Exit Full View

FooCAD / src / dist / extensions / uk.co.nickthecoder.foocad / compound / v1 / help.txt

We often want to build a shape from many smaller shapes.

Instead of :

    val a = Circle( 10 ).leftTo(0)
    val b = Cube( 20 ).center()
    return a + b

Use this pattern instead :

    Compound().apply {
        + Circle( 10 ).leftTo(0)
        + Cube( 20 ).center()
    }.build()

You can also use the unary minus operator to cut out parts of the result.

_Cavities_

Compound can also be used with _cavities_, by passing `true` into the constructor.

The unary operators + and - will then use Cavity.and() / Cavity.remove()
instead of creating simple unions and differences.