@itwin/core-geometry 5.5.0-dev.4 → 5.5.0-dev.5

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 (611) hide show
  1. package/lib/cjs/Geometry.d.ts +7 -0
  2. package/lib/cjs/Geometry.d.ts.map +1 -1
  3. package/lib/cjs/Geometry.js +9 -0
  4. package/lib/cjs/Geometry.js.map +1 -1
  5. package/lib/cjs/bspline/BSplineCurve.d.ts.map +1 -1
  6. package/lib/cjs/bspline/BSplineCurve.js +2 -1
  7. package/lib/cjs/bspline/BSplineCurve.js.map +1 -1
  8. package/lib/cjs/bspline/BSplineCurveOps.d.ts.map +1 -1
  9. package/lib/cjs/bspline/BSplineCurveOps.js +4 -1
  10. package/lib/cjs/bspline/BSplineCurveOps.js.map +1 -1
  11. package/lib/cjs/bspline/BezierCurve3d.d.ts.map +1 -1
  12. package/lib/cjs/bspline/BezierCurve3d.js +14 -4
  13. package/lib/cjs/bspline/BezierCurve3d.js.map +1 -1
  14. package/lib/cjs/bspline/BezierCurve3dH.d.ts +2 -0
  15. package/lib/cjs/bspline/BezierCurve3dH.d.ts.map +1 -1
  16. package/lib/cjs/bspline/BezierCurve3dH.js +19 -3
  17. package/lib/cjs/bspline/BezierCurve3dH.js.map +1 -1
  18. package/lib/cjs/bspline/BezierCurveBase.d.ts +8 -2
  19. package/lib/cjs/bspline/BezierCurveBase.d.ts.map +1 -1
  20. package/lib/cjs/bspline/BezierCurveBase.js +10 -4
  21. package/lib/cjs/bspline/BezierCurveBase.js.map +1 -1
  22. package/lib/cjs/clipping/AlternatingConvexClipTree.js +4 -4
  23. package/lib/cjs/clipping/AlternatingConvexClipTree.js.map +1 -1
  24. package/lib/cjs/clipping/ClipPlane.d.ts +0 -3
  25. package/lib/cjs/clipping/ClipPlane.d.ts.map +1 -1
  26. package/lib/cjs/clipping/ClipPlane.js +9 -2
  27. package/lib/cjs/clipping/ClipPlane.js.map +1 -1
  28. package/lib/cjs/clipping/ClipPrimitive.d.ts +59 -9
  29. package/lib/cjs/clipping/ClipPrimitive.d.ts.map +1 -1
  30. package/lib/cjs/clipping/ClipPrimitive.js +124 -55
  31. package/lib/cjs/clipping/ClipPrimitive.js.map +1 -1
  32. package/lib/cjs/clipping/ClipUtils.js +1 -1
  33. package/lib/cjs/clipping/ClipUtils.js.map +1 -1
  34. package/lib/cjs/clipping/ClipVector.d.ts.map +1 -1
  35. package/lib/cjs/clipping/ClipVector.js +12 -8
  36. package/lib/cjs/clipping/ClipVector.js.map +1 -1
  37. package/lib/cjs/clipping/ConvexClipPlaneSet.d.ts +0 -2
  38. package/lib/cjs/clipping/ConvexClipPlaneSet.d.ts.map +1 -1
  39. package/lib/cjs/clipping/ConvexClipPlaneSet.js +19 -18
  40. package/lib/cjs/clipping/ConvexClipPlaneSet.js.map +1 -1
  41. package/lib/cjs/clipping/internalContexts/LineStringOffsetClipperContext.d.ts +1 -1
  42. package/lib/cjs/clipping/internalContexts/LineStringOffsetClipperContext.d.ts.map +1 -1
  43. package/lib/cjs/clipping/internalContexts/LineStringOffsetClipperContext.js +4 -5
  44. package/lib/cjs/clipping/internalContexts/LineStringOffsetClipperContext.js.map +1 -1
  45. package/lib/cjs/core-geometry.d.ts +0 -1
  46. package/lib/cjs/core-geometry.d.ts.map +1 -1
  47. package/lib/cjs/core-geometry.js +0 -1
  48. package/lib/cjs/core-geometry.js.map +1 -1
  49. package/lib/cjs/curve/Arc3d.js +2 -2
  50. package/lib/cjs/curve/Arc3d.js.map +1 -1
  51. package/lib/cjs/curve/CurveChainWithDistanceIndex.d.ts +12 -4
  52. package/lib/cjs/curve/CurveChainWithDistanceIndex.d.ts.map +1 -1
  53. package/lib/cjs/curve/CurveChainWithDistanceIndex.js +52 -33
  54. package/lib/cjs/curve/CurveChainWithDistanceIndex.js.map +1 -1
  55. package/lib/cjs/curve/CurveCollection.d.ts.map +1 -1
  56. package/lib/cjs/curve/CurveCollection.js +13 -6
  57. package/lib/cjs/curve/CurveCollection.js.map +1 -1
  58. package/lib/cjs/curve/CurveCurve.js +1 -1
  59. package/lib/cjs/curve/CurveCurve.js.map +1 -1
  60. package/lib/cjs/curve/CurveFactory.d.ts.map +1 -1
  61. package/lib/cjs/curve/CurveFactory.js +13 -1
  62. package/lib/cjs/curve/CurveFactory.js.map +1 -1
  63. package/lib/cjs/curve/CurveLocationDetail.d.ts +12 -4
  64. package/lib/cjs/curve/CurveLocationDetail.d.ts.map +1 -1
  65. package/lib/cjs/curve/CurveLocationDetail.js +14 -5
  66. package/lib/cjs/curve/CurveLocationDetail.js.map +1 -1
  67. package/lib/cjs/curve/CurvePrimitive.d.ts +5 -4
  68. package/lib/cjs/curve/CurvePrimitive.d.ts.map +1 -1
  69. package/lib/cjs/curve/CurvePrimitive.js +7 -4
  70. package/lib/cjs/curve/CurvePrimitive.js.map +1 -1
  71. package/lib/cjs/curve/LineString3d.d.ts +25 -16
  72. package/lib/cjs/curve/LineString3d.d.ts.map +1 -1
  73. package/lib/cjs/curve/LineString3d.js +90 -72
  74. package/lib/cjs/curve/LineString3d.js.map +1 -1
  75. package/lib/cjs/curve/Path.d.ts +0 -3
  76. package/lib/cjs/curve/Path.d.ts.map +1 -1
  77. package/lib/cjs/curve/Path.js +9 -2
  78. package/lib/cjs/curve/Path.js.map +1 -1
  79. package/lib/cjs/curve/Query/InOutTests.js.map +1 -1
  80. package/lib/cjs/curve/Query/PlanarSubdivision.d.ts.map +1 -1
  81. package/lib/cjs/curve/Query/PlanarSubdivision.js +25 -31
  82. package/lib/cjs/curve/Query/PlanarSubdivision.js.map +1 -1
  83. package/lib/cjs/curve/Query/StrokeCountChain.d.ts +7 -1
  84. package/lib/cjs/curve/Query/StrokeCountChain.d.ts.map +1 -1
  85. package/lib/cjs/curve/Query/StrokeCountChain.js +27 -36
  86. package/lib/cjs/curve/Query/StrokeCountChain.js.map +1 -1
  87. package/lib/cjs/curve/RegionMomentsXY.d.ts.map +1 -1
  88. package/lib/cjs/curve/RegionMomentsXY.js +7 -1
  89. package/lib/cjs/curve/RegionMomentsXY.js.map +1 -1
  90. package/lib/cjs/curve/RegionOps.d.ts.map +1 -1
  91. package/lib/cjs/curve/RegionOps.js +8 -5
  92. package/lib/cjs/curve/RegionOps.js.map +1 -1
  93. package/lib/cjs/curve/RegionOpsClassificationSweeps.d.ts.map +1 -1
  94. package/lib/cjs/curve/RegionOpsClassificationSweeps.js +6 -6
  95. package/lib/cjs/curve/RegionOpsClassificationSweeps.js.map +1 -1
  96. package/lib/cjs/curve/internalContexts/AnnounceTangentStrokeHandler.d.ts.map +1 -1
  97. package/lib/cjs/curve/internalContexts/AnnounceTangentStrokeHandler.js +4 -1
  98. package/lib/cjs/curve/internalContexts/AnnounceTangentStrokeHandler.js.map +1 -1
  99. package/lib/cjs/curve/internalContexts/ClosestPointStrokeHandler.d.ts.map +1 -1
  100. package/lib/cjs/curve/internalContexts/ClosestPointStrokeHandler.js +6 -1
  101. package/lib/cjs/curve/internalContexts/ClosestPointStrokeHandler.js.map +1 -1
  102. package/lib/cjs/curve/internalContexts/CurveCurveCloseApproachXY.d.ts +5 -21
  103. package/lib/cjs/curve/internalContexts/CurveCurveCloseApproachXY.d.ts.map +1 -1
  104. package/lib/cjs/curve/internalContexts/CurveCurveCloseApproachXY.js +29 -73
  105. package/lib/cjs/curve/internalContexts/CurveCurveCloseApproachXY.js.map +1 -1
  106. package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.d.ts +55 -13
  107. package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.d.ts.map +1 -1
  108. package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.js +238 -110
  109. package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.js.map +1 -1
  110. package/lib/cjs/curve/internalContexts/PolygonOffsetContext.js +1 -1
  111. package/lib/cjs/curve/internalContexts/PolygonOffsetContext.js.map +1 -1
  112. package/lib/cjs/curve/spiral/DirectSpiral3d.d.ts +1 -4
  113. package/lib/cjs/curve/spiral/DirectSpiral3d.d.ts.map +1 -1
  114. package/lib/cjs/curve/spiral/DirectSpiral3d.js +9 -9
  115. package/lib/cjs/curve/spiral/DirectSpiral3d.js.map +1 -1
  116. package/lib/cjs/curve/spiral/IntegratedSpiral3d.d.ts +11 -14
  117. package/lib/cjs/curve/spiral/IntegratedSpiral3d.d.ts.map +1 -1
  118. package/lib/cjs/curve/spiral/IntegratedSpiral3d.js +18 -18
  119. package/lib/cjs/curve/spiral/IntegratedSpiral3d.js.map +1 -1
  120. package/lib/cjs/curve/spiral/TransitionConditionalProperties.d.ts +7 -1
  121. package/lib/cjs/curve/spiral/TransitionConditionalProperties.d.ts.map +1 -1
  122. package/lib/cjs/curve/spiral/TransitionConditionalProperties.js.map +1 -1
  123. package/lib/cjs/geometry3d/Ellipsoid.d.ts +19 -7
  124. package/lib/cjs/geometry3d/Ellipsoid.d.ts.map +1 -1
  125. package/lib/cjs/geometry3d/Ellipsoid.js +26 -11
  126. package/lib/cjs/geometry3d/Ellipsoid.js.map +1 -1
  127. package/lib/cjs/geometry3d/FrustumAnimation.d.ts.map +1 -1
  128. package/lib/cjs/geometry3d/FrustumAnimation.js +11 -1
  129. package/lib/cjs/geometry3d/FrustumAnimation.js.map +1 -1
  130. package/lib/cjs/geometry3d/GrowableFloat64Array.d.ts +5 -1
  131. package/lib/cjs/geometry3d/GrowableFloat64Array.d.ts.map +1 -1
  132. package/lib/cjs/geometry3d/GrowableFloat64Array.js +11 -1
  133. package/lib/cjs/geometry3d/GrowableFloat64Array.js.map +1 -1
  134. package/lib/cjs/geometry3d/GrowableXYArray.d.ts +1 -1
  135. package/lib/cjs/geometry3d/GrowableXYArray.js +1 -1
  136. package/lib/cjs/geometry3d/GrowableXYArray.js.map +1 -1
  137. package/lib/cjs/geometry3d/GrowableXYZArray.d.ts +49 -8
  138. package/lib/cjs/geometry3d/GrowableXYZArray.d.ts.map +1 -1
  139. package/lib/cjs/geometry3d/GrowableXYZArray.js +90 -37
  140. package/lib/cjs/geometry3d/GrowableXYZArray.js.map +1 -1
  141. package/lib/cjs/geometry3d/IndexedXYZCollection.d.ts +100 -3
  142. package/lib/cjs/geometry3d/IndexedXYZCollection.d.ts.map +1 -1
  143. package/lib/cjs/geometry3d/IndexedXYZCollection.js +125 -0
  144. package/lib/cjs/geometry3d/IndexedXYZCollection.js.map +1 -1
  145. package/lib/cjs/geometry3d/Matrix3d.d.ts +10 -1
  146. package/lib/cjs/geometry3d/Matrix3d.d.ts.map +1 -1
  147. package/lib/cjs/geometry3d/Matrix3d.js +53 -34
  148. package/lib/cjs/geometry3d/Matrix3d.js.map +1 -1
  149. package/lib/cjs/geometry3d/Plane3dByOriginAndUnitNormal.js +1 -1
  150. package/lib/cjs/geometry3d/Plane3dByOriginAndUnitNormal.js.map +1 -1
  151. package/lib/cjs/geometry3d/Point3dArrayCarrier.d.ts +49 -2
  152. package/lib/cjs/geometry3d/Point3dArrayCarrier.d.ts.map +1 -1
  153. package/lib/cjs/geometry3d/Point3dArrayCarrier.js +67 -9
  154. package/lib/cjs/geometry3d/Point3dArrayCarrier.js.map +1 -1
  155. package/lib/cjs/geometry3d/Point3dVector3d.d.ts +1 -1
  156. package/lib/cjs/geometry3d/Point3dVector3d.js +1 -1
  157. package/lib/cjs/geometry3d/Point3dVector3d.js.map +1 -1
  158. package/lib/cjs/geometry3d/PointStreaming.js +1 -1
  159. package/lib/cjs/geometry3d/PointStreaming.js.map +1 -1
  160. package/lib/cjs/geometry3d/PolygonOps.d.ts +24 -32
  161. package/lib/cjs/geometry3d/PolygonOps.d.ts.map +1 -1
  162. package/lib/cjs/geometry3d/PolygonOps.js +147 -180
  163. package/lib/cjs/geometry3d/PolygonOps.js.map +1 -1
  164. package/lib/cjs/geometry3d/PolylineCompressionByEdgeOffset.js +5 -5
  165. package/lib/cjs/geometry3d/PolylineCompressionByEdgeOffset.js.map +1 -1
  166. package/lib/cjs/geometry3d/PolylineOps.d.ts.map +1 -1
  167. package/lib/cjs/geometry3d/PolylineOps.js +13 -3
  168. package/lib/cjs/geometry3d/PolylineOps.js.map +1 -1
  169. package/lib/cjs/geometry3d/Range.js.map +1 -1
  170. package/lib/cjs/geometry3d/Ray3d.d.ts +0 -3
  171. package/lib/cjs/geometry3d/Ray3d.d.ts.map +1 -1
  172. package/lib/cjs/geometry3d/Ray3d.js +5 -1
  173. package/lib/cjs/geometry3d/Ray3d.js.map +1 -1
  174. package/lib/cjs/geometry3d/SortablePolygon.d.ts +2 -2
  175. package/lib/cjs/geometry3d/SortablePolygon.d.ts.map +1 -1
  176. package/lib/cjs/geometry3d/SortablePolygon.js +14 -18
  177. package/lib/cjs/geometry3d/SortablePolygon.js.map +1 -1
  178. package/lib/cjs/geometry3d/Transform.d.ts +8 -0
  179. package/lib/cjs/geometry3d/Transform.d.ts.map +1 -1
  180. package/lib/cjs/geometry3d/Transform.js +15 -9
  181. package/lib/cjs/geometry3d/Transform.js.map +1 -1
  182. package/lib/cjs/numerics/ClusterableArray.d.ts +4 -2
  183. package/lib/cjs/numerics/ClusterableArray.d.ts.map +1 -1
  184. package/lib/cjs/numerics/ClusterableArray.js +6 -4
  185. package/lib/cjs/numerics/ClusterableArray.js.map +1 -1
  186. package/lib/cjs/numerics/Newton.d.ts +3 -1
  187. package/lib/cjs/numerics/Newton.d.ts.map +1 -1
  188. package/lib/cjs/numerics/Newton.js +5 -1
  189. package/lib/cjs/numerics/Newton.js.map +1 -1
  190. package/lib/cjs/polyface/AuxData.d.ts +1 -4
  191. package/lib/cjs/polyface/AuxData.d.ts.map +1 -1
  192. package/lib/cjs/polyface/AuxData.js +5 -1
  193. package/lib/cjs/polyface/AuxData.js.map +1 -1
  194. package/lib/cjs/polyface/GreedyTriangulationBetweenLineStrings.js +3 -3
  195. package/lib/cjs/polyface/GreedyTriangulationBetweenLineStrings.js.map +1 -1
  196. package/lib/cjs/polyface/Polyface.d.ts.map +1 -1
  197. package/lib/cjs/polyface/Polyface.js +14 -16
  198. package/lib/cjs/polyface/Polyface.js.map +1 -1
  199. package/lib/cjs/polyface/PolyfaceBuilder.d.ts +84 -28
  200. package/lib/cjs/polyface/PolyfaceBuilder.d.ts.map +1 -1
  201. package/lib/cjs/polyface/PolyfaceBuilder.js +277 -217
  202. package/lib/cjs/polyface/PolyfaceBuilder.js.map +1 -1
  203. package/lib/cjs/polyface/PolyfaceClip.d.ts +4 -3
  204. package/lib/cjs/polyface/PolyfaceClip.d.ts.map +1 -1
  205. package/lib/cjs/polyface/PolyfaceClip.js +11 -4
  206. package/lib/cjs/polyface/PolyfaceClip.js.map +1 -1
  207. package/lib/cjs/polyface/PolyfaceData.js.map +1 -1
  208. package/lib/cjs/polyface/PolyfaceQuery.d.ts.map +1 -1
  209. package/lib/cjs/polyface/PolyfaceQuery.js +9 -7
  210. package/lib/cjs/polyface/PolyfaceQuery.js.map +1 -1
  211. package/lib/cjs/polyface/RangeTree/LineString3dRangeTreeContext.d.ts.map +1 -1
  212. package/lib/cjs/polyface/RangeTree/LineString3dRangeTreeContext.js +3 -2
  213. package/lib/cjs/polyface/RangeTree/LineString3dRangeTreeContext.js.map +1 -1
  214. package/lib/cjs/polyface/RangeTree/RangeTreeNode.d.ts +1 -1
  215. package/lib/cjs/polyface/RangeTree/RangeTreeNode.js +2 -2
  216. package/lib/cjs/polyface/RangeTree/RangeTreeNode.js.map +1 -1
  217. package/lib/cjs/polyface/RangeTree/RangeTreeSearchHandlers.d.ts.map +1 -1
  218. package/lib/cjs/polyface/RangeTree/RangeTreeSearchHandlers.js +14 -12
  219. package/lib/cjs/polyface/RangeTree/RangeTreeSearchHandlers.js.map +1 -1
  220. package/lib/cjs/polyface/multiclip/BuildAverageNormalsContext.d.ts +1 -1
  221. package/lib/cjs/polyface/multiclip/BuildAverageNormalsContext.d.ts.map +1 -1
  222. package/lib/cjs/polyface/multiclip/BuildAverageNormalsContext.js +10 -6
  223. package/lib/cjs/polyface/multiclip/BuildAverageNormalsContext.js.map +1 -1
  224. package/lib/cjs/polyface/multiclip/OffsetMeshContext.js +4 -3
  225. package/lib/cjs/polyface/multiclip/OffsetMeshContext.js.map +1 -1
  226. package/lib/cjs/polyface/multiclip/SweepLineStringToFacetContext.d.ts.map +1 -1
  227. package/lib/cjs/polyface/multiclip/SweepLineStringToFacetContext.js +3 -5
  228. package/lib/cjs/polyface/multiclip/SweepLineStringToFacetContext.js.map +1 -1
  229. package/lib/cjs/polyface/multiclip/XYPointBuckets.d.ts +1 -1
  230. package/lib/cjs/polyface/multiclip/XYPointBuckets.d.ts.map +1 -1
  231. package/lib/cjs/polyface/multiclip/XYPointBuckets.js +4 -8
  232. package/lib/cjs/polyface/multiclip/XYPointBuckets.js.map +1 -1
  233. package/lib/cjs/serialization/BGFBAccessors.d.ts.map +1 -1
  234. package/lib/cjs/serialization/BGFBAccessors.js +1 -0
  235. package/lib/cjs/serialization/BGFBAccessors.js.map +1 -1
  236. package/lib/cjs/serialization/BGFBReader.d.ts.map +1 -1
  237. package/lib/cjs/serialization/BGFBReader.js +37 -7
  238. package/lib/cjs/serialization/BGFBReader.js.map +1 -1
  239. package/lib/cjs/serialization/BGFBWriter.d.ts +4 -4
  240. package/lib/cjs/serialization/BGFBWriter.d.ts.map +1 -1
  241. package/lib/cjs/serialization/BGFBWriter.js +24 -40
  242. package/lib/cjs/serialization/BGFBWriter.js.map +1 -1
  243. package/lib/cjs/serialization/IModelJsonSchema.d.ts.map +1 -1
  244. package/lib/cjs/serialization/IModelJsonSchema.js +9 -3
  245. package/lib/cjs/serialization/IModelJsonSchema.js.map +1 -1
  246. package/lib/cjs/serialization/SerializationHelpers.d.ts +0 -3
  247. package/lib/cjs/serialization/SerializationHelpers.d.ts.map +1 -1
  248. package/lib/cjs/serialization/SerializationHelpers.js +16 -7
  249. package/lib/cjs/serialization/SerializationHelpers.js.map +1 -1
  250. package/lib/cjs/solid/Box.d.ts +2 -2
  251. package/lib/cjs/solid/Box.d.ts.map +1 -1
  252. package/lib/cjs/solid/Box.js.map +1 -1
  253. package/lib/cjs/solid/Cone.d.ts +3 -2
  254. package/lib/cjs/solid/Cone.d.ts.map +1 -1
  255. package/lib/cjs/solid/Cone.js +4 -1
  256. package/lib/cjs/solid/Cone.js.map +1 -1
  257. package/lib/cjs/solid/LinearSweep.d.ts +1 -1
  258. package/lib/cjs/solid/LinearSweep.d.ts.map +1 -1
  259. package/lib/cjs/solid/LinearSweep.js +1 -1
  260. package/lib/cjs/solid/LinearSweep.js.map +1 -1
  261. package/lib/cjs/solid/RotationalSweep.d.ts.map +1 -1
  262. package/lib/cjs/solid/RotationalSweep.js +1 -3
  263. package/lib/cjs/solid/RotationalSweep.js.map +1 -1
  264. package/lib/cjs/solid/TorusPipe.d.ts +4 -3
  265. package/lib/cjs/solid/TorusPipe.d.ts.map +1 -1
  266. package/lib/cjs/solid/TorusPipe.js.map +1 -1
  267. package/lib/cjs/topology/ChainMerge.d.ts +4 -4
  268. package/lib/cjs/topology/ChainMerge.d.ts.map +1 -1
  269. package/lib/cjs/topology/ChainMerge.js +11 -1
  270. package/lib/cjs/topology/ChainMerge.js.map +1 -1
  271. package/lib/cjs/topology/Graph.d.ts +2 -0
  272. package/lib/cjs/topology/Graph.d.ts.map +1 -1
  273. package/lib/cjs/topology/Graph.js +5 -0
  274. package/lib/cjs/topology/Graph.js.map +1 -1
  275. package/lib/cjs/topology/HalfEdgeGraphSearch.d.ts.map +1 -1
  276. package/lib/cjs/topology/HalfEdgeGraphSearch.js +2 -0
  277. package/lib/cjs/topology/HalfEdgeGraphSearch.js.map +1 -1
  278. package/lib/cjs/topology/HalfEdgePointInGraphSearch.d.ts.map +1 -1
  279. package/lib/cjs/topology/HalfEdgePointInGraphSearch.js +23 -16
  280. package/lib/cjs/topology/HalfEdgePointInGraphSearch.js.map +1 -1
  281. package/lib/cjs/topology/HalfEdgePositionDetail.d.ts +20 -9
  282. package/lib/cjs/topology/HalfEdgePositionDetail.d.ts.map +1 -1
  283. package/lib/cjs/topology/HalfEdgePositionDetail.js +17 -13
  284. package/lib/cjs/topology/HalfEdgePositionDetail.js.map +1 -1
  285. package/lib/cjs/topology/HalfEdgePriorityQueue.d.ts.map +1 -1
  286. package/lib/cjs/topology/HalfEdgePriorityQueue.js +3 -1
  287. package/lib/cjs/topology/HalfEdgePriorityQueue.js.map +1 -1
  288. package/lib/cjs/topology/InsertAndRetriangulateContext.d.ts +6 -2
  289. package/lib/cjs/topology/InsertAndRetriangulateContext.d.ts.map +1 -1
  290. package/lib/cjs/topology/InsertAndRetriangulateContext.js +41 -35
  291. package/lib/cjs/topology/InsertAndRetriangulateContext.js.map +1 -1
  292. package/lib/cjs/topology/MaskManager.d.ts +7 -3
  293. package/lib/cjs/topology/MaskManager.d.ts.map +1 -1
  294. package/lib/cjs/topology/MaskManager.js +10 -4
  295. package/lib/cjs/topology/MaskManager.js.map +1 -1
  296. package/lib/cjs/topology/RegularizeFace.d.ts.map +1 -1
  297. package/lib/cjs/topology/RegularizeFace.js.map +1 -1
  298. package/lib/cjs/topology/Triangulation.d.ts +2 -1
  299. package/lib/cjs/topology/Triangulation.d.ts.map +1 -1
  300. package/lib/cjs/topology/Triangulation.js +12 -7
  301. package/lib/cjs/topology/Triangulation.js.map +1 -1
  302. package/lib/esm/Geometry.d.ts +7 -0
  303. package/lib/esm/Geometry.d.ts.map +1 -1
  304. package/lib/esm/Geometry.js +9 -0
  305. package/lib/esm/Geometry.js.map +1 -1
  306. package/lib/esm/bspline/BSplineCurve.d.ts.map +1 -1
  307. package/lib/esm/bspline/BSplineCurve.js +2 -1
  308. package/lib/esm/bspline/BSplineCurve.js.map +1 -1
  309. package/lib/esm/bspline/BSplineCurveOps.d.ts.map +1 -1
  310. package/lib/esm/bspline/BSplineCurveOps.js +4 -1
  311. package/lib/esm/bspline/BSplineCurveOps.js.map +1 -1
  312. package/lib/esm/bspline/BezierCurve3d.d.ts.map +1 -1
  313. package/lib/esm/bspline/BezierCurve3d.js +14 -4
  314. package/lib/esm/bspline/BezierCurve3d.js.map +1 -1
  315. package/lib/esm/bspline/BezierCurve3dH.d.ts +2 -0
  316. package/lib/esm/bspline/BezierCurve3dH.d.ts.map +1 -1
  317. package/lib/esm/bspline/BezierCurve3dH.js +19 -3
  318. package/lib/esm/bspline/BezierCurve3dH.js.map +1 -1
  319. package/lib/esm/bspline/BezierCurveBase.d.ts +8 -2
  320. package/lib/esm/bspline/BezierCurveBase.d.ts.map +1 -1
  321. package/lib/esm/bspline/BezierCurveBase.js +10 -4
  322. package/lib/esm/bspline/BezierCurveBase.js.map +1 -1
  323. package/lib/esm/clipping/AlternatingConvexClipTree.js +4 -4
  324. package/lib/esm/clipping/AlternatingConvexClipTree.js.map +1 -1
  325. package/lib/esm/clipping/ClipPlane.d.ts +0 -3
  326. package/lib/esm/clipping/ClipPlane.d.ts.map +1 -1
  327. package/lib/esm/clipping/ClipPlane.js +9 -2
  328. package/lib/esm/clipping/ClipPlane.js.map +1 -1
  329. package/lib/esm/clipping/ClipPrimitive.d.ts +59 -9
  330. package/lib/esm/clipping/ClipPrimitive.d.ts.map +1 -1
  331. package/lib/esm/clipping/ClipPrimitive.js +124 -55
  332. package/lib/esm/clipping/ClipPrimitive.js.map +1 -1
  333. package/lib/esm/clipping/ClipUtils.js +1 -1
  334. package/lib/esm/clipping/ClipUtils.js.map +1 -1
  335. package/lib/esm/clipping/ClipVector.d.ts.map +1 -1
  336. package/lib/esm/clipping/ClipVector.js +12 -8
  337. package/lib/esm/clipping/ClipVector.js.map +1 -1
  338. package/lib/esm/clipping/ConvexClipPlaneSet.d.ts +0 -2
  339. package/lib/esm/clipping/ConvexClipPlaneSet.d.ts.map +1 -1
  340. package/lib/esm/clipping/ConvexClipPlaneSet.js +20 -19
  341. package/lib/esm/clipping/ConvexClipPlaneSet.js.map +1 -1
  342. package/lib/esm/clipping/internalContexts/LineStringOffsetClipperContext.d.ts +1 -1
  343. package/lib/esm/clipping/internalContexts/LineStringOffsetClipperContext.d.ts.map +1 -1
  344. package/lib/esm/clipping/internalContexts/LineStringOffsetClipperContext.js +4 -5
  345. package/lib/esm/clipping/internalContexts/LineStringOffsetClipperContext.js.map +1 -1
  346. package/lib/esm/core-geometry.d.ts +0 -1
  347. package/lib/esm/core-geometry.d.ts.map +1 -1
  348. package/lib/esm/core-geometry.js +0 -1
  349. package/lib/esm/core-geometry.js.map +1 -1
  350. package/lib/esm/curve/Arc3d.js +2 -2
  351. package/lib/esm/curve/Arc3d.js.map +1 -1
  352. package/lib/esm/curve/CurveChainWithDistanceIndex.d.ts +12 -4
  353. package/lib/esm/curve/CurveChainWithDistanceIndex.d.ts.map +1 -1
  354. package/lib/esm/curve/CurveChainWithDistanceIndex.js +53 -34
  355. package/lib/esm/curve/CurveChainWithDistanceIndex.js.map +1 -1
  356. package/lib/esm/curve/CurveCollection.d.ts.map +1 -1
  357. package/lib/esm/curve/CurveCollection.js +13 -6
  358. package/lib/esm/curve/CurveCollection.js.map +1 -1
  359. package/lib/esm/curve/CurveCurve.js +1 -1
  360. package/lib/esm/curve/CurveCurve.js.map +1 -1
  361. package/lib/esm/curve/CurveFactory.d.ts.map +1 -1
  362. package/lib/esm/curve/CurveFactory.js +13 -1
  363. package/lib/esm/curve/CurveFactory.js.map +1 -1
  364. package/lib/esm/curve/CurveLocationDetail.d.ts +12 -4
  365. package/lib/esm/curve/CurveLocationDetail.d.ts.map +1 -1
  366. package/lib/esm/curve/CurveLocationDetail.js +14 -5
  367. package/lib/esm/curve/CurveLocationDetail.js.map +1 -1
  368. package/lib/esm/curve/CurvePrimitive.d.ts +5 -4
  369. package/lib/esm/curve/CurvePrimitive.d.ts.map +1 -1
  370. package/lib/esm/curve/CurvePrimitive.js +7 -4
  371. package/lib/esm/curve/CurvePrimitive.js.map +1 -1
  372. package/lib/esm/curve/LineString3d.d.ts +25 -16
  373. package/lib/esm/curve/LineString3d.d.ts.map +1 -1
  374. package/lib/esm/curve/LineString3d.js +90 -72
  375. package/lib/esm/curve/LineString3d.js.map +1 -1
  376. package/lib/esm/curve/Path.d.ts +0 -3
  377. package/lib/esm/curve/Path.d.ts.map +1 -1
  378. package/lib/esm/curve/Path.js +9 -2
  379. package/lib/esm/curve/Path.js.map +1 -1
  380. package/lib/esm/curve/Query/InOutTests.js.map +1 -1
  381. package/lib/esm/curve/Query/PlanarSubdivision.d.ts.map +1 -1
  382. package/lib/esm/curve/Query/PlanarSubdivision.js +25 -31
  383. package/lib/esm/curve/Query/PlanarSubdivision.js.map +1 -1
  384. package/lib/esm/curve/Query/StrokeCountChain.d.ts +7 -1
  385. package/lib/esm/curve/Query/StrokeCountChain.d.ts.map +1 -1
  386. package/lib/esm/curve/Query/StrokeCountChain.js +27 -36
  387. package/lib/esm/curve/Query/StrokeCountChain.js.map +1 -1
  388. package/lib/esm/curve/RegionMomentsXY.d.ts.map +1 -1
  389. package/lib/esm/curve/RegionMomentsXY.js +7 -1
  390. package/lib/esm/curve/RegionMomentsXY.js.map +1 -1
  391. package/lib/esm/curve/RegionOps.d.ts.map +1 -1
  392. package/lib/esm/curve/RegionOps.js +8 -5
  393. package/lib/esm/curve/RegionOps.js.map +1 -1
  394. package/lib/esm/curve/RegionOpsClassificationSweeps.d.ts.map +1 -1
  395. package/lib/esm/curve/RegionOpsClassificationSweeps.js +6 -6
  396. package/lib/esm/curve/RegionOpsClassificationSweeps.js.map +1 -1
  397. package/lib/esm/curve/internalContexts/AnnounceTangentStrokeHandler.d.ts.map +1 -1
  398. package/lib/esm/curve/internalContexts/AnnounceTangentStrokeHandler.js +4 -1
  399. package/lib/esm/curve/internalContexts/AnnounceTangentStrokeHandler.js.map +1 -1
  400. package/lib/esm/curve/internalContexts/ClosestPointStrokeHandler.d.ts.map +1 -1
  401. package/lib/esm/curve/internalContexts/ClosestPointStrokeHandler.js +6 -1
  402. package/lib/esm/curve/internalContexts/ClosestPointStrokeHandler.js.map +1 -1
  403. package/lib/esm/curve/internalContexts/CurveCurveCloseApproachXY.d.ts +5 -21
  404. package/lib/esm/curve/internalContexts/CurveCurveCloseApproachXY.d.ts.map +1 -1
  405. package/lib/esm/curve/internalContexts/CurveCurveCloseApproachXY.js +29 -73
  406. package/lib/esm/curve/internalContexts/CurveCurveCloseApproachXY.js.map +1 -1
  407. package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.d.ts +55 -13
  408. package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.d.ts.map +1 -1
  409. package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.js +239 -111
  410. package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.js.map +1 -1
  411. package/lib/esm/curve/internalContexts/PolygonOffsetContext.js +1 -1
  412. package/lib/esm/curve/internalContexts/PolygonOffsetContext.js.map +1 -1
  413. package/lib/esm/curve/spiral/DirectSpiral3d.d.ts +1 -4
  414. package/lib/esm/curve/spiral/DirectSpiral3d.d.ts.map +1 -1
  415. package/lib/esm/curve/spiral/DirectSpiral3d.js +9 -9
  416. package/lib/esm/curve/spiral/DirectSpiral3d.js.map +1 -1
  417. package/lib/esm/curve/spiral/IntegratedSpiral3d.d.ts +11 -14
  418. package/lib/esm/curve/spiral/IntegratedSpiral3d.d.ts.map +1 -1
  419. package/lib/esm/curve/spiral/IntegratedSpiral3d.js +18 -18
  420. package/lib/esm/curve/spiral/IntegratedSpiral3d.js.map +1 -1
  421. package/lib/esm/curve/spiral/TransitionConditionalProperties.d.ts +7 -1
  422. package/lib/esm/curve/spiral/TransitionConditionalProperties.d.ts.map +1 -1
  423. package/lib/esm/curve/spiral/TransitionConditionalProperties.js.map +1 -1
  424. package/lib/esm/geometry3d/Ellipsoid.d.ts +19 -7
  425. package/lib/esm/geometry3d/Ellipsoid.d.ts.map +1 -1
  426. package/lib/esm/geometry3d/Ellipsoid.js +26 -11
  427. package/lib/esm/geometry3d/Ellipsoid.js.map +1 -1
  428. package/lib/esm/geometry3d/FrustumAnimation.d.ts.map +1 -1
  429. package/lib/esm/geometry3d/FrustumAnimation.js +11 -1
  430. package/lib/esm/geometry3d/FrustumAnimation.js.map +1 -1
  431. package/lib/esm/geometry3d/GrowableFloat64Array.d.ts +5 -1
  432. package/lib/esm/geometry3d/GrowableFloat64Array.d.ts.map +1 -1
  433. package/lib/esm/geometry3d/GrowableFloat64Array.js +11 -1
  434. package/lib/esm/geometry3d/GrowableFloat64Array.js.map +1 -1
  435. package/lib/esm/geometry3d/GrowableXYArray.d.ts +1 -1
  436. package/lib/esm/geometry3d/GrowableXYArray.js +1 -1
  437. package/lib/esm/geometry3d/GrowableXYArray.js.map +1 -1
  438. package/lib/esm/geometry3d/GrowableXYZArray.d.ts +49 -8
  439. package/lib/esm/geometry3d/GrowableXYZArray.d.ts.map +1 -1
  440. package/lib/esm/geometry3d/GrowableXYZArray.js +90 -37
  441. package/lib/esm/geometry3d/GrowableXYZArray.js.map +1 -1
  442. package/lib/esm/geometry3d/IndexedXYZCollection.d.ts +100 -3
  443. package/lib/esm/geometry3d/IndexedXYZCollection.d.ts.map +1 -1
  444. package/lib/esm/geometry3d/IndexedXYZCollection.js +125 -0
  445. package/lib/esm/geometry3d/IndexedXYZCollection.js.map +1 -1
  446. package/lib/esm/geometry3d/Matrix3d.d.ts +10 -1
  447. package/lib/esm/geometry3d/Matrix3d.d.ts.map +1 -1
  448. package/lib/esm/geometry3d/Matrix3d.js +53 -34
  449. package/lib/esm/geometry3d/Matrix3d.js.map +1 -1
  450. package/lib/esm/geometry3d/Plane3dByOriginAndUnitNormal.js +1 -1
  451. package/lib/esm/geometry3d/Plane3dByOriginAndUnitNormal.js.map +1 -1
  452. package/lib/esm/geometry3d/Point3dArrayCarrier.d.ts +49 -2
  453. package/lib/esm/geometry3d/Point3dArrayCarrier.d.ts.map +1 -1
  454. package/lib/esm/geometry3d/Point3dArrayCarrier.js +67 -9
  455. package/lib/esm/geometry3d/Point3dArrayCarrier.js.map +1 -1
  456. package/lib/esm/geometry3d/Point3dVector3d.d.ts +1 -1
  457. package/lib/esm/geometry3d/Point3dVector3d.js +1 -1
  458. package/lib/esm/geometry3d/Point3dVector3d.js.map +1 -1
  459. package/lib/esm/geometry3d/PointStreaming.js +1 -1
  460. package/lib/esm/geometry3d/PointStreaming.js.map +1 -1
  461. package/lib/esm/geometry3d/PolygonOps.d.ts +24 -32
  462. package/lib/esm/geometry3d/PolygonOps.d.ts.map +1 -1
  463. package/lib/esm/geometry3d/PolygonOps.js +147 -180
  464. package/lib/esm/geometry3d/PolygonOps.js.map +1 -1
  465. package/lib/esm/geometry3d/PolylineCompressionByEdgeOffset.js +5 -5
  466. package/lib/esm/geometry3d/PolylineCompressionByEdgeOffset.js.map +1 -1
  467. package/lib/esm/geometry3d/PolylineOps.d.ts.map +1 -1
  468. package/lib/esm/geometry3d/PolylineOps.js +13 -3
  469. package/lib/esm/geometry3d/PolylineOps.js.map +1 -1
  470. package/lib/esm/geometry3d/Range.js.map +1 -1
  471. package/lib/esm/geometry3d/Ray3d.d.ts +0 -3
  472. package/lib/esm/geometry3d/Ray3d.d.ts.map +1 -1
  473. package/lib/esm/geometry3d/Ray3d.js +5 -1
  474. package/lib/esm/geometry3d/Ray3d.js.map +1 -1
  475. package/lib/esm/geometry3d/SortablePolygon.d.ts +2 -2
  476. package/lib/esm/geometry3d/SortablePolygon.d.ts.map +1 -1
  477. package/lib/esm/geometry3d/SortablePolygon.js +14 -18
  478. package/lib/esm/geometry3d/SortablePolygon.js.map +1 -1
  479. package/lib/esm/geometry3d/Transform.d.ts +8 -0
  480. package/lib/esm/geometry3d/Transform.d.ts.map +1 -1
  481. package/lib/esm/geometry3d/Transform.js +15 -9
  482. package/lib/esm/geometry3d/Transform.js.map +1 -1
  483. package/lib/esm/numerics/ClusterableArray.d.ts +4 -2
  484. package/lib/esm/numerics/ClusterableArray.d.ts.map +1 -1
  485. package/lib/esm/numerics/ClusterableArray.js +6 -4
  486. package/lib/esm/numerics/ClusterableArray.js.map +1 -1
  487. package/lib/esm/numerics/Newton.d.ts +3 -1
  488. package/lib/esm/numerics/Newton.d.ts.map +1 -1
  489. package/lib/esm/numerics/Newton.js +5 -1
  490. package/lib/esm/numerics/Newton.js.map +1 -1
  491. package/lib/esm/polyface/AuxData.d.ts +1 -4
  492. package/lib/esm/polyface/AuxData.d.ts.map +1 -1
  493. package/lib/esm/polyface/AuxData.js +5 -1
  494. package/lib/esm/polyface/AuxData.js.map +1 -1
  495. package/lib/esm/polyface/GreedyTriangulationBetweenLineStrings.js +3 -3
  496. package/lib/esm/polyface/GreedyTriangulationBetweenLineStrings.js.map +1 -1
  497. package/lib/esm/polyface/Polyface.d.ts.map +1 -1
  498. package/lib/esm/polyface/Polyface.js +14 -16
  499. package/lib/esm/polyface/Polyface.js.map +1 -1
  500. package/lib/esm/polyface/PolyfaceBuilder.d.ts +84 -28
  501. package/lib/esm/polyface/PolyfaceBuilder.d.ts.map +1 -1
  502. package/lib/esm/polyface/PolyfaceBuilder.js +277 -217
  503. package/lib/esm/polyface/PolyfaceBuilder.js.map +1 -1
  504. package/lib/esm/polyface/PolyfaceClip.d.ts +4 -3
  505. package/lib/esm/polyface/PolyfaceClip.d.ts.map +1 -1
  506. package/lib/esm/polyface/PolyfaceClip.js +11 -4
  507. package/lib/esm/polyface/PolyfaceClip.js.map +1 -1
  508. package/lib/esm/polyface/PolyfaceData.js.map +1 -1
  509. package/lib/esm/polyface/PolyfaceQuery.d.ts.map +1 -1
  510. package/lib/esm/polyface/PolyfaceQuery.js +9 -7
  511. package/lib/esm/polyface/PolyfaceQuery.js.map +1 -1
  512. package/lib/esm/polyface/RangeTree/LineString3dRangeTreeContext.d.ts.map +1 -1
  513. package/lib/esm/polyface/RangeTree/LineString3dRangeTreeContext.js +3 -2
  514. package/lib/esm/polyface/RangeTree/LineString3dRangeTreeContext.js.map +1 -1
  515. package/lib/esm/polyface/RangeTree/RangeTreeNode.d.ts +1 -1
  516. package/lib/esm/polyface/RangeTree/RangeTreeNode.js +2 -2
  517. package/lib/esm/polyface/RangeTree/RangeTreeNode.js.map +1 -1
  518. package/lib/esm/polyface/RangeTree/RangeTreeSearchHandlers.d.ts.map +1 -1
  519. package/lib/esm/polyface/RangeTree/RangeTreeSearchHandlers.js +14 -12
  520. package/lib/esm/polyface/RangeTree/RangeTreeSearchHandlers.js.map +1 -1
  521. package/lib/esm/polyface/multiclip/BuildAverageNormalsContext.d.ts +1 -1
  522. package/lib/esm/polyface/multiclip/BuildAverageNormalsContext.d.ts.map +1 -1
  523. package/lib/esm/polyface/multiclip/BuildAverageNormalsContext.js +10 -6
  524. package/lib/esm/polyface/multiclip/BuildAverageNormalsContext.js.map +1 -1
  525. package/lib/esm/polyface/multiclip/OffsetMeshContext.js +4 -3
  526. package/lib/esm/polyface/multiclip/OffsetMeshContext.js.map +1 -1
  527. package/lib/esm/polyface/multiclip/SweepLineStringToFacetContext.d.ts.map +1 -1
  528. package/lib/esm/polyface/multiclip/SweepLineStringToFacetContext.js +3 -5
  529. package/lib/esm/polyface/multiclip/SweepLineStringToFacetContext.js.map +1 -1
  530. package/lib/esm/polyface/multiclip/XYPointBuckets.d.ts +1 -1
  531. package/lib/esm/polyface/multiclip/XYPointBuckets.d.ts.map +1 -1
  532. package/lib/esm/polyface/multiclip/XYPointBuckets.js +4 -8
  533. package/lib/esm/polyface/multiclip/XYPointBuckets.js.map +1 -1
  534. package/lib/esm/serialization/BGFBAccessors.d.ts.map +1 -1
  535. package/lib/esm/serialization/BGFBAccessors.js +1 -0
  536. package/lib/esm/serialization/BGFBAccessors.js.map +1 -1
  537. package/lib/esm/serialization/BGFBReader.d.ts.map +1 -1
  538. package/lib/esm/serialization/BGFBReader.js +37 -7
  539. package/lib/esm/serialization/BGFBReader.js.map +1 -1
  540. package/lib/esm/serialization/BGFBWriter.d.ts +4 -4
  541. package/lib/esm/serialization/BGFBWriter.d.ts.map +1 -1
  542. package/lib/esm/serialization/BGFBWriter.js +24 -40
  543. package/lib/esm/serialization/BGFBWriter.js.map +1 -1
  544. package/lib/esm/serialization/IModelJsonSchema.d.ts.map +1 -1
  545. package/lib/esm/serialization/IModelJsonSchema.js +9 -3
  546. package/lib/esm/serialization/IModelJsonSchema.js.map +1 -1
  547. package/lib/esm/serialization/SerializationHelpers.d.ts +0 -3
  548. package/lib/esm/serialization/SerializationHelpers.d.ts.map +1 -1
  549. package/lib/esm/serialization/SerializationHelpers.js +16 -7
  550. package/lib/esm/serialization/SerializationHelpers.js.map +1 -1
  551. package/lib/esm/solid/Box.d.ts +2 -2
  552. package/lib/esm/solid/Box.d.ts.map +1 -1
  553. package/lib/esm/solid/Box.js.map +1 -1
  554. package/lib/esm/solid/Cone.d.ts +3 -2
  555. package/lib/esm/solid/Cone.d.ts.map +1 -1
  556. package/lib/esm/solid/Cone.js +4 -1
  557. package/lib/esm/solid/Cone.js.map +1 -1
  558. package/lib/esm/solid/LinearSweep.d.ts +1 -1
  559. package/lib/esm/solid/LinearSweep.d.ts.map +1 -1
  560. package/lib/esm/solid/LinearSweep.js +1 -1
  561. package/lib/esm/solid/LinearSweep.js.map +1 -1
  562. package/lib/esm/solid/RotationalSweep.d.ts.map +1 -1
  563. package/lib/esm/solid/RotationalSweep.js +1 -3
  564. package/lib/esm/solid/RotationalSweep.js.map +1 -1
  565. package/lib/esm/solid/TorusPipe.d.ts +4 -3
  566. package/lib/esm/solid/TorusPipe.d.ts.map +1 -1
  567. package/lib/esm/solid/TorusPipe.js.map +1 -1
  568. package/lib/esm/topology/ChainMerge.d.ts +4 -4
  569. package/lib/esm/topology/ChainMerge.d.ts.map +1 -1
  570. package/lib/esm/topology/ChainMerge.js +11 -1
  571. package/lib/esm/topology/ChainMerge.js.map +1 -1
  572. package/lib/esm/topology/Graph.d.ts +2 -0
  573. package/lib/esm/topology/Graph.d.ts.map +1 -1
  574. package/lib/esm/topology/Graph.js +5 -0
  575. package/lib/esm/topology/Graph.js.map +1 -1
  576. package/lib/esm/topology/HalfEdgeGraphSearch.d.ts.map +1 -1
  577. package/lib/esm/topology/HalfEdgeGraphSearch.js +2 -0
  578. package/lib/esm/topology/HalfEdgeGraphSearch.js.map +1 -1
  579. package/lib/esm/topology/HalfEdgePointInGraphSearch.d.ts.map +1 -1
  580. package/lib/esm/topology/HalfEdgePointInGraphSearch.js +23 -16
  581. package/lib/esm/topology/HalfEdgePointInGraphSearch.js.map +1 -1
  582. package/lib/esm/topology/HalfEdgePositionDetail.d.ts +20 -9
  583. package/lib/esm/topology/HalfEdgePositionDetail.d.ts.map +1 -1
  584. package/lib/esm/topology/HalfEdgePositionDetail.js +17 -13
  585. package/lib/esm/topology/HalfEdgePositionDetail.js.map +1 -1
  586. package/lib/esm/topology/HalfEdgePriorityQueue.d.ts.map +1 -1
  587. package/lib/esm/topology/HalfEdgePriorityQueue.js +4 -2
  588. package/lib/esm/topology/HalfEdgePriorityQueue.js.map +1 -1
  589. package/lib/esm/topology/InsertAndRetriangulateContext.d.ts +6 -2
  590. package/lib/esm/topology/InsertAndRetriangulateContext.d.ts.map +1 -1
  591. package/lib/esm/topology/InsertAndRetriangulateContext.js +41 -35
  592. package/lib/esm/topology/InsertAndRetriangulateContext.js.map +1 -1
  593. package/lib/esm/topology/MaskManager.d.ts +7 -3
  594. package/lib/esm/topology/MaskManager.d.ts.map +1 -1
  595. package/lib/esm/topology/MaskManager.js +10 -4
  596. package/lib/esm/topology/MaskManager.js.map +1 -1
  597. package/lib/esm/topology/RegularizeFace.d.ts.map +1 -1
  598. package/lib/esm/topology/RegularizeFace.js.map +1 -1
  599. package/lib/esm/topology/Triangulation.d.ts +2 -1
  600. package/lib/esm/topology/Triangulation.d.ts.map +1 -1
  601. package/lib/esm/topology/Triangulation.js +12 -7
  602. package/lib/esm/topology/Triangulation.js.map +1 -1
  603. package/package.json +3 -3
  604. package/lib/cjs/serialization/GeometrySamples.d.ts +0 -705
  605. package/lib/cjs/serialization/GeometrySamples.d.ts.map +0 -1
  606. package/lib/cjs/serialization/GeometrySamples.js +0 -2433
  607. package/lib/cjs/serialization/GeometrySamples.js.map +0 -1
  608. package/lib/esm/serialization/GeometrySamples.d.ts +0 -705
  609. package/lib/esm/serialization/GeometrySamples.d.ts.map +0 -1
  610. package/lib/esm/serialization/GeometrySamples.js +0 -2428
  611. package/lib/esm/serialization/GeometrySamples.js.map +0 -1
