nurbsCurve.circle

An exact full circle on a plane, starting on its x axis and running counter-clockwise about its normal.

GeometricSince 0.4.0

Usage

TypeScript
NurbsCurve.circle(radius: number, plane?: Plane): Result<NurbsCurve>

Parameters

  • radiusnumber

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

  • planePlane

    The plane: the circle is centred on its origin. Default Plane.worldXY. In model.

Returns

Ok with a closed rational degree-2 curve of nine control points on the knot domain [0, 1]; the first and last points coincide.

Errors

Guarantees

  • length() = 2π · radius to about 1e-15 relative
  • every sample() point is at radius from plane.origin and on the plane
  • pointAt(domain.t0) = pointAt(domain.t1) = plane.origin + radius · plane.xAxis
  • The same result on every machine.

Example

TypeScript
const r = NurbsCurve.circle(1.5, Plane.worldZX) // → length 3π once loadGeometryKernel() has run

See also