Skip to main content

Module nurbs_solid

Module nurbs_solid 

Source
Expand description

The NURBS Solid’s cage resolver, which the engine’s cage editor reads its handles through (resolve_cage, primitive_cage, has_persisted_cage). NS — NURBS Solid: a smooth body shaped by a control cage.

The feature wraps a ControlCage around a primitive (primitive, sizeX/Y/Z, segments, rings) and builds the bicubic B-spline solid the cage controls — one closed face with a seam edge and two pole edges, named {id} like the sphere’s. The editor deforms the cage by moving its points and refines it by inserting loops; both write the edited cage to persistentData.cage, and from then on THAT cage is the body — the primitive params are the starting shape only, until the editor’s Reset drops the persisted cage. resolve_cage is the ONE place that decision is made, and the editor reads its points through it, so what is drawn as a handle is exactly what the kernel builds from.

The cage lives in world space: there is no transform param, because a point dragged in the viewport must be the point the kernel builds from, not a point seen through a bake. Move the whole body by selecting every point, or transform the result downstream.

Constants§

DEFAULT_PRIMITIVE
The primitive a fresh feature wraps.
DEFAULT_RINGS
DEFAULT_SEGMENTS
DEFAULT_SIZE
PERSISTENT_KEY
The persistentData key the edited cage is stored under.

Functions§

context_applicable
Context-bar applicability (crate::feature_pipeline::context_offer): never offered from a selection (no reference inputs).
execute
has_persisted_cage
Whether the document carries an edited cage (the primitive params are then only the shape it started from).
primitive_cage
The initial cage the params describe, ignoring any persisted cage — what Reset returns to.
resolve_cage
The cage this feature builds from: the persisted one when the document has it, otherwise the primitive the params describe. The editor reads its handles through this, so a handle is always a point the kernel builds from.
schema