Documentation
    Preparing search index...

    Function latheGeometry

    • A surface of revolution: the points profile revolved a full turn about the +Y axis (§53 "lathe").

      // A wine-glass bowl: radius against height, bottom first.
      const geometry = latheGeometry({
      points: [
      { x: 0.05, y: 0 },
      { x: 0.4, y: 0.3 },
      { x: 0.45, y: 0.7 },
      ],
      });

      This is the general case the sphere, the cylinder, and the cone are special cases of — they are written out separately because their analytic normals are exact and their option names are the ones a caller reaches for, not because they are different machines.

      Normals come from the profile, not from the faces: at profile point i the tangent is the central difference P[i+1] − P[i−1] (one-sided at the ends), and the outward normal in the (r, y) half-plane is that tangent turned a quarter turn, (tangent.y, −tangent.x). Revolved, that gives (n_r·cos θ, n_y, n_r·sin θ). Feeding a circular arc in therefore reproduces the sphere's exact radial normals, which is the property the tests check — except at the two end rings, where the difference is necessarily one-sided and the normal leans by half a segment. That is visible only if a profile ends on a silhouette; sphereGeometry exists partly so the one shape where it would matter has analytic normals instead.

      A profile point with x = 0 is a pole: its ring collapses and the quads touching it degenerate, exactly as at a sphere's poles. Negative radii are rejected (§85) — they turn the surface inside out rather than doing anything useful. Uv is u around and v = i / (points.length − 1) along the profile, so v = 0 is the first point given.

      Parameters

      Returns BufferGeometry