Skip to main content

Crate geop_lib_booleans

Crate geop_lib_booleans 

Source
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.
RemeshParams
Every tunable remesh and its phases need. Bundled rather than passed positionally: the phases don’t share one tolerance (see curve_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_sides of the extrude and revolve); the error says where the tool ran on, for one that does not.

Functions§

boolean
solid_a combined with solid_b under op, as a new solid in model.
boolean_up_to_next
Like boolean — target combined with tool — but “up to next”: only the first piece of tool its face start reaches is combined.
combine_tools
Combines the tools built, one after the other, as how says, as the step step, whose names namer builds: the result is named namer’s root, and what the k-th tool’s combination creates is named after combine(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 round Reach::RunsOn, and leaves model part 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 a and b onto each other: every face of each is divided along the curves where the other’s boundary crosses it, and both are kept, sharing nothing. Returns a’s edges along those curves.
imprint_on_face
Divides face along the curves where the boundaries of the bodies tools cross 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 tool its face start reaches outside stops — up to the next face of any of them — as a solid of its own, named namer’s root, stops left as they are: what a new body going up to the next face is. Reach::RunsOn, as boolean_up_to_next does, if nothing stops the tool before its face end.
remesh
Prepare body_a and body_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 a and b cross, 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 body crosses the plane plane (through its origin, along its u and v), as a wire, the body left as it is: section of the body and a square of the plane reaching past the whole body. The square’s corners and sides are named N(plane,v0) … and N(plane,e0) …, its face N(plane). Fails, as section does, leaving the model as it was.
split
Splits solid along the sheet sheet into 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 sheet up to the next face of any of targets: keeps the piece of it that its edges named start lie on — up to where it meets their boundary — and drops the rest. targets are not changed.