/** @packageDocumentation * @module Solid */ import { Arc3d } from "../curve/Arc3d"; import { GeometryQuery } from "../curve/GeometryQuery"; import { Loop } from "../curve/Loop"; import { Path } from "../curve/Path"; import { Angle } from "../geometry3d/Angle"; 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 torus pipe is a partial torus (donut). * * In its local coordinate system, the z-axis passes through the donut hole. * * The "major hoop" circular arc is defined for theta in the angular sweep. Its formula in local coordinates: * * `vectorTheta0 = (radiusA, 0, 0)` * * `vectorTheta90 = (0, radiusA, 0)` * * `M(theta) = vectorTheta0 * cos(theta) + vectorTheta90 * sin(theta)` * * The "minor hoop" circular arc is defined for phi in [0,2pi]. Its formula, centered at the origin: * * `vectorPhi0 = (radiusB * cos(theta), radiusB * sin(theta), 0)` * * `vectorPhi90 = (0, 0, radiusB)` * * `m(phi) = vectorPhi0 * cos(phi) + vectorPhi90 * sin(phi)` * * Thus the torus pipe in local coordinates has the formula: * * `T(theta, phi) = M(theta) + m(phi)` * * The stored form of the torus pipe is oriented for positive volume: * * Both radii are positive, with radiusA >= radiusB > 0 * * The sweep is positive * * The coordinate system has positive determinant. * * For uv parameterization, * * u is around the minor hoop, with u in [0,1] mapping to phi in [0, 2pi] * * v is along the major hoop, with v in [0,1] mapping to theta in the angular sweep * * a constant v section is a full circle * * a constant u section is an arc with the same angular sweep as the torusPipe * @public */ export declare class TorusPipe extends SolidPrimitive implements UVSurface, UVSurfaceIsoParametricDistance { /** String name for schema properties */ readonly solidPrimitiveType = "torusPipe"; private _localToWorld; private _radiusA; private _radiusB; private _sweep; private _isReversed; protected constructor(map: Transform, radiusA: number, radiusB: number, sweep: Angle, capped: boolean); /** return a copy of the TorusPipe */ clone(): TorusPipe; /** * Apply `transform` to the local coordinate system. * * Fails if the transformation is singular. */ tryTransformInPlace(transform: Transform): boolean; /** * Clone this TorusPipe and transform the clone. * * Fails if the transformation is singular. */ cloneTransformed(transform: Transform): TorusPipe | undefined; /** Create a new `TorusPipe` * @param frame local to world transformation. For best results, the matrix part should be a pure rotation. * @param majorRadius major hoop radius * @param minorRadius minor hoop radius * @param sweep sweep angle for major circle, with positive sweep from x axis towards y axis. * @param capped true for circular caps */ static createInFrame(frame: Transform, majorRadius: number, minorRadius: number, sweep: Angle, capped: boolean): TorusPipe | undefined; /** Create a TorusPipe from the typical parameters of the Dgn file */ static createDgnTorusPipe(center: Point3d, vectorX: Vector3d, vectorY: Vector3d, majorRadius: number, minorRadius: number, sweep: Angle, capped: boolean): TorusPipe | undefined; /** * Create a TorusPipe from major arc and minor radius. * For best results, `arc` should be circular; otherwise, circularity is coerced. */ static createAlongArc(arc: Arc3d, minorRadius: number, capped: boolean): TorusPipe | undefined; /** Return a coordinate frame (right handed, unit axes) * * origin at center of major circle * * major circle in plane of first two columns * * last column perpendicular to first two */ getConstructiveFrame(): Transform | undefined; /** Return the center of the torus pipe (inside the donut hole) */ cloneCenter(): Point3d; /** return unit vector along the x axis (in the major hoop plane) */ cloneVectorX(): Vector3d; /** return unit vector along the y axis (in the major hoop plane) */ cloneVectorY(): Vector3d; /** return unit vector along the z axis */ cloneVectorZ(): Vector3d; /** get the major hoop radius (`radiusA`) in world coordinates */ getMajorRadius(): number; /** get the minor hoop radius (`radiusB`) in world coordinates */ getMinorRadius(): number; /** get the sweep angle along the major circle. */ getSweepAngle(): Angle; /** Ask if this TorusPipe is labeled as reversed */ getIsReversed(): boolean; /** Return the sweep angle as a fraction of full 360 degrees (2PI radians) */ getThetaFraction(): number; /** Return a (clone of) the TorusPipe's local to world transformation. */ cloneLocalToWorld(): Transform; /** ask if `other` is an instance of `TorusPipe` */ isSameGeometryClass(other: any): boolean; /** test if `this` and `other` have nearly equal geometry */ isAlmostEqual(other: GeometryQuery): boolean; /** Return the angle (in radians) for given fractional position around the major hoop. */ vFractionToRadians(v: number): number; /** Second step of double dispatch: call `handler.handleTorusPipe(this)` */ dispatchToGeometryHandler(handler: GeometryHandler): any; /** * Return the Arc3d section at vFraction. For the TorusPipe, this is a minor circle. * @param vFraction fractional position along the sweep direction */ constantVSection(v: number): Loop; /** Return an arc at constant u, and arc sweep matching this TorusPipe sweep. */ constantUSection(uFraction: number): Path; /** extend `rangeToExtend` to include this `TorusPipe` */ extendRange(rangeToExtend: Range3d, transform?: Transform): void; /** Evaluate as a uv surface * @param u fractional position in minor (phi) * @param v fractional position on major (theta) arc */ uvFractionToPoint(u: number, v: number, result?: Point3d): Point3d; /** Evaluate as a uv surface, returning point and two vectors. * @param u fractional position in minor (phi) * @param v fractional position on major (theta) arc */ uvFractionToPointAndTangents(u: number, v: number, result?: Plane3dByOriginAndVectors): Plane3dByOriginAndVectors; /** * Directional distance query * * u direction is around the (full) minor hoop * * v direction is around the outer radius, sum of (absolute values of) major and minor radii. */ maxIsoParametricDistance(): Vector2d; /** Return true if the solid's local z-axis is not perpendicular to its local xy-plane. */ get isSkew(): boolean; /** * @return true if this is a closed volume. */ get isClosedVolume(): boolean; } //# sourceMappingURL=TorusPipe.d.ts.map