Grainy 2D RegionIntersection Plot: How can I make it smoother?
In addtion to Carl's answer, you can also force to rasterize the image with customized resolution. Takes longer but creates higher resolution bitmap images.
g = Show[Graphics[{Red, rDisk}], Graphics[{Blue, bDisk}],
Graphics[{Green, gDisk}],
Graphics[{Blend[{Red, Blue}, 0.5], BoundaryDiscretizeRegion[rbDisk]}],
Graphics[{Blend[{Red, Green}, 0.5], BoundaryDiscretizeRegion[rgDisk]}],
Graphics[{Blend[{Green, Blue}, 0.5], BoundaryDiscretizeRegion[gbDisk]}],
Graphics[{White, BoundaryDiscretizeRegion[rgbDisk]}]];
Show[
Rasterize[g, ImageResolution -> 1000],
ImageSize -> Medium
]
You can use BoundaryDiscretizeRegion
instead of DiscretizeRegion
to avoid the mesh lines when using Antialiasing->True
:
Graphics[{
{Red, rDisk},
{Blue, bDisk},
{Green, gDisk},
Antialiasing->True,
BoundaryDiscretizeRegion[rbDisk, MeshCellStyle->{2->Blend[{Red, Blue}]}],
BoundaryDiscretizeRegion[rgDisk, MeshCellStyle->{2->Blend[{Red, Green}]}],
BoundaryDiscretizeRegion[gbDisk, MeshCellStyle->{2->Blend[{Green, Blue}]}],
BoundaryDiscretizeRegion[rgbDisk, MeshCellStyle->{2->White}]
}]
pts={AngleVector[60°],{1,0},{0,0}};
colors=Join[{r,g,b}={Red,Green,Blue},Blend[#,0.5]&/@{{r,g},{r,b},{g,b}},{White}];
regions=BoundaryDiscretizeRegion/@RegionIntersection/@Rest@Subsets[Disk/@pts];
Graphics[Thread[{EdgeForm/@colors,colors,regions}]]
or
Graphics[Thread[{colors, MeshPrimitives[#,2]&/@regions}]]
If need faster speed, I prefer use Graphics`PolygonUtils`PolygonIntersection
Manipulate[
Graphics[{
Thread[{{Red,Green,Blue,Yellow,Magenta,Cyan,White},
Rest@Subsets[Polygon@CirclePoints[#,1,100.]&/@pts]
}]/.{c_, p:{_Polygon,__}}:>{EdgeForm[c],c,Graphics`PolygonUtils`PolygonIntersection[p]}
},PlotRange->2.5,Background->Black,ImageSize->Large],
{{pts,CirclePoints[1/√3,3]},Locator}]