Documentation
    Preparing search index...

    Function tubeGeometry

    • A circular cross-section swept along a 3D polyline (§53 "tube").

      const geometry = tubeGeometry({
      path: [{ x: 0, y: 0, z: 0 }, { x: 1, y: 0.5, z: 0 }, { x: 2, y: 0, z: 0 }],
      radius: 0.05,
      });

      The frame is parallel-transported, not rebuilt per point from a fixed up-vector: an initial normal perpendicular to the first tangent is carried along the path by projecting it onto each new tangent's plane and renormalizing. A Frenet frame would flip the tube inside out wherever the curvature vanishes (a straight run) or reverses (an inflection), which is exactly what a cable, a pipe run, or a §119 winding path is full of.

      The tube is open at both ends: capping a swept path means answering what a cap looks like at an arbitrary orientation, and a caller who needs closed ends adds a sphere. Normals are the analytic radial direction in the local frame. Uv is u around the tube and v = i / (path.length − 1) along it.

      Parameters

      Returns BufferGeometry