@itwin/core-geometry 4.2.0-dev.30 → 4.2.0-dev.32

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 (232) hide show
  1. package/CHANGELOG.md +11 -1
  2. package/lib/cjs/Geometry.d.ts +4 -4
  3. package/lib/cjs/Geometry.d.ts.map +1 -1
  4. package/lib/cjs/Geometry.js +2 -2
  5. package/lib/cjs/Geometry.js.map +1 -1
  6. package/lib/cjs/clipping/ClipUtils.d.ts +12 -6
  7. package/lib/cjs/clipping/ClipUtils.d.ts.map +1 -1
  8. package/lib/cjs/clipping/ClipUtils.js +13 -7
  9. package/lib/cjs/clipping/ClipUtils.js.map +1 -1
  10. package/lib/cjs/curve/CurveChainWithDistanceIndex.d.ts +93 -91
  11. package/lib/cjs/curve/CurveChainWithDistanceIndex.d.ts.map +1 -1
  12. package/lib/cjs/curve/CurveChainWithDistanceIndex.js +171 -152
  13. package/lib/cjs/curve/CurveChainWithDistanceIndex.js.map +1 -1
  14. package/lib/cjs/curve/CurveCollection.d.ts +17 -4
  15. package/lib/cjs/curve/CurveCollection.d.ts.map +1 -1
  16. package/lib/cjs/curve/CurveCollection.js +18 -1
  17. package/lib/cjs/curve/CurveCollection.js.map +1 -1
  18. package/lib/cjs/curve/CurveLocationDetail.d.ts +2 -2
  19. package/lib/cjs/curve/CurveLocationDetail.js.map +1 -1
  20. package/lib/cjs/curve/CurvePrimitive.d.ts +1 -2
  21. package/lib/cjs/curve/CurvePrimitive.d.ts.map +1 -1
  22. package/lib/cjs/curve/CurvePrimitive.js +2 -2
  23. package/lib/cjs/curve/CurvePrimitive.js.map +1 -1
  24. package/lib/cjs/curve/ParityRegion.d.ts +2 -2
  25. package/lib/cjs/curve/ParityRegion.d.ts.map +1 -1
  26. package/lib/cjs/curve/ParityRegion.js +2 -2
  27. package/lib/cjs/curve/ParityRegion.js.map +1 -1
  28. package/lib/cjs/curve/RegionOps.d.ts +38 -3
  29. package/lib/cjs/curve/RegionOps.d.ts.map +1 -1
  30. package/lib/cjs/curve/RegionOps.js +136 -2
  31. package/lib/cjs/curve/RegionOps.js.map +1 -1
  32. package/lib/cjs/curve/StrokeOptions.d.ts +20 -11
  33. package/lib/cjs/curve/StrokeOptions.d.ts.map +1 -1
  34. package/lib/cjs/curve/StrokeOptions.js +22 -11
  35. package/lib/cjs/curve/StrokeOptions.js.map +1 -1
  36. package/lib/cjs/curve/UnionRegion.d.ts +2 -2
  37. package/lib/cjs/curve/UnionRegion.d.ts.map +1 -1
  38. package/lib/cjs/curve/UnionRegion.js +2 -2
  39. package/lib/cjs/curve/UnionRegion.js.map +1 -1
  40. package/lib/cjs/curve/internalContexts/ClosestPointStrokeHandler.d.ts +1 -1
  41. package/lib/cjs/curve/internalContexts/ClosestPointStrokeHandler.d.ts.map +1 -1
  42. package/lib/cjs/curve/internalContexts/ClosestPointStrokeHandler.js +2 -2
  43. package/lib/cjs/curve/internalContexts/ClosestPointStrokeHandler.js.map +1 -1
  44. package/lib/cjs/curve/internalContexts/CurveCurveCloseApproachXY.d.ts +20 -12
  45. package/lib/cjs/curve/internalContexts/CurveCurveCloseApproachXY.d.ts.map +1 -1
  46. package/lib/cjs/curve/internalContexts/CurveCurveCloseApproachXY.js +63 -14
  47. package/lib/cjs/curve/internalContexts/CurveCurveCloseApproachXY.js.map +1 -1
  48. package/lib/cjs/curve/internalContexts/CurveOffsetXYHandler.d.ts +2 -2
  49. package/lib/cjs/curve/internalContexts/CurveOffsetXYHandler.d.ts.map +1 -1
  50. package/lib/cjs/curve/internalContexts/CurveOffsetXYHandler.js +9 -5
  51. package/lib/cjs/curve/internalContexts/CurveOffsetXYHandler.js.map +1 -1
  52. package/lib/cjs/geometry3d/GeometryHandler.d.ts +15 -26
  53. package/lib/cjs/geometry3d/GeometryHandler.d.ts.map +1 -1
  54. package/lib/cjs/geometry3d/GeometryHandler.js +23 -32
  55. package/lib/cjs/geometry3d/GeometryHandler.js.map +1 -1
  56. package/lib/cjs/geometry3d/Matrix3d.d.ts.map +1 -1
  57. package/lib/cjs/geometry3d/Matrix3d.js +3 -6
  58. package/lib/cjs/geometry3d/Matrix3d.js.map +1 -1
  59. package/lib/cjs/geometry3d/Point3dVector3d.d.ts +1 -1
  60. package/lib/cjs/geometry3d/Point3dVector3d.d.ts.map +1 -1
  61. package/lib/cjs/geometry3d/Point3dVector3d.js.map +1 -1
  62. package/lib/cjs/geometry3d/PolygonOps.d.ts +1 -1
  63. package/lib/cjs/geometry3d/PolygonOps.d.ts.map +1 -1
  64. package/lib/cjs/geometry3d/PolygonOps.js +2 -3
  65. package/lib/cjs/geometry3d/PolygonOps.js.map +1 -1
  66. package/lib/cjs/geometry3d/Range.d.ts +1 -1
  67. package/lib/cjs/geometry3d/Range.d.ts.map +1 -1
  68. package/lib/cjs/geometry3d/Range.js +1 -1
  69. package/lib/cjs/geometry3d/Range.js.map +1 -1
  70. package/lib/cjs/geometry3d/Transform.d.ts.map +1 -1
  71. package/lib/cjs/geometry3d/Transform.js +4 -6
  72. package/lib/cjs/geometry3d/Transform.js.map +1 -1
  73. package/lib/cjs/geometry4d/Matrix4d.d.ts.map +1 -1
  74. package/lib/cjs/geometry4d/Matrix4d.js +4 -2
  75. package/lib/cjs/geometry4d/Matrix4d.js.map +1 -1
  76. package/lib/cjs/geometry4d/Point4d.js.map +1 -1
  77. package/lib/cjs/polyface/PolyfaceBuilder.d.ts +17 -5
  78. package/lib/cjs/polyface/PolyfaceBuilder.d.ts.map +1 -1
  79. package/lib/cjs/polyface/PolyfaceBuilder.js +48 -15
  80. package/lib/cjs/polyface/PolyfaceBuilder.js.map +1 -1
  81. package/lib/cjs/polyface/PolyfaceClip.d.ts +16 -7
  82. package/lib/cjs/polyface/PolyfaceClip.d.ts.map +1 -1
  83. package/lib/cjs/polyface/PolyfaceClip.js +38 -7
  84. package/lib/cjs/polyface/PolyfaceClip.js.map +1 -1
  85. package/lib/cjs/polyface/PolyfaceData.d.ts +5 -39
  86. package/lib/cjs/polyface/PolyfaceData.d.ts.map +1 -1
  87. package/lib/cjs/polyface/PolyfaceData.js +7 -41
  88. package/lib/cjs/polyface/PolyfaceData.js.map +1 -1
  89. package/lib/cjs/polyface/PolyfaceQuery.d.ts +10 -8
  90. package/lib/cjs/polyface/PolyfaceQuery.d.ts.map +1 -1
  91. package/lib/cjs/polyface/PolyfaceQuery.js +64 -18
  92. package/lib/cjs/polyface/PolyfaceQuery.js.map +1 -1
  93. package/lib/cjs/serialization/GeometrySamples.d.ts +6 -0
  94. package/lib/cjs/serialization/GeometrySamples.d.ts.map +1 -1
  95. package/lib/cjs/serialization/GeometrySamples.js +68 -2
  96. package/lib/cjs/serialization/GeometrySamples.js.map +1 -1
  97. package/lib/cjs/solid/SweepContour.d.ts +34 -25
  98. package/lib/cjs/solid/SweepContour.d.ts.map +1 -1
  99. package/lib/cjs/solid/SweepContour.js +84 -100
  100. package/lib/cjs/solid/SweepContour.js.map +1 -1
  101. package/lib/cjs/topology/Graph.d.ts +29 -11
  102. package/lib/cjs/topology/Graph.d.ts.map +1 -1
  103. package/lib/cjs/topology/Graph.js +45 -26
  104. package/lib/cjs/topology/Graph.js.map +1 -1
  105. package/lib/cjs/topology/HalfEdgeMarkSet.d.ts +2 -2
  106. package/lib/cjs/topology/HalfEdgeMarkSet.d.ts.map +1 -1
  107. package/lib/cjs/topology/HalfEdgeMarkSet.js +4 -4
  108. package/lib/cjs/topology/HalfEdgeMarkSet.js.map +1 -1
  109. package/lib/cjs/topology/Merging.d.ts +3 -0
  110. package/lib/cjs/topology/Merging.d.ts.map +1 -1
  111. package/lib/cjs/topology/Merging.js +19 -5
  112. package/lib/cjs/topology/Merging.js.map +1 -1
  113. package/lib/cjs/topology/Triangulation.d.ts +15 -7
  114. package/lib/cjs/topology/Triangulation.d.ts.map +1 -1
  115. package/lib/cjs/topology/Triangulation.js +89 -47
  116. package/lib/cjs/topology/Triangulation.js.map +1 -1
  117. package/lib/esm/Geometry.d.ts +4 -4
  118. package/lib/esm/Geometry.d.ts.map +1 -1
  119. package/lib/esm/Geometry.js +2 -2
  120. package/lib/esm/Geometry.js.map +1 -1
  121. package/lib/esm/clipping/ClipUtils.d.ts +12 -6
  122. package/lib/esm/clipping/ClipUtils.d.ts.map +1 -1
  123. package/lib/esm/clipping/ClipUtils.js +13 -7
  124. package/lib/esm/clipping/ClipUtils.js.map +1 -1
  125. package/lib/esm/curve/CurveChainWithDistanceIndex.d.ts +93 -91
  126. package/lib/esm/curve/CurveChainWithDistanceIndex.d.ts.map +1 -1
  127. package/lib/esm/curve/CurveChainWithDistanceIndex.js +171 -152
  128. package/lib/esm/curve/CurveChainWithDistanceIndex.js.map +1 -1
  129. package/lib/esm/curve/CurveCollection.d.ts +17 -4
  130. package/lib/esm/curve/CurveCollection.d.ts.map +1 -1
  131. package/lib/esm/curve/CurveCollection.js +18 -1
  132. package/lib/esm/curve/CurveCollection.js.map +1 -1
  133. package/lib/esm/curve/CurveLocationDetail.d.ts +2 -2
  134. package/lib/esm/curve/CurveLocationDetail.js.map +1 -1
  135. package/lib/esm/curve/CurvePrimitive.d.ts +1 -2
  136. package/lib/esm/curve/CurvePrimitive.d.ts.map +1 -1
  137. package/lib/esm/curve/CurvePrimitive.js +2 -2
  138. package/lib/esm/curve/CurvePrimitive.js.map +1 -1
  139. package/lib/esm/curve/ParityRegion.d.ts +2 -2
  140. package/lib/esm/curve/ParityRegion.d.ts.map +1 -1
  141. package/lib/esm/curve/ParityRegion.js +2 -2
  142. package/lib/esm/curve/ParityRegion.js.map +1 -1
  143. package/lib/esm/curve/RegionOps.d.ts +38 -3
  144. package/lib/esm/curve/RegionOps.d.ts.map +1 -1
  145. package/lib/esm/curve/RegionOps.js +137 -3
  146. package/lib/esm/curve/RegionOps.js.map +1 -1
  147. package/lib/esm/curve/StrokeOptions.d.ts +20 -11
  148. package/lib/esm/curve/StrokeOptions.d.ts.map +1 -1
  149. package/lib/esm/curve/StrokeOptions.js +22 -11
  150. package/lib/esm/curve/StrokeOptions.js.map +1 -1
  151. package/lib/esm/curve/UnionRegion.d.ts +2 -2
  152. package/lib/esm/curve/UnionRegion.d.ts.map +1 -1
  153. package/lib/esm/curve/UnionRegion.js +2 -2
  154. package/lib/esm/curve/UnionRegion.js.map +1 -1
  155. package/lib/esm/curve/internalContexts/ClosestPointStrokeHandler.d.ts +1 -1
  156. package/lib/esm/curve/internalContexts/ClosestPointStrokeHandler.d.ts.map +1 -1
  157. package/lib/esm/curve/internalContexts/ClosestPointStrokeHandler.js +2 -2
  158. package/lib/esm/curve/internalContexts/ClosestPointStrokeHandler.js.map +1 -1
  159. package/lib/esm/curve/internalContexts/CurveCurveCloseApproachXY.d.ts +20 -12
  160. package/lib/esm/curve/internalContexts/CurveCurveCloseApproachXY.d.ts.map +1 -1
  161. package/lib/esm/curve/internalContexts/CurveCurveCloseApproachXY.js +63 -14
  162. package/lib/esm/curve/internalContexts/CurveCurveCloseApproachXY.js.map +1 -1
  163. package/lib/esm/curve/internalContexts/CurveOffsetXYHandler.d.ts +2 -2
  164. package/lib/esm/curve/internalContexts/CurveOffsetXYHandler.d.ts.map +1 -1
  165. package/lib/esm/curve/internalContexts/CurveOffsetXYHandler.js +9 -5
  166. package/lib/esm/curve/internalContexts/CurveOffsetXYHandler.js.map +1 -1
  167. package/lib/esm/geometry3d/GeometryHandler.d.ts +15 -26
  168. package/lib/esm/geometry3d/GeometryHandler.d.ts.map +1 -1
  169. package/lib/esm/geometry3d/GeometryHandler.js +23 -32
  170. package/lib/esm/geometry3d/GeometryHandler.js.map +1 -1
  171. package/lib/esm/geometry3d/Matrix3d.d.ts.map +1 -1
  172. package/lib/esm/geometry3d/Matrix3d.js +3 -6
  173. package/lib/esm/geometry3d/Matrix3d.js.map +1 -1
  174. package/lib/esm/geometry3d/Point3dVector3d.d.ts +1 -1
  175. package/lib/esm/geometry3d/Point3dVector3d.d.ts.map +1 -1
  176. package/lib/esm/geometry3d/Point3dVector3d.js.map +1 -1
  177. package/lib/esm/geometry3d/PolygonOps.d.ts +1 -1
  178. package/lib/esm/geometry3d/PolygonOps.d.ts.map +1 -1
  179. package/lib/esm/geometry3d/PolygonOps.js +2 -3
  180. package/lib/esm/geometry3d/PolygonOps.js.map +1 -1
  181. package/lib/esm/geometry3d/Range.d.ts +1 -1
  182. package/lib/esm/geometry3d/Range.d.ts.map +1 -1
  183. package/lib/esm/geometry3d/Range.js +1 -1
  184. package/lib/esm/geometry3d/Range.js.map +1 -1
  185. package/lib/esm/geometry3d/Transform.d.ts.map +1 -1
  186. package/lib/esm/geometry3d/Transform.js +4 -6
  187. package/lib/esm/geometry3d/Transform.js.map +1 -1
  188. package/lib/esm/geometry4d/Matrix4d.d.ts.map +1 -1
  189. package/lib/esm/geometry4d/Matrix4d.js +4 -2
  190. package/lib/esm/geometry4d/Matrix4d.js.map +1 -1
  191. package/lib/esm/geometry4d/Point4d.js.map +1 -1
  192. package/lib/esm/polyface/PolyfaceBuilder.d.ts +17 -5
  193. package/lib/esm/polyface/PolyfaceBuilder.d.ts.map +1 -1
  194. package/lib/esm/polyface/PolyfaceBuilder.js +48 -15
  195. package/lib/esm/polyface/PolyfaceBuilder.js.map +1 -1
  196. package/lib/esm/polyface/PolyfaceClip.d.ts +16 -7
  197. package/lib/esm/polyface/PolyfaceClip.d.ts.map +1 -1
  198. package/lib/esm/polyface/PolyfaceClip.js +38 -7
  199. package/lib/esm/polyface/PolyfaceClip.js.map +1 -1
  200. package/lib/esm/polyface/PolyfaceData.d.ts +5 -39
  201. package/lib/esm/polyface/PolyfaceData.d.ts.map +1 -1
  202. package/lib/esm/polyface/PolyfaceData.js +7 -41
  203. package/lib/esm/polyface/PolyfaceData.js.map +1 -1
  204. package/lib/esm/polyface/PolyfaceQuery.d.ts +10 -8
  205. package/lib/esm/polyface/PolyfaceQuery.d.ts.map +1 -1
  206. package/lib/esm/polyface/PolyfaceQuery.js +64 -18
  207. package/lib/esm/polyface/PolyfaceQuery.js.map +1 -1
  208. package/lib/esm/serialization/GeometrySamples.d.ts +6 -0
  209. package/lib/esm/serialization/GeometrySamples.d.ts.map +1 -1
  210. package/lib/esm/serialization/GeometrySamples.js +68 -2
  211. package/lib/esm/serialization/GeometrySamples.js.map +1 -1
  212. package/lib/esm/solid/SweepContour.d.ts +34 -25
  213. package/lib/esm/solid/SweepContour.d.ts.map +1 -1
  214. package/lib/esm/solid/SweepContour.js +84 -100
  215. package/lib/esm/solid/SweepContour.js.map +1 -1
  216. package/lib/esm/topology/Graph.d.ts +29 -11
  217. package/lib/esm/topology/Graph.d.ts.map +1 -1
  218. package/lib/esm/topology/Graph.js +45 -26
  219. package/lib/esm/topology/Graph.js.map +1 -1
  220. package/lib/esm/topology/HalfEdgeMarkSet.d.ts +2 -2
  221. package/lib/esm/topology/HalfEdgeMarkSet.d.ts.map +1 -1
  222. package/lib/esm/topology/HalfEdgeMarkSet.js +2 -2
  223. package/lib/esm/topology/HalfEdgeMarkSet.js.map +1 -1
  224. package/lib/esm/topology/Merging.d.ts +3 -0
  225. package/lib/esm/topology/Merging.d.ts.map +1 -1
  226. package/lib/esm/topology/Merging.js +19 -5
  227. package/lib/esm/topology/Merging.js.map +1 -1
  228. package/lib/esm/topology/Triangulation.d.ts +15 -7
  229. package/lib/esm/topology/Triangulation.d.ts.map +1 -1
  230. package/lib/esm/topology/Triangulation.js +89 -47
  231. package/lib/esm/topology/Triangulation.js.map +1 -1
  232. package/package.json +4 -4
