Documentation
    Preparing search index...

    Function torusGeometry

    • A torus lying in the XZ plane, its axis along +Y, centred on the origin (§53 "torus").

      const geometry = torusGeometry({ radius: 1, tubeRadius: 0.25 });
      
      P(u, v) = ((R + r·cos v)·cos u,  r·sin v,  (R + r·cos v)·sin u)
      N(u, v) = (cos v·cos u,  sin v,  cos v·sin u)
      

      — with u around the main ring and v around the tube's cross-section, both from 0 to 2π. The normal is the analytic one, so it is exact at every sample rather than at the ones a face-average happens to get right; v = 0 is the outer equator, which is where a texture's bottom edge lands.

      XZ rather than XY so the ring lies flat on the ground plane of a Y-up world (§7a) — a gear, a bearing race, a rotor lamination — and a torus that has to stand up is rotated by its node.

      Parameters

      Returns BufferGeometry