Skip to main content

Module extrude

Module extrude 

Source
Expand description

Extrude a closed planar profile — an outer loop plus any number of holes, each a closed chain of NURBS curves in the (u, v) plane of a coordinate system — one unit along its w to produce a solid, entirely from euler operations.

Orientation contract: outer must wind counter-clockwise, each hole clockwise, and coordinate_system must be left-handed (u x v = -w). Every side wall is parametrized (height, profile), so the normal it ends up with is w x d for a wall along profile direction d; that is the outward normal exactly under this combination. Hand it a right-handed basis and the whole solid comes out inside-out — still structurally valid, still renders, and rejected by validation::face_orientation::check_normals_point_outward. extrude_from_plane takes a right-handed plane instead and arranges this itself.

Profile curves: every curve must be clamped (start at its first control point, end at its last), have the domain [0, 1], and start exactly where the previous one in its loop ends; each loop needs at least two curves (every vertex of the solid sits at a curve joint). The curves may lie anywhere in the plane: the flat caps are sized to the profile.

[grow_ring] (mvfs/mvr + mve_from_vertex + mve) builds the outer ring directly on a placeholder (NurbSurface3D::everything()) face; mef (like mer, but the split-off ring is moved onto a brand new, real-surfaced face instead of staying as a second boundary of the same face) turns that ring into the bottom cap, leaving the same ring, traced the other way, on the placeholder face. Each hole is grown the same way, directly on the (now real) bottom cap instead — mvr gives it a fresh bare-vertex boundary there, and mer (like mef, but the split-off ring moves onto an already-existing face instead of a new one) moves its “other side” onto the placeholder face too, alongside the outer ring’s own. [build_side_walls] then advances every one of these rings straight up by w, closing off a side wall per curve — since the pcurves grow_ring/mer leave it were only ever valid for whatever face the ring was grown on, the very first thing it does is swap them all out (replace_pcurve) for the side walls’ own reusable convention — and leaves their top rings on the placeholder face, so replace_face can give it the real top surface (with the same holes) as the very last step.

Structs§

ExtrudeNames
The names one extrude gives to what it builds from one region, following geop_core_part’s scheme: N is the operation’s [Namer], X a profile curve’s name and P a joint’s (see Profile).

Functions§

extrude
Extrude outer (counter-clockwise) with holes (clockwise) one unit along coordinate_system’s w, which must be left-handed (see the module docs). Everything built is named after outer‘s and the holes’ curves and joints, see ExtrudeNames.
extrude_from_plane
Extrude a profile drawn on a right-handed plane (u x v along its normal w) by distance along w — backwards for a negative distance. outer winds counter-clockwise and the holes clockwise, as seen in the plane’s own (u, v). The start cap lies on plane.