Message Boards Message Boards

1
|
6722 Views
|
2 Replies
|
1 Total Likes
View groups...
Share
Share this post:

Combining Graphics Primitives by Union, Intersection and Complement

Posted 11 years ago

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
2 Replies

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

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
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract