@itwin/core-geometry 5.0.0-dev.3 → 5.0.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 (664) hide show
  1. package/CHANGELOG.md +19 -1
  2. package/lib/cjs/Constant.js.map +1 -1
  3. package/lib/cjs/Geometry.js.map +1 -1
  4. package/lib/cjs/bspline/AkimaCurve3d.js.map +1 -1
  5. package/lib/cjs/bspline/BSpline1dNd.js.map +1 -1
  6. package/lib/cjs/bspline/BSplineCurve.js.map +1 -1
  7. package/lib/cjs/bspline/BSplineCurve3dH.js.map +1 -1
  8. package/lib/cjs/bspline/BSplineCurveOps.d.ts.map +1 -1
  9. package/lib/cjs/bspline/BSplineCurveOps.js +18 -21
  10. package/lib/cjs/bspline/BSplineCurveOps.js.map +1 -1
  11. package/lib/cjs/bspline/BSplineSurface.js.map +1 -1
  12. package/lib/cjs/bspline/Bezier1dNd.js.map +1 -1
  13. package/lib/cjs/bspline/BezierCurve3d.js.map +1 -1
  14. package/lib/cjs/bspline/BezierCurve3dH.js.map +1 -1
  15. package/lib/cjs/bspline/BezierCurveBase.d.ts.map +1 -1
  16. package/lib/cjs/bspline/BezierCurveBase.js.map +1 -1
  17. package/lib/cjs/bspline/InterpolationCurve3d.js.map +1 -1
  18. package/lib/cjs/bspline/KnotVector.js.map +1 -1
  19. package/lib/cjs/bspline/SurfaceLocationDetail.js.map +1 -1
  20. package/lib/cjs/clipping/AlternatingConvexClipTree.js.map +1 -1
  21. package/lib/cjs/clipping/BooleanClipFactory.js.map +1 -1
  22. package/lib/cjs/clipping/BooleanClipNode.js.map +1 -1
  23. package/lib/cjs/clipping/ClipPlane.js.map +1 -1
  24. package/lib/cjs/clipping/ClipPrimitive.js.map +1 -1
  25. package/lib/cjs/clipping/ClipUtils.js.map +1 -1
  26. package/lib/cjs/clipping/ClipVector.js.map +1 -1
  27. package/lib/cjs/clipping/ConvexClipPlaneSet.js.map +1 -1
  28. package/lib/cjs/clipping/UnionOfConvexClipPlaneSets.js.map +1 -1
  29. package/lib/cjs/clipping/internalContexts/LineStringOffsetClipperContext.js.map +1 -1
  30. package/lib/cjs/core-geometry.js.map +1 -1
  31. package/lib/cjs/curve/Arc3d.d.ts +40 -8
  32. package/lib/cjs/curve/Arc3d.d.ts.map +1 -1
  33. package/lib/cjs/curve/Arc3d.js +66 -8
  34. package/lib/cjs/curve/Arc3d.js.map +1 -1
  35. package/lib/cjs/curve/ConstructCurveBetweenCurves.js.map +1 -1
  36. package/lib/cjs/curve/CoordinateXYZ.js.map +1 -1
  37. package/lib/cjs/curve/CurveChainWithDistanceIndex.js.map +1 -1
  38. package/lib/cjs/curve/CurveCollection.d.ts +16 -2
  39. package/lib/cjs/curve/CurveCollection.d.ts.map +1 -1
  40. package/lib/cjs/curve/CurveCollection.js +33 -2
  41. package/lib/cjs/curve/CurveCollection.js.map +1 -1
  42. package/lib/cjs/curve/CurveCurve.js.map +1 -1
  43. package/lib/cjs/curve/CurveExtendMode.js.map +1 -1
  44. package/lib/cjs/curve/CurveFactory.d.ts +87 -53
  45. package/lib/cjs/curve/CurveFactory.d.ts.map +1 -1
  46. package/lib/cjs/curve/CurveFactory.js +213 -135
  47. package/lib/cjs/curve/CurveFactory.js.map +1 -1
  48. package/lib/cjs/curve/CurveLocationDetail.js.map +1 -1
  49. package/lib/cjs/curve/CurveOps.js.map +1 -1
  50. package/lib/cjs/curve/CurvePrimitive.js.map +1 -1
  51. package/lib/cjs/curve/CurveProcessor.js.map +1 -1
  52. package/lib/cjs/curve/CurveTypes.js.map +1 -1
  53. package/lib/cjs/curve/CurveWireMomentsXYZ.js.map +1 -1
  54. package/lib/cjs/curve/GeometryQuery.js.map +1 -1
  55. package/lib/cjs/curve/LineSegment3d.js.map +1 -1
  56. package/lib/cjs/curve/LineString3d.d.ts +12 -8
  57. package/lib/cjs/curve/LineString3d.d.ts.map +1 -1
  58. package/lib/cjs/curve/LineString3d.js +29 -8
  59. package/lib/cjs/curve/LineString3d.js.map +1 -1
  60. package/lib/cjs/curve/Loop.d.ts +12 -6
  61. package/lib/cjs/curve/Loop.d.ts.map +1 -1
  62. package/lib/cjs/curve/Loop.js +12 -6
  63. package/lib/cjs/curve/Loop.js.map +1 -1
  64. package/lib/cjs/curve/OffsetOptions.js.map +1 -1
  65. package/lib/cjs/curve/ParityRegion.js.map +1 -1
  66. package/lib/cjs/curve/Path.js.map +1 -1
  67. package/lib/cjs/curve/PointString3d.js.map +1 -1
  68. package/lib/cjs/curve/ProxyCurve.js.map +1 -1
  69. package/lib/cjs/curve/Query/ConsolidateAdjacentPrimitivesContext.js.map +1 -1
  70. package/lib/cjs/curve/Query/CurveSplitContext.js.map +1 -1
  71. package/lib/cjs/curve/Query/CylindricalRange.d.ts +8 -6
  72. package/lib/cjs/curve/Query/CylindricalRange.d.ts.map +1 -1
  73. package/lib/cjs/curve/Query/CylindricalRange.js +13 -9
  74. package/lib/cjs/curve/Query/CylindricalRange.js.map +1 -1
  75. package/lib/cjs/curve/Query/InOutTests.js.map +1 -1
  76. package/lib/cjs/curve/Query/PlanarSubdivision.js.map +1 -1
  77. package/lib/cjs/curve/Query/StrokeCountChain.js.map +1 -1
  78. package/lib/cjs/curve/Query/StrokeCountMap.js.map +1 -1
  79. package/lib/cjs/curve/RegionMomentsXY.js.map +1 -1
  80. package/lib/cjs/curve/RegionOps.js.map +1 -1
  81. package/lib/cjs/curve/RegionOpsClassificationSweeps.js.map +1 -1
  82. package/lib/cjs/curve/StrokeOptions.d.ts +4 -4
  83. package/lib/cjs/curve/StrokeOptions.d.ts.map +1 -1
  84. package/lib/cjs/curve/StrokeOptions.js +1 -1
  85. package/lib/cjs/curve/StrokeOptions.js.map +1 -1
  86. package/lib/cjs/curve/UnionRegion.js.map +1 -1
  87. package/lib/cjs/curve/internalContexts/AppendPlaneIntersectionStrokeHandler.js.map +1 -1
  88. package/lib/cjs/curve/internalContexts/ChainCollectorContext.js.map +1 -1
  89. package/lib/cjs/curve/internalContexts/CloneCurvesContext.js.map +1 -1
  90. package/lib/cjs/curve/internalContexts/CloneWithExpandedLineStrings.js.map +1 -1
  91. package/lib/cjs/curve/internalContexts/ClosestPointStrokeHandler.js.map +1 -1
  92. package/lib/cjs/curve/internalContexts/CountLinearPartsSearchContext.js.map +1 -1
  93. package/lib/cjs/curve/internalContexts/CurveCurveCloseApproachXY.js.map +1 -1
  94. package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.js.map +1 -1
  95. package/lib/cjs/curve/internalContexts/CurveCurveIntersectXYZ.js.map +1 -1
  96. package/lib/cjs/curve/internalContexts/CurveLengthContext.js.map +1 -1
  97. package/lib/cjs/curve/internalContexts/CurveOffsetXYHandler.js.map +1 -1
  98. package/lib/cjs/curve/internalContexts/EllipticalArcApproximationContext.d.ts.map +1 -1
  99. package/lib/cjs/curve/internalContexts/EllipticalArcApproximationContext.js +24 -18
  100. package/lib/cjs/curve/internalContexts/EllipticalArcApproximationContext.js.map +1 -1
  101. package/lib/cjs/curve/internalContexts/GapSearchContext.js.map +1 -1
  102. package/lib/cjs/curve/internalContexts/MultiChainCollector.js.map +1 -1
  103. package/lib/cjs/curve/internalContexts/NewtonRtoRStrokeHandler.js.map +1 -1
  104. package/lib/cjs/curve/internalContexts/PlaneAltitudeRangeContext.js.map +1 -1
  105. package/lib/cjs/curve/internalContexts/PolygonOffsetContext.js.map +1 -1
  106. package/lib/cjs/curve/internalContexts/SumLengthsContext.js.map +1 -1
  107. package/lib/cjs/curve/internalContexts/TransformInPlaceContext.js.map +1 -1
  108. package/lib/cjs/curve/spiral/AustralianRailCorpXYEvaluator.js.map +1 -1
  109. package/lib/cjs/curve/spiral/ClothoidSeries.js.map +1 -1
  110. package/lib/cjs/curve/spiral/CubicEvaluator.js.map +1 -1
  111. package/lib/cjs/curve/spiral/CzechSpiralEvaluator.js.map +1 -1
  112. package/lib/cjs/curve/spiral/DirectHalfCosineSpiralEvaluator.js.map +1 -1
  113. package/lib/cjs/curve/spiral/DirectSpiral3d.js.map +1 -1
  114. package/lib/cjs/curve/spiral/IntegratedSpiral3d.js.map +1 -1
  115. package/lib/cjs/curve/spiral/MXCubicAlongArcSpiralEvaluator.js.map +1 -1
  116. package/lib/cjs/curve/spiral/NormalizedTransition.js.map +1 -1
  117. package/lib/cjs/curve/spiral/PolishCubicSpiralEvaluator.js.map +1 -1
  118. package/lib/cjs/curve/spiral/TransitionConditionalProperties.js.map +1 -1
  119. package/lib/cjs/curve/spiral/TransitionSpiral3d.js.map +1 -1
  120. package/lib/cjs/curve/spiral/XYCurveEvaluator.js.map +1 -1
  121. package/lib/cjs/geometry3d/Angle.js.map +1 -1
  122. package/lib/cjs/geometry3d/AngleSweep.d.ts +1 -1
  123. package/lib/cjs/geometry3d/AngleSweep.d.ts.map +1 -1
  124. package/lib/cjs/geometry3d/AngleSweep.js +1 -1
  125. package/lib/cjs/geometry3d/AngleSweep.js.map +1 -1
  126. package/lib/cjs/geometry3d/BarycentricTriangle.d.ts +14 -8
  127. package/lib/cjs/geometry3d/BarycentricTriangle.d.ts.map +1 -1
  128. package/lib/cjs/geometry3d/BarycentricTriangle.js +17 -8
  129. package/lib/cjs/geometry3d/BarycentricTriangle.js.map +1 -1
  130. package/lib/cjs/geometry3d/BilinearPatch.js.map +1 -1
  131. package/lib/cjs/geometry3d/CoincidentGeometryOps.js.map +1 -1
  132. package/lib/cjs/geometry3d/Ellipsoid.js.map +1 -1
  133. package/lib/cjs/geometry3d/FrameBuilder.js +4 -4
  134. package/lib/cjs/geometry3d/FrameBuilder.js.map +1 -1
  135. package/lib/cjs/geometry3d/FrustumAnimation.js.map +1 -1
  136. package/lib/cjs/geometry3d/GeometryHandler.js.map +1 -1
  137. package/lib/cjs/geometry3d/GrowableBlockedArray.js.map +1 -1
  138. package/lib/cjs/geometry3d/GrowableFloat64Array.d.ts +2 -0
  139. package/lib/cjs/geometry3d/GrowableFloat64Array.d.ts.map +1 -1
  140. package/lib/cjs/geometry3d/GrowableFloat64Array.js +4 -0
  141. package/lib/cjs/geometry3d/GrowableFloat64Array.js.map +1 -1
  142. package/lib/cjs/geometry3d/GrowableXYArray.js.map +1 -1
  143. package/lib/cjs/geometry3d/GrowableXYZArray.d.ts +32 -10
  144. package/lib/cjs/geometry3d/GrowableXYZArray.d.ts.map +1 -1
  145. package/lib/cjs/geometry3d/GrowableXYZArray.js +54 -16
  146. package/lib/cjs/geometry3d/GrowableXYZArray.js.map +1 -1
  147. package/lib/cjs/geometry3d/IndexedCollectionInterval.js.map +1 -1
  148. package/lib/cjs/geometry3d/IndexedXYCollection.js.map +1 -1
  149. package/lib/cjs/geometry3d/IndexedXYZCollection.d.ts +13 -2
  150. package/lib/cjs/geometry3d/IndexedXYZCollection.d.ts.map +1 -1
  151. package/lib/cjs/geometry3d/IndexedXYZCollection.js +24 -10
  152. package/lib/cjs/geometry3d/IndexedXYZCollection.js.map +1 -1
  153. package/lib/cjs/geometry3d/LongitudeLatitudeAltitude.js.map +1 -1
  154. package/lib/cjs/geometry3d/Matrix3d.d.ts +11 -8
  155. package/lib/cjs/geometry3d/Matrix3d.d.ts.map +1 -1
  156. package/lib/cjs/geometry3d/Matrix3d.js +28 -26
  157. package/lib/cjs/geometry3d/Matrix3d.js.map +1 -1
  158. package/lib/cjs/geometry3d/OrderedRotationAngles.js.map +1 -1
  159. package/lib/cjs/geometry3d/Plane3d.js.map +1 -1
  160. package/lib/cjs/geometry3d/Plane3dByOriginAndUnitNormal.js.map +1 -1
  161. package/lib/cjs/geometry3d/Plane3dByOriginAndVectors.js.map +1 -1
  162. package/lib/cjs/geometry3d/Point2dArrayCarrier.js.map +1 -1
  163. package/lib/cjs/geometry3d/Point2dVector2d.js.map +1 -1
  164. package/lib/cjs/geometry3d/Point3dArrayCarrier.js +1 -1
  165. package/lib/cjs/geometry3d/Point3dArrayCarrier.js.map +1 -1
  166. package/lib/cjs/geometry3d/Point3dVector3d.d.ts +6 -6
  167. package/lib/cjs/geometry3d/Point3dVector3d.js +6 -6
  168. package/lib/cjs/geometry3d/Point3dVector3d.js.map +1 -1
  169. package/lib/cjs/geometry3d/PointHelpers.js.map +1 -1
  170. package/lib/cjs/geometry3d/PointStreaming.js.map +1 -1
  171. package/lib/cjs/geometry3d/PolygonOps.d.ts +12 -6
  172. package/lib/cjs/geometry3d/PolygonOps.d.ts.map +1 -1
  173. package/lib/cjs/geometry3d/PolygonOps.js +94 -47
  174. package/lib/cjs/geometry3d/PolygonOps.js.map +1 -1
  175. package/lib/cjs/geometry3d/PolylineCompressionByEdgeOffset.js.map +1 -1
  176. package/lib/cjs/geometry3d/PolylineOps.d.ts +9 -5
  177. package/lib/cjs/geometry3d/PolylineOps.d.ts.map +1 -1
  178. package/lib/cjs/geometry3d/PolylineOps.js +9 -5
  179. package/lib/cjs/geometry3d/PolylineOps.js.map +1 -1
  180. package/lib/cjs/geometry3d/Range.js.map +1 -1
  181. package/lib/cjs/geometry3d/Ray2d.js.map +1 -1
  182. package/lib/cjs/geometry3d/Ray3d.js.map +1 -1
  183. package/lib/cjs/geometry3d/ReusableObjectCache.js.map +1 -1
  184. package/lib/cjs/geometry3d/Segment1d.js.map +1 -1
  185. package/lib/cjs/geometry3d/SortablePolygon.js.map +1 -1
  186. package/lib/cjs/geometry3d/Transform.js.map +1 -1
  187. package/lib/cjs/geometry3d/UVSurfaceOps.js.map +1 -1
  188. package/lib/cjs/geometry3d/XYZProps.js.map +1 -1
  189. package/lib/cjs/geometry3d/YawPitchRollAngles.js.map +1 -1
  190. package/lib/cjs/geometry4d/Map4d.js.map +1 -1
  191. package/lib/cjs/geometry4d/Matrix4d.js.map +1 -1
  192. package/lib/cjs/geometry4d/MomentData.d.ts +72 -73
  193. package/lib/cjs/geometry4d/MomentData.d.ts.map +1 -1
  194. package/lib/cjs/geometry4d/MomentData.js +62 -64
  195. package/lib/cjs/geometry4d/MomentData.js.map +1 -1
  196. package/lib/cjs/geometry4d/PlaneByOriginAndVectors4d.js.map +1 -1
  197. package/lib/cjs/geometry4d/Point4d.js.map +1 -1
  198. package/lib/cjs/numerics/BandedSystem.js.map +1 -1
  199. package/lib/cjs/numerics/BezierPolynomials.js.map +1 -1
  200. package/lib/cjs/numerics/ClusterableArray.js.map +1 -1
  201. package/lib/cjs/numerics/Complex.js.map +1 -1
  202. package/lib/cjs/numerics/ConvexPolygon2d.js.map +1 -1
  203. package/lib/cjs/numerics/Newton.js.map +1 -1
  204. package/lib/cjs/numerics/PascalCoefficients.js.map +1 -1
  205. package/lib/cjs/numerics/PolarData.js.map +1 -1
  206. package/lib/cjs/numerics/Polynomials.d.ts +5 -5
  207. package/lib/cjs/numerics/Polynomials.js +6 -6
  208. package/lib/cjs/numerics/Polynomials.js.map +1 -1
  209. package/lib/cjs/numerics/Quadrature.js.map +1 -1
  210. package/lib/cjs/numerics/Range1dArray.js.map +1 -1
  211. package/lib/cjs/numerics/SmallSystem.js.map +1 -1
  212. package/lib/cjs/numerics/TriDiagonalSystem.js.map +1 -1
  213. package/lib/cjs/numerics/UnionFind.js.map +1 -1
  214. package/lib/cjs/numerics/UsageSums.js.map +1 -1
  215. package/lib/cjs/polyface/AuxData.d.ts +2 -2
  216. package/lib/cjs/polyface/AuxData.d.ts.map +1 -1
  217. package/lib/cjs/polyface/AuxData.js +11 -3
  218. package/lib/cjs/polyface/AuxData.js.map +1 -1
  219. package/lib/cjs/polyface/BoxTopology.js.map +1 -1
  220. package/lib/cjs/polyface/FacetFaceData.js.map +1 -1
  221. package/lib/cjs/polyface/FacetLocationDetail.js.map +1 -1
  222. package/lib/cjs/polyface/FacetOrientation.js.map +1 -1
  223. package/lib/cjs/polyface/GreedyTriangulationBetweenLineStrings.js.map +1 -1
  224. package/lib/cjs/polyface/IndexedEdgeMatcher.d.ts +27 -20
  225. package/lib/cjs/polyface/IndexedEdgeMatcher.d.ts.map +1 -1
  226. package/lib/cjs/polyface/IndexedEdgeMatcher.js +56 -30
  227. package/lib/cjs/polyface/IndexedEdgeMatcher.js.map +1 -1
  228. package/lib/cjs/polyface/IndexedPolyfaceVisitor.d.ts +2 -1
  229. package/lib/cjs/polyface/IndexedPolyfaceVisitor.d.ts.map +1 -1
  230. package/lib/cjs/polyface/IndexedPolyfaceVisitor.js +2 -1
  231. package/lib/cjs/polyface/IndexedPolyfaceVisitor.js.map +1 -1
  232. package/lib/cjs/polyface/Polyface.d.ts +3 -5
  233. package/lib/cjs/polyface/Polyface.d.ts.map +1 -1
  234. package/lib/cjs/polyface/Polyface.js +6 -13
  235. package/lib/cjs/polyface/Polyface.js.map +1 -1
  236. package/lib/cjs/polyface/PolyfaceBuilder.d.ts +14 -7
  237. package/lib/cjs/polyface/PolyfaceBuilder.d.ts.map +1 -1
  238. package/lib/cjs/polyface/PolyfaceBuilder.js +55 -60
  239. package/lib/cjs/polyface/PolyfaceBuilder.js.map +1 -1
  240. package/lib/cjs/polyface/PolyfaceClip.js.map +1 -1
  241. package/lib/cjs/polyface/PolyfaceData.d.ts +13 -3
  242. package/lib/cjs/polyface/PolyfaceData.d.ts.map +1 -1
  243. package/lib/cjs/polyface/PolyfaceData.js +21 -4
  244. package/lib/cjs/polyface/PolyfaceData.js.map +1 -1
  245. package/lib/cjs/polyface/PolyfaceQuery.d.ts +2 -2
  246. package/lib/cjs/polyface/PolyfaceQuery.d.ts.map +1 -1
  247. package/lib/cjs/polyface/PolyfaceQuery.js +4 -3
  248. package/lib/cjs/polyface/PolyfaceQuery.js.map +1 -1
  249. package/lib/cjs/polyface/RangeLengthData.js.map +1 -1
  250. package/lib/cjs/polyface/RangeTree/LineString3dRangeTreeContext.js.map +1 -1
  251. package/lib/cjs/polyface/RangeTree/MinimumValueTester.js.map +1 -1
  252. package/lib/cjs/polyface/RangeTree/Point3dArrayRangeTreeContext.js.map +1 -1
  253. package/lib/cjs/polyface/RangeTree/PolyfaceRangeTreeContext.js.map +1 -1
  254. package/lib/cjs/polyface/RangeTree/RangeTreeNode.js.map +1 -1
  255. package/lib/cjs/polyface/RangeTree/RangeTreeSearchHandlers.js.map +1 -1
  256. package/lib/cjs/polyface/TaggedNumericData.js.map +1 -1
  257. package/lib/cjs/polyface/TriangleCandidate.js.map +1 -1
  258. package/lib/cjs/polyface/multiclip/BuildAverageNormalsContext.js.map +1 -1
  259. package/lib/cjs/polyface/multiclip/GriddedRaggedRange2dSet.js.map +1 -1
  260. package/lib/cjs/polyface/multiclip/GriddedRaggedRange2dSetWithOverflow.js.map +1 -1
  261. package/lib/cjs/polyface/multiclip/LinearSearchRange2dArray.js.map +1 -1
  262. package/lib/cjs/polyface/multiclip/OffsetMeshContext.js.map +1 -1
  263. package/lib/cjs/polyface/multiclip/Range2dSearchInterface.js.map +1 -1
  264. package/lib/cjs/polyface/multiclip/RangeSearch.js.map +1 -1
  265. package/lib/cjs/polyface/multiclip/SweepLineStringToFacetContext.js.map +1 -1
  266. package/lib/cjs/polyface/multiclip/XYPointBuckets.js.map +1 -1
  267. package/lib/cjs/serialization/BGFBAccessors.js.map +1 -1
  268. package/lib/cjs/serialization/BGFBReader.js.map +1 -1
  269. package/lib/cjs/serialization/BGFBWriter.js.map +1 -1
  270. package/lib/cjs/serialization/BentleyGeometryFlatBuffer.js.map +1 -1
  271. package/lib/cjs/serialization/DeepCompare.js.map +1 -1
  272. package/lib/cjs/serialization/GeometrySamples.d.ts +5 -5
  273. package/lib/cjs/serialization/GeometrySamples.d.ts.map +1 -1
  274. package/lib/cjs/serialization/GeometrySamples.js +5 -5
  275. package/lib/cjs/serialization/GeometrySamples.js.map +1 -1
  276. package/lib/cjs/serialization/IModelJsonSchema.js.map +1 -1
  277. package/lib/cjs/serialization/SerializationHelpers.js.map +1 -1
  278. package/lib/cjs/solid/Box.d.ts +9 -3
  279. package/lib/cjs/solid/Box.d.ts.map +1 -1
  280. package/lib/cjs/solid/Box.js +10 -5
  281. package/lib/cjs/solid/Box.js.map +1 -1
  282. package/lib/cjs/solid/Cone.d.ts +3 -2
  283. package/lib/cjs/solid/Cone.d.ts.map +1 -1
  284. package/lib/cjs/solid/Cone.js +3 -3
  285. package/lib/cjs/solid/Cone.js.map +1 -1
  286. package/lib/cjs/solid/LinearSweep.d.ts +9 -3
  287. package/lib/cjs/solid/LinearSweep.d.ts.map +1 -1
  288. package/lib/cjs/solid/LinearSweep.js +9 -4
  289. package/lib/cjs/solid/LinearSweep.js.map +1 -1
  290. package/lib/cjs/solid/RotationalSweep.d.ts +15 -4
  291. package/lib/cjs/solid/RotationalSweep.d.ts.map +1 -1
  292. package/lib/cjs/solid/RotationalSweep.js +20 -7
  293. package/lib/cjs/solid/RotationalSweep.js.map +1 -1
  294. package/lib/cjs/solid/RuledSweep.d.ts +35 -26
  295. package/lib/cjs/solid/RuledSweep.d.ts.map +1 -1
  296. package/lib/cjs/solid/RuledSweep.js +41 -28
  297. package/lib/cjs/solid/RuledSweep.js.map +1 -1
  298. package/lib/cjs/solid/SolidPrimitive.d.ts +12 -11
  299. package/lib/cjs/solid/SolidPrimitive.d.ts.map +1 -1
  300. package/lib/cjs/solid/SolidPrimitive.js +8 -5
  301. package/lib/cjs/solid/SolidPrimitive.js.map +1 -1
  302. package/lib/cjs/solid/Sphere.d.ts +17 -7
  303. package/lib/cjs/solid/Sphere.d.ts.map +1 -1
  304. package/lib/cjs/solid/Sphere.js +22 -16
  305. package/lib/cjs/solid/Sphere.js.map +1 -1
  306. package/lib/cjs/solid/SweepContour.d.ts +25 -16
  307. package/lib/cjs/solid/SweepContour.d.ts.map +1 -1
  308. package/lib/cjs/solid/SweepContour.js +25 -16
  309. package/lib/cjs/solid/SweepContour.js.map +1 -1
  310. package/lib/cjs/solid/TorusPipe.d.ts +8 -2
  311. package/lib/cjs/solid/TorusPipe.d.ts.map +1 -1
  312. package/lib/cjs/solid/TorusPipe.js +9 -5
  313. package/lib/cjs/solid/TorusPipe.js.map +1 -1
  314. package/lib/cjs/topology/ChainMerge.js.map +1 -1
  315. package/lib/cjs/topology/Graph.js.map +1 -1
  316. package/lib/cjs/topology/HalfEdgeGraphFromIndexedLoopsContext.js.map +1 -1
  317. package/lib/cjs/topology/HalfEdgeGraphSearch.js.map +1 -1
  318. package/lib/cjs/topology/HalfEdgeGraphSpineContext.js.map +1 -1
  319. package/lib/cjs/topology/HalfEdgeGraphValidation.js.map +1 -1
  320. package/lib/cjs/topology/HalfEdgeMarkSet.js.map +1 -1
  321. package/lib/cjs/topology/HalfEdgeNodeXYZUV.js.map +1 -1
  322. package/lib/cjs/topology/HalfEdgePointInGraphSearch.js.map +1 -1
  323. package/lib/cjs/topology/HalfEdgePositionDetail.js.map +1 -1
  324. package/lib/cjs/topology/HalfEdgePriorityQueue.js.map +1 -1
  325. package/lib/cjs/topology/InsertAndRetriangulateContext.js.map +1 -1
  326. package/lib/cjs/topology/MaskManager.js.map +1 -1
  327. package/lib/cjs/topology/Merging.js.map +1 -1
  328. package/lib/cjs/topology/RegularizeFace.js.map +1 -1
  329. package/lib/cjs/topology/SignedDataSummary.js.map +1 -1
  330. package/lib/cjs/topology/SpaceTriangulation.js.map +1 -1
  331. package/lib/cjs/topology/Triangulation.js.map +1 -1
  332. package/lib/cjs/topology/XYParitySearchContext.js.map +1 -1
  333. package/lib/esm/Constant.js.map +1 -1
  334. package/lib/esm/Geometry.js.map +1 -1
  335. package/lib/esm/bspline/AkimaCurve3d.js.map +1 -1
  336. package/lib/esm/bspline/BSpline1dNd.js.map +1 -1
  337. package/lib/esm/bspline/BSplineCurve.js.map +1 -1
  338. package/lib/esm/bspline/BSplineCurve3dH.js.map +1 -1
  339. package/lib/esm/bspline/BSplineCurveOps.d.ts.map +1 -1
  340. package/lib/esm/bspline/BSplineCurveOps.js +18 -21
  341. package/lib/esm/bspline/BSplineCurveOps.js.map +1 -1
  342. package/lib/esm/bspline/BSplineSurface.js.map +1 -1
  343. package/lib/esm/bspline/Bezier1dNd.js.map +1 -1
  344. package/lib/esm/bspline/BezierCurve3d.js.map +1 -1
  345. package/lib/esm/bspline/BezierCurve3dH.js.map +1 -1
  346. package/lib/esm/bspline/BezierCurveBase.d.ts.map +1 -1
  347. package/lib/esm/bspline/BezierCurveBase.js.map +1 -1
  348. package/lib/esm/bspline/InterpolationCurve3d.js.map +1 -1
  349. package/lib/esm/bspline/KnotVector.js.map +1 -1
  350. package/lib/esm/bspline/SurfaceLocationDetail.js.map +1 -1
  351. package/lib/esm/clipping/AlternatingConvexClipTree.js.map +1 -1
  352. package/lib/esm/clipping/BooleanClipFactory.js.map +1 -1
  353. package/lib/esm/clipping/BooleanClipNode.js.map +1 -1
  354. package/lib/esm/clipping/ClipPlane.js.map +1 -1
  355. package/lib/esm/clipping/ClipPrimitive.js.map +1 -1
  356. package/lib/esm/clipping/ClipUtils.js.map +1 -1
  357. package/lib/esm/clipping/ClipVector.js.map +1 -1
  358. package/lib/esm/clipping/ConvexClipPlaneSet.js.map +1 -1
  359. package/lib/esm/clipping/UnionOfConvexClipPlaneSets.js.map +1 -1
  360. package/lib/esm/clipping/internalContexts/LineStringOffsetClipperContext.js.map +1 -1
  361. package/lib/esm/core-geometry.js.map +1 -1
  362. package/lib/esm/curve/Arc3d.d.ts +40 -8
  363. package/lib/esm/curve/Arc3d.d.ts.map +1 -1
  364. package/lib/esm/curve/Arc3d.js +66 -8
  365. package/lib/esm/curve/Arc3d.js.map +1 -1
  366. package/lib/esm/curve/ConstructCurveBetweenCurves.js.map +1 -1
  367. package/lib/esm/curve/CoordinateXYZ.js.map +1 -1
  368. package/lib/esm/curve/CurveChainWithDistanceIndex.js.map +1 -1
  369. package/lib/esm/curve/CurveCollection.d.ts +16 -2
  370. package/lib/esm/curve/CurveCollection.d.ts.map +1 -1
  371. package/lib/esm/curve/CurveCollection.js +33 -2
  372. package/lib/esm/curve/CurveCollection.js.map +1 -1
  373. package/lib/esm/curve/CurveCurve.js.map +1 -1
  374. package/lib/esm/curve/CurveExtendMode.js.map +1 -1
  375. package/lib/esm/curve/CurveFactory.d.ts +87 -53
  376. package/lib/esm/curve/CurveFactory.d.ts.map +1 -1
  377. package/lib/esm/curve/CurveFactory.js +213 -135
  378. package/lib/esm/curve/CurveFactory.js.map +1 -1
  379. package/lib/esm/curve/CurveLocationDetail.js.map +1 -1
  380. package/lib/esm/curve/CurveOps.js.map +1 -1
  381. package/lib/esm/curve/CurvePrimitive.js.map +1 -1
  382. package/lib/esm/curve/CurveProcessor.js.map +1 -1
  383. package/lib/esm/curve/CurveTypes.js.map +1 -1
  384. package/lib/esm/curve/CurveWireMomentsXYZ.js.map +1 -1
  385. package/lib/esm/curve/GeometryQuery.js.map +1 -1
  386. package/lib/esm/curve/LineSegment3d.js.map +1 -1
  387. package/lib/esm/curve/LineString3d.d.ts +12 -8
  388. package/lib/esm/curve/LineString3d.d.ts.map +1 -1
  389. package/lib/esm/curve/LineString3d.js +29 -8
  390. package/lib/esm/curve/LineString3d.js.map +1 -1
  391. package/lib/esm/curve/Loop.d.ts +12 -6
  392. package/lib/esm/curve/Loop.d.ts.map +1 -1
  393. package/lib/esm/curve/Loop.js +12 -6
  394. package/lib/esm/curve/Loop.js.map +1 -1
  395. package/lib/esm/curve/OffsetOptions.js.map +1 -1
  396. package/lib/esm/curve/ParityRegion.js.map +1 -1
  397. package/lib/esm/curve/Path.js.map +1 -1
  398. package/lib/esm/curve/PointString3d.js.map +1 -1
  399. package/lib/esm/curve/ProxyCurve.js.map +1 -1
  400. package/lib/esm/curve/Query/ConsolidateAdjacentPrimitivesContext.js.map +1 -1
  401. package/lib/esm/curve/Query/CurveSplitContext.js.map +1 -1
  402. package/lib/esm/curve/Query/CylindricalRange.d.ts +8 -6
  403. package/lib/esm/curve/Query/CylindricalRange.d.ts.map +1 -1
  404. package/lib/esm/curve/Query/CylindricalRange.js +13 -9
  405. package/lib/esm/curve/Query/CylindricalRange.js.map +1 -1
  406. package/lib/esm/curve/Query/InOutTests.js.map +1 -1
  407. package/lib/esm/curve/Query/PlanarSubdivision.js.map +1 -1
  408. package/lib/esm/curve/Query/StrokeCountChain.js.map +1 -1
  409. package/lib/esm/curve/Query/StrokeCountMap.js.map +1 -1
  410. package/lib/esm/curve/RegionMomentsXY.js.map +1 -1
  411. package/lib/esm/curve/RegionOps.js.map +1 -1
  412. package/lib/esm/curve/RegionOpsClassificationSweeps.js.map +1 -1
  413. package/lib/esm/curve/StrokeOptions.d.ts +4 -4
  414. package/lib/esm/curve/StrokeOptions.d.ts.map +1 -1
  415. package/lib/esm/curve/StrokeOptions.js +1 -1
  416. package/lib/esm/curve/StrokeOptions.js.map +1 -1
  417. package/lib/esm/curve/UnionRegion.js.map +1 -1
  418. package/lib/esm/curve/internalContexts/AppendPlaneIntersectionStrokeHandler.js.map +1 -1
  419. package/lib/esm/curve/internalContexts/ChainCollectorContext.js.map +1 -1
  420. package/lib/esm/curve/internalContexts/CloneCurvesContext.js.map +1 -1
  421. package/lib/esm/curve/internalContexts/CloneWithExpandedLineStrings.js.map +1 -1
  422. package/lib/esm/curve/internalContexts/ClosestPointStrokeHandler.js.map +1 -1
  423. package/lib/esm/curve/internalContexts/CountLinearPartsSearchContext.js.map +1 -1
  424. package/lib/esm/curve/internalContexts/CurveCurveCloseApproachXY.js.map +1 -1
  425. package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.js.map +1 -1
  426. package/lib/esm/curve/internalContexts/CurveCurveIntersectXYZ.js.map +1 -1
  427. package/lib/esm/curve/internalContexts/CurveLengthContext.js.map +1 -1
  428. package/lib/esm/curve/internalContexts/CurveOffsetXYHandler.js.map +1 -1
  429. package/lib/esm/curve/internalContexts/EllipticalArcApproximationContext.d.ts.map +1 -1
  430. package/lib/esm/curve/internalContexts/EllipticalArcApproximationContext.js +24 -18
  431. package/lib/esm/curve/internalContexts/EllipticalArcApproximationContext.js.map +1 -1
  432. package/lib/esm/curve/internalContexts/GapSearchContext.js.map +1 -1
  433. package/lib/esm/curve/internalContexts/MultiChainCollector.js.map +1 -1
  434. package/lib/esm/curve/internalContexts/NewtonRtoRStrokeHandler.js.map +1 -1
  435. package/lib/esm/curve/internalContexts/PlaneAltitudeRangeContext.js.map +1 -1
  436. package/lib/esm/curve/internalContexts/PolygonOffsetContext.js.map +1 -1
  437. package/lib/esm/curve/internalContexts/SumLengthsContext.js.map +1 -1
  438. package/lib/esm/curve/internalContexts/TransformInPlaceContext.js.map +1 -1
  439. package/lib/esm/curve/spiral/AustralianRailCorpXYEvaluator.js.map +1 -1
  440. package/lib/esm/curve/spiral/ClothoidSeries.js.map +1 -1
  441. package/lib/esm/curve/spiral/CubicEvaluator.js.map +1 -1
  442. package/lib/esm/curve/spiral/CzechSpiralEvaluator.js.map +1 -1
  443. package/lib/esm/curve/spiral/DirectHalfCosineSpiralEvaluator.js.map +1 -1
  444. package/lib/esm/curve/spiral/DirectSpiral3d.js.map +1 -1
  445. package/lib/esm/curve/spiral/IntegratedSpiral3d.js.map +1 -1
  446. package/lib/esm/curve/spiral/MXCubicAlongArcSpiralEvaluator.js.map +1 -1
  447. package/lib/esm/curve/spiral/NormalizedTransition.js.map +1 -1
  448. package/lib/esm/curve/spiral/PolishCubicSpiralEvaluator.js.map +1 -1
  449. package/lib/esm/curve/spiral/TransitionConditionalProperties.js.map +1 -1
  450. package/lib/esm/curve/spiral/TransitionSpiral3d.js.map +1 -1
  451. package/lib/esm/curve/spiral/XYCurveEvaluator.js.map +1 -1
  452. package/lib/esm/geometry3d/Angle.js.map +1 -1
  453. package/lib/esm/geometry3d/AngleSweep.d.ts +1 -1
  454. package/lib/esm/geometry3d/AngleSweep.d.ts.map +1 -1
  455. package/lib/esm/geometry3d/AngleSweep.js +1 -1
  456. package/lib/esm/geometry3d/AngleSweep.js.map +1 -1
  457. package/lib/esm/geometry3d/BarycentricTriangle.d.ts +14 -8
  458. package/lib/esm/geometry3d/BarycentricTriangle.d.ts.map +1 -1
  459. package/lib/esm/geometry3d/BarycentricTriangle.js +17 -8
  460. package/lib/esm/geometry3d/BarycentricTriangle.js.map +1 -1
  461. package/lib/esm/geometry3d/BilinearPatch.js.map +1 -1
  462. package/lib/esm/geometry3d/CoincidentGeometryOps.js.map +1 -1
  463. package/lib/esm/geometry3d/Ellipsoid.js.map +1 -1
  464. package/lib/esm/geometry3d/FrameBuilder.js +4 -4
  465. package/lib/esm/geometry3d/FrameBuilder.js.map +1 -1
  466. package/lib/esm/geometry3d/FrustumAnimation.js.map +1 -1
  467. package/lib/esm/geometry3d/GeometryHandler.js.map +1 -1
  468. package/lib/esm/geometry3d/GrowableBlockedArray.js.map +1 -1
  469. package/lib/esm/geometry3d/GrowableFloat64Array.d.ts +2 -0
  470. package/lib/esm/geometry3d/GrowableFloat64Array.d.ts.map +1 -1
  471. package/lib/esm/geometry3d/GrowableFloat64Array.js +4 -0
  472. package/lib/esm/geometry3d/GrowableFloat64Array.js.map +1 -1
  473. package/lib/esm/geometry3d/GrowableXYArray.js.map +1 -1
  474. package/lib/esm/geometry3d/GrowableXYZArray.d.ts +32 -10
  475. package/lib/esm/geometry3d/GrowableXYZArray.d.ts.map +1 -1
  476. package/lib/esm/geometry3d/GrowableXYZArray.js +54 -16
  477. package/lib/esm/geometry3d/GrowableXYZArray.js.map +1 -1
  478. package/lib/esm/geometry3d/IndexedCollectionInterval.js.map +1 -1
  479. package/lib/esm/geometry3d/IndexedXYCollection.js.map +1 -1
  480. package/lib/esm/geometry3d/IndexedXYZCollection.d.ts +13 -2
  481. package/lib/esm/geometry3d/IndexedXYZCollection.d.ts.map +1 -1
  482. package/lib/esm/geometry3d/IndexedXYZCollection.js +24 -10
  483. package/lib/esm/geometry3d/IndexedXYZCollection.js.map +1 -1
  484. package/lib/esm/geometry3d/LongitudeLatitudeAltitude.js.map +1 -1
  485. package/lib/esm/geometry3d/Matrix3d.d.ts +11 -8
  486. package/lib/esm/geometry3d/Matrix3d.d.ts.map +1 -1
  487. package/lib/esm/geometry3d/Matrix3d.js +28 -26
  488. package/lib/esm/geometry3d/Matrix3d.js.map +1 -1
  489. package/lib/esm/geometry3d/OrderedRotationAngles.js.map +1 -1
  490. package/lib/esm/geometry3d/Plane3d.js.map +1 -1
  491. package/lib/esm/geometry3d/Plane3dByOriginAndUnitNormal.js.map +1 -1
  492. package/lib/esm/geometry3d/Plane3dByOriginAndVectors.js.map +1 -1
  493. package/lib/esm/geometry3d/Point2dArrayCarrier.js.map +1 -1
  494. package/lib/esm/geometry3d/Point2dVector2d.js.map +1 -1
  495. package/lib/esm/geometry3d/Point3dArrayCarrier.js +1 -1
  496. package/lib/esm/geometry3d/Point3dArrayCarrier.js.map +1 -1
  497. package/lib/esm/geometry3d/Point3dVector3d.d.ts +6 -6
  498. package/lib/esm/geometry3d/Point3dVector3d.js +6 -6
  499. package/lib/esm/geometry3d/Point3dVector3d.js.map +1 -1
  500. package/lib/esm/geometry3d/PointHelpers.js.map +1 -1
  501. package/lib/esm/geometry3d/PointStreaming.js.map +1 -1
  502. package/lib/esm/geometry3d/PolygonOps.d.ts +12 -6
  503. package/lib/esm/geometry3d/PolygonOps.d.ts.map +1 -1
  504. package/lib/esm/geometry3d/PolygonOps.js +94 -47
  505. package/lib/esm/geometry3d/PolygonOps.js.map +1 -1
  506. package/lib/esm/geometry3d/PolylineCompressionByEdgeOffset.js.map +1 -1
  507. package/lib/esm/geometry3d/PolylineOps.d.ts +9 -5
  508. package/lib/esm/geometry3d/PolylineOps.d.ts.map +1 -1
  509. package/lib/esm/geometry3d/PolylineOps.js +9 -5
  510. package/lib/esm/geometry3d/PolylineOps.js.map +1 -1
  511. package/lib/esm/geometry3d/Range.js.map +1 -1
  512. package/lib/esm/geometry3d/Ray2d.js.map +1 -1
  513. package/lib/esm/geometry3d/Ray3d.js.map +1 -1
  514. package/lib/esm/geometry3d/ReusableObjectCache.js.map +1 -1
  515. package/lib/esm/geometry3d/Segment1d.js.map +1 -1
  516. package/lib/esm/geometry3d/SortablePolygon.js.map +1 -1
  517. package/lib/esm/geometry3d/Transform.js.map +1 -1
  518. package/lib/esm/geometry3d/UVSurfaceOps.js.map +1 -1
  519. package/lib/esm/geometry3d/XYZProps.js.map +1 -1
  520. package/lib/esm/geometry3d/YawPitchRollAngles.js.map +1 -1
  521. package/lib/esm/geometry4d/Map4d.js.map +1 -1
  522. package/lib/esm/geometry4d/Matrix4d.js.map +1 -1
  523. package/lib/esm/geometry4d/MomentData.d.ts +72 -73
  524. package/lib/esm/geometry4d/MomentData.d.ts.map +1 -1
  525. package/lib/esm/geometry4d/MomentData.js +62 -64
  526. package/lib/esm/geometry4d/MomentData.js.map +1 -1
  527. package/lib/esm/geometry4d/PlaneByOriginAndVectors4d.js.map +1 -1
  528. package/lib/esm/geometry4d/Point4d.js.map +1 -1
  529. package/lib/esm/numerics/BandedSystem.js.map +1 -1
  530. package/lib/esm/numerics/BezierPolynomials.js.map +1 -1
  531. package/lib/esm/numerics/ClusterableArray.js.map +1 -1
  532. package/lib/esm/numerics/Complex.js.map +1 -1
  533. package/lib/esm/numerics/ConvexPolygon2d.js.map +1 -1
  534. package/lib/esm/numerics/Newton.js.map +1 -1
  535. package/lib/esm/numerics/PascalCoefficients.js.map +1 -1
  536. package/lib/esm/numerics/PolarData.js.map +1 -1
  537. package/lib/esm/numerics/Polynomials.d.ts +5 -5
  538. package/lib/esm/numerics/Polynomials.js +6 -6
  539. package/lib/esm/numerics/Polynomials.js.map +1 -1
  540. package/lib/esm/numerics/Quadrature.js.map +1 -1
  541. package/lib/esm/numerics/Range1dArray.js.map +1 -1
  542. package/lib/esm/numerics/SmallSystem.js.map +1 -1
  543. package/lib/esm/numerics/TriDiagonalSystem.js.map +1 -1
  544. package/lib/esm/numerics/UnionFind.js.map +1 -1
  545. package/lib/esm/numerics/UsageSums.js.map +1 -1
  546. package/lib/esm/polyface/AuxData.d.ts +2 -2
  547. package/lib/esm/polyface/AuxData.d.ts.map +1 -1
  548. package/lib/esm/polyface/AuxData.js +11 -3
  549. package/lib/esm/polyface/AuxData.js.map +1 -1
  550. package/lib/esm/polyface/BoxTopology.js.map +1 -1
  551. package/lib/esm/polyface/FacetFaceData.js.map +1 -1
  552. package/lib/esm/polyface/FacetLocationDetail.js.map +1 -1
  553. package/lib/esm/polyface/FacetOrientation.js.map +1 -1
  554. package/lib/esm/polyface/GreedyTriangulationBetweenLineStrings.js.map +1 -1
  555. package/lib/esm/polyface/IndexedEdgeMatcher.d.ts +27 -20
  556. package/lib/esm/polyface/IndexedEdgeMatcher.d.ts.map +1 -1
  557. package/lib/esm/polyface/IndexedEdgeMatcher.js +56 -30
  558. package/lib/esm/polyface/IndexedEdgeMatcher.js.map +1 -1
  559. package/lib/esm/polyface/IndexedPolyfaceVisitor.d.ts +2 -1
  560. package/lib/esm/polyface/IndexedPolyfaceVisitor.d.ts.map +1 -1
  561. package/lib/esm/polyface/IndexedPolyfaceVisitor.js +2 -1
  562. package/lib/esm/polyface/IndexedPolyfaceVisitor.js.map +1 -1
  563. package/lib/esm/polyface/Polyface.d.ts +3 -5
  564. package/lib/esm/polyface/Polyface.d.ts.map +1 -1
  565. package/lib/esm/polyface/Polyface.js +6 -13
  566. package/lib/esm/polyface/Polyface.js.map +1 -1
  567. package/lib/esm/polyface/PolyfaceBuilder.d.ts +14 -7
  568. package/lib/esm/polyface/PolyfaceBuilder.d.ts.map +1 -1
  569. package/lib/esm/polyface/PolyfaceBuilder.js +56 -61
  570. package/lib/esm/polyface/PolyfaceBuilder.js.map +1 -1
  571. package/lib/esm/polyface/PolyfaceClip.js.map +1 -1
  572. package/lib/esm/polyface/PolyfaceData.d.ts +13 -3
  573. package/lib/esm/polyface/PolyfaceData.d.ts.map +1 -1
  574. package/lib/esm/polyface/PolyfaceData.js +21 -4
  575. package/lib/esm/polyface/PolyfaceData.js.map +1 -1
  576. package/lib/esm/polyface/PolyfaceQuery.d.ts +2 -2
  577. package/lib/esm/polyface/PolyfaceQuery.d.ts.map +1 -1
  578. package/lib/esm/polyface/PolyfaceQuery.js +4 -3
  579. package/lib/esm/polyface/PolyfaceQuery.js.map +1 -1
  580. package/lib/esm/polyface/RangeLengthData.js.map +1 -1
  581. package/lib/esm/polyface/RangeTree/LineString3dRangeTreeContext.js.map +1 -1
  582. package/lib/esm/polyface/RangeTree/MinimumValueTester.js.map +1 -1
  583. package/lib/esm/polyface/RangeTree/Point3dArrayRangeTreeContext.js.map +1 -1
  584. package/lib/esm/polyface/RangeTree/PolyfaceRangeTreeContext.js.map +1 -1
  585. package/lib/esm/polyface/RangeTree/RangeTreeNode.js.map +1 -1
  586. package/lib/esm/polyface/RangeTree/RangeTreeSearchHandlers.js.map +1 -1
  587. package/lib/esm/polyface/TaggedNumericData.js.map +1 -1
  588. package/lib/esm/polyface/TriangleCandidate.js.map +1 -1
  589. package/lib/esm/polyface/multiclip/BuildAverageNormalsContext.js.map +1 -1
  590. package/lib/esm/polyface/multiclip/GriddedRaggedRange2dSet.js.map +1 -1
  591. package/lib/esm/polyface/multiclip/GriddedRaggedRange2dSetWithOverflow.js.map +1 -1
  592. package/lib/esm/polyface/multiclip/LinearSearchRange2dArray.js.map +1 -1
  593. package/lib/esm/polyface/multiclip/OffsetMeshContext.js.map +1 -1
  594. package/lib/esm/polyface/multiclip/Range2dSearchInterface.js.map +1 -1
  595. package/lib/esm/polyface/multiclip/RangeSearch.js.map +1 -1
  596. package/lib/esm/polyface/multiclip/SweepLineStringToFacetContext.js.map +1 -1
  597. package/lib/esm/polyface/multiclip/XYPointBuckets.js.map +1 -1
  598. package/lib/esm/serialization/BGFBAccessors.js.map +1 -1
  599. package/lib/esm/serialization/BGFBReader.js.map +1 -1
  600. package/lib/esm/serialization/BGFBWriter.js.map +1 -1
  601. package/lib/esm/serialization/BentleyGeometryFlatBuffer.js.map +1 -1
  602. package/lib/esm/serialization/DeepCompare.js.map +1 -1
  603. package/lib/esm/serialization/GeometrySamples.d.ts +5 -5
  604. package/lib/esm/serialization/GeometrySamples.d.ts.map +1 -1
  605. package/lib/esm/serialization/GeometrySamples.js +5 -5
  606. package/lib/esm/serialization/GeometrySamples.js.map +1 -1
  607. package/lib/esm/serialization/IModelJsonSchema.js.map +1 -1
  608. package/lib/esm/serialization/SerializationHelpers.js.map +1 -1
  609. package/lib/esm/solid/Box.d.ts +9 -3
  610. package/lib/esm/solid/Box.d.ts.map +1 -1
  611. package/lib/esm/solid/Box.js +10 -5
  612. package/lib/esm/solid/Box.js.map +1 -1
  613. package/lib/esm/solid/Cone.d.ts +3 -2
  614. package/lib/esm/solid/Cone.d.ts.map +1 -1
  615. package/lib/esm/solid/Cone.js +3 -3
  616. package/lib/esm/solid/Cone.js.map +1 -1
  617. package/lib/esm/solid/LinearSweep.d.ts +9 -3
  618. package/lib/esm/solid/LinearSweep.d.ts.map +1 -1
  619. package/lib/esm/solid/LinearSweep.js +9 -4
  620. package/lib/esm/solid/LinearSweep.js.map +1 -1
  621. package/lib/esm/solid/RotationalSweep.d.ts +15 -4
  622. package/lib/esm/solid/RotationalSweep.d.ts.map +1 -1
  623. package/lib/esm/solid/RotationalSweep.js +20 -7
  624. package/lib/esm/solid/RotationalSweep.js.map +1 -1
  625. package/lib/esm/solid/RuledSweep.d.ts +35 -26
  626. package/lib/esm/solid/RuledSweep.d.ts.map +1 -1
  627. package/lib/esm/solid/RuledSweep.js +41 -28
  628. package/lib/esm/solid/RuledSweep.js.map +1 -1
  629. package/lib/esm/solid/SolidPrimitive.d.ts +12 -11
  630. package/lib/esm/solid/SolidPrimitive.d.ts.map +1 -1
  631. package/lib/esm/solid/SolidPrimitive.js +8 -5
  632. package/lib/esm/solid/SolidPrimitive.js.map +1 -1
  633. package/lib/esm/solid/Sphere.d.ts +17 -7
  634. package/lib/esm/solid/Sphere.d.ts.map +1 -1
  635. package/lib/esm/solid/Sphere.js +22 -16
  636. package/lib/esm/solid/Sphere.js.map +1 -1
  637. package/lib/esm/solid/SweepContour.d.ts +25 -16
  638. package/lib/esm/solid/SweepContour.d.ts.map +1 -1
  639. package/lib/esm/solid/SweepContour.js +25 -16
  640. package/lib/esm/solid/SweepContour.js.map +1 -1
  641. package/lib/esm/solid/TorusPipe.d.ts +8 -2
  642. package/lib/esm/solid/TorusPipe.d.ts.map +1 -1
  643. package/lib/esm/solid/TorusPipe.js +9 -5
  644. package/lib/esm/solid/TorusPipe.js.map +1 -1
  645. package/lib/esm/topology/ChainMerge.js.map +1 -1
  646. package/lib/esm/topology/Graph.js.map +1 -1
  647. package/lib/esm/topology/HalfEdgeGraphFromIndexedLoopsContext.js.map +1 -1
  648. package/lib/esm/topology/HalfEdgeGraphSearch.js.map +1 -1
  649. package/lib/esm/topology/HalfEdgeGraphSpineContext.js.map +1 -1
  650. package/lib/esm/topology/HalfEdgeGraphValidation.js.map +1 -1
  651. package/lib/esm/topology/HalfEdgeMarkSet.js.map +1 -1
  652. package/lib/esm/topology/HalfEdgeNodeXYZUV.js.map +1 -1
  653. package/lib/esm/topology/HalfEdgePointInGraphSearch.js.map +1 -1
  654. package/lib/esm/topology/HalfEdgePositionDetail.js.map +1 -1
  655. package/lib/esm/topology/HalfEdgePriorityQueue.js.map +1 -1
  656. package/lib/esm/topology/InsertAndRetriangulateContext.js.map +1 -1
  657. package/lib/esm/topology/MaskManager.js.map +1 -1
  658. package/lib/esm/topology/Merging.js.map +1 -1
  659. package/lib/esm/topology/RegularizeFace.js.map +1 -1
  660. package/lib/esm/topology/SignedDataSummary.js.map +1 -1
  661. package/lib/esm/topology/SpaceTriangulation.js.map +1 -1
  662. package/lib/esm/topology/Triangulation.js.map +1 -1
  663. package/lib/esm/topology/XYParitySearchContext.js.map +1 -1
  664. package/package.json +4 -4
