@itwin/core-geometry 5.10.0-dev.1 → 5.10.0-dev.11

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 (174) hide show
  1. package/CHANGELOG.md +22 -1
  2. package/lib/cjs/clipping/BooleanClipNode.d.ts +28 -29
  3. package/lib/cjs/clipping/BooleanClipNode.d.ts.map +1 -1
  4. package/lib/cjs/clipping/BooleanClipNode.js +61 -29
  5. package/lib/cjs/clipping/BooleanClipNode.js.map +1 -1
  6. package/lib/cjs/clipping/ClipPlane.d.ts +12 -13
  7. package/lib/cjs/clipping/ClipPlane.d.ts.map +1 -1
  8. package/lib/cjs/clipping/ClipPlane.js +19 -12
  9. package/lib/cjs/clipping/ClipPlane.js.map +1 -1
  10. package/lib/cjs/clipping/ClipPrimitive.d.ts +13 -8
  11. package/lib/cjs/clipping/ClipPrimitive.d.ts.map +1 -1
  12. package/lib/cjs/clipping/ClipPrimitive.js +18 -7
  13. package/lib/cjs/clipping/ClipPrimitive.js.map +1 -1
  14. package/lib/cjs/clipping/ClipUtils.d.ts +13 -5
  15. package/lib/cjs/clipping/ClipUtils.d.ts.map +1 -1
  16. package/lib/cjs/clipping/ClipUtils.js.map +1 -1
  17. package/lib/cjs/clipping/ClipVector.d.ts +11 -5
  18. package/lib/cjs/clipping/ClipVector.d.ts.map +1 -1
  19. package/lib/cjs/clipping/ClipVector.js +22 -7
  20. package/lib/cjs/clipping/ClipVector.js.map +1 -1
  21. package/lib/cjs/clipping/ConvexClipPlaneSet.d.ts +7 -20
  22. package/lib/cjs/clipping/ConvexClipPlaneSet.d.ts.map +1 -1
  23. package/lib/cjs/clipping/ConvexClipPlaneSet.js +16 -20
  24. package/lib/cjs/clipping/ConvexClipPlaneSet.js.map +1 -1
  25. package/lib/cjs/clipping/UnionOfConvexClipPlaneSets.d.ts +8 -19
  26. package/lib/cjs/clipping/UnionOfConvexClipPlaneSets.d.ts.map +1 -1
  27. package/lib/cjs/clipping/UnionOfConvexClipPlaneSets.js +19 -22
  28. package/lib/cjs/clipping/UnionOfConvexClipPlaneSets.js.map +1 -1
  29. package/lib/cjs/curve/CurvePrimitive.d.ts +4 -4
  30. package/lib/cjs/curve/CurvePrimitive.d.ts.map +1 -1
  31. package/lib/cjs/curve/CurvePrimitive.js +5 -6
  32. package/lib/cjs/curve/CurvePrimitive.js.map +1 -1
  33. package/lib/cjs/curve/LineString3d.d.ts +4 -4
  34. package/lib/cjs/curve/LineString3d.d.ts.map +1 -1
  35. package/lib/cjs/curve/LineString3d.js +4 -6
  36. package/lib/cjs/curve/LineString3d.js.map +1 -1
  37. package/lib/cjs/curve/internalContexts/AppendPlaneIntersectionStrokeHandler.d.ts +2 -3
  38. package/lib/cjs/curve/internalContexts/AppendPlaneIntersectionStrokeHandler.d.ts.map +1 -1
  39. package/lib/cjs/curve/internalContexts/AppendPlaneIntersectionStrokeHandler.js +5 -6
  40. package/lib/cjs/curve/internalContexts/AppendPlaneIntersectionStrokeHandler.js.map +1 -1
  41. package/lib/cjs/curve/spiral/TransitionSpiral3d.d.ts.map +1 -1
  42. package/lib/cjs/curve/spiral/TransitionSpiral3d.js.map +1 -1
  43. package/lib/cjs/geometry3d/Ellipsoid.d.ts +4 -3
  44. package/lib/cjs/geometry3d/Ellipsoid.d.ts.map +1 -1
  45. package/lib/cjs/geometry3d/Ellipsoid.js +7 -4
  46. package/lib/cjs/geometry3d/Ellipsoid.js.map +1 -1
  47. package/lib/cjs/geometry3d/Matrix3d.d.ts +2 -0
  48. package/lib/cjs/geometry3d/Matrix3d.d.ts.map +1 -1
  49. package/lib/cjs/geometry3d/Matrix3d.js +4 -0
  50. package/lib/cjs/geometry3d/Matrix3d.js.map +1 -1
  51. package/lib/cjs/geometry3d/Plane3d.d.ts +16 -11
  52. package/lib/cjs/geometry3d/Plane3d.d.ts.map +1 -1
  53. package/lib/cjs/geometry3d/Plane3d.js +16 -11
  54. package/lib/cjs/geometry3d/Plane3d.js.map +1 -1
  55. package/lib/cjs/serialization/IModelJsonSchema.d.ts.map +1 -1
  56. package/lib/cjs/serialization/IModelJsonSchema.js +8 -13
  57. package/lib/cjs/serialization/IModelJsonSchema.js.map +1 -1
  58. package/lib/cjs/solid/Box.d.ts +2 -0
  59. package/lib/cjs/solid/Box.d.ts.map +1 -1
  60. package/lib/cjs/solid/Box.js +4 -0
  61. package/lib/cjs/solid/Box.js.map +1 -1
  62. package/lib/cjs/solid/Cone.d.ts +12 -0
  63. package/lib/cjs/solid/Cone.d.ts.map +1 -1
  64. package/lib/cjs/solid/Cone.js +23 -0
  65. package/lib/cjs/solid/Cone.js.map +1 -1
  66. package/lib/cjs/solid/LinearSweep.d.ts +2 -0
  67. package/lib/cjs/solid/LinearSweep.d.ts.map +1 -1
  68. package/lib/cjs/solid/LinearSweep.js +4 -0
  69. package/lib/cjs/solid/LinearSweep.js.map +1 -1
  70. package/lib/cjs/solid/RotationalSweep.d.ts +2 -0
  71. package/lib/cjs/solid/RotationalSweep.d.ts.map +1 -1
  72. package/lib/cjs/solid/RotationalSweep.js +4 -0
  73. package/lib/cjs/solid/RotationalSweep.js.map +1 -1
  74. package/lib/cjs/solid/RuledSweep.d.ts +1 -1
  75. package/lib/cjs/solid/RuledSweep.js.map +1 -1
  76. package/lib/cjs/solid/SolidPrimitive.d.ts +8 -1
  77. package/lib/cjs/solid/SolidPrimitive.d.ts.map +1 -1
  78. package/lib/cjs/solid/SolidPrimitive.js +8 -0
  79. package/lib/cjs/solid/SolidPrimitive.js.map +1 -1
  80. package/lib/cjs/solid/Sphere.d.ts +2 -0
  81. package/lib/cjs/solid/Sphere.d.ts.map +1 -1
  82. package/lib/cjs/solid/Sphere.js +4 -0
  83. package/lib/cjs/solid/Sphere.js.map +1 -1
  84. package/lib/cjs/solid/TorusPipe.d.ts +2 -0
  85. package/lib/cjs/solid/TorusPipe.d.ts.map +1 -1
  86. package/lib/cjs/solid/TorusPipe.js +4 -0
  87. package/lib/cjs/solid/TorusPipe.js.map +1 -1
  88. package/lib/esm/clipping/BooleanClipNode.d.ts +28 -29
  89. package/lib/esm/clipping/BooleanClipNode.d.ts.map +1 -1
  90. package/lib/esm/clipping/BooleanClipNode.js +61 -29
  91. package/lib/esm/clipping/BooleanClipNode.js.map +1 -1
  92. package/lib/esm/clipping/ClipPlane.d.ts +12 -13
  93. package/lib/esm/clipping/ClipPlane.d.ts.map +1 -1
  94. package/lib/esm/clipping/ClipPlane.js +19 -12
  95. package/lib/esm/clipping/ClipPlane.js.map +1 -1
  96. package/lib/esm/clipping/ClipPrimitive.d.ts +13 -8
  97. package/lib/esm/clipping/ClipPrimitive.d.ts.map +1 -1
  98. package/lib/esm/clipping/ClipPrimitive.js +18 -7
  99. package/lib/esm/clipping/ClipPrimitive.js.map +1 -1
  100. package/lib/esm/clipping/ClipUtils.d.ts +13 -5
  101. package/lib/esm/clipping/ClipUtils.d.ts.map +1 -1
  102. package/lib/esm/clipping/ClipUtils.js.map +1 -1
  103. package/lib/esm/clipping/ClipVector.d.ts +11 -5
  104. package/lib/esm/clipping/ClipVector.d.ts.map +1 -1
  105. package/lib/esm/clipping/ClipVector.js +22 -7
  106. package/lib/esm/clipping/ClipVector.js.map +1 -1
  107. package/lib/esm/clipping/ConvexClipPlaneSet.d.ts +7 -20
  108. package/lib/esm/clipping/ConvexClipPlaneSet.d.ts.map +1 -1
  109. package/lib/esm/clipping/ConvexClipPlaneSet.js +16 -20
  110. package/lib/esm/clipping/ConvexClipPlaneSet.js.map +1 -1
  111. package/lib/esm/clipping/UnionOfConvexClipPlaneSets.d.ts +8 -19
  112. package/lib/esm/clipping/UnionOfConvexClipPlaneSets.d.ts.map +1 -1
  113. package/lib/esm/clipping/UnionOfConvexClipPlaneSets.js +19 -22
  114. package/lib/esm/clipping/UnionOfConvexClipPlaneSets.js.map +1 -1
  115. package/lib/esm/curve/CurvePrimitive.d.ts +4 -4
  116. package/lib/esm/curve/CurvePrimitive.d.ts.map +1 -1
  117. package/lib/esm/curve/CurvePrimitive.js +5 -6
  118. package/lib/esm/curve/CurvePrimitive.js.map +1 -1
  119. package/lib/esm/curve/LineString3d.d.ts +4 -4
  120. package/lib/esm/curve/LineString3d.d.ts.map +1 -1
  121. package/lib/esm/curve/LineString3d.js +4 -6
  122. package/lib/esm/curve/LineString3d.js.map +1 -1
  123. package/lib/esm/curve/internalContexts/AppendPlaneIntersectionStrokeHandler.d.ts +2 -3
  124. package/lib/esm/curve/internalContexts/AppendPlaneIntersectionStrokeHandler.d.ts.map +1 -1
  125. package/lib/esm/curve/internalContexts/AppendPlaneIntersectionStrokeHandler.js +5 -6
  126. package/lib/esm/curve/internalContexts/AppendPlaneIntersectionStrokeHandler.js.map +1 -1
  127. package/lib/esm/curve/spiral/TransitionSpiral3d.d.ts.map +1 -1
  128. package/lib/esm/curve/spiral/TransitionSpiral3d.js.map +1 -1
  129. package/lib/esm/geometry3d/Ellipsoid.d.ts +4 -3
  130. package/lib/esm/geometry3d/Ellipsoid.d.ts.map +1 -1
  131. package/lib/esm/geometry3d/Ellipsoid.js +7 -4
  132. package/lib/esm/geometry3d/Ellipsoid.js.map +1 -1
  133. package/lib/esm/geometry3d/Matrix3d.d.ts +2 -0
  134. package/lib/esm/geometry3d/Matrix3d.d.ts.map +1 -1
  135. package/lib/esm/geometry3d/Matrix3d.js +4 -0
  136. package/lib/esm/geometry3d/Matrix3d.js.map +1 -1
  137. package/lib/esm/geometry3d/Plane3d.d.ts +16 -11
  138. package/lib/esm/geometry3d/Plane3d.d.ts.map +1 -1
  139. package/lib/esm/geometry3d/Plane3d.js +16 -11
  140. package/lib/esm/geometry3d/Plane3d.js.map +1 -1
  141. package/lib/esm/serialization/IModelJsonSchema.d.ts.map +1 -1
  142. package/lib/esm/serialization/IModelJsonSchema.js +8 -13
  143. package/lib/esm/serialization/IModelJsonSchema.js.map +1 -1
  144. package/lib/esm/solid/Box.d.ts +2 -0
  145. package/lib/esm/solid/Box.d.ts.map +1 -1
  146. package/lib/esm/solid/Box.js +4 -0
  147. package/lib/esm/solid/Box.js.map +1 -1
  148. package/lib/esm/solid/Cone.d.ts +12 -0
  149. package/lib/esm/solid/Cone.d.ts.map +1 -1
  150. package/lib/esm/solid/Cone.js +23 -0
  151. package/lib/esm/solid/Cone.js.map +1 -1
  152. package/lib/esm/solid/LinearSweep.d.ts +2 -0
  153. package/lib/esm/solid/LinearSweep.d.ts.map +1 -1
  154. package/lib/esm/solid/LinearSweep.js +4 -0
  155. package/lib/esm/solid/LinearSweep.js.map +1 -1
  156. package/lib/esm/solid/RotationalSweep.d.ts +2 -0
  157. package/lib/esm/solid/RotationalSweep.d.ts.map +1 -1
  158. package/lib/esm/solid/RotationalSweep.js +4 -0
  159. package/lib/esm/solid/RotationalSweep.js.map +1 -1
  160. package/lib/esm/solid/RuledSweep.d.ts +1 -1
  161. package/lib/esm/solid/RuledSweep.js.map +1 -1
  162. package/lib/esm/solid/SolidPrimitive.d.ts +8 -1
  163. package/lib/esm/solid/SolidPrimitive.d.ts.map +1 -1
  164. package/lib/esm/solid/SolidPrimitive.js +8 -0
  165. package/lib/esm/solid/SolidPrimitive.js.map +1 -1
  166. package/lib/esm/solid/Sphere.d.ts +2 -0
  167. package/lib/esm/solid/Sphere.d.ts.map +1 -1
  168. package/lib/esm/solid/Sphere.js +4 -0
  169. package/lib/esm/solid/Sphere.js.map +1 -1
  170. package/lib/esm/solid/TorusPipe.d.ts +2 -0
  171. package/lib/esm/solid/TorusPipe.d.ts.map +1 -1
  172. package/lib/esm/solid/TorusPipe.js +4 -0
  173. package/lib/esm/solid/TorusPipe.js.map +1 -1
  174. package/package.json +3 -3
