Expand description
Revolve a planar profile, given as (r, z) points in the half-plane `r
= 0
(whose first and last points must be poles,r = 0), 360 degrees around a vertical axis, entirely from euler operations — built one angular quadrant *column* at a time (allP = profile.len() - 1row faces of a given 90-degree wedge, before moving to the next wedge), exactly the same strategy [sphere_octants`](super::sphere::sphere_octants) uses for its own dedicated (exact, doubly-curved) construction, just generalized to an arbitrary profile instead of a fixed 2-segment pole-equator-pole one.
One persistent face (mvfs’s own, playing the same role extrude’s
placeholder does) always holds whatever’s still left to close off. The
very first column (meridian 0, the profile’s own P-edge chain, straight
in the profile direction) is bootstrapped directly from mvfs’s vertex.
Each of the next 2 columns grows a fresh meridian one angular “beam” arc
at a time (one per non-pole row) and immediately closes every row’s own
degree-(2, 1) quadrant face (mve for the beam, mef — minting that
row’s new meridian edge as it goes — for the face) against the previous
meridian. The 4th and last column closes back onto the very first
meridian’s own reversed edges instead of growing a new one — only the
interior beams (angle 3 -> 0) are still new, one per non-last row’s own
closing mef — and its very last row needs no mef at all: by the time
every other row of that column has closed, its own boundary is already
sitting complete on the placeholder face, so replace_face alone turns
it real. No separate degenerate cap is ever needed, unlike a naive
row-by-row sweep (which always leaves one extra zero-area face behind at
the final pole).
A profile row at r = 0 (only ever the first/last, both required poles)
collapses to a single shared vertex — no angular beam is grown for it at
all, and its neighboring rows’ own meridian edges connect straight to
that one shared vertex instead, both euler ops here (mve, mef) taking
existing vertices as-is rather than minting fresh ones.
Functions§
- revolve
revolve_ataround the z-axis itself (origin = (0, 0, 0)).- revolve_
at - Revolve
profile— an open chain of curves in the(r, z)half-planer >= 0, starting and ending on the axis (r = 0), each clamped and on the domain[0, 1]— 360 degrees around a vertical axis throughorigin(parallel to the z-axis), producing a closed, manifold solid of exactly4 * profile.len()faces (no leftover degenerate one) —originis added to every generated point, so the profile’s ownzvalues are relative toorigin’sz. See the module doc for the overall column-by-column strategy, andrevolve_at_orientedfor how the result is named. - revolve_
at_ oriented - Like
revolve_at, but revolves aroundcoordinate_system’s ownwaxis instead of always the ambient z-axis: a profile point(r, z)maps tocoordinate_system.to_xyz([r cos, r sin, z])—u/vspan the equatorial plane (the angle-0 direction and its 90-degree-around-wfollower, respectively) andwis the revolution axis, exactly the same roleextrude’s own coordinate system’swplays as its sweep direction. Every position this builds still ultimately comes from this onepos/centerspair — the rest of the function (euler operations, pcurves) has no notion of x/y/z at all, so generalizing the axis needed no changes anywhere else.