@itwin/core-geometry 5.1.0-dev.20 → 5.1.0-dev.25
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/lib/cjs/bspline/BSplineCurve.d.ts.map +1 -1
- package/lib/cjs/bspline/BSplineCurve.js +7 -1
- package/lib/cjs/bspline/BSplineCurve.js.map +1 -1
- package/lib/cjs/clipping/ClipUtils.d.ts.map +1 -1
- package/lib/cjs/clipping/ClipUtils.js +5 -3
- package/lib/cjs/clipping/ClipUtils.js.map +1 -1
- package/lib/cjs/curve/Arc3d.d.ts +1 -1
- package/lib/cjs/curve/Arc3d.d.ts.map +1 -1
- package/lib/cjs/curve/Arc3d.js +1 -1
- package/lib/cjs/curve/Arc3d.js.map +1 -1
- package/lib/cjs/curve/CurveCollection.d.ts +31 -1
- package/lib/cjs/curve/CurveCollection.d.ts.map +1 -1
- package/lib/cjs/curve/CurveCollection.js +65 -0
- package/lib/cjs/curve/CurveCollection.js.map +1 -1
- package/lib/cjs/curve/CurveLocationDetail.d.ts +24 -24
- package/lib/cjs/curve/CurveLocationDetail.d.ts.map +1 -1
- package/lib/cjs/curve/CurveLocationDetail.js +24 -24
- package/lib/cjs/curve/CurveLocationDetail.js.map +1 -1
- package/lib/cjs/curve/CurvePrimitive.d.ts +2 -2
- package/lib/cjs/curve/CurvePrimitive.js.map +1 -1
- package/lib/cjs/curve/Query/PlanarSubdivision.d.ts +9 -5
- package/lib/cjs/curve/Query/PlanarSubdivision.d.ts.map +1 -1
- package/lib/cjs/curve/Query/PlanarSubdivision.js +20 -9
- package/lib/cjs/curve/Query/PlanarSubdivision.js.map +1 -1
- package/lib/cjs/curve/RegionMomentsXY.d.ts.map +1 -1
- package/lib/cjs/curve/RegionMomentsXY.js +14 -14
- package/lib/cjs/curve/RegionMomentsXY.js.map +1 -1
- package/lib/cjs/curve/RegionOps.d.ts +12 -0
- package/lib/cjs/curve/RegionOps.d.ts.map +1 -1
- package/lib/cjs/curve/RegionOps.js +23 -3
- package/lib/cjs/curve/RegionOps.js.map +1 -1
- package/lib/cjs/curve/RegionOpsClassificationSweeps.d.ts +14 -13
- package/lib/cjs/curve/RegionOpsClassificationSweeps.d.ts.map +1 -1
- package/lib/cjs/curve/RegionOpsClassificationSweeps.js +46 -29
- package/lib/cjs/curve/RegionOpsClassificationSweeps.js.map +1 -1
- package/lib/cjs/curve/internalContexts/AnnounceTangentStrokeHandler.js.map +1 -1
- package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.d.ts.map +1 -1
- package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.js +41 -17
- package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.js.map +1 -1
- package/lib/cjs/geometry3d/AngleSweep.d.ts +10 -6
- package/lib/cjs/geometry3d/AngleSweep.d.ts.map +1 -1
- package/lib/cjs/geometry3d/AngleSweep.js +17 -6
- package/lib/cjs/geometry3d/AngleSweep.js.map +1 -1
- package/lib/cjs/geometry3d/Point3dVector3d.d.ts +1 -1
- package/lib/cjs/geometry3d/Point3dVector3d.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Point3dVector3d.js.map +1 -1
- package/lib/cjs/geometry4d/Point4d.d.ts +3 -2
- package/lib/cjs/geometry4d/Point4d.d.ts.map +1 -1
- package/lib/cjs/geometry4d/Point4d.js +9 -2
- package/lib/cjs/geometry4d/Point4d.js.map +1 -1
- package/lib/cjs/numerics/BezierPolynomials.d.ts +2 -0
- package/lib/cjs/numerics/BezierPolynomials.d.ts.map +1 -1
- package/lib/cjs/numerics/BezierPolynomials.js +11 -0
- package/lib/cjs/numerics/BezierPolynomials.js.map +1 -1
- package/lib/cjs/numerics/SmallSystem.d.ts.map +1 -1
- package/lib/cjs/numerics/SmallSystem.js +3 -3
- package/lib/cjs/numerics/SmallSystem.js.map +1 -1
- package/lib/cjs/polyface/IndexedPolyfaceVisitor.js +1 -1
- package/lib/cjs/polyface/IndexedPolyfaceVisitor.js.map +1 -1
- package/lib/cjs/topology/HalfEdgeGraphSearch.d.ts +1 -0
- package/lib/cjs/topology/HalfEdgeGraphSearch.d.ts.map +1 -1
- package/lib/cjs/topology/HalfEdgeGraphSearch.js +1 -0
- package/lib/cjs/topology/HalfEdgeGraphSearch.js.map +1 -1
- package/lib/esm/bspline/BSplineCurve.d.ts.map +1 -1
- package/lib/esm/bspline/BSplineCurve.js +7 -1
- package/lib/esm/bspline/BSplineCurve.js.map +1 -1
- package/lib/esm/clipping/ClipUtils.d.ts.map +1 -1
- package/lib/esm/clipping/ClipUtils.js +5 -3
- package/lib/esm/clipping/ClipUtils.js.map +1 -1
- package/lib/esm/curve/Arc3d.d.ts +1 -1
- package/lib/esm/curve/Arc3d.d.ts.map +1 -1
- package/lib/esm/curve/Arc3d.js +1 -1
- package/lib/esm/curve/Arc3d.js.map +1 -1
- package/lib/esm/curve/CurveCollection.d.ts +31 -1
- package/lib/esm/curve/CurveCollection.d.ts.map +1 -1
- package/lib/esm/curve/CurveCollection.js +65 -0
- package/lib/esm/curve/CurveCollection.js.map +1 -1
- package/lib/esm/curve/CurveLocationDetail.d.ts +24 -24
- package/lib/esm/curve/CurveLocationDetail.d.ts.map +1 -1
- package/lib/esm/curve/CurveLocationDetail.js +24 -24
- package/lib/esm/curve/CurveLocationDetail.js.map +1 -1
- package/lib/esm/curve/CurvePrimitive.d.ts +2 -2
- package/lib/esm/curve/CurvePrimitive.js.map +1 -1
- package/lib/esm/curve/Query/PlanarSubdivision.d.ts +9 -5
- package/lib/esm/curve/Query/PlanarSubdivision.d.ts.map +1 -1
- package/lib/esm/curve/Query/PlanarSubdivision.js +20 -9
- package/lib/esm/curve/Query/PlanarSubdivision.js.map +1 -1
- package/lib/esm/curve/RegionMomentsXY.d.ts.map +1 -1
- package/lib/esm/curve/RegionMomentsXY.js +14 -14
- package/lib/esm/curve/RegionMomentsXY.js.map +1 -1
- package/lib/esm/curve/RegionOps.d.ts +12 -0
- package/lib/esm/curve/RegionOps.d.ts.map +1 -1
- package/lib/esm/curve/RegionOps.js +23 -3
- package/lib/esm/curve/RegionOps.js.map +1 -1
- package/lib/esm/curve/RegionOpsClassificationSweeps.d.ts +14 -13
- package/lib/esm/curve/RegionOpsClassificationSweeps.d.ts.map +1 -1
- package/lib/esm/curve/RegionOpsClassificationSweeps.js +46 -29
- package/lib/esm/curve/RegionOpsClassificationSweeps.js.map +1 -1
- package/lib/esm/curve/internalContexts/AnnounceTangentStrokeHandler.js.map +1 -1
- package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.d.ts.map +1 -1
- package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.js +41 -17
- package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.js.map +1 -1
- package/lib/esm/geometry3d/AngleSweep.d.ts +10 -6
- package/lib/esm/geometry3d/AngleSweep.d.ts.map +1 -1
- package/lib/esm/geometry3d/AngleSweep.js +17 -6
- package/lib/esm/geometry3d/AngleSweep.js.map +1 -1
- package/lib/esm/geometry3d/Point3dVector3d.d.ts +1 -1
- package/lib/esm/geometry3d/Point3dVector3d.d.ts.map +1 -1
- package/lib/esm/geometry3d/Point3dVector3d.js.map +1 -1
- package/lib/esm/geometry4d/Point4d.d.ts +3 -2
- package/lib/esm/geometry4d/Point4d.d.ts.map +1 -1
- package/lib/esm/geometry4d/Point4d.js +9 -2
- package/lib/esm/geometry4d/Point4d.js.map +1 -1
- package/lib/esm/numerics/BezierPolynomials.d.ts +2 -0
- package/lib/esm/numerics/BezierPolynomials.d.ts.map +1 -1
- package/lib/esm/numerics/BezierPolynomials.js +11 -0
- package/lib/esm/numerics/BezierPolynomials.js.map +1 -1
- package/lib/esm/numerics/SmallSystem.d.ts.map +1 -1
- package/lib/esm/numerics/SmallSystem.js +3 -3
- package/lib/esm/numerics/SmallSystem.js.map +1 -1
- package/lib/esm/polyface/IndexedPolyfaceVisitor.js +1 -1
- package/lib/esm/polyface/IndexedPolyfaceVisitor.js.map +1 -1
- package/lib/esm/topology/HalfEdgeGraphSearch.d.ts +1 -0
- package/lib/esm/topology/HalfEdgeGraphSearch.d.ts.map +1 -1
- package/lib/esm/topology/HalfEdgeGraphSearch.js +1 -0
- package/lib/esm/topology/HalfEdgeGraphSearch.js.map +1 -1
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CurveCollection.d.ts","sourceRoot":"","sources":["../../../src/curve/CurveCollection.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAClE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,2BAA2B,EAAE,MAAM,mBAAmB,CAAC;AAChE,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"CurveCollection.d.ts","sourceRoot":"","sources":["../../../src/curve/CurveCollection.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAClE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,2BAA2B,EAAE,MAAM,mBAAmB,CAAC;AAChE,OAAO,EAAE,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E,MAAW,GAAG,IAAI;IAGrG,0CAA0C;IACnC,YAAY,CAAC,OAAO,CAAC,EAAE,aAAa,GAAG,WAAW;IAiBzD;;;;;;OAMG;IACa,YAAY,CAC1B,UAAU,EAAE,OAAO,EAAE,MAAM,GAAE,2BAAmC,EAAE,MAAM,CAAC,EAAE,mBAAmB,GAC7F,mBAAmB,GAAG,SAAS;IAWlC,oCAAoC;IAC7B,cAAc,IAAI,WAAW;IAGpC,mBAAmB;IACZ,WAAW,CAAC,KAAK,EAAE,QAAQ,GAAG,SAAS,GAAG,OAAO;IAKxD,2BAA2B;IACpB,QAAQ,CAAC,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,SAAS;IAKhD,8EAA8E;IACvE,yBAAyB,CAAC,OAAO,EAAE,eAAe,GAAG,GAAG;CAGhE"}
|
|
@@ -21,6 +21,8 @@ const SumLengthsContext_1 = require("./internalContexts/SumLengthsContext");
|
|
|
21
21
|
const TransformInPlaceContext_1 = require("./internalContexts/TransformInPlaceContext");
|
|
22
22
|
const LineString3d_1 = require("./LineString3d");
|
|
23
23
|
const ProxyCurve_1 = require("./ProxyCurve");
|
|
24
|
+
const AnnounceTangentStrokeHandler_1 = require("./internalContexts/AnnounceTangentStrokeHandler");
|
|
25
|
+
const Matrix3d_1 = require("../geometry3d/Matrix3d");
|
|
24
26
|
/**
|
|
25
27
|
* A `CurveCollection` is an abstract (non-instantiable) class for various sets of curves with particular structures:
|
|
26
28
|
* - [[CurveChain]] - a non-instantiable intermediate class for a sequence of [[CurvePrimitive]] joining head-to-tail.
|
|
@@ -61,6 +63,69 @@ class CurveCollection extends GeometryQuery_1.GeometryQuery {
|
|
|
61
63
|
}
|
|
62
64
|
return detailA;
|
|
63
65
|
}
|
|
66
|
+
/**
|
|
67
|
+
* Announce all points `P` on the contained curves such that the line containing `spacePoint` and `P` is tangent to
|
|
68
|
+
* the contained curves in the view defined by `options.vectorToEye`.
|
|
69
|
+
* * Strictly speaking, each tangent line lies in the plane through `P` whose normal is the cross product of the curve
|
|
70
|
+
* tangent at `P` and `options.vectorToEye`. This is equivalent to tangency as seen in a view plane perpendicular to
|
|
71
|
+
* `options.vectorToEye`.
|
|
72
|
+
* @param spacePoint point in space.
|
|
73
|
+
* @param announceTangent callback to announce each computed tangent. The received [[CurveLocationDetail]] is reused
|
|
74
|
+
* internally, so it should be cloned in the callback if it needs to be saved.
|
|
75
|
+
* @param options (optional) options for computing tangents. See [[TangentOptions]] for defaults.
|
|
76
|
+
*/
|
|
77
|
+
emitTangents(spacePoint, announceTangent, options) {
|
|
78
|
+
const strokeHandler = new AnnounceTangentStrokeHandler_1.AnnounceTangentStrokeHandler(spacePoint, announceTangent, options);
|
|
79
|
+
if (this.children !== undefined) {
|
|
80
|
+
for (const child of this.children) {
|
|
81
|
+
if (child instanceof CurvePrimitive_1.CurvePrimitive)
|
|
82
|
+
child.emitStrokableParts(strokeHandler, options?.strokeOptions);
|
|
83
|
+
else if (child instanceof CurveCollection)
|
|
84
|
+
child.emitTangents(spacePoint, announceTangent, options);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Return all points `P` on the contained curves such that the line containing `spacePoint` and `P` is tangent to the
|
|
90
|
+
* contained curves in the view defined by `options.vectorToEye`.
|
|
91
|
+
* * See [[emitTangents]] for the definition of tangency employed.
|
|
92
|
+
* @param spacePoint point in space.
|
|
93
|
+
* @param options (optional) options for computing tangents. See [[TangentOptions]] for defaults.
|
|
94
|
+
* @returns an array of details of all tangent points or undefined if no tangent was found.
|
|
95
|
+
*/
|
|
96
|
+
allTangents(spacePoint, options) {
|
|
97
|
+
const tangents = [];
|
|
98
|
+
this.emitTangents(spacePoint, (t) => tangents.push(t.clone()), options);
|
|
99
|
+
return (tangents.length === 0) ? undefined : tangents;
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Return the point `P` on the contained curves such that the line containing `spacePoint` and `P` is tangent to the
|
|
103
|
+
* contained curves in the view defined by `options.vectorToEye`, and `P` is closest to `options.hintPoint` in this view.
|
|
104
|
+
* * See [[emitTangents]] for the definition of tangency employed.
|
|
105
|
+
* @param spacePoint point in space.
|
|
106
|
+
* @param options (optional) options for computing tangents. See [[TangentOptions]] for defaults.
|
|
107
|
+
* @returns the detail of the closest tangent point or undefined if no tangent was found.
|
|
108
|
+
*/
|
|
109
|
+
closestTangent(spacePoint, options) {
|
|
110
|
+
const hint = options?.hintPoint ?? spacePoint;
|
|
111
|
+
let toLocal;
|
|
112
|
+
if (options?.vectorToEye && !options.vectorToEye.isExactEqual({ x: 0, y: 0, z: 1 }))
|
|
113
|
+
toLocal = Matrix3d_1.Matrix3d.createRigidViewAxesZTowardsEye(options.vectorToEye.x, options.vectorToEye.y, options.vectorToEye.z);
|
|
114
|
+
const measureHintDist2 = (pt) => {
|
|
115
|
+
return toLocal?.multiplyTransposeXYZ(hint.x - pt.x, hint.y - pt.y, hint.z - pt.z).magnitudeSquaredXY() ?? pt.distanceSquaredXY(hint);
|
|
116
|
+
};
|
|
117
|
+
let closestTangent;
|
|
118
|
+
let closestDist2 = Geometry_1.Geometry.largeCoordinateResult;
|
|
119
|
+
const collectClosestTangent = (tangent) => {
|
|
120
|
+
const dist2 = measureHintDist2(tangent.point);
|
|
121
|
+
if (!closestTangent || dist2 < closestDist2) {
|
|
122
|
+
closestTangent = tangent.clone(closestTangent);
|
|
123
|
+
closestDist2 = dist2;
|
|
124
|
+
}
|
|
125
|
+
};
|
|
126
|
+
this.emitTangents(spacePoint, collectClosestTangent, options);
|
|
127
|
+
return closestTangent;
|
|
128
|
+
}
|
|
64
129
|
/** Reverse the collection's data so that each child curve's fractional stroking moves in the opposite direction. */
|
|
65
130
|
reverseInPlace() {
|
|
66
131
|
for (const curve of this.children)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CurveCollection.js","sourceRoot":"","sources":["../../../src/curve/CurveCollection.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F;;GA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CAAC,IAAI,CAAC,CAAC;IACzC,CAAC;CACF;AA/FD,kCA+FC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\n/** @packageDocumentation\r\n * @module Curve\r\n */\r\nimport { Geometry } from \"../Geometry\";\r\nimport { GeometryHandler } from \"../geometry3d/GeometryHandler\";\r\nimport { GrowableXYZArray } from \"../geometry3d/GrowableXYZArray\";\r\nimport { Point3d, Vector3d } from \"../geometry3d/Point3dVector3d\";\r\nimport { Range1d, Range3d } from \"../geometry3d/Range\";\r\nimport { Ray3d } from \"../geometry3d/Ray3d\";\r\nimport { Transform } from \"../geometry3d/Transform\";\r\nimport { VariantCurveExtendParameter } from \"./CurveExtendMode\";\r\nimport { CurveLocationDetail } from \"./CurveLocationDetail\";\r\nimport { CurvePrimitive } from \"./CurvePrimitive\";\r\nimport { RecursiveCurveProcessor } from \"./CurveProcessor\";\r\nimport { AnyCurve, type AnyRegion } from \"./CurveTypes\";\r\nimport { GeometryQuery } from \"./GeometryQuery\";\r\nimport { CloneCurvesContext } from \"./internalContexts/CloneCurvesContext\";\r\nimport { CloneWithExpandedLineStrings } from \"./internalContexts/CloneWithExpandedLineStrings\";\r\nimport { CountLinearPartsSearchContext } from \"./internalContexts/CountLinearPartsSearchContext\";\r\nimport { GapSearchContext } from \"./internalContexts/GapSearchContext\";\r\nimport { PlaneAltitudeRangeContext } from \"./internalContexts/PlaneAltitudeRangeContext\";\r\nimport { SumLengthsContext } from \"./internalContexts/SumLengthsContext\";\r\nimport { TransformInPlaceContext } from \"./internalContexts/TransformInPlaceContext\";\r\nimport { LineString3d } from \"./LineString3d\";\r\nimport { ProxyCurve } from \"./ProxyCurve\";\r\nimport { StrokeOptions } from \"./StrokeOptions\";\r\n\r\nimport type { Path } from \"./Path\";\r\nimport type { Loop } from \"./Loop\";\r\n\r\n/** Note: CurveChain and BagOfCurves classes are located in this file to prevent circular dependency. */\r\n\r\n/**\r\n * Describes the concrete type of a [[CurveCollection]]. Each type name maps to a specific subclass and can be\r\n * used in conditional statements for type-switching.\r\n * - \"loop\" => [[Loop]]\r\n * - \"path\" => [[Path]]\r\n * - \"unionRegion\" => [[UnionRegion]]\r\n * - \"parityRegion\" => [[ParityRegion]]\r\n * - \"bagOfCurves\" => [[BagOfCurves]]\r\n * @public\r\n */\r\nexport type CurveCollectionType = \"loop\" | \"path\" | \"unionRegion\" | \"parityRegion\" | \"bagOfCurves\";\r\n\r\n/**\r\n * A `CurveCollection` is an abstract (non-instantiable) class for various sets of curves with particular structures:\r\n * - [[CurveChain]] - a non-instantiable intermediate class for a sequence of [[CurvePrimitive]] joining head-to-tail.\r\n * The two instantiable forms of `CurveChain` are:\r\n * - [[Path]] - a chain of curves. Does not have to be closed or planar. A closed `Path` is not treated as bounding a surface.\r\n * - [[Loop]] - a closed and planar chain of curves. A `Loop` is treated as bounding a planar area.\r\n * - [[ParityRegion]] - a collection of coplanar `Loop`, with \"in/out\" classification by parity rules.\r\n * - [[UnionRegion]] - a collection of coplanar `Loop` and/or `ParityRegion`, with \"in/out\" classification by union rules.\r\n * - [[BagOfCurves]] - a collection of [[AnyCurve]] with no implied structure.\r\n *\r\n * @see [Curve Collections]($docs/learning/geometry/CurveCollection.md) learning article.\r\n * @public\r\n */\r\nexport abstract class CurveCollection extends GeometryQuery {\r\n /** String name for schema properties */\r\n public readonly geometryCategory = \"curveCollection\";\r\n /** Type discriminator. */\r\n public abstract readonly curveCollectionType: CurveCollectionType;\r\n /** Flag for inner loop status. Only used by `Loop`. */\r\n public isInner: boolean = false;\r\n /** Return the curve children. */\r\n public abstract override get children(): AnyCurve[];\r\n /** Return the sum of the lengths of all contained curves. */\r\n public sumLengths(): number {\r\n return SumLengthsContext.sumLengths(this);\r\n }\r\n /**\r\n * Return the closest point on the contained curves.\r\n * @param spacePoint point in space.\r\n * @param _extend unused here (pass false), but applicable to overrides in [[Path]] and [[BagOfCurves]].\r\n * @param result optional pre-allocated detail to populate and return.\r\n * @returns details of the closest point.\r\n */\r\n public closestPoint(\r\n spacePoint: Point3d, _extend: VariantCurveExtendParameter = false, result?: CurveLocationDetail,\r\n ): CurveLocationDetail | undefined {\r\n let detailA: CurveLocationDetail | undefined;\r\n const detailB = new CurveLocationDetail();\r\n if (this.children !== undefined) {\r\n for (const child of this.children) {\r\n if (child.closestPoint(spacePoint, false, detailB))\r\n detailA = result = CurveLocationDetail.chooseSmallerA(detailA, detailB)!.clone(result);\r\n }\r\n }\r\n return detailA;\r\n }\r\n /** Reverse the collection's data so that each child curve's fractional stroking moves in the opposite direction. */\r\n public reverseInPlace(): void {\r\n for (const curve of this.children)\r\n curve.reverseInPlace();\r\n }\r\n /**\r\n * Return the max gap between adjacent primitives in Path and Loop collections.\r\n * * In a Path, gaps are computed between consecutive primitives.\r\n * * In a Loop, gaps are computed between consecutive primitives and between last and first.\r\n * * Gaps are NOT computed between consecutive CurvePrimitives in \"unstructured\" collections. The type is\r\n * \"unstructured\" so gaps should not be semantically meaningful.\r\n */\r\n public maxGap(): number {\r\n return GapSearchContext.maxGap(this);\r\n }\r\n /** Return true if the curve collection has any primitives other than LineSegment3d and LineString3d */\r\n public checkForNonLinearPrimitives(): boolean {\r\n return CountLinearPartsSearchContext.hasNonLinearPrimitives(this);\r\n }\r\n /** Apply transform recursively to children */\r\n public tryTransformInPlace(transform: Transform): boolean {\r\n return TransformInPlaceContext.tryTransformInPlace(this, transform);\r\n }\r\n /** Return a deep copy. */\r\n public override clone(): CurveCollection {\r\n return CloneCurvesContext.clone(this) as CurveCollection;\r\n }\r\n /** Create a deep copy of transformed curves. */\r\n public override cloneTransformed(transform: Transform): CurveCollection | undefined {\r\n return CloneCurvesContext.clone(this, transform);\r\n }\r\n /** Create a deep copy with all linestrings broken down into multiple LineSegment3d. */\r\n public cloneWithExpandedLineStrings(): CurveCollection {\r\n return CloneWithExpandedLineStrings.clone(this);\r\n }\r\n /**\r\n * Push all CurvePrimitives contained in the instance onto the `results` array.\r\n * * This method is recursive. For example, if the CurveCollection contains a Loop, all CurvePrimitives\r\n * of the Loop are pushed onto `results`.\r\n */\r\n private collectCurvePrimitivesGo(\r\n results: CurvePrimitive[], smallestPossiblePrimitives: boolean, explodeLinestrings: boolean = false,\r\n ): void {\r\n if (this.children) {\r\n for (const child of this.children) {\r\n if (child instanceof CurvePrimitive)\r\n child.collectCurvePrimitivesGo(results, smallestPossiblePrimitives, explodeLinestrings);\r\n else if (child instanceof CurveCollection)\r\n child.collectCurvePrimitivesGo(results, smallestPossiblePrimitives, explodeLinestrings);\r\n }\r\n }\r\n }\r\n /**\r\n * Return an array containing all CurvePrimitives in the instance.\r\n * * This method is recursive. For example, if the CurveCollection contains a Loop, all CurvePrimitives of\r\n * the Loop are pushed onto the returned array.\r\n * @param collectorArray optional array to receive primitives. If present, new primitives are ADDED (without\r\n * clearing the array).\r\n * @param smallestPossiblePrimitives if false, CurvePrimitiveWithDistanceIndex returns only itself. If true,\r\n * it recurses to its (otherwise hidden) children.\r\n */\r\n public collectCurvePrimitives(\r\n collectorArray?: CurvePrimitive[], smallestPossiblePrimitives: boolean = false, explodeLineStrings: boolean = false,\r\n ): CurvePrimitive[] {\r\n const results: CurvePrimitive[] = collectorArray === undefined ? [] : collectorArray;\r\n this.collectCurvePrimitivesGo(results, smallestPossiblePrimitives, explodeLineStrings);\r\n return results;\r\n }\r\n /**\r\n * Return true for planar region types:\r\n * * `Loop`\r\n * * `ParityRegion`\r\n * * `UnionRegion`\r\n * @see isAnyRegion\r\n */\r\n public get isAnyRegionType(): boolean {\r\n return this.dgnBoundaryType() === 2 || this.dgnBoundaryType() === 4 || this.dgnBoundaryType() === 5;\r\n }\r\n /** Type guard for AnyRegion */\r\n public isAnyRegion(): this is AnyRegion {\r\n return this.isAnyRegionType;\r\n }\r\n /**\r\n * Return true for a `Path`, i.e. a chain of curves joined head-to-tail\r\n * @see isPath\r\n */\r\n public get isOpenPath(): boolean {\r\n return this.dgnBoundaryType() === 1;\r\n }\r\n /** Type guard for Path */\r\n public isPath(): this is Path {\r\n return this.isOpenPath;\r\n }\r\n /**\r\n * Return true for a single-loop planar region type, i.e. `Loop`.\r\n * * This is NOT a test for physical closure of a `Path`.\r\n * @see isLoop\r\n */\r\n public get isClosedPath(): boolean {\r\n return this.dgnBoundaryType() === 2;\r\n }\r\n /** Type guard for Loop */\r\n public isLoop(): this is Loop {\r\n return this.isClosedPath;\r\n }\r\n\r\n /** Return a CurveCollection with the same structure but all curves replaced by strokes. */\r\n public abstract cloneStroked(options?: StrokeOptions): CurveCollection;\r\n /** Support method for ICurvePrimitive ... one line call to specific announce method . . */\r\n public abstract announceToCurveProcessor(processor: RecursiveCurveProcessor): void;\r\n /** Clone an empty collection. */\r\n public abstract cloneEmptyPeer(): CurveCollection;\r\n /**\r\n * Return the boundary type of a corresponding MicroStation CurveVector.\r\n * * Derived class must implement.\r\n */\r\n public abstract dgnBoundaryType(): number;\r\n /**\r\n * Try to add a child.\r\n * @param child child to add.\r\n * @return true if child is an acceptable type for this collection.\r\n */\r\n public abstract tryAddChild(child: AnyCurve | undefined): boolean;\r\n /** Return a child identified by by index */\r\n public abstract getChild(i: number): AnyCurve | undefined;\r\n /**\r\n * Extend (increase) the given range as needed to encompass all curves in the curve collection.\r\n * @param rangeToExtend the given range.\r\n * @param transform if supplied, the range is extended with transformed curves.\r\n */\r\n public extendRange(rangeToExtend: Range3d, transform?: Transform): void {\r\n const children = this.children;\r\n if (children) {\r\n for (const c of children) {\r\n c.extendRange(rangeToExtend, transform);\r\n }\r\n }\r\n }\r\n /**\r\n * Find any CurvePrimitive in the source and evaluate it at the given fraction.\r\n * * The first CurvePrimitive found is evaluated. Any other CurvePrimitives are ignored.\r\n * @param source containing `CurvePrimitive` or `CurveCollection`\r\n * @param fraction fraction to use in `curve.fractionToPoint(fraction)`\r\n */\r\n public static createCurveLocationDetailOnAnyCurvePrimitive(\r\n source: GeometryQuery | undefined, fraction: number = 0.5,\r\n ): CurveLocationDetail | undefined {\r\n if (!source)\r\n return undefined;\r\n if (source instanceof CurvePrimitive) {\r\n return CurveLocationDetail.createCurveEvaluatedFraction(source, fraction);\r\n } else if (source instanceof CurveCollection && source.children !== undefined)\r\n for (const child of source.children) {\r\n const detail = this.createCurveLocationDetailOnAnyCurvePrimitive(child, fraction);\r\n if (detail)\r\n return detail;\r\n }\r\n return undefined;\r\n }\r\n /**\r\n * Project instance geometry (via dispatch) onto the given ray, and return the extreme fractional parameters\r\n * of projection.\r\n * @param ray ray onto which the instance is projected. A `Vector3d` is treated as a `Ray3d` with zero origin.\r\n * @param lowHigh optional receiver for output\r\n * @returns range of fractional projection parameters onto the ray, where 0.0 is start of the ray and 1.0 is the\r\n * end of the ray.\r\n */\r\n public projectedParameterRange(ray: Vector3d | Ray3d, lowHigh?: Range1d): Range1d | undefined {\r\n return PlaneAltitudeRangeContext.findExtremeFractionsAlongDirection(this, ray, lowHigh);\r\n }\r\n /** Return the immediate parent of the input curve in the instance, or undefined if it is not a descendant. */\r\n public findParentOfDescendant(descendant: AnyCurve): CurveCollection | undefined {\r\n for (const child of this.children) {\r\n if (child === descendant)\r\n return this;\r\n if (child instanceof CurveCollection) {\r\n const parent = child.findParentOfDescendant(descendant);\r\n if (parent)\r\n return parent;\r\n }\r\n }\r\n return undefined;\r\n };\r\n}\r\n\r\n/**\r\n * Shared base class for use by both open and closed paths.\r\n * * A `CurveChain` contains only CurvePrimitives. No other paths, loops, or regions allowed.\r\n * * The specific derived classes are `Path` and `Loop`.\r\n * * `CurveChain` is an intermediate class. It is not instantiable on its own.\r\n * * The related class `CurveChainWithDistanceIndex` is a `CurvePrimitive` whose API presents well-defined mappings\r\n * from fraction to xyz over the entire chain, but in fact does all the calculations over multiple primitives.\r\n * @see [Curve Collections]($docs/learning/geometry/CurveCollection.md) learning article.\r\n * @public\r\n */\r\nexport abstract class CurveChain extends CurveCollection {\r\n /** The curve primitives in the chain. */\r\n protected _curves: CurvePrimitive[];\r\n /** Constructor */\r\n protected constructor() {\r\n super();\r\n this._curves = [];\r\n }\r\n /** Return the array of `CurvePrimitive` */\r\n public override get children(): CurvePrimitive[] {\r\n return this._curves;\r\n }\r\n /** Return the start point of the curve chain (start point of the first child). */\r\n public startPoint(result?: Point3d): Point3d | undefined {\r\n const firstChild = this.getChild(0);\r\n if (firstChild)\r\n return firstChild.fractionToPoint(0.0, result);\r\n else\r\n return undefined;\r\n }\r\n /** Return the end point of the curve chain (end point of the last child). */\r\n public endPoint(result?: Point3d): Point3d | undefined {\r\n const lastChild = this.getChild(this._curves.length - 1);\r\n if (lastChild)\r\n return lastChild.fractionToPoint(1.0, result);\r\n else\r\n return undefined;\r\n }\r\n /**\r\n * Return the start point and derivative of the first child of the curve chain.\r\n * * For queries interior to the chain, use [[CurveChainWithDistanceIndex.fractionToPointAndDerivative]].\r\n */\r\n public startPointAndDerivative(result?: Ray3d): Ray3d | undefined {\r\n const firstChild = this.getChild(0);\r\n if (firstChild)\r\n return firstChild.fractionToPointAndDerivative(0.0, result);\r\n else\r\n return undefined;\r\n }\r\n /**\r\n * Return the end point and derivative of the last child of the curve chain.\r\n * * For queries interior to the chain, use [[CurveChainWithDistanceIndex.fractionToPointAndDerivative]].\r\n */\r\n public endPointAndDerivative(result?: Ray3d): Ray3d | undefined {\r\n const lastChild = this.getChild(this._curves.length - 1);\r\n if (lastChild)\r\n return lastChild.fractionToPointAndDerivative(1.0, result);\r\n else\r\n return undefined;\r\n }\r\n /**\r\n * Return the curve primitive at the given `index`, optionally using `modulo` to map `index` to the cyclic indexing.\r\n * * In particular, `-1` is the final curve.\r\n * @param index cyclic index\r\n */\r\n public cyclicCurvePrimitive(index: number, cyclic: boolean = true): CurvePrimitive | undefined {\r\n const n = this.children.length;\r\n if (n === 0)\r\n return undefined;\r\n if (index >= 0 && index < n) // try simplest non-cyclic access first\r\n return this.children[index];\r\n if (cyclic) {\r\n const index2 = Geometry.modulo(index, n);\r\n return this.children[index2];\r\n }\r\n return undefined;\r\n }\r\n /**\r\n * Stroke the chain into a simple xyz array.\r\n * @param options tolerance parameters controlling the stroking.\r\n */\r\n public getPackedStrokes(options?: StrokeOptions): GrowableXYZArray | undefined {\r\n /**\r\n * The object returned by \"cloneStroked\" has the same type (Loop or Path) but instead of a chain of\r\n * CurvePrimitives as children, it has a single LineString3d child. \"getPackedStrokes\" just returns\r\n * the points of that LineString3d using \"packedPoints\".\r\n */\r\n const tree = this.cloneStroked(options);\r\n if (tree instanceof CurveChain) {\r\n const children = tree.children;\r\n if (children.length === 1) {\r\n const ls = children[0];\r\n if (ls instanceof LineString3d)\r\n return ls.packedPoints;\r\n }\r\n }\r\n return undefined;\r\n }\r\n /** Return a structural clone, with CurvePrimitive objects stroked. */\r\n public abstract override cloneStroked(options?: StrokeOptions): CurveChain;\r\n /**\r\n * Add a child curve.\r\n * @param child curve to add to the chain. The curve is captured by this instance.\r\n * @return whether the child was added\r\n */\r\n public tryAddChild(child: AnyCurve | undefined): boolean {\r\n if (child && child instanceof CurvePrimitive) {\r\n this._curves.push(child);\r\n return true;\r\n }\r\n return false;\r\n }\r\n /** Return a child by index */\r\n public getChild(i: number): CurvePrimitive | undefined {\r\n if (i < this._curves.length) return this._curves[i];\r\n return undefined;\r\n }\r\n /** Invoke `curve.extendRange(range, transform)` for each child */\r\n public override extendRange(range: Range3d, transform?: Transform): void {\r\n for (const curve of this._curves)\r\n curve.extendRange(range, transform);\r\n }\r\n /**\r\n * Reverse each child curve (in place).\r\n * Reverse the order of the children array.\r\n */\r\n public reverseChildrenInPlace(): void {\r\n for (const curve of this._curves)\r\n curve.reverseInPlace();\r\n this._curves.reverse();\r\n }\r\n /** Same as [[reverseChildrenInPlace]]. */\r\n public override reverseInPlace(): void {\r\n this.reverseChildrenInPlace();\r\n }\r\n /**\r\n * Return the index where target is found in the array of children.\r\n * @param alsoSearchProxies whether to also check proxy curves of the children\r\n */\r\n public childIndex(target: CurvePrimitive | undefined, alsoSearchProxies?: boolean): number | undefined {\r\n for (let i = 0; i < this._curves.length; i++) {\r\n if (this._curves[i] === target)\r\n return i;\r\n }\r\n if (alsoSearchProxies ?? false) {\r\n for (let i = 0; i < this._curves.length; i++) {\r\n const childCurve = this._curves[i];\r\n if (childCurve instanceof ProxyCurve) {\r\n if (childCurve.proxyCurve === target)\r\n return i;\r\n }\r\n }\r\n }\r\n return undefined;\r\n }\r\n /** Evaluate an indexed curve at a fraction. Return as a CurveLocationDetail that indicates the primitive. */\r\n public primitiveIndexAndFractionToCurveLocationDetailPointAndDerivative(\r\n index: number, fraction: number, cyclic: boolean = false, result?: CurveLocationDetail,\r\n ): CurveLocationDetail | undefined {\r\n const primitive = this.cyclicCurvePrimitive(index, cyclic);\r\n if (primitive) {\r\n return CurveLocationDetail.createCurveEvaluatedFractionPointAndDerivative(primitive, fraction, result);\r\n }\r\n return undefined;\r\n }\r\n}\r\n\r\n/**\r\n * * A `BagOfCurves` object is a collection of `AnyCurve` objects.\r\n * * A `BagOfCurves` has no implied properties such as being planar.\r\n * @public\r\n */\r\nexport class BagOfCurves extends CurveCollection {\r\n /** String name for schema properties */\r\n public readonly curveCollectionType = \"bagOfCurves\";\r\n /** Test if `other` is an instance of `BagOfCurves` */\r\n public isSameGeometryClass(other: GeometryQuery): boolean {\r\n return other instanceof BagOfCurves;\r\n }\r\n /**\r\n * Array of children.\r\n * * No restrictions on type.\r\n */\r\n protected _children: AnyCurve[];\r\n /** Construct an empty `BagOfCurves` */\r\n public constructor() {\r\n super();\r\n this._children = [];\r\n }\r\n /** Return the (reference to) array of children */\r\n public override get children(): AnyCurve[] {\r\n return this._children;\r\n }\r\n /** Create with given curves. */\r\n public static create(...data: AnyCurve[]): BagOfCurves {\r\n const result = new BagOfCurves();\r\n for (const child of data) {\r\n result.tryAddChild(child);\r\n }\r\n return result;\r\n }\r\n /** Return the boundary type (0) of a corresponding MicroStation CurveVector */\r\n public dgnBoundaryType(): number {\r\n return 0;\r\n }\r\n /** Invoke `processor.announceBagOfCurves(this, indexInParent);` */\r\n public announceToCurveProcessor(processor: RecursiveCurveProcessor, indexInParent: number = -1): void {\r\n return processor.announceBagOfCurves(this, indexInParent);\r\n }\r\n /** Clone all children in stroked form. */\r\n public cloneStroked(options?: StrokeOptions): BagOfCurves {\r\n const clone = new BagOfCurves();\r\n let child;\r\n for (child of this.children) {\r\n if (child instanceof CurvePrimitive) {\r\n const ls = LineString3d.create();\r\n child.emitStrokes(ls, options);\r\n if (ls)\r\n clone.children.push(ls);\r\n } else if (child instanceof CurveCollection) {\r\n const childStrokes = child.cloneStroked(options);\r\n if (childStrokes)\r\n clone.children.push(childStrokes);\r\n }\r\n }\r\n return clone;\r\n }\r\n /**\r\n * Return the closest point on the contained curves.\r\n * @param spacePoint point in space.\r\n * @param extend applicable only to children of type [[CurvePrimitive]], [[Path]], or [[BagOfCurves]]\r\n * @param result optional pre-allocated detail to populate and return.\r\n * @returns details of the closest point.\r\n */\r\n public override closestPoint(\r\n spacePoint: Point3d, extend: VariantCurveExtendParameter = false, result?: CurveLocationDetail,\r\n ): CurveLocationDetail | undefined {\r\n let detailA: CurveLocationDetail | undefined;\r\n const detailB = new CurveLocationDetail();\r\n if (this.children !== undefined) {\r\n for (const child of this.children) {\r\n if (child.closestPoint(spacePoint, extend, detailB))\r\n detailA = result = CurveLocationDetail.chooseSmallerA(detailA, detailB)!.clone(result);\r\n }\r\n }\r\n return detailA;\r\n }\r\n /** Return an empty `BagOfCurves` */\r\n public cloneEmptyPeer(): BagOfCurves {\r\n return new BagOfCurves();\r\n }\r\n /** Add a child */\r\n public tryAddChild(child: AnyCurve | undefined): boolean {\r\n if (child)\r\n this._children.push(child);\r\n return true;\r\n }\r\n /** Get a child by index */\r\n public getChild(i: number): AnyCurve | undefined {\r\n if (i < this._children.length)\r\n return this._children[i];\r\n return undefined;\r\n }\r\n /** Second step of double dispatch: call `handler.handleBagOfCurves(this)` */\r\n public dispatchToGeometryHandler(handler: GeometryHandler): any {\r\n return handler.handleBagOfCurves(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ACd,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;YACtC,CAAC;QACH,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;IACD;;;;;;OAMG;IACa,YAAY,CAC1B,UAAmB,EAAE,SAAsC,KAAK,EAAE,MAA4B;QAE9F,IAAI,OAAwC,CAAC;QAC7C,MAAM,OAAO,GAAG,IAAI,yCAAmB,EAAE,CAAC;QAC1C,IAAI,IAAI,CAAC,QAAQ,KAAK,SAAS,EAAE,CAAC;YAChC,KAAK,MAAM,KAAK,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;gBAClC,IAAI,KAAK,CAAC,YAAY,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,CAAC;oBACjD,OAAO,GAAG,MAAM,GAAG,yCAAmB,CAAC,cAAc,CAAC,OAAO,EAAE,OAAO,CAAE,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;YAC3F,CAAC;QACH,CAAC;QACD,OAAO,OAAO,CAAC;IACjB,CAAC;IACD,oCAAoC;IAC7B,cAAc;QACnB,OAAO,IAAI,WAAW,EAAE,CAAC;IAC3B,CAAC;IACD,mBAAmB;IACZ,WAAW,CAAC,KAA2B;QAC5C,IAAI,KAAK;YACP,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAC7B,OAAO,IAAI,CAAC;IACd,CAAC;IACD,2BAA2B;IACpB,QAAQ,CAAC,CAAS;QACvB,IAAI,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM;YAC3B,OAAO,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;QAC3B,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,8EAA8E;IACvE,yBAAyB,CAAC,OAAwB;QACvD,OAAO,OAAO,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC;IACzC,CAAC;CACF;AA/FD,kCA+FC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\n/** @packageDocumentation\r\n * @module Curve\r\n */\r\nimport { Geometry } from \"../Geometry\";\r\nimport { GeometryHandler } from \"../geometry3d/GeometryHandler\";\r\nimport { GrowableXYZArray } from \"../geometry3d/GrowableXYZArray\";\r\nimport { Point3d, Vector3d } from \"../geometry3d/Point3dVector3d\";\r\nimport { Range1d, Range3d } from \"../geometry3d/Range\";\r\nimport { Ray3d } from \"../geometry3d/Ray3d\";\r\nimport { Transform } from \"../geometry3d/Transform\";\r\nimport { VariantCurveExtendParameter } from \"./CurveExtendMode\";\r\nimport { CurveLocationDetail } from \"./CurveLocationDetail\";\r\nimport { CurvePrimitive, TangentOptions } from \"./CurvePrimitive\";\r\nimport { RecursiveCurveProcessor } from \"./CurveProcessor\";\r\nimport { AnyCurve, type AnyRegion } from \"./CurveTypes\";\r\nimport { GeometryQuery } from \"./GeometryQuery\";\r\nimport { CloneCurvesContext } from \"./internalContexts/CloneCurvesContext\";\r\nimport { CloneWithExpandedLineStrings } from \"./internalContexts/CloneWithExpandedLineStrings\";\r\nimport { CountLinearPartsSearchContext } from \"./internalContexts/CountLinearPartsSearchContext\";\r\nimport { GapSearchContext } from \"./internalContexts/GapSearchContext\";\r\nimport { PlaneAltitudeRangeContext } from \"./internalContexts/PlaneAltitudeRangeContext\";\r\nimport { SumLengthsContext } from \"./internalContexts/SumLengthsContext\";\r\nimport { TransformInPlaceContext } from \"./internalContexts/TransformInPlaceContext\";\r\nimport { LineString3d } from \"./LineString3d\";\r\nimport { ProxyCurve } from \"./ProxyCurve\";\r\nimport { StrokeOptions } from \"./StrokeOptions\";\r\n\r\nimport type { Path } from \"./Path\";\r\nimport type { Loop } from \"./Loop\";\r\nimport { AnnounceTangentStrokeHandler } from \"./internalContexts/AnnounceTangentStrokeHandler\";\r\nimport { Matrix3d } from \"../geometry3d/Matrix3d\";\r\n\r\n/** Note: CurveChain and BagOfCurves classes are located in this file to prevent circular dependency. */\r\n\r\n/**\r\n * Describes the concrete type of a [[CurveCollection]]. Each type name maps to a specific subclass and can be\r\n * used in conditional statements for type-switching.\r\n * - \"loop\" => [[Loop]]\r\n * - \"path\" => [[Path]]\r\n * - \"unionRegion\" => [[UnionRegion]]\r\n * - \"parityRegion\" => [[ParityRegion]]\r\n * - \"bagOfCurves\" => [[BagOfCurves]]\r\n * @public\r\n */\r\nexport type CurveCollectionType = \"loop\" | \"path\" | \"unionRegion\" | \"parityRegion\" | \"bagOfCurves\";\r\n\r\n/**\r\n * A `CurveCollection` is an abstract (non-instantiable) class for various sets of curves with particular structures:\r\n * - [[CurveChain]] - a non-instantiable intermediate class for a sequence of [[CurvePrimitive]] joining head-to-tail.\r\n * The two instantiable forms of `CurveChain` are:\r\n * - [[Path]] - a chain of curves. Does not have to be closed or planar. A closed `Path` is not treated as bounding a surface.\r\n * - [[Loop]] - a closed and planar chain of curves. A `Loop` is treated as bounding a planar area.\r\n * - [[ParityRegion]] - a collection of coplanar `Loop`, with \"in/out\" classification by parity rules.\r\n * - [[UnionRegion]] - a collection of coplanar `Loop` and/or `ParityRegion`, with \"in/out\" classification by union rules.\r\n * - [[BagOfCurves]] - a collection of [[AnyCurve]] with no implied structure.\r\n *\r\n * @see [Curve Collections]($docs/learning/geometry/CurveCollection.md) learning article.\r\n * @public\r\n */\r\nexport abstract class CurveCollection extends GeometryQuery {\r\n /** String name for schema properties */\r\n public readonly geometryCategory = \"curveCollection\";\r\n /** Type discriminator. */\r\n public abstract readonly curveCollectionType: CurveCollectionType;\r\n /** Flag for inner loop status. Only used by `Loop`. */\r\n public isInner: boolean = false;\r\n /** Return the curve children. */\r\n public abstract override get children(): AnyCurve[];\r\n /** Return the sum of the lengths of all contained curves. */\r\n public sumLengths(): number {\r\n return SumLengthsContext.sumLengths(this);\r\n }\r\n /**\r\n * Return the closest point on the contained curves.\r\n * @param spacePoint point in space.\r\n * @param _extend unused here (pass false), but applicable to overrides in [[Path]] and [[BagOfCurves]].\r\n * @param result optional pre-allocated detail to populate and return.\r\n * @returns details of the closest point.\r\n */\r\n public closestPoint(\r\n spacePoint: Point3d, _extend: VariantCurveExtendParameter = false, result?: CurveLocationDetail,\r\n ): CurveLocationDetail | undefined {\r\n let detailA: CurveLocationDetail | undefined;\r\n const detailB = new CurveLocationDetail();\r\n if (this.children !== undefined) {\r\n for (const child of this.children) {\r\n if (child.closestPoint(spacePoint, false, detailB))\r\n detailA = result = CurveLocationDetail.chooseSmallerA(detailA, detailB)!.clone(result);\r\n }\r\n }\r\n return detailA;\r\n }\r\n /**\r\n * Announce all points `P` on the contained curves such that the line containing `spacePoint` and `P` is tangent to\r\n * the contained curves in the view defined by `options.vectorToEye`.\r\n * * Strictly speaking, each tangent line lies in the plane through `P` whose normal is the cross product of the curve\r\n * tangent at `P` and `options.vectorToEye`. This is equivalent to tangency as seen in a view plane perpendicular to\r\n * `options.vectorToEye`.\r\n * @param spacePoint point in space.\r\n * @param announceTangent callback to announce each computed tangent. The received [[CurveLocationDetail]] is reused\r\n * internally, so it should be cloned in the callback if it needs to be saved.\r\n * @param options (optional) options for computing tangents. See [[TangentOptions]] for defaults.\r\n */\r\n public emitTangents(\r\n spacePoint: Point3d, announceTangent: (tangent: CurveLocationDetail) => any, options?: TangentOptions,\r\n ): void {\r\n const strokeHandler = new AnnounceTangentStrokeHandler(spacePoint, announceTangent, options);\r\n if (this.children !== undefined) {\r\n for (const child of this.children) {\r\n if (child instanceof CurvePrimitive)\r\n child.emitStrokableParts(strokeHandler, options?.strokeOptions);\r\n else if (child instanceof CurveCollection)\r\n child.emitTangents(spacePoint, announceTangent, options);\r\n }\r\n }\r\n }\r\n /**\r\n * Return all points `P` on the contained curves such that the line containing `spacePoint` and `P` is tangent to the\r\n * contained curves in the view defined by `options.vectorToEye`.\r\n * * See [[emitTangents]] for the definition of tangency employed.\r\n * @param spacePoint point in space.\r\n * @param options (optional) options for computing tangents. See [[TangentOptions]] for defaults.\r\n * @returns an array of details of all tangent points or undefined if no tangent was found.\r\n */\r\n public allTangents(spacePoint: Point3d, options?: TangentOptions): CurveLocationDetail[] | undefined {\r\n const tangents: CurveLocationDetail[] = [];\r\n this.emitTangents(spacePoint, (t: CurveLocationDetail) => tangents.push(t.clone()), options);\r\n return (tangents.length === 0) ? undefined : tangents;\r\n }\r\n /**\r\n * Return the point `P` on the contained curves such that the line containing `spacePoint` and `P` is tangent to the\r\n * contained curves in the view defined by `options.vectorToEye`, and `P` is closest to `options.hintPoint` in this view.\r\n * * See [[emitTangents]] for the definition of tangency employed.\r\n * @param spacePoint point in space.\r\n * @param options (optional) options for computing tangents. See [[TangentOptions]] for defaults.\r\n * @returns the detail of the closest tangent point or undefined if no tangent was found.\r\n */\r\n public closestTangent(spacePoint: Point3d, options?: TangentOptions): CurveLocationDetail | undefined {\r\n const hint = options?.hintPoint ?? spacePoint;\r\n let toLocal: Matrix3d | undefined;\r\n if (options?.vectorToEye && !options.vectorToEye.isExactEqual({ x: 0, y: 0, z: 1 }))\r\n toLocal = Matrix3d.createRigidViewAxesZTowardsEye(options.vectorToEye.x, options.vectorToEye.y, options.vectorToEye.z);\r\n const measureHintDist2 = (pt: Point3d): number => { // measure distance to hint in view plane coordinates\r\n return toLocal?.multiplyTransposeXYZ(hint.x - pt.x, hint.y - pt.y, hint.z - pt.z).magnitudeSquaredXY() ?? pt.distanceSquaredXY(hint);\r\n };\r\n let closestTangent: CurveLocationDetail | undefined;\r\n let closestDist2 = Geometry.largeCoordinateResult;\r\n const collectClosestTangent = (tangent: CurveLocationDetail) => {\r\n const dist2 = measureHintDist2(tangent.point);\r\n if (!closestTangent || dist2 < closestDist2) {\r\n closestTangent = tangent.clone(closestTangent);\r\n closestDist2 = dist2;\r\n }\r\n };\r\n this.emitTangents(spacePoint, collectClosestTangent, options);\r\n return closestTangent;\r\n }\r\n /** Reverse the collection's data so that each child curve's fractional stroking moves in the opposite direction. */\r\n public reverseInPlace(): void {\r\n for (const curve of this.children)\r\n curve.reverseInPlace();\r\n }\r\n /**\r\n * Return the max gap between adjacent primitives in Path and Loop collections.\r\n * * In a Path, gaps are computed between consecutive primitives.\r\n * * In a Loop, gaps are computed between consecutive primitives and between last and first.\r\n * * Gaps are NOT computed between consecutive CurvePrimitives in \"unstructured\" collections. The type is\r\n * \"unstructured\" so gaps should not be semantically meaningful.\r\n */\r\n public maxGap(): number {\r\n return GapSearchContext.maxGap(this);\r\n }\r\n /** Return true if the curve collection has any primitives other than LineSegment3d and LineString3d */\r\n public checkForNonLinearPrimitives(): boolean {\r\n return CountLinearPartsSearchContext.hasNonLinearPrimitives(this);\r\n }\r\n /** Apply transform recursively to children */\r\n public tryTransformInPlace(transform: Transform): boolean {\r\n return TransformInPlaceContext.tryTransformInPlace(this, transform);\r\n }\r\n /** Return a deep copy. */\r\n public override clone(): CurveCollection {\r\n return CloneCurvesContext.clone(this) as CurveCollection;\r\n }\r\n /** Create a deep copy of transformed curves. */\r\n public override cloneTransformed(transform: Transform): CurveCollection | undefined {\r\n return CloneCurvesContext.clone(this, transform);\r\n }\r\n /** Create a deep copy with all linestrings broken down into multiple LineSegment3d. */\r\n public cloneWithExpandedLineStrings(): CurveCollection {\r\n return CloneWithExpandedLineStrings.clone(this);\r\n }\r\n /**\r\n * Push all CurvePrimitives contained in the instance onto the `results` array.\r\n * * This method is recursive. For example, if the CurveCollection contains a Loop, all CurvePrimitives\r\n * of the Loop are pushed onto `results`.\r\n */\r\n private collectCurvePrimitivesGo(\r\n results: CurvePrimitive[], smallestPossiblePrimitives: boolean, explodeLinestrings: boolean = false,\r\n ): void {\r\n if (this.children) {\r\n for (const child of this.children) {\r\n if (child instanceof CurvePrimitive)\r\n child.collectCurvePrimitivesGo(results, smallestPossiblePrimitives, explodeLinestrings);\r\n else if (child instanceof CurveCollection)\r\n child.collectCurvePrimitivesGo(results, smallestPossiblePrimitives, explodeLinestrings);\r\n }\r\n }\r\n }\r\n /**\r\n * Return an array containing all CurvePrimitives in the instance.\r\n * * This method is recursive. For example, if the CurveCollection contains a Loop, all CurvePrimitives of\r\n * the Loop are pushed onto the returned array.\r\n * @param collectorArray optional array to receive primitives. If present, new primitives are ADDED (without\r\n * clearing the array).\r\n * @param smallestPossiblePrimitives if false, CurvePrimitiveWithDistanceIndex returns only itself. If true,\r\n * it recurses to its (otherwise hidden) children.\r\n */\r\n public collectCurvePrimitives(\r\n collectorArray?: CurvePrimitive[], smallestPossiblePrimitives: boolean = false, explodeLineStrings: boolean = false,\r\n ): CurvePrimitive[] {\r\n const results: CurvePrimitive[] = collectorArray === undefined ? [] : collectorArray;\r\n this.collectCurvePrimitivesGo(results, smallestPossiblePrimitives, explodeLineStrings);\r\n return results;\r\n }\r\n /**\r\n * Return true for planar region types:\r\n * * `Loop`\r\n * * `ParityRegion`\r\n * * `UnionRegion`\r\n * @see isAnyRegion\r\n */\r\n public get isAnyRegionType(): boolean {\r\n return this.dgnBoundaryType() === 2 || this.dgnBoundaryType() === 4 || this.dgnBoundaryType() === 5;\r\n }\r\n /** Type guard for AnyRegion */\r\n public isAnyRegion(): this is AnyRegion {\r\n return this.isAnyRegionType;\r\n }\r\n /**\r\n * Return true for a `Path`, i.e. a chain of curves joined head-to-tail\r\n * @see isPath\r\n */\r\n public get isOpenPath(): boolean {\r\n return this.dgnBoundaryType() === 1;\r\n }\r\n /** Type guard for Path */\r\n public isPath(): this is Path {\r\n return this.isOpenPath;\r\n }\r\n /**\r\n * Return true for a single-loop planar region type, i.e. `Loop`.\r\n * * This is NOT a test for physical closure of a `Path`.\r\n * @see isLoop\r\n */\r\n public get isClosedPath(): boolean {\r\n return this.dgnBoundaryType() === 2;\r\n }\r\n /** Type guard for Loop */\r\n public isLoop(): this is Loop {\r\n return this.isClosedPath;\r\n }\r\n\r\n /** Return a CurveCollection with the same structure but all curves replaced by strokes. */\r\n public abstract cloneStroked(options?: StrokeOptions): CurveCollection;\r\n /** Support method for ICurvePrimitive ... one line call to specific announce method . . */\r\n public abstract announceToCurveProcessor(processor: RecursiveCurveProcessor): void;\r\n /** Clone an empty collection. */\r\n public abstract cloneEmptyPeer(): CurveCollection;\r\n /**\r\n * Return the boundary type of a corresponding MicroStation CurveVector.\r\n * * Derived class must implement.\r\n */\r\n public abstract dgnBoundaryType(): number;\r\n /**\r\n * Try to add a child.\r\n * @param child child to add.\r\n * @return true if child is an acceptable type for this collection.\r\n */\r\n public abstract tryAddChild(child: AnyCurve | undefined): boolean;\r\n /** Return a child identified by by index */\r\n public abstract getChild(i: number): AnyCurve | undefined;\r\n /**\r\n * Extend (increase) the given range as needed to encompass all curves in the curve collection.\r\n * @param rangeToExtend the given range.\r\n * @param transform if supplied, the range is extended with transformed curves.\r\n */\r\n public extendRange(rangeToExtend: Range3d, transform?: Transform): void {\r\n const children = this.children;\r\n if (children) {\r\n for (const c of children) {\r\n c.extendRange(rangeToExtend, transform);\r\n }\r\n }\r\n }\r\n /**\r\n * Find any CurvePrimitive in the source and evaluate it at the given fraction.\r\n * * The first CurvePrimitive found is evaluated. Any other CurvePrimitives are ignored.\r\n * @param source containing `CurvePrimitive` or `CurveCollection`\r\n * @param fraction fraction to use in `curve.fractionToPoint(fraction)`\r\n */\r\n public static createCurveLocationDetailOnAnyCurvePrimitive(\r\n source: GeometryQuery | undefined, fraction: number = 0.5,\r\n ): CurveLocationDetail | undefined {\r\n if (!source)\r\n return undefined;\r\n if (source instanceof CurvePrimitive) {\r\n return CurveLocationDetail.createCurveEvaluatedFraction(source, fraction);\r\n } else if (source instanceof CurveCollection && source.children !== undefined)\r\n for (const child of source.children) {\r\n const detail = this.createCurveLocationDetailOnAnyCurvePrimitive(child, fraction);\r\n if (detail)\r\n return detail;\r\n }\r\n return undefined;\r\n }\r\n /**\r\n * Project instance geometry (via dispatch) onto the given ray, and return the extreme fractional parameters\r\n * of projection.\r\n * @param ray ray onto which the instance is projected. A `Vector3d` is treated as a `Ray3d` with zero origin.\r\n * @param lowHigh optional receiver for output\r\n * @returns range of fractional projection parameters onto the ray, where 0.0 is start of the ray and 1.0 is the\r\n * end of the ray.\r\n */\r\n public projectedParameterRange(ray: Vector3d | Ray3d, lowHigh?: Range1d): Range1d | undefined {\r\n return PlaneAltitudeRangeContext.findExtremeFractionsAlongDirection(this, ray, lowHigh);\r\n }\r\n /** Return the immediate parent of the input curve in the instance, or undefined if it is not a descendant. */\r\n public findParentOfDescendant(descendant: AnyCurve): CurveCollection | undefined {\r\n for (const child of this.children) {\r\n if (child === descendant)\r\n return this;\r\n if (child instanceof CurveCollection) {\r\n const parent = child.findParentOfDescendant(descendant);\r\n if (parent)\r\n return parent;\r\n }\r\n }\r\n return undefined;\r\n };\r\n}\r\n\r\n/**\r\n * Shared base class for use by both open and closed paths.\r\n * * A `CurveChain` contains only CurvePrimitives. No other paths, loops, or regions allowed.\r\n * * The specific derived classes are `Path` and `Loop`.\r\n * * `CurveChain` is an intermediate class. It is not instantiable on its own.\r\n * * The related class `CurveChainWithDistanceIndex` is a `CurvePrimitive` whose API presents well-defined mappings\r\n * from fraction to xyz over the entire chain, but in fact does all the calculations over multiple primitives.\r\n * @see [Curve Collections]($docs/learning/geometry/CurveCollection.md) learning article.\r\n * @public\r\n */\r\nexport abstract class CurveChain extends CurveCollection {\r\n /** The curve primitives in the chain. */\r\n protected _curves: CurvePrimitive[];\r\n /** Constructor */\r\n protected constructor() {\r\n super();\r\n this._curves = [];\r\n }\r\n /** Return the array of `CurvePrimitive` */\r\n public override get children(): CurvePrimitive[] {\r\n return this._curves;\r\n }\r\n /** Return the start point of the curve chain (start point of the first child). */\r\n public startPoint(result?: Point3d): Point3d | undefined {\r\n const firstChild = this.getChild(0);\r\n if (firstChild)\r\n return firstChild.fractionToPoint(0.0, result);\r\n else\r\n return undefined;\r\n }\r\n /** Return the end point of the curve chain (end point of the last child). */\r\n public endPoint(result?: Point3d): Point3d | undefined {\r\n const lastChild = this.getChild(this._curves.length - 1);\r\n if (lastChild)\r\n return lastChild.fractionToPoint(1.0, result);\r\n else\r\n return undefined;\r\n }\r\n /**\r\n * Return the start point and derivative of the first child of the curve chain.\r\n * * For queries interior to the chain, use [[CurveChainWithDistanceIndex.fractionToPointAndDerivative]].\r\n */\r\n public startPointAndDerivative(result?: Ray3d): Ray3d | undefined {\r\n const firstChild = this.getChild(0);\r\n if (firstChild)\r\n return firstChild.fractionToPointAndDerivative(0.0, result);\r\n else\r\n return undefined;\r\n }\r\n /**\r\n * Return the end point and derivative of the last child of the curve chain.\r\n * * For queries interior to the chain, use [[CurveChainWithDistanceIndex.fractionToPointAndDerivative]].\r\n */\r\n public endPointAndDerivative(result?: Ray3d): Ray3d | undefined {\r\n const lastChild = this.getChild(this._curves.length - 1);\r\n if (lastChild)\r\n return lastChild.fractionToPointAndDerivative(1.0, result);\r\n else\r\n return undefined;\r\n }\r\n /**\r\n * Return the curve primitive at the given `index`, optionally using `modulo` to map `index` to the cyclic indexing.\r\n * * In particular, `-1` is the final curve.\r\n * @param index cyclic index\r\n */\r\n public cyclicCurvePrimitive(index: number, cyclic: boolean = true): CurvePrimitive | undefined {\r\n const n = this.children.length;\r\n if (n === 0)\r\n return undefined;\r\n if (index >= 0 && index < n) // try simplest non-cyclic access first\r\n return this.children[index];\r\n if (cyclic) {\r\n const index2 = Geometry.modulo(index, n);\r\n return this.children[index2];\r\n }\r\n return undefined;\r\n }\r\n /**\r\n * Stroke the chain into a simple xyz array.\r\n * @param options tolerance parameters controlling the stroking.\r\n */\r\n public getPackedStrokes(options?: StrokeOptions): GrowableXYZArray | undefined {\r\n /**\r\n * The object returned by \"cloneStroked\" has the same type (Loop or Path) but instead of a chain of\r\n * CurvePrimitives as children, it has a single LineString3d child. \"getPackedStrokes\" just returns\r\n * the points of that LineString3d using \"packedPoints\".\r\n */\r\n const tree = this.cloneStroked(options);\r\n if (tree instanceof CurveChain) {\r\n const children = tree.children;\r\n if (children.length === 1) {\r\n const ls = children[0];\r\n if (ls instanceof LineString3d)\r\n return ls.packedPoints;\r\n }\r\n }\r\n return undefined;\r\n }\r\n /** Return a structural clone, with CurvePrimitive objects stroked. */\r\n public abstract override cloneStroked(options?: StrokeOptions): CurveChain;\r\n /**\r\n * Add a child curve.\r\n * @param child curve to add to the chain. The curve is captured by this instance.\r\n * @return whether the child was added\r\n */\r\n public tryAddChild(child: AnyCurve | undefined): boolean {\r\n if (child && child instanceof CurvePrimitive) {\r\n this._curves.push(child);\r\n return true;\r\n }\r\n return false;\r\n }\r\n /** Return a child by index */\r\n public getChild(i: number): CurvePrimitive | undefined {\r\n if (i < this._curves.length) return this._curves[i];\r\n return undefined;\r\n }\r\n /** Invoke `curve.extendRange(range, transform)` for each child */\r\n public override extendRange(range: Range3d, transform?: Transform): void {\r\n for (const curve of this._curves)\r\n curve.extendRange(range, transform);\r\n }\r\n /**\r\n * Reverse each child curve (in place).\r\n * Reverse the order of the children array.\r\n */\r\n public reverseChildrenInPlace(): void {\r\n for (const curve of this._curves)\r\n curve.reverseInPlace();\r\n this._curves.reverse();\r\n }\r\n /** Same as [[reverseChildrenInPlace]]. */\r\n public override reverseInPlace(): void {\r\n this.reverseChildrenInPlace();\r\n }\r\n /**\r\n * Return the index where target is found in the array of children.\r\n * @param alsoSearchProxies whether to also check proxy curves of the children\r\n */\r\n public childIndex(target: CurvePrimitive | undefined, alsoSearchProxies?: boolean): number | undefined {\r\n for (let i = 0; i < this._curves.length; i++) {\r\n if (this._curves[i] === target)\r\n return i;\r\n }\r\n if (alsoSearchProxies ?? false) {\r\n for (let i = 0; i < this._curves.length; i++) {\r\n const childCurve = this._curves[i];\r\n if (childCurve instanceof ProxyCurve) {\r\n if (childCurve.proxyCurve === target)\r\n return i;\r\n }\r\n }\r\n }\r\n return undefined;\r\n }\r\n /** Evaluate an indexed curve at a fraction. Return as a CurveLocationDetail that indicates the primitive. */\r\n public primitiveIndexAndFractionToCurveLocationDetailPointAndDerivative(\r\n index: number, fraction: number, cyclic: boolean = false, result?: CurveLocationDetail,\r\n ): CurveLocationDetail | undefined {\r\n const primitive = this.cyclicCurvePrimitive(index, cyclic);\r\n if (primitive) {\r\n return CurveLocationDetail.createCurveEvaluatedFractionPointAndDerivative(primitive, fraction, result);\r\n }\r\n return undefined;\r\n }\r\n}\r\n\r\n/**\r\n * * A `BagOfCurves` object is a collection of `AnyCurve` objects.\r\n * * A `BagOfCurves` has no implied properties such as being planar.\r\n * @public\r\n */\r\nexport class BagOfCurves extends CurveCollection {\r\n /** String name for schema properties */\r\n public readonly curveCollectionType = \"bagOfCurves\";\r\n /** Test if `other` is an instance of `BagOfCurves` */\r\n public isSameGeometryClass(other: GeometryQuery): boolean {\r\n return other instanceof BagOfCurves;\r\n }\r\n /**\r\n * Array of children.\r\n * * No restrictions on type.\r\n */\r\n protected _children: AnyCurve[];\r\n /** Construct an empty `BagOfCurves` */\r\n public constructor() {\r\n super();\r\n this._children = [];\r\n }\r\n /** Return the (reference to) array of children */\r\n public override get children(): AnyCurve[] {\r\n return this._children;\r\n }\r\n /** Create with given curves. */\r\n public static create(...data: AnyCurve[]): BagOfCurves {\r\n const result = new BagOfCurves();\r\n for (const child of data) {\r\n result.tryAddChild(child);\r\n }\r\n return result;\r\n }\r\n /** Return the boundary type (0) of a corresponding MicroStation CurveVector */\r\n public dgnBoundaryType(): number {\r\n return 0;\r\n }\r\n /** Invoke `processor.announceBagOfCurves(this, indexInParent);` */\r\n public announceToCurveProcessor(processor: RecursiveCurveProcessor, indexInParent: number = -1): void {\r\n return processor.announceBagOfCurves(this, indexInParent);\r\n }\r\n /** Clone all children in stroked form. */\r\n public cloneStroked(options?: StrokeOptions): BagOfCurves {\r\n const clone = new BagOfCurves();\r\n let child;\r\n for (child of this.children) {\r\n if (child instanceof CurvePrimitive) {\r\n const ls = LineString3d.create();\r\n child.emitStrokes(ls, options);\r\n if (ls)\r\n clone.children.push(ls);\r\n } else if (child instanceof CurveCollection) {\r\n const childStrokes = child.cloneStroked(options);\r\n if (childStrokes)\r\n clone.children.push(childStrokes);\r\n }\r\n }\r\n return clone;\r\n }\r\n /**\r\n * Return the closest point on the contained curves.\r\n * @param spacePoint point in space.\r\n * @param extend applicable only to children of type [[CurvePrimitive]], [[Path]], or [[BagOfCurves]]\r\n * @param result optional pre-allocated detail to populate and return.\r\n * @returns details of the closest point.\r\n */\r\n public override closestPoint(\r\n spacePoint: Point3d, extend: VariantCurveExtendParameter = false, result?: CurveLocationDetail,\r\n ): CurveLocationDetail | undefined {\r\n let detailA: CurveLocationDetail | undefined;\r\n const detailB = new CurveLocationDetail();\r\n if (this.children !== undefined) {\r\n for (const child of this.children) {\r\n if (child.closestPoint(spacePoint, extend, detailB))\r\n detailA = result = CurveLocationDetail.chooseSmallerA(detailA, detailB)!.clone(result);\r\n }\r\n }\r\n return detailA;\r\n }\r\n /** Return an empty `BagOfCurves` */\r\n public cloneEmptyPeer(): BagOfCurves {\r\n return new BagOfCurves();\r\n }\r\n /** Add a child */\r\n public tryAddChild(child: AnyCurve | undefined): boolean {\r\n if (child)\r\n this._children.push(child);\r\n return true;\r\n }\r\n /** Get a child by index */\r\n public getChild(i: number): AnyCurve | undefined {\r\n if (i < this._children.length)\r\n return this._children[i];\r\n return undefined;\r\n }\r\n /** Second step of double dispatch: call `handler.handleBagOfCurves(this)` */\r\n public dispatchToGeometryHandler(handler: GeometryHandler): any {\r\n return handler.handleBagOfCurves(this);\r\n }\r\n}\r\n"]}
|
|
@@ -37,19 +37,19 @@ export declare enum CurveSearchStatus {
|
|
|
37
37
|
* @public
|
|
38
38
|
*/
|
|
39
39
|
export declare class CurveLocationDetail {
|
|
40
|
-
/** The curve being evaluated */
|
|
40
|
+
/** The curve being evaluated. */
|
|
41
41
|
curve?: CurvePrimitive;
|
|
42
|
-
/** Optional ray */
|
|
42
|
+
/** Optional ray. */
|
|
43
43
|
ray?: Ray3d;
|
|
44
|
-
/** The fractional position along the curve */
|
|
44
|
+
/** The fractional position along the curve. */
|
|
45
45
|
fraction: number;
|
|
46
|
-
/** Detail condition of the role this point has in some context */
|
|
46
|
+
/** Detail condition of the role this point has in some context. */
|
|
47
47
|
intervalRole?: CurveIntervalRole;
|
|
48
|
-
/** The point on the curve */
|
|
48
|
+
/** The point on the curve. */
|
|
49
49
|
point: Point3d;
|
|
50
|
-
/** A vector (e.g. tangent vector) in context */
|
|
50
|
+
/** A vector (e.g. tangent vector) in context. */
|
|
51
51
|
vectorInCurveLocationDetail?: Vector3d;
|
|
52
|
-
/** A context-specific numeric value
|
|
52
|
+
/** A context-specific numeric value (e.g., a distance). */
|
|
53
53
|
a: number;
|
|
54
54
|
/**
|
|
55
55
|
* Optional CurveLocationDetail with more detail of location. For instance, a detail for fractional position
|
|
@@ -59,26 +59,26 @@ export declare class CurveLocationDetail {
|
|
|
59
59
|
childDetail?: CurveLocationDetail;
|
|
60
60
|
/**
|
|
61
61
|
* A status indicator for certain searches.
|
|
62
|
-
* * e.g
|
|
62
|
+
* * e.g., CurvePrimitive.moveSignedDistanceFromFraction.
|
|
63
63
|
*/
|
|
64
64
|
curveSearchStatus?: CurveSearchStatus;
|
|
65
|
-
/** (Optional) second fraction, e.g. end of interval of coincident curves */
|
|
65
|
+
/** (Optional) second fraction, e.g. end of interval of coincident curves. */
|
|
66
66
|
fraction1?: number;
|
|
67
|
-
/** (Optional) second point, e.g. end of interval of coincident curves */
|
|
67
|
+
/** (Optional) second point, e.g. end of interval of coincident curves. */
|
|
68
68
|
point1?: Point3d;
|
|
69
69
|
/** A context-specific temporary point, e.g. for intermediate calculations. */
|
|
70
70
|
pointQ: Point3d;
|
|
71
71
|
/** Constructor */
|
|
72
72
|
constructor();
|
|
73
|
-
/** Set the (optional) intervalRole field */
|
|
73
|
+
/** Set the (optional) intervalRole field. */
|
|
74
74
|
setIntervalRole(value: CurveIntervalRole): void;
|
|
75
|
-
/** Set the (optional) fraction1 and point1, using direct assignment (capture!) to point1 */
|
|
75
|
+
/** Set the (optional) fraction1 and point1, using direct assignment (capture!) to point1. */
|
|
76
76
|
captureFraction1Point1(fraction1: number, point1: Point3d): void;
|
|
77
|
-
/** Test if this pair has fraction1 defined */
|
|
77
|
+
/** Test if this pair has fraction1 defined. */
|
|
78
78
|
get hasFraction1(): boolean;
|
|
79
|
-
/** Test if this is an isolated point. This is true if intervalRole is any of (undefined, isolated, isolatedAtVertex) */
|
|
79
|
+
/** Test if this is an isolated point. This is true if intervalRole is any of (undefined, isolated, isolatedAtVertex). */
|
|
80
80
|
get isIsolated(): boolean;
|
|
81
|
-
/** Return the fraction delta. (0 if no fraction1) */
|
|
81
|
+
/** Return the fraction delta. (0 if no fraction1). */
|
|
82
82
|
get fractionDelta(): number;
|
|
83
83
|
/**
|
|
84
84
|
* If (fraction1, point1) are defined, make them the primary (and only) data.
|
|
@@ -88,7 +88,7 @@ export declare class CurveLocationDetail {
|
|
|
88
88
|
/** Make (fraction, point) the primary (and only) data. */
|
|
89
89
|
collapseToStart(): void;
|
|
90
90
|
/**
|
|
91
|
-
* Return a complete copy, WITH CAVEATS
|
|
91
|
+
* Return a complete copy, WITH CAVEATS.
|
|
92
92
|
* * curve member is copied as a reference.
|
|
93
93
|
* * point and vector members are cloned.
|
|
94
94
|
*/
|
|
@@ -96,9 +96,9 @@ export declare class CurveLocationDetail {
|
|
|
96
96
|
/**
|
|
97
97
|
* Updated in this instance.
|
|
98
98
|
* * Note that if caller omits `vector` and `a`, those fields are updated to the call-list defaults (NOT left as-is)
|
|
99
|
-
* * point and vector updates are by data copy (not capture of pointers)
|
|
100
|
-
* @param fraction (required) fraction to install
|
|
101
|
-
* @param point
|
|
99
|
+
* * point and vector updates are by data copy (not capture of pointers).
|
|
100
|
+
* @param fraction (required) fraction to install.
|
|
101
|
+
* @param point (required) point to install.
|
|
102
102
|
* @param vector (optional) vector to install.
|
|
103
103
|
* @param a (optional) numeric value to install.
|
|
104
104
|
*/
|
|
@@ -106,9 +106,9 @@ export declare class CurveLocationDetail {
|
|
|
106
106
|
/**
|
|
107
107
|
* Updated in this instance.
|
|
108
108
|
* * Note that if caller omits a`, that field is updated to the call-list default (NOT left as-is)
|
|
109
|
-
* * point and vector updates are by data copy (not capture of the ray members)
|
|
110
|
-
* @param fraction (required) fraction to install
|
|
111
|
-
* @param ray (required) point and vector to install
|
|
109
|
+
* * point and vector updates are by data copy (not capture of the ray members).
|
|
110
|
+
* @param fraction (required) fraction to install.
|
|
111
|
+
* @param ray (required) point and vector to install.
|
|
112
112
|
* @param a (optional) numeric value to install.
|
|
113
113
|
*/
|
|
114
114
|
setFR(fraction: number, ray: Ray3d, a?: number): void;
|
|
@@ -122,7 +122,7 @@ export declare class CurveLocationDetail {
|
|
|
122
122
|
static createCurveFractionPoint(curve: CurvePrimitive | undefined, fraction: number, point: Point3d, result?: CurveLocationDetail): CurveLocationDetail;
|
|
123
123
|
/** Create a new detail with only ray, fraction, and point. */
|
|
124
124
|
static createRayFractionPoint(ray: Ray3d, fraction: number, point: Point3d, result?: CurveLocationDetail): CurveLocationDetail;
|
|
125
|
-
/** Create with CurvePrimitive pointer, fraction, and point coordinates */
|
|
125
|
+
/** Create with CurvePrimitive pointer, fraction, and point coordinates. */
|
|
126
126
|
static createCurveFractionPointDistanceCurveSearchStatus(curve: CurvePrimitive | undefined, fraction: number, point: Point3d, distance: number, status: CurveSearchStatus, result?: CurveLocationDetail): CurveLocationDetail;
|
|
127
127
|
/** Create with curveSearchStatus affected by allowExtension. */
|
|
128
128
|
static createConditionalMoveSignedDistance(allowExtension: boolean, curve: CurvePrimitive, startFraction: number, endFraction: number, requestedSignedDistance: number, result?: CurveLocationDetail): CurveLocationDetail;
|
|
@@ -140,7 +140,7 @@ export declare class CurveLocationDetail {
|
|
|
140
140
|
* @param fraction candidate fraction
|
|
141
141
|
* @param point candidate point
|
|
142
142
|
* @param a candidate distance
|
|
143
|
-
* @returns true if the given distance is smaller (and hence this detail was updated
|
|
143
|
+
* @returns true if the given distance is smaller (and hence this detail was updated)
|
|
144
144
|
*/
|
|
145
145
|
updateIfCloserCurveFractionPointDistance(curve: CurvePrimitive, fraction: number, point: Point3d, a: number): boolean;
|
|
146
146
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CurveLocationDetail.d.ts","sourceRoot":"","sources":["../../../src/curve/CurveLocationDetail.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD;;;GAGG;AACH,oBAAY,iBAAiB;IAC3B,+DAA+D;IAC/D,QAAQ,IAAI;IACZ,2CAA2C;IAC3C,gBAAgB,IAAI;IACpB,2CAA2C;IAC3C,aAAa,KAAK;IAClB,gDAAgD;IAChD,gBAAgB,KAAK;IACrB,qCAAqC;IACrC,WAAW,KAAK;CACjB;AAED;;;GAGG;AACH,oBAAY,iBAAiB;IAC3B,0CAA0C;IAC1C,KAAK,IAAA;IACL,iCAAiC;IACjC,OAAO,IAAI;IACX,4FAA4F;IAC5F,iBAAiB,IAAI;CACtB;AAaD;;;;;GAKG;AACH,qBAAa,mBAAmB;IAC9B,
|
|
1
|
+
{"version":3,"file":"CurveLocationDetail.d.ts","sourceRoot":"","sources":["../../../src/curve/CurveLocationDetail.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD;;;GAGG;AACH,oBAAY,iBAAiB;IAC3B,+DAA+D;IAC/D,QAAQ,IAAI;IACZ,2CAA2C;IAC3C,gBAAgB,IAAI;IACpB,2CAA2C;IAC3C,aAAa,KAAK;IAClB,gDAAgD;IAChD,gBAAgB,KAAK;IACrB,qCAAqC;IACrC,WAAW,KAAK;CACjB;AA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IACrC,YAAY,IAAI;IAChB,iHAAiH;IACjH,kBAAkB,IAAI;IACtB,qCAAqC;IACrC,kBAAkB,IAAI;IACtB,oCAAoC;IACpC,gBAAgB,IAAI;CACrB;AAED;;;GAGG;AACH,qBAAa,uBAAuB;IAClC,oCAAoC;IAC7B,OAAO,EAAE,mBAAmB,CAAC;IACpC,qCAAqC;IAC9B,OAAO,EAAE,mBAAmB,CAAC;IACpC;;;OAGG;IACI,YAAY,CAAC,EAAE,sBAAsB,CAAC;gBAE1B,OAAO,CAAC,EAAE,mBAAmB,EAAE,OAAO,CAAC,EAAE,mBAAmB;IAI/E,8EAA8E;WAChE,aAAa,CACzB,OAAO,EAAE,mBAAmB,EAAE,OAAO,EAAE,mBAAmB,EAAE,MAAM,CAAC,EAAE,uBAAuB,GAC3F,uBAAuB;IAM1B;;;OAGG;WACW,4BAA4B,CACxC,OAAO,EAAE,mBAAmB,EAAE,OAAO,EAAE,mBAAmB,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE,uBAAuB,GAC9G,uBAAuB;IAY1B,uDAAuD;IAChD,KAAK,CAAC,MAAM,CAAC,EAAE,uBAAuB,GAAG,uBAAuB;IAOvE,+BAA+B;IACxB,WAAW;IAKlB;;;;;;;;;OASG;WACW,wBAAwB,CAAC,KAAK,EAAE,uBAAuB,EAAE,EAAE,MAAM,GAAE,MAAU,GAAG,uBAAuB,EAAE;IAgBvH;;;;;OAKG;IACI,mBAAmB,CAAC,SAAS,EAAE,SAAS,GAAG,OAAO;CAG1D;AAED;;;;GAIG;AACH,qBAAa,4BAA4B;IACvC,8BAA8B;IACvB,KAAK,EAAE,mBAAmB,EAAE,CAAC;IACpC,+BAA+B;IACxB,KAAK,EAAE,mBAAmB,EAAE,CAAC;;CAKrC"}
|
|
@@ -57,19 +57,19 @@ function optionalUpdate(source, result) {
|
|
|
57
57
|
* @public
|
|
58
58
|
*/
|
|
59
59
|
class CurveLocationDetail {
|
|
60
|
-
/** The curve being evaluated */
|
|
60
|
+
/** The curve being evaluated. */
|
|
61
61
|
curve;
|
|
62
|
-
/** Optional ray */
|
|
62
|
+
/** Optional ray. */
|
|
63
63
|
ray;
|
|
64
|
-
/** The fractional position along the curve */
|
|
64
|
+
/** The fractional position along the curve. */
|
|
65
65
|
fraction;
|
|
66
|
-
/** Detail condition of the role this point has in some context */
|
|
66
|
+
/** Detail condition of the role this point has in some context. */
|
|
67
67
|
intervalRole;
|
|
68
|
-
/** The point on the curve */
|
|
68
|
+
/** The point on the curve. */
|
|
69
69
|
point;
|
|
70
|
-
/** A vector (e.g. tangent vector) in context */
|
|
70
|
+
/** A vector (e.g. tangent vector) in context. */
|
|
71
71
|
vectorInCurveLocationDetail;
|
|
72
|
-
/** A context-specific numeric value
|
|
72
|
+
/** A context-specific numeric value (e.g., a distance). */
|
|
73
73
|
a;
|
|
74
74
|
/**
|
|
75
75
|
* Optional CurveLocationDetail with more detail of location. For instance, a detail for fractional position
|
|
@@ -79,12 +79,12 @@ class CurveLocationDetail {
|
|
|
79
79
|
childDetail;
|
|
80
80
|
/**
|
|
81
81
|
* A status indicator for certain searches.
|
|
82
|
-
* * e.g
|
|
82
|
+
* * e.g., CurvePrimitive.moveSignedDistanceFromFraction.
|
|
83
83
|
*/
|
|
84
84
|
curveSearchStatus;
|
|
85
|
-
/** (Optional) second fraction, e.g. end of interval of coincident curves */
|
|
85
|
+
/** (Optional) second fraction, e.g. end of interval of coincident curves. */
|
|
86
86
|
fraction1;
|
|
87
|
-
/** (Optional) second point, e.g. end of interval of coincident curves */
|
|
87
|
+
/** (Optional) second point, e.g. end of interval of coincident curves. */
|
|
88
88
|
point1;
|
|
89
89
|
/** A context-specific temporary point, e.g. for intermediate calculations. */
|
|
90
90
|
pointQ;
|
|
@@ -95,26 +95,26 @@ class CurveLocationDetail {
|
|
|
95
95
|
this.point = Point3dVector3d_1.Point3d.createZero();
|
|
96
96
|
this.a = 0.0;
|
|
97
97
|
}
|
|
98
|
-
/** Set the (optional) intervalRole field */
|
|
98
|
+
/** Set the (optional) intervalRole field. */
|
|
99
99
|
setIntervalRole(value) {
|
|
100
100
|
this.intervalRole = value;
|
|
101
101
|
}
|
|
102
|
-
/** Set the (optional) fraction1 and point1, using direct assignment (capture!) to point1 */
|
|
102
|
+
/** Set the (optional) fraction1 and point1, using direct assignment (capture!) to point1. */
|
|
103
103
|
captureFraction1Point1(fraction1, point1) {
|
|
104
104
|
this.fraction1 = fraction1;
|
|
105
105
|
this.point1 = point1;
|
|
106
106
|
}
|
|
107
|
-
/** Test if this pair has fraction1 defined */
|
|
107
|
+
/** Test if this pair has fraction1 defined. */
|
|
108
108
|
get hasFraction1() {
|
|
109
109
|
return this.fraction1 !== undefined;
|
|
110
110
|
}
|
|
111
|
-
/** Test if this is an isolated point. This is true if intervalRole is any of (undefined, isolated, isolatedAtVertex) */
|
|
111
|
+
/** Test if this is an isolated point. This is true if intervalRole is any of (undefined, isolated, isolatedAtVertex). */
|
|
112
112
|
get isIsolated() {
|
|
113
113
|
return this.intervalRole === undefined
|
|
114
114
|
|| this.intervalRole === CurveIntervalRole.isolated
|
|
115
115
|
|| this.intervalRole === CurveIntervalRole.isolatedAtVertex;
|
|
116
116
|
}
|
|
117
|
-
/** Return the fraction delta. (0 if no fraction1) */
|
|
117
|
+
/** Return the fraction delta. (0 if no fraction1). */
|
|
118
118
|
get fractionDelta() {
|
|
119
119
|
return this.fraction1 !== undefined ? this.fraction1 - this.fraction : 0.0;
|
|
120
120
|
}
|
|
@@ -135,7 +135,7 @@ class CurveLocationDetail {
|
|
|
135
135
|
this.point1 = undefined;
|
|
136
136
|
}
|
|
137
137
|
/**
|
|
138
|
-
* Return a complete copy, WITH CAVEATS
|
|
138
|
+
* Return a complete copy, WITH CAVEATS.
|
|
139
139
|
* * curve member is copied as a reference.
|
|
140
140
|
* * point and vector members are cloned.
|
|
141
141
|
*/
|
|
@@ -157,9 +157,9 @@ class CurveLocationDetail {
|
|
|
157
157
|
/**
|
|
158
158
|
* Updated in this instance.
|
|
159
159
|
* * Note that if caller omits `vector` and `a`, those fields are updated to the call-list defaults (NOT left as-is)
|
|
160
|
-
* * point and vector updates are by data copy (not capture of pointers)
|
|
161
|
-
* @param fraction (required) fraction to install
|
|
162
|
-
* @param point
|
|
160
|
+
* * point and vector updates are by data copy (not capture of pointers).
|
|
161
|
+
* @param fraction (required) fraction to install.
|
|
162
|
+
* @param point (required) point to install.
|
|
163
163
|
* @param vector (optional) vector to install.
|
|
164
164
|
* @param a (optional) numeric value to install.
|
|
165
165
|
*/
|
|
@@ -172,9 +172,9 @@ class CurveLocationDetail {
|
|
|
172
172
|
/**
|
|
173
173
|
* Updated in this instance.
|
|
174
174
|
* * Note that if caller omits a`, that field is updated to the call-list default (NOT left as-is)
|
|
175
|
-
* * point and vector updates are by data copy (not capture of the ray members)
|
|
176
|
-
* @param fraction (required) fraction to install
|
|
177
|
-
* @param ray (required) point and vector to install
|
|
175
|
+
* * point and vector updates are by data copy (not capture of the ray members).
|
|
176
|
+
* @param fraction (required) fraction to install.
|
|
177
|
+
* @param ray (required) point and vector to install.
|
|
178
178
|
* @param a (optional) numeric value to install.
|
|
179
179
|
*/
|
|
180
180
|
setFR(fraction, ray, a = 0) {
|
|
@@ -214,7 +214,7 @@ class CurveLocationDetail {
|
|
|
214
214
|
result.point.setFromPoint3d(point);
|
|
215
215
|
return result;
|
|
216
216
|
}
|
|
217
|
-
/** Create with CurvePrimitive pointer, fraction, and point coordinates */
|
|
217
|
+
/** Create with CurvePrimitive pointer, fraction, and point coordinates. */
|
|
218
218
|
static createCurveFractionPointDistanceCurveSearchStatus(curve, fraction, point, distance, status, result) {
|
|
219
219
|
result = result ? result : new CurveLocationDetail();
|
|
220
220
|
result.curve = curve;
|
|
@@ -310,7 +310,7 @@ class CurveLocationDetail {
|
|
|
310
310
|
* @param fraction candidate fraction
|
|
311
311
|
* @param point candidate point
|
|
312
312
|
* @param a candidate distance
|
|
313
|
-
* @returns true if the given distance is smaller (and hence this detail was updated
|
|
313
|
+
* @returns true if the given distance is smaller (and hence this detail was updated)
|
|
314
314
|
*/
|
|
315
315
|
updateIfCloserCurveFractionPointDistance(curve, fraction, point, a) {
|
|
316
316
|
if (this.a < a)
|