nurbsSurface.sphere

An exact sphere of a radius about a centre, as a rational degree-(2, 2) surface.

GeometricSince 0.4.0

Usage

TypeScript
NurbsSurface.sphere(radius: number, center?: Point3): Result<NurbsSurface>

Parameters

  • radiusnumber

    The radius, finite and > 0. Required. In model.

  • centerPoint3

    The centre. Default Point3.origin. In model.

Returns

Ok with a 9 × 5 rational surface on [0, 1] × [0, 1]: u runs round the equator from +x towards −z (counter-clockwise about +y, closing on a seam), v from the pole at −y to the pole at +y.

Errors

Guarantees

  • every pointAt(u, v) is at radius from center to 1e-12 (Point3.distance)
  • normalAt points outward (Vector3.dot(normal, point − center) > 0), and is null at the poles
  • The same result on every machine.

Example

TypeScript
const r = NurbsSurface.sphere(2, Point3.of(1, -2, 3)) // → every point 2 from the centre, once loadGeometryKernel() has run

See also