Group Abstract Group Abstract

Message Boards Message Boards

Combining Graphics Primitives by Union, Intersection and Complement

GROUPS:

I have a problem which I cannot solve efficiently. I have a list of half-planes, disks and exteriors of disks and know that the intersection defines a bounded object, which I want to draw. RegionPlot doesn't work as it takes too long and is also very imprecise. You could say I would like to do the following; Given several graphics primitives (in my particular case these are all disks and squares in general position, i.e. special polygons) I want to draw that object one gets when combining these graphics primitives by some of the set operations union, intersection and complement. Is there any easy way to do that?

POSTED BY: Mario Weitzer
Answer
3 months ago

You could try using Reduce to calculate the intersection using constraint definitions of the half-planes, disks, etc. and then use RegionPlot on the result.

POSTED BY: Frank Kampas
Answer
3 months ago

One wants to use Boole] and bring the functions from this old post [Re: Fl├Ąche sich ├╝berlagernder Objekte into 3D to new life.

An overkill

    Graphics3D[
Table[If[Boole[ x/2 + (3 y)/5 + (5 z)/6 > 0 && -(x/2) + (3 y)/5 + (5 z)/6 < -(2/3) &&
x/2 - (3 y)/5 + (5 z)/6 < -(1/2) && x/2 + (3 y)/5 - (5 z)/6 > -(1/2)] == 1, Sphere[{x, y, z}]],
{x,0, 6, 0.2}, {y, -6, 6, 0.2}, {z, -6, 6, 0.2}]]

overkill

and obviously confused by the many (useless) inner points

ListSurfacePlot3D[
DeleteMissing[
Flatten[Table[
If[Boole[x/2 + (3 y)/5 + (5 z)/6 > 0 && -(x/2) + (3 y)/5 + (5 z)/6 < -(2/3) &&
x/2 - (3 y)/5 + (5 z)/6 < -(1/2) && x/2 + (3 y)/5 - (5 z)/6 > -(1/2)] == 1, {x, y, z},
Missing[]], {x, 0, 6, 0.1}, {y, -6, 6, 0.1}, {z, -6, 6, 0.1}],
2]], MaxPlotPoints -> 50]

confused

POSTED BY: Udo Krause
Answer
3 months ago