Skip to main content

Crate ogeom_bool

Crate ogeom_bool 

Source
Expand description

Boolean operations.

Fuse, common, cut, section and split are one algorithm (general fuse) plus a selection predicate: every face of each solid is split by the other solid’s faces, the pieces are classified against the other solid, and a filter keeps the pieces the operation wants.

§One pipeline, any analytic face

The pipeline runs on solids whose faces are any surface the intersectors answer for (planes, cylinders, spheres, cones, tori), with the planar case as nothing more than the case where every curve is a line. Sections come from intersect_surfaces, exact with same-parameter pcurves where the projection has a closed form and marched and fitted to a stated tolerance where it does not. Paves (the points where sections meet boundary edges and each other) come from the exact curve/curve intersection. Every face is then split in its own parameter space by an arrangement of strands: polyline scaffolding, each naming the exact sub-curve it stands for, so the combinatorics run on polylines and the rebuilt result is exact curves, pcurves attached both sides, sewn back into shared topology.

Pieces are classified against the other solid by the exact ray classifier and the filters select: fuse keeps what is outside, common what is inside, cut flips the tool’s contribution. Same-domain contact (a piece lying on the other boundary) is resolved by whether the two solids’ outward normals agree there, where the contact’s edges can be imaged in the shared chart, and refused by name where they cannot. A tangential touch splits nothing and is carried as the contact curve it is.

§Sheets

A sheet (a face, a shell or a compound of those) runs the same pipeline with one side left out: its faces are split by the other argument’s, and the other argument’s faces only cut. common and cut classify the sheet’s pieces against a solid or a half space and keep those inside or outside it. split_sheet keeps every piece, unclassified. The kept pieces are sewn into shells with no closure asked of them.

Structs§

Cells
The three cells two solids cut space into, each one boolean’s answer: what is only in a, what is only in b, and what is in both. Arbitrary set expressions compose by fusing a selection of these.

Enums§

Recharted
What rechart_clear_of_poles did with a face.

Constants§

POLE_MARGIN
How near, in radians round the sphere’s centre, a sphere face’s trim may come to a pole of its chart, which it does not run through, before the face is re-charted. Beside a pole the trim’s image sweeps half a turn of longitude within twice its distance from the pole, and no fitted image follows it there.
POLE_TOUCHING
How close a pole may come to the other operand’s surfaces, as a fraction of the ball’s radius, before the chart is turned. A section a thousandth and a half of the radius beside a pole is already marched across the chart’s collapse and snapped onto the pole.

Functions§

cells
Split two solids into their three cells.
common
The intersection of two solids.
common_fuzzy
common at a stated fuzz.
cut
The first solid with the second removed.
cut_by_mesh_region
Cut shape by the break surface region marks on mesh, thickened by offset to each side, and keep the pieces on the keep side.
cut_fuzzy
cut at a stated fuzz.
cut_seated
cut, where b is a blend’s wedge, or a compound of wedges standing apart, that sits flush on a: each wedge bounded by planar seats lying on faces of a and one strip of a cylinder, the blend; or each a rim’s wedge, an annulus of a plane and a band of a cylinder about one axis lying on faces of a, and the quarter of a torus’s tube between them; or a piece of a rim’s wedge between two planar ends through its axis, at most half a turn, each seat and end lying on a face of a. Where every seat lies within the face it is on, facing its way, and no other face of a reaches into the wedge, the faces the seats lie on are trimmed along the wedge’s own edges and the blends close what is left: the general fuse is not run, and the result and its history are those it gives. A straight band’s wedge whose end runs, at a block’s corner, into a blend of a of its radius rounding the face it rounds is trimmed so as its part inside a, cut back at the mitre where the two blends cross. Where b mixes rims’ wedges with other lumps, each rim’s box standing further from every other lump’s than the boolean welds, the rims are trimmed out so and the other lumps cut from what is left, to the solid and history the general fuse gives cutting all of b. Otherwise, and where a or b is anything else, this is cut.
fuse
The union of two solids.
fuse_fuzzy
fuse with geometry within fuzz of touching counted as touching.
fuse_seated
fuse, where b is a concave rim’s blend wedge, or a compound of such wedges standing apart, that sits flush on a: each an annulus of a plane and a band of a cylinder about one axis lying on faces of a, facing against them, and the quarter of a torus’s tube between them; or a concave straight band’s wedge or a piece of a rim’s, as cut_seated reads them, its seats lying on faces of a facing against them. Where every seat lies within the face it is on and no other face of a reaches into the region the wedge lies in, the faces the seats lie on are trimmed along the wedge’s own edges and the blends close what is left: the general fuse is not run, and the result and its history are those it gives. Where b mixes such wedges with other lumps, each rim’s box standing further from every other lump’s than the boolean welds, the rims are filled so and the other lumps fused on to what is left, to the solid and history the general fuse gives fusing all of b. Otherwise, and where a or b is anything else, this is fuse.
make_periodic
A shape repeated count times along a direction at a period and fused into one: the periodic pattern as a composition of what exists.
make_volume
Solids from an unordered soup of faces: sew, demand closure, nest shells into solids and voids: the pipeline’s own final stages offered as a builder.
rechart_clear_of_poles
Re-chart face in place where it is a sphere face whose trim comes within POLE_MARGIN of a pole of its chart without running through it: the same sphere charted about the axis, among a ball’s candidate axes, whose poles stand furthest from the trim, its trim edges given images on that chart, and the seam and pole edges it needs. The surface, the edges and their curves are unchanged; only the chart and the pcurves are. A face whose trim runs through a pole (a meridian rim) or keeps clear of both is left untouched, read and not changed.
remove_faces
Remove faces from solid and close the openings from the neighbours’ own geometry.
section
The edges where the two solids’ boundaries cross.
section_face
The edges where the faces of shape cross plane, each trimmed to the face it lies on.
self_union
The union of the material solid encloses, where its boundary passes through itself: the regions it encloses twice made one, and its faces cut where they cross and trimmed back to the union’s boundary.
split_sheet
A sheet split where another sheet crosses it: the pieces, with history.