Expand description
Boolean operations on solids.
remesh imprints the two solids’ boundaries onto each other (splitting
edges at coincidences, tracing face x face intersection curves) so that
boolean can classify and keep the right faces for union,
intersection, or difference. Both work on a geop_ops_model::NamedModel,
and naming describes the stable names they give to everything they
create. split cuts a solid into pieces with a sheet, imprinting it the
same way. imprint divides two bodies along where each crosses the
other and keeps both; imprint_on_face divides one face along the
curves where other bodies cross it. section makes those curves a
wire. combine_tools combines the tools a step built as its
geop_ops_model::Combine says: the whole of each, or only up to the next
face of the solid it meets (boolean_up_to_next, trim_up_to_next).
scenes is test-scene scaffolding, built from basic shapes, shared by
the modules’ tests.
Structs§
- Origins
- What the faces and edges of two remeshed bodies came from: the name each
had before, or, for a piece split off one, the name that one had — its
origin (see
naming). Entities created otherwise, and since deleted, may be missing or left over. - Remesh
Params - Every tunable
remeshand its phases need. Bundled rather than passed positionally: the phases don’t share one tolerance (seecurve_curve_min_subdivision_size’s own note below), so the list is long enough that positional arguments stop being readable at the call site — and each field’s meaning is documented once here instead of in every signature it’s threaded through.
Enums§
- Reach
- What combining a tool up to the next face came to: stopped all round,
and what that left — or not, the target meeting part of the profile, or
none, and the rest going on past it to the tool’s end. A caller may then
go another way (see
combine_sidesof the extrude and revolve); the error says where the tool ran on, for one that does not.
Functions§
- boolean
solid_acombined withsolid_bunderop, as a new solid inmodel.- boolean_
up_ to_ next - Like
boolean—targetcombined withtool— but “up to next”: only the first piece oftoolits facestartreaches is combined. - combine_
tools - Combines the
toolsbuilt, one after the other, ashowsays, as the stepstep, whose namesnamerbuilds: the result is namednamer’s root, and what thek-th tool’s combination creates is named aftercombine(E)— scoped by the tool’s own scope, if it has one. An empty result — an intersection with a solid the new one does not touch — leaves no solid, and no tool. A tool going up to the next face that nothing stops all roundReach::RunsOn, and leavesmodelpart way through: a caller going another way tries on a copy. - faces_
classified - How many faces this thread’s booleans have classified at points of their own, against the other solid, ever: what classifying costs grows with this, so a test can bound the work of a cut by the faces it touches rather than time it.
- imprint
- Imprints the bodies
aandbonto each other: every face of each is divided along the curves where the other’s boundary crosses it, and both are kept, sharing nothing. Returnsa’s edges along those curves. - imprint_
on_ face - Divides
facealong the curves where the boundaries of the bodiestoolscross it, and returns the edges imprinted there. The tools are consumed; nothing else of the face’s body changes but the boundary edges of the face being split where a curve ends on them. - piece_
up_ to_ next - The first piece of
toolits facestartreaches outsidestops— up to the next face of any of them — as a solid of its own, namednamer’s root,stopsleft as they are: what a new body going up to the next face is.Reach::RunsOn, asboolean_up_to_nextdoes, if nothing stops the tool before its faceend. - remesh
- Prepare
body_aandbody_b’s topology for a boolean operation or a split: every coincidence between them (vertex/vertex, vertex/edge, edge/edge, edge/face) is resolved into shared topology, so that afterwards the two bodies meet only along entities they genuinely share. Either may be a sheet: imprinting asks nothing of a body but its faces, edges and vertices. - section
- The curves where the boundaries of the bodies
aandbcross, as a wire, both bodies left as they are. Where a face of one lies on a face of the other, the outline of what they share is among the curves. - section_
by_ plane - The curves where the boundary of the body
bodycrosses the planeplane(through its origin, along itsuandv), as a wire, the body left as it is:sectionof the body and a square of the plane reaching past the whole body. The square’s corners and sides are namedN(plane,v0)… andN(plane,e0)…, its faceN(plane). Fails, assectiondoes, leaving the model as it was. - split
- Splits
solidalong the sheetsheetinto the pieces it cuts the solid into, each a solid of its own. The solid is consumed; the sheet is left as it is — a copy of it does the cutting. - trim_
up_ to_ next - Trims the sheet
sheetup to the next face of any oftargets: keeps the piece of it that its edges namedstartlie on — up to where it meets their boundary — and drops the rest.targetsare not changed.