package/CHANGELOG.md CHANGED
@@ -1,6 +1,27 @@
1
1
  # Change Log - @itwin/core-geometry
2
2
 
3
- This log was last generated on Thu, 23 Apr 2026 18:06:53 GMT and should not be manually modified.
3
+ This log was last generated on Fri, 08 May 2026 20:37:55 GMT and should not be manually modified.
4
+
5
+ ## 5.9.2
6
+ Fri, 08 May 2026 20:36:41 GMT
7
+
8
+ _Version update only_
9
+
10
+ ## 5.9.1
11
+ Tue, 05 May 2026 17:43:30 GMT
12
+
13
+ _Version update only_
14
+
15
+ ## 5.9.0
16
+ Mon, 04 May 2026 16:32:08 GMT
17
+
18
+ ### Updates
19
+
20
+ - propagate Loop.isInner during clone
21
+ - filter stubborn bridge edges in RegionOps.constructAllXYRegionLoops
22
+ - Fixed intersection of 2 tangent circles
23
+ - Set _xyInUse correcly for GrowableXYArray and GrowableXYZArray.
24
+ - Improved B-spline curve close approach
4
25
 
5
26
  ## 5.8.4
6
27
  Thu, 23 Apr 2026 18:05:14 GMT
@@ -1,6 +1,3 @@
1
- /** @packageDocumentation
2
- * @module CartesianGeometry
3
- */
4
1
  import { Arc3d } from "../curve/Arc3d";
5
2
  import { AnnounceNumberNumber, AnnounceNumberNumberCurvePrimitive, CurvePrimitive } from "../curve/CurvePrimitive";
6
3
  import { GrowableXYZArray } from "../geometry3d/GrowableXYZArray";
@@ -9,20 +6,21 @@ import { Point3d } from "../geometry3d/Point3dVector3d";
9
6
  import { Range1d } from "../geometry3d/Range";
10
7
  import { GrowableXYZArrayCache } from "../geometry3d/ReusableObjectCache";
11
8
  import { Clipper, PolygonClipper } from "./ClipUtils";
12
- /** BooleanClipNode is an abstract base class for boolean actions by an array of clippers.
13
- * * Derived class must implement
9
+ /**
10
+ * BooleanClipNode is an abstract base class for boolean actions by an array of clippers.
11
+ * * Derived class must implement:
14
12
  * * The single point test `isPointOnOrInsideChildren`
15
13
  * * Boolean operation on 1d intervals `combineIntervals`
16
- * * The `keepInside` flag controls an additional optional flip of the boolean result.
17
- * * if `keepInside === true`, accept the "inside" of the clip clippers
14
+ * * The `keepInside` flag controls an additional optional flip of the boolean result:
15
+ * * if `keepInside === true`, accept the "inside" of the child clippers.
18
16
  * * if `keepInside === false`, accept the "outside" of the child clippers.
19
- * * Hence the combinations of derived classes for (OR, AND, XOR) and keepInside are
20
- * * (OR, true) = simple union (OR), i.e. "in" one or more clips
21
- * * (OR, false) = complement of union (NOR), i.e. "outside" all clips
22
- * * (AND, true) = simple intersection (AND), i.e. "in" all clips
23
- * * (AND, false) = complement of intersection (NAND), i.e. "outside" one or more clips
24
- * * (XOR,true) = simple parity, i.e. "in" an odd number of clips
25
- * * (XOR,false) = complement of parity ), i.e. "in" an even number of clips
17
+ * * Hence the combinations of derived classes for (OR, AND, XOR) and keepInside are:
18
+ * * (OR, true) = simple union (OR), i.e., "in" one or more clips.
19
+ * * (OR, false) = complement of union (NOR), i.e., "outside" all clips.
20
+ * * (AND, true) = simple intersection (AND), i.e., "in" all clips.
21
+ * * (AND, false) = complement of intersection (NAND), i.e., "outside" one or more clips.
22
+ * * (XOR, true) = simple parity, i.e., "in" an odd number of clips.
23
+ * * (XOR, false) = complement of parity, i.e., "in" an even number of clips.
26
24
  * @internal
27
25
  */
