Previous:Inside and Outside Main Index Next:Intersection

#### Union

The union of two objects.

The simplest kind of CSG is the `union`. The syntax is:

UNION:
`
  union {
` OBJECTS... [OBJECT_MODIFIERS...] `}`

Unions are simply glue used to bind two or more shapes into a single entity that can be manipulated as a single object. The image above shows the union of `A` and `B`. The new object created by the union operation can be scaled, translated and rotated as a single shape. The entire union can share a single texture but each object contained in the union may also have its own texture, which will override any texture statements in the parent object.

You should be aware that the surfaces inside the union will not be removed. As you can see from the figure this may be a problem for transparent unions. If you want those surfaces to be removed you'll have to use the `merge` operations explained in a later section.

The following union will contain a box and a sphere.

      union {

        box { <-1.5, -1, -1>, <0.5, 1, 1> }

        cylinder { <0.5, 0, -1>, <0.5, 0, 1>, 1 }

      }

Earlier versions of POV-Ray placed restrictions on unions so you often had to combine objects with `composite` statements. Those earlier restrictions have been lifted so `composite` is no longer needed. It is still supported for backwards compatibility.

Previous:Inside and Outside Main Index Next:Intersection