# Combining Graphics Primitives by Union, Intersection and Complement

**URL:** <https://community.wolfram.com/t/combining-graphics-primitives-by-union-intersection-and-complement/2757>\
**Category:** Questions\
**Tags:** mathematica, geometry, graphics-and-visualization\
**Created:** [July 24, 2014, 6:56pm UTC](https://community.wolfram.com/t/combining-graphics-primitives-by-union-intersection-and-complement/2757 "2014-07-24T18:56:28Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![marioweitzerat](https://avatars.discourse-cdn.com/v4/letter/m/e0b2c6/32.png) [@marioweitzerat](https://community.wolfram.com/u/marioweitzerat)\
**Post date:** [July 24, 2014, 6:56pm UTC](https://community.wolfram.com/t/combining-graphics-primitives-by-union-intersection-and-complement/2757/1 "2014-07-24T18:56:28Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![fkampas](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/fkampas/32/41217_2.png) [@fkampas](https://community.wolfram.com/u/fkampas)\
**Post date:** [July 25, 2014, 12:40pm UTC](https://community.wolfram.com/t/combining-graphics-primitives-by-union-intersection-and-complement/2757/2 "2014-07-25T12:40:13Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![sukrause](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/sukrause/32/41348_2.png) [@sukrause](https://community.wolfram.com/u/sukrause)\
**Post date:** [July 27, 2014, 11:19am UTC](https://community.wolfram.com/t/combining-graphics-primitives-by-union-intersection-and-complement/2757/3 "2014-07-27T11:19:37Z")

</div>

One wants to use Boole[] and bring the functions from this old post [Re: Fläche sich überlagernder Objekte](http://www.mathematica.ch/dmug-archive/2005/msg00269.html) 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}]]

```

 ![weitzer1.png](https://global.discourse-cdn.com/wolfram/original/3X/7/0/70f0d03b35d06752705493b845c55ccea76d3c1a.png)

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]

```

 ![weitzer2.png](https://global.discourse-cdn.com/wolfram/original/3X/e/e/eebdb03c449fc838cf9aceadf241d00076180cfa.png)
