Cut out circle out of circle

Perhaps Disk is more appropriate than Circle, if you want it to be filled:

Graphics[{Black, Disk[{0, 0}, 3], White, Disk[{0, 0}, 2]}]

enter image description here

I don't think this works the same way as pathfinder, but it is getting at similar effects. One of the main reasons for using pathfinder is that it joins the multiple paths together in order to create a single object that is easy to manipulate. In Mathematica it might be more common to give the object a name and then use that name whenever you wish to reproduce, move, or modify the object.

As an example with circles (rather than disks), consider:

doubleCircle[{x_, y_}] := {Black, Circle[{x, y}, 3], Circle[{x, y}, 2]}

which creates a ``double circle'' function. You can draw lots of such objects:

rand = RandomInteger[{1, 15}, {5, 2}]
Graphics[doubleCircle[#] & /@ rand]

enter image description here


You can use region functionality and do boolean operations, e.g. (borrowing from bills):

annulus[c_, r1_, r2_] := RegionDifference[Disk[c, r1], Disk[c, r2]]
fun[] := Module[{rand}, rand = RandomInteger[{1, 15}, {5, 2}];
  RegionPlot[RegionUnion @@ (annulus[#, 3, 2] & /@ rand), 
   AspectRatio -> Automatic, PlotStyle -> Red, 
   BoundaryStyle -> {Thickness[0.01], Yellow}, Background -> Black, 
   Frame -> None, PlotRange -> {{-5, 20}, {-5, 20}}, 
   PlotPoints -> 40]]

The following animation is made from tab=Table[fun[],20]:

enter image description here


You can control the thickness in this way.

Graphics[{Thickness[#], Circle[{0, 0}, 3]}] & /@ {0.1, 0.2, 0.3}

enter image description here

Tags:

Graphics