@itwin/core-geometry 4.1.0-dev.70 → 4.1.0-dev.72

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.
Files changed (96) hide show
  1. package/CHANGELOG.md +6 -1
  2. package/lib/cjs/clipping/AlternatingConvexClipTree.d.ts +15 -17
  3. package/lib/cjs/clipping/AlternatingConvexClipTree.d.ts.map +1 -1
  4. package/lib/cjs/clipping/AlternatingConvexClipTree.js +24 -20
  5. package/lib/cjs/clipping/AlternatingConvexClipTree.js.map +1 -1
  6. package/lib/cjs/clipping/BooleanClipFactory.d.ts +28 -28
  7. package/lib/cjs/clipping/BooleanClipFactory.d.ts.map +1 -1
  8. package/lib/cjs/clipping/BooleanClipFactory.js +28 -28
  9. package/lib/cjs/clipping/BooleanClipFactory.js.map +1 -1
  10. package/lib/cjs/clipping/BooleanClipNode.d.ts +11 -11
  11. package/lib/cjs/clipping/BooleanClipNode.d.ts.map +1 -1
  12. package/lib/cjs/clipping/BooleanClipNode.js +11 -11
  13. package/lib/cjs/clipping/BooleanClipNode.js.map +1 -1
  14. package/lib/cjs/clipping/ClipPlane.d.ts +73 -76
  15. package/lib/cjs/clipping/ClipPlane.d.ts.map +1 -1
  16. package/lib/cjs/clipping/ClipPlane.js +105 -86
  17. package/lib/cjs/clipping/ClipPlane.js.map +1 -1
  18. package/lib/cjs/clipping/ClipPrimitive.d.ts +78 -47
  19. package/lib/cjs/clipping/ClipPrimitive.d.ts.map +1 -1
  20. package/lib/cjs/clipping/ClipPrimitive.js +110 -54
  21. package/lib/cjs/clipping/ClipPrimitive.js.map +1 -1
  22. package/lib/cjs/clipping/ClipUtils.d.ts +54 -44
  23. package/lib/cjs/clipping/ClipUtils.d.ts.map +1 -1
  24. package/lib/cjs/clipping/ClipUtils.js +33 -29
  25. package/lib/cjs/clipping/ClipUtils.js.map +1 -1
  26. package/lib/cjs/clipping/ClipVector.d.ts +39 -25
  27. package/lib/cjs/clipping/ClipVector.d.ts.map +1 -1
  28. package/lib/cjs/clipping/ClipVector.js +35 -23
  29. package/lib/cjs/clipping/ClipVector.js.map +1 -1
  30. package/lib/cjs/clipping/ConvexClipPlaneSet.d.ts +61 -38
  31. package/lib/cjs/clipping/ConvexClipPlaneSet.d.ts.map +1 -1
  32. package/lib/cjs/clipping/ConvexClipPlaneSet.js +64 -41
  33. package/lib/cjs/clipping/ConvexClipPlaneSet.js.map +1 -1
  34. package/lib/cjs/clipping/UnionOfConvexClipPlaneSets.d.ts +49 -30
  35. package/lib/cjs/clipping/UnionOfConvexClipPlaneSets.d.ts.map +1 -1
  36. package/lib/cjs/clipping/UnionOfConvexClipPlaneSets.js +50 -30
  37. package/lib/cjs/clipping/UnionOfConvexClipPlaneSets.js.map +1 -1
  38. package/lib/cjs/clipping/internalContexts/LineStringOffsetClipperContext.d.ts +2 -2
  39. package/lib/cjs/clipping/internalContexts/LineStringOffsetClipperContext.d.ts.map +1 -1
  40. package/lib/cjs/clipping/internalContexts/LineStringOffsetClipperContext.js +2 -2
  41. package/lib/cjs/clipping/internalContexts/LineStringOffsetClipperContext.js.map +1 -1
  42. package/lib/cjs/curve/CurvePrimitive.d.ts +4 -2
  43. package/lib/cjs/curve/CurvePrimitive.d.ts.map +1 -1
  44. package/lib/cjs/curve/CurvePrimitive.js.map +1 -1
  45. package/lib/cjs/curve/LineSegment3d.d.ts.map +1 -1
  46. package/lib/cjs/curve/LineSegment3d.js.map +1 -1
  47. package/lib/cjs/curve/LineString3d.d.ts.map +1 -1
  48. package/lib/cjs/curve/LineString3d.js.map +1 -1
  49. package/lib/esm/clipping/AlternatingConvexClipTree.d.ts +15 -17
  50. package/lib/esm/clipping/AlternatingConvexClipTree.d.ts.map +1 -1
  51. package/lib/esm/clipping/AlternatingConvexClipTree.js +24 -20
  52. package/lib/esm/clipping/AlternatingConvexClipTree.js.map +1 -1
  53. package/lib/esm/clipping/BooleanClipFactory.d.ts +28 -28
  54. package/lib/esm/clipping/BooleanClipFactory.d.ts.map +1 -1
  55. package/lib/esm/clipping/BooleanClipFactory.js +28 -28
  56. package/lib/esm/clipping/BooleanClipFactory.js.map +1 -1
  57. package/lib/esm/clipping/BooleanClipNode.d.ts +11 -11
  58. package/lib/esm/clipping/BooleanClipNode.d.ts.map +1 -1
  59. package/lib/esm/clipping/BooleanClipNode.js +11 -11
  60. package/lib/esm/clipping/BooleanClipNode.js.map +1 -1
  61. package/lib/esm/clipping/ClipPlane.d.ts +73 -76
  62. package/lib/esm/clipping/ClipPlane.d.ts.map +1 -1
  63. package/lib/esm/clipping/ClipPlane.js +105 -86
  64. package/lib/esm/clipping/ClipPlane.js.map +1 -1
  65. package/lib/esm/clipping/ClipPrimitive.d.ts +78 -47
  66. package/lib/esm/clipping/ClipPrimitive.d.ts.map +1 -1
  67. package/lib/esm/clipping/ClipPrimitive.js +110 -54
  68. package/lib/esm/clipping/ClipPrimitive.js.map +1 -1
  69. package/lib/esm/clipping/ClipUtils.d.ts +54 -44
  70. package/lib/esm/clipping/ClipUtils.d.ts.map +1 -1
  71. package/lib/esm/clipping/ClipUtils.js +33 -29
  72. package/lib/esm/clipping/ClipUtils.js.map +1 -1
  73. package/lib/esm/clipping/ClipVector.d.ts +39 -25
  74. package/lib/esm/clipping/ClipVector.d.ts.map +1 -1
  75. package/lib/esm/clipping/ClipVector.js +35 -23
  76. package/lib/esm/clipping/ClipVector.js.map +1 -1
  77. package/lib/esm/clipping/ConvexClipPlaneSet.d.ts +61 -38
  78. package/lib/esm/clipping/ConvexClipPlaneSet.d.ts.map +1 -1
  79. package/lib/esm/clipping/ConvexClipPlaneSet.js +64 -41
  80. package/lib/esm/clipping/ConvexClipPlaneSet.js.map +1 -1
  81. package/lib/esm/clipping/UnionOfConvexClipPlaneSets.d.ts +49 -30
  82. package/lib/esm/clipping/UnionOfConvexClipPlaneSets.d.ts.map +1 -1
  83. package/lib/esm/clipping/UnionOfConvexClipPlaneSets.js +50 -30
  84. package/lib/esm/clipping/UnionOfConvexClipPlaneSets.js.map +1 -1
  85. package/lib/esm/clipping/internalContexts/LineStringOffsetClipperContext.d.ts +2 -2
  86. package/lib/esm/clipping/internalContexts/LineStringOffsetClipperContext.d.ts.map +1 -1
  87. package/lib/esm/clipping/internalContexts/LineStringOffsetClipperContext.js +2 -2
  88. package/lib/esm/clipping/internalContexts/LineStringOffsetClipperContext.js.map +1 -1
  89. package/lib/esm/curve/CurvePrimitive.d.ts +4 -2
  90. package/lib/esm/curve/CurvePrimitive.d.ts.map +1 -1
  91. package/lib/esm/curve/CurvePrimitive.js.map +1 -1
  92. package/lib/esm/curve/LineSegment3d.d.ts.map +1 -1
  93. package/lib/esm/curve/LineSegment3d.js.map +1 -1
  94. package/lib/esm/curve/LineString3d.d.ts.map +1 -1
  95. package/lib/esm/curve/LineString3d.js.map +1 -1
  96. package/package.json +3 -3
@@ -10,7 +10,7 @@ import { GrowableXYZArrayCache } from "../geometry3d/ReusableObjectCache";
10
10
  /**
11
11
  * An AlternatingConvexClipTreeNode is a node in a tree structure in which
12
12
  * <ul>
13
- * <li>Each node contains a ConvexClipPlaneSet
13
+ * <li>Each node contains a ConvexClipPlaneSet.
14
14
  * <li>Each node contains an array of children which are also AlternatingConvexClipTreeNode.
15
15
  * <li>The rule for an in/out decision is that a point is IN the subtree under a node if
16
16
  * <ul>
@@ -43,27 +43,27 @@ export declare class AlternatingCCTreeNode implements PolygonClipper {
43
43
  * </ul>
44
44
  */
45
45
  static createTreeForPolygon(points: Point3d[], result?: AlternatingCCTreeNode): AlternatingCCTreeNode;
46
- /**
47
- * Build the outer convex hull will inlets as first level children
48
- */
46
+ /** Build the outer convex hull with inlets as first level children. */
49
47
  static createHullAndInletsForPolygon(points: Point3d[], result?: AlternatingCCTreeNode): AlternatingCCTreeNode;
50
48
  private extractLoopsGo;
51
49
  /**
52
50
  * Return an array with all the loops in the tree.
53
- * This looses the alternating structure of the tree, but the collection still matches well-formed polygons by parity rules.
51
+ * This loses the alternating structure of the tree, but the collection still matches well-formed polygons by
52
+ * parity rules.
54
53
  */
55
54
  extractLoops(): Point3d[][];
56
- /** Resets this AlternatingConvexClipTreeNode to a newly-created state */
55
+ /** Resets this AlternatingConvexClipTreeNode to a newly-created state. */
57
56
  empty(): void;
58
57
  /** Creates a deep copy of this node (expensive - copies Geometry, and is recursive for children array). */
59
58
  clone(result?: AlternatingCCTreeNode): AlternatingCCTreeNode;
60
59
  /** Add a new child that has an empty plane set and given indices. */
61
60
  addEmptyChild(index0: number, numPoints: number): void;
62
- /** Add a plane to the ConvexClipPlaneSet */
61
+ /** Add a plane to the ConvexClipPlaneSet. */
63
62
  addPlane(plane: ClipPlane): void;
64
63
  /** Search with alternating in and out semantics. */
65
64
  isPointOnOrInside(point: Point3d): boolean;
