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 inb, and what is in both. Arbitrary set expressions compose by fusing a selection of these.
Enums§
- Recharted
- What
rechart_clear_of_polesdid 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 commonat a stated fuzz.- cut
- The first solid with the second removed.
- cut_
by_ mesh_ region - Cut
shapeby the break surfaceregionmarks onmesh, thickened byoffsetto each side, and keep the pieces on thekeepside. - cut_
fuzzy cutat a stated fuzz.- cut_
seated cut, wherebis a blend’s wedge, or a compound of wedges standing apart, that sits flush ona: each wedge bounded by planar seats lying on faces ofaand 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 ofa, 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 ofa. Where every seat lies within the face it is on, facing its way, and no other face ofareaches 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 ofaof its radius rounding the face it rounds is trimmed so as its part insidea, cut back at the mitre where the two blends cross. Wherebmixes 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 ofb. Otherwise, and whereaorbis anything else, this iscut.- fuse
- The union of two solids.
- fuse_
fuzzy fusewith geometry withinfuzzof touching counted as touching.- fuse_
seated fuse, wherebis a concave rim’s blend wedge, or a compound of such wedges standing apart, that sits flush ona: each an annulus of a plane and a band of a cylinder about one axis lying on faces ofa, 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, ascut_seatedreads them, its seats lying on faces ofafacing against them. Where every seat lies within the face it is on and no other face ofareaches 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. Wherebmixes 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 ofb. Otherwise, and whereaorbis anything else, this isfuse.- make_
periodic - A shape repeated
counttimes 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
facein place where it is a sphere face whose trim comes withinPOLE_MARGINof 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
facesfromsolidand 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
shapecrossplane, each trimmed to the face it lies on. - self_
union - The union of the material
solidencloses, 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.