@itwin/core-geometry 5.0.0-dev.4 → 5.0.0-dev.40

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 (434) hide show
  1. package/CHANGELOG.md +29 -1
  2. package/lib/cjs/Constant.js +17 -17
  3. package/lib/cjs/Constant.js.map +1 -1
  4. package/lib/cjs/Geometry.js +35 -35
  5. package/lib/cjs/Geometry.js.map +1 -1
  6. package/lib/cjs/bspline/BSplineCurveOps.d.ts.map +1 -1
  7. package/lib/cjs/bspline/BSplineCurveOps.js +18 -21
  8. package/lib/cjs/bspline/BSplineCurveOps.js.map +1 -1
  9. package/lib/cjs/bspline/BezierCurveBase.d.ts.map +1 -1
  10. package/lib/cjs/bspline/BezierCurveBase.js.map +1 -1
  11. package/lib/cjs/bspline/KnotVector.js +2 -2
  12. package/lib/cjs/bspline/KnotVector.js.map +1 -1
  13. package/lib/cjs/clipping/AlternatingConvexClipTree.js +2 -2
  14. package/lib/cjs/clipping/AlternatingConvexClipTree.js.map +1 -1
  15. package/lib/cjs/clipping/ClipPlane.js +1 -1
  16. package/lib/cjs/clipping/ClipPlane.js.map +1 -1
  17. package/lib/cjs/clipping/ClipUtils.js +1 -1
  18. package/lib/cjs/clipping/ClipUtils.js.map +1 -1
  19. package/lib/cjs/clipping/ClipVector.js +1 -1
  20. package/lib/cjs/clipping/ClipVector.js.map +1 -1
  21. package/lib/cjs/clipping/ConvexClipPlaneSet.js +3 -3
  22. package/lib/cjs/clipping/ConvexClipPlaneSet.js.map +1 -1
  23. package/lib/cjs/clipping/UnionOfConvexClipPlaneSets.js +1 -1
  24. package/lib/cjs/clipping/UnionOfConvexClipPlaneSets.js.map +1 -1
  25. package/lib/cjs/curve/Arc3d.d.ts +40 -8
  26. package/lib/cjs/curve/Arc3d.d.ts.map +1 -1
  27. package/lib/cjs/curve/Arc3d.js +80 -22
  28. package/lib/cjs/curve/Arc3d.js.map +1 -1
  29. package/lib/cjs/curve/CurveChainWithDistanceIndex.js +4 -4
  30. package/lib/cjs/curve/CurveChainWithDistanceIndex.js.map +1 -1
  31. package/lib/cjs/curve/CurveCollection.d.ts +16 -2
  32. package/lib/cjs/curve/CurveCollection.d.ts.map +1 -1
  33. package/lib/cjs/curve/CurveCollection.js +33 -2
  34. package/lib/cjs/curve/CurveCollection.js.map +1 -1
  35. package/lib/cjs/curve/CurveFactory.d.ts +87 -53
  36. package/lib/cjs/curve/CurveFactory.d.ts.map +1 -1
  37. package/lib/cjs/curve/CurveFactory.js +213 -135
  38. package/lib/cjs/curve/CurveFactory.js.map +1 -1
  39. package/lib/cjs/curve/LineString3d.d.ts +12 -8
  40. package/lib/cjs/curve/LineString3d.d.ts.map +1 -1
  41. package/lib/cjs/curve/LineString3d.js +34 -13
  42. package/lib/cjs/curve/LineString3d.js.map +1 -1
  43. package/lib/cjs/curve/Loop.d.ts +12 -6
  44. package/lib/cjs/curve/Loop.d.ts.map +1 -1
  45. package/lib/cjs/curve/Loop.js +12 -6
  46. package/lib/cjs/curve/Loop.js.map +1 -1
  47. package/lib/cjs/curve/Query/CylindricalRange.d.ts +8 -6
  48. package/lib/cjs/curve/Query/CylindricalRange.d.ts.map +1 -1
  49. package/lib/cjs/curve/Query/CylindricalRange.js +13 -9
  50. package/lib/cjs/curve/Query/CylindricalRange.js.map +1 -1
  51. package/lib/cjs/curve/RegionOpsClassificationSweeps.js +1 -1
  52. package/lib/cjs/curve/RegionOpsClassificationSweeps.js.map +1 -1
  53. package/lib/cjs/curve/StrokeOptions.d.ts +4 -4
  54. package/lib/cjs/curve/StrokeOptions.d.ts.map +1 -1
  55. package/lib/cjs/curve/StrokeOptions.js +1 -1
  56. package/lib/cjs/curve/StrokeOptions.js.map +1 -1
  57. package/lib/cjs/curve/internalContexts/CurveCurveCloseApproachXY.js +5 -5
  58. package/lib/cjs/curve/internalContexts/CurveCurveCloseApproachXY.js.map +1 -1
  59. package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.js +13 -13
  60. package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.js.map +1 -1
  61. package/lib/cjs/curve/internalContexts/CurveCurveIntersectXYZ.js +5 -5
  62. package/lib/cjs/curve/internalContexts/CurveCurveIntersectXYZ.js.map +1 -1
  63. package/lib/cjs/curve/internalContexts/EllipticalArcApproximationContext.d.ts.map +1 -1
  64. package/lib/cjs/curve/internalContexts/EllipticalArcApproximationContext.js +29 -23
  65. package/lib/cjs/curve/internalContexts/EllipticalArcApproximationContext.js.map +1 -1
  66. package/lib/cjs/curve/internalContexts/PolygonOffsetContext.js +4 -4
  67. package/lib/cjs/curve/internalContexts/PolygonOffsetContext.js.map +1 -1
  68. package/lib/cjs/curve/spiral/IntegratedSpiral3d.js +2 -2
  69. package/lib/cjs/curve/spiral/IntegratedSpiral3d.js.map +1 -1
  70. package/lib/cjs/geometry3d/Angle.js +16 -16
  71. package/lib/cjs/geometry3d/Angle.js.map +1 -1
  72. package/lib/cjs/geometry3d/AngleSweep.d.ts +1 -1
  73. package/lib/cjs/geometry3d/AngleSweep.d.ts.map +1 -1
  74. package/lib/cjs/geometry3d/AngleSweep.js +1 -1
  75. package/lib/cjs/geometry3d/AngleSweep.js.map +1 -1
  76. package/lib/cjs/geometry3d/BarycentricTriangle.d.ts +14 -8
  77. package/lib/cjs/geometry3d/BarycentricTriangle.d.ts.map +1 -1
  78. package/lib/cjs/geometry3d/BarycentricTriangle.js +17 -8
  79. package/lib/cjs/geometry3d/BarycentricTriangle.js.map +1 -1
  80. package/lib/cjs/geometry3d/FrameBuilder.js +4 -4
  81. package/lib/cjs/geometry3d/FrameBuilder.js.map +1 -1
  82. package/lib/cjs/geometry3d/GrowableFloat64Array.d.ts +2 -0
  83. package/lib/cjs/geometry3d/GrowableFloat64Array.d.ts.map +1 -1
  84. package/lib/cjs/geometry3d/GrowableFloat64Array.js +4 -0
  85. package/lib/cjs/geometry3d/GrowableFloat64Array.js.map +1 -1
  86. package/lib/cjs/geometry3d/GrowableXYZArray.d.ts +32 -10
  87. package/lib/cjs/geometry3d/GrowableXYZArray.d.ts.map +1 -1
  88. package/lib/cjs/geometry3d/GrowableXYZArray.js +54 -16
  89. package/lib/cjs/geometry3d/GrowableXYZArray.js.map +1 -1
  90. package/lib/cjs/geometry3d/IndexedXYZCollection.d.ts +13 -2
  91. package/lib/cjs/geometry3d/IndexedXYZCollection.d.ts.map +1 -1
  92. package/lib/cjs/geometry3d/IndexedXYZCollection.js +24 -10
  93. package/lib/cjs/geometry3d/IndexedXYZCollection.js.map +1 -1
  94. package/lib/cjs/geometry3d/Matrix3d.d.ts +11 -8
  95. package/lib/cjs/geometry3d/Matrix3d.d.ts.map +1 -1
  96. package/lib/cjs/geometry3d/Matrix3d.js +36 -34
  97. package/lib/cjs/geometry3d/Matrix3d.js.map +1 -1
  98. package/lib/cjs/geometry3d/OrderedRotationAngles.js +2 -2
  99. package/lib/cjs/geometry3d/OrderedRotationAngles.js.map +1 -1
  100. package/lib/cjs/geometry3d/Point3dArrayCarrier.js +1 -1
  101. package/lib/cjs/geometry3d/Point3dArrayCarrier.js.map +1 -1
  102. package/lib/cjs/geometry3d/Point3dVector3d.d.ts +6 -6
  103. package/lib/cjs/geometry3d/Point3dVector3d.js +6 -6
  104. package/lib/cjs/geometry3d/Point3dVector3d.js.map +1 -1
  105. package/lib/cjs/geometry3d/PointHelpers.js +5 -5
  106. package/lib/cjs/geometry3d/PointHelpers.js.map +1 -1
  107. package/lib/cjs/geometry3d/PolygonOps.d.ts +12 -6
  108. package/lib/cjs/geometry3d/PolygonOps.d.ts.map +1 -1
  109. package/lib/cjs/geometry3d/PolygonOps.js +117 -70
  110. package/lib/cjs/geometry3d/PolygonOps.js.map +1 -1
  111. package/lib/cjs/geometry3d/PolylineCompressionByEdgeOffset.js +3 -3
  112. package/lib/cjs/geometry3d/PolylineCompressionByEdgeOffset.js.map +1 -1
  113. package/lib/cjs/geometry3d/PolylineOps.d.ts +9 -5
  114. package/lib/cjs/geometry3d/PolylineOps.d.ts.map +1 -1
  115. package/lib/cjs/geometry3d/PolylineOps.js +9 -5
  116. package/lib/cjs/geometry3d/PolylineOps.js.map +1 -1
  117. package/lib/cjs/geometry3d/Range.js +4 -4
  118. package/lib/cjs/geometry3d/Range.js.map +1 -1
  119. package/lib/cjs/geometry4d/MomentData.d.ts +72 -73
  120. package/lib/cjs/geometry4d/MomentData.d.ts.map +1 -1
  121. package/lib/cjs/geometry4d/MomentData.js +62 -64
  122. package/lib/cjs/geometry4d/MomentData.js.map +1 -1
  123. package/lib/cjs/numerics/ClusterableArray.js +13 -13
  124. package/lib/cjs/numerics/ClusterableArray.js.map +1 -1
  125. package/lib/cjs/numerics/PascalCoefficients.js +1 -1
  126. package/lib/cjs/numerics/PascalCoefficients.js.map +1 -1
  127. package/lib/cjs/numerics/PolarData.js +1 -1
  128. package/lib/cjs/numerics/PolarData.js.map +1 -1
  129. package/lib/cjs/numerics/Polynomials.d.ts +5 -5
  130. package/lib/cjs/numerics/Polynomials.js +32 -32
  131. package/lib/cjs/numerics/Polynomials.js.map +1 -1
  132. package/lib/cjs/numerics/Quadrature.js +20 -20
  133. package/lib/cjs/numerics/Quadrature.js.map +1 -1
  134. package/lib/cjs/polyface/AuxData.d.ts +2 -2
  135. package/lib/cjs/polyface/AuxData.d.ts.map +1 -1
  136. package/lib/cjs/polyface/AuxData.js +11 -3
  137. package/lib/cjs/polyface/AuxData.js.map +1 -1
  138. package/lib/cjs/polyface/BoxTopology.js +67 -67
  139. package/lib/cjs/polyface/BoxTopology.js.map +1 -1
  140. package/lib/cjs/polyface/GreedyTriangulationBetweenLineStrings.js +2 -2
  141. package/lib/cjs/polyface/GreedyTriangulationBetweenLineStrings.js.map +1 -1
  142. package/lib/cjs/polyface/IndexedEdgeMatcher.d.ts +27 -20
  143. package/lib/cjs/polyface/IndexedEdgeMatcher.d.ts.map +1 -1
  144. package/lib/cjs/polyface/IndexedEdgeMatcher.js +56 -30
  145. package/lib/cjs/polyface/IndexedEdgeMatcher.js.map +1 -1
  146. package/lib/cjs/polyface/IndexedPolyfaceVisitor.d.ts +2 -1
  147. package/lib/cjs/polyface/IndexedPolyfaceVisitor.d.ts.map +1 -1
  148. package/lib/cjs/polyface/IndexedPolyfaceVisitor.js +2 -1
  149. package/lib/cjs/polyface/IndexedPolyfaceVisitor.js.map +1 -1
  150. package/lib/cjs/polyface/Polyface.d.ts +3 -5
  151. package/lib/cjs/polyface/Polyface.d.ts.map +1 -1
  152. package/lib/cjs/polyface/Polyface.js +6 -13
  153. package/lib/cjs/polyface/Polyface.js.map +1 -1
  154. package/lib/cjs/polyface/PolyfaceBuilder.d.ts +14 -7
  155. package/lib/cjs/polyface/PolyfaceBuilder.d.ts.map +1 -1
  156. package/lib/cjs/polyface/PolyfaceBuilder.js +59 -64
  157. package/lib/cjs/polyface/PolyfaceBuilder.js.map +1 -1
  158. package/lib/cjs/polyface/PolyfaceData.d.ts +13 -3
  159. package/lib/cjs/polyface/PolyfaceData.d.ts.map +1 -1
  160. package/lib/cjs/polyface/PolyfaceData.js +26 -9
  161. package/lib/cjs/polyface/PolyfaceData.js.map +1 -1
  162. package/lib/cjs/polyface/PolyfaceQuery.d.ts +2 -2
  163. package/lib/cjs/polyface/PolyfaceQuery.d.ts.map +1 -1
  164. package/lib/cjs/polyface/PolyfaceQuery.js +11 -10
  165. package/lib/cjs/polyface/PolyfaceQuery.js.map +1 -1
  166. package/lib/cjs/polyface/multiclip/RangeSearch.js +5 -5
  167. package/lib/cjs/polyface/multiclip/RangeSearch.js.map +1 -1
  168. package/lib/cjs/serialization/BGFBReader.js +22 -22
  169. package/lib/cjs/serialization/BGFBReader.js.map +1 -1
  170. package/lib/cjs/serialization/GeometrySamples.d.ts +5 -5
  171. package/lib/cjs/serialization/GeometrySamples.d.ts.map +1 -1
  172. package/lib/cjs/serialization/GeometrySamples.js +112 -112
  173. package/lib/cjs/serialization/GeometrySamples.js.map +1 -1
  174. package/lib/cjs/solid/Box.d.ts +9 -3
  175. package/lib/cjs/solid/Box.d.ts.map +1 -1
  176. package/lib/cjs/solid/Box.js +10 -5
  177. package/lib/cjs/solid/Box.js.map +1 -1
  178. package/lib/cjs/solid/Cone.d.ts +3 -2
  179. package/lib/cjs/solid/Cone.d.ts.map +1 -1
  180. package/lib/cjs/solid/Cone.js +3 -3
  181. package/lib/cjs/solid/Cone.js.map +1 -1
  182. package/lib/cjs/solid/LinearSweep.d.ts +9 -3
  183. package/lib/cjs/solid/LinearSweep.d.ts.map +1 -1
  184. package/lib/cjs/solid/LinearSweep.js +9 -4
  185. package/lib/cjs/solid/LinearSweep.js.map +1 -1
  186. package/lib/cjs/solid/RotationalSweep.d.ts +15 -4
  187. package/lib/cjs/solid/RotationalSweep.d.ts.map +1 -1
  188. package/lib/cjs/solid/RotationalSweep.js +20 -7
  189. package/lib/cjs/solid/RotationalSweep.js.map +1 -1
  190. package/lib/cjs/solid/RuledSweep.d.ts +35 -26
  191. package/lib/cjs/solid/RuledSweep.d.ts.map +1 -1
  192. package/lib/cjs/solid/RuledSweep.js +41 -28
  193. package/lib/cjs/solid/RuledSweep.js.map +1 -1
  194. package/lib/cjs/solid/SolidPrimitive.d.ts +12 -11
  195. package/lib/cjs/solid/SolidPrimitive.d.ts.map +1 -1
  196. package/lib/cjs/solid/SolidPrimitive.js +8 -5
  197. package/lib/cjs/solid/SolidPrimitive.js.map +1 -1
  198. package/lib/cjs/solid/Sphere.d.ts +17 -7
  199. package/lib/cjs/solid/Sphere.d.ts.map +1 -1
  200. package/lib/cjs/solid/Sphere.js +22 -16
  201. package/lib/cjs/solid/Sphere.js.map +1 -1
  202. package/lib/cjs/solid/SweepContour.d.ts +25 -16
  203. package/lib/cjs/solid/SweepContour.d.ts.map +1 -1
  204. package/lib/cjs/solid/SweepContour.js +25 -16
  205. package/lib/cjs/solid/SweepContour.js.map +1 -1
  206. package/lib/cjs/solid/TorusPipe.d.ts +8 -2
  207. package/lib/cjs/solid/TorusPipe.d.ts.map +1 -1
  208. package/lib/cjs/solid/TorusPipe.js +9 -5
  209. package/lib/cjs/solid/TorusPipe.js.map +1 -1
  210. package/lib/cjs/topology/ChainMerge.js +4 -4
  211. package/lib/cjs/topology/ChainMerge.js.map +1 -1
  212. package/lib/cjs/topology/Graph.js +5 -5
  213. package/lib/cjs/topology/Graph.js.map +1 -1
  214. package/lib/cjs/topology/HalfEdgeGraphSpineContext.js +2 -2
  215. package/lib/cjs/topology/HalfEdgeGraphSpineContext.js.map +1 -1
  216. package/lib/cjs/topology/Triangulation.js +11 -11
  217. package/lib/cjs/topology/Triangulation.js.map +1 -1
  218. package/lib/esm/Constant.js +17 -17
  219. package/lib/esm/Constant.js.map +1 -1
  220. package/lib/esm/Geometry.js +35 -35
  221. package/lib/esm/Geometry.js.map +1 -1
  222. package/lib/esm/bspline/BSplineCurveOps.d.ts.map +1 -1
  223. package/lib/esm/bspline/BSplineCurveOps.js +18 -21
  224. package/lib/esm/bspline/BSplineCurveOps.js.map +1 -1
  225. package/lib/esm/bspline/BezierCurveBase.d.ts.map +1 -1
  226. package/lib/esm/bspline/BezierCurveBase.js.map +1 -1
  227. package/lib/esm/bspline/KnotVector.js +2 -2
  228. package/lib/esm/bspline/KnotVector.js.map +1 -1
  229. package/lib/esm/clipping/AlternatingConvexClipTree.js +2 -2
  230. package/lib/esm/clipping/AlternatingConvexClipTree.js.map +1 -1
  231. package/lib/esm/clipping/ClipPlane.js +1 -1
  232. package/lib/esm/clipping/ClipPlane.js.map +1 -1
  233. package/lib/esm/clipping/ClipUtils.js +1 -1
  234. package/lib/esm/clipping/ClipUtils.js.map +1 -1
  235. package/lib/esm/clipping/ClipVector.js +1 -1
  236. package/lib/esm/clipping/ClipVector.js.map +1 -1
  237. package/lib/esm/clipping/ConvexClipPlaneSet.js +3 -3
  238. package/lib/esm/clipping/ConvexClipPlaneSet.js.map +1 -1
  239. package/lib/esm/clipping/UnionOfConvexClipPlaneSets.js +1 -1
  240. package/lib/esm/clipping/UnionOfConvexClipPlaneSets.js.map +1 -1
  241. package/lib/esm/curve/Arc3d.d.ts +40 -8
  242. package/lib/esm/curve/Arc3d.d.ts.map +1 -1
  243. package/lib/esm/curve/Arc3d.js +80 -22
  244. package/lib/esm/curve/Arc3d.js.map +1 -1
  245. package/lib/esm/curve/CurveChainWithDistanceIndex.js +4 -4
  246. package/lib/esm/curve/CurveChainWithDistanceIndex.js.map +1 -1
  247. package/lib/esm/curve/CurveCollection.d.ts +16 -2
  248. package/lib/esm/curve/CurveCollection.d.ts.map +1 -1
  249. package/lib/esm/curve/CurveCollection.js +33 -2
  250. package/lib/esm/curve/CurveCollection.js.map +1 -1
  251. package/lib/esm/curve/CurveFactory.d.ts +87 -53
  252. package/lib/esm/curve/CurveFactory.d.ts.map +1 -1
  253. package/lib/esm/curve/CurveFactory.js +213 -135
  254. package/lib/esm/curve/CurveFactory.js.map +1 -1
  255. package/lib/esm/curve/LineString3d.d.ts +12 -8
  256. package/lib/esm/curve/LineString3d.d.ts.map +1 -1
  257. package/lib/esm/curve/LineString3d.js +34 -13
  258. package/lib/esm/curve/LineString3d.js.map +1 -1
  259. package/lib/esm/curve/Loop.d.ts +12 -6
  260. package/lib/esm/curve/Loop.d.ts.map +1 -1
  261. package/lib/esm/curve/Loop.js +12 -6
  262. package/lib/esm/curve/Loop.js.map +1 -1
  263. package/lib/esm/curve/Query/CylindricalRange.d.ts +8 -6
  264. package/lib/esm/curve/Query/CylindricalRange.d.ts.map +1 -1
  265. package/lib/esm/curve/Query/CylindricalRange.js +13 -9
  266. package/lib/esm/curve/Query/CylindricalRange.js.map +1 -1
  267. package/lib/esm/curve/RegionOpsClassificationSweeps.js +1 -1
  268. package/lib/esm/curve/RegionOpsClassificationSweeps.js.map +1 -1
  269. package/lib/esm/curve/StrokeOptions.d.ts +4 -4
  270. package/lib/esm/curve/StrokeOptions.d.ts.map +1 -1
  271. package/lib/esm/curve/StrokeOptions.js +1 -1
  272. package/lib/esm/curve/StrokeOptions.js.map +1 -1
  273. package/lib/esm/curve/internalContexts/CurveCurveCloseApproachXY.js +5 -5
  274. package/lib/esm/curve/internalContexts/CurveCurveCloseApproachXY.js.map +1 -1
  275. package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.js +13 -13
  276. package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.js.map +1 -1
  277. package/lib/esm/curve/internalContexts/CurveCurveIntersectXYZ.js +5 -5
  278. package/lib/esm/curve/internalContexts/CurveCurveIntersectXYZ.js.map +1 -1
  279. package/lib/esm/curve/internalContexts/EllipticalArcApproximationContext.d.ts.map +1 -1
  280. package/lib/esm/curve/internalContexts/EllipticalArcApproximationContext.js +29 -23
  281. package/lib/esm/curve/internalContexts/EllipticalArcApproximationContext.js.map +1 -1
  282. package/lib/esm/curve/internalContexts/PolygonOffsetContext.js +4 -4
  283. package/lib/esm/curve/internalContexts/PolygonOffsetContext.js.map +1 -1
  284. package/lib/esm/curve/spiral/IntegratedSpiral3d.js +2 -2
  285. package/lib/esm/curve/spiral/IntegratedSpiral3d.js.map +1 -1
  286. package/lib/esm/geometry3d/Angle.js +16 -16
  287. package/lib/esm/geometry3d/Angle.js.map +1 -1
  288. package/lib/esm/geometry3d/AngleSweep.d.ts +1 -1
  289. package/lib/esm/geometry3d/AngleSweep.d.ts.map +1 -1
  290. package/lib/esm/geometry3d/AngleSweep.js +1 -1
  291. package/lib/esm/geometry3d/AngleSweep.js.map +1 -1
  292. package/lib/esm/geometry3d/BarycentricTriangle.d.ts +14 -8
  293. package/lib/esm/geometry3d/BarycentricTriangle.d.ts.map +1 -1
  294. package/lib/esm/geometry3d/BarycentricTriangle.js +17 -8
  295. package/lib/esm/geometry3d/BarycentricTriangle.js.map +1 -1
  296. package/lib/esm/geometry3d/FrameBuilder.js +4 -4
  297. package/lib/esm/geometry3d/FrameBuilder.js.map +1 -1
  298. package/lib/esm/geometry3d/GrowableFloat64Array.d.ts +2 -0
  299. package/lib/esm/geometry3d/GrowableFloat64Array.d.ts.map +1 -1
  300. package/lib/esm/geometry3d/GrowableFloat64Array.js +4 -0
  301. package/lib/esm/geometry3d/GrowableFloat64Array.js.map +1 -1
  302. package/lib/esm/geometry3d/GrowableXYZArray.d.ts +32 -10
  303. package/lib/esm/geometry3d/GrowableXYZArray.d.ts.map +1 -1
  304. package/lib/esm/geometry3d/GrowableXYZArray.js +54 -16
  305. package/lib/esm/geometry3d/GrowableXYZArray.js.map +1 -1
  306. package/lib/esm/geometry3d/IndexedXYZCollection.d.ts +13 -2
  307. package/lib/esm/geometry3d/IndexedXYZCollection.d.ts.map +1 -1
  308. package/lib/esm/geometry3d/IndexedXYZCollection.js +24 -10
  309. package/lib/esm/geometry3d/IndexedXYZCollection.js.map +1 -1
  310. package/lib/esm/geometry3d/Matrix3d.d.ts +11 -8
  311. package/lib/esm/geometry3d/Matrix3d.d.ts.map +1 -1
  312. package/lib/esm/geometry3d/Matrix3d.js +36 -34
  313. package/lib/esm/geometry3d/Matrix3d.js.map +1 -1
  314. package/lib/esm/geometry3d/OrderedRotationAngles.js +2 -2
  315. package/lib/esm/geometry3d/OrderedRotationAngles.js.map +1 -1
  316. package/lib/esm/geometry3d/Point3dArrayCarrier.js +1 -1
  317. package/lib/esm/geometry3d/Point3dArrayCarrier.js.map +1 -1
  318. package/lib/esm/geometry3d/Point3dVector3d.d.ts +6 -6
  319. package/lib/esm/geometry3d/Point3dVector3d.js +6 -6
  320. package/lib/esm/geometry3d/Point3dVector3d.js.map +1 -1
  321. package/lib/esm/geometry3d/PointHelpers.js +5 -5
  322. package/lib/esm/geometry3d/PointHelpers.js.map +1 -1
  323. package/lib/esm/geometry3d/PolygonOps.d.ts +12 -6
  324. package/lib/esm/geometry3d/PolygonOps.d.ts.map +1 -1
  325. package/lib/esm/geometry3d/PolygonOps.js +117 -70
  326. package/lib/esm/geometry3d/PolygonOps.js.map +1 -1
  327. package/lib/esm/geometry3d/PolylineCompressionByEdgeOffset.js +3 -3
  328. package/lib/esm/geometry3d/PolylineCompressionByEdgeOffset.js.map +1 -1
  329. package/lib/esm/geometry3d/PolylineOps.d.ts +9 -5
  330. package/lib/esm/geometry3d/PolylineOps.d.ts.map +1 -1
  331. package/lib/esm/geometry3d/PolylineOps.js +9 -5
  332. package/lib/esm/geometry3d/PolylineOps.js.map +1 -1
  333. package/lib/esm/geometry3d/Range.js +4 -4
  334. package/lib/esm/geometry3d/Range.js.map +1 -1
  335. package/lib/esm/geometry4d/MomentData.d.ts +72 -73
  336. package/lib/esm/geometry4d/MomentData.d.ts.map +1 -1
  337. package/lib/esm/geometry4d/MomentData.js +62 -64
  338. package/lib/esm/geometry4d/MomentData.js.map +1 -1
  339. package/lib/esm/numerics/ClusterableArray.js +13 -13
  340. package/lib/esm/numerics/ClusterableArray.js.map +1 -1
  341. package/lib/esm/numerics/PascalCoefficients.js +1 -1
  342. package/lib/esm/numerics/PascalCoefficients.js.map +1 -1
  343. package/lib/esm/numerics/PolarData.js +1 -1
  344. package/lib/esm/numerics/PolarData.js.map +1 -1
  345. package/lib/esm/numerics/Polynomials.d.ts +5 -5
  346. package/lib/esm/numerics/Polynomials.js +32 -32
  347. package/lib/esm/numerics/Polynomials.js.map +1 -1
  348. package/lib/esm/numerics/Quadrature.js +20 -20
  349. package/lib/esm/numerics/Quadrature.js.map +1 -1
  350. package/lib/esm/polyface/AuxData.d.ts +2 -2
  351. package/lib/esm/polyface/AuxData.d.ts.map +1 -1
  352. package/lib/esm/polyface/AuxData.js +11 -3
  353. package/lib/esm/polyface/AuxData.js.map +1 -1
  354. package/lib/esm/polyface/BoxTopology.js +67 -67
  355. package/lib/esm/polyface/BoxTopology.js.map +1 -1
  356. package/lib/esm/polyface/GreedyTriangulationBetweenLineStrings.js +2 -2
  357. package/lib/esm/polyface/GreedyTriangulationBetweenLineStrings.js.map +1 -1
  358. package/lib/esm/polyface/IndexedEdgeMatcher.d.ts +27 -20
  359. package/lib/esm/polyface/IndexedEdgeMatcher.d.ts.map +1 -1
  360. package/lib/esm/polyface/IndexedEdgeMatcher.js +56 -30
  361. package/lib/esm/polyface/IndexedEdgeMatcher.js.map +1 -1
  362. package/lib/esm/polyface/IndexedPolyfaceVisitor.d.ts +2 -1
  363. package/lib/esm/polyface/IndexedPolyfaceVisitor.d.ts.map +1 -1
  364. package/lib/esm/polyface/IndexedPolyfaceVisitor.js +2 -1
  365. package/lib/esm/polyface/IndexedPolyfaceVisitor.js.map +1 -1
  366. package/lib/esm/polyface/Polyface.d.ts +3 -5
  367. package/lib/esm/polyface/Polyface.d.ts.map +1 -1
  368. package/lib/esm/polyface/Polyface.js +6 -13
  369. package/lib/esm/polyface/Polyface.js.map +1 -1
  370. package/lib/esm/polyface/PolyfaceBuilder.d.ts +14 -7
  371. package/lib/esm/polyface/PolyfaceBuilder.d.ts.map +1 -1
  372. package/lib/esm/polyface/PolyfaceBuilder.js +60 -65
  373. package/lib/esm/polyface/PolyfaceBuilder.js.map +1 -1
  374. package/lib/esm/polyface/PolyfaceData.d.ts +13 -3
  375. package/lib/esm/polyface/PolyfaceData.d.ts.map +1 -1
  376. package/lib/esm/polyface/PolyfaceData.js +26 -9
  377. package/lib/esm/polyface/PolyfaceData.js.map +1 -1
  378. package/lib/esm/polyface/PolyfaceQuery.d.ts +2 -2
  379. package/lib/esm/polyface/PolyfaceQuery.d.ts.map +1 -1
  380. package/lib/esm/polyface/PolyfaceQuery.js +11 -10
  381. package/lib/esm/polyface/PolyfaceQuery.js.map +1 -1
  382. package/lib/esm/polyface/multiclip/RangeSearch.js +5 -5
  383. package/lib/esm/polyface/multiclip/RangeSearch.js.map +1 -1
  384. package/lib/esm/serialization/BGFBReader.js +22 -22
  385. package/lib/esm/serialization/BGFBReader.js.map +1 -1
  386. package/lib/esm/serialization/GeometrySamples.d.ts +5 -5
  387. package/lib/esm/serialization/GeometrySamples.d.ts.map +1 -1
  388. package/lib/esm/serialization/GeometrySamples.js +112 -112
  389. package/lib/esm/serialization/GeometrySamples.js.map +1 -1
  390. package/lib/esm/solid/Box.d.ts +9 -3
  391. package/lib/esm/solid/Box.d.ts.map +1 -1
  392. package/lib/esm/solid/Box.js +10 -5
  393. package/lib/esm/solid/Box.js.map +1 -1
  394. package/lib/esm/solid/Cone.d.ts +3 -2
  395. package/lib/esm/solid/Cone.d.ts.map +1 -1
  396. package/lib/esm/solid/Cone.js +3 -3
  397. package/lib/esm/solid/Cone.js.map +1 -1
  398. package/lib/esm/solid/LinearSweep.d.ts +9 -3
  399. package/lib/esm/solid/LinearSweep.d.ts.map +1 -1
  400. package/lib/esm/solid/LinearSweep.js +9 -4
  401. package/lib/esm/solid/LinearSweep.js.map +1 -1
  402. package/lib/esm/solid/RotationalSweep.d.ts +15 -4
  403. package/lib/esm/solid/RotationalSweep.d.ts.map +1 -1
  404. package/lib/esm/solid/RotationalSweep.js +20 -7
  405. package/lib/esm/solid/RotationalSweep.js.map +1 -1
  406. package/lib/esm/solid/RuledSweep.d.ts +35 -26
  407. package/lib/esm/solid/RuledSweep.d.ts.map +1 -1
  408. package/lib/esm/solid/RuledSweep.js +41 -28
  409. package/lib/esm/solid/RuledSweep.js.map +1 -1
  410. package/lib/esm/solid/SolidPrimitive.d.ts +12 -11
  411. package/lib/esm/solid/SolidPrimitive.d.ts.map +1 -1
  412. package/lib/esm/solid/SolidPrimitive.js +8 -5
  413. package/lib/esm/solid/SolidPrimitive.js.map +1 -1
  414. package/lib/esm/solid/Sphere.d.ts +17 -7
  415. package/lib/esm/solid/Sphere.d.ts.map +1 -1
  416. package/lib/esm/solid/Sphere.js +22 -16
  417. package/lib/esm/solid/Sphere.js.map +1 -1
  418. package/lib/esm/solid/SweepContour.d.ts +25 -16
  419. package/lib/esm/solid/SweepContour.d.ts.map +1 -1
  420. package/lib/esm/solid/SweepContour.js +25 -16
  421. package/lib/esm/solid/SweepContour.js.map +1 -1
  422. package/lib/esm/solid/TorusPipe.d.ts +8 -2
  423. package/lib/esm/solid/TorusPipe.d.ts.map +1 -1
  424. package/lib/esm/solid/TorusPipe.js +9 -5
  425. package/lib/esm/solid/TorusPipe.js.map +1 -1
  426. package/lib/esm/topology/ChainMerge.js +4 -4
  427. package/lib/esm/topology/ChainMerge.js.map +1 -1
  428. package/lib/esm/topology/Graph.js +5 -5
  429. package/lib/esm/topology/Graph.js.map +1 -1
  430. package/lib/esm/topology/HalfEdgeGraphSpineContext.js +2 -2
  431. package/lib/esm/topology/HalfEdgeGraphSpineContext.js.map +1 -1
  432. package/lib/esm/topology/Triangulation.js +11 -11
  433. package/lib/esm/topology/Triangulation.js.map +1 -1
  434. package/package.json +5 -5
