/** @packageDocumentation * @module Solid */ import { Arc3d } from "../curve/Arc3d"; import { GeometryQuery } from "../curve/GeometryQuery"; import { LineString3d } from "../curve/LineString3d"; import { Loop } from "../curve/Loop"; import { StrokeOptions } from "../curve/StrokeOptions"; import { AngleSweep } from "../geometry3d/AngleSweep"; import { GeometryHandler, UVSurface } from "../geometry3d/GeometryHandler"; import { Matrix3d } from "../geometry3d/Matrix3d"; import { Plane3dByOriginAndVectors } from "../geometry3d/Plane3dByOriginAndVectors"; import { Vector2d } from "../geometry3d/Point2dVector2d"; import { Point3d, Vector3d } from "../geometry3d/Point3dVector3d"; import { Range3d } from "../geometry3d/Range"; import { Transform } from "../geometry3d/Transform"; import { SolidPrimitive } from "./SolidPrimitive"; /** * 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]]. * @public */ export declare class Sphere extends SolidPrimitive implements UVSurface { /** String name for schema properties */ readonly solidPrimitiveType = "sphere"; private _localToWorld; private _latitudeSweep; /** Return the latitude (in radians) all fractional v. */ vFractionToRadians(v: number): number; /** Return the longitude (in radians) all fractional u. */ uFractionToRadians(u: number): number; /** Constructor CAPTURES inputs */ private constructor(); /** return a deep clone */ clone(): Sphere; /** * Transform the sphere in place. * * Fails if the transform is singular. */ tryTransformInPlace(transform: Transform): boolean; /** * Return a transformed clone. * * Fails if the transform is singular. */ cloneTransformed(transform: Transform): Sphere | undefined; /** * Construct a rigid coordinate frame from the local coordinate frame. * * The returned frame is right-handed, with perpendicular unit axes. * * Compare to [[cloneLocalToWorld]]. */ getConstructiveFrame(): Transform | undefined; /** Return the latitude sweep as fraction of south pole to north pole. */ get latitudeSweepFraction(): number; /** Create from center and radius, with optional restricted latitudes. */ static createCenterRadius(center: Point3d, radius: number, latitudeSweep?: AngleSweep, capped?: boolean): Sphere; /** Create an ellipsoid which is a unit sphere mapped to position by an (arbitrary, possibly skewed and scaled) transform. */ static createEllipsoid(localToWorld: Transform, latitudeSweep?: AngleSweep, capped?: boolean): Sphere | undefined; /** * Create a sphere from the typical parameters of the DGN file. * * This method normalizes the input vectors, squares `vectorX` against `vectorZ`, and scales the radii by the vectors' original lengths. * * These restrictions allow the sphere to be represented by an element in the DGN file. */ static createDgnSphere(center: Point3d, vectorX: Vector3d, vectorZ: Vector3d, radiusXY: number, radiusZ: number, latitudeSweep?: AngleSweep, capped?: boolean): Sphere | undefined; /** * Create a sphere. * * If `axes` is supplied, its columns are scaled by the radii to form the sphere's local frame. */ static createFromAxesAndScales(center: Point3d, axes: undefined | Matrix3d, radiusX: number, radiusY: number, radiusZ: number, latitudeSweep?: AngleSweep, capped?: boolean): Sphere | undefined; /** return (copy of) sphere center */ cloneCenter(): Point3d; /** return the (full length, i.e. scaled by radius) X vector from the sphere transform */ cloneVectorX(): Vector3d; /** return the (full length, i.e. scaled by radius) Y vector from the sphere transform */ cloneVectorY(): Vector3d; /** return the (full length, i.e. scaled by radius) Z vector from the sphere transform */ cloneVectorZ(): Vector3d; /** return (a copy of) the sphere's angle sweep. */ cloneLatitudeSweep(): AngleSweep; /** Test if the geometry is a true sphere taking the transform (which might have nonuniform scaling) is applied. */ trueSphereRadius(): number | undefined; /** * Return the largest of the primary xyz axis radii */ maxAxisRadius(): number; /** * Return a (clone of) the sphere's local to world transformation. * * Compare to [[getConstructiveFrame]]. */ cloneLocalToWorld(): Transform; /** Test if `other` is a `Sphere` */ isSameGeometryClass(other: any): boolean; /** Test for same geometry in `other` */ isAlmostEqual(other: GeometryQuery): boolean; /** * Return strokes for the elliptical arc cross-section at latitude sweep fraction v. * * Optional inputs control the number of strokes along the cross-section: * * If `fixedStrokeCount` is supplied, it is taken as the cross-section stroke count. * * If `fixedStrokeCount` is undefined, stroke count is computed by applying `options` to the cross-section. * * If neither input is supplied, the stroke count default is 16. * * In any case, stroke count is clamped to the interval [4,64]. * @param v fractional position along the sphere axis * @param fixedStrokeCount optional stroke count in u-direction * @param options optional stroke options in u-direction * @return strokes as line string */ strokeConstantVSection(v: number, fixedStrokeCount?: number, options?: StrokeOptions): LineString3d; /** Second step of double dispatch: call `handler.handleSphere(this)` */ dispatchToGeometryHandler(handler: GeometryHandler): any; /** * Return the Arc3d section at uFraction. For the sphere, this is a meridian arc. * @param uFraction fractional position along the equator. */ constantUSection(uFraction: number): Arc3d; /** * Return the Arc3d section at vFraction. For the sphere, this is a latitude circle. * @param vFraction fractional position along the sweep direction */ constantVSection(vFraction: number): Loop; /** Extend a range to contain this sphere. */ extendRange(range: Range3d, transform?: Transform): void; /** Evaluate as a uv surface * @param uFraction fractional position on minor arc (theta, longitude) * @param vFraction fractional position on major arc (phi, latitude) */ uvFractionToPoint(uFraction: number, vFraction: number, result?: Point3d): Point3d; /** Evaluate as a uv surface, returning point and two vectors. * @param uFraction fractional position on minor arc (theta, longitude) * @param vFraction fractional position on major arc (phi, latitude) */ uvFractionToPointAndTangents(uFraction: number, vFraction: number, result?: Plane3dByOriginAndVectors): Plane3dByOriginAndVectors; /** Return true if the solid's local z-axis is not perpendicular to its local xy-plane. */ get isSkew(): boolean; /** * * A sphere is can be closed two ways: * * full sphere (no caps needed for closure) * * incomplete but with caps * @return true if this is a closed volume. */ get isClosedVolume(): boolean; /** * Directional distance query * * u direction is around latitude circle at maximum distance from axis. * * v direction is on a line of longitude between the latitude limits. */ maxIsoParametricDistance(): Vector2d; } //# sourceMappingURL=Sphere.d.ts.map