28
26
  export declare abstract class BooleanClipNode implements Clipper {
@@ -37,65 +35,66 @@ export declare abstract class BooleanClipNode implements Clipper {
37
35
  toJSON(): any;
38
36
  /** Capture a (reference to a) child node or nodes */
39
37
  captureChild(child: Clipper | Clipper[]): void;
40
- /** Toggle the "keepInside" behavior. Return the prior value. */
38
+ /** Toggle the "keepInside" behavior. Return the prior value. */
41
39
  toggleResult(): boolean;
42
- /** Set the "keepInside" behavior */
40
+ /** Set the "keepInside" behavior. */
43
41
  selectResult(keepInside: boolean): boolean;
44
42
  /**
45
- * Conditionally (if a1 > a0 strictly) call announce (a0, a1).
43
+ * Conditionally (if a1 > a0 strictly) call `announce(a0, a1)`.
46
44
  * * Return 0 if not called, 1 if called.
47
45
  */
48
46
  protected testedAnnounceNN(a0: number, a1: number, announce?: AnnounceNumberNumber): number;
49
47
  /**
50
- * Conditionally (if a1 > a0 strictly) call announce (a0, a1, cp).
48
+ * Conditionally (if a1 > a0 strictly) call `announce(a0, a1, cp)`.
51
49
  * * Return 0 if not called, 1 if called.
52
50
  */
53
51
  protected testedAnnounceNNC(a0: number, a1: number, cp: CurvePrimitive, announce?: AnnounceNumberNumberCurvePrimitive): number;
54
- /** Swap the _intervalsA and _intervalsB */
52
+ /** Swap the `_intervalsA` and `_intervalsB`. */
55
53
  protected swapAB(): void;
56
54
  /**
57
- * Announce all "outside intervals" --not masked by intervals
55
+ * Announce all "outside intervals" -- not masked by intervals.
58
56
  * * Return true if any intervals announced.
59
57
  */
60
58
  protected announcePartsNN(keepInside: boolean, intervals: Range1d[], f0: number, f1: number, announce?: AnnounceNumberNumber): boolean;
61
59
  /**
62
- * Announce all "outside intervals" --not masked by intervals
60
+ * Announce all "outside intervals" -- not masked by intervals.
63
61
  * * Return true if any intervals announced.
64
62
  */
65
63
  protected announcePartsNNC(keepInside: boolean, intervals: Range1d[], f0: number, f1: number, cp: CurvePrimitive, announce?: AnnounceNumberNumberCurvePrimitive): boolean;
66
- /** Invoke callback to test if a point is "in" this clipper */
64
+ /** Invoke callback to test if a point is "in" this clipper. */
67
65
  isPointOnOrInside(point: Point3d): boolean;
68
- /** Announce "in" portions of a line segment. See `Clipper.announceClippedSegmentIntervals` */
66
+ /** Method from [[Clipper]] interface. */
69
67
  announceClippedSegmentIntervals(f0: number, f1: number, pointA: Point3d, pointB: Point3d, announce?: AnnounceNumberNumber): boolean;
70
- /** Announce "in" portions of a line segment. See `Clipper.announceClippedSegmentIntervals` */
68
+ /** Method from [[Clipper]] interface. */
71
69
  announceClippedArcIntervals(arc: Arc3d, announce?: AnnounceNumberNumberCurvePrimitive): boolean;
70
+ announceClippedCurveIntervals(curve: CurvePrimitive, announce?: AnnounceNumberNumberCurvePrimitive): boolean;
72
71
  }
73
72
  /**
74
- * Implement [BooleanClipNode] virtual methods for intersection (boolean OR) among children
73
+ * Implement [BooleanClipNode] virtual methods for intersection (boolean OR) among children.
75
74
  * @internal
76
75
  */
77
76
  export declare class BooleanClipNodeUnion extends BooleanClipNode {
78
77
  get operationName(): string;
79
78
  constructor(keepInside: boolean);
80
- /** Return true if inside any child clipper */
79
+ /** Return true if inside any child clipper. */
81
80
  isPointOnOrInsideChildren(point: Point3d): boolean;
82
81
  combineIntervals(operandA: Range1d[], operandB: Range1d[]): Range1d[];
83
82
  appendPolygonClip(xyz: IndexedXYZCollection, insideFragments: GrowableXYZArray[], outsideFragments: GrowableXYZArray[], arrayCache: GrowableXYZArrayCache): void;
84
83
  }
85
84
  /**
86
- * Implement [BooleanClipNode] virtual methods for intersection (boolean OR) among children
85
+ * Implement [BooleanClipNode] virtual methods for intersection (boolean OR) among children.
87
86
  * @internal
88
87
  */
89
88
  export declare class BooleanClipNodeParity extends BooleanClipNode {
90
89
  get operationName(): string;
91
90
  constructor(keepInside: boolean);
92
- /** Return true if inside an odd number of clippers child clipper */
91
+ /** Return true if inside an odd number of clippers child clipper. */
93
92
  isPointOnOrInsideChildren(point: Point3d): boolean;
94
93
  combineIntervals(operandA: Range1d[], operandB: Range1d[]): Range1d[];
95
94
  appendPolygonClip(xyz: IndexedXYZCollection, insideFragments: GrowableXYZArray[], outsideFragments: GrowableXYZArray[], arrayCache: GrowableXYZArrayCache): void;
96
95
  }
97
96
  /**
98
- * Implement [BooleanClipNode] virtual methods for intersection (boolean OR) among children
97
+ * Implement [BooleanClipNode] virtual methods for intersection (boolean OR) among children.
99
98
  * @internal
100
99
  */
101
100
  export declare class BooleanClipNodeIntersection extends BooleanClipNode implements PolygonClipper {
@@ -1 +1 @@
1
- {"version":3,"file":"BooleanClipNode.d.ts","sourceRoot":"","sources":["../../../src/clipping/BooleanClipNode.ts"],"names":[],"mappings":"AAKA;;GAEG;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AACvC,OAAO,EAAE,oBAAoB,EAAE,kCAAkC,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACnH,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAClE,OAAO,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAC1E,OAAO,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AACxD,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC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,yBAAyB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO;IAQlD,gBAAgB,CAAC,QAAQ,EAAE,OAAO,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,OAAO,EAAE;IAGrE,iBAAiB,CACtB,GAAG,EAAE,oBAAoB,EACzB,eAAe,EAAE,gBAAgB,EAAE,EACnC,gBAAgB,EAAE,gBAAgB,EAAE,EACpC,UAAU,EAAE,qBAAqB;CAUpC;AAED;;;GAGG;AACH,qBAAa,2BAA4B,SAAQ,eAAgB,YAAW,cAAc;IACxF,IAAW,aAAa,IAAI,MAAM,CAEjC;gBACkB,UAAU,EAAE,OAAO;IAGtC,mDAAmD;IAC5C,yBAAyB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO;IAOlD,gBAAgB,CAAC,QAAQ,EAAE,OAAO,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,OAAO,EAAE;IAGrE,iBAAiB,CACtB,GAAG,EAAE,oBAAoB,EACzB,eAAe,EAAE,gBAAgB,EAAE,EACnC,gBAAgB,EAAE,gBAAgB,EAAE,EACpC,UAAU,EAAE,qBAAqB;CAepC"}
@@ -5,23 +5,28 @@
5
5
  *--------------------------------------------------------------------------------------------*/
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
7
  exports.BooleanClipNodeIntersection = exports.BooleanClipNodeParity = exports.BooleanClipNodeUnion = exports.BooleanClipNode = void 0;
8
+ /** @packageDocumentation
9
+ * @module CartesianGeometry
10
+ */
11
+ const core_bentley_1 = require("@itwin/core-bentley");
8
12
  const Range_1 = require("../geometry3d/Range");
9
13
  const Range1dArray_1 = require("../numerics/Range1dArray");
10
14
  const ClipUtils_1 = require("./ClipUtils");
11
- /** BooleanClipNode is an abstract base class for boolean actions by an array of clippers.
12
- * * Derived class must implement
15
+ /**
16
+ * BooleanClipNode is an abstract base class for boolean actions by an array of clippers.
17
+ * * Derived class must implement:
13
18
  * * The single point test `isPointOnOrInsideChildren`
14
19
  * * Boolean operation on 1d intervals `combineIntervals`
15
- * * The `keepInside` flag controls an additional optional flip of the boolean result.
16
- * * if `keepInside === true`, accept the "inside" of the clip clippers
20
+ * * The `keepInside` flag controls an additional optional flip of the boolean result:
21
+ * * if `keepInside === true`, accept the "inside" of the child clippers.
17
22
  * * if `keepInside === false`, accept the "outside" of the child clippers.
18
- * * Hence the combinations of derived classes for (OR, AND, XOR) and keepInside are
19
- * * (OR, true) = simple union (OR), i.e. "in" one or more clips
20
- * * (OR, false) = complement of union (NOR), i.e. "outside" all clips
21
- * * (AND, true) = simple intersection (AND), i.e. "in" all clips
22
- * * (AND, false) = complement of intersection (NAND), i.e. "outside" one or more clips
23
- * * (XOR,true) = simple parity, i.e. "in" an odd number of clips
24
- * * (XOR,false) = complement of parity ), i.e. "in" an even number of clips
23
+ * * Hence the combinations of derived classes for (OR, AND, XOR) and keepInside are:
24
+ * * (OR, true) = simple union (OR), i.e., "in" one or more clips.
25
+ * * (OR, false) = complement of union (NOR), i.e., "outside" all clips.
26
+ * * (AND, true) = simple intersection (AND), i.e., "in" all clips.
27
+ * * (AND, false) = complement of intersection (NAND), i.e., "outside" one or more clips.
28
+ * * (XOR, true) = simple parity, i.e., "in" an odd number of clips.
29
+ * * (XOR, false) = complement of parity, i.e., "in" an even number of clips.
25
30
  * @internal
26
31
  */
27
32
  class BooleanClipNode {
@@ -58,18 +63,18 @@ class BooleanClipNode {
58
63
  this._clippers.push(child);
59
64
  }
60
65
  }
61
- /** Toggle the "keepInside" behavior. Return the prior value. */
66
+ /** Toggle the "keepInside" behavior. Return the prior value. */
62
67
  toggleResult() {
63
68
  return this.selectResult(!this._keepInside);
64
69
  }
65
- /** Set the "keepInside" behavior */
70
+ /** Set the "keepInside" behavior. */
66
71
  selectResult(keepInside) {
67
72
  const s = this._keepInside;
68
73
  this._keepInside = keepInside;
69
74
  return s;
70
75
  }
71
76
  /**
72
- * Conditionally (if a1 > a0 strictly) call announce (a0, a1).
77
+ * Conditionally (if a1 > a0 strictly) call `announce(a0, a1)`.
73
78
  * * Return 0 if not called, 1 if called.
74
79
  */
75
80
  testedAnnounceNN(a0, a1, announce) {
@@ -81,7 +86,7 @@ class BooleanClipNode {
81
86
  return 0;
82
87
  }
83
88
  /**
84
- * Conditionally (if a1 > a0 strictly) call announce (a0, a1, cp).
89
+ * Conditionally (if a1 > a0 strictly) call `announce(a0, a1, cp)`.
85
90
  * * Return 0 if not called, 1 if called.
86
91
  */
87
92
  testedAnnounceNNC(a0, a1, cp, announce) {
@@ -92,14 +97,14 @@ class BooleanClipNode {
92
97
  }
93
98
  return 0;
94
99
  }
95
- /** Swap the _intervalsA and _intervalsB */
100
+ /** Swap the `_intervalsA` and `_intervalsB`. */
96
101
  swapAB() {
97
102
  const q = this._intervalsA;
98
103
  this._intervalsA = this._intervalsB;
99
104
  this._intervalsB = q;
100
105
  }
101
106
  /**
102
- * Announce all "outside intervals" --not masked by intervals
107
+ * Announce all "outside intervals" -- not masked by intervals.
103
108
  * * Return true if any intervals announced.
104
109
  */
105
110
  announcePartsNN(keepInside, intervals, f0, f1, announce) {
@@ -121,7 +126,7 @@ class BooleanClipNode {
121
126
  return numAnnounce > 0;
122
127
  }
123
128
  /**
124
- * Announce all "outside intervals" --not masked by intervals
129
+ * Announce all "outside intervals" -- not masked by intervals.
125
130
  * * Return true if any intervals announced.
126
131
  */
127
132
  announcePartsNNC(keepInside, intervals, f0, f1, cp, announce) {
@@ -142,12 +147,12 @@ class BooleanClipNode {
142
147
  }
143
148
  return numAnnounce > 0;
144
149
  }
145
- /** Invoke callback to test if a point is "in" this clipper */
150
+ /** Invoke callback to test if a point is "in" this clipper. */
146
151
  isPointOnOrInside(point) {
147
152
  const q = this.isPointOnOrInsideChildren(point);
148
153
  return this._keepInside ? q : !q;
149
154
  }
150
- /** Announce "in" portions of a line segment. See `Clipper.announceClippedSegmentIntervals` */
155
+ /** Method from [[Clipper]] interface. */
151
156
  announceClippedSegmentIntervals(f0, f1, pointA, pointB, announce) {
152
157
  this._intervalsA.length = 0;
153
158
  const announceIntervalB = (a0, a1) => {
@@ -174,7 +179,7 @@ class BooleanClipNode {
174
179
  }
175
180
  return this.announcePartsNN(this._keepInside, this._intervalsA, f0, f1, announce);
176
181
  }
177
- /** Announce "in" portions of a line segment. See `Clipper.announceClippedSegmentIntervals` */
182
+ /** Method from [[Clipper]] interface. */
178
183
  announceClippedArcIntervals(arc, announce) {
179
184
  this._intervalsA.length = 0;
180
185
  const announceIntervalB = (a0, a1) => {
@@ -195,18 +200,41 @@ class BooleanClipNode {
195
200
  }
196
201
  return this.announcePartsNNC(this._keepInside, this._intervalsA, 0, 1, arc, announce);
197
202
  }
203
+ /* Method from [[Clipper]] interface. */
204
+ announceClippedCurveIntervals(curve, announce) {
205
+ this._intervalsA.length = 0;
206
+ const announceIntervalB = (a0, a1, _cp) => {
207
+ this._intervalsB.push(Range_1.Range1d.createXX(a0, a1));
208
+ };
209
+ let i = 0;
210
+ for (const c of this._clippers) {
211
+ this._intervalsB.length = 0;
212
+ c.announceClippedCurveIntervals?.(curve, announceIntervalB) ?? (0, core_bentley_1.assert)(false, () => `Expect ${c.constructor.name} to implement announceClippedCurveIntervals`);
213
+ Range1dArray_1.Range1dArray.simplifySortUnion(this._intervalsB);
214
+ if (i === 0) {
215
+ this.swapAB();
216
+ }
217
+ else {
218
+ this._intervalsA = this.combineIntervals(this._intervalsA, this._intervalsB);
219
+ }
220
+ i++;
221
+ }
222
+ return this.announcePartsNNC(this._keepInside, this._intervalsA, 0, 1, curve, announce);
223
+ }
198
224
  }
199
225
  exports.BooleanClipNode = BooleanClipNode;
200
226
  /**
201
- * Implement [BooleanClipNode] virtual methods for intersection (boolean OR) among children
227
+ * Implement [BooleanClipNode] virtual methods for intersection (boolean OR) among children.
202
228
  * @internal
203
229
  */
204
230
  class BooleanClipNodeUnion extends BooleanClipNode {
205
- get operationName() { return this._keepInside ? "OR" : "NOR"; }
231
+ get operationName() {
232
+ return this._keepInside ? "OR" : "NOR";
233
+ }
206
234
  constructor(keepInside) {
207
235
  super(keepInside);
208
236
  }
209
- /** Return true if inside any child clipper */
237
+ /** Return true if inside any child clipper. */
210
238
  isPointOnOrInsideChildren(point) {
211
239
  for (const clipper of this._clippers) {
212
240
  if (clipper.isPointOnOrInside(point))
@@ -223,15 +251,17 @@ class BooleanClipNodeUnion extends BooleanClipNode {
223
251
  }
224
252
  exports.BooleanClipNodeUnion = BooleanClipNodeUnion;
225
253
  /**
226
- * Implement [BooleanClipNode] virtual methods for intersection (boolean OR) among children
254
+ * Implement [BooleanClipNode] virtual methods for intersection (boolean OR) among children.
227
255
  * @internal
228
256
  */
229
257
  class BooleanClipNodeParity extends BooleanClipNode {
230
- get operationName() { return this._keepInside ? "XOR" : "NXOR"; }
258
+ get operationName() {
259
+ return this._keepInside ? "XOR" : "NXOR";
260
+ }
231
261
  constructor(keepInside) {
232
262
  super(keepInside);
233
263
  }
234
- /** Return true if inside an odd number of clippers child clipper */
264
+ /** Return true if inside an odd number of clippers child clipper. */
235
265
  isPointOnOrInsideChildren(point) {
236
266
  let q = false;
237
267
  for (const clipper of this._clippers) {
@@ -249,11 +279,13 @@ class BooleanClipNodeParity extends BooleanClipNode {
249
279
  }
250
280
  exports.BooleanClipNodeParity = BooleanClipNodeParity;
251
281
  /**
252
- * Implement [BooleanClipNode] virtual methods for intersection (boolean OR) among children
282
+ * Implement [BooleanClipNode] virtual methods for intersection (boolean OR) among children.
253
283
  * @internal
254
284
  */
255
285
  class BooleanClipNodeIntersection extends BooleanClipNode {
256
- get operationName() { return this._keepInside ? "AND" : "NAND"; }
286
+ get operationName() {
287
+ return this._keepInside ? "AND" : "NAND";
288
+ }
257
289
  constructor(keepInside) {
258
290
  super(keepInside);
259
291
  }
@@ -1 +1 @@
1
- {"version":3,"file":"BooleanClipNode.js","sourceRoot":"","sources":["../../../src/clipping/BooleanClipNode.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAW/F,+CAA8C;AAE9C,2DAAwD;AACxD,2CAAqF;AAErF;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AAI,CAAC,WAAW,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,gBAAgB,EACrD,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,eAAe,EACrD,SAAS,EACT,0BAAc,CAAC,cAAc,EAC7B,0BAAc,CAAC,SAAS,EACxB,0BAAc,CAAC,QAAQ,EACvB,UAAU,CACX,CAAC;IACJ,CAAC;CACF;AAnCD,kEAmCC","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 { Arc3d } from \"../curve/Arc3d\";\r\nimport { AnnounceNumberNumber, AnnounceNumberNumberCurvePrimitive, CurvePrimitive } from \"../curve/CurvePrimitive\";\r\nimport { GrowableXYZArray } from \"../geometry3d/GrowableXYZArray\";\r\nimport { IndexedXYZCollection } from \"../geometry3d/IndexedXYZCollection\";\r\nimport { Point3d } from \"../geometry3d/Point3dVector3d\";\r\nimport { Range1d } from \"../geometry3d/Range\";\r\nimport { GrowableXYZArrayCache } from \"../geometry3d/ReusableObjectCache\";\r\nimport { Range1dArray } from \"../numerics/Range1dArray\";\r\nimport { Clipper, ClipStepAction, ClipUtilities, PolygonClipper } from \"./ClipUtils\";\r\n\r\n/** BooleanClipNode is an abstract base class for boolean actions by an array of clippers.\r\n * * Derived class must implement\r\n * * The single point test `isPointOnOrInsideChildren`\r\n * * Boolean operation on 1d intervals `combineIntervals`\r\n * * The `keepInside` flag controls an additional optional flip of the boolean result.\r\n * * if `keepInside === true`, accept the \"inside\" of the clip clippers\r\n * * if `keepInside === false`, accept the \"outside\" of the child clippers.\r\n * * Hence the combinations of derived classes for (OR, AND, XOR) and keepInside are\r\n * * (OR, true) = simple union (OR), i.e. \"in\" one or more clips\r\n * * (OR, false) = complement of union (NOR), i.e. \"outside\" all clips\r\n * * (AND, true) = simple intersection (AND), i.e. \"in\" all clips\r\n * * (AND, false) = complement of intersection (NAND), i.e. \"outside\" one or more clips\r\n * * (XOR,true) = simple parity, i.e. \"in\" an odd number of clips\r\n * * (XOR,false) = complement of parity ), i.e. \"in\" an even number of clips\r\n * @internal\r\n */\r\nexport abstract class BooleanClipNode implements Clipper {\r\n protected _clippers: Clipper[];\r\n protected _intervalsA: Range1d[];\r\n protected _intervalsB: Range1d[];\r\n protected _keepInside: boolean;\r\n\r\n public constructor(keepInside: boolean) {\r\n this._keepInside = keepInside;\r\n this._clippers = [];\r\n this._intervalsA = [];\r\n this._intervalsB = [];\r\n }\r\n protected abstract isPointOnOrInsideChildren(point: Point3d): boolean;\r\n protected abstract combineIntervals(operandA: Range1d[], operandB: Range1d[]): Range1d[];\r\n public abstract get operationName(): string;\r\n public toJSON(): any {\r\n const data = [];\r\n for (const c of this._clippers) {\r\n const c1 = c as any;\r\n if (c1.toJSON)\r\n data.push(c1.toJSON());\r\n }\r\n // return this.formatJSON(data);\r\n const s = this.operationName;\r\n const json: { [opType: string]: any[] } = {};\r\n json[s] = data;\r\n return json;\r\n }\r\n /** Capture a (reference to a) child node or nodes */\r\n public captureChild(child: Clipper | Clipper[]) {\r\n if (Array.isArray(child)) {\r\n for (const c of child) this.captureChild(c);\r\n } else {\r\n this._clippers.push(child);\r\n }\r\n }\r\n /** Toggle the \"keepInside\" behavior. Return the prior value. */\r\n public toggleResult(): boolean {\r\n return this.selectResult(!this._keepInside);\r\n }\r\n /** Set the \"keepInside\" behavior */\r\n public selectResult(keepInside: boolean): boolean {\r\n const s = this._keepInside;\r\n this._keepInside = keepInside;\r\n return s;\r\n }\r\n /**\r\n * Conditionally (if a1 > a0 strictly) call announce (a0, a1).\r\n * * Return 0 if not called, 1 if called.\r\n */\r\n protected testedAnnounceNN(a0: number, a1: number, announce?: AnnounceNumberNumber): number {\r\n if (a0 < a1) {\r\n if (announce)\r\n announce(a0, a1);\r\n return 1;\r\n }\r\n return 0;\r\n }\r\n /**\r\n * Conditionally (if a1 > a0 strictly) call announce (a0, a1, cp).\r\n * * Return 0 if not called, 1 if called.\r\n */\r\n protected testedAnnounceNNC(\r\n a0: number, a1: number, cp: CurvePrimitive, announce?: AnnounceNumberNumberCurvePrimitive,\r\n ): number {\r\n if (a0 < a1) {\r\n if (announce)\r\n announce(a0, a1, cp);\r\n return 1;\r\n }\r\n return 0;\r\n }\r\n /** Swap the _intervalsA and _intervalsB */\r\n protected swapAB(): void {\r\n const q = this._intervalsA;\r\n this._intervalsA = this._intervalsB;\r\n this._intervalsB = q;\r\n }\r\n /**\r\n * Announce all \"outside intervals\" --not masked by intervals\r\n * * Return true if any intervals announced.\r\n */\r\n protected announcePartsNN(\r\n keepInside: boolean, intervals: Range1d[], f0: number, f1: number, announce?: AnnounceNumberNumber,\r\n ): boolean {\r\n let numAnnounce = 0;\r\n if (!keepInside) {\r\n let lowFraction = f0;\r\n for (const interval of intervals) {\r\n numAnnounce += this.testedAnnounceNN(lowFraction, interval.low, announce);\r\n lowFraction = interval.high;\r\n }\r\n numAnnounce += this.testedAnnounceNN(lowFraction, f1, announce);\r\n } else {\r\n for (const interval of intervals) {\r\n // use f0..f1 ?\r\n numAnnounce += this.testedAnnounceNN(interval.low, interval.high, announce);\r\n }\r\n }\r\n return numAnnounce > 0;\r\n }\r\n /**\r\n * Announce all \"outside intervals\" --not masked by intervals\r\n * * Return true if any intervals announced.\r\n */\r\n protected announcePartsNNC(\r\n keepInside: boolean, intervals: Range1d[], f0: number, f1: number, cp: CurvePrimitive, announce?: AnnounceNumberNumberCurvePrimitive,\r\n ): boolean {\r\n let numAnnounce = 0;\r\n if (!keepInside) {\r\n let lowFraction = f0;\r\n for (const interval of intervals) {\r\n numAnnounce += this.testedAnnounceNNC(lowFraction, interval.low, cp, announce);\r\n lowFraction = interval.high;\r\n }\r\n numAnnounce += this.testedAnnounceNNC(lowFraction, f1, cp, announce);\r\n } else {\r\n for (const interval of intervals) {\r\n // use f0..f1 ?\r\n numAnnounce += this.testedAnnounceNNC(interval.low, interval.high, cp, announce);\r\n }\r\n }\r\n return numAnnounce > 0;\r\n }\r\n /** Invoke callback to test if a point is \"in\" this clipper */\r\n public isPointOnOrInside(point: Point3d): boolean {\r\n const q = this.isPointOnOrInsideChildren(point);\r\n return this._keepInside ? q : !q;\r\n }\r\n /** Announce \"in\" portions of a line segment. See `Clipper.announceClippedSegmentIntervals` */\r\n public announceClippedSegmentIntervals(\r\n f0: number, f1: number, pointA: Point3d, pointB: Point3d, announce?: AnnounceNumberNumber,\r\n ): boolean {\r\n this._intervalsA.length = 0;\r\n const announceIntervalB = (a0: number, a1: number) => {\r\n this._intervalsB.push(Range1d.createXX(a0, a1));\r\n };\r\n // Strategy:\r\n // _intervalsA is the accumulated UNION of from clippers\r\n // _intervalsB is the current clipper.\r\n // announceIntervalB appends single new interval to _intervalB\r\n // at end, output gaps in _intervalsA\r\n //\r\n let i = 0;\r\n for (const c of this._clippers) {\r\n this._intervalsB.length = 0;\r\n c.announceClippedSegmentIntervals(f0, f1, pointA, pointB, announceIntervalB);\r\n Range1dArray.simplifySortUnion(this._intervalsB);\r\n if (i === 0) {\r\n this.swapAB();\r\n } else {\r\n this._intervalsA = this.combineIntervals(this._intervalsA, this._intervalsB);\r\n }\r\n i++;\r\n }\r\n return this.announcePartsNN(this._keepInside, this._intervalsA, f0, f1, announce);\r\n }\r\n /** Announce \"in\" portions of a line segment. See `Clipper.announceClippedSegmentIntervals` */\r\n public announceClippedArcIntervals(arc: Arc3d, announce?: AnnounceNumberNumberCurvePrimitive): boolean {\r\n this._intervalsA.length = 0;\r\n const announceIntervalB = (a0: number, a1: number) => {\r\n this._intervalsB.push(Range1d.createXX(a0, a1));\r\n };\r\n let i = 0;\r\n for (const c of this._clippers) {\r\n this._intervalsB.length = 0;\r\n c.announceClippedArcIntervals(arc, announceIntervalB);\r\n Range1dArray.simplifySortUnion(this._intervalsB);\r\n if (i === 0) {\r\n this.swapAB();\r\n } else {\r\n this._intervalsA = this.combineIntervals(this._intervalsA, this._intervalsB);\r\n }\r\n i++;\r\n }\r\n return this.announcePartsNNC(this._keepInside, this._intervalsA, 0, 1, arc, announce);\r\n }\r\n}\r\n\r\n/**\r\n * Implement [BooleanClipNode] virtual methods for intersection (boolean OR) among children\r\n * @internal\r\n */\r\nexport class BooleanClipNodeUnion extends BooleanClipNode {\r\n public get operationName(): string { return this._keepInside ? \"OR\" : \"NOR\"; }\r\n public constructor(keepInside: boolean) {\r\n super(keepInside);\r\n }\r\n /** Return true if inside any child clipper */\r\n public isPointOnOrInsideChildren(point: Point3d): boolean {\r\n for (const clipper of this._clippers) {\r\n if (clipper.isPointOnOrInside(point))\r\n return true;\r\n }\r\n return false;\r\n }\r\n public combineIntervals(operandA: Range1d[], operandB: Range1d[]): Range1d[] {\r\n return Range1dArray.unionSorted(operandA, operandB);\r\n }\r\n public appendPolygonClip(\r\n xyz: IndexedXYZCollection,\r\n insideFragments: GrowableXYZArray[],\r\n outsideFragments: GrowableXYZArray[],\r\n arrayCache: GrowableXYZArrayCache,\r\n ) {\r\n ClipUtilities.doPolygonClipSequence(\r\n xyz,\r\n this._clippers,\r\n this._keepInside ? insideFragments : outsideFragments,\r\n this._keepInside ? outsideFragments : insideFragments,\r\n undefined,\r\n ClipStepAction.acceptIn,\r\n ClipStepAction.passToNextStep,\r\n ClipStepAction.acceptOut,\r\n arrayCache,\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * Implement [BooleanClipNode] virtual methods for intersection (boolean OR) among children\r\n * @internal\r\n */\r\nexport class BooleanClipNodeParity extends BooleanClipNode {\r\n public get operationName(): string { return this._keepInside ? \"XOR\" : \"NXOR\"; }\r\n public constructor(keepInside: boolean) {\r\n super(keepInside);\r\n }\r\n /** Return true if inside an odd number of clippers child clipper */\r\n public isPointOnOrInsideChildren(point: Point3d): boolean {\r\n let q = false;\r\n for (const clipper of this._clippers) {\r\n if (clipper.isPointOnOrInside(point))\r\n q = !q;\r\n }\r\n return q;\r\n }\r\n public combineIntervals(operandA: Range1d[], operandB: Range1d[]): Range1d[] {\r\n return Range1dArray.paritySorted(operandA, operandB);\r\n }\r\n public appendPolygonClip(\r\n xyz: IndexedXYZCollection,\r\n insideFragments: GrowableXYZArray[],\r\n outsideFragments: GrowableXYZArray[],\r\n arrayCache: GrowableXYZArrayCache,\r\n ) {\r\n ClipUtilities.doPolygonClipParitySequence(\r\n xyz,\r\n this._clippers,\r\n this._keepInside ? insideFragments : outsideFragments,\r\n this._keepInside ? outsideFragments : insideFragments,\r\n arrayCache,\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * Implement [BooleanClipNode] virtual methods for intersection (boolean OR) among children\r\n * @internal\r\n */\r\nexport class BooleanClipNodeIntersection extends BooleanClipNode implements PolygonClipper {\r\n public get operationName(): string { return this._keepInside ? \"AND\" : \"NAND\"; }\r\n public constructor(keepInside: boolean) {\r\n super(keepInside);\r\n }\r\n /** Return false if outside of any child clipper */\r\n public isPointOnOrInsideChildren(point: Point3d): boolean {\r\n for (const clipper of this._clippers) {\r\n if (!clipper.isPointOnOrInside(point))\r\n return false;\r\n }\r\n return true;\r\n }\r\n public combineIntervals(operandA: Range1d[], operandB: Range1d[]): Range1d[] {\r\n return Range1dArray.intersectSorted(operandA, operandB);\r\n }\r\n public appendPolygonClip(\r\n xyz: IndexedXYZCollection,\r\n insideFragments: GrowableXYZArray[],\r\n outsideFragments: GrowableXYZArray[],\r\n arrayCache: GrowableXYZArrayCache,\r\n ) {\r\n\r\n ClipUtilities.doPolygonClipSequence(\r\n xyz,\r\n this._clippers,\r\n this._keepInside ? insideFragments : outsideFragments,\r\n this._keepInside ? outsideFragments : insideFragments,\r\n undefined,\r\n ClipStepAction.passToNextStep,\r\n ClipStepAction.acceptOut,\r\n ClipStepAction.acceptIn,\r\n arrayCache,\r\n );\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"BooleanClipNode.js","sourceRoot":"","sources":["../../../src/clipping/Boolean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ACd,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,gBAAgB,EACrD,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,eAAe,EACrD,SAAS,EACT,0BAAc,CAAC,cAAc,EAC7B,0BAAc,CAAC,SAAS,EACxB,0BAAc,CAAC,QAAQ,EACvB,UAAU,CACX,CAAC;IACJ,CAAC;CACF;AArCD,kEAqCC","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 { assert } from \"@itwin/core-bentley\";\r\nimport { Arc3d } from \"../curve/Arc3d\";\r\nimport { AnnounceNumberNumber, AnnounceNumberNumberCurvePrimitive, CurvePrimitive } from \"../curve/CurvePrimitive\";\r\nimport { GrowableXYZArray } from \"../geometry3d/GrowableXYZArray\";\r\nimport { IndexedXYZCollection } from \"../geometry3d/IndexedXYZCollection\";\r\nimport { Point3d } from \"../geometry3d/Point3dVector3d\";\r\nimport { Range1d } from \"../geometry3d/Range\";\r\nimport { GrowableXYZArrayCache } from \"../geometry3d/ReusableObjectCache\";\r\nimport { Range1dArray } from \"../numerics/Range1dArray\";\r\nimport { Clipper, ClipStepAction, ClipUtilities, PolygonClipper } from \"./ClipUtils\";\r\n\r\n/**\r\n * BooleanClipNode is an abstract base class for boolean actions by an array of clippers.\r\n * * Derived class must implement:\r\n * * The single point test `isPointOnOrInsideChildren`\r\n * * Boolean operation on 1d intervals `combineIntervals`\r\n * * The `keepInside` flag controls an additional optional flip of the boolean result:\r\n * * if `keepInside === true`, accept the \"inside\" of the child clippers.\r\n * * if `keepInside === false`, accept the \"outside\" of the child clippers.\r\n * * Hence the combinations of derived classes for (OR, AND, XOR) and keepInside are:\r\n * * (OR, true) = simple union (OR), i.e., \"in\" one or more clips.\r\n * * (OR, false) = complement of union (NOR), i.e., \"outside\" all clips.\r\n * * (AND, true) = simple intersection (AND), i.e., \"in\" all clips.\r\n * * (AND, false) = complement of intersection (NAND), i.e., \"outside\" one or more clips.\r\n * * (XOR, true) = simple parity, i.e., \"in\" an odd number of clips.\r\n * * (XOR, false) = complement of parity, i.e., \"in\" an even number of clips.\r\n * @internal\r\n */\r\nexport abstract class BooleanClipNode implements Clipper {\r\n protected _clippers: Clipper[];\r\n protected _intervalsA: Range1d[];\r\n protected _intervalsB: Range1d[];\r\n protected _keepInside: boolean;\r\n public constructor(keepInside: boolean) {\r\n this._keepInside = keepInside;\r\n this._clippers = [];\r\n this._intervalsA = [];\r\n this._intervalsB = [];\r\n }\r\n protected abstract isPointOnOrInsideChildren(point: Point3d): boolean;\r\n protected abstract combineIntervals(operandA: Range1d[], operandB: Range1d[]): Range1d[];\r\n public abstract get operationName(): string;\r\n public toJSON(): any {\r\n const data = [];\r\n for (const c of this._clippers) {\r\n const c1 = c as any;\r\n if (c1.toJSON)\r\n data.push(c1.toJSON());\r\n }\r\n // return this.formatJSON(data);\r\n const s = this.operationName;\r\n const json: { [opType: string]: any[] } = {};\r\n json[s] = data;\r\n return json;\r\n }\r\n /** Capture a (reference to a) child node or nodes */\r\n public captureChild(child: Clipper | Clipper[]) {\r\n if (Array.isArray(child)) {\r\n for (const c of child) this.captureChild(c);\r\n } else {\r\n this._clippers.push(child);\r\n }\r\n }\r\n /** Toggle the \"keepInside\" behavior. Return the prior value. */\r\n public toggleResult(): boolean {\r\n return this.selectResult(!this._keepInside);\r\n }\r\n /** Set the \"keepInside\" behavior. */\r\n public selectResult(keepInside: boolean): boolean {\r\n const s = this._keepInside;\r\n this._keepInside = keepInside;\r\n return s;\r\n }\r\n /**\r\n * Conditionally (if a1 > a0 strictly) call `announce(a0, a1)`.\r\n * * Return 0 if not called, 1 if called.\r\n */\r\n protected testedAnnounceNN(a0: number, a1: number, announce?: AnnounceNumberNumber): number {\r\n if (a0 < a1) {\r\n if (announce)\r\n announce(a0, a1);\r\n return 1;\r\n }\r\n return 0;\r\n }\r\n /**\r\n * Conditionally (if a1 > a0 strictly) call `announce(a0, a1, cp)`.\r\n * * Return 0 if not called, 1 if called.\r\n */\r\n protected testedAnnounceNNC(\r\n a0: number, a1: number, cp: CurvePrimitive, announce?: AnnounceNumberNumberCurvePrimitive,\r\n ): number {\r\n if (a0 < a1) {\r\n if (announce)\r\n announce(a0, a1, cp);\r\n return 1;\r\n }\r\n return 0;\r\n }\r\n /** Swap the `_intervalsA` and `_intervalsB`. */\r\n protected swapAB(): void {\r\n const q = this._intervalsA;\r\n this._intervalsA = this._intervalsB;\r\n this._intervalsB = q;\r\n }\r\n /**\r\n * Announce all \"outside intervals\" -- not masked by intervals.\r\n * * Return true if any intervals announced.\r\n */\r\n protected announcePartsNN(\r\n keepInside: boolean, intervals: Range1d[], f0: number, f1: number, announce?: AnnounceNumberNumber,\r\n ): boolean {\r\n let numAnnounce = 0;\r\n if (!keepInside) {\r\n let lowFraction = f0;\r\n for (const interval of intervals) {\r\n numAnnounce += this.testedAnnounceNN(lowFraction, interval.low, announce);\r\n lowFraction = interval.high;\r\n }\r\n numAnnounce += this.testedAnnounceNN(lowFraction, f1, announce);\r\n } else {\r\n for (const interval of intervals) {\r\n // use f0..f1 ?\r\n numAnnounce += this.testedAnnounceNN(interval.low, interval.high, announce);\r\n }\r\n }\r\n return numAnnounce > 0;\r\n }\r\n /**\r\n * Announce all \"outside intervals\" -- not masked by intervals.\r\n * * Return true if any intervals announced.\r\n */\r\n protected announcePartsNNC(\r\n keepInside: boolean, intervals: Range1d[], f0: number, f1: number, cp: CurvePrimitive, announce?: AnnounceNumberNumberCurvePrimitive,\r\n ): boolean {\r\n let numAnnounce = 0;\r\n if (!keepInside) {\r\n let lowFraction = f0;\r\n for (const interval of intervals) {\r\n numAnnounce += this.testedAnnounceNNC(lowFraction, interval.low, cp, announce);\r\n lowFraction = interval.high;\r\n }\r\n numAnnounce += this.testedAnnounceNNC(lowFraction, f1, cp, announce);\r\n } else {\r\n for (const interval of intervals) {\r\n // use f0..f1 ?\r\n numAnnounce += this.testedAnnounceNNC(interval.low, interval.high, cp, announce);\r\n }\r\n }\r\n return numAnnounce > 0;\r\n }\r\n /** Invoke callback to test if a point is \"in\" this clipper. */\r\n public isPointOnOrInside(point: Point3d): boolean {\r\n const q = this.isPointOnOrInsideChildren(point);\r\n return this._keepInside ? q : !q;\r\n }\r\n /** Method from [[Clipper]] interface. */\r\n public announceClippedSegmentIntervals(\r\n f0: number, f1: number, pointA: Point3d, pointB: Point3d, announce?: AnnounceNumberNumber,\r\n ): boolean {\r\n this._intervalsA.length = 0;\r\n const announceIntervalB = (a0: number, a1: number) => {\r\n this._intervalsB.push(Range1d.createXX(a0, a1));\r\n };\r\n // Strategy:\r\n // _intervalsA is the accumulated UNION of from clippers\r\n // _intervalsB is the current clipper.\r\n // announceIntervalB appends single new interval to _intervalB\r\n // at end, output gaps in _intervalsA\r\n //\r\n let i = 0;\r\n for (const c of this._clippers) {\r\n this._intervalsB.length = 0;\r\n c.announceClippedSegmentIntervals(f0, f1, pointA, pointB, announceIntervalB);\r\n Range1dArray.simplifySortUnion(this._intervalsB);\r\n if (i === 0) {\r\n this.swapAB();\r\n } else {\r\n this._intervalsA = this.combineIntervals(this._intervalsA, this._intervalsB);\r\n }\r\n i++;\r\n }\r\n return this.announcePartsNN(this._keepInside, this._intervalsA, f0, f1, announce);\r\n }\r\n /** Method from [[Clipper]] interface. */\r\n public announceClippedArcIntervals(arc: Arc3d, announce?: AnnounceNumberNumberCurvePrimitive): boolean {\r\n this._intervalsA.length = 0;\r\n const announceIntervalB = (a0: number, a1: number) => {\r\n this._intervalsB.push(Range1d.createXX(a0, a1));\r\n };\r\n let i = 0;\r\n for (const c of this._clippers) {\r\n this._intervalsB.length = 0;\r\n c.announceClippedArcIntervals(arc, announceIntervalB);\r\n Range1dArray.simplifySortUnion(this._intervalsB);\r\n if (i === 0) {\r\n this.swapAB();\r\n } else {\r\n this._intervalsA = this.combineIntervals(this._intervalsA, this._intervalsB);\r\n }\r\n i++;\r\n }\r\n return this.announcePartsNNC(this._keepInside, this._intervalsA, 0, 1, arc, announce);\r\n }\r\n /* Method from [[Clipper]] interface. */\r\n public announceClippedCurveIntervals(curve: CurvePrimitive, announce?: AnnounceNumberNumberCurvePrimitive): boolean {\r\n this._intervalsA.length = 0;\r\n const announceIntervalB = (a0: number, a1: number, _cp: CurvePrimitive) => {\r\n this._intervalsB.push(Range1d.createXX(a0, a1));\r\n };\r\n let i = 0;\r\n for (const c of this._clippers) {\r\n this._intervalsB.length = 0;\r\n c.announceClippedCurveIntervals?.(curve, announceIntervalB) ?? assert(false, () => `Expect ${c.constructor.name} to implement announceClippedCurveIntervals`);\r\n Range1dArray.simplifySortUnion(this._intervalsB);\r\n if (i === 0) {\r\n this.swapAB();\r\n } else {\r\n this._intervalsA = this.combineIntervals(this._intervalsA, this._intervalsB);\r\n }\r\n i++;\r\n }\r\n return this.announcePartsNNC(this._keepInside, this._intervalsA, 0, 1, curve, announce);\r\n }\r\n}\r\n\r\n/**\r\n * Implement [BooleanClipNode] virtual methods for intersection (boolean OR) among children.\r\n * @internal\r\n */\r\nexport class BooleanClipNodeUnion extends BooleanClipNode {\r\n public get operationName(): string {\r\n return this._keepInside ? \"OR\" : \"NOR\";\r\n }\r\n public constructor(keepInside: boolean) {\r\n super(keepInside);\r\n }\r\n /** Return true if inside any child clipper. */\r\n public isPointOnOrInsideChildren(point: Point3d): boolean {\r\n for (const clipper of this._clippers) {\r\n if (clipper.isPointOnOrInside(point))\r\n return true;\r\n }\r\n return false;\r\n }\r\n public combineIntervals(operandA: Range1d[], operandB: Range1d[]): Range1d[] {\r\n return Range1dArray.unionSorted(operandA, operandB);\r\n }\r\n public appendPolygonClip(\r\n xyz: IndexedXYZCollection,\r\n insideFragments: GrowableXYZArray[],\r\n outsideFragments: GrowableXYZArray[],\r\n arrayCache: GrowableXYZArrayCache,\r\n ) {\r\n ClipUtilities.doPolygonClipSequence(\r\n xyz,\r\n this._clippers,\r\n this._keepInside ? insideFragments : outsideFragments,\r\n this._keepInside ? outsideFragments : insideFragments,\r\n undefined,\r\n ClipStepAction.acceptIn,\r\n ClipStepAction.passToNextStep,\r\n ClipStepAction.acceptOut,\r\n arrayCache,\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * Implement [BooleanClipNode] virtual methods for intersection (boolean OR) among children.\r\n * @internal\r\n */\r\nexport class BooleanClipNodeParity extends BooleanClipNode {\r\n public get operationName(): string {\r\n return this._keepInside ? \"XOR\" : \"NXOR\";\r\n }\r\n public constructor(keepInside: boolean) {\r\n super(keepInside);\r\n }\r\n /** Return true if inside an odd number of clippers child clipper. */\r\n public isPointOnOrInsideChildren(point: Point3d): boolean {\r\n let q = false;\r\n for (const clipper of this._clippers) {\r\n if (clipper.isPointOnOrInside(point))\r\n q = !q;\r\n }\r\n return q;\r\n }\r\n public combineIntervals(operandA: Range1d[], operandB: Range1d[]): Range1d[] {\r\n return Range1dArray.paritySorted(operandA, operandB);\r\n }\r\n public appendPolygonClip(\r\n xyz: IndexedXYZCollection,\r\n insideFragments: GrowableXYZArray[],\r\n outsideFragments: GrowableXYZArray[],\r\n arrayCache: GrowableXYZArrayCache,\r\n ) {\r\n ClipUtilities.doPolygonClipParitySequence(\r\n xyz,\r\n this._clippers,\r\n this._keepInside ? insideFragments : outsideFragments,\r\n this._keepInside ? outsideFragments : insideFragments,\r\n arrayCache,\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * Implement [BooleanClipNode] virtual methods for intersection (boolean OR) among children.\r\n * @internal\r\n */\r\nexport class BooleanClipNodeIntersection extends BooleanClipNode implements PolygonClipper {\r\n public get operationName(): string {\r\n return this._keepInside ? \"AND\" : \"NAND\";\r\n }\r\n public constructor(keepInside: boolean) {\r\n super(keepInside);\r\n }\r\n /** Return false if outside of any child clipper */\r\n public isPointOnOrInsideChildren(point: Point3d): boolean {\r\n for (const clipper of this._clippers) {\r\n if (!clipper.isPointOnOrInside(point))\r\n return false;\r\n }\r\n return true;\r\n }\r\n public combineIntervals(operandA: Range1d[], operandB: Range1d[]): Range1d[] {\r\n return Range1dArray.intersectSorted(operandA, operandB);\r\n }\r\n public appendPolygonClip(\r\n xyz: IndexedXYZCollection,\r\n insideFragments: GrowableXYZArray[],\r\n outsideFragments: GrowableXYZArray[],\r\n arrayCache: GrowableXYZArrayCache,\r\n ) {\r\n\r\n ClipUtilities.doPolygonClipSequence(\r\n xyz,\r\n this._clippers,\r\n this._keepInside ? insideFragments : outsideFragments,\r\n this._keepInside ? outsideFragments : insideFragments,\r\n undefined,\r\n ClipStepAction.passToNextStep,\r\n ClipStepAction.acceptOut,\r\n ClipStepAction.acceptIn,\r\n arrayCache,\r\n );\r\n }\r\n}\r\n"]}
@@ -1,5 +1,5 @@
1
1
  import { Arc3d } from "../curve/Arc3d";
2
- import { AnnounceNumberNumberCurvePrimitive } from "../curve/CurvePrimitive";
2
+ import { AnnounceNumberNumber, AnnounceNumberNumberCurvePrimitive, CurvePrimitive } from "../curve/CurvePrimitive";
3
3
  import { Angle } from "../geometry3d/Angle";
4
4
  import { GrowableFloat64Array } from "../geometry3d/GrowableFloat64Array";
5
5
  import { GrowableXYZArray } from "../geometry3d/GrowableXYZArray";
@@ -36,7 +36,7 @@ export interface ClipPlaneProps {
36
36
  * More details can be found at docs/learning/geometry/Clipping.md
37
37
  *
38
38
  * Hence
39
- * * The halfspace function evaluation for "point" (x,y,z) is `(x,y,z) DOT (u,v,w) - signedDistance`.
39
+ * * The halfspace function evaluation for point (x,y,z) is `(x,y,z) DOT (u,v,w) - signedDistance`.
40
40
  * * POSITIVE values of the halfspace function are "inside".
41
41
  * * ZERO value of the halfspace function is "on".
42
42
  * * NEGATIVE value of the halfspace function is "outside".
@@ -49,7 +49,7 @@ export declare class ClipPlane extends Plane3d implements Clipper, PolygonClippe
49
49
  /**
50
50
  * Construct a parallel plane through the origin.
51
51
  * * Move it to the actual position.
52
- * * _distanceFromOrigin is the distance it moved, with the (inward) normal direction as positive
52
+ * * _distanceFromOrigin is the distance it moved, with the (inward) normal direction as positive.
53
53
  */
54
54
  private _distanceFromOrigin;
55
55
  private _invisible;
@@ -205,17 +205,16 @@ export declare class ClipPlane extends Plane3d implements Clipper, PolygonClippe
205
205
  */
206
206
  isPointOn(point: Point3d, tolerance?: number): boolean;
207
207
  /**
208
- * Compute intersections of an (UNBOUNDED) arc with the plane. Append them (as radians) to a growing array.
209
- * @param arc arc to test. The angle limits of the arc are NOT considered.
210
- * @param intersectionRadians array to receive results
208
+ * Compute intersections of an (UNBOUNDED) arc with the plane. Append them (as radians) to a growing array.
209
+ * @param arc arc to test. The angle limits of the arc are NOT considered.
210
+ * @param intersectionRadians array to receive results.
211
211
  */
212
212
  appendIntersectionRadians(arc: Arc3d, intersectionRadians: GrowableFloat64Array): void;
213
- private static _clipArcFractionArray;
214
- /**
215
- * Announce fractional intervals of arc clip.
216
- * * Each call to `announce(fraction0, fraction1, arc)` announces one interval that is inside the clip plane.
217
- */
213
+ private static _clipFractionArray;
214
+ /** Method from [[Clipper]] interface. */
218
215
  announceClippedArcIntervals(arc: Arc3d, announce?: AnnounceNumberNumberCurvePrimitive): boolean;
216
+ /** Method from [[Clipper]] interface. */
217
+ announceClippedCurveIntervals(curve: CurvePrimitive, announce?: AnnounceNumberNumberCurvePrimitive): boolean;
219
218
  /**
220
219
  * Compute intersection of (unbounded) segment with the plane.
221
220
  * * If the ends are on the same side of the plane, return undefined.
@@ -262,8 +261,8 @@ export declare class ClipPlane extends Plane3d implements Clipper, PolygonClippe
262
261
  * * Both params default to true to get the full effect of transforming space.
263
262
  */
264
263
  multiplyPlaneByMatrix4d(matrix: Matrix4d, invert?: boolean, transpose?: boolean): boolean;
265
- /** Announce the interval (if any) where a line is within the clip plane half space. */
266
- announceClippedSegmentIntervals(f0: number, f1: number, pointA: Point3d, pointB: Point3d, announce?: (fraction0: number, fraction1: number) => void): boolean;
264
+ /** Method from [[Clipper]] interface. */
265
+ announceClippedSegmentIntervals(f0: number, f1: number, pointA: Point3d, pointB: Point3d, announce?: AnnounceNumberNumber): boolean;
267
266
  /**
268
267
  * Return a coordinate frame with
269
268
  * * origin at closest point to global origin
@@ -1 +1 @@
1
- {"version":3,"file":"ClipPlane.d.ts","sourceRoot":"","sources":["../../../src/clipping/ClipPlane.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AACvC,OAAO,EAAE,kCAAkC,EAAE,MAAM,yBAAyB,CAAC;AAE7E,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAC5C,OAAO,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAC1E,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAClE,OAAO,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAE1E,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAAE,4BAA4B,EAAE,MAAM,4CAA4C,CAAC;AAC1F,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AAElE,OAAO,EAAW,OAAO,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAC1E,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAClD,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAEhD,OAAO,EAAE,OAAO,EAAiB,cAAc,EAAE,MAAM,aAAa,CAAC;AAErE;;;;GAIG;AACH,MAAM,WAAW,cAAc;IAC7B,iCAAiC;IACjC,MAAM,CAAC,EAAE,QAAQ,CAAC;IAClB,mDAAmD;IACn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