66
- /** Add an AlternatingConvexClipTreeNode as a child of this one -- i.e. a hole.
65
+ /**
66
+ * Add an AlternatingConvexClipTreeNode as a child of this one -- i.e. a hole.
67
67
  * * The child pointer is pushed directly to the tree -- not cloned.
68
68
  */
69
69
  captureConvexClipPlaneSetAsVoid(child: AlternatingCCTreeNode): void;
@@ -72,16 +72,14 @@ export declare class AlternatingCCTreeNode implements PolygonClipper {
72
72
  /** Append start-end positions for curve intervals classified as inside or outside. */
73
73
  appendCurveCollectionClipIntervals(curves: CurveCollection, insideIntervals: CurveLocationDetailPair[], outsideIntervals: CurveLocationDetailPair[]): void;
74
74
  /**
75
- *
76
- * @param xyz input polygon. This is not changed.
77
- * @param insideFragments Array to receive "inside" fragments. Each fragment is a GrowableXYZArray grabbed from the cache. This is NOT cleared.
78
- * @param outsideFragments Array to receive "outside" fragments. Each fragment is a GrowableXYZArray grabbed from the cache. This is NOT cleared.
75
+ * @param xyz input polygon. This is not changed.
76
+ * @param insideFragments Array to receive "inside" fragments. Each fragment is a GrowableXYZArray grabbed from
77
+ * the cache. This is NOT cleared.
78
+ * @param outsideFragments Array to receive "outside" fragments. Each fragment is a GrowableXYZArray grabbed
79
+ * from the cache. This is NOT cleared.
79
80
  * @param arrayCache cache for reusable GrowableXYZArray.
80
81
  */
81
82
  appendPolygonClip(xyz: GrowableXYZArray, insideFragments: GrowableXYZArray[], outsideFragments: GrowableXYZArray[], arrayCache: GrowableXYZArrayCache): void;
82
- /**
83
- *
84
- */
85
83
  depth(): number;
86
84
  }
87
85
  /**
@@ -147,8 +145,8 @@ export declare class AlternatingCCTreeNodeCurveClipper {
147
145
  private static _fractionIntervals;
148
146
  private appendSingleClipToStack;
149
147
  /**
150
- * Run one level of recursion. On return, the stack is one level deeper than at entry and the new top of the stack has clip for this node
151
- * (expensive -- must clone items of arrays during "swaps")
148
+ * Run one level of recursion. On return, the stack is one level deeper than at entry and the new top of the stack
149
+ * has clip for this node (expensive -- must clone items of arrays during "swaps").
152
150
  */
153
151
  private recurse;
