MayaFlux 0.4.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ generate_tube() [1/2]

MAYAFLUX_API Kakshya::MeshData MayaFlux::Kinesis::generate_tube ( std::span< const glm::vec3 >  path,
const std::function< float(float t)> &  radius_fn,
uint32_t  radial_segments = 8,
bool  capped = false 
)

Extrude a circle along an arbitrary 3D path.

Each path point becomes a ring of radial_segments vertices. The ring frame is propagated along the path using parallel transport, which eliminates the twisting that naive normal-aligned cross-sections produce.

radius_fn maps the normalised path parameter t in [0,1] to a radius. A constant lambda gives a uniform tube. Any callable works: audio node output, envelope, position-dependent modulation.

Caps are flat and optional. An open tube (no caps) is suitable for chains and paths; a capped tube is suitable for solid cylindrical forms.

Parameters
pathOrdered world-space positions defining the spine. Minimum 2 points. Clamped to minimum 2.
radius_fnCallable: float(float t) returning radius at t.
radial_segmentsNumber of vertices per ring. Clamped to minimum 3.
cappedIf true, flat polygon caps are added at both ends.
Returns
MeshData ready for TRIANGLE_LIST draw.