@@ -1 +1 @@
1
- {"version":3,"file":"PolyfaceClip.js","sourceRoot":"","sources":["../../../src/polyface/PolyfaceClip.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F;;GAEG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAE,0BAA0B,EAAE,MAAM,wCAAwC,CAAC;AAEpF,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AACrC,OAAO,EAAE,kBAAkB,EAAE,SAAS,EAAE,MAAM,oB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EAAE,aAAa,CAAC,CAAC;QACxG,cAAc,CAAC,uBAAuB,EAAE,CAAC;QACzC,aAAa,CAAC,uBAAuB,EAAE,CAAC;QACxC,IAAI,CAAC,+CAA+C,CAAC,QAAQ,EAAE,QAAQ,EAAE,aAAa,EAAE,cAAc,CAAC,CAAC;QACxG,OAAO;YACL,WAAW,EAAE,cAAc,CAAC,aAAa,EAAE;YAC3C,UAAU,EAAE,aAAa,CAAC,aAAa,EAAE;SAC1C,CAAC;IACJ,CAAC;CACF","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 Polyface\r\n */\r\n\r\nimport { assert } from \"@itwin/core-bentley\";\r\nimport { ClipPlane } from \"../clipping/ClipPlane\";\r\nimport { ConvexClipPlaneSet } from \"../clipping/ConvexClipPlaneSet\";\r\nimport { UnionOfConvexClipPlaneSets } from \"../clipping/UnionOfConvexClipPlaneSets\";\r\nimport { AnyRegion } from \"../curve/CurveTypes\";\r\nimport { LineString3d } from \"../curve/LineString3d\";\r\nimport { Loop } from \"../curve/Loop\";\r\nimport { RegionBinaryOpType, RegionOps } from \"../curve/RegionOps\";\r\nimport { StrokeOptions } from \"../curve/StrokeOptions\";\r\nimport { UnionRegion } from \"../curve/UnionRegion\";\r\nimport { Geometry, PlaneAltitudeEvaluator } from \"../Geometry\";\r\nimport { FrameBuilder } from \"../geometry3d/FrameBuilder\";\r\nimport { GrowableXYZArray } from \"../geometry3d/GrowableXYZArray\";\r\nimport { Point3d, Vector3d } from \"../geometry3d/Point3dVector3d\";\r\nimport { IndexedXYZCollectionPolygonOps, PolygonOps } from \"../geometry3d/PolygonOps\";\r\nimport { Range1d, Range2d, Range3d } from \"../geometry3d/Range\";\r\nimport { GrowableXYZArrayCache } from \"../geometry3d/ReusableObjectCache\";\r\nimport { Transform } from \"../geometry3d/Transform\";\r\nimport { SweepContour } from \"../solid/SweepContour\";\r\nimport { ChainMergeContext } from \"../topology/ChainMerge\";\r\nimport { RangeSearch } from \"./multiclip/RangeSearch\";\r\nimport { IndexedPolyface, Polyface, PolyfaceVisitor } from \"./Polyface\";\r\nimport { PolyfaceBuilder } from \"./PolyfaceBuilder\";\r\nimport { PolyfaceQuery } from \"./PolyfaceQuery\";\r\n\r\n/**\r\n * carrier for a point array with an index into UnionOfConvexClipPlaneSets\r\n * @private\r\n */\r\nclass ClipCandidate {\r\n public nextConvexSetIndex: number;\r\n public points: GrowableXYZArray;\r\n public constructor(points: GrowableXYZArray, nextConvexSetIndex: number) {\r\n this.nextConvexSetIndex = nextConvexSetIndex;\r\n this.points = points;\r\n }\r\n}\r\n\r\n/**\r\n * A pair of [[PolyfaceBuilder]] objects, for use by clippers that emit inside and outside parts.\r\n * * @public\r\n */\r\nexport class ClippedPolyfaceBuilders {\r\n /** An available builder. Typically the \"inside\" parts */\r\n public builderA?: PolyfaceBuilder;\r\n /** An available builder. Typically the \"outside\" parts */\r\n public builderB?: PolyfaceBuilder;\r\n /** request to construct cut faces */\r\n public buildClosureFaces?: boolean;\r\n private constructor(builderA: PolyfaceBuilder | undefined, builderB: PolyfaceBuilder | undefined, buildClosureFaces: boolean = false) {\r\n this.builderA = builderA;\r\n this.builderB = builderB;\r\n this.buildClosureFaces = buildClosureFaces;\r\n }\r\n /**\r\n * Static constructor with default options for the builders.\r\n * @param keepInside whether to collect clipped facets inside the clipper to `this.builderA` (default true)\r\n * @param keepOutside whether to collect clipped facets outside the clipper to `this.builderB` (default false)\r\n * @param buildSideFaces whether to add side facets to active builders (default false)\r\n */\r\n public static create(keepInside: boolean = true, keepOutside: boolean = false, buildSideFaces: boolean = false) {\r\n return new ClippedPolyfaceBuilders(keepInside ? PolyfaceBuilder.create() : undefined, keepOutside ? PolyfaceBuilder.create() : undefined, buildSideFaces);\r\n }\r\n\r\n /**\r\n * Return the computed facets from the selected builder.\r\n * @param selector the polyface to return: 0 - builderA (typically inside facets), 1 - builderB (typically outside facets)\r\n * @param fixup whether to clean up the polyface\r\n * @param tolerance compression tolerance (default [[Geometry.smallMetricDistance]]).\r\n */\r\n public claimPolyface(selector: 0 | 1, fixup: boolean, tolerance: number = Geometry.smallMetricDistance): IndexedPolyface | undefined {\r\n const builder = selector === 0 ? this.builderA : this.builderB;\r\n if (builder) {\r\n let polyface = builder.claimPolyface(true, tolerance);\r\n if (fixup) {\r\n polyface = PolyfaceQuery.cloneWithTVertexFixup(polyface);\r\n polyface = PolyfaceQuery.cloneWithDanglingEdgesRemoved(polyface);\r\n }\r\n return polyface;\r\n }\r\n return undefined;\r\n }\r\n}\r\n/** PolyfaceClip is a static class gathering operations using Polyfaces and clippers.\r\n * @public\r\n */\r\nexport class PolyfaceClip {\r\n /** Clip each facet of polyface to the ClipPlane.\r\n * * Return all surviving clip as a new mesh.\r\n * * WARNING: The new mesh is \"points only\" -- parameters, normals, etc are not interpolated\r\n */\r\n public static clipPolyfaceClipPlaneWithClosureFace(polyface: Polyface, clipper: ClipPlane, insideClip: boolean = true, buildClosureFaces: boolean = true): IndexedPolyface {\r\n return this.clipPolyfaceClipPlane(polyface, clipper, insideClip, buildClosureFaces);\r\n }\r\n /** Clip each facet of polyface to the ClipPlane.\r\n * * Return all surviving clip as a new mesh.\r\n * * WARNING: The new mesh is \"points only\" -- parameters, normals, etc are not interpolated\r\n */\r\n public static clipPolyfaceClipPlane(polyface: Polyface, clipper: ClipPlane, insideClip: boolean = true, buildClosureFaces: boolean = false): IndexedPolyface {\r\n const builders = ClippedPolyfaceBuilders.create(insideClip, !insideClip, buildClosureFaces);\r\n this.clipPolyfaceInsideOutside(polyface, clipper, builders);\r\n return builders.claimPolyface(insideClip ? 0 : 1, true)!;\r\n }\r\n\r\n /** Clip each facet of polyface to the ClipPlane.\r\n * * Return surviving clip as a new mesh.\r\n * * WARNING: The new mesh is \"points only\".\r\n */\r\n public static clipPolyfaceConvexClipPlaneSet(polyface: Polyface, clipper: ConvexClipPlaneSet): IndexedPolyface {\r\n const visitor = polyface.createVisitor(0);\r\n const builder = PolyfaceBuilder.create();\r\n const work = new GrowableXYZArray(10);\r\n for (visitor.reset(); visitor.moveToNextFacet();) {\r\n clipper.clipConvexPolygonInPlace(visitor.point, work);\r\n if (visitor.point.length > 2)\r\n builder.addPolygonGrowableXYZArray(visitor.point);\r\n }\r\n return builder.claimPolyface(true);\r\n }\r\n\r\n /** Clip each facet of polyface to the the clippers.\r\n * * Add inside, outside fragments to builderA, builderB\r\n * * This does not consider params, normals, colors. Just points.\r\n * * outputSelect determines how the clip output is structured\r\n * * 0 outputs all shards -- this may have many interior edges.\r\n * * 1 stitches shards together to get cleaner facets.\r\n */\r\n public static clipPolyfaceUnionOfConvexClipPlaneSetsToBuilders(polyface: Polyface | PolyfaceVisitor, allClippers: UnionOfConvexClipPlaneSets, destination: ClippedPolyfaceBuilders, outputSelector: number = 1) {\r\n if (polyface instanceof Polyface) {\r\n this.clipPolyfaceUnionOfConvexClipPlaneSetsToBuilders(polyface.createVisitor(0), allClippers, destination, outputSelector);\r\n return;\r\n }\r\n const builderA = destination.builderA;\r\n const builderB = destination.builderB;\r\n const visitor = polyface; // alias; we have a visitor now\r\n const cache = new GrowableXYZArrayCache();\r\n const insideShards: GrowableXYZArray[] = [];\r\n const outsideShards: GrowableXYZArray[] = [];\r\n const residualPolygons: ClipCandidate[] = [];\r\n let candidate: ClipCandidate | undefined;\r\n const outsideParts: GrowableXYZArray[] = [];\r\n\r\n const numConvexSet = allClippers.convexSets.length;\r\n for (visitor.reset(); visitor.moveToNextFacet();) {\r\n residualPolygons.push(new ClipCandidate(cache.grabAndFill(visitor.point), 0));\r\n while ((candidate = residualPolygons.pop()) !== undefined) {\r\n const convexSetIndex = candidate.nextConvexSetIndex;\r\n if (convexSetIndex >= numConvexSet) {\r\n // ths remnant polygon is OUT ...\r\n if (candidate.points.length > 2)\r\n outsideShards.push(candidate.points);\r\n } else {\r\n const clipper = allClippers.convexSets[convexSetIndex];\r\n outsideParts.length = 0; // NO NO -- why isn't it empty from prior step cleanup?\r\n const insidePart = clipper.clipInsidePushOutside(candidate.points, outsideParts, cache);\r\n if (insidePart) {\r\n if (insidePart.length > 2)\r\n insideShards.push(insidePart);\r\n // Keep outside parts active for clip by later facets . . .\r\n for (const outsidePolygon of outsideParts) {\r\n residualPolygons.push(new ClipCandidate(outsidePolygon, convexSetIndex + 1));\r\n }\r\n } else {\r\n // Nothing was insidePart. The outside parts might be split by intermediate steps -- but all the pieces are there.\r\n candidate.nextConvexSetIndex++;\r\n residualPolygons.push(candidate);\r\n }\r\n outsideParts.length = 0;\r\n }\r\n }\r\n if (outsideShards.length === 0) {\r\n builderA?.addPolygonGrowableXYZArray(visitor.point);\r\n } else if (insideShards.length === 0) {\r\n // the facet spanned clippers but is intact outside\r\n builderB?.addPolygonGrowableXYZArray(visitor.point);\r\n } else {\r\n const localToWorld = FrameBuilder.createRightHandedFrame(undefined, visitor.point);\r\n let worldToLocal: Transform | undefined;\r\n if (outputSelector === 1 && localToWorld !== undefined\r\n && undefined !== (worldToLocal = localToWorld.inverse())) {\r\n this.cleanupAndAddRegion(builderA, insideShards, worldToLocal, localToWorld);\r\n this.cleanupAndAddRegion(builderB, outsideShards, worldToLocal, localToWorld);\r\n } else {\r\n for (const shard of insideShards)\r\n this.addPolygonToBuilderAndDropToCache(shard, builderA, cache);\r\n for (const shard of outsideShards)\r\n this.addPolygonToBuilderAndDropToCache(shard, builderB, cache);\r\n }\r\n }\r\n outsideShards.length = 0;\r\n insideShards.length = 0;\r\n }\r\n cache.dropAllToCache(outsideParts);\r\n if (destination.buildClosureFaces) {\r\n for (const clipper of allClippers.convexSets) {\r\n this.buildClosureFacesForConvexSet(visitor, clipper, destination, cache);\r\n }\r\n }\r\n }\r\n private static addRegion(builder: PolyfaceBuilder | undefined, region: AnyRegion | undefined) {\r\n if (builder !== undefined && region !== undefined) {\r\n if (region instanceof Loop && region.children.length === 1 && region.children[0] instanceof LineString3d) {\r\n builder.addPolygonGrowableXYZArray(region.children[0].packedPoints);\r\n } else if (region instanceof UnionRegion) {\r\n for (const child of region.children)\r\n this.addRegion(builder, child);\r\n } else {\r\n assert(false, \"unexpected region encountered\");\r\n }\r\n }\r\n }\r\n // WARNING: shards are transformed into local system, not reverted!!!\r\n private static cleanupAndAddRegion(builder: PolyfaceBuilder | undefined, shards: GrowableXYZArray[],\r\n worldToLocal: Transform | undefined, localToWorld: Transform | undefined) {\r\n if (builder !== undefined && shards.length > 0) {\r\n if (worldToLocal)\r\n GrowableXYZArray.multiplyTransformInPlace(worldToLocal, shards);\r\n const outsidePieces = RegionOps.polygonBooleanXYToLoops(shards, RegionBinaryOpType.Union, []);\r\n if (outsidePieces && outsidePieces.children.length > 0) {\r\n RegionOps.consolidateAdjacentPrimitives(outsidePieces); // source of the T-vertices removed in claimPolyface\r\n const options = new StrokeOptions();\r\n options.maximizeConvexFacets = true;\r\n const localFacets = RegionOps.facetRegionXY(outsidePieces, options);\r\n if (localFacets) {\r\n // prefer to add non-convex facets\r\n builder.addIndexedPolyface(localFacets, false, localToWorld);\r\n } else { // failsafe; we don't expect to get here\r\n if (localToWorld)\r\n outsidePieces.tryTransformInPlace(localToWorld);\r\n this.addRegion(builder, outsidePieces); // possibly non-convex!\r\n }\r\n }\r\n }\r\n }\r\n private static addPolygonToBuilderAndDropToCache(polygon: GrowableXYZArray | undefined, builder: PolyfaceBuilder | undefined, cache: GrowableXYZArrayCache) {\r\n if (polygon) {\r\n if (builder)\r\n builder.addPolygonGrowableXYZArray(polygon);\r\n cache.dropToCache(polygon);\r\n }\r\n }\r\n private static addPolygonArrayToBuilderAndDropToCache(polygonArray: GrowableXYZArray[], builder: PolyfaceBuilder | undefined, cache: GrowableXYZArrayCache) {\r\n let polygon;\r\n while ((polygon = polygonArray.pop()) !== undefined) {\r\n this.addPolygonToBuilderAndDropToCache(polygon, builder, cache);\r\n }\r\n }\r\n private static createChainContextsForConvexClipPlaneSet(clipper: ConvexClipPlaneSet): ChainMergeContext[] {\r\n const chainContexts = [];\r\n for (const plane of clipper.planes) {\r\n if (!plane.interior) {\r\n const c = ChainMergeContext.create();\r\n c.plane = plane;\r\n c.convexClipper = clipper;\r\n chainContexts.push(c);\r\n }\r\n }\r\n return chainContexts;\r\n }\r\n\r\n /** Clip each facet of polyface to the the clippers.\r\n * * Add inside, outside fragments to builderA, builderB\r\n * * This does not consider params, normals, colors. Just points.\r\n * @internal\r\n */\r\n public static clipPolyfaceConvexClipPlaneSetToBuilders(polyface: Polyface, clipper: ConvexClipPlaneSet, destination: ClippedPolyfaceBuilders) {\r\n const builderA = destination.builderA;\r\n const builderB = destination.builderB;\r\n const visitor = polyface.createVisitor(0);\r\n const cache = new GrowableXYZArrayCache();\r\n const outsideParts: GrowableXYZArray[] = [];\r\n for (visitor.reset(); visitor.moveToNextFacet();) {\r\n // !!! currentCandidates and next candidates are empty at this point !!!\r\n const insidePart = clipper.clipInsidePushOutside(visitor.point, outsideParts, cache);\r\n if (insidePart === undefined) {\r\n // everything is out ... outsideParts might be fragmented. Save only the original polygon\r\n builderB?.addPolygonGrowableXYZArray(visitor.point);\r\n cache.dropToCache(insidePart);\r\n cache.dropAllToCache(outsideParts);\r\n }\r\n this.addPolygonToBuilderAndDropToCache(insidePart, builderA, cache);\r\n this.addPolygonArrayToBuilderAndDropToCache(outsideParts, builderB, cache);\r\n }\r\n this.buildClosureFacesForConvexSet(visitor, clipper, destination, cache);\r\n }\r\n /**\r\n *\r\n * @param visitor visitor for all facets of interest (entire polyface)\r\n * @param clipper ConvexClipPlaneSet to apply\r\n * @param destination builders to receive inside, outside parts\r\n * @param cache GrowableArray cache.\r\n */\r\n private static buildClosureFacesForConvexSet(visitor: PolyfaceVisitor, clipper: ConvexClipPlaneSet, destination: ClippedPolyfaceBuilders,\r\n cache: GrowableXYZArrayCache) {\r\n if (destination.buildClosureFaces) {\r\n const chainContexts = this.createChainContextsForConvexClipPlaneSet(clipper);\r\n const workPoints = cache.grabFromCache();\r\n const facetPoints = cache.grabFromCache();\r\n for (visitor.reset(); visitor.moveToNextFacet();) {\r\n for (const chainContext of chainContexts) {\r\n const plane = chainContext.plane;\r\n facetPoints.clear();\r\n facetPoints.pushFrom(visitor.point);\r\n IndexedXYZCollectionPolygonOps.clipConvexPolygonInPlace(plane!, facetPoints, workPoints);\r\n chainContext.addSegmentsOnPlane(facetPoints, true);\r\n }\r\n }\r\n cache.dropToCache(facetPoints);\r\n cache.dropToCache(workPoints);\r\n for (const chainContext of chainContexts) {\r\n this.addClosureFacets(chainContext, destination, cache);\r\n }\r\n }\r\n }\r\n\r\n /**\r\n *\r\n * @param visitor visitor for all facets of interest (entire polyface)\r\n * @param clipper ConvexClipPlaneSet to apply\r\n * @param destination builders to receive inside, outside parts\r\n * @param cache GrowableArray cache.\r\n */\r\n private static buildClosureFacesForPlane(visitor: PolyfaceVisitor, plane: PlaneAltitudeEvaluator, destination: ClippedPolyfaceBuilders,\r\n cache: GrowableXYZArrayCache) {\r\n if (destination.buildClosureFaces) {\r\n const chainContext = ChainMergeContext.create();\r\n chainContext.plane = plane;\r\n const workPoints = cache.grabFromCache();\r\n const facetPoints = cache.grabFromCache();\r\n for (visitor.reset(); visitor.moveToNextFacet();) {\r\n facetPoints.clear();\r\n facetPoints.pushFrom(visitor.point);\r\n IndexedXYZCollectionPolygonOps.clipConvexPolygonInPlace(plane, facetPoints, workPoints);\r\n chainContext.addSegmentsOnPlane(facetPoints, true);\r\n }\r\n cache.dropToCache(facetPoints);\r\n cache.dropToCache(workPoints);\r\n this.addClosureFacets(chainContext, destination, cache);\r\n }\r\n }\r\n private static evaluateInwardPlaneNormal(plane: PlaneAltitudeEvaluator, scale: number): Vector3d {\r\n return Vector3d.create(plane.velocityXYZ(scale, 0, 0), plane.velocityXYZ(0, scale, 0), plane.velocityXYZ(0, 0, scale));\r\n }\r\n /**\r\n * * Triangulate the contour.\r\n * * Add all the triangles to both builders\r\n * * reversed in builderB.\r\n */\r\n private static addClippedContour(contour: SweepContour, clipper: ConvexClipPlaneSet | undefined, destination: ClippedPolyfaceBuilders, cache: GrowableXYZArrayCache) {\r\n const polygonA = cache.grabFromCache();\r\n const polygonB = cache.grabFromCache();\r\n if (destination.builderB)\r\n destination.builderB.toggleReversedFacetFlag();\r\n contour.announceFacets((facets: IndexedPolyface) => {\r\n const visitor = facets.createVisitor();\r\n // The contour facets are convex .. easy clip ..\r\n for (visitor.reset(); visitor.moveToNextFacet();) {\r\n polygonA.clear();\r\n polygonA.pushFromGrowableXYZArray(visitor.point);\r\n clipper?.clipConvexPolygonInPlace(polygonA, polygonB);\r\n if (polygonA.length > 2) {\r\n destination.builderA?.addPolygonGrowableXYZArray(polygonA);\r\n destination.builderB?.addPolygonGrowableXYZArray(polygonA);\r\n }\r\n }\r\n }, undefined);\r\n if (destination.builderB)\r\n destination.builderB.toggleReversedFacetFlag();\r\n cache.dropToCache(polygonA);\r\n cache.dropToCache(polygonB);\r\n }\r\n\r\n /**\r\n * Gather loops out of the ChainMergeContext. Add to destination arrays.\r\n * @param chainContext ASSUMED TO HAVE A PLANE\r\n * @param destination\r\n */\r\n private static addClosureFacets(chainContext: ChainMergeContext, destination: ClippedPolyfaceBuilders, cache: GrowableXYZArrayCache) {\r\n const clipper = chainContext.convexClipper;\r\n const plane = chainContext.plane!;\r\n const outwardNormal = this.evaluateInwardPlaneNormal(plane, -1.0);\r\n chainContext.clusterAndMergeVerticesXYZ();\r\n const loops = chainContext.collectMaximalGrowableXYZArrays();\r\n if (loops.length > 1) {\r\n const loopSets = PolygonOps.sortOuterAndHoleLoops(loops, outwardNormal);\r\n for (const loopSet of loopSets) {\r\n PolygonOps.orientLoopsCCWForOutwardNormalInPlace(loopSet, outwardNormal);\r\n const contour = SweepContour.createForPolygon(loopSet, outwardNormal);\r\n if (contour !== undefined) {\r\n if (clipper) {\r\n this.addClippedContour(contour, clipper, destination, cache);\r\n } else {\r\n if (destination.builderA)\r\n contour.emitFacets(destination.builderA, false);\r\n if (destination.builderB)\r\n contour.emitFacets(destination.builderB, true);\r\n }\r\n }\r\n }\r\n } else {\r\n PolygonOps.orientLoopsCCWForOutwardNormalInPlace(loops, outwardNormal);\r\n const contour = SweepContour.createForPolygon(loops, outwardNormal);\r\n if (contour !== undefined) {\r\n if (clipper) {\r\n this.addClippedContour(contour, clipper, destination, cache);\r\n } else {\r\n if (destination.builderA)\r\n contour.emitFacets(destination.builderA, false);\r\n if (destination.builderB)\r\n contour.emitFacets(destination.builderB, true);\r\n }\r\n }\r\n }\r\n }\r\n\r\n /** Clip each facet of polyface to the the clippers.\r\n * * Add inside, outside fragments to builderA, builderB\r\n * * This does not consider params, normals, colors. Just points.\r\n * @internal\r\n */\r\n public static clipPolyfaceClipPlaneToBuilders(polyface: Polyface, clipper: PlaneAltitudeEvaluator, destination: ClippedPolyfaceBuilders) {\r\n const builderA = destination.builderA;\r\n const builderB = destination.builderB;\r\n const visitor = polyface.createVisitor(0);\r\n const cache = new GrowableXYZArrayCache();\r\n const inside = cache.grabFromCache();\r\n const outside = cache.grabFromCache();\r\n const range = Range1d.createNull();\r\n for (visitor.reset(); visitor.moveToNextFacet();) {\r\n // !!! currentCandidates and next candidates are empty at this point !!!\r\n IndexedXYZCollectionPolygonOps.splitConvexPolygonInsideOutsidePlane(clipper, visitor.point, inside, outside, range);\r\n if (builderA)\r\n builderA.addPolygonGrowableXYZArray(inside);\r\n if (builderB)\r\n builderB.addPolygonGrowableXYZArray(outside);\r\n }\r\n this.buildClosureFacesForPlane(visitor, clipper, destination, cache);\r\n cache.dropToCache(inside);\r\n cache.dropToCache(outside);\r\n }\r\n\r\n /** Clip each facet of polyface to the ClipPlane or ConvexClipPlaneSet\r\n * * accumulate inside and outside facets -- to destination.builderA and destination.builderB\r\n * * if `destination.buildClosureFaces` is set, and also build closure facets\r\n * * This method parses the variant input types and calls a more specific method.\r\n * * WARNING: The new mesh is \"points only\".\r\n * * outputSelect applies only for UnionOfConvexClipPlaneSets -- see [[PolyfaceClip.clipPolyfaceUnionOfConvexClipPlaneSetsToBuilders]]\r\n */\r\n public static clipPolyfaceInsideOutside(polyface: Polyface, clipper: ClipPlane | ConvexClipPlaneSet | UnionOfConvexClipPlaneSets, destination: ClippedPolyfaceBuilders,\r\n outputSelect: number = 0) {\r\n if (clipper instanceof ClipPlane) {\r\n this.clipPolyfaceClipPlaneToBuilders(polyface, clipper, destination);\r\n } else if (clipper instanceof ConvexClipPlaneSet) {\r\n this.clipPolyfaceConvexClipPlaneSetToBuilders(polyface, clipper, destination);\r\n } else if (clipper instanceof UnionOfConvexClipPlaneSets) {\r\n this.clipPolyfaceUnionOfConvexClipPlaneSetsToBuilders(polyface, clipper, destination, outputSelect);\r\n }\r\n }\r\n /** Clip each facet of polyface to the ClipPlane or ConvexClipPlaneSet\r\n * * This method parses the variant input types and calls a more specific method.\r\n * * To get both inside and outside parts, use clipPolyfaceInsideOutside\r\n * * WARNING: The new mesh is \"points only\".\r\n */\r\n public static clipPolyface(polyface: Polyface, clipper: ClipPlane | ConvexClipPlaneSet): Polyface | undefined {\r\n if (clipper instanceof ClipPlane)\r\n return this.clipPolyfaceClipPlane(polyface, clipper);\r\n if (clipper instanceof ConvexClipPlaneSet)\r\n return this.clipPolyfaceConvexClipPlaneSet(polyface, clipper);\r\n // (The if tests exhaust the type space -- this line is unreachable.)\r\n return undefined;\r\n }\r\n /**\r\n * Drape the region onto the mesh.\r\n * * This method computes the portion of the input mesh that lies inside the clipper generated from sweeping the input region in the given direction.\r\n * @param mesh input mesh, untouched\r\n * @param region planar region to drape onto mesh\r\n * @param sweepVector optional sweep direction for region, magnitude unused. If undefined, sweep is along the region normal.\r\n * @param options how to stroke the region boundary\r\n * @returns clipped facets. No other mesh data but vertices appear in output.\r\n */\r\n public static drapeRegion(mesh: Polyface | PolyfaceVisitor, region: AnyRegion, sweepVector?: Vector3d, options?: StrokeOptions): IndexedPolyface | undefined {\r\n if (mesh instanceof Polyface)\r\n return this.drapeRegion(mesh.createVisitor(0), region, sweepVector, options);\r\n const contour = SweepContour.createForLinearSweep(region);\r\n if (!contour)\r\n return undefined;\r\n let sweep = sweepVector;\r\n if (sweepVector && contour.localToWorld.matrix.dotColumnZ(sweepVector) < 0.0)\r\n sweep = sweepVector.scale(-1); // avoid inverted clipper\r\n const clipper = contour.sweepToUnionOfConvexClipPlaneSets(sweep, false, false, options);\r\n if (!clipper)\r\n return undefined;\r\n const builders = ClippedPolyfaceBuilders.create(true); // we want only the facets inside the clipper\r\n this.clipPolyfaceUnionOfConvexClipPlaneSetsToBuilders(mesh, clipper, builders, 1);\r\n return builders.claimPolyface(0, true);\r\n }\r\n /** Find consecutive points around a polygon (with implied closure edge) that are ON a plane\r\n * @param points array of points around polygon. Closure edge is implied.\r\n * @param chainContext context receiving edges\r\n * @param point0 work point\r\n * @param point1 work point\r\n */\r\n private static collectEdgesOnPlane(points: GrowableXYZArray, clipper: ClipPlane, chainContext: ChainMergeContext, point0: Point3d, point1: Point3d) {\r\n const n = points.length;\r\n if (n > 1) {\r\n points.getPoint3dAtUncheckedPointIndex(n - 1, point0);\r\n for (let i = 0; i < n; i++) {\r\n points.getPoint3dAtUncheckedPointIndex(i, point1);\r\n if (clipper.isPointOn(point0) && clipper.isPointOn(point1))\r\n chainContext.addSegment(point0, point1);\r\n point0.setFromPoint3d(point1);\r\n }\r\n }\r\n }\r\n /** Intersect each facet with the clip plane. (Producing intersection edges.)\r\n * * Return all edges chained as array of LineString3d.\r\n */\r\n public static sectionPolyfaceClipPlane(polyface: Polyface, clipper: ClipPlane): LineString3d[] {\r\n const chainContext = ChainMergeContext.create();\r\n\r\n const visitor = polyface.createVisitor(0);\r\n const work = new GrowableXYZArray(10);\r\n const point0 = Point3d.create();\r\n const point1 = Point3d.create();\r\n for (visitor.reset(); visitor.moveToNextFacet();) {\r\n clipper.clipConvexPolygonInPlace(visitor.point, work, true);\r\n this.collectEdgesOnPlane(visitor.point, clipper, chainContext, point0, point1);\r\n }\r\n chainContext.clusterAndMergeVerticesXYZ();\r\n return chainContext.collectMaximalChains();\r\n }\r\n\r\n /**\r\n * * Split facets of mesh \"A\" into parts that are\r\n * * under mesh \"B\"\r\n * * over mesh \"B\"\r\n * * both meshes are represented by visitors rather than the meshes themselves\r\n * * If the data in-hand is a mesh, call with `mesh.createVisitor`\r\n * * The respective clip parts are fed to caller-supplied builders.\r\n * * Caller may set either or both builders to toggle facet order (e.g. toggle the lower facets to make them \"point down\" in cut-fill application)\r\n * * This step is commonly one-half of \"cut fill\".\r\n * * A \"cut fill\" wrapper will call this twice with the visitor and builder roles reversed.\r\n * * Both polyfaces are assumed convex with CCW orientation viewed from above.\r\n * @param visitorA iterator over polyface to be split.\r\n * @param visitorB iterator over polyface that acts as a splitter\r\n * @param orientUnderMeshDownward if true, the \"meshAUnderB\" output is oriented with its normals reversed so it can act as the bottom side of a cut-fill pair.\r\n */\r\n public static clipPolyfaceUnderOverConvexPolyfaceIntoBuilders(visitorA: PolyfaceVisitor, visitorB: PolyfaceVisitor,\r\n builderAUnderB: PolyfaceBuilder | undefined,\r\n builderAOverB: PolyfaceBuilder | undefined) {\r\n const rangeDataA = PolyfaceQuery.collectRangeLengthData(visitorA);\r\n const searchA = RangeSearch.create2dSearcherForRangeLengthData<number>(rangeDataA);\r\n if (!searchA)\r\n return;\r\n const range = Range3d.create();\r\n for (visitorA.reset(); visitorA.moveToNextFacet();) {\r\n visitorA.point.setRange(range);\r\n searchA.addRange(range, visitorA.currentReadIndex());\r\n }\r\n const xyClip = new GrowableXYZArray(10);\r\n const workArray = new GrowableXYZArray(10);\r\n const xyFrustum = ConvexClipPlaneSet.createEmpty();\r\n const below = new GrowableXYZArray(10);\r\n const above = new GrowableXYZArray(10);\r\n const planeOfFacet = ClipPlane.createNormalAndPointXYZXYZ(0, 0, 1, 0, 0, 0)!;\r\n const altitudeRange = Range1d.createNull();\r\n\r\n for (visitorB.reset(); visitorB.moveToNextFacet();) {\r\n visitorB.point.setRange(range);\r\n ConvexClipPlaneSet.setPlaneAndXYLoopCCW(visitorB.point, planeOfFacet, xyFrustum);\r\n searchA.searchRange2d(range, (_rangeA: Range2d, readIndexA: number) => {\r\n visitorA.moveToReadIndex(readIndexA);\r\n xyFrustum.polygonClip(visitorA.point, xyClip, workArray);\r\n // builderAOverB.addPolygonGrowableXYZArray(xyClip);\r\n if (xyClip.length > 0) {\r\n // planeOfFacet.convexPolygonSplitInsideOutsideGrowableArrays(xyClip, below, above, altitudeRange);\r\n IndexedXYZCollectionPolygonOps.splitConvexPolygonInsideOutsidePlane(planeOfFacet, xyClip, below, above, altitudeRange);\r\n if (below.length > 0 && builderAUnderB)\r\n builderAUnderB.addPolygonGrowableXYZArray(below);\r\n if (above.length > 0 && builderAOverB)\r\n builderAOverB.addPolygonGrowableXYZArray(above);\r\n }\r\n return true;\r\n });\r\n }\r\n }\r\n\r\n /**\r\n * * Split facets into vertically overlapping sections\r\n * * both meshes are represented by visitors rather than the meshes themselves\r\n * * If the data in-hand is a mesh, call with `mesh.createVisitor`\r\n * * The respective clip parts are returned as separate meshes.\r\n * * Caller may set either or both builders to toggle facet order (e.g. toggle the lower facets to make them \"point down\" in cut-fill application)\r\n * * Both polyfaces are assumed convex with CCW orientation viewed from above.\r\n * * Each output contains some facets from meshA and some from meshB:\r\n * * meshAUnderB -- areas where meshA is underneath mesh B.\r\n * * If A is \"design surface\" and B is existing DTM, this is \"cut\" volume\r\n * * meshAOverB -- areas where meshB is over meshB.\r\n * * If A is \"design surface\" and B is existing DTM, this is \"fill\" volume\r\n *\r\n * @param visitorA iterator over polyface to be split.\r\n * @param visitorB iterator over polyface that acts as a splitter\r\n * @param orientUnderMeshDownward if true, the \"meshAUnderB\" output is oriented with its normals reversed so it can act as the bottom side of a cut-fill pair.\r\n */\r\n public static computeCutFill(meshA: IndexedPolyface, meshB: IndexedPolyface): { meshAUnderB: IndexedPolyface, meshAOverB: IndexedPolyface } {\r\n const visitorA = meshA.createVisitor();\r\n const visitorB = meshB.createVisitor();\r\n const builderAUnderB = PolyfaceBuilder.create();\r\n const builderAOverB = PolyfaceBuilder.create();\r\n builderAUnderB.toggleReversedFacetFlag();\r\n this.clipPolyfaceUnderOverConvexPolyfaceIntoBuilders(visitorA, visitorB, builderAUnderB, builderAOverB);\r\n builderAUnderB.toggleReversedFacetFlag();\r\n builderAOverB.toggleReversedFacetFlag();\r\n this.clipPolyfaceUnderOverConvexPolyfaceIntoBuilders(visitorB, visitorA, builderAOverB, builderAUnderB);\r\n return {\r\n meshAUnderB: builderAUnderB.claimPolyface(),\r\n meshAOverB: builderAOverB.claimPolyface(),\r\n };\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"PolyfaceClip.js","sourceRoot":"","sources":["../../../src/polyface/PolyfaceClip.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F;;GAEG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAE,0BAA0B,EAAE,MAAM,wCAAwC,CAAC;AAEpF,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AACrC,OAAO,EAAE,kBAAkB,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AACnE,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,QAAQ,EAA0B,MAAM,aAAa,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAClE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,8BAA8B,EAAE,UAAU,EAAE,MAAM,0BAA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M,GAAG,CAAC,EAAE,CAAC;oBACtB,mGAAmG;oBACnG,8BAA8B,CAAC,oCAAoC,CAAC,YAAY,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,aAAa,CAAC,CAAC;oBACvH,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,IAAI,cAAc;wBACpC,cAAc,CAAC,0BAA0B,CAAC,KAAK,CAAC,CAAC;oBACnD,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,IAAI,aAAa;wBACnC,aAAa,CAAC,0BAA0B,CAAC,KAAK,CAAC,CAAC;gBACpD,CAAC;gBACD,OAAO,IAAI,CAAC;YACd,CAAC,CAAC,CAAC;QACL,CAAC;IACH,CAAC;IAED;;;;;;;;;;;;;;;;OAgBG;IACI,MAAM,CAAC,cAAc,CAAC,KAAsB,EAAE,KAAsB;QACzE,MAAM,QAAQ,GAAG,KAAK,CAAC,aAAa,EAAE,CAAC;QACvC,MAAM,QAAQ,GAAG,KAAK,CAAC,aAAa,EAAE,CAAC;QACvC,MAAM,cAAc,GAAG,eAAe,CAAC,MAAM,EAAE,CAAC;QAChD,MAAM,aAAa,GAAG,eAAe,CAAC,MAAM,EAAE,CAAC;QAC/C,cAAc,CAAC,uBAAuB,EAAE,CAAC;QACzC,IAAI,CAAC,+CAA+C,CAAC,QAAQ,EAAE,QAAQ,EAAE,cAAc,EAAE,aAAa,CAAC,CAAC;QACxG,cAAc,CAAC,uBAAuB,EAAE,CAAC;QACzC,aAAa,CAAC,uBAAuB,EAAE,CAAC;QACxC,IAAI,CAAC,+CAA+C,CAAC,QAAQ,EAAE,QAAQ,EAAE,aAAa,EAAE,cAAc,CAAC,CAAC;QACxG,OAAO;YACL,WAAW,EAAE,cAAc,CAAC,aAAa,EAAE;YAC3C,UAAU,EAAE,aAAa,CAAC,aAAa,EAAE;SAC1C,CAAC;IACJ,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\n/** @packageDocumentation\n * @module Polyface\n */\n\nimport { assert } from \"@itwin/core-bentley\";\nimport { ClipPlane } from \"../clipping/ClipPlane\";\nimport { ConvexClipPlaneSet } from \"../clipping/ConvexClipPlaneSet\";\nimport { UnionOfConvexClipPlaneSets } from \"../clipping/UnionOfConvexClipPlaneSets\";\nimport { AnyRegion } from \"../curve/CurveTypes\";\nimport { LineString3d } from \"../curve/LineString3d\";\nimport { Loop } from \"../curve/Loop\";\nimport { RegionBinaryOpType, RegionOps } from \"../curve/RegionOps\";\nimport { StrokeOptions } from \"../curve/StrokeOptions\";\nimport { UnionRegion } from \"../curve/UnionRegion\";\nimport { Geometry, PlaneAltitudeEvaluator } from \"../Geometry\";\nimport { FrameBuilder } from \"../geometry3d/FrameBuilder\";\nimport { GrowableXYZArray } from \"../geometry3d/GrowableXYZArray\";\nimport { Point3d, Vector3d } from \"../geometry3d/Point3dVector3d\";\nimport { IndexedXYZCollectionPolygonOps, PolygonOps } from \"../geometry3d/PolygonOps\";\nimport { Range1d, Range2d, Range3d } from \"../geometry3d/Range\";\nimport { GrowableXYZArrayCache } from \"../geometry3d/ReusableObjectCache\";\nimport { Transform } from \"../geometry3d/Transform\";\nimport { SweepContour } from \"../solid/SweepContour\";\nimport { ChainMergeContext } from \"../topology/ChainMerge\";\nimport { RangeSearch } from \"./multiclip/RangeSearch\";\nimport { IndexedPolyface, Polyface, PolyfaceVisitor } from \"./Polyface\";\nimport { PolyfaceBuilder } from \"./PolyfaceBuilder\";\nimport { PolyfaceQuery } from \"./PolyfaceQuery\";\n\n/**\n * carrier for a point array with an index into UnionOfConvexClipPlaneSets\n * @private\n */\nclass ClipCandidate {\n public nextConvexSetIndex: number;\n public points: GrowableXYZArray;\n public constructor(points: GrowableXYZArray, nextConvexSetIndex: number) {\n this.nextConvexSetIndex = nextConvexSetIndex;\n this.points = points;\n }\n}\n\n/**\n * A pair of [[PolyfaceBuilder]] objects, for use by clippers that emit inside and outside parts.\n * * @public\n */\nexport class ClippedPolyfaceBuilders {\n /** An available builder. Typically the \"inside\" parts */\n public builderA?: PolyfaceBuilder;\n /** An available builder. Typically the \"outside\" parts */\n public builderB?: PolyfaceBuilder;\n /** request to construct cut faces */\n public buildClosureFaces?: boolean;\n private constructor(builderA: PolyfaceBuilder | undefined, builderB: PolyfaceBuilder | undefined, buildClosureFaces: boolean = false) {\n this.builderA = builderA;\n this.builderB = builderB;\n this.buildClosureFaces = buildClosureFaces;\n }\n /**\n * Static constructor with default options for the builders.\n * @param keepInside whether to collect clipped facets inside the clipper to `this.builderA` (default true)\n * @param keepOutside whether to collect clipped facets outside the clipper to `this.builderB` (default false)\n * @param buildSideFaces whether to add side facets to active builders (default false)\n */\n public static create(keepInside: boolean = true, keepOutside: boolean = false, buildSideFaces: boolean = false) {\n return new ClippedPolyfaceBuilders(keepInside ? PolyfaceBuilder.create() : undefined, keepOutside ? PolyfaceBuilder.create() : undefined, buildSideFaces);\n }\n\n /**\n * Return the computed facets from the selected builder.\n * @param selector the polyface to return: 0 - builderA (typically inside facets), 1 - builderB (typically outside facets)\n * @param fixup whether to clean up the polyface\n * @param tolerance compression tolerance (default [[Geometry.smallMetricDistance]]).\n */\n public claimPolyface(selector: 0 | 1, fixup: boolean, tolerance: number = Geometry.smallMetricDistance): IndexedPolyface | undefined {\n const builder = selector === 0 ? this.builderA : this.builderB;\n if (builder) {\n let polyface = builder.claimPolyface(true, tolerance);\n if (fixup) {\n polyface = PolyfaceQuery.cloneWithTVertexFixup(polyface);\n polyface = PolyfaceQuery.cloneWithDanglingEdgesRemoved(polyface);\n }\n return polyface;\n }\n return undefined;\n }\n}\n/** PolyfaceClip is a static class gathering operations using Polyfaces and clippers.\n * @public\n */\nexport class PolyfaceClip {\n /** Clip each facet of polyface to the ClipPlane.\n * * Return all surviving clip as a new mesh.\n * * WARNING: The new mesh is \"points only\" -- parameters, normals, etc are not interpolated\n */\n public static clipPolyfaceClipPlaneWithClosureFace(polyface: Polyface, clipper: ClipPlane, insideClip: boolean = true, buildClosureFaces: boolean = true): IndexedPolyface {\n return this.clipPolyfaceClipPlane(polyface, clipper, insideClip, buildClosureFaces);\n }\n /** Clip each facet of polyface to the ClipPlane.\n * * Return all surviving clip as a new mesh.\n * * WARNING: The new mesh is \"points only\" -- parameters, normals, etc are not interpolated\n */\n public static clipPolyfaceClipPlane(polyface: Polyface, clipper: ClipPlane, insideClip: boolean = true, buildClosureFaces: boolean = false): IndexedPolyface {\n const builders = ClippedPolyfaceBuilders.create(insideClip, !insideClip, buildClosureFaces);\n this.clipPolyfaceInsideOutside(polyface, clipper, builders);\n return builders.claimPolyface(insideClip ? 0 : 1, true)!;\n }\n\n /** Clip each facet of polyface to the ClipPlane.\n * * Return surviving clip as a new mesh.\n * * WARNING: The new mesh is \"points only\".\n */\n public static clipPolyfaceConvexClipPlaneSet(polyface: Polyface, clipper: ConvexClipPlaneSet): IndexedPolyface {\n const visitor = polyface.createVisitor(0);\n const builder = PolyfaceBuilder.create();\n const work = new GrowableXYZArray(10);\n for (visitor.reset(); visitor.moveToNextFacet();) {\n clipper.clipConvexPolygonInPlace(visitor.point, work);\n if (visitor.point.length > 2)\n builder.addPolygonGrowableXYZArray(visitor.point);\n }\n return builder.claimPolyface(true);\n }\n\n /** Clip each facet of polyface to the the clippers.\n * * Add inside, outside fragments to builderA, builderB\n * * This does not consider params, normals, colors. Just points.\n * * outputSelect determines how the clip output is structured\n * * 0 outputs all shards -- this may have many interior edges.\n * * 1 stitches shards together to get cleaner facets.\n */\n public static clipPolyfaceUnionOfConvexClipPlaneSetsToBuilders(polyface: Polyface | PolyfaceVisitor, allClippers: UnionOfConvexClipPlaneSets, destination: ClippedPolyfaceBuilders, outputSelector: number = 1) {\n if (polyface instanceof Polyface) {\n this.clipPolyfaceUnionOfConvexClipPlaneSetsToBuilders(polyface.createVisitor(0), allClippers, destination, outputSelector);\n return;\n }\n const builderA = destination.builderA;\n const builderB = destination.builderB;\n const visitor = polyface; // alias; we have a visitor now\n const cache = new GrowableXYZArrayCache();\n const insideShards: GrowableXYZArray[] = [];\n const outsideShards: GrowableXYZArray[] = [];\n const residualPolygons: ClipCandidate[] = [];\n let candidate: ClipCandidate | undefined;\n const outsideParts: GrowableXYZArray[] = [];\n\n const numConvexSet = allClippers.convexSets.length;\n for (visitor.reset(); visitor.moveToNextFacet();) {\n residualPolygons.push(new ClipCandidate(cache.grabAndFill(visitor.point), 0));\n while ((candidate = residualPolygons.pop()) !== undefined) {\n const convexSetIndex = candidate.nextConvexSetIndex;\n if (convexSetIndex >= numConvexSet) {\n // ths remnant polygon is OUT ...\n if (candidate.points.length > 2)\n outsideShards.push(candidate.points);\n } else {\n const clipper = allClippers.convexSets[convexSetIndex];\n outsideParts.length = 0; // NO NO -- why isn't it empty from prior step cleanup?\n const insidePart = clipper.clipInsidePushOutside(candidate.points, outsideParts, cache);\n if (insidePart) {\n if (insidePart.length > 2)\n insideShards.push(insidePart);\n // Keep outside parts active for clip by later facets . . .\n for (const outsidePolygon of outsideParts) {\n residualPolygons.push(new ClipCandidate(outsidePolygon, convexSetIndex + 1));\n }\n } else {\n // Nothing was insidePart. The outside parts might be split by intermediate steps -- but all the pieces are there.\n candidate.nextConvexSetIndex++;\n residualPolygons.push(candidate);\n }\n outsideParts.length = 0;\n }\n }\n if (outsideShards.length === 0) {\n builderA?.addPolygonGrowableXYZArray(visitor.point);\n } else if (insideShards.length === 0) {\n // the facet spanned clippers but is intact outside\n builderB?.addPolygonGrowableXYZArray(visitor.point);\n } else {\n const localToWorld = FrameBuilder.createRightHandedFrame(undefined, visitor.point);\n let worldToLocal: Transform | undefined;\n if (outputSelector === 1 && localToWorld !== undefined\n && undefined !== (worldToLocal = localToWorld.inverse())) {\n this.cleanupAndAddRegion(builderA, insideShards, worldToLocal, localToWorld);\n this.cleanupAndAddRegion(builderB, outsideShards, worldToLocal, localToWorld);\n } else {\n for (const shard of insideShards)\n this.addPolygonToBuilderAndDropToCache(shard, builderA, cache);\n for (const shard of outsideShards)\n this.addPolygonToBuilderAndDropToCache(shard, builderB, cache);\n }\n }\n outsideShards.length = 0;\n insideShards.length = 0;\n }\n cache.dropAllToCache(outsideParts);\n if (destination.buildClosureFaces) {\n for (const clipper of allClippers.convexSets) {\n this.buildClosureFacesForConvexSet(visitor, clipper, destination, cache);\n }\n }\n }\n private static addRegion(builder: PolyfaceBuilder | undefined, region: AnyRegion | undefined) {\n if (builder !== undefined && region !== undefined) {\n if (region instanceof Loop && region.children.length === 1 && region.children[0] instanceof LineString3d) {\n builder.addPolygonGrowableXYZArray(region.children[0].packedPoints);\n } else if (region instanceof UnionRegion) {\n for (const child of region.children)\n this.addRegion(builder, child);\n } else {\n assert(false, \"unexpected region encountered\");\n }\n }\n }\n // WARNING: shards are transformed into local system, not reverted!!!\n private static cleanupAndAddRegion(builder: PolyfaceBuilder | undefined, shards: GrowableXYZArray[],\n worldToLocal: Transform | undefined, localToWorld: Transform | undefined) {\n if (builder !== undefined && shards.length > 0) {\n if (worldToLocal)\n GrowableXYZArray.multiplyTransformInPlace(worldToLocal, shards);\n const outsidePieces = RegionOps.polygonBooleanXYToLoops(shards, RegionBinaryOpType.Union, []);\n if (outsidePieces && outsidePieces.children.length > 0) {\n RegionOps.consolidateAdjacentPrimitives(outsidePieces); // source of the T-vertices removed in claimPolyface\n const options = new StrokeOptions();\n options.maximizeConvexFacets = true;\n const localFacets = RegionOps.facetRegionXY(outsidePieces, options);\n if (localFacets) {\n // prefer to add non-convex facets\n builder.addIndexedPolyface(localFacets, false, localToWorld);\n } else { // failsafe; we don't expect to get here\n if (localToWorld)\n outsidePieces.tryTransformInPlace(localToWorld);\n this.addRegion(builder, outsidePieces); // possibly non-convex!\n }\n }\n }\n }\n private static addPolygonToBuilderAndDropToCache(polygon: GrowableXYZArray | undefined, builder: PolyfaceBuilder | undefined, cache: GrowableXYZArrayCache) {\n if (polygon) {\n if (builder)\n builder.addPolygonGrowableXYZArray(polygon);\n cache.dropToCache(polygon);\n }\n }\n private static addPolygonArrayToBuilderAndDropToCache(polygonArray: GrowableXYZArray[], builder: PolyfaceBuilder | undefined, cache: GrowableXYZArrayCache) {\n let polygon;\n while ((polygon = polygonArray.pop()) !== undefined) {\n this.addPolygonToBuilderAndDropToCache(polygon, builder, cache);\n }\n }\n private static createChainContextsForConvexClipPlaneSet(clipper: ConvexClipPlaneSet): ChainMergeContext[] {\n const chainContexts = [];\n for (const plane of clipper.planes) {\n if (!plane.interior) {\n const c = ChainMergeContext.create();\n c.plane = plane;\n c.convexClipper = clipper;\n chainContexts.push(c);\n }\n }\n return chainContexts;\n }\n\n /** Clip each facet of polyface to the the clippers.\n * * Add inside, outside fragments to builderA, builderB\n * * This does not consider params, normals, colors. Just points.\n * @internal\n */\n public static clipPolyfaceConvexClipPlaneSetToBuilders(polyface: Polyface, clipper: ConvexClipPlaneSet, destination: ClippedPolyfaceBuilders) {\n const builderA = destination.builderA;\n const builderB = destination.builderB;\n const visitor = polyface.createVisitor(0);\n const cache = new GrowableXYZArrayCache();\n const outsideParts: GrowableXYZArray[] = [];\n for (visitor.reset(); visitor.moveToNextFacet();) {\n // !!! currentCandidates and next candidates are empty at this point !!!\n const insidePart = clipper.clipInsidePushOutside(visitor.point, outsideParts, cache);\n if (insidePart === undefined) {\n // everything is out ... outsideParts might be fragmented. Save only the original polygon\n builderB?.addPolygonGrowableXYZArray(visitor.point);\n cache.dropToCache(insidePart);\n cache.dropAllToCache(outsideParts);\n }\n this.addPolygonToBuilderAndDropToCache(insidePart, builderA, cache);\n this.addPolygonArrayToBuilderAndDropToCache(outsideParts, builderB, cache);\n }\n this.buildClosureFacesForConvexSet(visitor, clipper, destination, cache);\n }\n /**\n *\n * @param visitor visitor for all facets of interest (entire polyface)\n * @param clipper ConvexClipPlaneSet to apply\n * @param destination builders to receive inside, outside parts\n * @param cache GrowableArray cache.\n */\n private static buildClosureFacesForConvexSet(visitor: PolyfaceVisitor, clipper: ConvexClipPlaneSet, destination: ClippedPolyfaceBuilders,\n cache: GrowableXYZArrayCache) {\n if (destination.buildClosureFaces) {\n const chainContexts = this.createChainContextsForConvexClipPlaneSet(clipper);\n const workPoints = cache.grabFromCache();\n const facetPoints = cache.grabFromCache();\n for (visitor.reset(); visitor.moveToNextFacet();) {\n for (const chainContext of chainContexts) {\n const plane = chainContext.plane;\n facetPoints.clear();\n facetPoints.pushFrom(visitor.point);\n IndexedXYZCollectionPolygonOps.clipConvexPolygonInPlace(plane!, facetPoints, workPoints);\n chainContext.addSegmentsOnPlane(facetPoints, true);\n }\n }\n cache.dropToCache(facetPoints);\n cache.dropToCache(workPoints);\n for (const chainContext of chainContexts) {\n this.addClosureFacets(chainContext, destination, cache);\n }\n }\n }\n\n /**\n *\n * @param visitor visitor for all facets of interest (entire polyface)\n * @param clipper ConvexClipPlaneSet to apply\n * @param destination builders to receive inside, outside parts\n * @param cache GrowableArray cache.\n */\n private static buildClosureFacesForPlane(visitor: PolyfaceVisitor, plane: PlaneAltitudeEvaluator, destination: ClippedPolyfaceBuilders,\n cache: GrowableXYZArrayCache) {\n if (destination.buildClosureFaces) {\n const chainContext = ChainMergeContext.create();\n chainContext.plane = plane;\n const workPoints = cache.grabFromCache();\n const facetPoints = cache.grabFromCache();\n for (visitor.reset(); visitor.moveToNextFacet();) {\n facetPoints.clear();\n facetPoints.pushFrom(visitor.point);\n IndexedXYZCollectionPolygonOps.clipConvexPolygonInPlace(plane, facetPoints, workPoints);\n chainContext.addSegmentsOnPlane(facetPoints, true);\n }\n cache.dropToCache(facetPoints);\n cache.dropToCache(workPoints);\n this.addClosureFacets(chainContext, destination, cache);\n }\n }\n private static evaluateInwardPlaneNormal(plane: PlaneAltitudeEvaluator, scale: number): Vector3d {\n return Vector3d.create(plane.velocityXYZ(scale, 0, 0), plane.velocityXYZ(0, scale, 0), plane.velocityXYZ(0, 0, scale));\n }\n /**\n * * Triangulate the contour.\n * * Add all the triangles to both builders\n * * reversed in builderB.\n */\n private static addClippedContour(contour: SweepContour, clipper: ConvexClipPlaneSet | undefined, destination: ClippedPolyfaceBuilders, cache: GrowableXYZArrayCache) {\n const polygonA = cache.grabFromCache();\n const polygonB = cache.grabFromCache();\n if (destination.builderB)\n destination.builderB.toggleReversedFacetFlag();\n contour.announceFacets((facets: IndexedPolyface) => {\n const visitor = facets.createVisitor();\n // The contour facets are convex .. easy clip ..\n for (visitor.reset(); visitor.moveToNextFacet();) {\n polygonA.clear();\n polygonA.pushFromGrowableXYZArray(visitor.point);\n clipper?.clipConvexPolygonInPlace(polygonA, polygonB);\n if (polygonA.length > 2) {\n destination.builderA?.addPolygonGrowableXYZArray(polygonA);\n destination.builderB?.addPolygonGrowableXYZArray(polygonA);\n }\n }\n }, undefined);\n if (destination.builderB)\n destination.builderB.toggleReversedFacetFlag();\n cache.dropToCache(polygonA);\n cache.dropToCache(polygonB);\n }\n\n /**\n * Gather loops out of the ChainMergeContext. Add to destination arrays.\n * @param chainContext ASSUMED TO HAVE A PLANE\n * @param destination\n */\n private static addClosureFacets(chainContext: ChainMergeContext, destination: ClippedPolyfaceBuilders, cache: GrowableXYZArrayCache) {\n const clipper = chainContext.convexClipper;\n const plane = chainContext.plane!;\n const outwardNormal = this.evaluateInwardPlaneNormal(plane, -1.0);\n chainContext.clusterAndMergeVerticesXYZ();\n const loops = chainContext.collectMaximalGrowableXYZArrays();\n if (loops.length > 1) {\n const loopSets = PolygonOps.sortOuterAndHoleLoops(loops, outwardNormal);\n for (const loopSet of loopSets) {\n PolygonOps.orientLoopsCCWForOutwardNormalInPlace(loopSet, outwardNormal);\n const contour = SweepContour.createForPolygon(loopSet, outwardNormal);\n if (contour !== undefined) {\n if (clipper) {\n this.addClippedContour(contour, clipper, destination, cache);\n } else {\n if (destination.builderA)\n contour.emitFacets(destination.builderA, false);\n if (destination.builderB)\n contour.emitFacets(destination.builderB, true);\n }\n }\n }\n } else {\n PolygonOps.orientLoopsCCWForOutwardNormalInPlace(loops, outwardNormal);\n const contour = SweepContour.createForPolygon(loops, outwardNormal);\n if (contour !== undefined) {\n if (clipper) {\n this.addClippedContour(contour, clipper, destination, cache);\n } else {\n if (destination.builderA)\n contour.emitFacets(destination.builderA, false);\n if (destination.builderB)\n contour.emitFacets(destination.builderB, true);\n }\n }\n }\n }\n\n /** Clip each facet of polyface to the the clippers.\n * * Add inside, outside fragments to builderA, builderB\n * * This does not consider params, normals, colors. Just points.\n * @internal\n */\n public static clipPolyfaceClipPlaneToBuilders(polyface: Polyface, clipper: PlaneAltitudeEvaluator, destination: ClippedPolyfaceBuilders) {\n const builderA = destination.builderA;\n const builderB = destination.builderB;\n const visitor = polyface.createVisitor(0);\n const cache = new GrowableXYZArrayCache();\n const inside = cache.grabFromCache();\n const outside = cache.grabFromCache();\n const range = Range1d.createNull();\n for (visitor.reset(); visitor.moveToNextFacet();) {\n // !!! currentCandidates and next candidates are empty at this point !!!\n IndexedXYZCollectionPolygonOps.splitConvexPolygonInsideOutsidePlane(clipper, visitor.point, inside, outside, range);\n if (builderA)\n builderA.addPolygonGrowableXYZArray(inside);\n if (builderB)\n builderB.addPolygonGrowableXYZArray(outside);\n }\n this.buildClosureFacesForPlane(visitor, clipper, destination, cache);\n cache.dropToCache(inside);\n cache.dropToCache(outside);\n }\n\n /** Clip each facet of polyface to the ClipPlane or ConvexClipPlaneSet\n * * accumulate inside and outside facets -- to destination.builderA and destination.builderB\n * * if `destination.buildClosureFaces` is set, and also build closure facets\n * * This method parses the variant input types and calls a more specific method.\n * * WARNING: The new mesh is \"points only\".\n * * outputSelect applies only for UnionOfConvexClipPlaneSets -- see [[PolyfaceClip.clipPolyfaceUnionOfConvexClipPlaneSetsToBuilders]]\n */\n public static clipPolyfaceInsideOutside(polyface: Polyface, clipper: ClipPlane | ConvexClipPlaneSet | UnionOfConvexClipPlaneSets, destination: ClippedPolyfaceBuilders,\n outputSelect: number = 0) {\n if (clipper instanceof ClipPlane) {\n this.clipPolyfaceClipPlaneToBuilders(polyface, clipper, destination);\n } else if (clipper instanceof ConvexClipPlaneSet) {\n this.clipPolyfaceConvexClipPlaneSetToBuilders(polyface, clipper, destination);\n } else if (clipper instanceof UnionOfConvexClipPlaneSets) {\n this.clipPolyfaceUnionOfConvexClipPlaneSetsToBuilders(polyface, clipper, destination, outputSelect);\n }\n }\n /** Clip each facet of polyface to the ClipPlane or ConvexClipPlaneSet\n * * This method parses the variant input types and calls a more specific method.\n * * To get both inside and outside parts, use clipPolyfaceInsideOutside\n * * WARNING: The new mesh is \"points only\".\n */\n public static clipPolyface(polyface: Polyface, clipper: ClipPlane | ConvexClipPlaneSet): Polyface | undefined {\n if (clipper instanceof ClipPlane)\n return this.clipPolyfaceClipPlane(polyface, clipper);\n if (clipper instanceof ConvexClipPlaneSet)\n return this.clipPolyfaceConvexClipPlaneSet(polyface, clipper);\n // (The if tests exhaust the type space -- this line is unreachable.)\n return undefined;\n }\n /**\n * Drape the region onto the mesh.\n * * This method computes the portion of the input mesh that lies inside the clipper generated from sweeping the input region in the given direction.\n * @param mesh input mesh, untouched\n * @param region planar region to drape onto mesh\n * @param sweepVector optional sweep direction for region, magnitude unused. If undefined, sweep is along the region normal.\n * @param options how to stroke the region boundary\n * @returns clipped facets. No other mesh data but vertices appear in output.\n */\n public static drapeRegion(mesh: Polyface | PolyfaceVisitor, region: AnyRegion, sweepVector?: Vector3d, options?: StrokeOptions): IndexedPolyface | undefined {\n if (mesh instanceof Polyface)\n return this.drapeRegion(mesh.createVisitor(0), region, sweepVector, options);\n const contour = SweepContour.createForLinearSweep(region);\n if (!contour)\n return undefined;\n let sweep = sweepVector;\n if (sweepVector && contour.localToWorld.matrix.dotColumnZ(sweepVector) < 0.0)\n sweep = sweepVector.scale(-1); // avoid inverted clipper\n const clipper = contour.sweepToUnionOfConvexClipPlaneSets(sweep, false, false, options);\n if (!clipper)\n return undefined;\n const builders = ClippedPolyfaceBuilders.create(true); // we want only the facets inside the clipper\n this.clipPolyfaceUnionOfConvexClipPlaneSetsToBuilders(mesh, clipper, builders, 1);\n return builders.claimPolyface(0, true);\n }\n /** Find consecutive points around a polygon (with implied closure edge) that are ON a plane\n * @param points array of points around polygon. Closure edge is implied.\n * @param chainContext context receiving edges\n * @param point0 work point\n * @param point1 work point\n */\n private static collectEdgesOnPlane(points: GrowableXYZArray, clipper: ClipPlane, chainContext: ChainMergeContext, point0: Point3d, point1: Point3d) {\n const n = points.length;\n if (n > 1) {\n points.getPoint3dAtUncheckedPointIndex(n - 1, point0);\n for (let i = 0; i < n; i++) {\n points.getPoint3dAtUncheckedPointIndex(i, point1);\n if (clipper.isPointOn(point0) && clipper.isPointOn(point1))\n chainContext.addSegment(point0, point1);\n point0.setFromPoint3d(point1);\n }\n }\n }\n /** Intersect each facet with the clip plane. (Producing intersection edges.)\n * * Return all edges chained as array of LineString3d.\n */\n public static sectionPolyfaceClipPlane(polyface: Polyface, clipper: ClipPlane): LineString3d[] {\n const chainContext = ChainMergeContext.create();\n\n const visitor = polyface.createVisitor(0);\n const work = new GrowableXYZArray(10);\n const point0 = Point3d.create();\n const point1 = Point3d.create();\n for (visitor.reset(); visitor.moveToNextFacet();) {\n clipper.clipConvexPolygonInPlace(visitor.point, work, true);\n this.collectEdgesOnPlane(visitor.point, clipper, chainContext, point0, point1);\n }\n chainContext.clusterAndMergeVerticesXYZ();\n return chainContext.collectMaximalChains();\n }\n\n /**\n * * Split facets of mesh \"A\" into parts that are\n * * under mesh \"B\"\n * * over mesh \"B\"\n * * both meshes are represented by visitors rather than the meshes themselves\n * * If the data in-hand is a mesh, call with `mesh.createVisitor`\n * * The respective clip parts are fed to caller-supplied builders.\n * * Caller may set either or both builders to toggle facet order (e.g. toggle the lower facets to make them \"point down\" in cut-fill application)\n * * This step is commonly one-half of \"cut fill\".\n * * A \"cut fill\" wrapper will call this twice with the visitor and builder roles reversed.\n * * Both polyfaces are assumed convex with CCW orientation viewed from above.\n * @param visitorA iterator over polyface to be split.\n * @param visitorB iterator over polyface that acts as a splitter\n * @param orientUnderMeshDownward if true, the \"meshAUnderB\" output is oriented with its normals reversed so it can act as the bottom side of a cut-fill pair.\n */\n public static clipPolyfaceUnderOverConvexPolyfaceIntoBuilders(visitorA: PolyfaceVisitor, visitorB: PolyfaceVisitor,\n builderAUnderB: PolyfaceBuilder | undefined,\n builderAOverB: PolyfaceBuilder | undefined) {\n const rangeDataA = PolyfaceQuery.collectRangeLengthData(visitorA);\n const searchA = RangeSearch.create2dSearcherForRangeLengthData<number>(rangeDataA);\n if (!searchA)\n return;\n const range = Range3d.create();\n for (visitorA.reset(); visitorA.moveToNextFacet();) {\n visitorA.point.setRange(range);\n searchA.addRange(range, visitorA.currentReadIndex());\n }\n const xyClip = new GrowableXYZArray(10);\n const workArray = new GrowableXYZArray(10);\n const xyFrustum = ConvexClipPlaneSet.createEmpty();\n const below = new GrowableXYZArray(10);\n const above = new GrowableXYZArray(10);\n const planeOfFacet = ClipPlane.createNormalAndPointXYZXYZ(0, 0, 1, 0, 0, 0)!;\n const altitudeRange = Range1d.createNull();\n\n for (visitorB.reset(); visitorB.moveToNextFacet();) {\n visitorB.point.setRange(range);\n ConvexClipPlaneSet.setPlaneAndXYLoopCCW(visitorB.point, planeOfFacet, xyFrustum);\n searchA.searchRange2d(range, (_rangeA: Range2d, readIndexA: number) => {\n visitorA.moveToReadIndex(readIndexA);\n xyFrustum.polygonClip(visitorA.point, xyClip, workArray);\n // builderAOverB.addPolygonGrowableXYZArray(xyClip);\n if (xyClip.length > 0) {\n // planeOfFacet.convexPolygonSplitInsideOutsideGrowableArrays(xyClip, below, above, altitudeRange);\n IndexedXYZCollectionPolygonOps.splitConvexPolygonInsideOutsidePlane(planeOfFacet, xyClip, below, above, altitudeRange);\n if (below.length > 0 && builderAUnderB)\n builderAUnderB.addPolygonGrowableXYZArray(below);\n if (above.length > 0 && builderAOverB)\n builderAOverB.addPolygonGrowableXYZArray(above);\n }\n return true;\n });\n }\n }\n\n /**\n * * Split facets into vertically overlapping sections\n * * both meshes are represented by visitors rather than the meshes themselves\n * * If the data in-hand is a mesh, call with `mesh.createVisitor`\n * * The respective clip parts are returned as separate meshes.\n * * Caller may set either or both builders to toggle facet order (e.g. toggle the lower facets to make them \"point down\" in cut-fill application)\n * * Both polyfaces are assumed convex with CCW orientation viewed from above.\n * * Each output contains some facets from meshA and some from meshB:\n * * meshAUnderB -- areas where meshA is underneath mesh B.\n * * If A is \"design surface\" and B is existing DTM, this is \"cut\" volume\n * * meshAOverB -- areas where meshB is over meshB.\n * * If A is \"design surface\" and B is existing DTM, this is \"fill\" volume\n *\n * @param visitorA iterator over polyface to be split.\n * @param visitorB iterator over polyface that acts as a splitter\n * @param orientUnderMeshDownward if true, the \"meshAUnderB\" output is oriented with its normals reversed so it can act as the bottom side of a cut-fill pair.\n */\n public static computeCutFill(meshA: IndexedPolyface, meshB: IndexedPolyface): { meshAUnderB: IndexedPolyface, meshAOverB: IndexedPolyface } {\n const visitorA = meshA.createVisitor();\n const visitorB = meshB.createVisitor();\n const builderAUnderB = PolyfaceBuilder.create();\n const builderAOverB = PolyfaceBuilder.create();\n builderAUnderB.toggleReversedFacetFlag();\n this.clipPolyfaceUnderOverConvexPolyfaceIntoBuilders(visitorA, visitorB, builderAUnderB, builderAOverB);\n builderAUnderB.toggleReversedFacetFlag();\n builderAOverB.toggleReversedFacetFlag();\n this.clipPolyfaceUnderOverConvexPolyfaceIntoBuilders(visitorB, visitorA, builderAOverB, builderAUnderB);\n return {\n meshAUnderB: builderAUnderB.claimPolyface(),\n meshAOverB: builderAOverB.claimPolyface(),\n };\n }\n}\n"]}
@@ -160,9 +160,19 @@ export declare class PolyfaceData {
160
160
  /** Return the range of the point array (optionally transformed). */
161
161
  range(result?: Range3d, transform?: Transform): Range3d;
162
162
  /**
163
- * Apply `transform` to point and normal arrays and to auxData.
164
- * * IMPORTANT This base class is just a data carrier. It does not know if the index order and normal directions
165
- * have special meaning, i.e., caller must separately reverse index order and normal direction if needed.
163
+ * Apply a transform to the mesh data.
164
+ * * Transform the data as follows:
165
+ * * apply `transform` to points.
166
+ * * apply inverse transpose of `transform` to normals and renormalize. This preserves normals perpendicular
167
+ * to transformed facets, and keeps them pointing outward, e.g, if the mesh is closed. If the transform is not
168
+ * invertible or a normal has zero length, the normal(s) are left unchanged, and this error is silently ignored.
169
+ * * apply `transform` to auxData.
170
+ * * scale faceData distances by the cube root of the absolute value of the determinant of `transform.matrix`.
171
+ * * Note that if the transform is a mirror, this method does NOT reverse index order. This is the caller's
172
+ * responsibility. This base class is just a data carrier: PolyfaceData does not know if the index order has
173
+ * special meaning.
174
+ * * Note that this method always returns true. If transforming normals fails (due to singular matrix or zero
175
+ * normal), the original normal(s) are left unchanged.
166
176
  */
167
177
  tryTransformInPlace(transform: Transform): boolean;
168
178
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"PolyfaceData.d.ts","sourceRoot":"","sources":["../../../src/polyface/PolyfaceData.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAClE,OAAO,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AACxD,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AAElE,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAEpD,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAIxD;;;;;;;;;GASG;AACH,qBAAa,YAAY;IACvB;;;MAGE;IACF,gBAAuB,oBAAoB,SAAW;IACtD,0FAA0F;IACnF,KAAK,EAAE,gBAAgB,CAAC;IAC/B,2CAA2C;IACpC,UAAU,EAAE,MAAM,EAAE,CAAC;IAC5B,+EAA+E;IACxE,MAAM,CAAC,EAAE,gBAAgB,CA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Ac,CAAC,CAAC,EAAE,eAAe,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,CAAC,EAAE,GAAG,SAAS,EAAE,aAAa,EAAE,OAAO,GAAG,OAAO;IAgCrH;;;;;;;;;;OAUG;WACW,yBAAyB,CAAC,CAAC,EACvC,UAAU,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,CAAC,EAAE,GAAG,SAAS,EAAE,aAAa,EAAE,OAAO,GAC9F,OAAO;IA8BV;;;;;;;;MAQE;IACK,cAAc,CAAC,eAAe,CAAC,EAAE,MAAM,EAAE,GAAG,IAAI;IAYvD;;;;;;;OAOG;IACI,yBAAyB,CAAC,UAAU,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,EAAE,GAAG,IAAI;IAUrF,mCAAmC;IAC5B,cAAc;CAItB"}
@@ -448,15 +448,32 @@ export class PolyfaceData {
448
448
  return result;
449
449
  }
450
450
  /**
451
- * Apply `transform` to point and normal arrays and to auxData.
452
- * * IMPORTANT This base class is just a data carrier. It does not know if the index order and normal directions
453
- * have special meaning, i.e., caller must separately reverse index order and normal direction if needed.
451
+ * Apply a transform to the mesh data.
452
+ * * Transform the data as follows:
453
+ * * apply `transform` to points.
454
+ * * apply inverse transpose of `transform` to normals and renormalize. This preserves normals perpendicular
455
+ * to transformed facets, and keeps them pointing outward, e.g, if the mesh is closed. If the transform is not
456
+ * invertible or a normal has zero length, the normal(s) are left unchanged, and this error is silently ignored.
457
+ * * apply `transform` to auxData.
458
+ * * scale faceData distances by the cube root of the absolute value of the determinant of `transform.matrix`.
459
+ * * Note that if the transform is a mirror, this method does NOT reverse index order. This is the caller's
460
+ * responsibility. This base class is just a data carrier: PolyfaceData does not know if the index order has
461
+ * special meaning.
462
+ * * Note that this method always returns true. If transforming normals fails (due to singular matrix or zero
463
+ * normal), the original normal(s) are left unchanged.
454
464
  */
455
465
  tryTransformInPlace(transform) {
456
466
  this.point.multiplyTransformInPlace(transform);
457
467
  if (this.normal && !transform.matrix.isIdentity)
458
468
  this.normal.multiplyAndRenormalizeMatrix3dInverseTransposeInPlace(transform.matrix);
459
- return undefined === this.auxData || this.auxData.tryTransformInPlace(transform);
469
+ if (this.face.length > 0) {
470
+ const distScale = Math.cbrt(Math.abs(transform.matrix.determinant()));
471
+ for (const faceData of this.face)
472
+ faceData.scaleDistances(distScale);
473
+ }
474
+ if (this.auxData)
475
+ this.auxData.tryTransformInPlace(transform);
476
+ return true;
460
477
  }
461
478
  /**
462
479
  * Compress the instance by equating duplicate data.