Skip to main content

Module revolve

Module revolve 

Source
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 (all P = profile.len() - 1 row 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_at around the z-axis itself (origin = (0, 0, 0)).
revolve_at
Revolve profile — an open chain of curves in the (r, z) half-plane r >= 0, starting and ending on the axis (r = 0), each clamped and on the domain [0, 1] — 360 degrees around a vertical axis through origin (parallel to the z-axis), producing a closed, manifold solid of exactly 4 * profile.len() faces (no leftover degenerate one) — origin is added to every generated point, so the profile’s own z values are relative to origin’s z. See the module doc for the overall column-by-column strategy, and revolve_at_oriented for how the result is named.
revolve_at_oriented
Like revolve_at, but revolves around coordinate_system’s own w axis instead of always the ambient z-axis: a profile point (r, z) maps to coordinate_system.to_xyz([r cos, r sin, z]) — u/v span the equatorial plane (the angle-0 direction and its 90-degree-around-w follower, respectively) and w is the revolution axis, exactly the same role extrude’s own coordinate system’s w plays as its sweep direction. Every position this builds still ultimately comes from this one pos/centers pair — 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.