@@ -148,7 +148,7 @@ exports.PolygonLocationDetailPair = PolygonLocationDetailPair;
148
148
  class CutLoop {
149
149
  /* All points of the loop */
150
150
  xyz;
151
- /* ray within point of "on" edge */
151
+ /* ray within edge generated by clip */
152
152
  edge;
153
153
  sortCoordinate0;
154
154
  sortCoordinate1;
@@ -167,8 +167,11 @@ class CutLoop {
167
167
  */
168
168
  static createCaptureWithReturnEdge(xyz) {
169
169
  const result = new CutLoop(xyz);
170
- if (xyz.length >= 2)
171
- result.edge = Ray3d_1.Ray3d.createStartEnd(xyz.front(), xyz.back());
170
+ if (xyz.length >= 2) {
171
+ const firstPoint = xyz.getPoint3dAtUncheckedPointIndex(0);
172
+ const lastPoint = xyz.getPoint3dAtUncheckedPointIndex(xyz.length - 1);
173
+ result.edge = Ray3d_1.Ray3d.createStartEnd(firstPoint, lastPoint);
174
+ }
172
175
  return result;
173
176
  }
174
177
  /**
@@ -178,6 +181,8 @@ class CutLoop {
178
181
  * * Hence sorting on the coordinates puts loops in left-to-right order by the their edge vector leftmost point.
179
182
  */
180
183
  setSortCoordinates(ray) {
184
+ if (!this.edge)
185
+ return;
181
186
  this.sortDelta = this.edge.direction.dotProduct(ray.direction);
182
187
  const a = ray.dotProductToPoint(this.edge.origin);
183
188
  if (this.sortDelta >= 0) {
@@ -216,14 +221,6 @@ class CutLoop {
216
221
  const q = loopA.sortCoordinate0 - loopB.sortCoordinate0;
217
222
  return q > 0 ? 1 : -1;
218
223
  }
219
- /** Return first point coordinates.
220
- * * For type checking, assume array is not empty.
221
- */
222
- front(result) { return this.xyz.front(result); }
223
- /** Return last point coordinates.
224
- * * For type checking, assume array is not empty.
225
- */
226
- back(result) { return this.xyz.back(result); }
227
224
  }
228
225
  exports.CutLoop = CutLoop;
229
226
  /**
@@ -252,17 +249,19 @@ class CutLoopMergeContext {
252
249
  resultPoint.setZero();
253
250
  let d;
254
251
  for (const loop of this.inputLoops) {
255
- loop.front(workPoint);
256
- d = workPoint.distanceSquared(point0);
257
- if (d > dMax) {
258
- dMax = d;
259
- resultPoint.setFromPoint3d(workPoint);
252
+ if (loop.xyz.front(workPoint)) {
253
+ d = workPoint.distanceSquared(point0);
254
+ if (d > dMax) {
255
+ dMax = d;
256
+ resultPoint.setFromPoint3d(workPoint);
257
+ }
260
258
  }
261
- loop.back(workPoint);
262
- d = workPoint.distanceSquared(point0);
263
- if (d > dMax) {
264
- dMax = d;
265
- resultPoint.setFromPoint3d(workPoint);
259
+ if (loop.xyz.back(workPoint)) {
260
+ d = workPoint.distanceSquared(point0);
261
+ if (d > dMax) {
262
+ dMax = d;
263
+ resultPoint.setFromPoint3d(workPoint);
264
+ }
266
265
  }
267
266
  }
268
267
  }
@@ -273,7 +272,7 @@ class CutLoopMergeContext {
273
272
  */
274
273
  sortInputs() {
275
274
  if (this.inputLoops.length > 0 && this.inputLoops[0].xyz.length > 0) {
276
- const point0 = this.inputLoops[0].xyz.front();
275
+ const point0 = this.inputLoops[0].xyz.getPoint3dAtUncheckedPointIndex(0);
277
276
  const workPoint = Point3dVector3d_1.Point3d.create();
278
277
  const point1 = Point3dVector3d_1.Point3d.create();
279
278
  // point0 could be in the middle. Find the most distant point ...
@@ -541,9 +540,9 @@ class PolygonOps {
541
540
  }
542
541
  const n = points.length;
543
542
  if (n === 3) {
544
- const normal = points.crossProductIndexIndexIndex(0, 1, 2, result?.direction);
543
+ const normal = points.crossProductUncheckedIndexIndexIndex(0, 1, 2, result?.direction);
545
544
  const a = 0.5 * normal.magnitude();
546
- const centroid = points.getPoint3dAtCheckedPointIndex(0, result?.origin);
545
+ const centroid = points.getPoint3dAtUncheckedPointIndex(0, result?.origin);
547
546
  points.accumulateScaledXYZ(1, 1.0, centroid);
548
547
  points.accumulateScaledXYZ(2, 1.0, centroid);
549
548
  centroid.scaleInPlace(1.0 / 3.0);
@@ -560,7 +559,7 @@ class PolygonOps {
560
559
  points.accumulateCrossProductIndexIndexIndex(0, i - 1, i, areaNormal);
561
560
  }
562
561
  areaNormal.normalizeInPlace();
563
- const origin = points.getPoint3dAtCheckedPointIndex(0);
562
+ const origin = points.getPoint3dAtUncheckedPointIndex(0);
564
563
  const vector0 = Point3dVector3d_1.Vector3d.create();
565
564
  const vector1 = Point3dVector3d_1.Vector3d.create();
566
565
  points.vectorXYAndZIndex(origin, 1, vector0);
@@ -686,7 +685,7 @@ class PolygonOps {
686
685
  const placement = PolygonOps._matrixA;
687
686
  const matrixAB = PolygonOps._matrixB;
688
687
  const matrixABC = PolygonOps._matrixC;
689
- const vectorOrigin = points.vectorXYAndZIndex(origin, 0, PolygonOps._vectorOrigin);
688
+ const vectorOrigin = points.vectorXYAndZUncheckedIndex(origin, 0, PolygonOps._vectorOrigin);
690
689
  const numPoints = points.length;
691
690
  let detJ = 0;
692
691
  for (let i2 = 2; i2 < numPoints; i2++) {
@@ -715,14 +714,14 @@ class PolygonOps {
715
714
  /**
716
715
  * Compute the signed volume of the truncated prism between a facet and a plane.
717
716
  * * Useful for parallel algorithms.
718
- * @param facetPoints input 3D polygon; on return the points are projected onto the plane. Wraparound point is optional.
717
+ * @param facetPoints input 3D polygon, wraparound point optional. This array is mutated on return if `options.skipMoments === false`: each point is projected onto the plane.
719
718
  * @param plane infinite plane bounding volume between the facet and (virtual) side facets perpendicular to the plane (unmodified).
720
719
  * @param options optional flags and pre-allocated temporary storage.
721
- * @returns computed data for this facet:
722
- * * `volume6`: six times the signed volume of the truncated prism between the facet and the plane.
723
- * * `area2`: two times the signed area of the facet's projection onto the plane.
724
- * * `origin`: origin of the facet used to accumulate area moments.
725
- * * `products`: raw accumulated second moment area products of the facet's projection onto the plane.
720
+ * @returns computed data for this facet, or defaults if `facetPoints.length < 3`:
721
+ * * `volume6`: six times the signed volume of the truncated prism between the facet and the plane (default 0).
722
+ * * `area2`: two times the signed area of the facet's projection onto the plane (default 0).
723
+ * * `origin`: origin of the facet used to accumulate area moments (default `undefined`).
724
+ * * `products`: raw accumulated second moment area products of the facet's projection onto the plane (default `undefined`).
726
725
  * @see [[PolyfaceQuery.sumVolumeBetweenFacetsAndPlane]]
727
726
  */
728
727
  static volumeBetweenPolygonAndPlane(facetPoints, plane, options) {
@@ -730,20 +729,22 @@ class PolygonOps {
730
729
  let products;
731
730
  let singleProjectedFacetAreaTimes2 = 0.0;
732
731
  let signedTruncatedPrismVolumeTimes6 = 0.0;
733
- const h0 = facetPoints.evaluateUncheckedIndexPlaneAltitude(0, plane);
734
- for (let i = 1; i + 1 < facetPoints.length; i++) {
735
- const triangleNormal = facetPoints.crossProductIndexIndexIndex(0, i, i + 1, options?.workVector);
736
- const hA = facetPoints.evaluateUncheckedIndexPlaneAltitude(i, plane);
737
- const hB = facetPoints.evaluateUncheckedIndexPlaneAltitude(i + 1, plane);
738
- const signedProjectedTriangleAreaTimes2 = triangleNormal.dotProductXYZ(plane.normalX(), plane.normalY(), plane.normalZ());
739
- singleProjectedFacetAreaTimes2 += signedProjectedTriangleAreaTimes2;
740
- signedTruncatedPrismVolumeTimes6 += signedProjectedTriangleAreaTimes2 * (h0 + hA + hB);
741
- }
742
- if (!options?.skipMoments) {
743
- origin = facetPoints.getPoint3dAtUncheckedPointIndex(0, options?.workPoint0);
744
- products = Matrix4d_1.Matrix4d.createZero(options?.workMatrix);
745
- facetPoints.mapPoint((x, y, z) => plane.projectXYZToPlane(x, y, z, options?.workPoint1));
746
- PolygonOps.addSecondMomentAreaProducts(facetPoints, origin, products);
732
+ if (facetPoints.length >= 3) {
733
+ const h0 = facetPoints.evaluateUncheckedIndexPlaneAltitude(0, plane);
734
+ for (let i = 1; i + 1 < facetPoints.length; i++) {
735
+ const triangleNormal = facetPoints.crossProductUncheckedIndexIndexIndex(0, i, i + 1, options?.workVector);
736
+ const hA = facetPoints.evaluateUncheckedIndexPlaneAltitude(i, plane);
737
+ const hB = facetPoints.evaluateUncheckedIndexPlaneAltitude(i + 1, plane);
738
+ const signedProjectedTriangleAreaTimes2 = triangleNormal.dotProductXYZ(plane.normalX(), plane.normalY(), plane.normalZ());
739
+ singleProjectedFacetAreaTimes2 += signedProjectedTriangleAreaTimes2;
740
+ signedTruncatedPrismVolumeTimes6 += signedProjectedTriangleAreaTimes2 * (h0 + hA + hB);
741
+ }
742
+ if (!options?.skipMoments) {
743
+ origin = facetPoints.getPoint3dAtUncheckedPointIndex(0, options?.workPoint0);
744
+ products = Matrix4d_1.Matrix4d.createZero(options?.workMatrix);
745
+ facetPoints.mapPoint((x, y, z) => plane.projectXYZToPlane(x, y, z, options?.workPoint1));
746
+ PolygonOps.addSecondMomentAreaProducts(facetPoints, origin, products);
747
+ }
747
748
  }
748
749
  return { volume6: signedTruncatedPrismVolumeTimes6, area2: singleProjectedFacetAreaTimes2, origin, products };
749
750
  }
@@ -974,7 +975,7 @@ class PolygonOps {
974
975
  const distTol2 = distTol * distTol;
975
976
  let numPoints = polygon.length;
976
977
  while (numPoints > 1) {
977
- if (polygon.distanceSquaredIndexIndex(0, numPoints - 1) > distTol2)
978
+ if (polygon.distanceSquaredUncheckedIndexIndex(0, numPoints - 1) > distTol2)
978
979
  break;
979
980
  --numPoints; // ignore closure point
980
981
  }
@@ -1002,10 +1003,10 @@ class PolygonOps {
1002
1003
  let iEdgeEnd = iEdgeStart + 1;
1003
1004
  if (iEdgeEnd === numPoints)
1004
1005
  iEdgeEnd = 0;
1005
- uDotU = polygon.distanceSquaredIndexIndex(iEdgeStart, iEdgeEnd);
1006
+ uDotU = polygon.distanceSquaredUncheckedIndexIndex(iEdgeStart, iEdgeEnd);
1006
1007
  if (uDotU > distTol2) { // nontrivial edge
1007
- vDotV = polygon.distanceSquaredIndexXYAndZ(iEdgeStart, testPoint);
1008
- const uDotV = polygon.dotProductIndexIndexXYAndZ(iEdgeStart, iEdgeEnd, testPoint);
1008
+ vDotV = polygon.distanceSquaredUncheckedIndexXYAndZ(iEdgeStart, testPoint);
1009
+ const uDotV = polygon.dotProductUncheckedIndexIndexXYAndZ(iEdgeStart, iEdgeEnd, testPoint);
1009
1010
  edgeParam = uDotV / uDotU; // param of projection of testPoint onto edge [iEdgeStart, iEdgeEnd]
1010
1011
  isValid = true;
1011
1012
  }
@@ -1029,6 +1030,9 @@ class PolygonOps {
1029
1030
  let iNext = iBase + 1;
1030
1031
  if (iNext === numPoints)
1031
1032
  iNext = 0;
1033
+ (0, core_bentley_1.assert)(() => iBase >= 0 && iBase < numPoints &&
1034
+ iPrev >= 0 && iPrev < numPoints &&
1035
+ iNext >= 0 && iNext < numPoints, "expect iBase, iPrev, iNext are valid indices");
1032
1036
  const projData = projectToEdge(iBase);
1033
1037
  if (!projData.isValid)
1034
1038
  continue; // ignore trivial polygon edge (keep iPrev, projBeyondPrevEdge)
@@ -1048,7 +1052,7 @@ class PolygonOps {
1048
1052
  // update candidate (to edge start) only if testPoint projected beyond previous edge end
1049
1053
  polygon.getPoint3dAtUncheckedPointIndex(iBase, result.point);
1050
1054
  result.a = Math.sqrt(distToStart2);
1051
- polygon.crossProductIndexIndexIndex(iBase, iPrev, iNext, result.v);
1055
+ polygon.crossProductUncheckedIndexIndexIndex(iBase, iPrev, iNext, result.v);
1052
1056
  result.code = Geometry_1.PolygonLocation.OnPolygonVertex;
1053
1057
  result.closestEdgeIndex = iBase;
1054
1058
  result.closestEdgeParam = 0.0;
@@ -1096,7 +1100,7 @@ class PolygonOps {
1096
1100
  // update candidate
1097
1101
  polygon.interpolateIndexIndex(iBase, projData.edgeParam, iNext, result.point);
1098
1102
  result.a = Math.sqrt(projDist2);
1099
- polygon.crossProductIndexIndexXYAndZ(iBase, iNext, testPoint, result.v);
1103
+ polygon.crossProductUncheckedIndexIndexXYAndZ(iBase, iNext, testPoint, result.v);
1100
1104
  result.code = projData.edgeParam < 1.0 ? Geometry_1.PolygonLocation.OnPolygonEdgeInterior : Geometry_1.PolygonLocation.OnPolygonVertex;
1101
1105
  ;
1102
1106
  result.closestEdgeIndex = iBase;
@@ -1131,6 +1135,7 @@ class PolygonOps {
1131
1135
  if (!this.unitNormal(polygon, this._normal))
1132
1136
  return PolygonLocationDetail.create(result); // invalid
1133
1137
  const polygonPlane = this._workPlane = Plane3dByOriginAndUnitNormal_1.Plane3dByOriginAndUnitNormal.createXYZUVW(polygon.getXAtUncheckedPointIndex(0), polygon.getYAtUncheckedPointIndex(0), polygon.getZAtUncheckedPointIndex(0), this._normal.x, this._normal.y, this._normal.z, this._workPlane);
1138
+ (0, core_bentley_1.assert)(polygonPlane !== undefined, "expect this._normal to be nonzero because unitNormal succeeded");
1134
1139
  const planePoint = this._workXYZ = polygonPlane.projectPointToPlane(testPoint, this._workXYZ);
1135
1140
  result = this.closestPointOnBoundary(polygon, planePoint, tolerance, result);
1136
1141
  if (result.isValid) {
@@ -1175,6 +1180,7 @@ class PolygonOps {
1175
1180
  if (!this.unitNormal(polygon, this._normal))
1176
1181
  return PolygonLocationDetail.create(result); // invalid
1177
1182
  this._workPlane = Plane3dByOriginAndUnitNormal_1.Plane3dByOriginAndUnitNormal.createXYZUVW(polygon.getXAtUncheckedPointIndex(0), polygon.getYAtUncheckedPointIndex(0), polygon.getZAtUncheckedPointIndex(0), this._normal.x, this._normal.y, this._normal.z, this._workPlane);
1183
+ (0, core_bentley_1.assert)(this._workPlane !== undefined, "expect this._normal to be nonzero because unitNormal succeeded");
1178
1184
  const intersectionPoint = this._workXYZ = Point3dVector3d_1.Point3d.createZero(this._workXYZ);
1179
1185
  const rayParam = ray.intersectionWithPlane(this._workPlane, intersectionPoint);
1180
1186
  if (undefined === rayParam)
@@ -1233,7 +1239,7 @@ class PolygonOps {
1233
1239
  static computeEdgeDataXY(polygon, edgeStartVertexIndex, point, edgeOutwardUnitNormal, tolerance = Geometry_1.Geometry.smallMetricDistance, result) {
1234
1240
  const i0 = edgeStartVertexIndex % polygon.length;
1235
1241
  const i1 = (i0 + 1) % polygon.length;
1236
- polygon.vectorIndexIndex(i0, i1, edgeOutwardUnitNormal).unitPerpendicularXY(edgeOutwardUnitNormal).negate(edgeOutwardUnitNormal); // z is zero
1242
+ polygon.vectorUncheckedIndexIndex(i0, i1, edgeOutwardUnitNormal).unitPerpendicularXY(edgeOutwardUnitNormal).negate(edgeOutwardUnitNormal); // z is zero
1237
1243
  const hypDeltaX = polygon.getXAtUncheckedPointIndex(i0) - point.x;
1238
1244
  const hypDeltaY = polygon.getYAtUncheckedPointIndex(i0) - point.y;
1239
1245
  let projDist = Geometry_1.Geometry.dotProductXYXY(hypDeltaX, hypDeltaY, edgeOutwardUnitNormal.x, edgeOutwardUnitNormal.y);
@@ -1308,9 +1314,14 @@ class PolygonOps {
1308
1314
  return undefined;
1309
1315
  const localToWorld = this._workMatrix3d = Matrix3d_1.Matrix3d.createRigidHeadsUp(this._normal, Geometry_1.AxisOrder.ZXY, this._workMatrix3d);
1310
1316
  const polygonXY = new GrowableXYZArray_1.GrowableXYZArray(n);
1311
- for (let i = 0; i < n; ++i)
1312
- polygonXY.push(localToWorld.multiplyInverseXYZAsPoint3d(polygon.getXAtUncheckedPointIndex(i), polygon.getYAtUncheckedPointIndex(i), polygon.getZAtUncheckedPointIndex(i), this._workXYZ));
1313
- const pointXY = this._workXYZ = localToWorld.multiplyInverseXYZAsPoint3d(point.x, point.y, point.z, this._workXYZ);
1317
+ for (let i = 0; i < n; ++i) {
1318
+ const pt = this._workXYZ = localToWorld.multiplyInverseXYZAsPoint3d(polygon.getXAtUncheckedPointIndex(i), polygon.getYAtUncheckedPointIndex(i), polygon.getZAtUncheckedPointIndex(i), this._workXYZ);
1319
+ (0, core_bentley_1.assert)(pt !== undefined, "expect localToWorld is nonsingular because this._normal is nonzero");
1320
+ polygonXY.push(pt);
1321
+ }
1322
+ (0, core_bentley_1.assert)(this._workXYZ !== undefined, "expect this._workXYZ is allocated because polygon is nonempty");
1323
+ const pointXY = localToWorld.multiplyInverseXYZAsPoint3d(point.x, point.y, point.z, this._workXYZ);
1324
+ (0, core_bentley_1.assert)(pointXY !== undefined, "expect localToWorld is nonsingular because this._normal is nonzero");
1314
1325
  // now we know polygon orientation is ccw, its last edge has positive length, and we can ignore z-coords
1315
1326
  let iPrev = n - 1;
1316
1327
  const outwardUnitNormalOfLastEdge = this._vector0;
@@ -1336,9 +1347,7 @@ class PolygonOps {
1336
1347
  continue; // point is on subsequent colinear edge (ASSUMING interior point, convex polygon!); coords[i] = 0; keep previous edge data
1337
1348
  const areaOfNormalParallelogram = Math.abs(outwardUnitNormalOfPrevEdge.crossProductXY(outwardUnitNormalOfEdge));
1338
1349
  const coord = Geometry_1.Geometry.conditionalDivideCoordinate(areaOfNormalParallelogram, projToPrevEdge.x * projToEdge.x, largestResult);
1339
- if (undefined === coord) {
1340
- (0, core_bentley_1.assert)(false, "unexpectedly small projection distance to an edge"); // shouldn't happen due to chopping in computeEdgeDataXY: area/(dist*dist) <= 1/tol^2 = largestResult
1341
- }
1350
+ (0, core_bentley_1.assert)(coord !== undefined, "unexpectedly small projection distance to an edge"); // shouldn't happen due to chopping in computeEdgeDataXY: area/(dist*dist) <= 1/tol^2 = largestResult
1342
1351
  coords[i] = coord;
1343
1352
  coordSum += coord;
1344
1353
  outwardUnitNormalOfPrevEdge.setFrom(outwardUnitNormalOfEdge);
@@ -1502,78 +1511,71 @@ class IndexedXYZCollectionPolygonOps {
1502
1511
  }
1503
1512
  }
1504
1513
  /**
1505
- * Clip a polygon to one side of a plane.
1506
- * * Results with 2 or fewer points are ignored.
1507
- * * Other than ensuring capacity in the arrays, there are no object allocations during execution of this function.
1514
+ * Clip a polygon to one side of a plane in place.
1508
1515
  * * For a convex input polygon, the output polygon is also convex.
1509
1516
  * * For non-convex input, the output polygon may have double-back edges along plane intersections. This is still a
1510
1517
  * valid clip in a parity sense (overlapping regions cancel).
1511
- * * This method returns only the piece of the input polygon on one side of the clipper.
1512
- * See [[splitConvexPolygonInsideOutsidePlane]] for a method that returns both sides.
1513
- * @param plane any type that has `plane.altitude`
1514
- * @param xyz input polygon, clipped on output
1518
+ * * Output may also consist entirely of (colinear) polygon vertices that lie on the clip plane.
1519
+ * No attempt is made to filter such zero-area output.
1520
+ * * Other than ensuring capacity in the arrays, there are no object allocations during execution of this function.
1521
+ * @param plane altitude evaluator
1522
+ * @param xyz input polygon, clipped on output. Closure point, if present on input, is removed on output. Fewer than 3 input vertices results in empty output.
1515
1523
  * @param work optional work buffer
1516
1524
  * @param keepPositive whether the positive side of the plane survives (true, default), or negative side (false).
1517
1525
  * @param tolerance tolerance for "on plane" decision. This is a distance if `plane` has unit normal (e.g., [[ClipPlane]]).
1518
1526
  * Default value is [[Geometry.smallMetricDistance]].
1519
- * @return the number of crossings. If this is larger than 2, the input polygon was non-convex.
1520
- * @see splitConvexPolygonInsideOutsidePlane
1527
+ * @return the number of on-plane vertices and maximal vertex intervals. If this is larger than 2, the input polygon was non-convex.
1528
+ * @see [[splitConvexPolygonInsideOutsidePlane]] for a method that clips to both sides of the plane.
1521
1529
  */
1522
1530
  static clipConvexPolygonInPlace(plane, xyz, work, keepPositive = true, tolerance = Geometry_1.Geometry.smallMetricDistance) {
1523
- if (!work)
1524
- work = new GrowableXYZArray_1.GrowableXYZArray();
1525
- work.clear();
1526
- const s = keepPositive ? 1.0 : -1.0;
1531
+ while (xyz.length > 1 && xyz.getPoint3dAtUncheckedPointIndex(0).isExactEqual(xyz.getPoint3dAtUncheckedPointIndex(xyz.length - 1)))
1532
+ xyz.pop(); // ignore closure point(s)
1527
1533
  const n = xyz.length;
1528
- let numNegative = 0;
1534
+ if (n < 3) { // swallow degenerate polygon
1535
+ xyz.clear();
1536
+ return 0;
1537
+ }
1538
+ const s = keepPositive ? 1.0 : -1.0;
1539
+ const computeAltitude = (i) => {
1540
+ const a = s * xyz.evaluateUncheckedIndexPlaneAltitude(i, plane);
1541
+ return (Math.abs(a) < tolerance) ? 0 : a;
1542
+ };
1529
1543
  const fractionTol = 1.0e-8;
1530
- const b = -tolerance;
1531
- let numCrossings = 0;
1532
- if (xyz.length > 1) { // > 2 ??
1533
- let a1;
1534
- let index0 = xyz.length - 1;
1535
- let a0 = s * xyz.evaluateUncheckedIndexPlaneAltitude(index0, plane);
1536
- if (Math.abs(a0) < tolerance)
1537
- a0 = 0;
1538
- // if (a0 >= 0.0)
1539
- // work.push_back (xyz0);
1540
- for (let index1 = 0; index1 < n; a0 = a1, index0 = index1++) {
1541
- a1 = s * xyz.evaluateUncheckedIndexPlaneAltitude(index1, plane);
1542
- if (Math.abs(a1) < tolerance)
1543
- a1 = 0;
1544
- if (a1 < 0)
1545
- numNegative++;
1546
- if (a0 * a1 < 0.0) {
1547
- // simple crossing . . .
1548
- const f = -a0 / (a1 - a0);
1549
- if (f > 1.0 - fractionTol && a1 >= 0.0) {
1550
- // the endpoint will be saved -- avoid the duplicate
1551
- }
1552
- else {
1553
- work.pushInterpolatedFromGrowableXYZArray(xyz, index0, f, index1);
1554
- if (a1 > 0)
1555
- numCrossings++; // "out to in"
1556
- }
1544
+ let numClippedVertices = 0;
1545
+ let numSimpleCrossings = 0; // # new surviving vertices, each at intersection of plane with polygon edge interior
1546
+ let numTangentRuns = 0; // # on-plane vertices (or maximal runs of such consecutive vertices) whose entrance/exit edges lie on same side of plane
1547
+ const surviving = work ? work : new GrowableXYZArray_1.GrowableXYZArray();
1548
+ surviving.clear();
1549
+ let a1, a0 = computeAltitude(n - 1);
1550
+ for (let index0 = n - 1, index1 = 0; index1 < n; a0 = a1, index0 = index1++) {
1551
+ a1 = computeAltitude(index1);
1552
+ if (a1 < 0)
1553
+ numClippedVertices++;
1554
+ if (a0 * a1 < 0.0) { // simple crossing
1555
+ const f = -a0 / (a1 - a0);
1556
+ if (f > 1.0 - fractionTol && a1 > 0.0) {
1557
+ // don't push end vertex of this edge; it will be pushed later
1557
1558
  }
1558
- if (a1 >= b) {
1559
- work.pushFromGrowableXYZArray(xyz, index1);
1560
- if (a0 < -b) {
1561
- numCrossings++; // "in to out"
1562
- }
1559
+ else {
1560
+ const crossing = xyz.interpolateUncheckedIndexIndex(index0, f, index1, this._xyz0Work);
1561
+ surviving.pushXYZ(crossing.x, crossing.y, crossing.z);
1562
+ numSimpleCrossings++;
1563
1563
  }
1564
- index0 = index1;
1565
- a0 = a1;
1566
1564
  }
1565
+ if (a1 >= 0) {
1566
+ surviving.pushXYZ(xyz.getXAtUncheckedPointIndex(index1), xyz.getYAtUncheckedPointIndex(index1), xyz.getZAtUncheckedPointIndex(index1));
1567
+ if (a1 === 0 && a0 !== 0)
1568
+ numTangentRuns++; // on-plane vertex, or start of on-plane interval
1569
+ }
1570
+ index0 = index1;
1571
+ a0 = a1;
1567
1572
  }
1568
- if (work.length <= 2) {
1569
- xyz.clear();
1570
- }
1571
- else if (numNegative > 0) {
1573
+ if (numClippedVertices > 0) {
1572
1574
  xyz.clear();
1573
- xyz.pushFromGrowableXYZArray(work);
1575
+ xyz.pushIndexedXYZCollection(surviving);
1574
1576
  }
1575
- work.clear();
1576
- return numCrossings;
1577
+ surviving.clear();
1578
+ return numSimpleCrossings + numTangentRuns;
1577
1579
  }
1578
1580
  /** Return an array containing
1579
1581
  * * All points that are exactly on the plane.
@@ -1646,38 +1648,42 @@ class IndexedXYZCollectionPolygonOps {
1646
1648
  return result;
1647
1649
  }
1648
1650
  /**
1649
- * * Input the loops from `gatherCutLoopsFromClipPlane`
1651
+ * * Input the loops from [[gatherCutLoopsFromPlaneClip]].
1650
1652
  * * Consolidate loops for reentrant configurations.
1651
1653
  * * WARNING: The output reuses and modifies input loops whenever possible.
1652
1654
  * @internal
1653
1655
  */
1654
1656
  static reorderCutLoops(loops) {
1655
- // Simple case: all loops have common orientation
1656
- if (loops.inputLoops.length === 1)
1657
+ if (loops.inputLoops.length <= 1)
1657
1658
  return;
1658
1659
  // Simple cases: 2 loops . . .
1659
1660
  if (loops.inputLoops.length === 2) {
1660
- // if edges are in the same direction, it must be a pair of unrelated loop . . .
1661
- if (loops.inputLoops[0].edge.direction.dotProduct(loops.inputLoops[1].edge.direction) > 0) {
1662
- loops.outputLoops.push(loops.inputLoops[0]);
1663
- loops.outputLoops.push(loops.inputLoops[1]);
1664
- return;
1661
+ const edge0 = loops.inputLoops[0].edge;
1662
+ const edge1 = loops.inputLoops[1].edge;
1663
+ if (edge0 && edge1) {
1664
+ if (edge0.direction.dotProduct(edge1.direction) > 0) {
1665
+ // if edges are in the same direction, it must be a pair of unrelated loops
1666
+ loops.outputLoops.push(loops.inputLoops[0]);
1667
+ loops.outputLoops.push(loops.inputLoops[1]);
1668
+ }
1669
+ else {
1670
+ // 2 loops on opposite sides of the plane; twist into 1
1671
+ const source = loops.inputLoops[1].xyz;
1672
+ const dest = loops.inputLoops[0].xyz;
1673
+ dest.pushFromGrowableXYZArray(source);
1674
+ loops.outputLoops.push(loops.inputLoops[0]);
1675
+ }
1665
1676
  }
1666
- // twist the two loops into 1,
1667
- const source = loops.inputLoops[1].xyz;
1668
- const dest = loops.inputLoops[0].xyz;
1669
- dest.pushFromGrowableXYZArray(source);
1670
- loops.outputLoops.push(loops.inputLoops[0]);
1671
- return;
1672
1677
  }
1673
- // 3 or more loops.
1674
- loops.sortAndMergeLoops();
1675
- //
1678
+ else {
1679
+ // 3 or more loops.
1680
+ loops.sortAndMergeLoops();
1681
+ }
1676
1682
  }
1677
1683
  /**
1678
- * Return the intersection of the plane with a range cube.
1679
- * @param range
1680
- * @param xyzOut intersection polygon. This is convex.
1684
+ * Clip a convex polygon in place by a range box.
1685
+ * @param range six clipping planes
1686
+ * @param xyz convex polygon, clipped in place
1681
1687
  * @return reference to xyz if the polygon still has points; undefined if all points are clipped away.
1682
1688
  */
1683
1689
  static intersectRangeConvexPolygonInPlace(range, xyz) {
@@ -1718,9 +1724,6 @@ exports.IndexedXYZCollectionPolygonOps = IndexedXYZCollectionPolygonOps;
1718
1724
  * @public
1719
1725
  */
1720
1726
  class Point3dArrayPolygonOps {
1721
- static _xyz0Work = Point3dVector3d_1.Point3d.create();
1722
- // private static _xyz1Work: Point3d = Point3d.create();
1723
- // private static _xyz2Work: Point3d = Point3d.create();
1724
1727
  /**
1725
1728
  * Split a (convex) polygon into 2 parts.
1726
1729
  * @param xyz original polygon
@@ -1743,53 +1746,17 @@ class Point3dArrayPolygonOps {
1743
1746
  return IndexedXYZCollectionPolygonOps.polygonPlaneCrossings(plane, xyzSource, crossings);
1744
1747
  }
1745
1748
  /**
1746
- * Clip a polygon, returning the clip result in the same object.
1749
+ * Clip a polygon to one side of a plane in place.
1750
+ * @param plane altitude evaluator
1747
1751
  * @param xyz input/output polygon
1748
- * @param work scratch object
1752
+ * @param work optional scratch object
1749
1753
  * @param tolerance tolerance for on-plane decision.
1754
+ * @see [[IndexedXYZCollectionPolygonOps.clipConvexPolygonInPlace]]
1750
1755
  */
1751
1756
  static convexPolygonClipInPlace(plane, xyz, work, tolerance = Geometry_1.Geometry.smallMetricDistance) {
1752
- if (work === undefined)
1753
- work = [];
1754
- work.length = 0;
1755
- let numNegative = 0;
1756
- const fractionTol = 1.0e-8;
1757
- const b = -tolerance;
1758
- if (xyz.length > 2) {
1759
- let xyz0 = xyz[xyz.length - 1];
1760
- let a0 = plane.altitude(xyz0);
1761
- // if (a0 >= 0.0)
1762
- // work.push_back (xyz0);
1763
- for (const xyz1 of xyz) {
1764
- const a1 = plane.altitude(xyz1);
1765
- if (a1 < 0)
1766
- numNegative++;
1767
- if (a0 * a1 < 0.0) {
1768
- // simple crossing . . .
1769
- const f = -a0 / (a1 - a0);
1770
- if (f > 1.0 - fractionTol && a1 >= 0.0) {
1771
- // the endpoint will be saved -- avoid the duplicate
1772
- }
1773
- else {
1774
- work.push(xyz0.interpolate(f, xyz1));
1775
- }
1776
- }
1777
- if (a1 >= b)
1778
- work.push(xyz1);
1779
- xyz0 = Point3dVector3d_1.Point3d.createFrom(xyz1);
1780
- a0 = a1;
1781
- }
1782
- }
1783
- if (work.length <= 2) {
1784
- xyz.length = 0;
1785
- }
1786
- else if (numNegative > 0) {
1787
- xyz.length = 0;
1788
- for (const xyzI of work) {
1789
- xyz.push(xyzI);
1790
- }
1791
- work.length = 0;
1792
- }
1757
+ const xyzSource = new Point3dArrayCarrier_1.Point3dArrayCarrier(xyz);
1758
+ const workSource = work ? new Point3dArrayCarrier_1.Point3dArrayCarrier(work) : undefined;
1759
+ return IndexedXYZCollectionPolygonOps.clipConvexPolygonInPlace(plane, xyzSource, workSource, true, tolerance);
1793
1760
  }
1794
1761
  }
1795
1762
  exports.Point3dArrayPolygonOps = Point3dArrayPolygonOps;