@@ -9,7 +9,7 @@ import { IndexedPolyface } from "../polyface/Polyface";
9
9
  import { PolyfaceBuilder } from "../polyface/PolyfaceBuilder";
10
10
  import { MultiLineStringDataVariant } from "../topology/Triangulation";
11
11
  /**
12
- * Sweepable contour with Transform for local to world interaction.
12
+ * Sweepable planar contour with Transform for local to world interaction.
13
13
  * * The surface/solid classes `LinearSweep`, `RotationalSweep`, `RuledSweep` use this for their swept contours.
14
14
  * @public
15
15
  */
@@ -20,25 +20,30 @@ export declare class SweepContour {
20
20
  localToWorld: Transform;
21
21
  /** Axis used only in rotational case. */
22
22
  axis: Ray3d | undefined;
23
+ /** caches */
24
+ private _xyStrokes?;
25
+ private _facets?;
23
26
  private constructor();
24
27
  /** Create for linear sweep.
25
- * * The optional default normal may be useful for guiding coordinate frame setup.
26
- * * the contour is CAPTURED.
28
+ * @param contour curve to sweep, CAPTURED. For best results, contour should be planar.
29
+ * @param defaultNormal optional default normal for guiding coordinate frame setup.
27
30
  */
28
31
  static createForLinearSweep(contour: AnyCurve, defaultNormal?: Vector3d): SweepContour | undefined;
29
32
  /** Create for linear sweep.
30
- * * The optional default normal may be useful for guiding coordinate frame setup.
31
- * * the points are captured into linestrings and Loops as needed.
33
+ * @param points polygon to sweep, CAPTURED as a Loop. Closure point is optional. If multiple polygons are passed in, parity logic is employed.
34
+ * For best results, all points should be coplanar.
35
+ * @param defaultNormal optional default normal for guiding coordinate frame setup.
32
36
  */
33
37
  static createForPolygon(points: MultiLineStringDataVariant, defaultNormal?: Vector3d): SweepContour | undefined;
34
38
  /** Create for rotational sweep.
35
- * * The axis ray is retained.
36
- * * the contour is CAPTURED.
39
+ * @param contour curve to sweep, CAPTURED. For best results, contour should be planar.
40
+ * @param axis rotation axis
37
41
  */
38
42
  static createForRotation(contour: AnyCurve, axis: Ray3d): SweepContour | undefined;
39
43
  /** Return (Reference to) the curves */
40
44
  getCurves(): CurveCollection;
41
- /** Apply `transform` to the curves, axis.
45
+ /**
46
+ * Apply `transform` to the curves, axis.
42
47
  * * The local to world frame is reconstructed for the transformed curves.
43
48
  */
44
49
  tryTransformInPlace(transform: Transform): boolean;
@@ -46,17 +51,20 @@ export declare class SweepContour {
46
51
  clone(): SweepContour;
47
52
  /** Return a transformed clone. */
48
53
  cloneTransformed(transform: Transform): SweepContour | undefined;
49
- /** Test for near equality of cures and local frame. */
54
+ /** Test for near equality of curves, frame, and axis. */
50
55
  isAlmostEqual(other: any): boolean;
51
- private _xyStrokes?;
52
- private _facets?;
53
- get xyStrokes(): AnyCurve | undefined;
56
+ /** Recompute the local strokes cache for this contour */
57
+ computeXYStrokes(options?: StrokeOptions): void;
58
+ /** Return cached contour strokes */
59
+ get xyStrokes(): CurveCollection | undefined;
54
60
  /**
55
- * build the (cached) internal facets.
56
- * @param options options for stroking the curves.
61
+ * Build the (cached) internal facets for the contour.
62
+ * @param options primarily how to stroke the contour, but also how to facet it.
63
+ * * By default, a triangulation is computed, but if `options.maximizeConvexFacets === true`, edges between coplanar triangles are removed to return maximally convex facets.
57
64
  */
58
- buildFacets(options: StrokeOptions | undefined): void;
59
- /** delete existing facets.
65
+ buildFacets(options?: StrokeOptions): void;
66
+ /**
67
+ * Delete facet cache.
60
68
  * * This protects against PolyfaceBuilder reusing facets constructed with different options settings.
61
69
  */
62
70
  purgeFacets(): void;
@@ -66,17 +74,18 @@ export declare class SweepContour {
66
74
  emitFacets(builder: PolyfaceBuilder, reverse: boolean, transform?: Transform): void;
67
75
  /** Emit facets to a function
68
76
  * This method may cache and reuse facets over multiple calls.
77
+ * @param announce callback to receive the facet set
78
+ * @param options how to stroke the contour
69
79
  */
70
- announceFacets(announce: (facets: IndexedPolyface) => void, options: StrokeOptions | undefined): void;
80
+ announceFacets(announce: (facets: IndexedPolyface) => void, options?: StrokeOptions): void;
71
81
  /**
72
- * Triangulate the region.
73
- * Create a UnionOfConvexClipPlaneSets that clips to the swept region.
74
- * * If sweepVector is not given, the sweep direction is perpendicular to the plane of the contour.
75
- * * If sweepVector is given, it is the sweep direction and does not have to be perpendicular to the contour.
76
- * * cap0 and cap1 indicate construction of clip planes parallel to the contour plane.
77
- * * If cap1 is true, the cap plane is at `anyPointOnPlane + sweepVector`. That is, the sweep vector indicates both direction and distance.
78
- * * caps are NOT created of sweepVector is not given.
82
+ * Create a UnionOfConvexClipPlaneSets that clips to the swept faceted contour region.
83
+ * @param sweepVector the sweep direction (does not have to be perpendicular to the contour). If undefined, the sweep direction is perpendicular to the plane of the contour, and no caps are constructed.
84
+ * @param cap0 construct a clip plane equal to the contour plane. Note that `sweepVector` must be defined.
85
+ * @param cap1 construct a clip plane parallel to the contour plane at the end of `sweepVector`. That is, sweepVector indicates both direction and distance.
86
+ * @param options how to stroke the contour
87
+ * @returns clipper defined by faceting then sweeping the contour region
79
88
  */
80
- sweepToUnionOfConvexClipPlaneSets(sweepVector?: Vector3d, cap0?: boolean, cap1?: boolean): UnionOfConvexClipPlaneSets | undefined;
89
+ sweepToUnionOfConvexClipPlaneSets(sweepVector?: Vector3d, cap0?: boolean, cap1?: boolean, options?: StrokeOptions): UnionOfConvexClipPlaneSets | undefined;
81
90
  }
82
91
  //# sourceMappingURL=SweepContour.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"SweepContour.d.ts","sourceRoot":"","sources":["../../../src/solid/SweepContour.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,0BAA0B,EAAE,MAAM,wCAAwC,CAAC;AACpF,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAO3D,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAEvD,OAAO,EAAW,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AAElE,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAE9D,OAAO,EAAE,0BAA0B,EAAgB,MAAM,2BAA2B,CAAC;AAErF;;;;GAIG;AACH,qBAAa,YAAY;IACvB,0EAA0E;IACnE,MAAM,EAAE,eAAe,CAAC;IAC/B,yEAAyE;IAClE,YAAY,EAAE,SAAS,CAAC;IAC/B,yCAAyC;IAClC,IAAI,EAAE,KAAK,GAAG,SAAS,CAAC;IAE/B,OAAO;IAYP;;;OAGG;WACW,oBAAoB,CAAC,OAAO,EAAE,QAAQ,EAAE,aAAa,CAAC,EAAE,QA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AAI,YAAY;IAG5B,kCAAkC;IAC3B,gBAAgB,CAAC,SAAS,EAAE,SAAS,GAAG,YAAY,GAAG,SAAS;IAMvE,yDAAyD;IAClD,aAAa,CAAC,KAAK,EAAE,GAAG,GAAG,OAAO;IAezC,yDAAyD;IAClD,gBAAgB,CAAC,OAAO,CAAC,EAAE,aAAa,GAAG,IAAI;IAStD,oCAAoC;IACpC,IAAW,SAAS,IAAI,eAAe,GAAG,SAAS,CAElD;IAED;;;;OAIG;IACI,WAAW,CAAC,OAAO,CAAC,EAAE,aAAa,GAAG,IAAI;IAcjD;;;OAGG;IACI,WAAW;IAGlB;;OAEG;IACI,UAAU,CAAC,OAAO,EAAE,eAAe,EAAE,OAAO,EAAE,OAAO,EAAE,SAAS,CAAC,EAAE,SAAS;IAKnF;;;;OAIG;IACI,cAAc,CAAC,QAAQ,EAAE,CAAC,MAAM,EAAE,eAAe,KAAK,IAAI,EAAE,OAAO,CAAC,EAAE,aAAa,GAAG,IAAI;IAKjG;;;;;;;OAOG;IACI,iCAAiC,CAAC,WAAW,CAAC,EAAE,QAAQ,EAAE,IAAI,GAAE,OAAe,EAAE,IAAI,GAAE,OAAe,EAAE,OAAO,CAAC,EAAE,aAAa,GAAG,0BAA0B,GAAG,SAAS;CA8ChL"}
@@ -17,14 +17,11 @@ const Loop_1 = require("../curve/Loop");
17
17
  const ParityRegion_1 = require("../curve/ParityRegion");
18
18
  const Path_1 = require("../curve/Path");
19
19
  const RegionOps_1 = require("../curve/RegionOps");
20
+ const StrokeOptions_1 = require("../curve/StrokeOptions");
20
21
  const FrameBuilder_1 = require("../geometry3d/FrameBuilder");
21
22
  const Point3dVector3d_1 = require("../geometry3d/Point3dVector3d");
22
- const PolygonOps_1 = require("../geometry3d/PolygonOps");
23
- const PolyfaceBuilder_1 = require("../polyface/PolyfaceBuilder");
24
- const HalfEdgeGraphSearch_1 = require("../topology/HalfEdgeGraphSearch");
25
- const Triangulation_1 = require("../topology/Triangulation");
26
23
  /**
27
- * Sweepable contour with Transform for local to world interaction.
24
+ * Sweepable planar contour with Transform for local to world interaction.
28
25
  * * The surface/solid classes `LinearSweep`, `RotationalSweep`, `RuledSweep` use this for their swept contours.
29
26
  * @public
30
27
  */
@@ -33,6 +30,7 @@ class SweepContour {
33
30
  if (contour instanceof CurvePrimitive_1.CurvePrimitive) {
34
31
  // this.curves is a CurveCollection (not AnyCurve) so that contour type determines closure.
35
32
  // This is the only time we detect CurvePrimitive closure and wrap as a relevant CurveChain.
33
+ // Note that we are ASSUMING closure means planar here. This is potentially problematic.
36
34
  const primitive = contour;
37
35
  contour = contour.startPoint().isAlmostEqual(contour.endPoint()) ? new Loop_1.Loop() : new Path_1.Path();
38
36
  contour.tryAddChild(primitive);
@@ -42,8 +40,8 @@ class SweepContour {
42
40
  this.axis = axis;
43
41
  }
44
42
  /** Create for linear sweep.
45
- * * The optional default normal may be useful for guiding coordinate frame setup.
46
- * * the contour is CAPTURED.
43
+ * @param contour curve to sweep, CAPTURED. For best results, contour should be planar.
44
+ * @param defaultNormal optional default normal for guiding coordinate frame setup.
47
45
  */
48
46
  static createForLinearSweep(contour, defaultNormal) {
49
47
  const localToWorld = FrameBuilder_1.FrameBuilder.createRightHandedFrame(defaultNormal, contour);
@@ -53,8 +51,9 @@ class SweepContour {
53
51
  return undefined;
54
52
  }
55
53
  /** Create for linear sweep.
56
- * * The optional default normal may be useful for guiding coordinate frame setup.
57
- * * the points are captured into linestrings and Loops as needed.
54
+ * @param points polygon to sweep, CAPTURED as a Loop. Closure point is optional. If multiple polygons are passed in, parity logic is employed.
55
+ * For best results, all points should be coplanar.
56
+ * @param defaultNormal optional default normal for guiding coordinate frame setup.
58
57
  */
59
58
  static createForPolygon(points, defaultNormal) {
60
59
  const localToWorld = FrameBuilder_1.FrameBuilder.createRightHandedFrame(defaultNormal, points);
@@ -79,8 +78,8 @@ class SweepContour {
79
78
  return undefined;
80
79
  }
81
80
  /** Create for rotational sweep.
82
- * * The axis ray is retained.
83
- * * the contour is CAPTURED.
81
+ * @param contour curve to sweep, CAPTURED. For best results, contour should be planar.
82
+ * @param axis rotation axis
84
83
  */
85
84
  static createForRotation(contour, axis) {
86
85
  // createRightHandedFrame -- the axis is a last-gasp resolver for in-plane vectors.
@@ -92,7 +91,8 @@ class SweepContour {
92
91
  }
93
92
  /** Return (Reference to) the curves */
94
93
  getCurves() { return this.curves; }
95
- /** Apply `transform` to the curves, axis.
94
+ /**
95
+ * Apply `transform` to the curves, axis.
96
96
  * * The local to world frame is reconstructed for the transformed curves.
97
97
  */
98
98
  tryTransformInPlace(transform) {
@@ -104,6 +104,7 @@ class SweepContour {
104
104
  : FrameBuilder_1.FrameBuilder.createRightHandedFrame(undefined, this.curves);
105
105
  if (localToWorld) {
106
106
  this.localToWorld.setFrom(localToWorld);
107
+ this._xyStrokes = undefined;
107
108
  return true;
108
109
  }
109
110
  }
@@ -120,81 +121,57 @@ class SweepContour {
120
121
  return newContour;
121
122
  return undefined;
122
123
  }
123
- /** Test for near equality of cures and local frame. */
124
+ /** Test for near equality of curves, frame, and axis. */
124
125
  isAlmostEqual(other) {
125
- if (other instanceof SweepContour) {
126
- return this.curves.isAlmostEqual(other.curves) && this.localToWorld.isAlmostEqual(other.localToWorld);
126
+ if (!(other instanceof SweepContour))
127
+ return false;
128
+ if (!this.curves.isAlmostEqual(other.curves))
129
+ return false;
130
+ if (!this.localToWorld.isAlmostEqual(other.localToWorld))
131
+ return false;
132
+ if (this.axis && other.axis) {
133
+ if (!this.axis.isAlmostEqual(other.axis))
134
+ return false;
127
135
  }
128
- return false;
136
+ else if (this.axis || other.axis)
137
+ return false;
138
+ return true;
139
+ }
140
+ /** Recompute the local strokes cache for this contour */
141
+ computeXYStrokes(options) {
142
+ this._xyStrokes = undefined;
143
+ const worldToLocal = this.localToWorld.inverse();
144
+ if (worldToLocal) {
145
+ const strokes = this.curves.cloneStroked(options);
146
+ if (strokes.tryTransformInPlace(worldToLocal))
147
+ this._xyStrokes = strokes;
148
+ }
149
+ }
150
+ /** Return cached contour strokes */
151
+ get xyStrokes() {
152
+ return this._xyStrokes;
129
153
  }
130
- get xyStrokes() { return this._xyStrokes; }
131
154
  /**
132
- * build the (cached) internal facets.
133
- * @param options options for stroking the curves.
155
+ * Build the (cached) internal facets for the contour.
156
+ * @param options primarily how to stroke the contour, but also how to facet it.
157
+ * * By default, a triangulation is computed, but if `options.maximizeConvexFacets === true`, edges between coplanar triangles are removed to return maximally convex facets.
134
158
  */
135
159
  buildFacets(options) {
136
- if (!this._facets) {
137
- if (this.curves instanceof Loop_1.Loop) {
138
- this._xyStrokes = this.curves.cloneStroked(options);
139
- if (this._xyStrokes instanceof Loop_1.Loop && this._xyStrokes.children.length === 1) {
140
- const children = this._xyStrokes.children;
141
- const linestring = children[0];
142
- const points = linestring.points;
143
- this.localToWorld.multiplyInversePoint3dArrayInPlace(points);
144
- if (PolygonOps_1.PolygonOps.sumTriangleAreasXY(points) < 0)
145
- points.reverse();
146
- const graph = Triangulation_1.Triangulator.createTriangulatedGraphFromSingleLoop(points);
147
- if (graph) {
148
- Triangulation_1.Triangulator.flipTriangles(graph);
149
- const unflippedPoly = PolyfaceBuilder_1.PolyfaceBuilder.graphToPolyface(graph, options);
150
- this._facets = unflippedPoly;
151
- this._facets.tryTransformInPlace(this.localToWorld);
152
- }
153
- else { // earcut failed (e.g., on a split washer polygon, where the bridge edge is traversed twice)
154
- const polyface = RegionOps_1.RegionOps.polygonXYAreaUnionLoopsToPolyface(points, [], true);
155
- if (polyface) {
156
- this._facets = polyface;
157
- this._facets.tryTransformInPlace(this.localToWorld);
158
- }
159
- }
160
- }
161
- }
162
- else if (this.curves instanceof ParityRegion_1.ParityRegion) {
163
- this._xyStrokes = this.curves.cloneStroked(options);
164
- if (this._xyStrokes instanceof (ParityRegion_1.ParityRegion)) {
165
- const worldToLocal = this.localToWorld.inverse();
166
- this._xyStrokes.tryTransformInPlace(worldToLocal);
167
- const strokes = [];
168
- for (const childLoop of this._xyStrokes.children) {
169
- const loopCurves = childLoop.children;
170
- if (loopCurves.length === 1) {
171
- const c = loopCurves[0];
172
- if (c instanceof LineString3d_1.LineString3d)
173
- strokes.push(c.packedPoints);
174
- }
175
- }
176
- const numLoops = strokes.length;
177
- /** Try the earcut algorithm first -- lots less machinery, but can't handle any form of overlap */
178
- const graph = Triangulation_1.Triangulator.createTriangulatedGraphFromLoops(strokes);
179
- if (graph && HalfEdgeGraphSearch_1.HalfEdgeGraphSearch.isTriangulatedCCW(graph, true, numLoops - 1)) {
180
- Triangulation_1.Triangulator.flipTriangles(graph);
181
- const unflippedPoly = PolyfaceBuilder_1.PolyfaceBuilder.graphToPolyface(graph, options);
182
- this._facets = unflippedPoly;
183
- this._facets.tryTransformInPlace(this.localToWorld);
184
- }
185
- else {
186
- // earcut failed. Restart with full merge and parity analysis.
187
- const polyface = RegionOps_1.RegionOps.polygonXYAreaUnionLoopsToPolyface(strokes, [], true);
188
- if (polyface) {
189
- this._facets = polyface;
190
- this._facets.tryTransformInPlace(this.localToWorld);
191
- }
192
- }
193
- }
194
- }
195
- }
160
+ if (this._facets)
161
+ return;
162
+ if (!this.curves.isAnyRegion())
163
+ return;
164
+ const worldToLocal = this.localToWorld.inverse();
165
+ if (!worldToLocal)
166
+ return;
167
+ const localRegion = this.curves.cloneTransformed(worldToLocal);
168
+ if (!localRegion)
169
+ return;
170
+ if (this._facets = RegionOps_1.RegionOps.facetRegionXY(localRegion, options))
171
+ this._facets.tryTransformInPlace(this.localToWorld);
196
172
  }
197
- /** delete existing facets.
173
+ /**
174
+ * Delete facet cache.
198
175
  * * This protects against PolyfaceBuilder reusing facets constructed with different options settings.
199
176
  */
200
177
  purgeFacets() {
@@ -210,6 +187,8 @@ class SweepContour {
210
187
  }
211
188
  /** Emit facets to a function
212
189
  * This method may cache and reuse facets over multiple calls.
190
+ * @param announce callback to receive the facet set
191
+ * @param options how to stroke the contour
213
192
  */
214
193
  announceFacets(announce, options) {
215
194
  this.buildFacets(options);
@@ -217,31 +196,27 @@ class SweepContour {
217
196
  announce(this._facets);
218
197
  }
219
198
  /**
220
- * Triangulate the region.
221
- * Create a UnionOfConvexClipPlaneSets that clips to the swept region.
222
- * * If sweepVector is not given, the sweep direction is perpendicular to the plane of the contour.
223
- * * If sweepVector is given, it is the sweep direction and does not have to be perpendicular to the contour.
224
- * * cap0 and cap1 indicate construction of clip planes parallel to the contour plane.
225
- * * If cap1 is true, the cap plane is at `anyPointOnPlane + sweepVector`. That is, the sweep vector indicates both direction and distance.
226
- * * caps are NOT created of sweepVector is not given.
199
+ * Create a UnionOfConvexClipPlaneSets that clips to the swept faceted contour region.
200
+ * @param sweepVector the sweep direction (does not have to be perpendicular to the contour). If undefined, the sweep direction is perpendicular to the plane of the contour, and no caps are constructed.
201
+ * @param cap0 construct a clip plane equal to the contour plane. Note that `sweepVector` must be defined.
202
+ * @param cap1 construct a clip plane parallel to the contour plane at the end of `sweepVector`. That is, sweepVector indicates both direction and distance.
203
+ * @param options how to stroke the contour
204
+ * @returns clipper defined by faceting then sweeping the contour region
227
205
  */
228
- sweepToUnionOfConvexClipPlaneSets(sweepVector, cap0 = false, cap1 = false) {
229
- const builder = PolyfaceBuilder_1.PolyfaceBuilder.create();
230
- // It's a trip around the barn, but it's easy to make a polyface and scan it . . .
231
- if (!sweepVector)
206
+ sweepToUnionOfConvexClipPlaneSets(sweepVector, cap0 = false, cap1 = false, options) {
207
+ if (!options)
208
+ options = StrokeOptions_1.StrokeOptions.createForFacets();
209
+ if (!sweepVector) {
232
210
  cap0 = cap1 = false;
233
- this.buildFacets(builder.options);
234
- if (sweepVector === undefined)
235
211
  sweepVector = this.localToWorld.matrix.columnZ();
236
- const zVector = this.localToWorld.matrix.columnZ();
212
+ }
213
+ options.maximizeConvexFacets = true; // produce fewer ConvexClipPlaneSets
214
+ // It's a trip around the barn, but it's easy to make a polyface and scan it . . .
215
+ this.buildFacets(options);
237
216
  const facets = this._facets;
238
- const point0 = Point3dVector3d_1.Point3d.create();
239
- const point1 = Point3dVector3d_1.Point3d.create();
240
217
  if (facets) {
241
- const plane0Origin = this.localToWorld.getOrigin();
242
- const plane1Origin = plane0Origin.plus(sweepVector);
243
- const inwardNormal0 = zVector.clone();
244
- const inwardNormal1 = zVector.negate();
218
+ const point0 = Point3dVector3d_1.Point3d.create();
219
+ const point1 = Point3dVector3d_1.Point3d.create();
245
220
  const result = UnionOfConvexClipPlaneSets_1.UnionOfConvexClipPlaneSets.createEmpty();
246
221
  const visitor = facets.createVisitor(1);
247
222
  for (visitor.reset(); visitor.moveToNextFacet();) {
@@ -255,6 +230,15 @@ class SweepContour {
255
230
  plane?.setFlags(!visible, !visible);
256
231
  clipper.addPlaneToConvexSet(plane);
257
232
  }
233
+ result.addConvexSet(clipper);
234
+ }
235
+ if (cap0 || cap1) {
236
+ const zVector = this.localToWorld.matrix.columnZ();
237
+ const plane0Origin = this.localToWorld.getOrigin();
238
+ const plane1Origin = plane0Origin.plus(sweepVector);
239
+ const inwardNormal0 = zVector.clone();
240
+ const inwardNormal1 = zVector.negate();
241
+ const clipper = ConvexClipPlaneSet_1.ConvexClipPlaneSet.createEmpty();
258
242
  if (cap0)
259
243
  clipper.addPlaneToConvexSet(ClipPlane_1.ClipPlane.createNormalAndPoint(inwardNormal0, plane0Origin));
260
244
  if (cap1)
@@ -1 +1 @@
1
- {"version":3,"file":"SweepContour.js","sourceRoot":"","sources":["../../../src/solid/SweepContour.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F;;GAEG;AAEH,qDAAkD;AAClD,uEAAoE;AACpE,uFAAoF;AAGpF,4DAAyD;AACzD,wDAAqD;AACrD,wCAAqC;AACrC,wDAAqD;AACrD,wCAAqC;AACrC,kDAA+C;AAE/C,6DAA0D;AAC1D,mEAAkE;AAClE,yDAAsD;AAItD,iEAA8D;AAC9D,yEAAsE;AACtE,6DAAqF;AAErF;;;;GAIG;AACH,MAAa,YAAY;IAQvB,YAAoB,OAAiB,EAAE,GAAc,EAAE,IAAuB;QAC5E,IAAI,OAAO,YAAY,+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AAC,oBAAoB,CAAC,aAAa,EAAE,YAAY,CAAC,CAAC,CAAC;gBAC3F,IAAI,IAAI;oBACN,OAAO,CAAC,mBAAmB,CAAC,qBAAS,CAAC,oBAAoB,CAAC,aAAa,EAAE,YAAY,CAAC,CAAC,CAAC;gBAC3F,MAAM,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;aAC9B;YACD,OAAO,MAAM,CAAC;SACf;QACD,OAAO,SAAS,CAAC;IACnB,CAAC;CACF;AA1PD,oCA0PC","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 Solid\r\n */\r\n\r\nimport { ClipPlane } from \"../clipping/ClipPlane\";\r\nimport { ConvexClipPlaneSet } from \"../clipping/ConvexClipPlaneSet\";\r\nimport { UnionOfConvexClipPlaneSets } from \"../clipping/UnionOfConvexClipPlaneSets\";\r\nimport { AnyCurve } from \"../curve/CurveTypes\";\r\nimport { CurveCollection } from \"../curve/CurveCollection\";\r\nimport { CurvePrimitive } from \"../curve/CurvePrimitive\";\r\nimport { LineString3d } from \"../curve/LineString3d\";\r\nimport { Loop } from \"../curve/Loop\";\r\nimport { ParityRegion } from \"../curve/ParityRegion\";\r\nimport { Path } from \"../curve/Path\";\r\nimport { RegionOps } from \"../curve/RegionOps\";\r\nimport { StrokeOptions } from \"../curve/StrokeOptions\";\r\nimport { FrameBuilder } from \"../geometry3d/FrameBuilder\";\r\nimport { Point3d, Vector3d } from \"../geometry3d/Point3dVector3d\";\r\nimport { PolygonOps } from \"../geometry3d/PolygonOps\";\r\nimport { Ray3d } from \"../geometry3d/Ray3d\";\r\nimport { Transform } from \"../geometry3d/Transform\";\r\nimport { IndexedPolyface } from \"../polyface/Polyface\";\r\nimport { PolyfaceBuilder } from \"../polyface/PolyfaceBuilder\";\r\nimport { HalfEdgeGraphSearch } from \"../topology/HalfEdgeGraphSearch\";\r\nimport { MultiLineStringDataVariant, Triangulator } from \"../topology/Triangulation\";\r\n\r\n/**\r\n * Sweepable contour with Transform for local to world interaction.\r\n * * The surface/solid classes `LinearSweep`, `RotationalSweep`, `RuledSweep` use this for their swept contours.\r\n * @public\r\n */\r\nexport class SweepContour {\r\n /** The underlying curve collection, in its world coordinates position. */\r\n public curves: CurveCollection;\r\n /** coordinate frame that in which the curves are all in the xy plane. */\r\n public localToWorld: Transform;\r\n /** Axis used only in rotational case. */\r\n public axis: Ray3d | undefined;\r\n\r\n private constructor(contour: AnyCurve, map: Transform, axis: Ray3d | undefined) {\r\n if (contour instanceof CurvePrimitive) {\r\n // this.curves is a CurveCollection (not AnyCurve) so that contour type determines closure.\r\n // This is the only time we detect CurvePrimitive closure and wrap as a relevant CurveChain.\r\n const primitive = contour;\r\n contour = contour.startPoint().isAlmostEqual(contour.endPoint()) ? new Loop() : new Path();\r\n contour.tryAddChild(primitive);\r\n }\r\n this.curves = contour;\r\n this.localToWorld = map;\r\n this.axis = axis;\r\n }\r\n /** Create for linear sweep.\r\n * * The optional default normal may be useful for guiding coordinate frame setup.\r\n * * the contour is CAPTURED.\r\n */\r\n public static createForLinearSweep(contour: AnyCurve, defaultNormal?: Vector3d): SweepContour | undefined {\r\n const localToWorld = FrameBuilder.createRightHandedFrame(defaultNormal, contour);\r\n if (localToWorld) {\r\n return new SweepContour(contour, localToWorld, undefined);\r\n }\r\n return undefined;\r\n }\r\n\r\n /** Create for linear sweep.\r\n * * The optional default normal may be useful for guiding coordinate frame setup.\r\n * * the points are captured into linestrings and Loops as needed.\r\n */\r\n public static createForPolygon(points: MultiLineStringDataVariant, defaultNormal?: Vector3d): SweepContour | undefined {\r\n const localToWorld = FrameBuilder.createRightHandedFrame(defaultNormal, points);\r\n if (localToWorld) {\r\n if (defaultNormal !== undefined) {\r\n if (localToWorld.matrix.dotColumnZ(defaultNormal))\r\n localToWorld.matrix.scaleColumnsInPlace(1.0, -1.0, -1.0);\r\n }\r\n const linestrings = LineString3d.createArrayOfLineString3d(points);\r\n const loops = [];\r\n for (const ls of linestrings) {\r\n ls.addClosurePoint();\r\n loops.push(Loop.create(ls));\r\n }\r\n if (loops.length === 1) {\r\n return new SweepContour(loops[0], localToWorld, undefined);\r\n } else if (loops.length > 1) {\r\n return new SweepContour(ParityRegion.createLoops(loops), localToWorld, undefined);\r\n }\r\n }\r\n return undefined;\r\n }\r\n\r\n /** Create for rotational sweep.\r\n * * The axis ray is retained.\r\n * * the contour is CAPTURED.\r\n */\r\n public static createForRotation(contour: AnyCurve, axis: Ray3d): SweepContour | undefined {\r\n // createRightHandedFrame -- the axis is a last-gasp resolver for in-plane vectors.\r\n const localToWorld = FrameBuilder.createRightHandedFrame(undefined, contour, axis);\r\n if (localToWorld) {\r\n return new SweepContour(contour, localToWorld, axis.clone());\r\n }\r\n return undefined;\r\n }\r\n /** Return (Reference to) the curves */\r\n public getCurves(): CurveCollection { return this.curves; }\r\n /** Apply `transform` to the curves, axis.\r\n * * The local to world frame is reconstructed for the transformed curves.\r\n */\r\n public tryTransformInPlace(transform: Transform): boolean {\r\n if (this.curves.tryTransformInPlace(transform)) {\r\n if (this.axis)\r\n this.axis.transformInPlace(transform);\r\n\r\n const localToWorld = this.axis !== undefined\r\n ? FrameBuilder.createRightHandedFrame(undefined, this.curves, this.axis)\r\n : FrameBuilder.createRightHandedFrame(undefined, this.curves);\r\n if (localToWorld) {\r\n this.localToWorld.setFrom(localToWorld);\r\n return true;\r\n }\r\n }\r\n return false;\r\n }\r\n /** Return a deep clone. */\r\n public clone(): SweepContour {\r\n return new SweepContour(this.curves.clone(), this.localToWorld.clone(), this.axis);\r\n }\r\n /** Return a transformed clone. */\r\n public cloneTransformed(transform: Transform): SweepContour | undefined {\r\n const newContour = this.clone();\r\n if (newContour.tryTransformInPlace(transform))\r\n return newContour;\r\n return undefined;\r\n }\r\n /** Test for near equality of cures and local frame. */\r\n public isAlmostEqual(other: any): boolean {\r\n if (other instanceof SweepContour) {\r\n return this.curves.isAlmostEqual(other.curves) && this.localToWorld.isAlmostEqual(other.localToWorld);\r\n }\r\n return false;\r\n }\r\n\r\n private _xyStrokes?: AnyCurve;\r\n private _facets?: IndexedPolyface;\r\n public get xyStrokes(): AnyCurve | undefined { return this._xyStrokes; }\r\n /**\r\n * build the (cached) internal facets.\r\n * @param options options for stroking the curves.\r\n */\r\n public buildFacets(options: StrokeOptions | undefined): void {\r\n if (!this._facets) {\r\n if (this.curves instanceof Loop) {\r\n this._xyStrokes = this.curves.cloneStroked(options);\r\n if (this._xyStrokes instanceof Loop && this._xyStrokes.children.length === 1) {\r\n const children = this._xyStrokes.children;\r\n const linestring = children[0] as LineString3d;\r\n const points = linestring.points;\r\n this.localToWorld.multiplyInversePoint3dArrayInPlace(points);\r\n if (PolygonOps.sumTriangleAreasXY(points) < 0)\r\n points.reverse();\r\n const graph = Triangulator.createTriangulatedGraphFromSingleLoop(points);\r\n if (graph) {\r\n Triangulator.flipTriangles(graph);\r\n const unflippedPoly = PolyfaceBuilder.graphToPolyface(graph, options);\r\n this._facets = unflippedPoly;\r\n this._facets.tryTransformInPlace(this.localToWorld);\r\n } else { // earcut failed (e.g., on a split washer polygon, where the bridge edge is traversed twice)\r\n const polyface = RegionOps.polygonXYAreaUnionLoopsToPolyface(points, [], true);\r\n if (polyface) {\r\n this._facets = polyface as IndexedPolyface;\r\n this._facets.tryTransformInPlace(this.localToWorld);\r\n }\r\n }\r\n }\r\n } else if (this.curves instanceof ParityRegion) {\r\n this._xyStrokes = this.curves.cloneStroked(options);\r\n if (this._xyStrokes instanceof (ParityRegion)) {\r\n const worldToLocal = this.localToWorld.inverse()!;\r\n this._xyStrokes.tryTransformInPlace(worldToLocal);\r\n const strokes = [];\r\n for (const childLoop of this._xyStrokes.children) {\r\n const loopCurves = childLoop.children;\r\n if (loopCurves.length === 1) {\r\n const c = loopCurves[0];\r\n if (c instanceof LineString3d)\r\n strokes.push(c.packedPoints);\r\n }\r\n }\r\n const numLoops = strokes.length;\r\n /** Try the earcut algorithm first -- lots less machinery, but can't handle any form of overlap */\r\n const graph = Triangulator.createTriangulatedGraphFromLoops(strokes);\r\n if (graph && HalfEdgeGraphSearch.isTriangulatedCCW(graph, true, numLoops - 1)) {\r\n Triangulator.flipTriangles(graph);\r\n const unflippedPoly = PolyfaceBuilder.graphToPolyface(graph, options);\r\n this._facets = unflippedPoly;\r\n this._facets.tryTransformInPlace(this.localToWorld);\r\n } else {\r\n // earcut failed. Restart with full merge and parity analysis.\r\n const polyface = RegionOps.polygonXYAreaUnionLoopsToPolyface(strokes, [], true);\r\n if (polyface) {\r\n this._facets = polyface as IndexedPolyface;\r\n this._facets.tryTransformInPlace(this.localToWorld);\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n /** delete existing facets.\r\n * * This protects against PolyfaceBuilder reusing facets constructed with different options settings.\r\n */\r\n public purgeFacets() {\r\n this._facets = undefined;\r\n }\r\n\r\n /** Emit facets to a builder.\r\n * This method may cache and reuse facets over multiple calls.\r\n */\r\n public emitFacets(builder: PolyfaceBuilder, reverse: boolean, transform?: Transform) {\r\n this.buildFacets(builder.options);\r\n if (this._facets)\r\n builder.addIndexedPolyface(this._facets, reverse, transform);\r\n }\r\n\r\n /** Emit facets to a function\r\n * This method may cache and reuse facets over multiple calls.\r\n */\r\n public announceFacets(announce: (facets: IndexedPolyface) => void, options: StrokeOptions | undefined) {\r\n this.buildFacets(options);\r\n if (this._facets)\r\n announce(this._facets);\r\n }\r\n\r\n /**\r\n * Triangulate the region.\r\n * Create a UnionOfConvexClipPlaneSets that clips to the swept region.\r\n * * If sweepVector is not given, the sweep direction is perpendicular to the plane of the contour.\r\n * * If sweepVector is given, it is the sweep direction and does not have to be perpendicular to the contour.\r\n * * cap0 and cap1 indicate construction of clip planes parallel to the contour plane.\r\n * * If cap1 is true, the cap plane is at `anyPointOnPlane + sweepVector`. That is, the sweep vector indicates both direction and distance.\r\n * * caps are NOT created of sweepVector is not given.\r\n */\r\n public sweepToUnionOfConvexClipPlaneSets(sweepVector?: Vector3d, cap0: boolean = false, cap1: boolean = false): UnionOfConvexClipPlaneSets | undefined {\r\n const builder = PolyfaceBuilder.create();\r\n // It's a trip around the barn, but it's easy to make a polyface and scan it . . .\r\n if (!sweepVector)\r\n cap0 = cap1 = false;\r\n this.buildFacets(builder.options);\r\n if (sweepVector === undefined)\r\n sweepVector = this.localToWorld.matrix.columnZ();\r\n const zVector = this.localToWorld.matrix.columnZ();\r\n const facets = this._facets;\r\n const point0 = Point3d.create();\r\n const point1 = Point3d.create();\r\n if (facets) {\r\n const plane0Origin = this.localToWorld.getOrigin();\r\n const plane1Origin = plane0Origin.plus(sweepVector);\r\n const inwardNormal0 = zVector.clone();\r\n const inwardNormal1 = zVector.negate();\r\n\r\n const result = UnionOfConvexClipPlaneSets.createEmpty();\r\n const visitor = facets.createVisitor(1);\r\n for (visitor.reset(); visitor.moveToNextFacet();) {\r\n const numEdges = visitor.point.length - 1;\r\n const clipper = ConvexClipPlaneSet.createEmpty();\r\n for (let i = 0; i < numEdges; i++) {\r\n visitor.point.getPoint3dAtUncheckedPointIndex(i, point0);\r\n visitor.point.getPoint3dAtUncheckedPointIndex(i + 1, point1);\r\n const plane = ClipPlane.createEdgeAndUpVector(point1, point0, sweepVector);\r\n const visible = visitor.edgeVisible[i];\r\n plane?.setFlags(!visible, !visible);\r\n clipper.addPlaneToConvexSet(plane);\r\n }\r\n if (cap0)\r\n clipper.addPlaneToConvexSet(ClipPlane.createNormalAndPoint(inwardNormal0, plane0Origin));\r\n if (cap1)\r\n clipper.addPlaneToConvexSet(ClipPlane.createNormalAndPoint(inwardNormal1, plane1Origin));\r\n result.addConvexSet(clipper);\r\n }\r\n return result;\r\n }\r\n return undefined;\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"SweepContour.js","sourceRoot":"","sources":["../../../src/solid/SweepContour.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F;;GAEG;AAEH,q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AAG,OAAO,CAAC,KAAK,EAAE,CAAC;gBACtC,MAAM,aAAa,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;gBACvC,MAAM,OAAO,GAAG,uCAAkB,CAAC,WAAW,EAAE,CAAC;gBACjD,IAAI,IAAI;oBACN,OAAO,CAAC,mBAAmB,CAAC,qBAAS,CAAC,oBAAoB,CAAC,aAAa,EAAE,YAAY,CAAC,CAAC,CAAC;gBAC3F,IAAI,IAAI;oBACN,OAAO,CAAC,mBAAmB,CAAC,qBAAS,CAAC,oBAAoB,CAAC,aAAa,EAAE,YAAY,CAAC,CAAC,CAAC;gBAC3F,MAAM,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;aAC9B;YACD,OAAO,MAAM,CAAC;SACf;QACD,OAAO,SAAS,CAAC;IACnB,CAAC;CACF;AA5OD,oCA4OC","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 Solid\r\n */\r\n\r\nimport { ClipPlane } from \"../clipping/ClipPlane\";\r\nimport { ConvexClipPlaneSet } from \"../clipping/ConvexClipPlaneSet\";\r\nimport { UnionOfConvexClipPlaneSets } from \"../clipping/UnionOfConvexClipPlaneSets\";\r\nimport { AnyCurve, AnyRegion } from \"../curve/CurveTypes\";\r\nimport { CurveCollection } from \"../curve/CurveCollection\";\r\nimport { CurvePrimitive } from \"../curve/CurvePrimitive\";\r\nimport { LineString3d } from \"../curve/LineString3d\";\r\nimport { Loop } from \"../curve/Loop\";\r\nimport { ParityRegion } from \"../curve/ParityRegion\";\r\nimport { Path } from \"../curve/Path\";\r\nimport { RegionOps } from \"../curve/RegionOps\";\r\nimport { StrokeOptions } from \"../curve/StrokeOptions\";\r\nimport { FrameBuilder } from \"../geometry3d/FrameBuilder\";\r\nimport { Point3d, Vector3d } from \"../geometry3d/Point3dVector3d\";\r\nimport { Ray3d } from \"../geometry3d/Ray3d\";\r\nimport { Transform } from \"../geometry3d/Transform\";\r\nimport { IndexedPolyface } from \"../polyface/Polyface\";\r\nimport { PolyfaceBuilder } from \"../polyface/PolyfaceBuilder\";\r\nimport { MultiLineStringDataVariant } from \"../topology/Triangulation\";\r\n\r\n/**\r\n * Sweepable planar contour with Transform for local to world interaction.\r\n * * The surface/solid classes `LinearSweep`, `RotationalSweep`, `RuledSweep` use this for their swept contours.\r\n * @public\r\n */\r\nexport class SweepContour {\r\n /** The underlying curve collection, in its world coordinates position. */\r\n public curves: CurveCollection;\r\n /** coordinate frame that in which the curves are all in the xy plane. */\r\n public localToWorld: Transform;\r\n /** Axis used only in rotational case. */\r\n public axis: Ray3d | undefined;\r\n\r\n /** caches */\r\n private _xyStrokes?: CurveCollection;\r\n private _facets?: IndexedPolyface;\r\n\r\n private constructor(contour: AnyCurve, map: Transform, axis: Ray3d | undefined) {\r\n if (contour instanceof CurvePrimitive) {\r\n // this.curves is a CurveCollection (not AnyCurve) so that contour type determines closure.\r\n // This is the only time we detect CurvePrimitive closure and wrap as a relevant CurveChain.\r\n // Note that we are ASSUMING closure means planar here. This is potentially problematic.\r\n const primitive = contour;\r\n contour = contour.startPoint().isAlmostEqual(contour.endPoint()) ? new Loop() : new Path();\r\n contour.tryAddChild(primitive);\r\n }\r\n this.curves = contour;\r\n this.localToWorld = map;\r\n this.axis = axis;\r\n }\r\n /** Create for linear sweep.\r\n * @param contour curve to sweep, CAPTURED. For best results, contour should be planar.\r\n * @param defaultNormal optional default normal for guiding coordinate frame setup.\r\n */\r\n public static createForLinearSweep(contour: AnyCurve, defaultNormal?: Vector3d): SweepContour | undefined {\r\n const localToWorld = FrameBuilder.createRightHandedFrame(defaultNormal, contour);\r\n if (localToWorld) {\r\n return new SweepContour(contour, localToWorld, undefined);\r\n }\r\n return undefined;\r\n }\r\n /** Create for linear sweep.\r\n * @param points polygon to sweep, CAPTURED as a Loop. Closure point is optional. If multiple polygons are passed in, parity logic is employed.\r\n * For best results, all points should be coplanar.\r\n * @param defaultNormal optional default normal for guiding coordinate frame setup.\r\n */\r\n public static createForPolygon(points: MultiLineStringDataVariant, defaultNormal?: Vector3d): SweepContour | undefined {\r\n const localToWorld = FrameBuilder.createRightHandedFrame(defaultNormal, points);\r\n if (localToWorld) {\r\n if (defaultNormal !== undefined) {\r\n if (localToWorld.matrix.dotColumnZ(defaultNormal))\r\n localToWorld.matrix.scaleColumnsInPlace(1.0, -1.0, -1.0);\r\n }\r\n const linestrings = LineString3d.createArrayOfLineString3d(points);\r\n const loops = [];\r\n for (const ls of linestrings) {\r\n ls.addClosurePoint();\r\n loops.push(Loop.create(ls));\r\n }\r\n if (loops.length === 1) {\r\n return new SweepContour(loops[0], localToWorld, undefined);\r\n } else if (loops.length > 1) {\r\n return new SweepContour(ParityRegion.createLoops(loops), localToWorld, undefined);\r\n }\r\n }\r\n return undefined;\r\n }\r\n /** Create for rotational sweep.\r\n * @param contour curve to sweep, CAPTURED. For best results, contour should be planar.\r\n * @param axis rotation axis\r\n */\r\n public static createForRotation(contour: AnyCurve, axis: Ray3d): SweepContour | undefined {\r\n // createRightHandedFrame -- the axis is a last-gasp resolver for in-plane vectors.\r\n const localToWorld = FrameBuilder.createRightHandedFrame(undefined, contour, axis);\r\n if (localToWorld) {\r\n return new SweepContour(contour, localToWorld, axis.clone());\r\n }\r\n return undefined;\r\n }\r\n /** Return (Reference to) the curves */\r\n public getCurves(): CurveCollection { return this.curves; }\r\n /**\r\n * Apply `transform` to the curves, axis.\r\n * * The local to world frame is reconstructed for the transformed curves.\r\n */\r\n public tryTransformInPlace(transform: Transform): boolean {\r\n if (this.curves.tryTransformInPlace(transform)) {\r\n if (this.axis)\r\n this.axis.transformInPlace(transform);\r\n\r\n const localToWorld = this.axis !== undefined\r\n ? FrameBuilder.createRightHandedFrame(undefined, this.curves, this.axis)\r\n : FrameBuilder.createRightHandedFrame(undefined, this.curves);\r\n if (localToWorld) {\r\n this.localToWorld.setFrom(localToWorld);\r\n this._xyStrokes = undefined;\r\n return true;\r\n }\r\n }\r\n return false;\r\n }\r\n /** Return a deep clone. */\r\n public clone(): SweepContour {\r\n return new SweepContour(this.curves.clone(), this.localToWorld.clone(), this.axis);\r\n }\r\n /** Return a transformed clone. */\r\n public cloneTransformed(transform: Transform): SweepContour | undefined {\r\n const newContour = this.clone();\r\n if (newContour.tryTransformInPlace(transform))\r\n return newContour;\r\n return undefined;\r\n }\r\n /** Test for near equality of curves, frame, and axis. */\r\n public isAlmostEqual(other: any): boolean {\r\n if (! (other instanceof SweepContour))\r\n return false;\r\n if (!this.curves.isAlmostEqual(other.curves))\r\n return false;\r\n if (!this.localToWorld.isAlmostEqual(other.localToWorld))\r\n return false;\r\n if (this.axis && other.axis) {\r\n if (!this.axis.isAlmostEqual(other.axis))\r\n return false;\r\n } else if (this.axis || other.axis)\r\n return false;\r\n return true;\r\n }\r\n\r\n /** Recompute the local strokes cache for this contour */\r\n public computeXYStrokes(options?: StrokeOptions): void {\r\n this._xyStrokes = undefined;\r\n const worldToLocal = this.localToWorld.inverse();\r\n if (worldToLocal) {\r\n const strokes = this.curves.cloneStroked(options);\r\n if (strokes.tryTransformInPlace(worldToLocal))\r\n this._xyStrokes = strokes;\r\n }\r\n }\r\n /** Return cached contour strokes */\r\n public get xyStrokes(): CurveCollection | undefined {\r\n return this._xyStrokes;\r\n }\r\n\r\n /**\r\n * Build the (cached) internal facets for the contour.\r\n * @param options primarily how to stroke the contour, but also how to facet it.\r\n * * By default, a triangulation is computed, but if `options.maximizeConvexFacets === true`, edges between coplanar triangles are removed to return maximally convex facets.\r\n */\r\n public buildFacets(options?: StrokeOptions): void {\r\n if (this._facets)\r\n return;\r\n if (!this.curves.isAnyRegion())\r\n return;\r\n const worldToLocal = this.localToWorld.inverse();\r\n if (!worldToLocal)\r\n return;\r\n const localRegion = this.curves.cloneTransformed(worldToLocal) as AnyRegion | undefined;\r\n if (!localRegion)\r\n return;\r\n if (this._facets = RegionOps.facetRegionXY(localRegion, options))\r\n this._facets.tryTransformInPlace(this.localToWorld);\r\n }\r\n /**\r\n * Delete facet cache.\r\n * * This protects against PolyfaceBuilder reusing facets constructed with different options settings.\r\n */\r\n public purgeFacets() {\r\n this._facets = undefined;\r\n }\r\n /** Emit facets to a builder.\r\n * This method may cache and reuse facets over multiple calls.\r\n */\r\n public emitFacets(builder: PolyfaceBuilder, reverse: boolean, transform?: Transform) {\r\n this.buildFacets(builder.options);\r\n if (this._facets)\r\n builder.addIndexedPolyface(this._facets, reverse, transform);\r\n }\r\n /** Emit facets to a function\r\n * This method may cache and reuse facets over multiple calls.\r\n * @param announce callback to receive the facet set\r\n * @param options how to stroke the contour\r\n */\r\n public announceFacets(announce: (facets: IndexedPolyface) => void, options?: StrokeOptions): void {\r\n this.buildFacets(options);\r\n if (this._facets)\r\n announce(this._facets);\r\n }\r\n /**\r\n * Create a UnionOfConvexClipPlaneSets that clips to the swept faceted contour region.\r\n * @param sweepVector the sweep direction (does not have to be perpendicular to the contour). If undefined, the sweep direction is perpendicular to the plane of the contour, and no caps are constructed.\r\n * @param cap0 construct a clip plane equal to the contour plane. Note that `sweepVector` must be defined.\r\n * @param cap1 construct a clip plane parallel to the contour plane at the end of `sweepVector`. That is, sweepVector indicates both direction and distance.\r\n * @param options how to stroke the contour\r\n * @returns clipper defined by faceting then sweeping the contour region\r\n */\r\n public sweepToUnionOfConvexClipPlaneSets(sweepVector?: Vector3d, cap0: boolean = false, cap1: boolean = false, options?: StrokeOptions): UnionOfConvexClipPlaneSets | undefined {\r\n if (!options)\r\n options = StrokeOptions.createForFacets();\r\n if (!sweepVector) {\r\n cap0 = cap1 = false;\r\n sweepVector = this.localToWorld.matrix.columnZ();\r\n }\r\n options.maximizeConvexFacets = true; // produce fewer ConvexClipPlaneSets\r\n // It's a trip around the barn, but it's easy to make a polyface and scan it . . .\r\n this.buildFacets(options);\r\n const facets = this._facets;\r\n if (facets) {\r\n const point0 = Point3d.create();\r\n const point1 = Point3d.create();\r\n const result = UnionOfConvexClipPlaneSets.createEmpty();\r\n const visitor = facets.createVisitor(1);\r\n for (visitor.reset(); visitor.moveToNextFacet();) {\r\n const numEdges = visitor.point.length - 1;\r\n const clipper = ConvexClipPlaneSet.createEmpty();\r\n for (let i = 0; i < numEdges; i++) {\r\n visitor.point.getPoint3dAtUncheckedPointIndex(i, point0);\r\n visitor.point.getPoint3dAtUncheckedPointIndex(i + 1, point1);\r\n const plane = ClipPlane.createEdgeAndUpVector(point1, point0, sweepVector);\r\n const visible = visitor.edgeVisible[i];\r\n plane?.setFlags(!visible, !visible);\r\n clipper.addPlaneToConvexSet(plane);\r\n }\r\n result.addConvexSet(clipper);\r\n }\r\n if (cap0 || cap1) {\r\n const zVector = this.localToWorld.matrix.columnZ();\r\n const plane0Origin = this.localToWorld.getOrigin();\r\n const plane1Origin = plane0Origin.plus(sweepVector);\r\n const inwardNormal0 = zVector.clone();\r\n const inwardNormal1 = zVector.negate();\r\n const clipper = ConvexClipPlaneSet.createEmpty();\r\n if (cap0)\r\n clipper.addPlaneToConvexSet(ClipPlane.createNormalAndPoint(inwardNormal0, plane0Origin));\r\n if (cap1)\r\n clipper.addPlaneToConvexSet(ClipPlane.createNormalAndPoint(inwardNormal1, plane1Origin));\r\n result.addConvexSet(clipper);\r\n }\r\n return result;\r\n }\r\n return undefined;\r\n }\r\n}\r\n"]}
@@ -253,8 +253,8 @@ export declare class HalfEdge implements HalfEdgeUserData {
253
253
  */
254
254
  setMaskAroundEdge(mask: HalfEdgeMask): void;
255
255
  /**
256
- * Apply a mask to both sides of an edge.
257
- * @param mask mask to apply to this edge and its `edgeMate`
256
+ * Clear a mask on both sides of an edge.
257
+ * @param mask mask to clear on this edge and its `edgeMate`
258
258
  */
259
259
  clearMaskAroundEdge(mask: HalfEdgeMask): void;
260
260
  /** Returns the number of edges around this face. */
@@ -382,17 +382,34 @@ export declare class HalfEdge implements HalfEdgeUserData {
382
382
  */
383
383
  static crossProductXYAlongChain(nodeA: HalfEdge, nodeB: HalfEdge, nodeC: HalfEdge): number;
384
384
  /**
385
- * @return whether the sector represented by the 2D vectors from nodeA to nodeB and nodeB to nodeC is convex.
385
+ * Compute whether the sector defined by the chain of nodes is convex.
386
+ * * This computation ignores z-coordinates and connectivity, so the nodes are not required to be in the same face loop.
387
+ * @param nodeA the first node in the chain, nominally the face predecessor of nodeB
388
+ * @param nodeB the second node in the chain; the node at the sector vertex
389
+ * @param nodeC the third node in the chain, nominally the face successor of nodeB
390
+ * @param signedAreaTol optional signed area tolerance to use in test for parallel vectors.
391
+ * Typically this is a fraction of the sector's face's signed area. We can't compute area here, so if undefined, zero tolerance is used.
392
+ * @returns true iff the sector is convex
386
393
  */
387
- static isSectorConvex(nodeA: HalfEdge, nodeB: HalfEdge, nodeC: HalfEdge): boolean;
394
+ static isSectorConvex(nodeA: HalfEdge, nodeB: HalfEdge, nodeC: HalfEdge, signedAreaTol?: number): boolean;
388
395
  /**
389
- * @return whether the sector of the face is convex.
396
+ * Compute whether the sector at this node is convex.
397
+ * * This computation ignores z-coordinates.
398
+ * @param signedAreaTol optional signed area tolerance to use in test for parallel vectors.
399
+ * If undefined, a fraction ([[Geometry.smallMetricDistanceSquared]]) of the computed signed area is used.
400
+ * Pass zero to skip toleranced computation.
401
+ * @returns true iff the sector is convex and its two edges are not antiparallel.
390
402
  */
391
- isSectorConvex(): boolean;
403
+ isSectorConvex(signedAreaTol?: number): boolean;
392
404
  /**
393
- * @return whether the face is convex.
405
+ * Compute whether this face is convex.
406
+ * * This computation ignores z-coordinates.
407
+ * @param tolerance optional relative tolerance to use in test for parallel vectors.
408
+ * Default value is [[Geometry.smallMetricDistanceSquared]].
409
+ * Pass zero to skip toleranced computation.
410
+ * @returns true iff this face is convex.
394
411
  */
395
- isFaceConvex(): boolean;
412
+ isFaceConvex(tolerance?: number): boolean;
396
413
  /**
397
414
  * Isolate the edge from the graph by yanking each end from its vertex loop.
398
415
  */
@@ -405,7 +422,7 @@ export declare class HalfEdge implements HalfEdgeUserData {
405
422
  belowYX(other: HalfEdge): boolean;
406
423
  /** Returns Returns true if the node does NOT have Mask.EXTERIOR_MASK set. */
407
424
  static testNodeMaskNotExterior(node: HalfEdge): boolean;
408
- /** Returns Returns true if the node does NOT have Mask.EXTERIOR_MASK set. */
425
+ /** Returns Returns true if the edge mate has Mask.EXTERIOR_MASK set. */
409
426
  static testMateMaskExterior(node: HalfEdge): boolean;
410
427
  /** Returns radians between this edge and its face predecessor edge, using all three coordinates x,y,z and given normal to resolve sweep direction.
411
428
  * * The returned angle is positive, i.e. may be larger than PI radians.
@@ -459,10 +476,11 @@ export declare class HalfEdge implements HalfEdgeUserData {
459
476
  clearMaskAroundFace(mask: HalfEdgeMask): void;
460
477
  /** For all the nodes in the vertex loop of the given node, clear out the mask given */
461
478
  clearMaskAroundVertex(mask: HalfEdgeMask): void;
462
- /** Returns the signed sum of xy areas of triangles from first node to edges.
463
- *
479
+ /**
480
+ * Compute the signed sum of xy areas of triangles from first node to edges.
464
481
  * * A positive area is counterclockwise.
465
482
  * * A negative area is clockwise.
483
+ * @returns signed area of this node's face
466
484
  */
467
485
  signedFaceArea(): number;
468
486
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"Graph.d.ts","sourceRoot":"","sources":["../../../src/topology/Graph.ts"],"names":[],"mappings":"AAKA;;GAEG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAGvD,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AASvD;;;;;;;;;;GAUG;AACH,oBAAY,YAAY;IACtB;;;;OAIG;IACH,QAAQ,IAAa;IACrB;;;OAGG;IACH,aAAa,IAAa;IAS1B;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