waterfall-cad-0.6.0.0: Declarative CAD/Solid Modeling Library
Safe HaskellNone
LanguageHaskell2010

Waterfall.Booleans

Description

Constructive Solid Geometry \(CSG\) operations on Solid, and Shape.

Synopsis

Documentation

union3D :: Solid -> Solid -> Solid Source #

Take the sum of two solids

The region occupied by either one of them.

difference3D :: Solid -> Solid -> Solid Source #

Take the difference of two solids

The region occupied by the first, but not the second.

intersection3D :: Solid -> Solid -> Solid Source #

Take the intersection of two solids

The region occupied by both of them.

complement :: Solid -> Solid Source #

Invert a Solid, equivalent to not in boolean algebra.

The complement of a solid represents the solid with the same surface, but where the opposite side of that surface is the "inside" of the solid.

Be warned that complement emptySolid does not appear to work correctly.

unions3D :: [Solid] -> Solid Source #

Take the sum of a list of solids

May be more performant than chaining multiple applications of union3D

intersections3D :: [Solid] -> Solid Source #

Take the intersection of a list of solids

May be more performant than chaining multiple applications of intersection3D

class Boolean a where Source #

Boolean Algebras, with an "empty" value.

Minimal complete definition

union, difference, intersection, empty

Methods

union :: a -> a -> a Source #

Take the union of two objects

The region occupied by either one of them.

difference :: a -> a -> a Source #

Take the difference of two objects

The region occupied by the first, but not the second.

intersection :: a -> a -> a Source #

Take the intersection of two objects

The region occupied by both of them.

empty :: a Source #

The empty object (identity for union, annihilator for intersection)

Represents a region of space containing no volume or area.

For union: empty union x = x union empty = x For intersection: empty intersection x = x intersection empty = empty

unions :: [a] -> a Source #

Take the union of a list of objects

May be more performant than chaining multiple applications of union.

intersections :: [a] -> a Source #

Take the intersection of a list of objects

May be more performant than chaining multiple applications of intersection.