Skip to main content

Module boolean

Module boolean 

Source
Expand description

Boolean operations on two solids, built on top of remesh.

The algorithm is deliberately simple, and it is simple because remesh has already done the hard part. After remeshing, every face of either solid lies wholly inside the other, wholly outside it, or exactly on its boundary — no face straddles, because every intersection curve has been imprinted and every face it crossed has been split. That turns a boolean into a per-face classification followed by a keep/drop table.

  1. remesh the two solids against each other.
  2. Classify each face with classify_face, by taking a point strictly inside its trimmed region and asking where it sits relative to the other solid.
  3. Keep the faces the operator wants (see BooleanOp::keeps), reversing them where the operator needs the material on the other side.
  4. Assemble the survivors into a new solid and discard everything else.

Enums§

BooleanOp
Which boolean to perform.
FaceClassification
Where one solid’s face sits relative to the other solid.

Functions§

boolean
solid_a combined with solid_b under op, as a new solid in model.
classify_face
Where face_id sits relative to other_solid, decided at a single point strictly inside the face’s trimmed region.