@@ -394,6 +394,25 @@ class PolygonOps {
394
394
  s *= 0.5;
395
395
  return s;
396
396
  }
397
+ /** These values are the integrated area moment products [xx,xy,xz, x]
398
+ * for a right triangle in the first quadrant at the origin -- (0,0),(1,0),(0,1)
399
+ */
400
+ static { this._triangleMomentWeights = Matrix4d_1.Matrix4d.createRowValues(2.0 / 24.0, 1.0 / 24.0, 0, 4.0 / 24.0, 1.0 / 24.0, 2.0 / 24.0, 0, 4.0 / 24.0, 0, 0, 0, 0, 4.0 / 24.0, 4.0 / 24.0, 0, 12.0 / 24.0); }
401
+ /** These values are the integrated volume moment products [xx,xy,xz, x, yx,yy,yz,y, zx,zy,zz,z,x,y,z,1]
402
+ * for a tetrahedron in the first quadrant at the origin -- (0,00),(1,0,0),(0,1,0),(0,0,1)
403
+ */
404
+ static { this._tetrahedralMomentWeights = Matrix4d_1.Matrix4d.createRowValues(1.0 / 60.0, 1.0 / 120, 1.0 / 120, 1.0 / 24.0, 1.0 / 120, 1.0 / 60.0, 1.0 / 120, 1.0 / 24.0, 1.0 / 120, 1.0 / 120, 1.0 / 60.0, 1.0 / 24.0, 1.0 / 24.0, 1.0 / 24.0, 1.0 / 24.0, 1.0 / 6.0); }
405
+ // statics for shared reuse.
406
+ // many methods use these.
407
+ // only use them in "leaf" methods that are certain not to call other users . . .
408
+ static { this._vector0 = Point3dVector3d_1.Vector3d.create(); }
409
+ static { this._vector1 = Point3dVector3d_1.Vector3d.create(); }
410
+ static { this._vector2 = Point3dVector3d_1.Vector3d.create(); }
411
+ static { this._vectorOrigin = Point3dVector3d_1.Vector3d.create(); }
412
+ static { this._normal = Point3dVector3d_1.Vector3d.create(); }
413
+ static { this._matrixA = Matrix4d_1.Matrix4d.createIdentity(); }
414
+ static { this._matrixB = Matrix4d_1.Matrix4d.createIdentity(); }
415
+ static { this._matrixC = Matrix4d_1.Matrix4d.createIdentity(); }
397
416
  /** return a vector which is perpendicular to the polygon and has magnitude equal to the polygon area. */
