import { GeometryQuery } from "../curve/GeometryQuery"; import { LineString3d } from "../curve/LineString3d"; import { Loop } from "../curve/Loop"; import { StrokeOptions } from "../curve/StrokeOptions"; import { GeometryHandler, UVSurface, UVSurfaceIsoParametricDistance } from "../geometry3d/GeometryHandler"; 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 cone with axis along the z-axis of a (possibly skewed) local coordinate system. * * The curved surface of the cone `C` with axis `vectorZ = centerB - centerA` is parameterized over (u,v) in [0,1]x[0,1] by * `C(u,v) = centerA + vFractionToRadius(v) * (cos(u * 2pi) * vectorX + sin(u * 2pi) * vectorY) + v * vectorZ`. * * Either radius may be zero, but they may not both be zero. * * Cross section size is determined by the lengths of `vectorX`, `vectorY`, and the radii. * * If `vectorX` and `vectorY` are orthonormal, the cross sections are circular, with sections at v = 0 and v = 1 having radius * `radiusA` and `radiusB`, respectively; otherwise, the cross sections are elliptical. * * The stored matrix encapsulates `vectorX`, `vectorY`, and `vectorZ` in the respective columns. Typically the first two columns * are orthogonal and unit length, and the last is full length. * * Creating a Cone without orthogonal xy-axes of equal length is possible, but not recommended, for the resulting geometry * lacks portability; for example, such a Cone cannot be represented as a DGN element (see [[createDgnCone]]). * @public */ export declare class Cone extends SolidPrimitive implements UVSurface, UVSurfaceIsoParametricDistance { /** String name for schema properties */ readonly solidPrimitiveType = "cone"; /** Local to world transform. Axes may have any nonzero length and may be non-perpendicular. */ private _localToWorld; /** Nominal cross sectional radius at z=0 (scales the cone's xy-axes). */ private _radiusA; /** Nominal cross sectional radius at z=1 (scales the cone's xy-axes). */ private _radiusB; /** Maximum of _radiusA and _radiusB. */ private _maxRadius; /** Constructor, inputs CONSUMED. */ protected constructor(map: Transform, radiusA: number, radiusB: number, capped: boolean); /** Return a clone of this Cone. */ clone(): Cone; /** Return a coordinate frame (right handed unit vectors) * * origin at center of the base circle. * * base circle in the xy plane * * z axis by right hand rule. */ getConstructiveFrame(): Transform | undefined; /** Apply the transform to this cone's local to world coordinates. * * Note that the radii are not changed. Scaling is absorbed into the frame. * * This fails if the transformation is singular. */ tryTransformInPlace(transform: Transform): boolean; /** * Create a clone and immediately transform the clone. * * This fails if the transformation is singular. */ cloneTransformed(transform: Transform): Cone | undefined; /** * Create a right circular cylinder or cone from the given base centers and radii. * * The circular cross sections are perpendicular to the axis line between the centers. * * Both radii must be of the same sign, and at least one radius must be nonzero. * * Negative radii are accepted to create an interior surface, however the downstream effects of this, combined with capping, may be problematic. */ static createAxisPoints(centerA: Point3d, centerB: Point3d, radiusA: number, radiusB: number, capped?: boolean): Cone | undefined; /** * Create a general cone from cross sections parallel to the plane spanned by the given vectors. * * Circular cross sections are indicated by perpendicular vectors of the same length. * * Elliptical cross sections are indicated by non-perpendicular vectors, or vectors of different lengths. * * Cross sectional planes do not have to be perpendicular to the axis line between centers. * * Cross section size is affected both by the given vector lengths and radii. To avoid unexpected scaling, * pass orthonormal vectors for circular cross sections, or unit radii for elliptical cross sections. * * There is no validation of the input radii. For best results, they should be nonnegative, and at least one should be nonzero. */ static createBaseAndTarget(centerA: Point3d, centerB: Point3d, vectorX: Vector3d, vectorY: Vector3d, radiusA: number, radiusB: number, capped?: boolean): Cone; /** * Create a circular cone from the typical parameters of the DGN file. * * This method calls [[createBaseAndTarget]] with normalized vectors, `vectorY` squared against `vectorX`, and * `radiusA` and `radiusB` scaled by the original length of `vectorX`. * * These restrictions allow the cone to be represented by an element in the DGN file. */ static createDgnCone(centerA: Point3d, centerB: Point3d, vectorX: Vector3d, vectorY: Vector3d, radiusA: number, radiusB: number, capped?: boolean): Cone | undefined; /** (Property accessor) Return the center point at the base plane */ getCenterA(): Point3d; /** (Property accessor) */ getCenterB(): Point3d; /** (Property accessor) Return the x vector in the local frame */ getVectorX(): Vector3d; /** (Property accessor) Return the y vector in the local frame */ getVectorY(): Vector3d; /** (Property accessor) return the radius at the base plane */ getRadiusA(): number; /** (Property accessor) return the radius at the top plane */ getRadiusB(): number; /** (Property accessor) return the larger of radiusA and radiusB */ getMaxRadius(): number; /** (Property accessor) return the radius at fraction `v` along the axis */ vFractionToRadius(v: number): number; /** (Property accessor) test if `other` is an instance of `Cone` */ isSameGeometryClass(other: any): boolean; /** (Property accessor) Test for nearly equal coordinate data. */ isAlmostEqual(other: GeometryQuery): boolean; /** Second step of double dispatch: call `handler.handleCone(this)` */ dispatchToGeometryHandler(handler: GeometryHandler): any; /** * return strokes for a cross-section (elliptic arc) at specified fraction v along the axis. * * fixedStrokeCount takes priority over stroke options. * * The linestring is created by LineString3d.createForStrokes (fixedStrokeCount, options), which sets up property according to the options: * * optional fractions member * * optional uvParams. uvParams are installed as full-scale distance parameters. * * optional derivatives. * @param v fractional position along the cone axis * @param fixedStrokeCount optional stroke count. * @param options optional stroke options. */ strokeConstantVSection(v: number, fixedStrokeCount?: number, options?: StrokeOptions): LineString3d; /** * Return the Arc3d section at vFraction * @param vFraction fractional position along the sweep direction */ constantVSection(vFraction: number): Loop; /** Extend `rangeToExtend` so it includes this `Cone` instance. */ extendRange(rangeToExtend: Range3d, transform?: Transform): void; /** Evaluate a point on the Cone surfaces, with * * v = 0 is the base plane. * * v = 1 is the top plane * * u = 0 to u = 1 wraps the angular range. */ uvFractionToPoint(uFraction: number, vFraction: number, result?: Point3d): Point3d; /** Evaluate a point tangent plane on the Cone surfaces, with * * v = 0 is the base plane. * * v = 1 is the top plane * * u = 0 to u = 1 wraps the angular range. */ 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; /** * Test if this cone is a cylinder. * * A cone is cylindrical if both conditions hold: * 1. cross sections are circles of equal radius * 2. axis is perpendicular to cross sections * * Radii within [[Geometry.smallMetricDistance]] are considered equal. * @param allowSkew whether to test the first condition only. Default value is `false`: test both conditions. * @return cross sectional radius > 0 if cylindrical cone; otherwise 0 for non-cylindrical or degenerate cone. */ cylinderRadius(allowSkew?: boolean): number; /** * @return true if this is a closed volume. */ get isClosedVolume(): boolean; /** * Directional distance query * * u direction is around longitude circle at maximum distance from axis. * * v direction is on a line of longitude between the latitude limits. * @returns max parametric distances, packed as a `Vector2d`, or zero vector if the instance is invalid. */ maxIsoParametricDistance(): Vector2d; } //# sourceMappingURL=Cone.d.ts.map