154
152
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"AlternatingConvexClipTree.d.ts","sourceRoot":"","sources":["../../../src/clipping/AlternatingConvexClipTree.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAC3D,OAAO,EAAuB,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AAC5F,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAIzD,OAAO,EAAE,OAAO,EAAY,MAAM,+BAA+B,CAAC;AAIlE,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAiB,cAAc,EAAE,MAAM,aAAa,CAAC;AAC5D,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAClE,OAAO,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAG1E;;;;;;;;;;;;;;;;;;;GAmBG;AACH,qBAAa,qBAAsB,YAAW,cAAc;IACnD,MAAM,EAAE,OAAO,EAAE,CAAM;IACvB,MAAM,EAAE,kBAAkB,CAAoC;IAC9D,QAAQ,EAAE,qBAAqB,EAAE,CAAM;IACvC,Q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CAAiC;IAC5C,OAAO,CAAC,MAAM,CAA6B;IAC3C,OAAO,CAAC,cAAc,CAAc;IACpC,OAAO,CAAC,WAAW,CAAS;;IAO5B,OAAO,CAAC,WAAW;IACnB,OAAO,CAAC,eAAe;IAMvB,OAAO,CAAC,iBAAiB;IAIzB,OAAO,CAAC,qBAAqB;IAM7B,OAAO,KAAK,WAAW,GAAmE;IAE1F,OAAO,KAAK,WAAW,QAItB;IACD,4CAA4C;IAC5C,OAAO,CAAC,UAAU;IAMlB,OAAO,CAAC,iBAAiB;IAIzB,OAAO,CAAC,MAAM,CAAC,kBAAkB,CAAgB;IACjD,OAAO,CAAC,uBAAuB;IAiD/B;;;OAGG;IACH,OAAO,CAAC,OAAO;IAmBf;;;OAGG;IACI,yBAAyB,CAAC,IAAI,EAAE,qBAAqB,EAAE,KAAK,EAAE,cAAc,EACjF,eAAe,EAAE,uBAAuB,EAAE,EAAE,iBAAiB,EAAE,uBAAuB,EAAE;IAmB1F;;;OAGG;IACI,yBAAyB,CAAC,IAAI,EAAE,qBAAqB,EAAE,KAAK,EAAE,eAAe,EAClF,eAAe,EAAE,uBAAuB,EAAE,EAAE,gBAAgB,EAAE,uBAAuB,EAAE;CAQ1F"}
@@ -24,7 +24,7 @@ import { Point3dArray } from "../geometry3d/PointHelpers";
24
24
  /**
25
25
  * An AlternatingConvexClipTreeNode is a node in a tree structure in which
26
26
  * <ul>
27
- * <li>Each node contains a ConvexClipPlaneSet
27
+ * <li>Each node contains a ConvexClipPlaneSet.
28
28
  * <li>Each node contains an array of children which are also AlternatingConvexClipTreeNode.
29
29
  * <li>The rule for an in/out decision is that a point is IN the subtree under a node if
30
30
  * <ul>
@@ -70,9 +70,7 @@ export class AlternatingCCTreeNode {
70
70
  builder.buildHullTree(result); // <-- Currently ALWAYS returns true
71
71
  return result;
72
72
  }
73
- /**
74
- * Build the outer convex hull will inlets as first level children
75
- */
73
+ /** Build the outer convex hull with inlets as first level children. */
76
74
  static createHullAndInletsForPolygon(points, result) {
77
75
  result = result ? result : new AlternatingCCTreeNode();
78
76
  result.empty();
@@ -87,14 +85,15 @@ export class AlternatingCCTreeNode {
87
85
  }
88
86
  /**
89
87
  * Return an array with all the loops in the tree.
90
- * This looses the alternating structure of the tree, but the collection still matches well-formed polygons by parity rules.
88
+ * This loses the alternating structure of the tree, but the collection still matches well-formed polygons by
89
+ * parity rules.
91
90
  */
92
91
  extractLoops() {
93
92
  const loops = [];
94
93
  this.extractLoopsGo(loops);
95
94
  return loops;
96
95
  }
97
- /** Resets this AlternatingConvexClipTreeNode to a newly-created state */
96
+ /** Resets this AlternatingConvexClipTreeNode to a newly-created state. */
98
97
  empty() {
99
98
  this.points.length = 0;
100
99
  this.planes.planes.length = 0;
@@ -121,7 +120,7 @@ export class AlternatingCCTreeNode {
121
120
  const newNode = AlternatingCCTreeNode.createWithIndices(index0, numPoints);
122
121
  this.children.push(newNode);
123
122
  }
124
- /** Add a plane to the ConvexClipPlaneSet */
123
+ /** Add a plane to the ConvexClipPlaneSet. */
125
124
  addPlane(plane) {
126
125
  this.planes.addPlaneToConvexSet(plane);
127
126
  }
@@ -136,7 +135,8 @@ export class AlternatingCCTreeNode {
136
135
  }
137
136
  return true;
138
137
  }
139
- /** Add an AlternatingConvexClipTreeNode as a child of this one -- i.e. a hole.
138
+ /**
139
+ * Add an AlternatingConvexClipTreeNode as a child of this one -- i.e. a hole.
140
140
  * * The child pointer is pushed directly to the tree -- not cloned.
141
141
  */
142
142
  captureConvexClipPlaneSetAsVoid(child) {
@@ -153,10 +153,11 @@ export class AlternatingCCTreeNode {
153
153
  clipper.appendCurveCollectionClip(this, curves, insideIntervals, outsideIntervals);
154
154
  }
155
155
  /**
156
- *
157
- * @param xyz input polygon. This is not changed.
158
- * @param insideFragments Array to receive "inside" fragments. Each fragment is a GrowableXYZArray grabbed from the cache. This is NOT cleared.
159
- * @param outsideFragments Array to receive "outside" fragments. Each fragment is a GrowableXYZArray grabbed from the cache. This is NOT cleared.
156
+ * @param xyz input polygon. This is not changed.
157
+ * @param insideFragments Array to receive "inside" fragments. Each fragment is a GrowableXYZArray grabbed from
158
+ * the cache. This is NOT cleared.
159
+ * @param outsideFragments Array to receive "outside" fragments. Each fragment is a GrowableXYZArray grabbed
160
+ * from the cache. This is NOT cleared.
160
161
  * @param arrayCache cache for reusable GrowableXYZArray.
161
162
  */
162
163
  appendPolygonClip(xyz, insideFragments, outsideFragments, arrayCache) {
@@ -189,9 +190,6 @@ export class AlternatingCCTreeNode {
189
190
  }
190
191
  }
191
192
  }
192
- /**
193
- *
194
- */
195
193
  depth() {
196
194
  const myDepth = 1;
197
195
  let maxChildDepth = 0;
@@ -222,9 +220,15 @@ export class AlternatingCCTreeBuilder {
222
220
  result._points.pop();
223
221
  return result;
224
222
  }
225
- get period() { return this._points.length; }
226
- indexAfter(i) { return (i + 1) % this._points.length; }
227
- indexBefore(i) { return (i + this._points.length - 1) % this._points.length; }
223
+ get period() {
224
+ return this._points.length;
225
+ }
226
+ indexAfter(i) {
227
+ return (i + 1) % this._points.length;
228
+ }
229
+ indexBefore(i) {
230
+ return (i + this._points.length - 1) % this._points.length;
231
+ }
228
232
  pushIndex(primaryPointIndex) {
229
233
  this._stack.push(primaryPointIndex);
230
234
  }
@@ -458,8 +462,8 @@ class AlternatingCCTreeNodeCurveClipper {
458
462
  return false;
459
463
  }
460
464
  /**
461
- * Run one level of recursion. On return, the stack is one level deeper than at entry and the new top of the stack has clip for this node
462
- * (expensive -- must clone items of arrays during "swaps")
465
+ * Run one level of recursion. On return, the stack is one level deeper than at entry and the new top of the stack
466
+ * has clip for this node (expensive -- must clone items of arrays during "swaps").
463
467
  */
464
468
  recurse(node) {
465
469
  this.pushEmptySegmentFrame();
@@ -1 +1 @@
1
- {"version":3,"file":"AlternatingConvexClipTree.js","sourceRoot":"","sources":["../../../src/clipping/AlternatingConvexClipTree.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F;;GAEG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,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AAE,EAAE,eAAe,EAAE,gBAAgB,CAAC,CAAC;SAC/E;IACH,CAAC;;AApHD,6BAA6B;AACd,oDAAkB,GAAa,EAAE,CAAC;SApDtC,iCAAiC","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 CartesianGeometry\r\n */\r\n\r\nimport { BSplineCurve3d } from \"../bspline/BSplineCurve\";\r\nimport { Arc3d } from \"../curve/Arc3d\";\r\nimport { CurveCollection } from \"../curve/CurveCollection\";\r\nimport { CurveLocationDetail, CurveLocationDetailPair } from \"../curve/CurveLocationDetail\";\r\nimport { CurvePrimitive } from \"../curve/CurvePrimitive\";\r\nimport { LineSegment3d } from \"../curve/LineSegment3d\";\r\nimport { LineString3d } from \"../curve/LineString3d\";\r\nimport { Angle } from \"../geometry3d/Angle\";\r\nimport { Point3d, Vector3d } from \"../geometry3d/Point3dVector3d\";\r\nimport { PolygonOps } from \"../geometry3d/PolygonOps\";\r\nimport { Range1d } from \"../geometry3d/Range\";\r\nimport { Range1dArray } from \"../numerics/Range1dArray\";\r\nimport { ClipPlane } from \"./ClipPlane\";\r\nimport { ClipUtilities, PolygonClipper } from \"./ClipUtils\";\r\nimport { ConvexClipPlaneSet } from \"./ConvexClipPlaneSet\";\r\nimport { GrowableXYZArray } from \"../geometry3d/GrowableXYZArray\";\r\nimport { GrowableXYZArrayCache } from \"../geometry3d/ReusableObjectCache\";\r\nimport { Point3dArray } from \"../geometry3d/PointHelpers\";\r\n\r\n/**\r\n * An AlternatingConvexClipTreeNode is a node in a tree structure in which\r\n * <ul>\r\n * <li>Each node contains a ConvexClipPlaneSet\r\n * <li>Each node contains an array of children which are also AlternatingConvexClipTreeNode.\r\n * <li>The rule for an in/out decision is that a point is IN the subtree under a node if\r\n * <ul>\r\n * <li>It is IN the node's ConvexClipPlaneSet.\r\n * <li>It is NOT IN any of the children.\r\n * </ul>\r\n * <li>Applying \"NOT IN any of the children\" locally to children at each level means that the ConvexClipPlaneSet\r\n * at adjacent levels flip between being positive areas and holes.\r\n * <li>Use an AlternatingConvexClipTreeNodeBuilder to construct the tree from a polygon.\r\n * <li>It is possible for the root clip plane set to be empty. An empty clip plane set returns \"true\"\r\n * for all point tests, so the meaning is just that holes are to be subtracted from the rest\r\n * of space.\r\n * <li>Although the interpretation of in/out alternates with tree levels, the ConvexClipPlaneSets\r\n * at each level are all \"enclosing\" planes in the usual way.\r\n * </ul>\r\n */\r\nexport class AlternatingCCTreeNode implements PolygonClipper {\r\n public points: Point3d[] = [];\r\n public planes: ConvexClipPlaneSet = ConvexClipPlaneSet.createEmpty();\r\n public children: AlternatingCCTreeNode[] = [];\r\n public startIdx: number = -1; // Start index into the master array (not the local points array)\r\n public numPoints: number = -1; // Number of points used in the master array\r\n\r\n private constructor() { }\r\n\r\n /** Initialize this node with index data referencing the parent polygon. */\r\n public static createWithIndices(index0: number, numPoints: number, result?: AlternatingCCTreeNode): AlternatingCCTreeNode {\r\n result = result ? result : new AlternatingCCTreeNode();\r\n result.startIdx = index0;\r\n result.numPoints = numPoints;\r\n result.children.length = 0;\r\n return result;\r\n }\r\n\r\n /**\r\n * <ul>\r\n * <li>Build the tree for a polygon.\r\n * <li>Caller creates the root node with empty constructor AlternatingConvexClipTreeNode.\r\n * </ul>\r\n */\r\n public static createTreeForPolygon(points: Point3d[], result?: AlternatingCCTreeNode): AlternatingCCTreeNode {\r\n result = result ? result : new AlternatingCCTreeNode();\r\n result.empty();\r\n const builder = AlternatingCCTreeBuilder.createPointsRef(points);\r\n builder.buildHullTree(result); // <-- Currently ALWAYS returns true\r\n return result;\r\n }\r\n\r\n /**\r\n * Build the outer convex hull will inlets as first level children\r\n */\r\n public static createHullAndInletsForPolygon(points: Point3d[], result?: AlternatingCCTreeNode): AlternatingCCTreeNode {\r\n result = result ? result : new AlternatingCCTreeNode();\r\n result.empty();\r\n const builder = AlternatingCCTreeBuilder.createPointsRef(points);\r\n builder.buildHullAndInletsForPolygon(result); // <-- Currently ALWAYS returns true\r\n return result;\r\n }\r\n private extractLoopsGo(loops: Point3d[][]) {\r\n loops.push(Point3dArray.clonePoint3dArray(this.points));\r\n for (const c of this.children)\r\n c.extractLoopsGo(loops);\r\n }\r\n/**\r\n * Return an array with all the loops in the tree.\r\n * This looses the alternating structure of the tree, but the collection still matches well-formed polygons by parity rules.\r\n */\r\n public extractLoops(): Point3d[][]{\r\n const loops: Point3d[][] = [];\r\n this.extractLoopsGo(loops);\r\n return loops;\r\n }\r\n /** Resets this AlternatingConvexClipTreeNode to a newly-created state */\r\n public empty() {\r\n this.points.length = 0;\r\n this.planes.planes.length = 0;\r\n this.children.length = 0;\r\n this.startIdx = -1;\r\n this.numPoints = -1;\r\n }\r\n\r\n /** Creates a deep copy of this node (expensive - copies Geometry, and is recursive for children array). */\r\n public clone(result?: AlternatingCCTreeNode): AlternatingCCTreeNode {\r\n result = result ? result : new AlternatingCCTreeNode();\r\n for (const point of this.points)\r\n result.points.push(point.clone());\r\n result.planes = ConvexClipPlaneSet.createEmpty();\r\n for (const plane of this.planes.planes)\r\n result.planes.planes.push(plane.clone());\r\n for (const node of this.children)\r\n result.children.push(node.clone());\r\n result.startIdx = this.startIdx;\r\n result.numPoints = this.numPoints;\r\n return result;\r\n }\r\n\r\n /** Add a new child that has an empty plane set and given indices. */\r\n public addEmptyChild(index0: number, numPoints: number) {\r\n const newNode = AlternatingCCTreeNode.createWithIndices(index0, numPoints);\r\n this.children.push(newNode);\r\n }\r\n\r\n /** Add a plane to the ConvexClipPlaneSet */\r\n public addPlane(plane: ClipPlane) {\r\n this.planes.addPlaneToConvexSet(plane);\r\n }\r\n\r\n /** Search with alternating in and out semantics. */\r\n public isPointOnOrInside(point: Point3d): boolean {\r\n const inRoot = this.planes.isPointOnOrInside(point, 0.0);\r\n if (!inRoot)\r\n return false;\r\n\r\n for (const child of this.children) {\r\n if (child.isPointOnOrInside(point))\r\n return false;\r\n }\r\n return true;\r\n }\r\n\r\n /** Add an AlternatingConvexClipTreeNode as a child of this one -- i.e. a hole.\r\n * * The child pointer is pushed directly to the tree -- not cloned.\r\n */\r\n public captureConvexClipPlaneSetAsVoid(child: AlternatingCCTreeNode) {\r\n this.children.push(child);\r\n }\r\n\r\n /** Append start-end positions for curve intervals classified as inside or outside. */\r\n public appendCurvePrimitiveClipIntervals(curve: CurvePrimitive, insideIntervals: CurveLocationDetailPair[], outsideIntervals: CurveLocationDetailPair[]) {\r\n const clipper = new AlternatingCCTreeNodeCurveClipper();\r\n clipper.appendSingleClipPrimitive(this, curve, insideIntervals, outsideIntervals);\r\n }\r\n\r\n /** Append start-end positions for curve intervals classified as inside or outside. */\r\n public appendCurveCollectionClipIntervals(curves: CurveCollection, insideIntervals: CurveLocationDetailPair[], outsideIntervals: CurveLocationDetailPair[]) {\r\n const clipper = new AlternatingCCTreeNodeCurveClipper();\r\n clipper.appendCurveCollectionClip(this, curves, insideIntervals, outsideIntervals);\r\n }\r\n /**\r\n *\r\n * @param xyz input polygon. This is not changed.\r\n * @param insideFragments Array to receive \"inside\" fragments. Each fragment is a GrowableXYZArray grabbed from the cache. This is NOT cleared.\r\n * @param outsideFragments Array to receive \"outside\" fragments. Each fragment is a GrowableXYZArray grabbed from the cache. This is NOT cleared.\r\n * @param arrayCache cache for reusable GrowableXYZArray.\r\n */\r\n public appendPolygonClip(\r\n xyz: GrowableXYZArray,\r\n insideFragments: GrowableXYZArray[],\r\n outsideFragments: GrowableXYZArray[],\r\n arrayCache: GrowableXYZArrayCache): void {\r\n // At first level ..\r\n // newInside is subject to re-clip by children.\r\n // outside is definitively outside\r\n const oldOutsideCount = outsideFragments.length;\r\n const newInside = this.planes.clipInsidePushOutside(xyz, outsideFragments, arrayCache);\r\n if (newInside === undefined) {\r\n ClipUtilities.restoreSingletonInPlaceOfMultipleShards (outsideFragments, oldOutsideCount, xyz, arrayCache);\r\n } else {\r\n let carryForwardA = [newInside];\r\n let carryForwardB: GrowableXYZArray[] = [];\r\n let tempAB;\r\n let shard;\r\n for (const c of this.children) {\r\n carryForwardB.length = 0;\r\n while (undefined !== (shard = carryForwardA.pop())) {\r\n // Anything inside this child is truly outside ...\r\n c.appendPolygonClip(shard, outsideFragments, carryForwardB, arrayCache);\r\n arrayCache.dropToCache(shard);\r\n }\r\n tempAB = carryForwardB;\r\n carryForwardB = carryForwardA; // and that is empty\r\n carryForwardA = tempAB;\r\n }\r\n while (undefined !== (shard = carryForwardA.pop())) {\r\n insideFragments.push(shard);\r\n }\r\n }\r\n }\r\n /**\r\n *\r\n */\r\n public depth(): number {\r\n const myDepth = 1;\r\n let maxChildDepth = 0;\r\n for (const c of this.children) {\r\n maxChildDepth = Math.max(maxChildDepth, c.depth());\r\n }\r\n return myDepth + maxChildDepth;\r\n }\r\n}\r\n/**\r\n * Context structure for building an AlternatingConvexClipTreeNode from a polygon.\r\n * <ul>\r\n * <li> The polygon is copied to the local m_points structure.\r\n * <li> During construction, m_stack contains indices of a sequence of points with uniform concavity.\r\n * </ul>\r\n */\r\nexport class AlternatingCCTreeBuilder {\r\n private _points: Point3d[] = [];\r\n private _stack: number[] = [];\r\n\r\n private constructor() { }\r\n\r\n public static createPointsRef(points: Point3d[], result?: AlternatingCCTreeBuilder): AlternatingCCTreeBuilder {\r\n result = result ? result : new AlternatingCCTreeBuilder();\r\n result._points = points;\r\n if (PolygonOps.areaXY(points) < 0.0)\r\n result._points.reverse();\r\n if (result._points[result._points.length - 1].isAlmostEqualMetric(result._points[0]))\r\n result._points.pop();\r\n return result;\r\n }\r\n\r\n public get period(): number { return this._points.length; }\r\n\r\n public indexAfter(i: number) { return (i + 1) % this._points.length; }\r\n public indexBefore(i: number) { return (i + this._points.length - 1) % this._points.length; }\r\n\r\n public pushIndex(primaryPointIndex: number) {\r\n this._stack.push(primaryPointIndex);\r\n }\r\n\r\n private static cross(pointA: Point3d, pointB: Point3d, pointC: Point3d): number {\r\n return pointA.crossProductToPointsXY(pointB, pointC);\r\n }\r\n /*\r\n public isInsideTurn(pointA: Point3d, pointB: Point3d, pointC: Point3d, sign: number) {\r\n return sign * AlternatingCCTreeBuilder.cross(pointA, pointB, pointC) > 0;\r\n }\r\n */\r\n public cyclicStackPoint(cyclicIndex: number): Point3d { // SIGNED index -- but negatives must be in first 10 periods?\r\n let stackIndex: number;\r\n const stack = this._stack;\r\n if (cyclicIndex > 0)\r\n stackIndex = cyclicIndex;\r\n else\r\n stackIndex = cyclicIndex + 10 * stack.length;\r\n stackIndex = stackIndex % stack.length;\r\n return this._points[stack[stackIndex]];\r\n }\r\n\r\n public signFromStackTip(pointIndex: number, sign: number) {\r\n const pointA = this.cyclicStackPoint(-2);\r\n const pointB = this.cyclicStackPoint(-1);\r\n const pointC = this._points[pointIndex];\r\n return sign * AlternatingCCTreeBuilder.cross(pointA, pointB, pointC) >= 0.0 ? 1 : -1;\r\n }\r\n\r\n /*\r\n * Test of xyz is in the convex region bounded by stack points:\r\n * <ul>\r\n * <li>polygon[i0]..polygon[i1]\r\n * <li>polygon[j0]..polygon[j1]\r\n * <li>polygon[i0]..polygon[i1]\r\n * </ul>\r\n * with \"inside\" controlled by sign multiplier.\r\n public isConvexContinuation(point: Point3d, i0: number, i1: number, j0: number, j1: number, sign: number): boolean {\r\n const points = this.points;\r\n const stack = this.stack;\r\n return this.isInsideTurn(points[stack[i0]], points[stack[i1]], point, sign)\r\n && this.isInsideTurn(points[stack[i0]], points[stack[j0]], point, sign)\r\n && this.isInsideTurn(points[stack[j1]], points[stack[i1]], point, sign);\r\n }\r\n */\r\n\r\n public get indexOfMaxX() {\r\n let k = 0;\r\n const points = this._points;\r\n const nPoints = this._points.length;\r\n for (let i = 1; i < nPoints; i++) {\r\n if (points[i].x > points[k].x)\r\n k = i;\r\n }\r\n return k;\r\n }\r\n\r\n /** Pop from the stack until the sign condition is satisfied */\r\n public extendHullChain(k: number, sign: number, pushAfterPops: boolean) {\r\n while (this._stack.length > 1 && this.signFromStackTip(k, sign) < 0.0)\r\n this._stack.pop();\r\n if (pushAfterPops)\r\n this.pushIndex(k);\r\n }\r\n\r\n public collectHullChain(kStart: number, numK: number, sign: number) {\r\n this._stack.length = 0;\r\n if (numK > 2) {\r\n let k = kStart;\r\n for (let i = 0; i < numK; i++) {\r\n this.extendHullChain(k, sign, true);\r\n k = this.indexAfter(k);\r\n }\r\n }\r\n }\r\n\r\n public collectHullPointsInArray(points: Point3d[], kStart: number, numK: number, _sign: number) {\r\n points.length = 0;\r\n if (numK > 2) {\r\n let k = kStart;\r\n for (let i = 0; i < numK; i++) {\r\n points.push(this._points[k]);\r\n k = this.indexAfter(k);\r\n }\r\n }\r\n }\r\n\r\n private buildHullTreeGo(root: AlternatingCCTreeNode, isPositiveArea: boolean, recurseToChildren: boolean = true): boolean {\r\n this.collectHullChain(root.startIdx, root.numPoints, isPositiveArea ? 1.0 : -1.0);\r\n root.points.length = 0;\r\n const stack = this._stack;\r\n const points = this._points;\r\n const stackLen = stack.length;\r\n\r\n for (let i = 0; i < stackLen; i++) {\r\n const k0 = stack[i];\r\n root.points.push(points[k0]);\r\n if (i + 1 < stackLen) {\r\n let k1 = stack[i + 1];\r\n if (k1 === this.indexAfter(k0)) {\r\n // two original points in sequence -- need a clip plane right here!!!\r\n const plane = ClipPlane.createEdgeAndUpVector(points[k0], points[k1], Vector3d.create(0, 0, 1), Angle.createRadians(0));\r\n if (plane !== undefined) {\r\n if (isPositiveArea)\r\n plane.negateInPlace();\r\n root.addPlane(plane);\r\n }\r\n } else {\r\n if (k1 < k0)\r\n k1 += this.period;\r\n root.addEmptyChild(k0, k1 - k0 + 1);\r\n }\r\n }\r\n }\r\n if (recurseToChildren){\r\n for (const child of root.children)\r\n this.buildHullTreeGo(child, !isPositiveArea);\r\n } else {\r\n for (const child of root.children)\r\n this.collectHullPointsInArray(child.points, child.startIdx, child.numPoints, isPositiveArea ? -1.0 : 1.0);\r\n\r\n }\r\n\r\n return true; // Are there failure modes? What happens with crossing data?..\r\n }\r\n\r\n /**\r\n * <ul>\r\n * <li> Input a ClipTreeRoot that has start and count data\r\n * <li> Build the hull for that data range\r\n * <li> Store the hull points in the root\r\n * <li> Add children with start and count data\r\n * <li> Recursively move to children\r\n * </ul>\r\n */\r\n public buildHullAndInletsForPolygon(root: AlternatingCCTreeNode): boolean {\r\n AlternatingCCTreeNode.createWithIndices(this.indexOfMaxX, this.period + 1, root);\r\n return this.buildHullTreeGo(root, true, false);\r\n }\r\n /**\r\n * <ul>\r\n * <li> Input a ClipTreeRoot that has start and count data\r\n * <li> Build the hull for that data range\r\n * <li> Store the hull points in the root\r\n * <li> Add children with start and count data\r\n * <li> Recursively move to children\r\n * </ul>\r\n */\r\n public buildHullTree(root: AlternatingCCTreeNode): boolean {\r\n AlternatingCCTreeNode.createWithIndices(this.indexOfMaxX, this.period + 1, root);\r\n return this.buildHullTreeGo(root, true);\r\n }\r\n\r\n}\r\n\r\nexport class AlternatingCCTreeNodeCurveClipper {\r\n private _curve: CurvePrimitive | undefined;\r\n private _intervalStack: Range1d[][];\r\n private _stackDepth: number;\r\n\r\n public constructor() {\r\n this._stackDepth = 0;\r\n this._intervalStack = [];\r\n }\r\n\r\n private setCurveRef(curve: CurvePrimitive) { this._curve = curve; }\r\n\r\n private popSegmentFrame() {\r\n if (this._stackDepth > 0) {\r\n this._topOfStack.length = 0; // formality.\r\n this._stackDepth -= 1;\r\n }\r\n }\r\n\r\n private clearSegmentStack() {\r\n while (this._stackDepth > 0)\r\n this.popSegmentFrame(); // and that will reduce stack depth\r\n }\r\n\r\n private pushEmptySegmentFrame() {\r\n this._stackDepth += 1;\r\n while (this._intervalStack.length < this._stackDepth)\r\n this._intervalStack.push([]);\r\n this._topOfStack.length = 0;\r\n }\r\n\r\n private get _topOfStack(): Range1d[] { return this._intervalStack[this._stackDepth - 1]; }\r\n // set the top of the stack (as defined by stackDepth -- not array length)\r\n private set _topOfStack(value: Range1d[]) {\r\n const n = this._stackDepth;\r\n if (n > 0)\r\n this._intervalStack[n - 1] = value;\r\n }\r\n\r\n /** Access entry [topOfStack() - numSkip] */\r\n private stackEntry(numSkip: number): Range1d[] {\r\n if (numSkip <= this._stackDepth)\r\n return this._intervalStack[this._stackDepth - 1 - numSkip];\r\n else\r\n return [];\r\n }\r\n\r\n private isTopOfStackEmpty(): boolean {\r\n return this._topOfStack.length === 0;\r\n }\r\n\r\n // Is re-used by method calls\r\n private static _fractionIntervals: number[] = [];\r\n\r\n private appendSingleClipToStack(planes: ConvexClipPlaneSet, insideSegments: Range1d[]): boolean {\r\n const fractionIntervals = AlternatingCCTreeNodeCurveClipper._fractionIntervals;\r\n\r\n if (this._curve instanceof LineSegment3d) {\r\n const segment = this._curve;\r\n let f0: number;\r\n let f1: number;\r\n if (segment.announceClipIntervals(planes, (a0: number, a1: number, _cp: CurvePrimitive) => { f0 = a0; f1 = a1; })) {\r\n insideSegments.push(Range1d.createXX(f0!, f1!));\r\n }\r\n return true;\r\n\r\n } else if (this._curve instanceof Arc3d) {\r\n const arc = this._curve;\r\n fractionIntervals.length = 0;\r\n arc.announceClipIntervals(planes, (a0: number, a1: number, _cp: CurvePrimitive) => {\r\n fractionIntervals.push(a0); fractionIntervals.push(a1);\r\n });\r\n for (let i = 0; i < fractionIntervals.length; i += 2)\r\n insideSegments.push(Range1d.createXX(fractionIntervals[i], fractionIntervals[i + 1]));\r\n return true;\r\n\r\n } else if (this._curve instanceof LineString3d && (this._curve).points.length > 1) {\r\n const linestring = this._curve;\r\n let f0: number;\r\n let f1: number;\r\n const nPoints = linestring.points.length;\r\n const df = 1.0 / (nPoints - 1);\r\n for (let i = 0; i < nPoints - 1; i++) {\r\n const segment = LineSegment3d.create(linestring.points[i], linestring.points[i + 1]);\r\n if (segment.announceClipIntervals(planes, (a0: number, a1: number, _cp: CurvePrimitive) => { f0 = a0; f1 = a1; })) {\r\n insideSegments.push(Range1d.createXX((i + f0!) * df, (i + f1!) * df));\r\n }\r\n }\r\n return true;\r\n\r\n } else if (this._curve instanceof BSplineCurve3d) {\r\n const bcurve = this._curve;\r\n fractionIntervals.length = 0;\r\n bcurve.announceClipIntervals(planes, (a0: number, a1: number, _cp: CurvePrimitive) => {\r\n fractionIntervals.push(a0); fractionIntervals.push(a1);\r\n });\r\n for (let i = 0; i < fractionIntervals.length; i += 2)\r\n insideSegments.push(Range1d.createXX(fractionIntervals[i], fractionIntervals[i + 1]));\r\n return true;\r\n }\r\n\r\n return false;\r\n }\r\n\r\n /**\r\n * Run one level of recursion. On return, the stack is one level deeper than at entry and the new top of the stack has clip for this node\r\n * (expensive -- must clone items of arrays during \"swaps\")\r\n */\r\n private recurse(node: AlternatingCCTreeNode) {\r\n this.pushEmptySegmentFrame();\r\n this.appendSingleClipToStack(node.planes, this._topOfStack);\r\n Range1dArray.sort(this._topOfStack);\r\n if (this.isTopOfStackEmpty())\r\n return;\r\n\r\n for (const child of node.children) {\r\n this.recurse(child);\r\n if (!this.isTopOfStackEmpty()) {\r\n const ranges = Range1dArray.differenceSorted(this.stackEntry(1), this.stackEntry(0));\r\n this.popSegmentFrame();\r\n this._topOfStack = ranges;\r\n } else {\r\n this.popSegmentFrame();\r\n }\r\n if (this.isTopOfStackEmpty())\r\n break;\r\n }\r\n }\r\n\r\n /**\r\n * Modifies the insideIntervals array given in place.\r\n * Note: curve given is passed by reference and stored.\r\n */\r\n public appendSingleClipPrimitive(root: AlternatingCCTreeNode, curve: CurvePrimitive,\r\n insideIntervals: CurveLocationDetailPair[], _outsideIntervals: CurveLocationDetailPair[]) {\r\n this.setCurveRef(curve);\r\n this.clearSegmentStack();\r\n this.recurse(root);\r\n if (this._stackDepth !== 1)\r\n return;\r\n\r\n const intervals = this._topOfStack;\r\n for (const interval of intervals) {\r\n const f0 = interval.low;\r\n const f1 = interval.high;\r\n const xyz0 = curve.fractionToPoint(f0);\r\n const xyz1 = curve.fractionToPoint(f1);\r\n insideIntervals.push(CurveLocationDetailPair.createCapture(\r\n CurveLocationDetail.createCurveFractionPoint(curve, f0, xyz0),\r\n CurveLocationDetail.createCurveFractionPoint(curve, f1, xyz1),\r\n ));\r\n }\r\n this.popSegmentFrame();\r\n }\r\n\r\n /**\r\n * Modifies the insideIntervals array given in place.\r\n * Note: curve given is passed by reference and stored.\r\n */\r\n public appendCurveCollectionClip(root: AlternatingCCTreeNode, curve: CurveCollection,\r\n insideIntervals: CurveLocationDetailPair[], outsideIntervals: CurveLocationDetailPair[]) {\r\n for (const cp of curve.children!) {\r\n if (cp instanceof CurvePrimitive)\r\n this.appendSingleClipPrimitive(root, cp, insideIntervals, outsideIntervals);\r\n else if (cp instanceof CurveCollection)\r\n this.appendCurveCollectionClip(root, cp, insideIntervals, outsideIntervals);\r\n }\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"AlternatingConvexClipTree.js","sourceRoot":"","sources":["../../../src/clipping/AlternatingConvexClipTree.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F;;GAEG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAC3D,OAAO,EAAE,mBAAmB,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AAC5F,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAC5C,OAAO,EAAW,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EAAE,SA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,eAAe,CAAC,IAAI,CAAC,uBAAuB,CAAC,aAAa,CACxD,mBAAmB,CAAC,wBAAwB,CAAC,KAAK,EAAE,EAAE,EAAE,IAAI,CAAC,EAC7D,mBAAmB,CAAC,wBAAwB,CAAC,KAAK,EAAE,EAAE,EAAE,IAAI,CAAC,CAC9D,CAAC,CAAC;SACJ;QACD,IAAI,CAAC,eAAe,EAAE,CAAC;IACzB,CAAC;IACD;;;OAGG;IACI,yBAAyB,CAAC,IAA2B,EAAE,KAAsB,EAClF,eAA0C,EAAE,gBAA2C;QACvF,KAAK,MAAM,EAAE,IAAI,KAAK,CAAC,QAAS,EAAE;YAChC,IAAI,EAAE,YAAY,cAAc;gBAC9B,IAAI,CAAC,yBAAyB,CAAC,IAAI,EAAE,EAAE,EAAE,eAAe,EAAE,gBAAgB,CAAC,CAAC;iBACzE,IAAI,EAAE,YAAY,eAAe;gBACpC,IAAI,CAAC,yBAAyB,CAAC,IAAI,EAAE,EAAE,EAAE,eAAe,EAAE,gBAAgB,CAAC,CAAC;SAC/E;IACH,CAAC;;AA9GD,6BAA6B;AACd,oDAAkB,GAAa,EAAE,CAAC;SA7CtC,iCAAiC","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 CartesianGeometry\r\n */\r\n\r\nimport { BSplineCurve3d } from \"../bspline/BSplineCurve\";\r\nimport { Arc3d } from \"../curve/Arc3d\";\r\nimport { CurveCollection } from \"../curve/CurveCollection\";\r\nimport { CurveLocationDetail, CurveLocationDetailPair } from \"../curve/CurveLocationDetail\";\r\nimport { CurvePrimitive } from \"../curve/CurvePrimitive\";\r\nimport { LineSegment3d } from \"../curve/LineSegment3d\";\r\nimport { LineString3d } from \"../curve/LineString3d\";\r\nimport { Angle } from \"../geometry3d/Angle\";\r\nimport { Point3d, Vector3d } from \"../geometry3d/Point3dVector3d\";\r\nimport { PolygonOps } from \"../geometry3d/PolygonOps\";\r\nimport { Range1d } from \"../geometry3d/Range\";\r\nimport { Range1dArray } from \"../numerics/Range1dArray\";\r\nimport { ClipPlane } from \"./ClipPlane\";\r\nimport { ClipUtilities, PolygonClipper } from \"./ClipUtils\";\r\nimport { ConvexClipPlaneSet } from \"./ConvexClipPlaneSet\";\r\nimport { GrowableXYZArray } from \"../geometry3d/GrowableXYZArray\";\r\nimport { GrowableXYZArrayCache } from \"../geometry3d/ReusableObjectCache\";\r\nimport { Point3dArray } from \"../geometry3d/PointHelpers\";\r\n\r\n/**\r\n * An AlternatingConvexClipTreeNode is a node in a tree structure in which\r\n * <ul>\r\n * <li>Each node contains a ConvexClipPlaneSet.\r\n * <li>Each node contains an array of children which are also AlternatingConvexClipTreeNode.\r\n * <li>The rule for an in/out decision is that a point is IN the subtree under a node if\r\n * <ul>\r\n * <li>It is IN the node's ConvexClipPlaneSet.\r\n * <li>It is NOT IN any of the children.\r\n * </ul>\r\n * <li>Applying \"NOT IN any of the children\" locally to children at each level means that the ConvexClipPlaneSet\r\n * at adjacent levels flip between being positive areas and holes.\r\n * <li>Use an AlternatingConvexClipTreeNodeBuilder to construct the tree from a polygon.\r\n * <li>It is possible for the root clip plane set to be empty. An empty clip plane set returns \"true\"\r\n * for all point tests, so the meaning is just that holes are to be subtracted from the rest\r\n * of space.\r\n * <li>Although the interpretation of in/out alternates with tree levels, the ConvexClipPlaneSets\r\n * at each level are all \"enclosing\" planes in the usual way.\r\n * </ul>\r\n */\r\nexport class AlternatingCCTreeNode implements PolygonClipper {\r\n public points: Point3d[] = [];\r\n public planes: ConvexClipPlaneSet = ConvexClipPlaneSet.createEmpty();\r\n public children: AlternatingCCTreeNode[] = [];\r\n public startIdx: number = -1; // Start index into the master array (not the local points array)\r\n public numPoints: number = -1; // Number of points used in the master array\r\n\r\n private constructor() { }\r\n\r\n /** Initialize this node with index data referencing the parent polygon. */\r\n public static createWithIndices(index0: number, numPoints: number, result?: AlternatingCCTreeNode): AlternatingCCTreeNode {\r\n result = result ? result : new AlternatingCCTreeNode();\r\n result.startIdx = index0;\r\n result.numPoints = numPoints;\r\n result.children.length = 0;\r\n return result;\r\n }\r\n /**\r\n * <ul>\r\n * <li>Build the tree for a polygon.\r\n * <li>Caller creates the root node with empty constructor AlternatingConvexClipTreeNode.\r\n * </ul>\r\n */\r\n public static createTreeForPolygon(points: Point3d[], result?: AlternatingCCTreeNode): AlternatingCCTreeNode {\r\n result = result ? result : new AlternatingCCTreeNode();\r\n result.empty();\r\n const builder = AlternatingCCTreeBuilder.createPointsRef(points);\r\n builder.buildHullTree(result); // <-- Currently ALWAYS returns true\r\n return result;\r\n }\r\n /** Build the outer convex hull with inlets as first level children. */\r\n public static createHullAndInletsForPolygon(points: Point3d[], result?: AlternatingCCTreeNode): AlternatingCCTreeNode {\r\n result = result ? result : new AlternatingCCTreeNode();\r\n result.empty();\r\n const builder = AlternatingCCTreeBuilder.createPointsRef(points);\r\n builder.buildHullAndInletsForPolygon(result); // <-- Currently ALWAYS returns true\r\n return result;\r\n }\r\n private extractLoopsGo(loops: Point3d[][]) {\r\n loops.push(Point3dArray.clonePoint3dArray(this.points));\r\n for (const c of this.children)\r\n c.extractLoopsGo(loops);\r\n }\r\n /**\r\n * Return an array with all the loops in the tree.\r\n * This loses the alternating structure of the tree, but the collection still matches well-formed polygons by\r\n * parity rules.\r\n */\r\n public extractLoops(): Point3d[][] {\r\n const loops: Point3d[][] = [];\r\n this.extractLoopsGo(loops);\r\n return loops;\r\n }\r\n /** Resets this AlternatingConvexClipTreeNode to a newly-created state. */\r\n public empty() {\r\n this.points.length = 0;\r\n this.planes.planes.length = 0;\r\n this.children.length = 0;\r\n this.startIdx = -1;\r\n this.numPoints = -1;\r\n }\r\n /** Creates a deep copy of this node (expensive - copies Geometry, and is recursive for children array). */\r\n public clone(result?: AlternatingCCTreeNode): AlternatingCCTreeNode {\r\n result = result ? result : new AlternatingCCTreeNode();\r\n for (const point of this.points)\r\n result.points.push(point.clone());\r\n result.planes = ConvexClipPlaneSet.createEmpty();\r\n for (const plane of this.planes.planes)\r\n result.planes.planes.push(plane.clone());\r\n for (const node of this.children)\r\n result.children.push(node.clone());\r\n result.startIdx = this.startIdx;\r\n result.numPoints = this.numPoints;\r\n return result;\r\n }\r\n /** Add a new child that has an empty plane set and given indices. */\r\n public addEmptyChild(index0: number, numPoints: number) {\r\n const newNode = AlternatingCCTreeNode.createWithIndices(index0, numPoints);\r\n this.children.push(newNode);\r\n }\r\n /** Add a plane to the ConvexClipPlaneSet. */\r\n public addPlane(plane: ClipPlane) {\r\n this.planes.addPlaneToConvexSet(plane);\r\n }\r\n /** Search with alternating in and out semantics. */\r\n public isPointOnOrInside(point: Point3d): boolean {\r\n const inRoot = this.planes.isPointOnOrInside(point, 0.0);\r\n if (!inRoot)\r\n return false;\r\n for (const child of this.children) {\r\n if (child.isPointOnOrInside(point))\r\n return false;\r\n }\r\n return true;\r\n }\r\n /**\r\n * Add an AlternatingConvexClipTreeNode as a child of this one -- i.e. a hole.\r\n * * The child pointer is pushed directly to the tree -- not cloned.\r\n */\r\n public captureConvexClipPlaneSetAsVoid(child: AlternatingCCTreeNode) {\r\n this.children.push(child);\r\n }\r\n /** Append start-end positions for curve intervals classified as inside or outside. */\r\n public appendCurvePrimitiveClipIntervals(\r\n curve: CurvePrimitive, insideIntervals: CurveLocationDetailPair[], outsideIntervals: CurveLocationDetailPair[],\r\n ): void {\r\n const clipper = new AlternatingCCTreeNodeCurveClipper();\r\n clipper.appendSingleClipPrimitive(this, curve, insideIntervals, outsideIntervals);\r\n }\r\n /** Append start-end positions for curve intervals classified as inside or outside. */\r\n public appendCurveCollectionClipIntervals(\r\n curves: CurveCollection, insideIntervals: CurveLocationDetailPair[], outsideIntervals: CurveLocationDetailPair[],\r\n ): void {\r\n const clipper = new AlternatingCCTreeNodeCurveClipper();\r\n clipper.appendCurveCollectionClip(this, curves, insideIntervals, outsideIntervals);\r\n }\r\n /**\r\n * @param xyz input polygon. This is not changed.\r\n * @param insideFragments Array to receive \"inside\" fragments. Each fragment is a GrowableXYZArray grabbed from\r\n * the cache. This is NOT cleared.\r\n * @param outsideFragments Array to receive \"outside\" fragments. Each fragment is a GrowableXYZArray grabbed\r\n * from the cache. This is NOT cleared.\r\n * @param arrayCache cache for reusable GrowableXYZArray.\r\n */\r\n public appendPolygonClip(\r\n xyz: GrowableXYZArray,\r\n insideFragments: GrowableXYZArray[],\r\n outsideFragments: GrowableXYZArray[],\r\n arrayCache: GrowableXYZArrayCache,\r\n ): void {\r\n // At first level ..\r\n // newInside is subject to re-clip by children.\r\n // outside is definitively outside\r\n const oldOutsideCount = outsideFragments.length;\r\n const newInside = this.planes.clipInsidePushOutside(xyz, outsideFragments, arrayCache);\r\n if (newInside === undefined) {\r\n ClipUtilities.restoreSingletonInPlaceOfMultipleShards(outsideFragments, oldOutsideCount, xyz, arrayCache);\r\n } else {\r\n let carryForwardA = [newInside];\r\n let carryForwardB: GrowableXYZArray[] = [];\r\n let tempAB;\r\n let shard;\r\n for (const c of this.children) {\r\n carryForwardB.length = 0;\r\n while (undefined !== (shard = carryForwardA.pop())) {\r\n // Anything inside this child is truly outside ...\r\n c.appendPolygonClip(shard, outsideFragments, carryForwardB, arrayCache);\r\n arrayCache.dropToCache(shard);\r\n }\r\n tempAB = carryForwardB;\r\n carryForwardB = carryForwardA; // and that is empty\r\n carryForwardA = tempAB;\r\n }\r\n while (undefined !== (shard = carryForwardA.pop())) {\r\n insideFragments.push(shard);\r\n }\r\n }\r\n }\r\n public depth(): number {\r\n const myDepth = 1;\r\n let maxChildDepth = 0;\r\n for (const c of this.children) {\r\n maxChildDepth = Math.max(maxChildDepth, c.depth());\r\n }\r\n return myDepth + maxChildDepth;\r\n }\r\n}\r\n\r\n/**\r\n * Context structure for building an AlternatingConvexClipTreeNode from a polygon.\r\n * <ul>\r\n * <li> The polygon is copied to the local m_points structure.\r\n * <li> During construction, m_stack contains indices of a sequence of points with uniform concavity.\r\n * </ul>\r\n */\r\nexport class AlternatingCCTreeBuilder {\r\n private _points: Point3d[] = [];\r\n private _stack: number[] = [];\r\n\r\n private constructor() { }\r\n\r\n public static createPointsRef(points: Point3d[], result?: AlternatingCCTreeBuilder): AlternatingCCTreeBuilder {\r\n result = result ? result : new AlternatingCCTreeBuilder();\r\n result._points = points;\r\n if (PolygonOps.areaXY(points) < 0.0)\r\n result._points.reverse();\r\n if (result._points[result._points.length - 1].isAlmostEqualMetric(result._points[0]))\r\n result._points.pop();\r\n return result;\r\n }\r\n public get period(): number {\r\n return this._points.length;\r\n }\r\n public indexAfter(i: number) {\r\n return (i + 1) % this._points.length;\r\n }\r\n public indexBefore(i: number) {\r\n return (i + this._points.length - 1) % this._points.length;\r\n }\r\n public pushIndex(primaryPointIndex: number) {\r\n this._stack.push(primaryPointIndex);\r\n }\r\n private static cross(pointA: Point3d, pointB: Point3d, pointC: Point3d): number {\r\n return pointA.crossProductToPointsXY(pointB, pointC);\r\n }\r\n /*\r\n public isInsideTurn(pointA: Point3d, pointB: Point3d, pointC: Point3d, sign: number) {\r\n return sign * AlternatingCCTreeBuilder.cross(pointA, pointB, pointC) > 0;\r\n }\r\n */\r\n public cyclicStackPoint(cyclicIndex: number): Point3d { // SIGNED index -- but negatives must be in first 10 periods?\r\n let stackIndex: number;\r\n const stack = this._stack;\r\n if (cyclicIndex > 0)\r\n stackIndex = cyclicIndex;\r\n else\r\n stackIndex = cyclicIndex + 10 * stack.length;\r\n stackIndex = stackIndex % stack.length;\r\n return this._points[stack[stackIndex]];\r\n }\r\n public signFromStackTip(pointIndex: number, sign: number) {\r\n const pointA = this.cyclicStackPoint(-2);\r\n const pointB = this.cyclicStackPoint(-1);\r\n const pointC = this._points[pointIndex];\r\n return sign * AlternatingCCTreeBuilder.cross(pointA, pointB, pointC) >= 0.0 ? 1 : -1;\r\n }\r\n /*\r\n * Test of xyz is in the convex region bounded by stack points:\r\n * <ul>\r\n * <li>polygon[i0]..polygon[i1]\r\n * <li>polygon[j0]..polygon[j1]\r\n * <li>polygon[i0]..polygon[i1]\r\n * </ul>\r\n * with \"inside\" controlled by sign multiplier.\r\n public isConvexContinuation(point: Point3d, i0: number, i1: number, j0: number, j1: number, sign: number): boolean {\r\n const points = this.points;\r\n const stack = this.stack;\r\n return this.isInsideTurn(points[stack[i0]], points[stack[i1]], point, sign)\r\n && this.isInsideTurn(points[stack[i0]], points[stack[j0]], point, sign)\r\n && this.isInsideTurn(points[stack[j1]], points[stack[i1]], point, sign);\r\n }\r\n */\r\n public get indexOfMaxX() {\r\n let k = 0;\r\n const points = this._points;\r\n const nPoints = this._points.length;\r\n for (let i = 1; i < nPoints; i++) {\r\n if (points[i].x > points[k].x)\r\n k = i;\r\n }\r\n return k;\r\n }\r\n /** Pop from the stack until the sign condition is satisfied */\r\n public extendHullChain(k: number, sign: number, pushAfterPops: boolean) {\r\n while (this._stack.length > 1 && this.signFromStackTip(k, sign) < 0.0)\r\n this._stack.pop();\r\n if (pushAfterPops)\r\n this.pushIndex(k);\r\n }\r\n public collectHullChain(kStart: number, numK: number, sign: number) {\r\n this._stack.length = 0;\r\n if (numK > 2) {\r\n let k = kStart;\r\n for (let i = 0; i < numK; i++) {\r\n this.extendHullChain(k, sign, true);\r\n k = this.indexAfter(k);\r\n }\r\n }\r\n }\r\n public collectHullPointsInArray(points: Point3d[], kStart: number, numK: number, _sign: number) {\r\n points.length = 0;\r\n if (numK > 2) {\r\n let k = kStart;\r\n for (let i = 0; i < numK; i++) {\r\n points.push(this._points[k]);\r\n k = this.indexAfter(k);\r\n }\r\n }\r\n }\r\n private buildHullTreeGo(\r\n root: AlternatingCCTreeNode, isPositiveArea: boolean, recurseToChildren: boolean = true,\r\n ): boolean {\r\n this.collectHullChain(root.startIdx, root.numPoints, isPositiveArea ? 1.0 : -1.0);\r\n root.points.length = 0;\r\n const stack = this._stack;\r\n const points = this._points;\r\n const stackLen = stack.length;\r\n\r\n for (let i = 0; i < stackLen; i++) {\r\n const k0 = stack[i];\r\n root.points.push(points[k0]);\r\n if (i + 1 < stackLen) {\r\n let k1 = stack[i + 1];\r\n if (k1 === this.indexAfter(k0)) {\r\n // two original points in sequence -- need a clip plane right here!!!\r\n const plane = ClipPlane.createEdgeAndUpVector(\r\n points[k0], points[k1], Vector3d.create(0, 0, 1), Angle.createRadians(0),\r\n );\r\n if (plane !== undefined) {\r\n if (isPositiveArea)\r\n plane.negateInPlace();\r\n root.addPlane(plane);\r\n }\r\n } else {\r\n if (k1 < k0)\r\n k1 += this.period;\r\n root.addEmptyChild(k0, k1 - k0 + 1);\r\n }\r\n }\r\n }\r\n if (recurseToChildren) {\r\n for (const child of root.children)\r\n this.buildHullTreeGo(child, !isPositiveArea);\r\n } else {\r\n for (const child of root.children)\r\n this.collectHullPointsInArray(child.points, child.startIdx, child.numPoints, isPositiveArea ? -1.0 : 1.0);\r\n }\r\n return true; // Are there failure modes? What happens with crossing data?..\r\n }\r\n /**\r\n * <ul>\r\n * <li> Input a ClipTreeRoot that has start and count data\r\n * <li> Build the hull for that data range\r\n * <li> Store the hull points in the root\r\n * <li> Add children with start and count data\r\n * <li> Recursively move to children\r\n * </ul>\r\n */\r\n public buildHullAndInletsForPolygon(root: AlternatingCCTreeNode): boolean {\r\n AlternatingCCTreeNode.createWithIndices(this.indexOfMaxX, this.period + 1, root);\r\n return this.buildHullTreeGo(root, true, false);\r\n }\r\n /**\r\n * <ul>\r\n * <li> Input a ClipTreeRoot that has start and count data\r\n * <li> Build the hull for that data range\r\n * <li> Store the hull points in the root\r\n * <li> Add children with start and count data\r\n * <li> Recursively move to children\r\n * </ul>\r\n */\r\n public buildHullTree(root: AlternatingCCTreeNode): boolean {\r\n AlternatingCCTreeNode.createWithIndices(this.indexOfMaxX, this.period + 1, root);\r\n return this.buildHullTreeGo(root, true);\r\n }\r\n}\r\n\r\nexport class AlternatingCCTreeNodeCurveClipper {\r\n private _curve: CurvePrimitive | undefined;\r\n private _intervalStack: Range1d[][];\r\n private _stackDepth: number;\r\n\r\n public constructor() {\r\n this._stackDepth = 0;\r\n this._intervalStack = [];\r\n }\r\n\r\n private setCurveRef(curve: CurvePrimitive) { this._curve = curve; }\r\n private popSegmentFrame() {\r\n if (this._stackDepth > 0) {\r\n this._topOfStack.length = 0; // formality.\r\n this._stackDepth -= 1;\r\n }\r\n }\r\n private clearSegmentStack() {\r\n while (this._stackDepth > 0)\r\n this.popSegmentFrame(); // and that will reduce stack depth\r\n }\r\n private pushEmptySegmentFrame() {\r\n this._stackDepth += 1;\r\n while (this._intervalStack.length < this._stackDepth)\r\n this._intervalStack.push([]);\r\n this._topOfStack.length = 0;\r\n }\r\n private get _topOfStack(): Range1d[] { return this._intervalStack[this._stackDepth - 1]; }\r\n // set the top of the stack (as defined by stackDepth -- not array length)\r\n private set _topOfStack(value: Range1d[]) {\r\n const n = this._stackDepth;\r\n if (n > 0)\r\n this._intervalStack[n - 1] = value;\r\n }\r\n /** Access entry [topOfStack() - numSkip] */\r\n private stackEntry(numSkip: number): Range1d[] {\r\n if (numSkip <= this._stackDepth)\r\n return this._intervalStack[this._stackDepth - 1 - numSkip];\r\n else\r\n return [];\r\n }\r\n private isTopOfStackEmpty(): boolean {\r\n return this._topOfStack.length === 0;\r\n }\r\n // Is re-used by method calls\r\n private static _fractionIntervals: number[] = [];\r\n private appendSingleClipToStack(planes: ConvexClipPlaneSet, insideSegments: Range1d[]): boolean {\r\n const fractionIntervals = AlternatingCCTreeNodeCurveClipper._fractionIntervals;\r\n\r\n if (this._curve instanceof LineSegment3d) {\r\n const segment = this._curve;\r\n let f0: number;\r\n let f1: number;\r\n if (segment.announceClipIntervals(planes, (a0: number, a1: number, _cp: CurvePrimitive) => { f0 = a0; f1 = a1; })) {\r\n insideSegments.push(Range1d.createXX(f0!, f1!));\r\n }\r\n return true;\r\n\r\n } else if (this._curve instanceof Arc3d) {\r\n const arc = this._curve;\r\n fractionIntervals.length = 0;\r\n arc.announceClipIntervals(planes, (a0: number, a1: number, _cp: CurvePrimitive) => {\r\n fractionIntervals.push(a0); fractionIntervals.push(a1);\r\n });\r\n for (let i = 0; i < fractionIntervals.length; i += 2)\r\n insideSegments.push(Range1d.createXX(fractionIntervals[i], fractionIntervals[i + 1]));\r\n return true;\r\n\r\n } else if (this._curve instanceof LineString3d && (this._curve).points.length > 1) {\r\n const linestring = this._curve;\r\n let f0: number;\r\n let f1: number;\r\n const nPoints = linestring.points.length;\r\n const df = 1.0 / (nPoints - 1);\r\n for (let i = 0; i < nPoints - 1; i++) {\r\n const segment = LineSegment3d.create(linestring.points[i], linestring.points[i + 1]);\r\n if (segment.announceClipIntervals(planes, (a0: number, a1: number, _cp: CurvePrimitive) => { f0 = a0; f1 = a1; })) {\r\n insideSegments.push(Range1d.createXX((i + f0!) * df, (i + f1!) * df));\r\n }\r\n }\r\n return true;\r\n\r\n } else if (this._curve instanceof BSplineCurve3d) {\r\n const bcurve = this._curve;\r\n fractionIntervals.length = 0;\r\n bcurve.announceClipIntervals(planes, (a0: number, a1: number, _cp: CurvePrimitive) => {\r\n fractionIntervals.push(a0); fractionIntervals.push(a1);\r\n });\r\n for (let i = 0; i < fractionIntervals.length; i += 2)\r\n insideSegments.push(Range1d.createXX(fractionIntervals[i], fractionIntervals[i + 1]));\r\n return true;\r\n }\r\n\r\n return false;\r\n }\r\n /**\r\n * Run one level of recursion. On return, the stack is one level deeper than at entry and the new top of the stack\r\n * has clip for this node (expensive -- must clone items of arrays during \"swaps\").\r\n */\r\n private recurse(node: AlternatingCCTreeNode) {\r\n this.pushEmptySegmentFrame();\r\n this.appendSingleClipToStack(node.planes, this._topOfStack);\r\n Range1dArray.sort(this._topOfStack);\r\n if (this.isTopOfStackEmpty())\r\n return;\r\n for (const child of node.children) {\r\n this.recurse(child);\r\n if (!this.isTopOfStackEmpty()) {\r\n const ranges = Range1dArray.differenceSorted(this.stackEntry(1), this.stackEntry(0));\r\n this.popSegmentFrame();\r\n this._topOfStack = ranges;\r\n } else {\r\n this.popSegmentFrame();\r\n }\r\n if (this.isTopOfStackEmpty())\r\n break;\r\n }\r\n }\r\n /**\r\n * Modifies the insideIntervals array given in place.\r\n * Note: curve given is passed by reference and stored.\r\n */\r\n public appendSingleClipPrimitive(root: AlternatingCCTreeNode, curve: CurvePrimitive,\r\n insideIntervals: CurveLocationDetailPair[], _outsideIntervals: CurveLocationDetailPair[]) {\r\n this.setCurveRef(curve);\r\n this.clearSegmentStack();\r\n this.recurse(root);\r\n if (this._stackDepth !== 1)\r\n return;\r\n const intervals = this._topOfStack;\r\n for (const interval of intervals) {\r\n const f0 = interval.low;\r\n const f1 = interval.high;\r\n const xyz0 = curve.fractionToPoint(f0);\r\n const xyz1 = curve.fractionToPoint(f1);\r\n insideIntervals.push(CurveLocationDetailPair.createCapture(\r\n CurveLocationDetail.createCurveFractionPoint(curve, f0, xyz0),\r\n CurveLocationDetail.createCurveFractionPoint(curve, f1, xyz1),\r\n ));\r\n }\r\n this.popSegmentFrame();\r\n }\r\n /**\r\n * Modifies the insideIntervals array given in place.\r\n * Note: curve given is passed by reference and stored.\r\n */\r\n public appendCurveCollectionClip(root: AlternatingCCTreeNode, curve: CurveCollection,\r\n insideIntervals: CurveLocationDetailPair[], outsideIntervals: CurveLocationDetailPair[]) {\r\n for (const cp of curve.children!) {\r\n if (cp instanceof CurvePrimitive)\r\n this.appendSingleClipPrimitive(root, cp, insideIntervals, outsideIntervals);\r\n else if (cp instanceof CurveCollection)\r\n this.appendCurveCollectionClip(root, cp, insideIntervals, outsideIntervals);\r\n }\r\n }\r\n}\r\n"]}
@@ -1,67 +1,67 @@
1
1
  import { Clipper } from "./ClipUtils";
2
- /** A BooleanClipFactory is a factory to create objects that implement interior nodes of a tree of boolean clip operations.
2
+ /**
3
+ * A BooleanClipFactory is a factory to create objects that implement interior nodes of a tree of boolean clip operations.
3
4
  * * These methods create specific clip tree types:
4
5
  * * Union
5
6
  * * Intersection
6
7
  * * Parity
7
8
  * * Difference
8
- * * Each construction has a `keepInside` flag that optionally negates the initial result of the parity, intersection, parity, or difference:
9
- * * if `keepInside === true`, accept the "inside" of the initial result
10
- * * if `keepInside === false`, accept the "outside" of the initial result
11
- * * These methods create various other specialized clippers
12
- * *
9
+ * * Each construction has a `keepInside` flag that optionally negates the initial result of the parity, intersection,
10
+ * parity, or difference:
11
+ * * if `keepInside === true`, accept the "inside" of the initial result.
12
+ * * if `keepInside === false`, accept the "outside" of the initial result.
13
+ * * These methods create various other specialized clippers.
13
14
  * @public
14
15
  */
15
16
  export declare class BooleanClipFactory {
16
17
  /**
17
- * Create a boolean clipper which performs a union over its children
18
- * * if `keepInside === true`, accept the "inside" of the union result
19
- * * if `keepInside === false`, accept the "outside" of the union result
20
- * @param clippers clip objects to capture
18
+ * Create a boolean clipper which performs a union over its children.
19
+ * * if `keepInside === true`, accept the "inside" of the union result.
20
+ * * if `keepInside === false`, accept the "outside" of the union result.
21
+ * @param clippers clip objects to capture.
21
22
  * @param keepInside flag to select results inside or outside the clippers.
22
23
  */
23
24
  static createCaptureUnion(clippers: Clipper | Clipper[], keepInside: boolean): Clipper;
24
25
  /**
25
- * Create a boolean clipper which performs an intersection over its children
26
- * * if `keepInside === true`, accept the "inside" of the intersection result
27
- * * if `keepInside === false`, accept the "outside" of the intersection result
28
- * @param clippers clip objects to capture
26
+ * Create a boolean clipper which performs an intersection over its children.
27
+ * * if `keepInside === true`, accept the "inside" of the intersection result.
28
+ * * if `keepInside === false`, accept the "outside" of the intersection result.
29
+ * @param clippers clip objects to capture.
29
30
  * @param keepInside flag to select results inside or outside the clippers.
30
31
  */
31
32
  static createCaptureIntersection(clippers: Clipper | Clipper[], keepInside: boolean): Clipper;
32
33
  /**
33
- * Create a boolean clipper which performs a parity over its children
34
- * * if `keepInside === true`, accept the "inside" of the parity result
35
- * * if `keepInside === false`, accept the "outside" of the parity result
36
- * @param clippers clip objects to capture
34
+ * Create a boolean clipper which performs a parity over its children.
35
+ * * if `keepInside === true`, accept the "inside" of the parity result.
36
+ * * if `keepInside === false`, accept the "outside" of the parity result.
37
+ * @param clippers clip objects to capture.
37
38
  * @param keepInside flag to select results inside or outside the clippers.
38
39
  */
39
40
  static createCaptureParity(clippers: Clipper | Clipper[], keepInside: boolean): Clipper;
40
41
  /**
41
- * Create a boolean clipper which performs a difference operation for points "inside `primaryClipper`" and "outside `excludedClipper`"
42
- * * if `keepInside === true`, accept the "inside" of the difference
43
- * * if `keepInside === false`, accept the "outside" of the difference
44
- * @param primaryClipper any clip object whose output is treated as positive
42
+ * Create a boolean clipper which performs a difference operation for points "inside `primaryClipper`" and
43
+ * "outside `excludedClipper`".
44
+ * * if `keepInside === true`, accept the "inside" of the difference.
45
+ * * if `keepInside === false`, accept the "outside" of the difference.
46
+ * @param primaryClipper any clip object whose output is treated as positive.
45
47
  * @param excludeClip any clipper whose output is treated as negative.
46
48
  * @param keepInside flag to select results inside or outside the initial `primary minus excludeClipper` clippers.
47
49
  */
48
50
  static createCaptureDifference(primaryClipper: Clipper, excludedClipper: Clipper, keepInside: boolean): Clipper;
49
51
  /**
50
- * Create a boolean clipper which performs the reverse of that of `primaryClipper`
51
- * @param primaryClipper clip objects to capture
52
+ * Create a boolean clipper which performs the reverse of that of `primaryClipper`.
53
+ * @param primaryClipper clip objects to capture.
52
54
  * @param keepInside flag to select results inside or outside the clippers.
53
55
  */
54
56
  static createCaptureClipOutside(primaryClipper: Clipper): Clipper;
55
57
  /**
56
- * convert `source` to an array of clipper objects.
58
+ * Convert `source` to an array of clipper objects.
57
59
  * * ANY TYPE OF Clipper is accepted.
58
60
  * * REMARK: This is normally called only from the primary public method `parseToClipper`.
59
- * @param source
60
- * @param internal
61
61
  */
62
62
  static parseToClipperArray(source: any): Clipper[] | undefined;
63
63
  /**
64
- * look for content that represents a clipper.
64
+ * Look for content that represents a clipper.
65
65
  * * Possible outputs are
66
66
  * * `ClipPlane`
67
67
  * * `ConvexClipPlaneSet`
@@ -1 +1 @@
1
- {"version":3,"file":"BooleanClipFactory.d.ts","sourceRoot":"","sources":["../../../src/clipping/Boole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WACW,yBAAyB,CAAC,QAAQ,EAAE,OAAO,GAAG,OAAO,EAAE,EAAE,UAAU,EAAE,OAAO,GAAG,OAAO;IAKpG;;;;;;OAMG;WACW,mBAAmB,CAAC,QAAQ,EAAE,OAAO,GAAG,OAAO,EAAE,EAAE,UAAU,EAAE,OAAO,GAAG,OAAO;IAK9F;;;;;;;;OAQG;WACW,uBAAuB,CAAC,cAAc,EAAE,OAAO,EAAE,eAAe,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,GAAG,OAAO;IAItH;;;;OAIG;WACW,wBAAwB,CAAC,cAAc,EAAE,OAAO,GAAG,OAAO;IAGxE;;;;OAIG;WACW,mBAAmB,CAAC,MAAM,EAAE,GAAG,GAAG,OAAO,EAAE,GAAG,SAAS;IAoBrE;;;;;;;;;;;;OAYG;WACW,cAAc,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,SAAS;IA0DlE,0DAA0D;WAC5C,gBAAgB,CAAC,OAAO,EAAE,GAAG,GAAG,GAAG,GAAG,SAAS;CAO9D"}
@@ -10,25 +10,26 @@ import { ClipPlane } from "./ClipPlane";
10
10
  import { ClipUtilities } from "./ClipUtils";
11
11
  import { ConvexClipPlaneSet } from "./ConvexClipPlaneSet";
12
12
  import { UnionOfConvexClipPlaneSets } from "./UnionOfConvexClipPlaneSets";
13
- /** A BooleanClipFactory is a factory to create objects that implement interior nodes of a tree of boolean clip operations.
13
+ /**
14
+ * A BooleanClipFactory is a factory to create objects that implement interior nodes of a tree of boolean clip operations.
14
15
  * * These methods create specific clip tree types:
15
16
  * * Union
16
17
  * * Intersection
17
18
  * * Parity
18
19
  * * Difference
19
- * * Each construction has a `keepInside` flag that optionally negates the initial result of the parity, intersection, parity, or difference:
20
- * * if `keepInside === true`, accept the "inside" of the initial result
21
- * * if `keepInside === false`, accept the "outside" of the initial result
22
- * * These methods create various other specialized clippers
23
- * *
20
+ * * Each construction has a `keepInside` flag that optionally negates the initial result of the parity, intersection,
21
+ * parity, or difference:
22
+ * * if `keepInside === true`, accept the "inside" of the initial result.
23
+ * * if `keepInside === false`, accept the "outside" of the initial result.
24
+ * * These methods create various other specialized clippers.
24
25
  * @public
25
26
  */
26
27
  export class BooleanClipFactory {
27
28
  /**
28
- * Create a boolean clipper which performs a union over its children
29
- * * if `keepInside === true`, accept the "inside" of the union result
30
- * * if `keepInside === false`, accept the "outside" of the union result
31
- * @param clippers clip objects to capture
29
+ * Create a boolean clipper which performs a union over its children.
30
+ * * if `keepInside === true`, accept the "inside" of the union result.
31
+ * * if `keepInside === false`, accept the "outside" of the union result.
32
+ * @param clippers clip objects to capture.
32
33
  * @param keepInside flag to select results inside or outside the clippers.
33
34
  */
34
35
  static createCaptureUnion(clippers, keepInside) {
@@ -37,10 +38,10 @@ export class BooleanClipFactory {
37
38
  return result;
38
39
  }
39
40
  /**
40
- * Create a boolean clipper which performs an intersection over its children
41
- * * if `keepInside === true`, accept the "inside" of the intersection result
42
- * * if `keepInside === false`, accept the "outside" of the intersection result
43
- * @param clippers clip objects to capture
41
+ * Create a boolean clipper which performs an intersection over its children.
42
+ * * if `keepInside === true`, accept the "inside" of the intersection result.
43
+ * * if `keepInside === false`, accept the "outside" of the intersection result.
44
+ * @param clippers clip objects to capture.
44
45
  * @param keepInside flag to select results inside or outside the clippers.
45
46
  */
46
47
  static createCaptureIntersection(clippers, keepInside) {
@@ -49,10 +50,10 @@ export class BooleanClipFactory {
49
50
  return result;
50
51
  }
51
52
  /**
52
- * Create a boolean clipper which performs a parity over its children
53
- * * if `keepInside === true`, accept the "inside" of the parity result
54
- * * if `keepInside === false`, accept the "outside" of the parity result
55
- * @param clippers clip objects to capture
53
+ * Create a boolean clipper which performs a parity over its children.
54
+ * * if `keepInside === true`, accept the "inside" of the parity result.
55
+ * * if `keepInside === false`, accept the "outside" of the parity result.
56
+ * @param clippers clip objects to capture.
56
57
  * @param keepInside flag to select results inside or outside the clippers.
57
58
  */
58
59
  static createCaptureParity(clippers, keepInside) {
@@ -61,10 +62,11 @@ export class BooleanClipFactory {
61
62
  return result;
62
63
  }
63
64
  /**
64
- * Create a boolean clipper which performs a difference operation for points "inside `primaryClipper`" and "outside `excludedClipper`"
65
- * * if `keepInside === true`, accept the "inside" of the difference
66
- * * if `keepInside === false`, accept the "outside" of the difference
67
- * @param primaryClipper any clip object whose output is treated as positive
65
+ * Create a boolean clipper which performs a difference operation for points "inside `primaryClipper`" and
66
+ * "outside `excludedClipper`".
67
+ * * if `keepInside === true`, accept the "inside" of the difference.
68
+ * * if `keepInside === false`, accept the "outside" of the difference.
69
+ * @param primaryClipper any clip object whose output is treated as positive.
68
70
  * @param excludeClip any clipper whose output is treated as negative.
69
71
  * @param keepInside flag to select results inside or outside the initial `primary minus excludeClipper` clippers.
70
72
  */
@@ -73,19 +75,17 @@ export class BooleanClipFactory {
73
75
  return this.createCaptureIntersection([primaryClipper, mask], keepInside);
74
76
  }
75
77
  /**
76
- * Create a boolean clipper which performs the reverse of that of `primaryClipper`
77
- * @param primaryClipper clip objects to capture
78
+ * Create a boolean clipper which performs the reverse of that of `primaryClipper`.
79
+ * @param primaryClipper clip objects to capture.
78
80
  * @param keepInside flag to select results inside or outside the clippers.
79
81
  */
80
82
  static createCaptureClipOutside(primaryClipper) {
81
83
  return this.createCaptureUnion([primaryClipper], false);
82
84
  }
83
85
  /**
84
- * convert `source` to an array of clipper objects.
86
+ * Convert `source` to an array of clipper objects.
85
87
  * * ANY TYPE OF Clipper is accepted.
86
88
  * * REMARK: This is normally called only from the primary public method `parseToClipper`.
87
- * @param source
88
- * @param internal
89
89
  */
90
90
  static parseToClipperArray(source) {
91
91
  if (Array.isArray(source)) {
@@ -109,7 +109,7 @@ export class BooleanClipFactory {
109
109
  return undefined;
110
110
  }
111
111
  /**
112
- * look for content that represents a clipper.
112
+ * Look for content that represents a clipper.
113
113
  * * Possible outputs are
114
114
  * * `ClipPlane`
115
115
  * * `ConvexClipPlaneSet`