398
417
  static areaNormalGo(points, result) {
399
418
  if (!result)
@@ -460,8 +479,8 @@ class PolygonOps {
460
479
  }
461
480
  /**
462
481
  * Return a Ray3d with (assuming the polygon is planar and not self-intersecting):
463
- * * `origin` at the centroid of the (3D) polygon
464
- * * `direction` is the unit vector perpendicular to the plane
482
+ * * `origin` at the centroid of the (3D) polygon,
483
+ * * `direction` is the unit vector perpendicular to the plane,
465
484
  * * `a` is the area.
466
485
  * @param points
467
486
  */
@@ -846,7 +865,10 @@ class PolygonOps {
846
865
  * * Compare to [[closestPoint]].
847
866
  * @param polygon points of the polygon, closure point optional
848
867
  * @param testPoint point p to project onto the polygon edges. Works best when p is in the plane of the polygon.
849
- * @param tolerance optional distance tolerance to determine point-vertex and point-edge coincidence.
868
+ * @param tolerance optional tolerance(s) to determine point-vertex and point-edge coincidence. A single number
869
+ * is interpreted as distance tolerance. If an array is given, the first number is interpreted as distance tolerance;
870
+ * the second, as parametric tolerance. Default values are [[Geometry.smallMetricDistance]] for distance tolerance
871
+ * and 0.0 for parameter tolerance.
850
872
  * @param result optional pre-allocated object to fill and return
851
873
  * @returns details d of the closest point `d.point`:
852
874
  * * `d.isValid()` returns true if and only if the polygon is nontrivial.
@@ -858,7 +880,9 @@ class PolygonOps {
858
880
  static closestPointOnBoundary(polygon, testPoint, tolerance = Geometry_1.Geometry.smallMetricDistance, result) {
859
881
  if (!(polygon instanceof IndexedXYZCollection_1.IndexedXYZCollection))
860
882
  return this.closestPointOnBoundary(new Point3dArrayCarrier_1.Point3dArrayCarrier(polygon), testPoint, tolerance, result);
861
- const distTol2 = tolerance * tolerance;
883
+ const distTol = Array.isArray(tolerance) ? tolerance[0] : tolerance;
884
+ const paramTol = Array.isArray(tolerance) ? Math.abs(tolerance[1]) : 0.0;
885
+ const distTol2 = distTol * distTol;
862
886
  let numPoints = polygon.length;
863
887
  while (numPoints > 1) {
864
888
  if (polygon.distanceSquaredIndexIndex(0, numPoints - 1) > distTol2)
@@ -868,29 +892,59 @@ class PolygonOps {
868
892
  result = PolygonLocationDetail.create(result);
869
893
  if (0 === numPoints)
870
894
  return result; // invalid
871
- if (1 === numPoints) {
872
- polygon.getPoint3dAtUncheckedPointIndex(0, result.point);
895
+ const constructSingletonPoint = (index) => {
896
+ polygon.getPoint3dAtUncheckedPointIndex(index, result.point);
873
897
  result.a = result.point.distance(testPoint);
874
898
  result.v.setZero();
875
899
  result.code = Geometry_1.PolygonLocation.OnPolygonVertex;
876
- result.closestEdgeIndex = 0;
900
+ result.closestEdgeIndex = index;
877
901
  result.closestEdgeParam = 0.0;
878
902
  return result;
879
- }
903
+ };
904
+ if (1 === numPoints)
905
+ return constructSingletonPoint(0);
906
+ // lambda for computing edge parameter at which testPoint projects onto the edge starting at iEdgeStart
907
+ const projectToEdge = (iEdgeStart) => {
908
+ let isValid = false;
909
+ let edgeParam = 0.0;
910
+ let uDotU = 0.0;
911
+ let vDotV = 0.0;
912
+ if (iEdgeStart >= 0 && iEdgeStart < numPoints) {
913
+ let iEdgeEnd = iEdgeStart + 1;
914
+ if (iEdgeEnd === numPoints)
915
+ iEdgeEnd = 0;
916
+ uDotU = polygon.distanceSquaredIndexIndex(iEdgeStart, iEdgeEnd);
917
+ if (uDotU > distTol2) { // nontrivial edge
918
+ vDotV = polygon.distanceSquaredIndexXYAndZ(iEdgeStart, testPoint);
919
+ const uDotV = polygon.dotProductIndexIndexXYAndZ(iEdgeStart, iEdgeEnd, testPoint);
920
+ edgeParam = uDotV / uDotU; // param of projection of testPoint onto edge [iEdgeStart, iEdgeEnd]
921
+ isValid = true;
922
+ }
923
+ }
924
+ return { isValid, edgeParam, uDotU, vDotV };
925
+ };
926
+ // find the previous nontrivial edge's projection status before processing the first edge
927
+ let projBeyondPrevEdge = false;
880
928
  let iPrev = numPoints - 1;
929
+ for (; iPrev > 0; --iPrev) {
930
+ const projData = projectToEdge(iPrev);
931
+ if (projData.isValid) {
932
+ projBeyondPrevEdge = projData.edgeParam > 1.0 + paramTol;
933
+ break;
934
+ }
935
+ }
936
+ if (iPrev <= 0) // all segments trivial, so treat like single point case
937
+ return constructSingletonPoint(0);
881
938
  let minDist2 = Geometry_1.Geometry.largeCoordinateResult;
882
939
  for (let iBase = 0; iBase < numPoints; ++iBase) {
883
940
  let iNext = iBase + 1;
884
941
  if (iNext === numPoints)
885
942
  iNext = 0;
886
- const uDotU = polygon.distanceSquaredIndexIndex(iBase, iNext);
887
- if (uDotU <= distTol2)
888
- continue; // ignore trivial polygon edge (keep iPrev)
889
- const vDotV = polygon.distanceSquaredIndexXYAndZ(iBase, testPoint);
890
- const uDotV = polygon.dotProductIndexIndexXYAndZ(iBase, iNext, testPoint);
891
- const edgeParam = uDotV / uDotU; // param of projection of testPoint onto this edge
892
- if (edgeParam <= 0.0) { // testPoint projects to/before edge start
893
- const distToStart2 = vDotV;
943
+ const projData = projectToEdge(iBase);
944
+ if (!projData.isValid)
945
+ continue; // ignore trivial polygon edge (keep iPrev, projBeyondPrevEdge)
946
+ if (projData.edgeParam <= paramTol) { // testPoint projects to/before edge start
947
+ const distToStart2 = projData.vDotV;
894
948
  if (distToStart2 <= distTol2) {
895
949
  // testPoint is at edge start; we are done
896
950
  polygon.getPoint3dAtUncheckedPointIndex(iBase, result.point);
@@ -901,25 +955,25 @@ class PolygonOps {
901
955
  result.closestEdgeParam = 0.0;
902
956
  return result;
903
957
  }
904
- if (distToStart2 < minDist2) {
905
- if (polygon.dotProductIndexIndexXYAndZ(iBase, iPrev, testPoint) <= 0.0) {
906
- // update candidate (to edge start) only if testPoint projected beyond previous edge end
907
- polygon.getPoint3dAtUncheckedPointIndex(iBase, result.point);
908
- result.a = Math.sqrt(distToStart2);
909
- polygon.crossProductIndexIndexIndex(iBase, iPrev, iNext, result.v);
910
- result.code = Geometry_1.PolygonLocation.OnPolygonVertex;
911
- result.closestEdgeIndex = iBase;
912
- result.closestEdgeParam = 0.0;
913
- minDist2 = distToStart2;
914
- }
958
+ if (distToStart2 < minDist2 && projBeyondPrevEdge) {
959
+ // update candidate (to edge start) only if testPoint projected beyond previous edge end
960
+ polygon.getPoint3dAtUncheckedPointIndex(iBase, result.point);
961
+ result.a = Math.sqrt(distToStart2);
962
+ polygon.crossProductIndexIndexIndex(iBase, iPrev, iNext, result.v);
963
+ result.code = Geometry_1.PolygonLocation.OnPolygonVertex;
964
+ result.closestEdgeIndex = iBase;
965
+ result.closestEdgeParam = 0.0;
966
+ minDist2 = distToStart2;
915
967
  }
968
+ projBeyondPrevEdge = false;
916
969
  }
917
- else if (edgeParam <= 1.0) { // testPoint projects inside edge, or to edge end
918
- const projDist2 = vDotV - edgeParam * edgeParam * uDotU;
970
+ else if (projData.edgeParam <= 1.0 + paramTol) { // testPoint projects inside edge, or to edge end
971
+ projData.edgeParam = Geometry_1.Geometry.clamp(projData.edgeParam, 0.0, 1.0);
972
+ const projDist2 = projData.vDotV - projData.edgeParam * projData.edgeParam * projData.uDotU;
919
973
  if (projDist2 <= distTol2) {
920
974
  // testPoint is on edge; we are done
921
- const distToStart2 = vDotV;
922
- if (edgeParam <= 0.5 && distToStart2 <= distTol2) {
975
+ const distToStart2 = projData.vDotV;
976
+ if (projData.edgeParam <= 0.5 && distToStart2 <= distTol2) {
923
977
  // testPoint is at edge start
924
978
  polygon.getPoint3dAtUncheckedPointIndex(iBase, result.point);
925
979
  result.a = Math.sqrt(distToStart2);
@@ -929,8 +983,8 @@ class PolygonOps {
929
983
  result.closestEdgeParam = 0.0;
930
984
  return result;
931
985
  }
932
- const distToEnd2 = projDist2 + (1.0 - edgeParam) * (1.0 - edgeParam) * uDotU;
933
- if (edgeParam > 0.5 && distToEnd2 <= distTol2) {
986
+ const distToEnd2 = projDist2 + (1.0 - projData.edgeParam) * (1.0 - projData.edgeParam) * projData.uDotU;
987
+ if (projData.edgeParam > 0.5 && distToEnd2 <= distTol2) {
934
988
  // testPoint is at edge end
935
989
  polygon.getPoint3dAtUncheckedPointIndex(iNext, result.point);
936
990
  result.a = Math.sqrt(distToEnd2);
@@ -941,27 +995,29 @@ class PolygonOps {
941
995
  return result;
942
996
  }
943
997
  // testPoint is on edge interior
944
- polygon.interpolateIndexIndex(iBase, edgeParam, iNext, result.point);
998
+ polygon.interpolateIndexIndex(iBase, projData.edgeParam, iNext, result.point);
945
999
  result.a = Math.sqrt(projDist2);
946
1000
  result.v.setZero();
947
1001
  result.code = Geometry_1.PolygonLocation.OnPolygonEdgeInterior;
948
1002
  result.closestEdgeIndex = iBase;
949
- result.closestEdgeParam = edgeParam;
1003
+ result.closestEdgeParam = projData.edgeParam;
950
1004
  return result;
951
1005
  }
952
1006
  if (projDist2 < minDist2) {
953
- // update candidate (to edge interior)
954
- polygon.interpolateIndexIndex(iBase, edgeParam, iNext, result.point);
1007
+ // update candidate
1008
+ polygon.interpolateIndexIndex(iBase, projData.edgeParam, iNext, result.point);
955
1009
  result.a = Math.sqrt(projDist2);
956
1010
  polygon.crossProductIndexIndexXYAndZ(iBase, iNext, testPoint, result.v);
957
- result.code = Geometry_1.PolygonLocation.OnPolygonEdgeInterior;
1011
+ result.code = projData.edgeParam < 1.0 ? Geometry_1.PolygonLocation.OnPolygonEdgeInterior : Geometry_1.PolygonLocation.OnPolygonVertex;
1012
+ ;
958
1013
  result.closestEdgeIndex = iBase;
959
- result.closestEdgeParam = edgeParam;
1014
+ result.closestEdgeParam = projData.edgeParam;
960
1015
  minDist2 = projDist2;
961
1016
  }
1017
+ projBeyondPrevEdge = false;
962
1018
  }
963
- else { // edgeParam > 1.0
964
- // NOOP: testPoint projects beyond edge end, handled by next edge
1019
+ else {
1020
+ projBeyondPrevEdge = true; // to be handled by next edge
965
1021
  }
966
1022
  iPrev = iBase;
967
1023
  }
@@ -1005,7 +1061,10 @@ class PolygonOps {
1005
1061
  /** Compute the intersection of a line (parameterized as a ray) with the plane of this polygon.
1006
1062
  * @param polygon points of the polygon, closure point optional
1007
1063
  * @param ray infinite line to intersect, as a ray
1008
- * @param tolerance optional distance tolerance to determine point-vertex and point-edge coincidence.
1064
+ * @param tolerance optional tolerance(s) to determine point-vertex and point-edge coincidence. A single number
1065
+ * is interpreted as distance tolerance. If an array is given, the first number is interpreted as distance tolerance;
1066
+ * the second, as parametric tolerance. Default values are [[Geometry.smallMetricDistance]] for distance tolerance
1067
+ * and 0.0 for parameter tolerance.
1009
1068
  * @param result optional pre-allocated object to fill and return
1010
1069
  * @returns details d of the line-plane intersection `d.point`:
1011
1070
  * * `d.isValid()` returns true if and only if the line intersects the plane.
@@ -1032,11 +1091,18 @@ class PolygonOps {
1032
1091
  // NOOP: intersectionPoint is on the polygon, so result.code already classifies it
1033
1092
  }
1034
1093
  else {
1035
- // intersectionPoint is not on polygon, so result.code refers to the closest point. Update it to refer to intersectionPoint.
1036
- if (Geometry_1.PolygonLocation.OnPolygonVertex === result.code)
1037
- result.code = (dot > 0.0) ? Geometry_1.PolygonLocation.InsidePolygonProjectsToVertex : Geometry_1.PolygonLocation.OutsidePolygonProjectsToVertex;
1038
- else if (Geometry_1.PolygonLocation.OnPolygonEdgeInterior === result.code)
1039
- result.code = (dot > 0.0) ? Geometry_1.PolygonLocation.InsidePolygonProjectsToEdgeInterior : Geometry_1.PolygonLocation.OutsidePolygonProjectsToEdgeInterior;
1094
+ // intersectionPoint is not on the polygon, so result.code refers to the closest point;
1095
+ // update it to refer to intersectionPoint.
1096
+ if (Geometry_1.PolygonLocation.OnPolygonVertex === result.code) {
1097
+ result.code = (dot > 0.0)
1098
+ ? Geometry_1.PolygonLocation.InsidePolygonProjectsToVertex
1099
+ : Geometry_1.PolygonLocation.OutsidePolygonProjectsToVertex;
1100
+ }
1101
+ else if (Geometry_1.PolygonLocation.OnPolygonEdgeInterior === result.code) {
1102
+ result.code = (dot > 0.0)
1103
+ ? Geometry_1.PolygonLocation.InsidePolygonProjectsToEdgeInterior
1104
+ : Geometry_1.PolygonLocation.OutsidePolygonProjectsToEdgeInterior;
1105
+ }
1040
1106
  }
1041
1107
  }
1042
1108
  return result;
@@ -1257,30 +1323,14 @@ class PolygonOps {
1257
1323
  }
1258
1324
  }
1259
1325
  exports.PolygonOps = PolygonOps;
1260
- /** These values are the integrated area moment products [xx,xy,xz, x]
1261
- * for a right triangle in the first quadrant at the origin -- (0,0),(1,0),(0,1)
1262
- */
1263
- PolygonOps._triangleMomentWeights = Matrix4d_1.Matrix4d.createRowValues(2.0 / 24.0, 1.0 / 24.0, 0, 4.0 / 24.0, 1.0 / 24.0, 2.0 / 24.0, 0, 4.0 / 24.0, 0, 0, 0, 0, 4.0 / 24.0, 4.0 / 24.0, 0, 12.0 / 24.0);
1264
- /** These values are the integrated volume moment products [xx,xy,xz, x, yx,yy,yz,y, zx,zy,zz,z,x,y,z,1]
1265
- * for a tetrahedron in the first quadrant at the origin -- (0,00),(1,0,0),(0,1,0),(0,0,1)
1266
- */
1267
- PolygonOps._tetrahedralMomentWeights = Matrix4d_1.Matrix4d.createRowValues(1.0 / 60.0, 1.0 / 120, 1.0 / 120, 1.0 / 24.0, 1.0 / 120, 1.0 / 60.0, 1.0 / 120, 1.0 / 24.0, 1.0 / 120, 1.0 / 120, 1.0 / 60.0, 1.0 / 24.0, 1.0 / 24.0, 1.0 / 24.0, 1.0 / 24.0, 1.0 / 6.0);
1268
- // statics for shared reuse.
1269
- // many methods use these.
1270
- // only use them in "leaf" methods that are certain not to call other users . . .
1271
- PolygonOps._vector0 = Point3dVector3d_1.Vector3d.create();
1272
- PolygonOps._vector1 = Point3dVector3d_1.Vector3d.create();
1273
- PolygonOps._vector2 = Point3dVector3d_1.Vector3d.create();
1274
- PolygonOps._vectorOrigin = Point3dVector3d_1.Vector3d.create();
1275
- PolygonOps._normal = Point3dVector3d_1.Vector3d.create();
1276
- PolygonOps._matrixA = Matrix4d_1.Matrix4d.createIdentity();
1277
- PolygonOps._matrixB = Matrix4d_1.Matrix4d.createIdentity();
1278
- PolygonOps._matrixC = Matrix4d_1.Matrix4d.createIdentity();
1279
1326
  /**
1280
1327
  * `IndexedXYZCollectionPolygonOps` class contains _static_ methods for typical operations on polygons carried as `IndexedXYZCollection`
1281
1328
  * @public
1282
1329
  */
1283
1330
  class IndexedXYZCollectionPolygonOps {
1331
+ static { this._xyz0Work = Point3dVector3d_1.Point3d.create(); }
1332
+ static { this._xyz1Work = Point3dVector3d_1.Point3d.create(); }
1333
+ static { this._xyz2Work = Point3dVector3d_1.Point3d.create(); }
1284
1334
  /**
1285
1335
  * Split a (convex) polygon into 2 parts based on altitude evaluations.
1286
1336
  * * POSITIVE ALTITUDE IS IN
@@ -1538,14 +1588,12 @@ class IndexedXYZCollectionPolygonOps {
1538
1588
  }
1539
1589
  }
1540
1590
  exports.IndexedXYZCollectionPolygonOps = IndexedXYZCollectionPolygonOps;
1541
- IndexedXYZCollectionPolygonOps._xyz0Work = Point3dVector3d_1.Point3d.create();
1542
- IndexedXYZCollectionPolygonOps._xyz1Work = Point3dVector3d_1.Point3d.create();
1543
- IndexedXYZCollectionPolygonOps._xyz2Work = Point3dVector3d_1.Point3d.create();
1544
1591
  /**
1545
1592
  * `Point3dArrayPolygonOps` class contains _static_ methods for typical operations on polygons carried as `Point3d[]`
1546
1593
  * @public
1547
1594
  */
1548
1595
  class Point3dArrayPolygonOps {
1596
+ static { this._xyz0Work = Point3dVector3d_1.Point3d.create(); }
1549
1597
  // private static _xyz1Work: Point3d = Point3d.create();
1550
1598
  // private static _xyz2Work: Point3d = Point3d.create();
1551
1599
  /**
@@ -1620,5 +1668,4 @@ class Point3dArrayPolygonOps {
1620
1668
  }
1621
1669
  }
1622
1670
  exports.Point3dArrayPolygonOps = Point3dArrayPolygonOps;
1623
- Point3dArrayPolygonOps._xyz0Work = Point3dVector3d_1.Point3d.create();
1624
1671
  //# sourceMappingURL=PolygonOps.js.map