I would like to clip a Show-command using
Show[{pic1, pic2,...},RegionFunction -> Function[{x, y}, RegionMember[reg] {x, y} ]]
but Mathematica won't evaluate.
Is there a simple workaround to use RegionFunction
inside Show
?
Thanks!
You can use a white mask overlaid on top instead.
reg = Region@Disk[{1/3, 1/3}, 1/2];
pic1 = Graphics[{Red, Rotate[Triangle[], 30 Degree]}];
pic2 = Graphics[{Blue, Triangle[]}];
mask = BoundaryDiscretizeRegion[
RegionDifference[Rectangle[{-3, -3}, {3, 3}], reg],
MaxCellMeasure -> 1/30, MeshCellStyle -> {1 -> None, 2 -> White},
Background -> Transparent];
Show[{pic1, pic2, mask}, PlotRange -> {{-1/3, 1}, {-1/3, 1}}]