Sphere Class
A unit sphere mapped by an arbitrary Transform.
- Typically, the stored matrix has orthogonal columns. In this case, if two columns have equal length, the resulting geometry is ellipsoidal; if all three columns have equal length, the resulting geometry is a sphere.
- Creating a Sphere without orthogonal columns is possible but not recommended, for the resulting geometry lacks portability; for example, such a Sphere cannot be represented as a DGN element (see createDgnSphere).
- An optional latitude sweep allows for partial spheres with or without caps.
- Compare to Ellipsoid, which has the same parameterization, but acts as a closed Clipper.
Extends
Implements
Methods
| Name | Description | |
|---|---|---|
| clone(): Sphere | return a deep clone | |
| cloneCenter(): Point3d | return (copy of) sphere center | |
| cloneLatitudeSweep(): AngleSweep | return (a copy of) the sphere's angle sweep. | |
| cloneLocalToWorld(): Transform | Return a (clone of) the sphere's local to world transformation. | |
| cloneTransformed(transform: Transform): undefined | Sphere | Return a transformed clone. | |
| cloneVectorX(): Vector3d | return the (full length, i.e. | |
| cloneVectorY(): Vector3d | return the (full length, i.e. | |
| cloneVectorZ(): Vector3d | return the (full length, i.e. | |
| constantUSection(uFraction: number): Arc3d | Return the Arc3d section at uFraction. | |
| constantVSection(vFraction: number): Loop | Return the Arc3d section at vFraction. | |
| dispatchToGeometryHandler(handler: GeometryHandler): any | Second step of double dispatch: call handler.handleSphere(this) |
|
| extendRange(range: Range3d, transform?: Transform): void | Extend a range to contain this sphere. | |
| getConstructiveFrame(): undefined | Transform | Construct a rigid coordinate frame from the local coordinate frame. | |
| isAlmostEqual(other: GeometryQuery): boolean | Test for same geometry in other |
|
| isSameGeometryClass(other: any): boolean | Test if other is a Sphere |
|
| maxAxisRadius(): number | Return the largest of the primary xyz axis radii | |
| maxIsoParametricDistance(): Vector2d | Directional distance query | |
| strokeConstantVSection(v: number, fixedStrokeCount?: number, options?: StrokeOptions): LineString3d | Return strokes for the elliptical arc cross-section at latitude sweep fraction v. | |
| trueSphereRadius(): undefined | number | Test if the geometry is a true sphere taking the transform (which might have nonuniform scaling) is applied. | |
| tryTransformInPlace(transform: Transform): boolean | Transform the sphere in place. | |
| uFractionToRadians(u: number): number | Return the longitude (in radians) all fractional u. | |
| uvFractionToPoint(uFraction: number, vFraction: number, result?: Point3d): Point3d | Evaluate as a uv surface | |
| uvFractionToPointAndTangents(uFraction: number, vFraction: number, result?: Plane3dByOriginAndVectors): Plane3dByOriginAndVectors | Evaluate as a uv surface, returning point and two vectors. | |
| vFractionToRadians(v: number): number | Return the latitude (in radians) all fractional v. | |
| createCenterRadius(center: Point3d, radius: number, latitudeSweep?: AngleSweep, capped?: boolean): Sphere Static | Create from center and radius, with optional restricted latitudes. | |
| createDgnSphere(center: Point3d, vectorX: Vector3d, vectorZ: Vector3d, radiusXY: number, radiusZ: number, latitudeSweep?: AngleSweep, capped?: boolean): undefined | Sphere Static | Create a sphere from the typical parameters of the DGN file. | |
| createEllipsoid(localToWorld: Transform, latitudeSweep?: AngleSweep, capped?: boolean): undefined | Sphere Static | Create an ellipsoid which is a unit sphere mapped to position by an (arbitrary, possibly skewed and scaled) transform. | |
| createFromAxesAndScales(center: Point3d, axes: Matrix3d, radiusX: number, radiusY: number, radiusZ: number, latitudeSweep?: AngleSweep, capped?: boolean): undefined | Sphere Static | Create a sphere. |
Inherited methods
| Name | Inherited from | Description |
|---|---|---|
| range(transform?: Transform, result?: Range3d): Range3d Inherited | SolidPrimitive | Return the range of the entire GeometryQuery tree. |
| tryTranslateInPlace(dx: number, dy: number = 0.0, dz: number = 0.0): boolean Inherited | SolidPrimitive | Try to move the geometry by dx,dy,dz. |
| areAlmostEqual(a: GeometryQuery, b: GeometryQuery): boolean Static Inherited | SolidPrimitive | Apply instance method isAlmostEqual if both are defined. |
Properties
| Name | Type | Description | |
|---|---|---|---|
| isClosedVolume Accessor ReadOnly | boolean | * A sphere is can be closed two ways: | |
| latitudeSweepFraction Accessor ReadOnly | number | Return the latitude sweep as fraction of south pole to north pole. | |
| solidPrimitiveType Readonly | "sphere" | String name for schema properties |
Inherited properties
| Name | Type | Inherited from | Description |
|---|---|---|---|
| _capped Protected Inherited | boolean | SolidPrimitive | Flag indicating whether cap region is considered closed (i.e. |
| capped Accessor Inherited | boolean | SolidPrimitive | Whether this is a capped solid. |
| children Accessor Inherited ReadOnly | undefined | GeometryQuery[] | SolidPrimitive | Return GeometryQuery children for recursive queries. * leaf classes do not need to implement. |
| geometryCategory Readonly Inherited | "solid" | SolidPrimitive | String name for schema properties. |
Defined in
- solid/Sphere.ts Line 37
Last Updated: 28 October, 2025
Found something wrong, missing, or unclear on this page? Raise an issue in our repo.