@itwin/core-geometry 5.1.0-dev.40 → 5.1.0-dev.41
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +18 -1
- package/lib/cjs/Geometry.d.ts +4 -4
- package/lib/cjs/Geometry.js +3 -3
- package/lib/cjs/Geometry.js.map +1 -1
- package/lib/cjs/bspline/BSpline1dNd.d.ts +1 -1
- package/lib/cjs/bspline/BSpline1dNd.js +1 -1
- package/lib/cjs/bspline/BSpline1dNd.js.map +1 -1
- package/lib/cjs/bspline/BSplineSurface.d.ts +2 -2
- package/lib/cjs/bspline/BSplineSurface.js +4 -4
- package/lib/cjs/bspline/BSplineSurface.js.map +1 -1
- package/lib/cjs/curve/Arc3d.d.ts +1 -1
- package/lib/cjs/curve/Arc3d.js +1 -1
- package/lib/cjs/curve/Arc3d.js.map +1 -1
- package/lib/cjs/curve/CurveLocationDetail.d.ts +1 -1
- package/lib/cjs/curve/CurveLocationDetail.js +1 -1
- package/lib/cjs/curve/CurveLocationDetail.js.map +1 -1
- package/lib/cjs/curve/CurveTypes.d.ts +1 -1
- package/lib/cjs/curve/CurveTypes.js.map +1 -1
- package/lib/cjs/curve/StrokeOptions.d.ts +1 -1
- package/lib/cjs/curve/StrokeOptions.js +1 -1
- package/lib/cjs/curve/StrokeOptions.js.map +1 -1
- package/lib/cjs/geometry3d/GrowableXYArray.d.ts +1 -1
- package/lib/cjs/geometry3d/GrowableXYArray.js +1 -1
- package/lib/cjs/geometry3d/GrowableXYArray.js.map +1 -1
- package/lib/cjs/geometry4d/Point4d.d.ts +1 -1
- package/lib/cjs/geometry4d/Point4d.js +1 -1
- package/lib/cjs/geometry4d/Point4d.js.map +1 -1
- package/lib/cjs/polyface/Polyface.d.ts +2 -2
- package/lib/cjs/polyface/Polyface.js +2 -2
- package/lib/cjs/polyface/Polyface.js.map +1 -1
- package/lib/cjs/polyface/PolyfaceBuilder.d.ts +1 -1
- package/lib/cjs/polyface/PolyfaceBuilder.js +1 -1
- package/lib/cjs/polyface/PolyfaceBuilder.js.map +1 -1
- package/lib/cjs/polyface/PolyfaceData.d.ts +1 -1
- package/lib/cjs/polyface/PolyfaceData.js +1 -1
- package/lib/cjs/polyface/PolyfaceData.js.map +1 -1
- package/lib/cjs/polyface/PolyfaceQuery.d.ts +3 -3
- package/lib/cjs/polyface/PolyfaceQuery.d.ts.map +1 -1
- package/lib/cjs/polyface/PolyfaceQuery.js +3 -3
- package/lib/cjs/polyface/PolyfaceQuery.js.map +1 -1
- package/lib/cjs/serialization/GeometrySamples.d.ts +1 -1
- package/lib/cjs/serialization/GeometrySamples.d.ts.map +1 -1
- package/lib/cjs/serialization/GeometrySamples.js +1 -1
- package/lib/cjs/serialization/GeometrySamples.js.map +1 -1
- package/lib/cjs/serialization/IModelJsonSchema.d.ts +3 -3
- package/lib/cjs/serialization/IModelJsonSchema.js.map +1 -1
- package/lib/esm/Geometry.d.ts +4 -4
- package/lib/esm/Geometry.js +3 -3
- package/lib/esm/Geometry.js.map +1 -1
- package/lib/esm/bspline/BSpline1dNd.d.ts +1 -1
- package/lib/esm/bspline/BSpline1dNd.js +1 -1
- package/lib/esm/bspline/BSpline1dNd.js.map +1 -1
- package/lib/esm/bspline/BSplineSurface.d.ts +2 -2
- package/lib/esm/bspline/BSplineSurface.js +4 -4
- package/lib/esm/bspline/BSplineSurface.js.map +1 -1
- package/lib/esm/curve/Arc3d.d.ts +1 -1
- package/lib/esm/curve/Arc3d.js +1 -1
- package/lib/esm/curve/Arc3d.js.map +1 -1
- package/lib/esm/curve/CurveLocationDetail.d.ts +1 -1
- package/lib/esm/curve/CurveLocationDetail.js +1 -1
- package/lib/esm/curve/CurveLocationDetail.js.map +1 -1
- package/lib/esm/curve/CurveTypes.d.ts +1 -1
- package/lib/esm/curve/CurveTypes.js.map +1 -1
- package/lib/esm/curve/StrokeOptions.d.ts +1 -1
- package/lib/esm/curve/StrokeOptions.js +1 -1
- package/lib/esm/curve/StrokeOptions.js.map +1 -1
- package/lib/esm/geometry3d/GrowableXYArray.d.ts +1 -1
- package/lib/esm/geometry3d/GrowableXYArray.js +1 -1
- package/lib/esm/geometry3d/GrowableXYArray.js.map +1 -1
- package/lib/esm/geometry4d/Point4d.d.ts +1 -1
- package/lib/esm/geometry4d/Point4d.js +1 -1
- package/lib/esm/geometry4d/Point4d.js.map +1 -1
- package/lib/esm/polyface/Polyface.d.ts +2 -2
- package/lib/esm/polyface/Polyface.js +2 -2
- package/lib/esm/polyface/Polyface.js.map +1 -1
- package/lib/esm/polyface/PolyfaceBuilder.d.ts +1 -1
- package/lib/esm/polyface/PolyfaceBuilder.js +1 -1
- package/lib/esm/polyface/PolyfaceBuilder.js.map +1 -1
- package/lib/esm/polyface/PolyfaceData.d.ts +1 -1
- package/lib/esm/polyface/PolyfaceData.js +1 -1
- package/lib/esm/polyface/PolyfaceData.js.map +1 -1
- package/lib/esm/polyface/PolyfaceQuery.d.ts +3 -3
- package/lib/esm/polyface/PolyfaceQuery.d.ts.map +1 -1
- package/lib/esm/polyface/PolyfaceQuery.js +3 -3
- package/lib/esm/polyface/PolyfaceQuery.js.map +1 -1
- package/lib/esm/serialization/GeometrySamples.d.ts +1 -1
- package/lib/esm/serialization/GeometrySamples.d.ts.map +1 -1
- package/lib/esm/serialization/GeometrySamples.js +1 -1
- package/lib/esm/serialization/GeometrySamples.js.map +1 -1
- package/lib/esm/serialization/IModelJsonSchema.d.ts +3 -3
- package/lib/esm/serialization/IModelJsonSchema.js.map +1 -1
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CurveLocationDetail.js","sourceRoot":"","sources":["../../../src/curve/CurveLocationDetail.ts"],"names":[],"mappings":";;;AAAA;;;+FAG+F;AAC/F;;GAEG;AACH,0CAAmD;AACnD,mEAAkE;AAKlE;;;GAGG;AACH,IAAY,iBAWX;AAXD,WAAY,iBAAiB;IAC3B,+DAA+D;IAC/D,iEAAY,CAAA;IACZ,2CAA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ACvC,8BAA8B;IACvB,KAAK,CAAwB;IACpC,+BAA+B;IACxB,KAAK,CAAwB;IACpC;QACE,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC;QAChB,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC;IAClB,CAAC;CACF;AATD,oEASC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Curve\n */\nimport { Geometry, ICloneable } from \"../Geometry\";\nimport { Point3d, Vector3d } from \"../geometry3d/Point3dVector3d\";\nimport { Ray3d } from \"../geometry3d/Ray3d\";\nimport { Transform } from \"../geometry3d/Transform\";\nimport { CurvePrimitive } from \"./CurvePrimitive\";\n\n/**\n * An enumeration of special conditions being described by a CurveLocationDetail.\n * @public\n */\nexport enum CurveIntervalRole {\n /** This point is an isolated point NOT at a primary vertex. */\n isolated = 0,\n /** This point is an isolated vertex hit */\n isolatedAtVertex = 1,\n /** This is the beginning of an interval */\n intervalStart = 10,\n /** This is an interior point of an interval. */\n intervalInterior = 11,\n /** This is the end of an interval */\n intervalEnd = 12,\n}\n\n/**\n * Return code for CurvePrimitive method `moveSignedDistanceFromFraction`\n * @public\n */\nexport enum CurveSearchStatus {\n /** Unimplemented or zero length curve */\n error,\n /** Complete success of search */\n success = 1,\n /** Search ended prematurely (e.g. at incomplete distance moved) at start or end of curve */\n stoppedAtBoundary = 2,\n}\n\n/**\n * Use to update a cloneable object when source and/or prior result are possibly undefined.\n * * Any undefined source returns undefined.\n * * For defined source, reuse optional result if available.\n * @param source optional source\n * @param result optional result\n */\nfunction optionalUpdate<T extends ICloneable<T>>(source: T | undefined, result: T | undefined): T | undefined {\n return source ? source.clone(result) : undefined;\n}\n\n/**\n * CurveLocationDetail carries point and parameter data about a point evaluated on a curve.\n * * These are returned by a variety of queries.\n * * Particular contents can vary among the queries.\n * @public\n */\nexport class CurveLocationDetail {\n /** The curve being evaluated. */\n public curve?: CurvePrimitive;\n /** Optional ray. */\n public ray?: Ray3d;\n /** The fractional position along the curve. */\n public fraction: number;\n /** Detail condition of the role this point has in some context. */\n public intervalRole?: CurveIntervalRole;\n /** The point on the curve. */\n public point: Point3d;\n /** A vector (e.g. tangent vector) in context. */\n public vectorInCurveLocationDetail?: Vector3d;\n /** A context-specific numeric value (e.g., a distance). */\n public a: number;\n /**\n * Optional CurveLocationDetail with more detail of location. For instance, a detail for fractional position\n * within a CurveChainWithDistanceIndex returns fraction and distance along the chain as its primary data and\n * further detail of the particular curve within the chain in the childDetail.\n */\n public childDetail?: CurveLocationDetail;\n /**\n * A status indicator for certain searches.\n * * e.g., CurvePrimitive.moveSignedDistanceFromFraction.\n */\n public curveSearchStatus?: CurveSearchStatus;\n /** (Optional) second fraction, e.g. end of interval of coincident curves. */\n public fraction1?: number;\n /** (Optional) second point, e.g. end of interval of coincident curves. */\n public point1?: Point3d;\n /** A context-specific temporary point, e.g. for intermediate calculations. */\n public pointQ: Point3d;\n /** Constructor */\n public constructor() {\n this.pointQ = Point3d.createZero();\n this.fraction = 0;\n this.point = Point3d.createZero();\n this.a = 0.0;\n }\n /** Set the (optional) intervalRole field. */\n public setIntervalRole(value: CurveIntervalRole): void {\n this.intervalRole = value;\n }\n /** Set the (optional) fraction1 and point1, using direct assignment (capture!) to point1. */\n public captureFraction1Point1(fraction1: number, point1: Point3d): void {\n this.fraction1 = fraction1;\n this.point1 = point1;\n }\n /** Test if this pair has fraction1 defined. */\n public get hasFraction1(): boolean {\n return this.fraction1 !== undefined;\n }\n /** Test if this is an isolated point. This is true if intervalRole is any of (undefined, isolated, isolatedAtVertex). */\n public get isIsolated(): boolean {\n return this.intervalRole === undefined\n || this.intervalRole === CurveIntervalRole.isolated\n || this.intervalRole === CurveIntervalRole.isolatedAtVertex;\n }\n /** Return the fraction delta. (0 if no fraction1). */\n public get fractionDelta(): number {\n return this.fraction1 !== undefined ? this.fraction1 - this.fraction : 0.0;\n }\n /**\n * If (fraction1, point1) are defined, make them the primary (and only) data.\n * * No action if undefined.\n */\n public collapseToEnd() {\n if (this.fraction1 !== undefined)\n this.fraction = this.fraction1;\n if (this.point1)\n this.point = this.point1;\n this.collapseToStart();\n }\n /** Make (fraction, point) the primary (and only) data. */\n public collapseToStart() {\n this.fraction1 = undefined;\n this.point1 = undefined;\n }\n /**\n * Return a complete copy, WITH CAVEATS.\n * * curve member is copied as a reference.\n * * point and vector members are cloned.\n */\n public clone(result?: CurveLocationDetail): CurveLocationDetail {\n if (result === this)\n return result;\n result = result ? result : new CurveLocationDetail();\n result.curve = this.curve;\n result.fraction = this.fraction;\n result.fraction1 = this.fraction1;\n result.point1 = optionalUpdate<Point3d>(this.point1, result.point1);\n result.point.setFromPoint3d(this.point);\n result.vectorInCurveLocationDetail = optionalUpdate<Vector3d>(this.vectorInCurveLocationDetail, result.vectorInCurveLocationDetail);\n result.a = this.a;\n result.childDetail = optionalUpdate<CurveLocationDetail>(this.childDetail, result.childDetail);\n result.curveSearchStatus = this.curveSearchStatus;\n return result;\n }\n /**\n * Updated in this instance.\n * * Note that if caller omits `vector` and `a`, those fields are updated to the call-list defaults (NOT left as-is)\n * * point and vector updates are by data copy (not capture of pointers).\n * @param fraction (required) fraction to install.\n * @param point (required) point to install.\n * @param vector (optional) vector to install.\n * @param a (optional) numeric value to install.\n */\n public setFP(fraction: number, point: Point3d, vector?: Vector3d, a: number = 0.0): void {\n this.fraction = fraction;\n this.point.setFromPoint3d(point);\n this.vectorInCurveLocationDetail = optionalUpdate<Vector3d>(vector, this.vectorInCurveLocationDetail);\n this.a = a;\n }\n /**\n * Updated in this instance.\n * * Note that if caller omits a`, that field is updated to the call-list default (NOT left as-is)\n * * point and vector updates are by data copy (not capture of the ray members).\n * @param fraction (required) fraction to install.\n * @param ray (required) point and vector to install.\n * @param a (optional) numeric value to install.\n */\n public setFR(fraction: number, ray: Ray3d, a: number = 0): void {\n return this.setFP(fraction, ray.origin, ray.direction, a);\n }\n /** Set the CurvePrimitive pointer, leaving all other properties untouched. */\n public setCurve(curve: CurvePrimitive) {\n this.curve = curve;\n }\n /** Record the distance from the CurveLocationDetail's point to the parameter point. */\n public setDistanceTo(point: Point3d) {\n this.a = this.point.distance(point);\n }\n /** Create with a CurvePrimitive pointer but no coordinate data. */\n public static create(curve?: CurvePrimitive, result?: CurveLocationDetail): CurveLocationDetail {\n result = result ? result : new CurveLocationDetail();\n result.curve = curve;\n return result;\n }\n /** Create a new detail using CurvePrimitive pointer, fraction, and point coordinates. */\n public static createCurveFractionPoint(\n curve: CurvePrimitive | undefined, fraction: number, point: Point3d, result?: CurveLocationDetail,\n ): CurveLocationDetail {\n result = result ? result : new CurveLocationDetail();\n result.curve = curve;\n result.fraction = fraction;\n result.point.setFromPoint3d(point);\n result.vectorInCurveLocationDetail = undefined;\n result.a = 0.0;\n result.childDetail = undefined;\n result.curveSearchStatus = undefined;\n return result;\n }\n /** Create a new detail with only ray, fraction, and point. */\n public static createRayFractionPoint(\n ray: Ray3d, fraction: number, point: Point3d, result?: CurveLocationDetail,\n ): CurveLocationDetail {\n result = result ? result : new CurveLocationDetail();\n result.fraction = fraction;\n result.ray = ray;\n result.point.setFromPoint3d(point);\n return result;\n }\n /** Create with CurvePrimitive pointer, fraction, and point coordinates. */\n public static createCurveFractionPointDistanceCurveSearchStatus(\n curve: CurvePrimitive | undefined,\n fraction: number,\n point: Point3d,\n distance: number,\n status: CurveSearchStatus,\n result?: CurveLocationDetail,\n ): CurveLocationDetail {\n result = result ? result : new CurveLocationDetail();\n result.curve = curve;\n result.fraction = fraction;\n result.point.setFromPoint3d(point);\n result.vectorInCurveLocationDetail = undefined;\n result.a = distance;\n result.childDetail = undefined;\n result.curveSearchStatus = status;\n return result;\n }\n /** Create with curveSearchStatus affected by allowExtension. */\n public static createConditionalMoveSignedDistance(\n allowExtension: boolean,\n curve: CurvePrimitive,\n startFraction: number,\n endFraction: number,\n requestedSignedDistance: number,\n result?: CurveLocationDetail,\n ): CurveLocationDetail {\n let a = requestedSignedDistance;\n let status = CurveSearchStatus.success;\n if (!allowExtension && !Geometry.isIn01(endFraction)) {\n // cap the movement at the endpoint\n if (endFraction < 0.0) {\n a = - curve.curveLengthBetweenFractions(startFraction, 0.0);\n endFraction = 0.0;\n status = CurveSearchStatus.stoppedAtBoundary;\n } else if (endFraction > 1.0) {\n endFraction = 1.0;\n a = curve.curveLengthBetweenFractions(startFraction, 1.0);\n status = CurveSearchStatus.stoppedAtBoundary;\n }\n }\n result = result ? result : new CurveLocationDetail();\n result.curve = curve;\n result.fraction = endFraction;\n curve.fractionToPoint(endFraction, result.point);\n result.vectorInCurveLocationDetail = undefined;\n result.a = a;\n result.childDetail = undefined;\n result.curveSearchStatus = status;\n return result;\n }\n /** Create with CurvePrimitive pointer and fraction for evaluation. */\n public static createCurveEvaluatedFraction(\n curve: CurvePrimitive, fraction: number, result?: CurveLocationDetail,\n ): CurveLocationDetail {\n result = result ? result : new CurveLocationDetail();\n result.curve = curve;\n result.fraction = fraction;\n curve.fractionToPoint(fraction, result.point);\n result.vectorInCurveLocationDetail = undefined;\n result.a = 0.0;\n result.childDetail = undefined;\n result.curveSearchStatus = undefined;\n return result;\n }\n /** Create with CurvePrimitive pointer and fraction for evaluation. */\n public static createCurveEvaluatedFractionPointAndDerivative(\n curve: CurvePrimitive, fraction: number, result?: CurveLocationDetail,\n ): CurveLocationDetail {\n result = result ? result : new CurveLocationDetail();\n result.curve = curve;\n result.fraction = fraction;\n const ray = curve.fractionToPointAndDerivative(fraction);\n result.point.setFromPoint3d(ray.origin);\n result.vectorInCurveLocationDetail = ray.direction;\n result.a = 0.0;\n result.childDetail = undefined;\n result.curveSearchStatus = undefined;\n return result;\n }\n /** Create with CurvePrimitive pointer and 2 fractions for evaluation. */\n public static createCurveEvaluatedFractionFraction(\n curve: CurvePrimitive, fraction0: number, fraction1: number, result?: CurveLocationDetail,\n ): CurveLocationDetail {\n result = result ? result : new CurveLocationDetail();\n result.curve = curve;\n result.fraction = fraction0;\n curve.fractionToPoint(fraction0, result.point);\n result.fraction1 = fraction1;\n result.point1 = curve.fractionToPoint(fraction1, result.point1);\n result.vectorInCurveLocationDetail = undefined;\n result.a = 0.0;\n result.childDetail = undefined;\n result.curveSearchStatus = undefined;\n return result;\n }\n /** Create with CurvePrimitive pointer, fraction, and point coordinates. */\n public static createCurveFractionPointDistance(\n curve: CurvePrimitive,\n fraction: number,\n point: Point3d,\n a: number,\n result?: CurveLocationDetail,\n ): CurveLocationDetail {\n result = result ? result : new CurveLocationDetail();\n result.curve = curve;\n result.fraction = fraction;\n result.point.setFromPoint3d(point);\n result.vectorInCurveLocationDetail = undefined;\n result.a = a;\n result.childDetail = undefined;\n result.curveSearchStatus = undefined;\n return result;\n }\n /**\n * Update or create if closer than current contents.\n * @param curve candidate curve\n * @param fraction candidate fraction\n * @param point candidate point\n * @param a candidate distance\n * @returns true if the given distance is smaller (and hence this detail was updated)\n */\n public updateIfCloserCurveFractionPointDistance(\n curve: CurvePrimitive, fraction: number, point: Point3d, a: number,\n ): boolean {\n if (this.a < a)\n return false;\n CurveLocationDetail.createCurveFractionPointDistance(curve, fraction, point, a, this);\n return true;\n }\n /**\n * Exchange the (fraction,fraction1) and (point, point1) pairs.\n * * (Skip each swap if its \"1\" value is undefined)\n */\n public swapFractionsAndPoints(): void {\n if (this.fraction1 !== undefined) {\n const f = this.fraction;\n this.fraction = this.fraction1;\n this.fraction1 = f;\n }\n if (this.point1 !== undefined) {\n const p = this.point;\n this.point = this.point1;\n this.point1 = p;\n }\n }\n /**\n * Return the fraction where f falls between fraction and fraction1.\n * * ASSUME fraction1 defined\n */\n public inverseInterpolateFraction(f: number, defaultFraction: number = 0): number {\n const a = Geometry.inverseInterpolate01(this.fraction, this.fraction1!, f);\n if (a === undefined)\n return defaultFraction;\n return a;\n }\n /**\n * Return the detail with smaller `a` value -- detailA returned if equal.\n * @param detailA first candidate\n * @param detailB second candidate\n */\n public static chooseSmallerA(\n detailA: CurveLocationDetail | undefined, detailB: CurveLocationDetail | undefined,\n ): CurveLocationDetail | undefined {\n if (detailA) {\n if (!detailB)\n return detailA;\n return detailA.a <= detailB.a ? detailA : detailB;\n }\n return detailB;\n }\n /** Compare only the curve and fraction of this detail with `other`. */\n public isSameCurveAndFraction(other: CurveLocationDetail | { curve: CurvePrimitive, fraction: number }): boolean {\n return this.curve === other.curve && Geometry.isAlmostEqualNumber(this.fraction, other.fraction);\n }\n /**\n * Transform the detail in place.\n * * All numerical properties are transformed directly, except:\n * * when `curve` is defined, `point` and `point1` are reset by evaluating the transformed curve at `fraction` and `fraction1`\n * * these properties are untouched: `a`, `fraction`, `fraction1`, `pointQ`\n * @param transform the transform to apply\n * @return true if and only if the transformation was successful. If false, the instance is in an indeterminate\n * state and should not be used.\n */\n public tryTransformInPlace(transform: Transform): boolean {\n if (this.curve && !this.curve.tryTransformInPlace(transform))\n return false;\n if (this.ray)\n this.ray.transformInPlace(transform);\n if (this.curve)\n this.curve.fractionToPoint(this.fraction, this.point);\n else\n transform.multiplyXYAndZInPlace(this.point);\n if (this.vectorInCurveLocationDetail)\n transform.multiplyVectorInPlace(this.vectorInCurveLocationDetail);\n if (this.childDetail && this.childDetail !== this && !this.childDetail.tryTransformInPlace(transform))\n return false;\n if (this.point1) {\n if (this.curve && this.fraction1)\n this.curve.fractionToPoint(this.fraction1, this.point1);\n else\n transform.multiplyXYAndZInPlace(this.point1);\n }\n return true;\n }\n}\n\n/**\n * Enumeration of configurations for intersections and min/max distance-between-curve\n * @public\n */\nexport enum CurveCurveApproachType {\n /** Intersection at a single point */\n Intersection = 0,\n /** Distinct points on the two curves, with each curve's tangent perpendicular to the chord between the points */\n PerpendicularChord = 1,\n /** Completely coincident geometry */\n CoincidentGeometry = 2,\n /** Completely parallel geometry. */\n ParallelGeometry = 3,\n}\n\n/**\n * A pair of CurveLocationDetail.\n * @public\n */\nexport class CurveLocationDetailPair {\n /** The first of the two details. */\n public detailA: CurveLocationDetail;\n /** The second of the two details. */\n public detailB: CurveLocationDetail;\n /**\n * Enumeration of how the detail pairs relate.\n * * This is set only by certain closeApproach calculations.\n */\n public approachType?: CurveCurveApproachType;\n\n public constructor(detailA?: CurveLocationDetail, detailB?: CurveLocationDetail) {\n this.detailA = detailA ? detailA : new CurveLocationDetail();\n this.detailB = detailB ? detailB : new CurveLocationDetail();\n }\n /** Create a curve detail pair using references to two CurveLocationDetails */\n public static createCapture(\n detailA: CurveLocationDetail, detailB: CurveLocationDetail, result?: CurveLocationDetailPair,\n ): CurveLocationDetailPair {\n result = result ? result : new CurveLocationDetailPair();\n result.detailA = detailA;\n result.detailB = detailB;\n return result;\n }\n /**\n * Create a curve detail pair using references to two CurveLocationDetails.\n * * optionally install in reversed positions\n */\n public static createCaptureOptionalReverse(\n detailA: CurveLocationDetail, detailB: CurveLocationDetail, reversed: boolean, result?: CurveLocationDetailPair,\n ): CurveLocationDetailPair {\n result = result ? result : new CurveLocationDetailPair();\n if (reversed) {\n result.detailA = detailA;\n result.detailB = detailB;\n\n } else {\n result.detailA = detailA;\n result.detailB = detailB;\n }\n return result;\n }\n /** Make a deep copy of this CurveLocationDetailPair */\n public clone(result?: CurveLocationDetailPair): CurveLocationDetailPair {\n result = result ? result : new CurveLocationDetailPair();\n result.detailA = this.detailA.clone();\n result.detailB = this.detailB.clone();\n result.approachType = this.approachType;\n return result;\n }\n /** Swap the details of A, B */\n public swapDetails() {\n const q = this.detailA;\n this.detailA = this.detailB;\n this.detailB = q;\n }\n /**\n * Mutate the input array by removing the second of two adjacent duplicate pairs.\n * * Ignores details representing coincident intervals (e.g., for which `fraction1` is defined).\n * * Comparison is performed by [[CurveLocationDetail.isSameCurveAndFraction]].\n * * No sorting is performed.\n * @param pairs array to de-duplicate in place\n * @param index0 look for duplicates in the tail of the array starting at index0\n * @return reference to input array\n * @internal\n */\n public static removeAdjacentDuplicates(pairs: CurveLocationDetailPair[], index0: number = 0): CurveLocationDetailPair[] {\n return pairs.flatMap(\n (pair: CurveLocationDetailPair, i: number, arr: CurveLocationDetailPair[]) => {\n if (i >= index0 && i > 0) {\n if (!pair.detailA.hasFraction1 && !pair.detailB.hasFraction1) {\n if (pair.detailA.isSameCurveAndFraction(arr[i - 1].detailA)) {\n if (pair.detailB.isSameCurveAndFraction(arr[i - 1].detailB)) {\n return []; // remove the i_th pair\n }\n }\n }\n }\n return [pair]; // preserve the i_th pair\n },\n );\n }\n /**\n * Transform the details in place.\n * @param transform the transform to apply\n * @return true if and only if the transformation was successful on both details.\n * If false, the instance is in an indeterminate state and should not be used.\n */\n public tryTransformInPlace(transform: Transform): boolean {\n return this.detailA.tryTransformInPlace(transform) && this.detailB.tryTransformInPlace(transform);\n }\n}\n\n/**\n * Data bundle for a pair of arrays of CurveLocationDetail structures.\n * @deprecated in 4.x - might be removed in next major version. Use CurveLocationDetailPair[] instead.\n * @public\n */\nexport class CurveLocationDetailArrayPair {\n /** First array of details. */\n public dataA: CurveLocationDetail[];\n /** Second array of details. */\n public dataB: CurveLocationDetail[];\n public constructor() {\n this.dataA = [];\n this.dataB = [];\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"CurveLocationDetail.js","sourceRoot":"","sources":["../../../src/curve/CurveLocationDetail.ts"],"names":[],"mappings":";;;AAAA;;;+FAG+F;AAC/F;;GAEG;AACH,0CAAmD;AACnD,mEAAkE;AAKlE;;;GAGG;AACH,IAAY,iBAWX;AAXD,WAAY,iBAAiB;IAC3B,+DAA+D;IAC/D,iEAAY,CAAA;IACZ,2CAA2C;IAC3C,iFAAoB,CAAA;IACpB,2CAA2C;IAC3C,4EAAkB,CAAA;IAClB,gDAAgD;IAChD,kFAAqB,CAAA;IACrB,qCAAqC;IACrC,wEAAgB,CAAA;AAClB,CAAC,EAXW,iBAAiB,iCAAjB,iBAAiB,QAW5B;AAED;;;GAGG;AACH,IAAY,iBAOX;AAPD,WAAY,iBAAiB;IAC3B,0CAA0C;IAC1C,2DAAK,CAAA;IACL,iCAAiC;IACjC,+DAAW,CAAA;IACX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,EAAE,SAAiB,CAAC;QACzF,OAAO,KAAK,CAAC,OAAO,CAClB,CAAC,IAA6B,EAAE,CAAS,EAAE,GAA8B,EAAE,EAAE;YAC3E,IAAI,CAAC,IAAI,MAAM,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;gBACzB,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,YAAY,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,YAAY,EAAE,CAAC;oBAC7D,IAAI,IAAI,CAAC,OAAO,CAAC,sBAAsB,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;wBAC5D,IAAI,IAAI,CAAC,OAAO,CAAC,sBAAsB,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;4BAC5D,OAAO,EAAE,CAAC,CAAE,uBAAuB;wBACrC,CAAC;oBACH,CAAC;gBACH,CAAC;YACH,CAAC;YACD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAE,yBAAyB;QAC3C,CAAC,CACF,CAAC;IACJ,CAAC;IACD;;;;;OAKG;IACI,mBAAmB,CAAC,SAAoB;QAC7C,OAAO,IAAI,CAAC,OAAO,CAAC,mBAAmB,CAAC,SAAS,CAAC,IAAI,IAAI,CAAC,OAAO,CAAC,mBAAmB,CAAC,SAAS,CAAC,CAAC;IACpG,CAAC;CACF;AA3FD,0DA2FC;AAED;;;;GAIG;AACH,MAAa,4BAA4B;IACvC,8BAA8B;IACvB,KAAK,CAAwB;IACpC,+BAA+B;IACxB,KAAK,CAAwB;IACpC;QACE,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC;QAChB,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC;IAClB,CAAC;CACF;AATD,oEASC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Curve\n */\nimport { Geometry, ICloneable } from \"../Geometry\";\nimport { Point3d, Vector3d } from \"../geometry3d/Point3dVector3d\";\nimport { Ray3d } from \"../geometry3d/Ray3d\";\nimport { Transform } from \"../geometry3d/Transform\";\nimport { CurvePrimitive } from \"./CurvePrimitive\";\n\n/**\n * An enumeration of special conditions being described by a CurveLocationDetail.\n * @public\n */\nexport enum CurveIntervalRole {\n /** This point is an isolated point NOT at a primary vertex. */\n isolated = 0,\n /** This point is an isolated vertex hit */\n isolatedAtVertex = 1,\n /** This is the beginning of an interval */\n intervalStart = 10,\n /** This is an interior point of an interval. */\n intervalInterior = 11,\n /** This is the end of an interval */\n intervalEnd = 12,\n}\n\n/**\n * Return code for CurvePrimitive method `moveSignedDistanceFromFraction`\n * @public\n */\nexport enum CurveSearchStatus {\n /** Unimplemented or zero length curve */\n error,\n /** Complete success of search */\n success = 1,\n /** Search ended prematurely (e.g. at incomplete distance moved) at start or end of curve */\n stoppedAtBoundary = 2,\n}\n\n/**\n * Use to update a cloneable object when source and/or prior result are possibly undefined.\n * * Any undefined source returns undefined.\n * * For defined source, reuse optional result if available.\n * @param source optional source\n * @param result optional result\n */\nfunction optionalUpdate<T extends ICloneable<T>>(source: T | undefined, result: T | undefined): T | undefined {\n return source ? source.clone(result) : undefined;\n}\n\n/**\n * CurveLocationDetail carries point and parameter data about a point evaluated on a curve.\n * * These are returned by a variety of queries.\n * * Particular contents can vary among the queries.\n * @public\n */\nexport class CurveLocationDetail {\n /** The curve being evaluated. */\n public curve?: CurvePrimitive;\n /** Optional ray. */\n public ray?: Ray3d;\n /** The fractional position along the curve. */\n public fraction: number;\n /** Detail condition of the role this point has in some context. */\n public intervalRole?: CurveIntervalRole;\n /** The point on the curve. */\n public point: Point3d;\n /** A vector (e.g. tangent vector) in context. */\n public vectorInCurveLocationDetail?: Vector3d;\n /** A context-specific numeric value (e.g., a distance). */\n public a: number;\n /**\n * Optional CurveLocationDetail with more detail of location. For instance, a detail for fractional position\n * within a CurveChainWithDistanceIndex returns fraction and distance along the chain as its primary data and\n * further detail of the particular curve within the chain in the childDetail.\n */\n public childDetail?: CurveLocationDetail;\n /**\n * A status indicator for certain searches.\n * * e.g., CurvePrimitive.moveSignedDistanceFromFraction.\n */\n public curveSearchStatus?: CurveSearchStatus;\n /** (Optional) second fraction, e.g. end of interval of coincident curves. */\n public fraction1?: number;\n /** (Optional) second point, e.g. end of interval of coincident curves. */\n public point1?: Point3d;\n /** A context-specific temporary point, e.g. for intermediate calculations. */\n public pointQ: Point3d;\n /** Constructor */\n public constructor() {\n this.pointQ = Point3d.createZero();\n this.fraction = 0;\n this.point = Point3d.createZero();\n this.a = 0.0;\n }\n /** Set the (optional) intervalRole field. */\n public setIntervalRole(value: CurveIntervalRole): void {\n this.intervalRole = value;\n }\n /** Set the (optional) fraction1 and point1, using direct assignment (capture!) to point1. */\n public captureFraction1Point1(fraction1: number, point1: Point3d): void {\n this.fraction1 = fraction1;\n this.point1 = point1;\n }\n /** Test if this pair has fraction1 defined. */\n public get hasFraction1(): boolean {\n return this.fraction1 !== undefined;\n }\n /** Test if this is an isolated point. This is true if intervalRole is any of (undefined, isolated, isolatedAtVertex). */\n public get isIsolated(): boolean {\n return this.intervalRole === undefined\n || this.intervalRole === CurveIntervalRole.isolated\n || this.intervalRole === CurveIntervalRole.isolatedAtVertex;\n }\n /** Return the fraction delta. (0 if no fraction1). */\n public get fractionDelta(): number {\n return this.fraction1 !== undefined ? this.fraction1 - this.fraction : 0.0;\n }\n /**\n * If (fraction1, point1) are defined, make them the primary (and only) data.\n * * No action if undefined.\n */\n public collapseToEnd() {\n if (this.fraction1 !== undefined)\n this.fraction = this.fraction1;\n if (this.point1)\n this.point = this.point1;\n this.collapseToStart();\n }\n /** Make (fraction, point) the primary (and only) data. */\n public collapseToStart() {\n this.fraction1 = undefined;\n this.point1 = undefined;\n }\n /**\n * Return a complete copy, WITH CAVEATS.\n * * curve member is copied as a reference.\n * * point and vector members are cloned.\n */\n public clone(result?: CurveLocationDetail): CurveLocationDetail {\n if (result === this)\n return result;\n result = result ? result : new CurveLocationDetail();\n result.curve = this.curve;\n result.fraction = this.fraction;\n result.fraction1 = this.fraction1;\n result.point1 = optionalUpdate<Point3d>(this.point1, result.point1);\n result.point.setFromPoint3d(this.point);\n result.vectorInCurveLocationDetail = optionalUpdate<Vector3d>(this.vectorInCurveLocationDetail, result.vectorInCurveLocationDetail);\n result.a = this.a;\n result.childDetail = optionalUpdate<CurveLocationDetail>(this.childDetail, result.childDetail);\n result.curveSearchStatus = this.curveSearchStatus;\n return result;\n }\n /**\n * Updated in this instance.\n * * Note that if caller omits `vector` and `a`, those fields are updated to the call-list defaults (NOT left as-is)\n * * point and vector updates are by data copy (not capture of pointers).\n * @param fraction (required) fraction to install.\n * @param point (required) point to install.\n * @param vector (optional) vector to install.\n * @param a (optional) numeric value to install.\n */\n public setFP(fraction: number, point: Point3d, vector?: Vector3d, a: number = 0.0): void {\n this.fraction = fraction;\n this.point.setFromPoint3d(point);\n this.vectorInCurveLocationDetail = optionalUpdate<Vector3d>(vector, this.vectorInCurveLocationDetail);\n this.a = a;\n }\n /**\n * Updated in this instance.\n * * Note that if caller omits a`, that field is updated to the call-list default (NOT left as-is)\n * * point and vector updates are by data copy (not capture of the ray members).\n * @param fraction (required) fraction to install.\n * @param ray (required) point and vector to install.\n * @param a (optional) numeric value to install.\n */\n public setFR(fraction: number, ray: Ray3d, a: number = 0): void {\n return this.setFP(fraction, ray.origin, ray.direction, a);\n }\n /** Set the CurvePrimitive pointer, leaving all other properties untouched. */\n public setCurve(curve: CurvePrimitive) {\n this.curve = curve;\n }\n /** Record the distance from the CurveLocationDetail's point to the parameter point. */\n public setDistanceTo(point: Point3d) {\n this.a = this.point.distance(point);\n }\n /** Create with a CurvePrimitive pointer but no coordinate data. */\n public static create(curve?: CurvePrimitive, result?: CurveLocationDetail): CurveLocationDetail {\n result = result ? result : new CurveLocationDetail();\n result.curve = curve;\n return result;\n }\n /** Create a new detail using CurvePrimitive pointer, fraction, and point coordinates. */\n public static createCurveFractionPoint(\n curve: CurvePrimitive | undefined, fraction: number, point: Point3d, result?: CurveLocationDetail,\n ): CurveLocationDetail {\n result = result ? result : new CurveLocationDetail();\n result.curve = curve;\n result.fraction = fraction;\n result.point.setFromPoint3d(point);\n result.vectorInCurveLocationDetail = undefined;\n result.a = 0.0;\n result.childDetail = undefined;\n result.curveSearchStatus = undefined;\n return result;\n }\n /** Create a new detail with only ray, fraction, and point. */\n public static createRayFractionPoint(\n ray: Ray3d, fraction: number, point: Point3d, result?: CurveLocationDetail,\n ): CurveLocationDetail {\n result = result ? result : new CurveLocationDetail();\n result.fraction = fraction;\n result.ray = ray;\n result.point.setFromPoint3d(point);\n return result;\n }\n /** Create with CurvePrimitive pointer, fraction, and point coordinates. */\n public static createCurveFractionPointDistanceCurveSearchStatus(\n curve: CurvePrimitive | undefined,\n fraction: number,\n point: Point3d,\n distance: number,\n status: CurveSearchStatus,\n result?: CurveLocationDetail,\n ): CurveLocationDetail {\n result = result ? result : new CurveLocationDetail();\n result.curve = curve;\n result.fraction = fraction;\n result.point.setFromPoint3d(point);\n result.vectorInCurveLocationDetail = undefined;\n result.a = distance;\n result.childDetail = undefined;\n result.curveSearchStatus = status;\n return result;\n }\n /** Create with curveSearchStatus affected by allowExtension. */\n public static createConditionalMoveSignedDistance(\n allowExtension: boolean,\n curve: CurvePrimitive,\n startFraction: number,\n endFraction: number,\n requestedSignedDistance: number,\n result?: CurveLocationDetail,\n ): CurveLocationDetail {\n let a = requestedSignedDistance;\n let status = CurveSearchStatus.success;\n if (!allowExtension && !Geometry.isIn01(endFraction)) {\n // cap the movement at the endpoint\n if (endFraction < 0.0) {\n a = - curve.curveLengthBetweenFractions(startFraction, 0.0);\n endFraction = 0.0;\n status = CurveSearchStatus.stoppedAtBoundary;\n } else if (endFraction > 1.0) {\n endFraction = 1.0;\n a = curve.curveLengthBetweenFractions(startFraction, 1.0);\n status = CurveSearchStatus.stoppedAtBoundary;\n }\n }\n result = result ? result : new CurveLocationDetail();\n result.curve = curve;\n result.fraction = endFraction;\n curve.fractionToPoint(endFraction, result.point);\n result.vectorInCurveLocationDetail = undefined;\n result.a = a;\n result.childDetail = undefined;\n result.curveSearchStatus = status;\n return result;\n }\n /** Create with CurvePrimitive pointer and fraction for evaluation. */\n public static createCurveEvaluatedFraction(\n curve: CurvePrimitive, fraction: number, result?: CurveLocationDetail,\n ): CurveLocationDetail {\n result = result ? result : new CurveLocationDetail();\n result.curve = curve;\n result.fraction = fraction;\n curve.fractionToPoint(fraction, result.point);\n result.vectorInCurveLocationDetail = undefined;\n result.a = 0.0;\n result.childDetail = undefined;\n result.curveSearchStatus = undefined;\n return result;\n }\n /** Create with CurvePrimitive pointer and fraction for evaluation. */\n public static createCurveEvaluatedFractionPointAndDerivative(\n curve: CurvePrimitive, fraction: number, result?: CurveLocationDetail,\n ): CurveLocationDetail {\n result = result ? result : new CurveLocationDetail();\n result.curve = curve;\n result.fraction = fraction;\n const ray = curve.fractionToPointAndDerivative(fraction);\n result.point.setFromPoint3d(ray.origin);\n result.vectorInCurveLocationDetail = ray.direction;\n result.a = 0.0;\n result.childDetail = undefined;\n result.curveSearchStatus = undefined;\n return result;\n }\n /** Create with CurvePrimitive pointer and 2 fractions for evaluation. */\n public static createCurveEvaluatedFractionFraction(\n curve: CurvePrimitive, fraction0: number, fraction1: number, result?: CurveLocationDetail,\n ): CurveLocationDetail {\n result = result ? result : new CurveLocationDetail();\n result.curve = curve;\n result.fraction = fraction0;\n curve.fractionToPoint(fraction0, result.point);\n result.fraction1 = fraction1;\n result.point1 = curve.fractionToPoint(fraction1, result.point1);\n result.vectorInCurveLocationDetail = undefined;\n result.a = 0.0;\n result.childDetail = undefined;\n result.curveSearchStatus = undefined;\n return result;\n }\n /** Create with CurvePrimitive pointer, fraction, and point coordinates. */\n public static createCurveFractionPointDistance(\n curve: CurvePrimitive,\n fraction: number,\n point: Point3d,\n a: number,\n result?: CurveLocationDetail,\n ): CurveLocationDetail {\n result = result ? result : new CurveLocationDetail();\n result.curve = curve;\n result.fraction = fraction;\n result.point.setFromPoint3d(point);\n result.vectorInCurveLocationDetail = undefined;\n result.a = a;\n result.childDetail = undefined;\n result.curveSearchStatus = undefined;\n return result;\n }\n /**\n * Update or create if closer than current contents.\n * @param curve candidate curve\n * @param fraction candidate fraction\n * @param point candidate point\n * @param a candidate distance\n * @returns true if the given distance is smaller (and hence this detail was updated)\n */\n public updateIfCloserCurveFractionPointDistance(\n curve: CurvePrimitive, fraction: number, point: Point3d, a: number,\n ): boolean {\n if (this.a < a)\n return false;\n CurveLocationDetail.createCurveFractionPointDistance(curve, fraction, point, a, this);\n return true;\n }\n /**\n * Exchange the (fraction,fraction1) and (point, point1) pairs.\n * * (Skip each swap if its \"1\" value is undefined)\n */\n public swapFractionsAndPoints(): void {\n if (this.fraction1 !== undefined) {\n const f = this.fraction;\n this.fraction = this.fraction1;\n this.fraction1 = f;\n }\n if (this.point1 !== undefined) {\n const p = this.point;\n this.point = this.point1;\n this.point1 = p;\n }\n }\n /**\n * Return the fraction where f falls between fraction and fraction1.\n * * ASSUME fraction1 defined\n */\n public inverseInterpolateFraction(f: number, defaultFraction: number = 0): number {\n const a = Geometry.inverseInterpolate01(this.fraction, this.fraction1!, f);\n if (a === undefined)\n return defaultFraction;\n return a;\n }\n /**\n * Return the detail with smaller `a` value -- detailA returned if equal.\n * @param detailA first candidate\n * @param detailB second candidate\n */\n public static chooseSmallerA(\n detailA: CurveLocationDetail | undefined, detailB: CurveLocationDetail | undefined,\n ): CurveLocationDetail | undefined {\n if (detailA) {\n if (!detailB)\n return detailA;\n return detailA.a <= detailB.a ? detailA : detailB;\n }\n return detailB;\n }\n /** Compare only the curve and fraction of this detail with `other`. */\n public isSameCurveAndFraction(other: CurveLocationDetail | { curve: CurvePrimitive, fraction: number }): boolean {\n return this.curve === other.curve && Geometry.isAlmostEqualNumber(this.fraction, other.fraction);\n }\n /**\n * Transform the detail in place.\n * * All numerical properties are transformed directly, except:\n * * when `curve` is defined, `point` and `point1` are reset by evaluating the transformed curve at `fraction` and `fraction1`\n * * these properties are untouched: `a`, `fraction`, `fraction1`, `pointQ`\n * @param transform the transform to apply\n * @return true if and only if the transformation was successful. If false, the instance is in an indeterminate\n * state and should not be used.\n */\n public tryTransformInPlace(transform: Transform): boolean {\n if (this.curve && !this.curve.tryTransformInPlace(transform))\n return false;\n if (this.ray)\n this.ray.transformInPlace(transform);\n if (this.curve)\n this.curve.fractionToPoint(this.fraction, this.point);\n else\n transform.multiplyXYAndZInPlace(this.point);\n if (this.vectorInCurveLocationDetail)\n transform.multiplyVectorInPlace(this.vectorInCurveLocationDetail);\n if (this.childDetail && this.childDetail !== this && !this.childDetail.tryTransformInPlace(transform))\n return false;\n if (this.point1) {\n if (this.curve && this.fraction1)\n this.curve.fractionToPoint(this.fraction1, this.point1);\n else\n transform.multiplyXYAndZInPlace(this.point1);\n }\n return true;\n }\n}\n\n/**\n * Enumeration of configurations for intersections and min/max distance-between-curve\n * @public\n */\nexport enum CurveCurveApproachType {\n /** Intersection at a single point */\n Intersection = 0,\n /** Distinct points on the two curves, with each curve's tangent perpendicular to the chord between the points */\n PerpendicularChord = 1,\n /** Completely coincident geometry */\n CoincidentGeometry = 2,\n /** Completely parallel geometry. */\n ParallelGeometry = 3,\n}\n\n/**\n * A pair of CurveLocationDetail.\n * @public\n */\nexport class CurveLocationDetailPair {\n /** The first of the two details. */\n public detailA: CurveLocationDetail;\n /** The second of the two details. */\n public detailB: CurveLocationDetail;\n /**\n * Enumeration of how the detail pairs relate.\n * * This is set only by certain closeApproach calculations.\n */\n public approachType?: CurveCurveApproachType;\n\n public constructor(detailA?: CurveLocationDetail, detailB?: CurveLocationDetail) {\n this.detailA = detailA ? detailA : new CurveLocationDetail();\n this.detailB = detailB ? detailB : new CurveLocationDetail();\n }\n /** Create a curve detail pair using references to two CurveLocationDetails */\n public static createCapture(\n detailA: CurveLocationDetail, detailB: CurveLocationDetail, result?: CurveLocationDetailPair,\n ): CurveLocationDetailPair {\n result = result ? result : new CurveLocationDetailPair();\n result.detailA = detailA;\n result.detailB = detailB;\n return result;\n }\n /**\n * Create a curve detail pair using references to two CurveLocationDetails.\n * * optionally install in reversed positions\n */\n public static createCaptureOptionalReverse(\n detailA: CurveLocationDetail, detailB: CurveLocationDetail, reversed: boolean, result?: CurveLocationDetailPair,\n ): CurveLocationDetailPair {\n result = result ? result : new CurveLocationDetailPair();\n if (reversed) {\n result.detailA = detailA;\n result.detailB = detailB;\n\n } else {\n result.detailA = detailA;\n result.detailB = detailB;\n }\n return result;\n }\n /** Make a deep copy of this CurveLocationDetailPair */\n public clone(result?: CurveLocationDetailPair): CurveLocationDetailPair {\n result = result ? result : new CurveLocationDetailPair();\n result.detailA = this.detailA.clone();\n result.detailB = this.detailB.clone();\n result.approachType = this.approachType;\n return result;\n }\n /** Swap the details of A, B */\n public swapDetails() {\n const q = this.detailA;\n this.detailA = this.detailB;\n this.detailB = q;\n }\n /**\n * Mutate the input array by removing the second of two adjacent duplicate pairs.\n * * Ignores details representing coincident intervals (e.g., for which `fraction1` is defined).\n * * Comparison is performed by [[CurveLocationDetail.isSameCurveAndFraction]].\n * * No sorting is performed.\n * @param pairs array to de-duplicate in place\n * @param index0 look for duplicates in the tail of the array starting at index0\n * @return reference to input array\n * @internal\n */\n public static removeAdjacentDuplicates(pairs: CurveLocationDetailPair[], index0: number = 0): CurveLocationDetailPair[] {\n return pairs.flatMap(\n (pair: CurveLocationDetailPair, i: number, arr: CurveLocationDetailPair[]) => {\n if (i >= index0 && i > 0) {\n if (!pair.detailA.hasFraction1 && !pair.detailB.hasFraction1) {\n if (pair.detailA.isSameCurveAndFraction(arr[i - 1].detailA)) {\n if (pair.detailB.isSameCurveAndFraction(arr[i - 1].detailB)) {\n return []; // remove the i_th pair\n }\n }\n }\n }\n return [pair]; // preserve the i_th pair\n },\n );\n }\n /**\n * Transform the details in place.\n * @param transform the transform to apply\n * @return true if and only if the transformation was successful on both details.\n * If false, the instance is in an indeterminate state and should not be used.\n */\n public tryTransformInPlace(transform: Transform): boolean {\n return this.detailA.tryTransformInPlace(transform) && this.detailB.tryTransformInPlace(transform);\n }\n}\n\n/**\n * Data bundle for a pair of arrays of CurveLocationDetail structures.\n * @deprecated in 4.x - will not be removed until after 2026-06-13. Use CurveLocationDetailPair[] instead.\n * @public\n */\nexport class CurveLocationDetailArrayPair {\n /** First array of details. */\n public dataA: CurveLocationDetail[];\n /** Second array of details. */\n public dataB: CurveLocationDetail[];\n public constructor() {\n this.dataA = [];\n this.dataB = [];\n }\n}\n"]}
|
|
@@ -20,7 +20,7 @@ export type AnyRegion = Loop | ParityRegion | UnionRegion;
|
|
|
20
20
|
/**
|
|
21
21
|
* Union type for a general curve chain, or a `BagOfCurves` understood to be a collection of unrelated chains.
|
|
22
22
|
* @public
|
|
23
|
-
* @deprecated in 4.x -
|
|
23
|
+
* @deprecated in 4.x - will not be removed until after 2026-06-13. Use AnyChain | undefined.
|
|
24
24
|
*/
|
|
25
25
|
export type ChainTypes = CurvePrimitive | Path | BagOfCurves | Loop | undefined;
|
|
26
26
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CurveTypes.js","sourceRoot":"","sources":["../../../src/curve/CurveTypes.ts"],"names":[],"mappings":";AAAA;;;+FAG+F","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\n/** @packageDocumentation\n * @module Curve\n */\n\nimport type { BagOfCurves, CurveCollection } from \"./CurveCollection\";\nimport type { CurvePrimitive } from \"./CurvePrimitive\";\nimport type { Loop } from \"./Loop\";\nimport type { Path } from \"./Path\";\nimport type { ParityRegion } from \"./ParityRegion\";\nimport type { UnionRegion } from \"./UnionRegion\";\n\n/**\n * Union type for `GeometryQuery` classes that have contain curves, either as individual parameter space or as collections.\n * @public\n */\nexport type AnyCurve = CurvePrimitive | CurveCollection;\n\n/**\n * Union type for `GeometryQuery` classes that bound (planar) regions.\n * @public\n */\nexport type AnyRegion = Loop | ParityRegion | UnionRegion;\n\n/**\n * Union type for a general curve chain, or a `BagOfCurves` understood to be a collection of unrelated chains.\n * @public\n * @deprecated in 4.x -
|
|
1
|
+
{"version":3,"file":"CurveTypes.js","sourceRoot":"","sources":["../../../src/curve/CurveTypes.ts"],"names":[],"mappings":";AAAA;;;+FAG+F","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\n/** @packageDocumentation\n * @module Curve\n */\n\nimport type { BagOfCurves, CurveCollection } from \"./CurveCollection\";\nimport type { CurvePrimitive } from \"./CurvePrimitive\";\nimport type { Loop } from \"./Loop\";\nimport type { Path } from \"./Path\";\nimport type { ParityRegion } from \"./ParityRegion\";\nimport type { UnionRegion } from \"./UnionRegion\";\n\n/**\n * Union type for `GeometryQuery` classes that have contain curves, either as individual parameter space or as collections.\n * @public\n */\nexport type AnyCurve = CurvePrimitive | CurveCollection;\n\n/**\n * Union type for `GeometryQuery` classes that bound (planar) regions.\n * @public\n */\nexport type AnyRegion = Loop | ParityRegion | UnionRegion;\n\n/**\n * Union type for a general curve chain, or a `BagOfCurves` understood to be a collection of unrelated chains.\n * @public\n * @deprecated in 4.x - will not be removed until after 2026-06-13. Use AnyChain | undefined.\n */\nexport type ChainTypes = CurvePrimitive | Path | BagOfCurves | Loop | undefined;\n\n/**\n * Union type for a general curve chain, or a `BagOfCurves` understood to be a collection of unrelated chains.\n * @public\n */\nexport type AnyChain = CurvePrimitive | Path | BagOfCurves | Loop;\n"]}
|
|
@@ -29,7 +29,7 @@ export declare class StrokeOptions {
|
|
|
29
29
|
maxEdgeLength?: number;
|
|
30
30
|
/**
|
|
31
31
|
* Caller expects convex facets.
|
|
32
|
-
* @deprecated in 4.x -
|
|
32
|
+
* @deprecated in 4.x - will not be removed until after 2026-06-13. Never used. See [[shouldTriangulate]] and [[maximizeConvexFacets]].
|
|
33
33
|
*/
|
|
34
34
|
needConvexFacets?: boolean;
|
|
35
35
|
/** Minimum strokes on a primitive. */
|
|
@@ -40,7 +40,7 @@ class StrokeOptions {
|
|
|
40
40
|
maxEdgeLength;
|
|
41
41
|
/**
|
|
42
42
|
* Caller expects convex facets.
|
|
43
|
-
* @deprecated in 4.x -
|
|
43
|
+
* @deprecated in 4.x - will not be removed until after 2026-06-13. Never used. See [[shouldTriangulate]] and [[maximizeConvexFacets]].
|
|
44
44
|
*/
|
|
45
45
|
needConvexFacets;
|
|
46
46
|
/** Minimum strokes on a primitive. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StrokeOptions.js","sourceRoot":"","sources":["../../../src/curve/StrokeOptions.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F;;GAEG;AAEH,0CAAuC;AACvC,+CAA4C;AAE5C;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAa,aAAa;IACxB,+CAA+C;IACxC,QAAQ,CAAU;IACzB,0EAA0E;IACnE,QAAQ,CAAS;IACxB,yCAAyC;IAClC,aAAa,CAAU;IAC9B;;;OAGG;IACI,gBAAgB,CAAW;IAClC,sCAAsC;IAC/B,sBAAsB,CAAU;IACvC,sDAAsD;IAC/C,iBAAiB,GAAY,KAAK,CAAC;IAClC,YAAY,CAAW;IACvB,aAAa,CAAW;IACxB,WAAW,CAAW;IAC9B,oCAAoC;IACpC,IAAW,UAAU;QACnB,OAAO,IAAI,CAAC,WAAW,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,KAAK,CAAC;IACnE,CAAC;IACD,IAAW,UAAU,CAAC,KAAc;QAClC,IAAI,CAAC,WAAW,GAAG,KAAK,CAAC;IAC3B,CAAC;IACD,oCAAoC;IACpC,IAAW,WAAW;QACpB,OAAO,I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Q,CAAC;IAClB,CAAC;IACD,iGAAiG;IAC1F,2BAA2B,CAAC,QAAgB;QACjD,IAAI,IAAI,CAAC,sBAAsB,KAAK,SAAS,IAAI,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,sBAAsB,CAAC;eACxF,IAAI,CAAC,sBAAsB,GAAG,QAAQ;YACzC,QAAQ,GAAG,IAAI,CAAC,sBAAsB,CAAC;QACzC,OAAO,QAAQ,CAAC;IAClB,CAAC;IACD;;;;OAIG;IACI,MAAM,CAAC,eAAe;QAC3B,MAAM,OAAO,GAAG,IAAI,aAAa,EAAE,CAAC;QACpC,OAAO,CAAC,QAAQ,GAAG,aAAK,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;QAC7C,OAAO,OAAO,CAAC;IACjB,CAAC;IACD;;;;OAIG;IACI,MAAM,CAAC,eAAe;QAC3B,MAAM,OAAO,GAAG,IAAI,aAAa,EAAE,CAAC;QACpC,OAAO,CAAC,QAAQ,GAAG,aAAK,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;QAC7C,OAAO,OAAO,CAAC;IACjB,CAAC;CACF;AAvMD,sCAuMC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\n/** @packageDocumentation\n * @module Curve\n */\n\nimport { Geometry } from \"../Geometry\";\nimport { Angle } from \"../geometry3d/Angle\";\n\n/**\n * Tolerance blob for various stroking methods.\n *\n * * Across many applications, the critical concepts are: chordTol, angleTol, maxEdgeLength\n * * Chord error is an distance measured from a curve or facet to its approximating stroke or facet.\n * * angle is the angle between two contiguous strokes or across a facet edge.\n * * maxEdgeLength is the length of a stroke or a edge of a facet.\n * * It is rare for all three to be active at once.\n * * Nearly all stroke and facet use cases will apply an angle tolerance.\n * * For curves, 15 degrees is typical\n * * For facets, 22.5 degrees is typical.\n * * Halving the angle tolerance will (roughly) make curves get twice as many strokes, and surfaces get 4 times as many facets.\n * * The angle tolerance has the useful property that its effect is independent of scale of that data. If data is suddenly scaled into millimeters rather than meters, the facet counts remain the same.\n * * When creating output for devices such as 3D printing will want a chord tolerance.\n * * For graphics display, use an angle tolerance of around 15 degrees and an chord tolerance which is the size of several pixels.\n * * Analysis meshes (e.g. Finite Elements) commonly need to apply maxEdgeLength.\n * * Using maxEdgeLength for graphics probably produces too many facets. For example, it causes long cylinders to get many nearly-square facets instead of the small number of long quads usually used for graphics.\n * * Facet tolerances are, as the Pirates' Code, guidelines, not absolute rules. Facet and stroke code may ignore tolerances in awkward situations.\n * * If multiple tolerances are in effect, the actual count will usually be based on the one that demands the most strokes or facets, unless it is so high that it violates some upper limit on the number of facets on an arc or a section of a curve.\n * @public\n */\nexport class StrokeOptions {\n /** Distance from stroke to actual geometry. */\n public chordTol?: number;\n /** Turning angle between strokes. Larger value leads to fewer strokes. */\n public angleTol?: Angle;\n /** Maximum length of a single stroke. */\n public maxEdgeLength?: number;\n /**\n * Caller expects convex facets.\n * @deprecated in 4.x - might be removed in next major version. Never used. See [[shouldTriangulate]] and [[maximizeConvexFacets]].\n */\n public needConvexFacets?: boolean;\n /** Minimum strokes on a primitive. */\n public minStrokesPerPrimitive?: number;\n /** Whether or not to triangulate each added facet. */\n public shouldTriangulate: boolean = false;\n private _needNormals?: boolean;\n private _needTwoSided?: boolean;\n private _needParams?: boolean;\n /** Whether params are requested. */\n public get needParams(): boolean {\n return this._needParams !== undefined ? this._needParams : false;\n }\n public set needParams(value: boolean) {\n this._needParams = value;\n }\n /** Whether normals are requested */\n public get needNormals(): boolean {\n return this._needNormals !== undefined ? this._needNormals : false;\n }\n public set needNormals(value: boolean) {\n this._needNormals = value;\n }\n /**\n * Whether to request facets that are viewable from the back.\n * * Default value is true.\n * * Set to false only if the requested facets are expected to form a closed volume with outward normals,\n * indicating they are amenable to backface culling for improved display performance.\n */\n public get needTwoSided(): boolean {\n return this._needTwoSided !== undefined ? this._needTwoSided : true;\n }\n public set needTwoSided(value: boolean) {\n this._needTwoSided = value;\n }\n /** Optional color request flag */\n public needColors?: boolean;\n /** Default number of strokes for a circle. */\n public defaultCircleStrokes = 16;\n /** Ask if angleTol is specified */\n public get hasAngleTol(): boolean {\n return this.angleTol !== undefined && Math.abs(this.angleTol.radians) > 0.0;\n }\n /** Ask if chordTol is specified */\n public get hasChordTol(): boolean {\n return this.chordTol !== undefined && this.chordTol > 0.0;\n }\n /** Ask if maxEdgeLength is specified */\n public get hasMaxEdgeLength(): boolean {\n return this.maxEdgeLength !== undefined && this.maxEdgeLength > 0.0;\n }\n private _maximizeConvexFacets?: boolean;\n /**\n * Whether to post-process a planar triangulation by removing edges to maximize the size of convex facets.\n * * Setting this to true also sets [[shouldTriangulate]] to true.\n */\n public get maximizeConvexFacets(): boolean {\n return this._maximizeConvexFacets ?? false;\n }\n public set maximizeConvexFacets(value: boolean) {\n this._maximizeConvexFacets = value;\n if (value)\n this.shouldTriangulate = value;\n }\n /** Return a deep clone */\n public clone(): StrokeOptions {\n const options = new StrokeOptions();\n options.chordTol = this.chordTol;\n options.angleTol = this.angleTol?.clone();\n options.maxEdgeLength = this.maxEdgeLength;\n options.minStrokesPerPrimitive = this.minStrokesPerPrimitive;\n options.shouldTriangulate = this.shouldTriangulate;\n options._needNormals = this._needNormals;\n options._needTwoSided = this._needTwoSided;\n options._needParams = this._needParams;\n options.needColors = this.needColors;\n options.defaultCircleStrokes = this.defaultCircleStrokes;\n options._maximizeConvexFacets = this._maximizeConvexFacets;\n return options;\n }\n /** Return stroke count which is the larger of the minCount or count needed for edge length condition. */\n public applyMaxEdgeLength(minCount: number, totalLength: number): number {\n totalLength = Math.abs(totalLength);\n if (this.maxEdgeLength && this.maxEdgeLength > 0.0 && minCount * this.maxEdgeLength < totalLength) {\n minCount = Geometry.stepCount(this.maxEdgeLength, totalLength, minCount);\n }\n return minCount;\n }\n /**\n * Return stroke count which is the larger of the existing count or count needed for angle condition for given\n * sweepRadians.\n * * defaultStepRadians is assumed to be larger than zero.\n */\n public applyAngleTol(minCount: number, sweepRadians: number, defaultStepRadians: number): number {\n return StrokeOptions.applyAngleTol(this, minCount, sweepRadians, defaultStepRadians);\n }\n /**\n * Return stroke count which is the larger of minCount and the count required to turn sweepRadians, using tolerance\n * from the options.\n */\n public static applyAngleTol(\n options: StrokeOptions | undefined, minCount: number, sweepRadians: number, defaultStepRadians?: number,\n ): number {\n sweepRadians = Math.abs(sweepRadians);\n let stepRadians = defaultStepRadians ? defaultStepRadians : Math.PI / 8.0;\n if (options && options.angleTol && options.angleTol.radians > 0.0)\n stepRadians = options.angleTol.radians;\n if (minCount * stepRadians < sweepRadians)\n minCount = Geometry.stepCount(stepRadians, sweepRadians, minCount);\n return minCount;\n }\n /**\n * Return the number of strokes needed for given edgeLength curve.\n * @param options\n * @param minCount smallest allowed count\n * @param edgeLength\n */\n public static applyMaxEdgeLength(\n options: StrokeOptions | undefined, minCount: number, edgeLength: number,\n ): number {\n if (edgeLength < 0)\n edgeLength = - edgeLength;\n if (minCount < 1)\n minCount = 1;\n if (options && options.maxEdgeLength && options.maxEdgeLength * minCount < edgeLength) {\n minCount = Geometry.stepCount(options.maxEdgeLength, edgeLength, minCount);\n }\n return minCount;\n }\n /**\n * Determine a stroke count for a (partial) circular arc of given radius. This considers angle, maxEdgeLength,\n * chord, and minimum stroke.\n */\n public applyTolerancesToArc(radius: number, sweepRadians: number = Math.PI * 2): number {\n let numStrokes = 1;\n numStrokes = this.applyAngleTol(numStrokes, sweepRadians, Math.PI * 0.25);\n numStrokes = this.applyMaxEdgeLength(numStrokes, sweepRadians * radius);\n numStrokes = this.applyChordTol(numStrokes, radius, sweepRadians);\n numStrokes = this.applyMinStrokesPerPrimitive(numStrokes);\n return numStrokes;\n }\n /** Return stroke count which is the larger of existing count or count needed for circular arc chord tolerance condition. */\n public applyChordTol(minCount: number, radius: number, sweepRadians: number): number {\n if (this.chordTol && this.chordTol > 0.0 && this.chordTol < radius) {\n const a = this.chordTol;\n const stepRadians = 2.0 * Math.acos((1.0 - a / radius));\n minCount = Geometry.stepCount(stepRadians, sweepRadians, minCount);\n }\n return minCount;\n }\n /**\n * Return stroke count which is the larger of existing count or count needed for circular arc chord tol with given\n * arc length and radians\n */\n public applyChordTolToLengthAndRadians(minCount: number, length: number, sweepRadians: number): number {\n if (this.chordTol && this.chordTol > 0.0) {\n const radius = Geometry.conditionalDivideFraction(length, sweepRadians);\n if (radius !== undefined)\n return this.applyChordTol(minCount, radius, sweepRadians);\n }\n return minCount;\n }\n /** Return stroke count which is the larger of existing count or `this.minStrokesPerPrimitive` */\n public applyMinStrokesPerPrimitive(minCount: number): number {\n if (this.minStrokesPerPrimitive !== undefined && Number.isFinite(this.minStrokesPerPrimitive)\n && this.minStrokesPerPrimitive > minCount)\n minCount = this.minStrokesPerPrimitive;\n return minCount;\n }\n /**\n * Create `StrokeOptions` with defaults appropriate for curves.\n * * angle tolerance of 15 degrees.\n * * all others inactive.\n */\n public static createForCurves(): StrokeOptions {\n const options = new StrokeOptions();\n options.angleTol = Angle.createDegrees(15.0);\n return options;\n }\n /**\n * Create `StrokeOptions` with defaults appropriate for surfaces facets\n * * angle tolerance of 22.5 degrees.\n * * all others inactive.\n */\n public static createForFacets(): StrokeOptions {\n const options = new StrokeOptions();\n options.angleTol = Angle.createDegrees(22.5);\n return options;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"StrokeOptions.js","sourceRoot":"","sources":["../../../src/curve/StrokeOptions.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F;;GAEG;AAEH,0CAAuC;AACvC,+CAA4C;AAE5C;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAa,aAAa;IACxB,+CAA+C;IACxC,QAAQ,CAAU;IACzB,0EAA0E;IACnE,QAAQ,CAAS;IACxB,yCAAyC;IAClC,aAAa,CAAU;IAC9B;;;OAGG;IACI,gBAAgB,CAAW;IAClC,sCAAsC;IAC/B,sBAAsB,CAAU;IACvC,sDAAsD;IAC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ACD;;;OAGG;IACI,+BAA+B,CAAC,QAAgB,EAAE,MAAc,EAAE,YAAoB;QAC3F,IAAI,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,QAAQ,GAAG,GAAG,EAAE,CAAC;YACzC,MAAM,MAAM,GAAG,mBAAQ,CAAC,yBAAyB,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;YACxE,IAAI,MAAM,KAAK,SAAS;gBACtB,OAAO,IAAI,CAAC,aAAa,CAAC,QAAQ,EAAE,MAAM,EAAE,YAAY,CAAC,CAAC;QAC9D,CAAC;QACD,OAAO,QAAQ,CAAC;IAClB,CAAC;IACD,iGAAiG;IAC1F,2BAA2B,CAAC,QAAgB;QACjD,IAAI,IAAI,CAAC,sBAAsB,KAAK,SAAS,IAAI,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,sBAAsB,CAAC;eACxF,IAAI,CAAC,sBAAsB,GAAG,QAAQ;YACzC,QAAQ,GAAG,IAAI,CAAC,sBAAsB,CAAC;QACzC,OAAO,QAAQ,CAAC;IAClB,CAAC;IACD;;;;OAIG;IACI,MAAM,CAAC,eAAe;QAC3B,MAAM,OAAO,GAAG,IAAI,aAAa,EAAE,CAAC;QACpC,OAAO,CAAC,QAAQ,GAAG,aAAK,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;QAC7C,OAAO,OAAO,CAAC;IACjB,CAAC;IACD;;;;OAIG;IACI,MAAM,CAAC,eAAe;QAC3B,MAAM,OAAO,GAAG,IAAI,aAAa,EAAE,CAAC;QACpC,OAAO,CAAC,QAAQ,GAAG,aAAK,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;QAC7C,OAAO,OAAO,CAAC;IACjB,CAAC;CACF;AAvMD,sCAuMC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\n/** @packageDocumentation\n * @module Curve\n */\n\nimport { Geometry } from \"../Geometry\";\nimport { Angle } from \"../geometry3d/Angle\";\n\n/**\n * Tolerance blob for various stroking methods.\n *\n * * Across many applications, the critical concepts are: chordTol, angleTol, maxEdgeLength\n * * Chord error is an distance measured from a curve or facet to its approximating stroke or facet.\n * * angle is the angle between two contiguous strokes or across a facet edge.\n * * maxEdgeLength is the length of a stroke or a edge of a facet.\n * * It is rare for all three to be active at once.\n * * Nearly all stroke and facet use cases will apply an angle tolerance.\n * * For curves, 15 degrees is typical\n * * For facets, 22.5 degrees is typical.\n * * Halving the angle tolerance will (roughly) make curves get twice as many strokes, and surfaces get 4 times as many facets.\n * * The angle tolerance has the useful property that its effect is independent of scale of that data. If data is suddenly scaled into millimeters rather than meters, the facet counts remain the same.\n * * When creating output for devices such as 3D printing will want a chord tolerance.\n * * For graphics display, use an angle tolerance of around 15 degrees and an chord tolerance which is the size of several pixels.\n * * Analysis meshes (e.g. Finite Elements) commonly need to apply maxEdgeLength.\n * * Using maxEdgeLength for graphics probably produces too many facets. For example, it causes long cylinders to get many nearly-square facets instead of the small number of long quads usually used for graphics.\n * * Facet tolerances are, as the Pirates' Code, guidelines, not absolute rules. Facet and stroke code may ignore tolerances in awkward situations.\n * * If multiple tolerances are in effect, the actual count will usually be based on the one that demands the most strokes or facets, unless it is so high that it violates some upper limit on the number of facets on an arc or a section of a curve.\n * @public\n */\nexport class StrokeOptions {\n /** Distance from stroke to actual geometry. */\n public chordTol?: number;\n /** Turning angle between strokes. Larger value leads to fewer strokes. */\n public angleTol?: Angle;\n /** Maximum length of a single stroke. */\n public maxEdgeLength?: number;\n /**\n * Caller expects convex facets.\n * @deprecated in 4.x - will not be removed until after 2026-06-13. Never used. See [[shouldTriangulate]] and [[maximizeConvexFacets]].\n */\n public needConvexFacets?: boolean;\n /** Minimum strokes on a primitive. */\n public minStrokesPerPrimitive?: number;\n /** Whether or not to triangulate each added facet. */\n public shouldTriangulate: boolean = false;\n private _needNormals?: boolean;\n private _needTwoSided?: boolean;\n private _needParams?: boolean;\n /** Whether params are requested. */\n public get needParams(): boolean {\n return this._needParams !== undefined ? this._needParams : false;\n }\n public set needParams(value: boolean) {\n this._needParams = value;\n }\n /** Whether normals are requested */\n public get needNormals(): boolean {\n return this._needNormals !== undefined ? this._needNormals : false;\n }\n public set needNormals(value: boolean) {\n this._needNormals = value;\n }\n /**\n * Whether to request facets that are viewable from the back.\n * * Default value is true.\n * * Set to false only if the requested facets are expected to form a closed volume with outward normals,\n * indicating they are amenable to backface culling for improved display performance.\n */\n public get needTwoSided(): boolean {\n return this._needTwoSided !== undefined ? this._needTwoSided : true;\n }\n public set needTwoSided(value: boolean) {\n this._needTwoSided = value;\n }\n /** Optional color request flag */\n public needColors?: boolean;\n /** Default number of strokes for a circle. */\n public defaultCircleStrokes = 16;\n /** Ask if angleTol is specified */\n public get hasAngleTol(): boolean {\n return this.angleTol !== undefined && Math.abs(this.angleTol.radians) > 0.0;\n }\n /** Ask if chordTol is specified */\n public get hasChordTol(): boolean {\n return this.chordTol !== undefined && this.chordTol > 0.0;\n }\n /** Ask if maxEdgeLength is specified */\n public get hasMaxEdgeLength(): boolean {\n return this.maxEdgeLength !== undefined && this.maxEdgeLength > 0.0;\n }\n private _maximizeConvexFacets?: boolean;\n /**\n * Whether to post-process a planar triangulation by removing edges to maximize the size of convex facets.\n * * Setting this to true also sets [[shouldTriangulate]] to true.\n */\n public get maximizeConvexFacets(): boolean {\n return this._maximizeConvexFacets ?? false;\n }\n public set maximizeConvexFacets(value: boolean) {\n this._maximizeConvexFacets = value;\n if (value)\n this.shouldTriangulate = value;\n }\n /** Return a deep clone */\n public clone(): StrokeOptions {\n const options = new StrokeOptions();\n options.chordTol = this.chordTol;\n options.angleTol = this.angleTol?.clone();\n options.maxEdgeLength = this.maxEdgeLength;\n options.minStrokesPerPrimitive = this.minStrokesPerPrimitive;\n options.shouldTriangulate = this.shouldTriangulate;\n options._needNormals = this._needNormals;\n options._needTwoSided = this._needTwoSided;\n options._needParams = this._needParams;\n options.needColors = this.needColors;\n options.defaultCircleStrokes = this.defaultCircleStrokes;\n options._maximizeConvexFacets = this._maximizeConvexFacets;\n return options;\n }\n /** Return stroke count which is the larger of the minCount or count needed for edge length condition. */\n public applyMaxEdgeLength(minCount: number, totalLength: number): number {\n totalLength = Math.abs(totalLength);\n if (this.maxEdgeLength && this.maxEdgeLength > 0.0 && minCount * this.maxEdgeLength < totalLength) {\n minCount = Geometry.stepCount(this.maxEdgeLength, totalLength, minCount);\n }\n return minCount;\n }\n /**\n * Return stroke count which is the larger of the existing count or count needed for angle condition for given\n * sweepRadians.\n * * defaultStepRadians is assumed to be larger than zero.\n */\n public applyAngleTol(minCount: number, sweepRadians: number, defaultStepRadians: number): number {\n return StrokeOptions.applyAngleTol(this, minCount, sweepRadians, defaultStepRadians);\n }\n /**\n * Return stroke count which is the larger of minCount and the count required to turn sweepRadians, using tolerance\n * from the options.\n */\n public static applyAngleTol(\n options: StrokeOptions | undefined, minCount: number, sweepRadians: number, defaultStepRadians?: number,\n ): number {\n sweepRadians = Math.abs(sweepRadians);\n let stepRadians = defaultStepRadians ? defaultStepRadians : Math.PI / 8.0;\n if (options && options.angleTol && options.angleTol.radians > 0.0)\n stepRadians = options.angleTol.radians;\n if (minCount * stepRadians < sweepRadians)\n minCount = Geometry.stepCount(stepRadians, sweepRadians, minCount);\n return minCount;\n }\n /**\n * Return the number of strokes needed for given edgeLength curve.\n * @param options\n * @param minCount smallest allowed count\n * @param edgeLength\n */\n public static applyMaxEdgeLength(\n options: StrokeOptions | undefined, minCount: number, edgeLength: number,\n ): number {\n if (edgeLength < 0)\n edgeLength = - edgeLength;\n if (minCount < 1)\n minCount = 1;\n if (options && options.maxEdgeLength && options.maxEdgeLength * minCount < edgeLength) {\n minCount = Geometry.stepCount(options.maxEdgeLength, edgeLength, minCount);\n }\n return minCount;\n }\n /**\n * Determine a stroke count for a (partial) circular arc of given radius. This considers angle, maxEdgeLength,\n * chord, and minimum stroke.\n */\n public applyTolerancesToArc(radius: number, sweepRadians: number = Math.PI * 2): number {\n let numStrokes = 1;\n numStrokes = this.applyAngleTol(numStrokes, sweepRadians, Math.PI * 0.25);\n numStrokes = this.applyMaxEdgeLength(numStrokes, sweepRadians * radius);\n numStrokes = this.applyChordTol(numStrokes, radius, sweepRadians);\n numStrokes = this.applyMinStrokesPerPrimitive(numStrokes);\n return numStrokes;\n }\n /** Return stroke count which is the larger of existing count or count needed for circular arc chord tolerance condition. */\n public applyChordTol(minCount: number, radius: number, sweepRadians: number): number {\n if (this.chordTol && this.chordTol > 0.0 && this.chordTol < radius) {\n const a = this.chordTol;\n const stepRadians = 2.0 * Math.acos((1.0 - a / radius));\n minCount = Geometry.stepCount(stepRadians, sweepRadians, minCount);\n }\n return minCount;\n }\n /**\n * Return stroke count which is the larger of existing count or count needed for circular arc chord tol with given\n * arc length and radians\n */\n public applyChordTolToLengthAndRadians(minCount: number, length: number, sweepRadians: number): number {\n if (this.chordTol && this.chordTol > 0.0) {\n const radius = Geometry.conditionalDivideFraction(length, sweepRadians);\n if (radius !== undefined)\n return this.applyChordTol(minCount, radius, sweepRadians);\n }\n return minCount;\n }\n /** Return stroke count which is the larger of existing count or `this.minStrokesPerPrimitive` */\n public applyMinStrokesPerPrimitive(minCount: number): number {\n if (this.minStrokesPerPrimitive !== undefined && Number.isFinite(this.minStrokesPerPrimitive)\n && this.minStrokesPerPrimitive > minCount)\n minCount = this.minStrokesPerPrimitive;\n return minCount;\n }\n /**\n * Create `StrokeOptions` with defaults appropriate for curves.\n * * angle tolerance of 15 degrees.\n * * all others inactive.\n */\n public static createForCurves(): StrokeOptions {\n const options = new StrokeOptions();\n options.angleTol = Angle.createDegrees(15.0);\n return options;\n }\n /**\n * Create `StrokeOptions` with defaults appropriate for surfaces facets\n * * angle tolerance of 22.5 degrees.\n * * all others inactive.\n */\n public static createForFacets(): StrokeOptions {\n const options = new StrokeOptions();\n options.angleTol = Angle.createDegrees(22.5);\n return options;\n }\n}\n"]}
|
|
@@ -79,7 +79,7 @@ export declare class GrowableXYArray extends IndexedXYCollection {
|
|
|
79
79
|
*/
|
|
80
80
|
static create(data: any, result?: GrowableXYArray): GrowableXYArray;
|
|
81
81
|
/** Restructure MultiLineStringDataVariant as array of GrowableXYZArray
|
|
82
|
-
* @deprecated in 4.x -
|
|
82
|
+
* @deprecated in 4.x - will not be removed until after 2026-06-13. Moved to GrowableXYZArray class.
|
|
83
83
|
*/
|
|
84
84
|
static createArrayOfGrowableXYZArray(data: MultiLineStringDataVariant): GrowableXYZArray[] | undefined;
|
|
85
85
|
/** push a point to the end of the array */
|
|
@@ -146,7 +146,7 @@ class GrowableXYArray extends IndexedXYCollection_1.IndexedXYCollection {
|
|
|
146
146
|
return result;
|
|
147
147
|
}
|
|
148
148
|
/** Restructure MultiLineStringDataVariant as array of GrowableXYZArray
|
|
149
|
-
* @deprecated in 4.x -
|
|
149
|
+
* @deprecated in 4.x - will not be removed until after 2026-06-13. Moved to GrowableXYZArray class.
|
|
150
150
|
*/
|
|
151
151
|
static createArrayOfGrowableXYZArray(data) {
|
|
152
152
|
return GrowableXYZArray_1.GrowableXYZArray.createArrayOfGrowableXYZArray(data);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GrowableXYArray.js","sourceRoot":"","sources":["../../../src/geometry3d/GrowableXYArray.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F;;GAEG;AAEH,0CAAuC;AACvC,yDAAsD;AACtD,+DAA4D;AAG5D,uDAAsD;AACtD,uDAA4C;AAK5C;;GAEG;AACH,MAAa,eAAgB,SAAQ,yCAAmB;IACtD;;OAEG;IACK,KAAK,CAAe;IAC5B;;OAEG;IACK,QAAQ,CAAS;IACzB;;OAEG;IACK,WAAW,CAAS;IAC5B;;OAEG;IACK,aAAa,CAAS;IAE9B;;;OAGG;IACH,YAAmB,YAAoB,CAAC,EAAE,YAAqB;QAC7D,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,KAAK,GAAG,IAAI,YAAY,CAAC,S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GAAG,EAAE;gBAAE,OAAO,CAAC,CAAC,CAAC;QACzB,CAAC;QACD,OAAO,EAAE,GAAG,EAAE,CAAC,CAAC,wDAAwD;IAC1E,CAAC;IAED,oFAAoF;IAC7E,SAAS,CAAC,UAAkB,EAAE,cAAsB;QACzD,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,UAAU,GAAG,cAAc,CAAC,CAAC;IACrD,CAAC;IACD,+BAA+B;IACxB,aAAa,CAAC,KAAsB,EAAE,YAAoB,mBAAQ,CAAC,mBAAmB;QAC3F,MAAM,KAAK,GAAG,IAAI,CAAC,QAAQ,CAAC;QAC5B,IAAI,KAAK,CAAC,QAAQ,KAAK,KAAK;YAC1B,OAAO,KAAK,CAAC;QACf,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;QACzB,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC;QAC1B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,KAAK,EAAE,CAAC,EAAE,EAAE,CAAC;YACnC,IAAI,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,SAAS;gBAC3C,OAAO,KAAK,CAAC;QACjB,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AArsBD,0CAqsBC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\n/** @packageDocumentation\n * @module ArraysAndInterfaces\n */\n\nimport { Geometry } from \"../Geometry\";\nimport { GrowableXYZArray } from \"./GrowableXYZArray\";\nimport { IndexedXYCollection } from \"./IndexedXYCollection\";\nimport { MultiLineStringDataVariant } from \"./IndexedXYZCollection\";\nimport { Matrix3d } from \"./Matrix3d\";\nimport { Point2d, Vector2d } from \"./Point2dVector2d\";\nimport { Point3d } from \"./Point3dVector3d\";\nimport { Range2d } from \"./Range\";\nimport { Transform } from \"./Transform\";\nimport { XAndY, XYAndZ } from \"./XYZProps\";\n\n/** `GrowableXYArray` manages a (possibly growing) Float64Array to pack xy coordinates.\n * @public\n */\nexport class GrowableXYArray extends IndexedXYCollection {\n /**\n * array of packed xy xy xy components\n */\n private _data: Float64Array;\n /**\n * Number of xy tuples (not floats) in the array\n */\n private _xyInUse: number;\n /**\n * capacity in xy tuples. (not floats)\n */\n private _xyCapacity: number;\n /**\n * multiplier used by ensureCapacity to expand requested reallocation size\n */\n private _growthFactor: number;\n\n /** Construct a new GrowablePoint2d array.\n * @param numPoints initial capacity in xy tuples (default 8)\n * @param growthFactor used by ensureCapacity to expand requested reallocation size (default 1.5)\n */\n public constructor(numPoints: number = 8, growthFactor?: number) {\n super();\n this._data = new Float64Array(numPoints * 2); // 2 values per point\n this._xyInUse = 0;\n this._xyCapacity = numPoints;\n this._growthFactor = (undefined !== growthFactor && growthFactor >= 1.0) ? growthFactor : 1.5;\n }\n\n /** Copy xy points from source array. Does not reallocate or change active point count.\n * @param source array to copy from\n * @param sourceCount copy the first sourceCount points; all points if undefined\n * @param destOffset copy to instance array starting at this point index; zero if undefined\n * @return count and offset of points copied\n */\n protected copyData(source: Float64Array | number[], sourceCount?: number, destOffset?: number): { count: number, offset: number } {\n // validate inputs and convert from points to entries\n let myOffset = (undefined !== destOffset) ? destOffset * 2 : 0;\n if (myOffset < 0)\n myOffset = 0;\n if (myOffset >= this._data.length)\n return { count: 0, offset: 0 };\n let myCount = (undefined !== sourceCount) ? sourceCount * 2 : source.length;\n if (myCount > 0) {\n if (myCount > source.length)\n myCount = source.length;\n if (myOffset + myCount > this._data.length)\n myCount = this._data.length - myOffset;\n if (myCount % 2 !== 0)\n myCount -= myCount % 2;\n }\n if (myCount <= 0)\n return { count: 0, offset: 0 };\n if (myCount === source.length)\n this._data.set(source, myOffset);\n else if (source instanceof Float64Array)\n this._data.set(source.subarray(0, myCount), myOffset);\n else\n this._data.set(source.slice(0, myCount), myOffset);\n return { count: myCount / 2, offset: myOffset / 2 };\n }\n\n /** The number of points in use. When the length is increased, the array is padded with zeroes. */\n public override get length() { return this._xyInUse; }\n public set length(newLength: number) { this.resize(newLength, true); }\n\n /** Return the number of float64 in use. */\n public get float64Length() { return this._xyInUse * 2; }\n /** Return the raw packed data.\n * * Note that the length of the returned Float64Array is a count of doubles, and includes the excess capacity\n */\n public float64Data(): Float64Array { return this._data; }\n\n /** If necessary, increase the capacity to a new pointCount. Current coordinates and point count (length) are unchanged. */\n public ensureCapacity(pointCapacity: number, applyGrowthFactor: boolean = true) {\n if (pointCapacity > this._xyCapacity) {\n if (applyGrowthFactor)\n pointCapacity *= this._growthFactor;\n const prevData = this._data;\n this._data = new Float64Array(pointCapacity * 2);\n this.copyData(prevData, this._xyInUse);\n this._xyCapacity = pointCapacity;\n }\n }\n /**\n * * If pointCount is less than current length, just reset current length to pointCount, effectively trimming active points but preserving original capacity.\n * * If pointCount is greater than current length, reallocate to exactly pointCount, copy existing points, and optionally pad excess with zero.\n * @param pointCount new number of active points in array\n * @param padWithZero when increasing point count, whether to zero out new points (default false)\n */\n public resize(pointCount: number, padWithZero?: boolean) {\n if (pointCount >= 0 && pointCount < this._xyInUse)\n this._xyInUse = pointCount;\n else if (pointCount > this._xyInUse) {\n this.ensureCapacity(pointCount, false);\n if (padWithZero ?? false)\n this._data.fill(0, this._xyInUse * 2);\n this._xyInUse = pointCount;\n }\n }\n /**\n * Make a copy of the (active) points in this array.\n * (The clone does NOT get excess capacity)\n */\n public clone(): GrowableXYArray {\n const newPoints = new GrowableXYArray(this.length);\n newPoints.copyData(this._data, this.length);\n newPoints._xyInUse = this.length;\n return newPoints;\n }\n /** Create an array populated from\n * Valid inputs are:\n * * Point2d\n * * Point3d\n * * An array of 2 doubles\n * * An array of 3 doubles\n * * A GrowableXYZArray\n * * A GrowableXYArray\n * * Any json object satisfying Point3d.isXAndY\n * * A Float64Array of doubles, interpreted as xyxy\n * * An array of any of the above\n */\n public static create(data: any, result?: GrowableXYArray): GrowableXYArray {\n if (result) {\n result.clear();\n } else {\n const pointCount = typeof data[0] === \"number\" ? data.length / 2 : data.length;\n result = new GrowableXYArray(pointCount);\n }\n result.pushFrom(data);\n return result;\n }\n\n /** Restructure MultiLineStringDataVariant as array of GrowableXYZArray\n * @deprecated in 4.x - might be removed in next major version. Moved to GrowableXYZArray class.\n */\n public static createArrayOfGrowableXYZArray(data: MultiLineStringDataVariant): GrowableXYZArray[] | undefined {\n return GrowableXYZArray.createArrayOfGrowableXYZArray(data);\n }\n /** push a point to the end of the array */\n public push(toPush: XAndY) {\n this.pushXY(toPush.x, toPush.y);\n }\n\n /** push all points of an array */\n public pushAll(points: XAndY[]) {\n this.ensureCapacity(this._xyInUse + points.length, false);\n for (const p of points)\n this.push(p);\n }\n /** push all points of an array */\n public pushAllXYAndZ(points: XYAndZ[] | GrowableXYZArray) {\n this.ensureCapacity(this._xyInUse + points.length, false);\n if (points instanceof GrowableXYZArray) {\n const xyzBuffer = points.float64Data();\n const n = points.length * 3;\n for (let i = 0; i + 2 < n; i += 3)\n this.pushXY(xyzBuffer[i], xyzBuffer[i + 1]);\n } else {\n for (const p of points) this.pushXY(p.x, p.y);\n }\n }\n /** Push copies of points from variant sources.\n * Valid inputs are:\n * * Point2d\n * * Point3d\n * * An array of 2 doubles\n * * A GrowableXYArray\n * * A GrowableXYZArray\n * * Any json object satisfying Point3d.isXAndY\n * * A Float64Array of doubles, interpreted as xyxy\n * * An array of any of the above\n */\n public pushFrom(p: any) {\n if (p instanceof Point3d) {\n this.pushXY(p.x, p.y);\n } else if (p instanceof GrowableXYZArray) {\n this.pushAllXYAndZ(p);\n } else if (p instanceof Point2d) {\n this.pushXY(p.x, p.y);\n } else if (Geometry.isNumberArray(p, 3) || p instanceof Float64Array) {\n const xyToAdd = Math.trunc(p.length / 2);\n this.ensureCapacity(this._xyInUse + xyToAdd, false);\n this.copyData(p, xyToAdd, this._xyInUse);\n this._xyInUse += xyToAdd;\n } else if (Geometry.isNumberArray(p, 2)) {\n this.pushXY(p[0], p[1]);\n } else if (Array.isArray(p)) {\n // direct recursion re-wraps p and goes infinite. Unroll here.\n for (const q of p)\n this.pushFrom(q);\n } else if (Point3d.isXAndY(p)) {\n this.pushXY(p.x, p.y);\n } else if (p instanceof IndexedXYCollection) {\n const n = p.length;\n this.ensureCapacity(this._xyInUse + n, false);\n for (let i = 0; i < n; i++)\n this.pushXY(p.getXAtUncheckedPointIndex(i), p.getYAtUncheckedPointIndex(i));\n }\n }\n /**\n * Replicate numWrap xy values from the front of the array as new values at the end.\n * @param numWrap number of xy values to replicate\n */\n public pushWrap(numWrap: number) {\n if (this._xyInUse >= numWrap) {\n this.ensureCapacity(this._xyInUse + numWrap, false);\n for (let i = 0; i < numWrap; i++) {\n const k = 2 * i;\n this.pushXY(this._data[k], this._data[k + 1]);\n }\n }\n }\n /** push a point given by x,y coordinates */\n public pushXY(x: number, y: number) {\n this.ensureCapacity(this._xyInUse + 1);\n const index = this._xyInUse * 2;\n this._data[index] = x;\n this._data[index + 1] = y;\n this._xyInUse++;\n }\n\n /** Remove one point from the back.\n * * NOTE that (in the manner of std::vector native) this is \"just\" removing the point -- no point is NOT returned.\n * * Use `back ()` to get the last x,y assembled into a `Point2d `\n */\n public pop() {\n if (this._xyInUse > 0)\n this._xyInUse--;\n }\n /**\n * Test if index is valid for an xy (point or vector) within this array\n * @param index xy index to test.\n */\n public isIndexValid(index: number): boolean {\n if (index >= this._xyInUse || index < 0)\n return false;\n return true;\n }\n /**\n * Clear all xy data, but leave capacity unchanged.\n */\n public clear() {\n this._xyInUse = 0;\n }\n /**\n * Get a point by index, strongly typed as a Point2d. This is unchecked. Use atPoint2dIndex to have validity test.\n * @param pointIndex index to access\n * @param result optional result\n */\n public getPoint2dAtUncheckedPointIndex(pointIndex: number, result?: Point2d): Point2d {\n const index = 2 * pointIndex;\n return Point2d.create(this._data[index], this._data[index + 1], result);\n }\n\n /**\n * Get x coordinate by point index, with no index checking\n * @param pointIndex index to access\n */\n public override getXAtUncheckedPointIndex(pointIndex: number): number {\n return this._data[2 * pointIndex];\n }\n\n /**\n * Get y coordinate by point index, with no index checking\n * @param pointIndex index to access\n */\n public override getYAtUncheckedPointIndex(pointIndex: number): number {\n return this._data[2 * pointIndex + 1];\n }\n\n /**\n * Gather all points as a Point2d[]\n */\n public getPoint2dArray(): Point2d[] {\n const n = 2 * this._xyInUse;\n const result = [];\n const data = this._data;\n for (let i = 0; i < n; i += 2)\n result.push(Point2d.create(data[i], data[i + 1]));\n return result;\n }\n\n /** copy xy into strongly typed Point2d */\n public override getPoint2dAtCheckedPointIndex(pointIndex: number, result?: Point2d): Point2d | undefined {\n if (this.isIndexValid(pointIndex)) {\n const index = 2 * pointIndex;\n return Point2d.create(this._data[index], this._data[index + 1], result);\n }\n return undefined;\n }\n\n /** copy xy into strongly typed Vector2d */\n public override getVector2dAtCheckedVectorIndex(vectorIndex: number, result?: Vector2d): Vector2d | undefined {\n if (this.isIndexValid(vectorIndex)) {\n const index = 2 * vectorIndex;\n return Vector2d.create(this._data[index], this._data[index + 1], result);\n }\n return undefined;\n }\n\n /**\n * Read coordinates from source array, place them at index within this array.\n * @param destIndex point index where coordinates are to be placed in this array\n * @param source source array\n * @param sourceIndex point index in source array\n * @returns true if destIndex and sourceIndex are both valid.\n */\n public transferFromGrowableXYArray(destIndex: number, source: GrowableXYArray, sourceIndex: number): boolean {\n if (this.isIndexValid(destIndex) && source.isIndexValid(sourceIndex)) {\n const i = destIndex * 2;\n const j = sourceIndex * 2;\n this._data[i] = source._data[j];\n this._data[i + 1] = source._data[j + 1];\n return true;\n }\n return false;\n }\n\n /**\n * push coordinates from the source array to the end of this array.\n * @param source source array\n * @param sourceIndex xy index within the source. If undefined, push entire contents of source\n * @returns number of points pushed.\n */\n public pushFromGrowableXYArray(source: GrowableXYArray, sourceIndex?: number): number {\n // full array push . . .\n if (sourceIndex === undefined) {\n const numXYAdd = source.length;\n this.ensureCapacity(this.length + numXYAdd, false);\n this.copyData(source._data, numXYAdd, this.length);\n this._xyInUse += numXYAdd;\n return numXYAdd;\n }\n // single point push . . .\n if (source.isIndexValid(sourceIndex)) {\n const j = sourceIndex * 2;\n this.pushXY(source._data[j], source._data[j + 1]);\n return 1;\n }\n return 0;\n }\n\n /**\n * * Compute a point at fractional coordinate between points i and j of source\n * * push onto this array.\n */\n public pushInterpolatedFromGrowableXYArray(source: GrowableXYArray, i: number, fraction: number, j: number) {\n if (source.isIndexValid(i) && source.isIndexValid(j)) {\n const fraction0 = 1.0 - fraction;\n const data = source._data;\n i = 2 * i;\n j = 2 * j;\n this.pushXY(\n fraction0 * data[i] + fraction * data[j],\n fraction0 * data[i + 1] + fraction * data[j + 1]);\n }\n }\n\n /**\n * Create an array of xy points from source xyz points.\n * @param source source array of xyz\n * @param transform optional transform to apply to xyz points.\n * @param dest optional result.\n */\n public static createFromGrowableXYZArray(source: GrowableXYZArray, transform?: Transform, dest?: GrowableXYArray) {\n const numPoints = source.length;\n if (!dest)\n dest = new GrowableXYArray(numPoints);\n else {\n dest.ensureCapacity(numPoints, false);\n dest.clear();\n }\n if (transform) {\n const packedXYZ = source.float64Data();\n const nDouble = 3 * numPoints;\n let x, y, z;\n for (let i = 0; i < nDouble; i += 3) {\n x = packedXYZ[i];\n y = packedXYZ[i + 1];\n z = packedXYZ[i + 2];\n dest.pushXY(transform.multiplyComponentXYZ(0, x, y, z), transform.multiplyComponentXYZ(1, x, y, z));\n }\n } else {\n dest.pushAllXYAndZ(source);\n }\n return dest;\n }\n /**\n * Return the first point, or undefined if the array is empty.\n */\n public front(result?: Point2d): Point2d | undefined {\n if (this._xyInUse === 0) return undefined;\n return this.getPoint2dAtUncheckedPointIndex(0, result);\n }\n /**\n * Return the last point, or undefined if the array is empty.\n */\n public back(result?: Point2d): Point2d | undefined {\n if (this._xyInUse < 1) return undefined;\n return this.getPoint2dAtUncheckedPointIndex(this._xyInUse - 1, result);\n }\n /**\n * Set the coordinates of a single point.\n * @param pointIndex index of point to set\n * @param value coordinates to set\n */\n public setAtCheckedPointIndex(pointIndex: number, value: XAndY): boolean {\n if (!this.isIndexValid(pointIndex))\n return false;\n const index = pointIndex * 2;\n this._data[index] = value.x;\n this._data[index + 1] = value.y;\n return true;\n }\n /**\n * Set the coordinates of a single point given as coordinates.\n * @param pointIndex index of point to set\n * @param x x coordinate\n * @param y y coordinate\n */\n public setXYAtCheckedPointIndex(pointIndex: number, x: number, y: number): boolean {\n if (!this.isIndexValid(pointIndex))\n return false;\n const index = pointIndex * 2;\n this._data[index] = x;\n this._data[index + 1] = y;\n return true;\n }\n /**\n * Copy all points into a simple array of Point3d with given z.\n */\n public getPoint3dArray(z: number = 0): Point3d[] {\n const n = 2 * this._xyInUse;\n const result = [];\n const data = this._data;\n for (let i = 0; i < n; i += 2)\n result.push(Point3d.create(data[i], data[i + 1], z));\n return result;\n }\n /** reverse the order of points. */\n public reverseInPlace() {\n const n = this.length;\n let j0, j1;\n let a;\n const data = this._data;\n for (let i0 = 0, i1 = n - 1; i0 < i1; i0++, i1--) {\n j0 = 2 * i0;\n j1 = 2 * i1;\n a = data[j0]; data[j0] = data[j1]; data[j1] = a;\n j0++;\n j1++;\n a = data[j0]; data[j0] = data[j1]; data[j1] = a;\n }\n }\n\n /** multiply each point by the transform, replace values. */\n public multiplyTransformInPlace(transform: Transform) {\n const data = this._data;\n const nDouble = this.float64Length;\n const coffs = transform.matrix.coffs;\n const origin = transform.origin;\n const x0 = origin.x;\n const y0 = origin.y;\n let x = 0;\n let y = 0;\n for (let i = 0; i + 1 < nDouble; i += 2) {\n x = data[i];\n y = data[i + 1];\n data[i] = coffs[0] * x + coffs[1] * y + x0;\n data[i + 1] = coffs[3] * x + coffs[4] * y + y0;\n }\n }\n\n /** multiply each xy (as a vector) by matrix, replace values. */\n public multiplyMatrix3dInPlace(matrix: Matrix3d) {\n const data = this._data;\n const nDouble = this.float64Length;\n const coffs = matrix.coffs;\n let x = 0;\n let y = 0;\n for (let i = 0; i + 1 < nDouble; i += 2) {\n x = data[i];\n y = data[i + 1];\n data[i] = coffs[0] * x + coffs[1] * y;\n data[i + 1] = coffs[3] * x + coffs[4] * y;\n }\n }\n\n /** multiply each point by the transform, replace values. */\n public tryTransformInverseInPlace(transform: Transform): boolean {\n const data = this._data;\n const nDouble = this.float64Length;\n const matrix = transform.matrix;\n matrix.computeCachedInverse(true);\n const coffs = matrix.inverseCoffs;\n if (!coffs)\n return false;\n const origin = transform.origin;\n const x0 = origin.x;\n const y0 = origin.y;\n let x = 0;\n let y = 0;\n for (let i = 0; i + 1 < nDouble; i += 2) {\n x = data[i] - x0;\n y = data[i + 1] - y0;\n data[i] = coffs[0] * x + coffs[1] * y;\n data[i + 1] = coffs[3] * x + coffs[4] * y;\n }\n return true;\n }\n /** Extend a `Range2d`, optionally transforming the points. */\n public extendRange(rangeToExtend: Range2d, transform?: Transform) {\n const numDouble = this.float64Length;\n const data = this._data;\n if (transform) {\n for (let i = 0; i + 1 < numDouble; i += 2)\n rangeToExtend.extendTransformedXY(transform, data[i], data[i + 1]);\n } else {\n for (let i = 0; i + 1 < numDouble; i += 2)\n rangeToExtend.extendXY(data[i], data[i + 1]);\n\n }\n }\n /** sum the lengths of segments between points. */\n public sumLengths(): number {\n let sum = 0.0;\n const n = 2 * (this._xyInUse - 1); // Length already takes into account what specifically is in use\n const data = this._data;\n for (let i = 0; i < n; i += 2) sum += Geometry.hypotenuseXY(\n data[i + 2] - data[i],\n data[i + 3] - data[i + 1]);\n return sum;\n }\n /**\n * Multiply each x,y by the scale factor.\n * @param factor\n */\n public scaleInPlace(factor: number) {\n if (this._data) {\n const numFloat = this.float64Length;\n for (let i = 0; i < numFloat; i++)\n this._data[i] = this._data[i] * factor;\n }\n }\n /** Compute a point at fractional coordinate between points i and j */\n public interpolate(i: number, fraction: number, j: number, result?: Point2d): Point2d | undefined {\n if (this.isIndexValid(i) && this.isIndexValid(j)) {\n const fraction0 = 1.0 - fraction;\n const data = this._data;\n i = 2 * i;\n j = 2 * j;\n return Point2d.create(\n fraction0 * data[i] + fraction * data[j],\n fraction0 * data[i + 1] + fraction * data[j + 1], result);\n }\n return undefined;\n }\n\n /** Sum the signed areas of the projection to xy plane */\n public areaXY(): number {\n let area = 0.0;\n const n = 2 * this._xyInUse; // float count !!\n if (n > 4) {\n const x0 = this._data[n - 2];\n const y0 = this._data[n - 1];\n let dx1 = this._data[0] - x0;\n let dy1 = this._data[1] - y0;\n let dx2 = 0;\n let dy2 = 0;\n for (let i = 2; i < n; i += 2, dx1 = dx2, dy1 = dy2) {\n dx2 = this._data[i] - x0;\n dy2 = this._data[i + 1] - y0;\n area += Geometry.crossProductXYXY(dx1, dy1, dx2, dy2);\n }\n }\n return 0.5 * area;\n }\n\n /** Compute a vector from index origin i to indexed target j */\n public override vectorIndexIndex(i: number, j: number, result?: Vector2d): Vector2d | undefined {\n if (!this.isIndexValid(i) || !this.isIndexValid(j))\n return undefined;\n const data = this._data;\n i = 2 * i;\n j = 2 * j;\n return Vector2d.create(data[j] - data[i], data[j + 1] - data[i + 1], result);\n }\n\n /** Compute a vector from origin to indexed target j */\n public override vectorXAndYIndex(origin: XAndY, j: number, result?: Vector2d): Vector2d | undefined {\n if (this.isIndexValid(j)) {\n const data = this._data;\n j = 2 * j;\n return Vector2d.create(\n data[j] - origin.x,\n data[j + 1] - origin.y, result);\n }\n return undefined;\n }\n\n /** Compute the cross product of vectors from from indexed origin to indexed targets i and j */\n public override crossProductIndexIndexIndex(originIndex: number, targetAIndex: number, targetBIndex: number): number | undefined {\n if (this.isIndexValid(originIndex) && this.isIndexValid(targetAIndex) && this.isIndexValid(targetBIndex)) {\n const i = originIndex * 2;\n const j = targetAIndex * 2;\n const k = targetBIndex * 2;\n const data = this._data;\n return Geometry.crossProductXYXY(\n data[j] - data[i], data[j + 1] - data[i + 1],\n data[k] - data[i], data[k + 1] - data[i + 1]);\n }\n return undefined;\n }\n\n /** Compute the cross product of vectors from from origin to indexed targets i and j */\n public override crossProductXAndYIndexIndex(origin: XAndY, targetAIndex: number, targetBIndex: number): number | undefined {\n if (this.isIndexValid(targetAIndex) && this.isIndexValid(targetBIndex)) {\n const j = targetAIndex * 2;\n const k = targetBIndex * 2;\n const data = this._data;\n return Geometry.crossProductXYXY(\n data[j] - origin.x, data[j + 1] - origin.y,\n data[k] - origin.x, data[k + 1] - origin.y);\n }\n return undefined;\n }\n\n /** Return the distance between two points in the array. */\n public distance(i: number, j: number): number | undefined {\n if (this.isIndexValid(i) && this.isIndexValid(j)) {\n const i0 = 2 * i;\n const j0 = 2 * j;\n return Geometry.hypotenuseXY(\n this._data[j0] - this._data[i0],\n this._data[j0 + 1] - this._data[i0 + 1]);\n }\n return undefined;\n }\n /** Return the distance between an array point and the input point. */\n public distanceIndexToPoint(i: number, spacePoint: Point2d): number | undefined {\n if (this.isIndexValid(i)) {\n const i0 = 2 * i;\n return Geometry.hypotenuseXY(\n spacePoint.x - this._data[i0],\n spacePoint.y - this._data[i0 + 1]);\n }\n return undefined;\n }\n /** Test for nearly equal arrays. */\n public static isAlmostEqual(dataA: GrowableXYArray | undefined, dataB: GrowableXYArray | undefined): boolean {\n if (dataA && dataB) {\n if (dataA.length !== dataB.length)\n return false;\n for (let i = 0; i < dataA.length; i++)\n if (!dataA.getPoint2dAtUncheckedPointIndex(i).isAlmostEqual(dataB.getPoint2dAtUncheckedPointIndex(i)))\n return false;\n return true;\n }\n // if both are null it is equal, otherwise unequal\n return (!dataA && !dataB);\n }\n\n /** Return an array of block indices sorted per compareLexicalBlock function */\n public sortIndicesLexical(): Uint32Array {\n const n = this._xyInUse;\n // let numCompare = 0;\n const result = new Uint32Array(n);\n for (let i = 0; i < n; i++) result[i] = i;\n result.sort(\n (blockIndexA: number, blockIndexB: number) => {\n // numCompare++;\n return this.compareLexicalBlock(blockIndexA, blockIndexB);\n });\n // console.log (n, numCompare);\n return result;\n }\n\n /** compare two blocks in simple lexical order. */\n public compareLexicalBlock(ia: number, ib: number): number {\n let ax = 0;\n let bx = 0;\n for (let i = 0; i < 2; i++) {\n ax = this._data[ia * 2 + i];\n bx = this._data[ib * 2 + i];\n if (ax > bx) return 1;\n if (ax < bx) return -1;\n }\n return ia - ib; // so original order is maintained among duplicates !!!!\n }\n\n /** Access a single double at offset within a block. This has no index checking. */\n public component(pointIndex: number, componentIndex: number): number {\n return this._data[2 * pointIndex + componentIndex];\n }\n /** Toleranced equality test */\n public isAlmostEqual(other: GrowableXYArray, tolerance: number = Geometry.smallMetricDistance): boolean {\n const numXY = this._xyInUse;\n if (other._xyInUse !== numXY)\n return false;\n const dataA = this._data;\n const dataB = other._data;\n for (let i = 0; i < 2 * numXY; i++) {\n if (Math.abs(dataA[i] - dataB[i]) > tolerance)\n return false;\n }\n return true;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"GrowableXYArray.js","sourceRoot":"","sources":["../../../src/geometry3d/GrowableXYArray.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F;;GAEG;AAEH,0CAAuC;AACvC,yDAAsD;AACtD,+DAA4D;AAG5D,uDAAsD;AACtD,uDAA4C;AAK5C;;GAEG;AACH,MAAa,eAAgB,SAAQ,yCAAmB;IACtD;;OAEG;IACK,KAAK,CAAe;IAC5B;;OAEG;IACK,QAAQ,CAAS;IACzB;;OAEG;IACK,WAAW,CAAS;IAC5B;;OAEG;IACK,aAAa,CAAS;IAE9B;;;OAGG;IACH,YAAmB,YAAoB,CAAC,EAAE,YAAqB;QAC7D,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,KAAK,GAAG,IAAI,YAAY,CAAC,SAAS,GAAG,CAAC,CAAC,CAAC,CAAG,qBAAqB;QACrE,IAAI,CAAC,QAAQ,GAAG,CAAC,CAAC;QAClB,IAAI,CAAC,WAAW,GAAG,SAAS,CAAC;QAC7B,IAAI,CAAC,aAAa,GAAG,CAAC,SAAS,KAAK,YAAY,IAAI,YAAY,IAAI,GAAG,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,CAA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;IACrD,CAAC;IACD,+BAA+B;IACxB,aAAa,CAAC,KAAsB,EAAE,YAAoB,mBAAQ,CAAC,mBAAmB;QAC3F,MAAM,KAAK,GAAG,IAAI,CAAC,QAAQ,CAAC;QAC5B,IAAI,KAAK,CAAC,QAAQ,KAAK,KAAK;YAC1B,OAAO,KAAK,CAAC;QACf,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;QACzB,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC;QAC1B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,KAAK,EAAE,CAAC,EAAE,EAAE,CAAC;YACnC,IAAI,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,SAAS;gBAC3C,OAAO,KAAK,CAAC;QACjB,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AArsBD,0CAqsBC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\n/** @packageDocumentation\n * @module ArraysAndInterfaces\n */\n\nimport { Geometry } from \"../Geometry\";\nimport { GrowableXYZArray } from \"./GrowableXYZArray\";\nimport { IndexedXYCollection } from \"./IndexedXYCollection\";\nimport { MultiLineStringDataVariant } from \"./IndexedXYZCollection\";\nimport { Matrix3d } from \"./Matrix3d\";\nimport { Point2d, Vector2d } from \"./Point2dVector2d\";\nimport { Point3d } from \"./Point3dVector3d\";\nimport { Range2d } from \"./Range\";\nimport { Transform } from \"./Transform\";\nimport { XAndY, XYAndZ } from \"./XYZProps\";\n\n/** `GrowableXYArray` manages a (possibly growing) Float64Array to pack xy coordinates.\n * @public\n */\nexport class GrowableXYArray extends IndexedXYCollection {\n /**\n * array of packed xy xy xy components\n */\n private _data: Float64Array;\n /**\n * Number of xy tuples (not floats) in the array\n */\n private _xyInUse: number;\n /**\n * capacity in xy tuples. (not floats)\n */\n private _xyCapacity: number;\n /**\n * multiplier used by ensureCapacity to expand requested reallocation size\n */\n private _growthFactor: number;\n\n /** Construct a new GrowablePoint2d array.\n * @param numPoints initial capacity in xy tuples (default 8)\n * @param growthFactor used by ensureCapacity to expand requested reallocation size (default 1.5)\n */\n public constructor(numPoints: number = 8, growthFactor?: number) {\n super();\n this._data = new Float64Array(numPoints * 2); // 2 values per point\n this._xyInUse = 0;\n this._xyCapacity = numPoints;\n this._growthFactor = (undefined !== growthFactor && growthFactor >= 1.0) ? growthFactor : 1.5;\n }\n\n /** Copy xy points from source array. Does not reallocate or change active point count.\n * @param source array to copy from\n * @param sourceCount copy the first sourceCount points; all points if undefined\n * @param destOffset copy to instance array starting at this point index; zero if undefined\n * @return count and offset of points copied\n */\n protected copyData(source: Float64Array | number[], sourceCount?: number, destOffset?: number): { count: number, offset: number } {\n // validate inputs and convert from points to entries\n let myOffset = (undefined !== destOffset) ? destOffset * 2 : 0;\n if (myOffset < 0)\n myOffset = 0;\n if (myOffset >= this._data.length)\n return { count: 0, offset: 0 };\n let myCount = (undefined !== sourceCount) ? sourceCount * 2 : source.length;\n if (myCount > 0) {\n if (myCount > source.length)\n myCount = source.length;\n if (myOffset + myCount > this._data.length)\n myCount = this._data.length - myOffset;\n if (myCount % 2 !== 0)\n myCount -= myCount % 2;\n }\n if (myCount <= 0)\n return { count: 0, offset: 0 };\n if (myCount === source.length)\n this._data.set(source, myOffset);\n else if (source instanceof Float64Array)\n this._data.set(source.subarray(0, myCount), myOffset);\n else\n this._data.set(source.slice(0, myCount), myOffset);\n return { count: myCount / 2, offset: myOffset / 2 };\n }\n\n /** The number of points in use. When the length is increased, the array is padded with zeroes. */\n public override get length() { return this._xyInUse; }\n public set length(newLength: number) { this.resize(newLength, true); }\n\n /** Return the number of float64 in use. */\n public get float64Length() { return this._xyInUse * 2; }\n /** Return the raw packed data.\n * * Note that the length of the returned Float64Array is a count of doubles, and includes the excess capacity\n */\n public float64Data(): Float64Array { return this._data; }\n\n /** If necessary, increase the capacity to a new pointCount. Current coordinates and point count (length) are unchanged. */\n public ensureCapacity(pointCapacity: number, applyGrowthFactor: boolean = true) {\n if (pointCapacity > this._xyCapacity) {\n if (applyGrowthFactor)\n pointCapacity *= this._growthFactor;\n const prevData = this._data;\n this._data = new Float64Array(pointCapacity * 2);\n this.copyData(prevData, this._xyInUse);\n this._xyCapacity = pointCapacity;\n }\n }\n /**\n * * If pointCount is less than current length, just reset current length to pointCount, effectively trimming active points but preserving original capacity.\n * * If pointCount is greater than current length, reallocate to exactly pointCount, copy existing points, and optionally pad excess with zero.\n * @param pointCount new number of active points in array\n * @param padWithZero when increasing point count, whether to zero out new points (default false)\n */\n public resize(pointCount: number, padWithZero?: boolean) {\n if (pointCount >= 0 && pointCount < this._xyInUse)\n this._xyInUse = pointCount;\n else if (pointCount > this._xyInUse) {\n this.ensureCapacity(pointCount, false);\n if (padWithZero ?? false)\n this._data.fill(0, this._xyInUse * 2);\n this._xyInUse = pointCount;\n }\n }\n /**\n * Make a copy of the (active) points in this array.\n * (The clone does NOT get excess capacity)\n */\n public clone(): GrowableXYArray {\n const newPoints = new GrowableXYArray(this.length);\n newPoints.copyData(this._data, this.length);\n newPoints._xyInUse = this.length;\n return newPoints;\n }\n /** Create an array populated from\n * Valid inputs are:\n * * Point2d\n * * Point3d\n * * An array of 2 doubles\n * * An array of 3 doubles\n * * A GrowableXYZArray\n * * A GrowableXYArray\n * * Any json object satisfying Point3d.isXAndY\n * * A Float64Array of doubles, interpreted as xyxy\n * * An array of any of the above\n */\n public static create(data: any, result?: GrowableXYArray): GrowableXYArray {\n if (result) {\n result.clear();\n } else {\n const pointCount = typeof data[0] === \"number\" ? data.length / 2 : data.length;\n result = new GrowableXYArray(pointCount);\n }\n result.pushFrom(data);\n return result;\n }\n\n /** Restructure MultiLineStringDataVariant as array of GrowableXYZArray\n * @deprecated in 4.x - will not be removed until after 2026-06-13. Moved to GrowableXYZArray class.\n */\n public static createArrayOfGrowableXYZArray(data: MultiLineStringDataVariant): GrowableXYZArray[] | undefined {\n return GrowableXYZArray.createArrayOfGrowableXYZArray(data);\n }\n /** push a point to the end of the array */\n public push(toPush: XAndY) {\n this.pushXY(toPush.x, toPush.y);\n }\n\n /** push all points of an array */\n public pushAll(points: XAndY[]) {\n this.ensureCapacity(this._xyInUse + points.length, false);\n for (const p of points)\n this.push(p);\n }\n /** push all points of an array */\n public pushAllXYAndZ(points: XYAndZ[] | GrowableXYZArray) {\n this.ensureCapacity(this._xyInUse + points.length, false);\n if (points instanceof GrowableXYZArray) {\n const xyzBuffer = points.float64Data();\n const n = points.length * 3;\n for (let i = 0; i + 2 < n; i += 3)\n this.pushXY(xyzBuffer[i], xyzBuffer[i + 1]);\n } else {\n for (const p of points) this.pushXY(p.x, p.y);\n }\n }\n /** Push copies of points from variant sources.\n * Valid inputs are:\n * * Point2d\n * * Point3d\n * * An array of 2 doubles\n * * A GrowableXYArray\n * * A GrowableXYZArray\n * * Any json object satisfying Point3d.isXAndY\n * * A Float64Array of doubles, interpreted as xyxy\n * * An array of any of the above\n */\n public pushFrom(p: any) {\n if (p instanceof Point3d) {\n this.pushXY(p.x, p.y);\n } else if (p instanceof GrowableXYZArray) {\n this.pushAllXYAndZ(p);\n } else if (p instanceof Point2d) {\n this.pushXY(p.x, p.y);\n } else if (Geometry.isNumberArray(p, 3) || p instanceof Float64Array) {\n const xyToAdd = Math.trunc(p.length / 2);\n this.ensureCapacity(this._xyInUse + xyToAdd, false);\n this.copyData(p, xyToAdd, this._xyInUse);\n this._xyInUse += xyToAdd;\n } else if (Geometry.isNumberArray(p, 2)) {\n this.pushXY(p[0], p[1]);\n } else if (Array.isArray(p)) {\n // direct recursion re-wraps p and goes infinite. Unroll here.\n for (const q of p)\n this.pushFrom(q);\n } else if (Point3d.isXAndY(p)) {\n this.pushXY(p.x, p.y);\n } else if (p instanceof IndexedXYCollection) {\n const n = p.length;\n this.ensureCapacity(this._xyInUse + n, false);\n for (let i = 0; i < n; i++)\n this.pushXY(p.getXAtUncheckedPointIndex(i), p.getYAtUncheckedPointIndex(i));\n }\n }\n /**\n * Replicate numWrap xy values from the front of the array as new values at the end.\n * @param numWrap number of xy values to replicate\n */\n public pushWrap(numWrap: number) {\n if (this._xyInUse >= numWrap) {\n this.ensureCapacity(this._xyInUse + numWrap, false);\n for (let i = 0; i < numWrap; i++) {\n const k = 2 * i;\n this.pushXY(this._data[k], this._data[k + 1]);\n }\n }\n }\n /** push a point given by x,y coordinates */\n public pushXY(x: number, y: number) {\n this.ensureCapacity(this._xyInUse + 1);\n const index = this._xyInUse * 2;\n this._data[index] = x;\n this._data[index + 1] = y;\n this._xyInUse++;\n }\n\n /** Remove one point from the back.\n * * NOTE that (in the manner of std::vector native) this is \"just\" removing the point -- no point is NOT returned.\n * * Use `back ()` to get the last x,y assembled into a `Point2d `\n */\n public pop() {\n if (this._xyInUse > 0)\n this._xyInUse--;\n }\n /**\n * Test if index is valid for an xy (point or vector) within this array\n * @param index xy index to test.\n */\n public isIndexValid(index: number): boolean {\n if (index >= this._xyInUse || index < 0)\n return false;\n return true;\n }\n /**\n * Clear all xy data, but leave capacity unchanged.\n */\n public clear() {\n this._xyInUse = 0;\n }\n /**\n * Get a point by index, strongly typed as a Point2d. This is unchecked. Use atPoint2dIndex to have validity test.\n * @param pointIndex index to access\n * @param result optional result\n */\n public getPoint2dAtUncheckedPointIndex(pointIndex: number, result?: Point2d): Point2d {\n const index = 2 * pointIndex;\n return Point2d.create(this._data[index], this._data[index + 1], result);\n }\n\n /**\n * Get x coordinate by point index, with no index checking\n * @param pointIndex index to access\n */\n public override getXAtUncheckedPointIndex(pointIndex: number): number {\n return this._data[2 * pointIndex];\n }\n\n /**\n * Get y coordinate by point index, with no index checking\n * @param pointIndex index to access\n */\n public override getYAtUncheckedPointIndex(pointIndex: number): number {\n return this._data[2 * pointIndex + 1];\n }\n\n /**\n * Gather all points as a Point2d[]\n */\n public getPoint2dArray(): Point2d[] {\n const n = 2 * this._xyInUse;\n const result = [];\n const data = this._data;\n for (let i = 0; i < n; i += 2)\n result.push(Point2d.create(data[i], data[i + 1]));\n return result;\n }\n\n /** copy xy into strongly typed Point2d */\n public override getPoint2dAtCheckedPointIndex(pointIndex: number, result?: Point2d): Point2d | undefined {\n if (this.isIndexValid(pointIndex)) {\n const index = 2 * pointIndex;\n return Point2d.create(this._data[index], this._data[index + 1], result);\n }\n return undefined;\n }\n\n /** copy xy into strongly typed Vector2d */\n public override getVector2dAtCheckedVectorIndex(vectorIndex: number, result?: Vector2d): Vector2d | undefined {\n if (this.isIndexValid(vectorIndex)) {\n const index = 2 * vectorIndex;\n return Vector2d.create(this._data[index], this._data[index + 1], result);\n }\n return undefined;\n }\n\n /**\n * Read coordinates from source array, place them at index within this array.\n * @param destIndex point index where coordinates are to be placed in this array\n * @param source source array\n * @param sourceIndex point index in source array\n * @returns true if destIndex and sourceIndex are both valid.\n */\n public transferFromGrowableXYArray(destIndex: number, source: GrowableXYArray, sourceIndex: number): boolean {\n if (this.isIndexValid(destIndex) && source.isIndexValid(sourceIndex)) {\n const i = destIndex * 2;\n const j = sourceIndex * 2;\n this._data[i] = source._data[j];\n this._data[i + 1] = source._data[j + 1];\n return true;\n }\n return false;\n }\n\n /**\n * push coordinates from the source array to the end of this array.\n * @param source source array\n * @param sourceIndex xy index within the source. If undefined, push entire contents of source\n * @returns number of points pushed.\n */\n public pushFromGrowableXYArray(source: GrowableXYArray, sourceIndex?: number): number {\n // full array push . . .\n if (sourceIndex === undefined) {\n const numXYAdd = source.length;\n this.ensureCapacity(this.length + numXYAdd, false);\n this.copyData(source._data, numXYAdd, this.length);\n this._xyInUse += numXYAdd;\n return numXYAdd;\n }\n // single point push . . .\n if (source.isIndexValid(sourceIndex)) {\n const j = sourceIndex * 2;\n this.pushXY(source._data[j], source._data[j + 1]);\n return 1;\n }\n return 0;\n }\n\n /**\n * * Compute a point at fractional coordinate between points i and j of source\n * * push onto this array.\n */\n public pushInterpolatedFromGrowableXYArray(source: GrowableXYArray, i: number, fraction: number, j: number) {\n if (source.isIndexValid(i) && source.isIndexValid(j)) {\n const fraction0 = 1.0 - fraction;\n const data = source._data;\n i = 2 * i;\n j = 2 * j;\n this.pushXY(\n fraction0 * data[i] + fraction * data[j],\n fraction0 * data[i + 1] + fraction * data[j + 1]);\n }\n }\n\n /**\n * Create an array of xy points from source xyz points.\n * @param source source array of xyz\n * @param transform optional transform to apply to xyz points.\n * @param dest optional result.\n */\n public static createFromGrowableXYZArray(source: GrowableXYZArray, transform?: Transform, dest?: GrowableXYArray) {\n const numPoints = source.length;\n if (!dest)\n dest = new GrowableXYArray(numPoints);\n else {\n dest.ensureCapacity(numPoints, false);\n dest.clear();\n }\n if (transform) {\n const packedXYZ = source.float64Data();\n const nDouble = 3 * numPoints;\n let x, y, z;\n for (let i = 0; i < nDouble; i += 3) {\n x = packedXYZ[i];\n y = packedXYZ[i + 1];\n z = packedXYZ[i + 2];\n dest.pushXY(transform.multiplyComponentXYZ(0, x, y, z), transform.multiplyComponentXYZ(1, x, y, z));\n }\n } else {\n dest.pushAllXYAndZ(source);\n }\n return dest;\n }\n /**\n * Return the first point, or undefined if the array is empty.\n */\n public front(result?: Point2d): Point2d | undefined {\n if (this._xyInUse === 0) return undefined;\n return this.getPoint2dAtUncheckedPointIndex(0, result);\n }\n /**\n * Return the last point, or undefined if the array is empty.\n */\n public back(result?: Point2d): Point2d | undefined {\n if (this._xyInUse < 1) return undefined;\n return this.getPoint2dAtUncheckedPointIndex(this._xyInUse - 1, result);\n }\n /**\n * Set the coordinates of a single point.\n * @param pointIndex index of point to set\n * @param value coordinates to set\n */\n public setAtCheckedPointIndex(pointIndex: number, value: XAndY): boolean {\n if (!this.isIndexValid(pointIndex))\n return false;\n const index = pointIndex * 2;\n this._data[index] = value.x;\n this._data[index + 1] = value.y;\n return true;\n }\n /**\n * Set the coordinates of a single point given as coordinates.\n * @param pointIndex index of point to set\n * @param x x coordinate\n * @param y y coordinate\n */\n public setXYAtCheckedPointIndex(pointIndex: number, x: number, y: number): boolean {\n if (!this.isIndexValid(pointIndex))\n return false;\n const index = pointIndex * 2;\n this._data[index] = x;\n this._data[index + 1] = y;\n return true;\n }\n /**\n * Copy all points into a simple array of Point3d with given z.\n */\n public getPoint3dArray(z: number = 0): Point3d[] {\n const n = 2 * this._xyInUse;\n const result = [];\n const data = this._data;\n for (let i = 0; i < n; i += 2)\n result.push(Point3d.create(data[i], data[i + 1], z));\n return result;\n }\n /** reverse the order of points. */\n public reverseInPlace() {\n const n = this.length;\n let j0, j1;\n let a;\n const data = this._data;\n for (let i0 = 0, i1 = n - 1; i0 < i1; i0++, i1--) {\n j0 = 2 * i0;\n j1 = 2 * i1;\n a = data[j0]; data[j0] = data[j1]; data[j1] = a;\n j0++;\n j1++;\n a = data[j0]; data[j0] = data[j1]; data[j1] = a;\n }\n }\n\n /** multiply each point by the transform, replace values. */\n public multiplyTransformInPlace(transform: Transform) {\n const data = this._data;\n const nDouble = this.float64Length;\n const coffs = transform.matrix.coffs;\n const origin = transform.origin;\n const x0 = origin.x;\n const y0 = origin.y;\n let x = 0;\n let y = 0;\n for (let i = 0; i + 1 < nDouble; i += 2) {\n x = data[i];\n y = data[i + 1];\n data[i] = coffs[0] * x + coffs[1] * y + x0;\n data[i + 1] = coffs[3] * x + coffs[4] * y + y0;\n }\n }\n\n /** multiply each xy (as a vector) by matrix, replace values. */\n public multiplyMatrix3dInPlace(matrix: Matrix3d) {\n const data = this._data;\n const nDouble = this.float64Length;\n const coffs = matrix.coffs;\n let x = 0;\n let y = 0;\n for (let i = 0; i + 1 < nDouble; i += 2) {\n x = data[i];\n y = data[i + 1];\n data[i] = coffs[0] * x + coffs[1] * y;\n data[i + 1] = coffs[3] * x + coffs[4] * y;\n }\n }\n\n /** multiply each point by the transform, replace values. */\n public tryTransformInverseInPlace(transform: Transform): boolean {\n const data = this._data;\n const nDouble = this.float64Length;\n const matrix = transform.matrix;\n matrix.computeCachedInverse(true);\n const coffs = matrix.inverseCoffs;\n if (!coffs)\n return false;\n const origin = transform.origin;\n const x0 = origin.x;\n const y0 = origin.y;\n let x = 0;\n let y = 0;\n for (let i = 0; i + 1 < nDouble; i += 2) {\n x = data[i] - x0;\n y = data[i + 1] - y0;\n data[i] = coffs[0] * x + coffs[1] * y;\n data[i + 1] = coffs[3] * x + coffs[4] * y;\n }\n return true;\n }\n /** Extend a `Range2d`, optionally transforming the points. */\n public extendRange(rangeToExtend: Range2d, transform?: Transform) {\n const numDouble = this.float64Length;\n const data = this._data;\n if (transform) {\n for (let i = 0; i + 1 < numDouble; i += 2)\n rangeToExtend.extendTransformedXY(transform, data[i], data[i + 1]);\n } else {\n for (let i = 0; i + 1 < numDouble; i += 2)\n rangeToExtend.extendXY(data[i], data[i + 1]);\n\n }\n }\n /** sum the lengths of segments between points. */\n public sumLengths(): number {\n let sum = 0.0;\n const n = 2 * (this._xyInUse - 1); // Length already takes into account what specifically is in use\n const data = this._data;\n for (let i = 0; i < n; i += 2) sum += Geometry.hypotenuseXY(\n data[i + 2] - data[i],\n data[i + 3] - data[i + 1]);\n return sum;\n }\n /**\n * Multiply each x,y by the scale factor.\n * @param factor\n */\n public scaleInPlace(factor: number) {\n if (this._data) {\n const numFloat = this.float64Length;\n for (let i = 0; i < numFloat; i++)\n this._data[i] = this._data[i] * factor;\n }\n }\n /** Compute a point at fractional coordinate between points i and j */\n public interpolate(i: number, fraction: number, j: number, result?: Point2d): Point2d | undefined {\n if (this.isIndexValid(i) && this.isIndexValid(j)) {\n const fraction0 = 1.0 - fraction;\n const data = this._data;\n i = 2 * i;\n j = 2 * j;\n return Point2d.create(\n fraction0 * data[i] + fraction * data[j],\n fraction0 * data[i + 1] + fraction * data[j + 1], result);\n }\n return undefined;\n }\n\n /** Sum the signed areas of the projection to xy plane */\n public areaXY(): number {\n let area = 0.0;\n const n = 2 * this._xyInUse; // float count !!\n if (n > 4) {\n const x0 = this._data[n - 2];\n const y0 = this._data[n - 1];\n let dx1 = this._data[0] - x0;\n let dy1 = this._data[1] - y0;\n let dx2 = 0;\n let dy2 = 0;\n for (let i = 2; i < n; i += 2, dx1 = dx2, dy1 = dy2) {\n dx2 = this._data[i] - x0;\n dy2 = this._data[i + 1] - y0;\n area += Geometry.crossProductXYXY(dx1, dy1, dx2, dy2);\n }\n }\n return 0.5 * area;\n }\n\n /** Compute a vector from index origin i to indexed target j */\n public override vectorIndexIndex(i: number, j: number, result?: Vector2d): Vector2d | undefined {\n if (!this.isIndexValid(i) || !this.isIndexValid(j))\n return undefined;\n const data = this._data;\n i = 2 * i;\n j = 2 * j;\n return Vector2d.create(data[j] - data[i], data[j + 1] - data[i + 1], result);\n }\n\n /** Compute a vector from origin to indexed target j */\n public override vectorXAndYIndex(origin: XAndY, j: number, result?: Vector2d): Vector2d | undefined {\n if (this.isIndexValid(j)) {\n const data = this._data;\n j = 2 * j;\n return Vector2d.create(\n data[j] - origin.x,\n data[j + 1] - origin.y, result);\n }\n return undefined;\n }\n\n /** Compute the cross product of vectors from from indexed origin to indexed targets i and j */\n public override crossProductIndexIndexIndex(originIndex: number, targetAIndex: number, targetBIndex: number): number | undefined {\n if (this.isIndexValid(originIndex) && this.isIndexValid(targetAIndex) && this.isIndexValid(targetBIndex)) {\n const i = originIndex * 2;\n const j = targetAIndex * 2;\n const k = targetBIndex * 2;\n const data = this._data;\n return Geometry.crossProductXYXY(\n data[j] - data[i], data[j + 1] - data[i + 1],\n data[k] - data[i], data[k + 1] - data[i + 1]);\n }\n return undefined;\n }\n\n /** Compute the cross product of vectors from from origin to indexed targets i and j */\n public override crossProductXAndYIndexIndex(origin: XAndY, targetAIndex: number, targetBIndex: number): number | undefined {\n if (this.isIndexValid(targetAIndex) && this.isIndexValid(targetBIndex)) {\n const j = targetAIndex * 2;\n const k = targetBIndex * 2;\n const data = this._data;\n return Geometry.crossProductXYXY(\n data[j] - origin.x, data[j + 1] - origin.y,\n data[k] - origin.x, data[k + 1] - origin.y);\n }\n return undefined;\n }\n\n /** Return the distance between two points in the array. */\n public distance(i: number, j: number): number | undefined {\n if (this.isIndexValid(i) && this.isIndexValid(j)) {\n const i0 = 2 * i;\n const j0 = 2 * j;\n return Geometry.hypotenuseXY(\n this._data[j0] - this._data[i0],\n this._data[j0 + 1] - this._data[i0 + 1]);\n }\n return undefined;\n }\n /** Return the distance between an array point and the input point. */\n public distanceIndexToPoint(i: number, spacePoint: Point2d): number | undefined {\n if (this.isIndexValid(i)) {\n const i0 = 2 * i;\n return Geometry.hypotenuseXY(\n spacePoint.x - this._data[i0],\n spacePoint.y - this._data[i0 + 1]);\n }\n return undefined;\n }\n /** Test for nearly equal arrays. */\n public static isAlmostEqual(dataA: GrowableXYArray | undefined, dataB: GrowableXYArray | undefined): boolean {\n if (dataA && dataB) {\n if (dataA.length !== dataB.length)\n return false;\n for (let i = 0; i < dataA.length; i++)\n if (!dataA.getPoint2dAtUncheckedPointIndex(i).isAlmostEqual(dataB.getPoint2dAtUncheckedPointIndex(i)))\n return false;\n return true;\n }\n // if both are null it is equal, otherwise unequal\n return (!dataA && !dataB);\n }\n\n /** Return an array of block indices sorted per compareLexicalBlock function */\n public sortIndicesLexical(): Uint32Array {\n const n = this._xyInUse;\n // let numCompare = 0;\n const result = new Uint32Array(n);\n for (let i = 0; i < n; i++) result[i] = i;\n result.sort(\n (blockIndexA: number, blockIndexB: number) => {\n // numCompare++;\n return this.compareLexicalBlock(blockIndexA, blockIndexB);\n });\n // console.log (n, numCompare);\n return result;\n }\n\n /** compare two blocks in simple lexical order. */\n public compareLexicalBlock(ia: number, ib: number): number {\n let ax = 0;\n let bx = 0;\n for (let i = 0; i < 2; i++) {\n ax = this._data[ia * 2 + i];\n bx = this._data[ib * 2 + i];\n if (ax > bx) return 1;\n if (ax < bx) return -1;\n }\n return ia - ib; // so original order is maintained among duplicates !!!!\n }\n\n /** Access a single double at offset within a block. This has no index checking. */\n public component(pointIndex: number, componentIndex: number): number {\n return this._data[2 * pointIndex + componentIndex];\n }\n /** Toleranced equality test */\n public isAlmostEqual(other: GrowableXYArray, tolerance: number = Geometry.smallMetricDistance): boolean {\n const numXY = this._xyInUse;\n if (other._xyInUse !== numXY)\n return false;\n const dataA = this._data;\n const dataB = other._data;\n for (let i = 0; i < 2 * numXY; i++) {\n if (Math.abs(dataA[i] - dataB[i]) > tolerance)\n return false;\n }\n return true;\n }\n}\n"]}
|
|
@@ -131,7 +131,7 @@ export declare class Point4d extends Plane3d implements BeJSONFunctions {
|
|
|
131
131
|
* extract 4 consecutive numbers from a Float64Array into a Point4d.
|
|
132
132
|
* @param data buffer of numbers
|
|
133
133
|
* @param xIndex first index for x,y,z,w sequence. Assumed to be a valid index!
|
|
134
|
-
* @deprecated in 4.x -
|
|
134
|
+
* @deprecated in 4.x - will not be removed until after 2026-06-13. Use createFromPacked instead.
|
|
135
135
|
*/
|
|
136
136
|
static createFromPackedXYZW(data: Float64Array, xIndex?: number, result?: Point4d): Point4d;
|
|
137
137
|
/** Create a `Point4d` with x,y,z from an `XYAndZ` input, and w from a separate number. */
|
|
@@ -243,7 +243,7 @@ class Point4d extends Plane3d_1.Plane3d {
|
|
|
243
243
|
* extract 4 consecutive numbers from a Float64Array into a Point4d.
|
|
244
244
|
* @param data buffer of numbers
|
|
245
245
|
* @param xIndex first index for x,y,z,w sequence. Assumed to be a valid index!
|
|
246
|
-
* @deprecated in 4.x -
|
|
246
|
+
* @deprecated in 4.x - will not be removed until after 2026-06-13. Use createFromPacked instead.
|
|
247
247
|
*/
|
|
248
248
|
static createFromPackedXYZW(data, xIndex = 0, result) {
|
|
249
249
|
return Point4d.create(data[xIndex], data[xIndex + 1], data[xIndex + 2], data[xIndex + 3], result);
|