@itwin/core-geometry 4.1.0-dev.8 → 4.1.0-dev.80

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 (896) hide show
  1. package/CHANGELOG.md +87 -1
  2. package/lib/cjs/Constant.js.map +1 -1
  3. package/lib/cjs/Geometry.js.map +1 -1
  4. package/lib/cjs/bspline/AkimaCurve3d.js.map +1 -1
  5. package/lib/cjs/bspline/BSpline1dNd.js.map +1 -1
  6. package/lib/cjs/bspline/BSplineCurve.d.ts +1 -1
  7. package/lib/cjs/bspline/BSplineCurve.d.ts.map +1 -1
  8. package/lib/cjs/bspline/BSplineCurve.js +2 -2
  9. package/lib/cjs/bspline/BSplineCurve.js.map +1 -1
  10. package/lib/cjs/bspline/BSplineCurve3dH.js.map +1 -1
  11. package/lib/cjs/bspline/BSplineCurveOps.js.map +1 -1
  12. package/lib/cjs/bspline/BSplineSurface.d.ts.map +1 -1
  13. package/lib/cjs/bspline/BSplineSurface.js +1 -1
  14. package/lib/cjs/bspline/BSplineSurface.js.map +1 -1
  15. package/lib/cjs/bspline/Bezier1dNd.js.map +1 -1
  16. package/lib/cjs/bspline/BezierCurve3d.js.map +1 -1
  17. package/lib/cjs/bspline/BezierCurve3dH.js.map +1 -1
  18. package/lib/cjs/bspline/BezierCurveBase.d.ts +1 -1
  19. package/lib/cjs/bspline/BezierCurveBase.d.ts.map +1 -1
  20. package/lib/cjs/bspline/BezierCurveBase.js +2 -2
  21. package/lib/cjs/bspline/BezierCurveBase.js.map +1 -1
  22. package/lib/cjs/bspline/InterpolationCurve3d.js.map +1 -1
  23. package/lib/cjs/bspline/KnotVector.js.map +1 -1
  24. package/lib/cjs/bspline/SurfaceLocationDetail.js.map +1 -1
  25. package/lib/cjs/clipping/AlternatingConvexClipTree.d.ts +15 -17
  26. package/lib/cjs/clipping/AlternatingConvexClipTree.d.ts.map +1 -1
  27. package/lib/cjs/clipping/AlternatingConvexClipTree.js +24 -20
  28. package/lib/cjs/clipping/AlternatingConvexClipTree.js.map +1 -1
  29. package/lib/cjs/clipping/BooleanClipFactory.d.ts +28 -28
  30. package/lib/cjs/clipping/BooleanClipFactory.d.ts.map +1 -1
  31. package/lib/cjs/clipping/BooleanClipFactory.js +28 -28
  32. package/lib/cjs/clipping/BooleanClipFactory.js.map +1 -1
  33. package/lib/cjs/clipping/BooleanClipNode.d.ts +11 -11
  34. package/lib/cjs/clipping/BooleanClipNode.d.ts.map +1 -1
  35. package/lib/cjs/clipping/BooleanClipNode.js +11 -11
  36. package/lib/cjs/clipping/BooleanClipNode.js.map +1 -1
  37. package/lib/cjs/clipping/ClipPlane.d.ts +73 -76
  38. package/lib/cjs/clipping/ClipPlane.d.ts.map +1 -1
  39. package/lib/cjs/clipping/ClipPlane.js +105 -86
  40. package/lib/cjs/clipping/ClipPlane.js.map +1 -1
  41. package/lib/cjs/clipping/ClipPrimitive.d.ts +78 -47
  42. package/lib/cjs/clipping/ClipPrimitive.d.ts.map +1 -1
  43. package/lib/cjs/clipping/ClipPrimitive.js +112 -54
  44. package/lib/cjs/clipping/ClipPrimitive.js.map +1 -1
  45. package/lib/cjs/clipping/ClipUtils.d.ts +54 -44
  46. package/lib/cjs/clipping/ClipUtils.d.ts.map +1 -1
  47. package/lib/cjs/clipping/ClipUtils.js +33 -29
  48. package/lib/cjs/clipping/ClipUtils.js.map +1 -1
  49. package/lib/cjs/clipping/ClipVector.d.ts +39 -25
  50. package/lib/cjs/clipping/ClipVector.d.ts.map +1 -1
  51. package/lib/cjs/clipping/ClipVector.js +35 -23
  52. package/lib/cjs/clipping/ClipVector.js.map +1 -1
  53. package/lib/cjs/clipping/ConvexClipPlaneSet.d.ts +61 -38
  54. package/lib/cjs/clipping/ConvexClipPlaneSet.d.ts.map +1 -1
  55. package/lib/cjs/clipping/ConvexClipPlaneSet.js +64 -41
  56. package/lib/cjs/clipping/ConvexClipPlaneSet.js.map +1 -1
  57. package/lib/cjs/clipping/UnionOfConvexClipPlaneSets.d.ts +49 -30
  58. package/lib/cjs/clipping/UnionOfConvexClipPlaneSets.d.ts.map +1 -1
  59. package/lib/cjs/clipping/UnionOfConvexClipPlaneSets.js +50 -30
  60. package/lib/cjs/clipping/UnionOfConvexClipPlaneSets.js.map +1 -1
  61. package/lib/cjs/clipping/internalContexts/LineStringOffsetClipperContext.d.ts +2 -2
  62. package/lib/cjs/clipping/internalContexts/LineStringOffsetClipperContext.d.ts.map +1 -1
  63. package/lib/cjs/clipping/internalContexts/LineStringOffsetClipperContext.js +2 -2
  64. package/lib/cjs/clipping/internalContexts/LineStringOffsetClipperContext.js.map +1 -1
  65. package/lib/cjs/core-geometry.d.ts +5 -1
  66. package/lib/cjs/core-geometry.d.ts.map +1 -1
  67. package/lib/cjs/core-geometry.js +5 -1
  68. package/lib/cjs/core-geometry.js.map +1 -1
  69. package/lib/cjs/curve/Arc3d.d.ts +4 -3
  70. package/lib/cjs/curve/Arc3d.d.ts.map +1 -1
  71. package/lib/cjs/curve/Arc3d.js +7 -5
  72. package/lib/cjs/curve/Arc3d.js.map +1 -1
  73. package/lib/cjs/curve/ConstructCurveBetweenCurves.js.map +1 -1
  74. package/lib/cjs/curve/CoordinateXYZ.js.map +1 -1
  75. package/lib/cjs/curve/CurveChain.js.map +1 -1
  76. package/lib/cjs/curve/CurveChainWithDistanceIndex.d.ts +62 -42
  77. package/lib/cjs/curve/CurveChainWithDistanceIndex.d.ts.map +1 -1
  78. package/lib/cjs/curve/CurveChainWithDistanceIndex.js +71 -48
  79. package/lib/cjs/curve/CurveChainWithDistanceIndex.js.map +1 -1
  80. package/lib/cjs/curve/CurveCollection.d.ts +36 -26
  81. package/lib/cjs/curve/CurveCollection.d.ts.map +1 -1
  82. package/lib/cjs/curve/CurveCollection.js +46 -39
  83. package/lib/cjs/curve/CurveCollection.js.map +1 -1
  84. package/lib/cjs/curve/CurveCurve.d.ts +6 -2
  85. package/lib/cjs/curve/CurveCurve.d.ts.map +1 -1
  86. package/lib/cjs/curve/CurveCurve.js +13 -9
  87. package/lib/cjs/curve/CurveCurve.js.map +1 -1
  88. package/lib/cjs/curve/CurveCurveCloseApproachXY.d.ts +74 -68
  89. package/lib/cjs/curve/CurveCurveCloseApproachXY.d.ts.map +1 -1
  90. package/lib/cjs/curve/CurveCurveCloseApproachXY.js +100 -108
  91. package/lib/cjs/curve/CurveCurveCloseApproachXY.js.map +1 -1
  92. package/lib/cjs/curve/CurveCurveIntersectXY.d.ts +46 -48
  93. package/lib/cjs/curve/CurveCurveIntersectXY.d.ts.map +1 -1
  94. package/lib/cjs/curve/CurveCurveIntersectXY.js +72 -61
  95. package/lib/cjs/curve/CurveCurveIntersectXY.js.map +1 -1
  96. package/lib/cjs/curve/CurveCurveIntersectXYZ.d.ts +32 -38
  97. package/lib/cjs/curve/CurveCurveIntersectXYZ.d.ts.map +1 -1
  98. package/lib/cjs/curve/CurveCurveIntersectXYZ.js +86 -97
  99. package/lib/cjs/curve/CurveCurveIntersectXYZ.js.map +1 -1
  100. package/lib/cjs/curve/CurveExtendMode.js.map +1 -1
  101. package/lib/cjs/curve/CurveFactory.d.ts +67 -3
  102. package/lib/cjs/curve/CurveFactory.d.ts.map +1 -1
  103. package/lib/cjs/curve/CurveFactory.js +75 -7
  104. package/lib/cjs/curve/CurveFactory.js.map +1 -1
  105. package/lib/cjs/curve/CurveLocationDetail.d.ts +6 -6
  106. package/lib/cjs/curve/CurveLocationDetail.d.ts.map +1 -1
  107. package/lib/cjs/curve/CurveLocationDetail.js +9 -7
  108. package/lib/cjs/curve/CurveLocationDetail.js.map +1 -1
  109. package/lib/cjs/curve/CurveOps.d.ts +77 -0
  110. package/lib/cjs/curve/CurveOps.d.ts.map +1 -0
  111. package/lib/cjs/curve/CurveOps.js +160 -0
  112. package/lib/cjs/curve/CurveOps.js.map +1 -0
  113. package/lib/cjs/curve/CurvePrimitive.d.ts +26 -18
  114. package/lib/cjs/curve/CurvePrimitive.d.ts.map +1 -1
  115. package/lib/cjs/curve/CurvePrimitive.js +4 -3
  116. package/lib/cjs/curve/CurvePrimitive.js.map +1 -1
  117. package/lib/cjs/curve/CurveProcessor.js.map +1 -1
  118. package/lib/cjs/curve/CurveWireMomentsXYZ.js.map +1 -1
  119. package/lib/cjs/curve/GeometryQuery.d.ts +2 -2
  120. package/lib/cjs/curve/GeometryQuery.d.ts.map +1 -1
  121. package/lib/cjs/curve/GeometryQuery.js +2 -2
  122. package/lib/cjs/curve/GeometryQuery.js.map +1 -1
  123. package/lib/cjs/curve/LineSegment3d.d.ts +7 -5
  124. package/lib/cjs/curve/LineSegment3d.d.ts.map +1 -1
  125. package/lib/cjs/curve/LineSegment3d.js +6 -6
  126. package/lib/cjs/curve/LineSegment3d.js.map +1 -1
  127. package/lib/cjs/curve/LineString3d.d.ts +2 -2
  128. package/lib/cjs/curve/LineString3d.d.ts.map +1 -1
  129. package/lib/cjs/curve/LineString3d.js +3 -3
  130. package/lib/cjs/curve/LineString3d.js.map +1 -1
  131. package/lib/cjs/curve/Loop.d.ts +7 -5
  132. package/lib/cjs/curve/Loop.d.ts.map +1 -1
  133. package/lib/cjs/curve/Loop.js +18 -6
  134. package/lib/cjs/curve/Loop.js.map +1 -1
  135. package/lib/cjs/curve/OffsetOptions.d.ts +97 -0
  136. package/lib/cjs/curve/OffsetOptions.d.ts.map +1 -0
  137. package/lib/cjs/curve/OffsetOptions.js +166 -0
  138. package/lib/cjs/curve/OffsetOptions.js.map +1 -0
  139. package/lib/cjs/curve/ParityRegion.d.ts +7 -7
  140. package/lib/cjs/curve/ParityRegion.d.ts.map +1 -1
  141. package/lib/cjs/curve/ParityRegion.js +19 -11
  142. package/lib/cjs/curve/ParityRegion.js.map +1 -1
  143. package/lib/cjs/curve/Path.d.ts +6 -6
  144. package/lib/cjs/curve/Path.d.ts.map +1 -1
  145. package/lib/cjs/curve/Path.js +15 -9
  146. package/lib/cjs/curve/Path.js.map +1 -1
  147. package/lib/cjs/curve/PointString3d.js.map +1 -1
  148. package/lib/cjs/curve/ProxyCurve.d.ts +5 -7
  149. package/lib/cjs/curve/ProxyCurve.d.ts.map +1 -1
  150. package/lib/cjs/curve/ProxyCurve.js +7 -7
  151. package/lib/cjs/curve/ProxyCurve.js.map +1 -1
  152. package/lib/cjs/curve/Query/ConsolidateAdjacentPrimitivesContext.js.map +1 -1
  153. package/lib/cjs/curve/Query/CurveSplitContext.js.map +1 -1
  154. package/lib/cjs/curve/Query/CylindricalRange.js.map +1 -1
  155. package/lib/cjs/curve/Query/InOutTests.js.map +1 -1
  156. package/lib/cjs/curve/Query/PlanarSubdivision.js.map +1 -1
  157. package/lib/cjs/curve/Query/StrokeCountChain.js.map +1 -1
  158. package/lib/cjs/curve/Query/StrokeCountMap.js.map +1 -1
  159. package/lib/cjs/curve/RegionMomentsXY.js.map +1 -1
  160. package/lib/cjs/curve/RegionOps.d.ts +76 -56
  161. package/lib/cjs/curve/RegionOps.d.ts.map +1 -1
  162. package/lib/cjs/curve/RegionOps.js +83 -60
  163. package/lib/cjs/curve/RegionOps.js.map +1 -1
  164. package/lib/cjs/curve/RegionOpsClassificationSweeps.js +2 -2
  165. package/lib/cjs/curve/RegionOpsClassificationSweeps.js.map +1 -1
  166. package/lib/cjs/curve/StrokeOptions.d.ts.map +1 -1
  167. package/lib/cjs/curve/StrokeOptions.js +6 -2
  168. package/lib/cjs/curve/StrokeOptions.js.map +1 -1
  169. package/lib/cjs/curve/UnionRegion.d.ts +6 -5
  170. package/lib/cjs/curve/UnionRegion.d.ts.map +1 -1
  171. package/lib/cjs/curve/UnionRegion.js +17 -8
  172. package/lib/cjs/curve/UnionRegion.js.map +1 -1
  173. package/lib/cjs/curve/internalContexts/AppendPlaneIntersectionStrokeHandler.js.map +1 -1
  174. package/lib/cjs/curve/{ChainCollectorContext.d.ts → internalContexts/ChainCollectorContext.d.ts} +4 -4
  175. package/lib/cjs/curve/internalContexts/ChainCollectorContext.d.ts.map +1 -0
  176. package/lib/cjs/curve/{ChainCollectorContext.js → internalContexts/ChainCollectorContext.js} +4 -4
  177. package/lib/cjs/curve/internalContexts/ChainCollectorContext.js.map +1 -0
  178. package/lib/cjs/curve/internalContexts/CloneCurvesContext.js.map +1 -1
  179. package/lib/cjs/curve/internalContexts/CloneWithExpandedLineStrings.js.map +1 -1
  180. package/lib/cjs/curve/internalContexts/ClosestPointStrokeHandler.js.map +1 -1
  181. package/lib/cjs/curve/internalContexts/CountLinearPartsSearchContext.js.map +1 -1
  182. package/lib/cjs/curve/internalContexts/CurveLengthContext.js.map +1 -1
  183. package/lib/cjs/curve/internalContexts/CurveOffsetXYHandler.js.map +1 -1
  184. package/lib/cjs/curve/internalContexts/GapSearchContext.d.ts +2 -1
  185. package/lib/cjs/curve/internalContexts/GapSearchContext.d.ts.map +1 -1
  186. package/lib/cjs/curve/internalContexts/GapSearchContext.js +6 -2
  187. package/lib/cjs/curve/internalContexts/GapSearchContext.js.map +1 -1
  188. package/lib/cjs/curve/internalContexts/MultiChainCollector.d.ts +59 -70
  189. package/lib/cjs/curve/internalContexts/MultiChainCollector.d.ts.map +1 -1
  190. package/lib/cjs/curve/internalContexts/MultiChainCollector.js +130 -220
  191. package/lib/cjs/curve/internalContexts/MultiChainCollector.js.map +1 -1
  192. package/lib/cjs/curve/internalContexts/NewtonRtoRStrokeHandler.js.map +1 -1
  193. package/lib/cjs/curve/internalContexts/PlaneAltitudeRangeContext.d.ts +14 -8
  194. package/lib/cjs/curve/internalContexts/PlaneAltitudeRangeContext.d.ts.map +1 -1
  195. package/lib/cjs/curve/internalContexts/PlaneAltitudeRangeContext.js +14 -8
  196. package/lib/cjs/curve/internalContexts/PlaneAltitudeRangeContext.js.map +1 -1
  197. package/lib/cjs/curve/internalContexts/PolygonOffsetContext.d.ts +23 -95
  198. package/lib/cjs/curve/internalContexts/PolygonOffsetContext.d.ts.map +1 -1
  199. package/lib/cjs/curve/internalContexts/PolygonOffsetContext.js +89 -178
  200. package/lib/cjs/curve/internalContexts/PolygonOffsetContext.js.map +1 -1
  201. package/lib/cjs/curve/internalContexts/SumLengthsContext.d.ts.map +1 -1
  202. package/lib/cjs/curve/internalContexts/SumLengthsContext.js +4 -1
  203. package/lib/cjs/curve/internalContexts/SumLengthsContext.js.map +1 -1
  204. package/lib/cjs/curve/internalContexts/TransformInPlaceContext.js.map +1 -1
  205. package/lib/cjs/curve/spiral/AustralianRailCorpXYEvaluator.js.map +1 -1
  206. package/lib/cjs/curve/spiral/ClothoidSeries.js.map +1 -1
  207. package/lib/cjs/curve/spiral/CubicEvaluator.js.map +1 -1
  208. package/lib/cjs/curve/spiral/CzechSpiralEvaluator.js.map +1 -1
  209. package/lib/cjs/curve/spiral/DirectHalfCosineSpiralEvaluator.js.map +1 -1
  210. package/lib/cjs/curve/spiral/DirectSpiral3d.js.map +1 -1
  211. package/lib/cjs/curve/spiral/IntegratedSpiral3d.js +1 -1
  212. package/lib/cjs/curve/spiral/IntegratedSpiral3d.js.map +1 -1
  213. package/lib/cjs/curve/spiral/MXCubicAlongArcSpiralEvaluator.js.map +1 -1
  214. package/lib/cjs/curve/spiral/NormalizedTransition.js.map +1 -1
  215. package/lib/cjs/curve/spiral/PolishCubicSpiralEvaluator.js.map +1 -1
  216. package/lib/cjs/curve/spiral/TransitionConditionalProperties.js.map +1 -1
  217. package/lib/cjs/curve/spiral/TransitionSpiral3d.d.ts +1 -1
  218. package/lib/cjs/curve/spiral/TransitionSpiral3d.d.ts.map +1 -1
  219. package/lib/cjs/curve/spiral/TransitionSpiral3d.js +2 -2
  220. package/lib/cjs/curve/spiral/TransitionSpiral3d.js.map +1 -1
  221. package/lib/cjs/curve/spiral/XYCurveEvaluator.js +1 -1
  222. package/lib/cjs/curve/spiral/XYCurveEvaluator.js.map +1 -1
  223. package/lib/cjs/geometry3d/Angle.d.ts +9 -0
  224. package/lib/cjs/geometry3d/Angle.d.ts.map +1 -1
  225. package/lib/cjs/geometry3d/Angle.js +13 -0
  226. package/lib/cjs/geometry3d/Angle.js.map +1 -1
  227. package/lib/cjs/geometry3d/AngleSweep.js.map +1 -1
  228. package/lib/cjs/geometry3d/BarycentricTriangle.js.map +1 -1
  229. package/lib/cjs/geometry3d/BilinearPatch.d.ts +43 -48
  230. package/lib/cjs/geometry3d/BilinearPatch.d.ts.map +1 -1
  231. package/lib/cjs/geometry3d/BilinearPatch.js +51 -55
  232. package/lib/cjs/geometry3d/BilinearPatch.js.map +1 -1
  233. package/lib/cjs/geometry3d/CoincidentGeometryOps.js.map +1 -1
  234. package/lib/cjs/geometry3d/Ellipsoid.d.ts +1 -1
  235. package/lib/cjs/geometry3d/Ellipsoid.js +1 -1
  236. package/lib/cjs/geometry3d/Ellipsoid.js.map +1 -1
  237. package/lib/cjs/geometry3d/FrameBuilder.d.ts.map +1 -1
  238. package/lib/cjs/geometry3d/FrameBuilder.js +13 -11
  239. package/lib/cjs/geometry3d/FrameBuilder.js.map +1 -1
  240. package/lib/cjs/geometry3d/FrustumAnimation.js.map +1 -1
  241. package/lib/cjs/geometry3d/GeometryHandler.d.ts +103 -97
  242. package/lib/cjs/geometry3d/GeometryHandler.d.ts.map +1 -1
  243. package/lib/cjs/geometry3d/GeometryHandler.js +247 -124
  244. package/lib/cjs/geometry3d/GeometryHandler.js.map +1 -1
  245. package/lib/cjs/geometry3d/GrowableBlockedArray.d.ts.map +1 -1
  246. package/lib/cjs/geometry3d/GrowableBlockedArray.js +1 -1
  247. package/lib/cjs/geometry3d/GrowableBlockedArray.js.map +1 -1
  248. package/lib/cjs/geometry3d/GrowableFloat64Array.d.ts.map +1 -1
  249. package/lib/cjs/geometry3d/GrowableFloat64Array.js +1 -1
  250. package/lib/cjs/geometry3d/GrowableFloat64Array.js.map +1 -1
  251. package/lib/cjs/geometry3d/GrowableXYArray.js.map +1 -1
  252. package/lib/cjs/geometry3d/GrowableXYZArray.js.map +1 -1
  253. package/lib/cjs/geometry3d/IndexedCollectionInterval.js.map +1 -1
  254. package/lib/cjs/geometry3d/IndexedXYCollection.js.map +1 -1
  255. package/lib/cjs/geometry3d/IndexedXYZCollection.js.map +1 -1
  256. package/lib/cjs/geometry3d/LongitudeLatitudeAltitude.js.map +1 -1
  257. package/lib/cjs/geometry3d/Matrix3d.d.ts +18 -0
  258. package/lib/cjs/geometry3d/Matrix3d.d.ts.map +1 -1
  259. package/lib/cjs/geometry3d/Matrix3d.js +32 -5
  260. package/lib/cjs/geometry3d/Matrix3d.js.map +1 -1
  261. package/lib/cjs/geometry3d/OrderedRotationAngles.js.map +1 -1
  262. package/lib/cjs/geometry3d/Plane3d.d.ts +41 -32
  263. package/lib/cjs/geometry3d/Plane3d.d.ts.map +1 -1
  264. package/lib/cjs/geometry3d/Plane3d.js +11 -8
  265. package/lib/cjs/geometry3d/Plane3d.js.map +1 -1
  266. package/lib/cjs/geometry3d/Plane3dByOriginAndUnitNormal.d.ts +37 -34
  267. package/lib/cjs/geometry3d/Plane3dByOriginAndUnitNormal.d.ts.map +1 -1
  268. package/lib/cjs/geometry3d/Plane3dByOriginAndUnitNormal.js +65 -43
  269. package/lib/cjs/geometry3d/Plane3dByOriginAndUnitNormal.js.map +1 -1
  270. package/lib/cjs/geometry3d/Plane3dByOriginAndVectors.d.ts +36 -32
  271. package/lib/cjs/geometry3d/Plane3dByOriginAndVectors.d.ts.map +1 -1
  272. package/lib/cjs/geometry3d/Plane3dByOriginAndVectors.js +37 -32
  273. package/lib/cjs/geometry3d/Plane3dByOriginAndVectors.js.map +1 -1
  274. package/lib/cjs/geometry3d/Point2dArrayCarrier.js.map +1 -1
  275. package/lib/cjs/geometry3d/Point2dVector2d.d.ts +8 -9
  276. package/lib/cjs/geometry3d/Point2dVector2d.d.ts.map +1 -1
  277. package/lib/cjs/geometry3d/Point2dVector2d.js +9 -10
  278. package/lib/cjs/geometry3d/Point2dVector2d.js.map +1 -1
  279. package/lib/cjs/geometry3d/Point3dArrayCarrier.js.map +1 -1
  280. package/lib/cjs/geometry3d/Point3dVector3d.d.ts +12 -4
  281. package/lib/cjs/geometry3d/Point3dVector3d.d.ts.map +1 -1
  282. package/lib/cjs/geometry3d/Point3dVector3d.js +18 -5
  283. package/lib/cjs/geometry3d/Point3dVector3d.js.map +1 -1
  284. package/lib/cjs/geometry3d/PointHelpers.d.ts.map +1 -1
  285. package/lib/cjs/geometry3d/PointHelpers.js +5 -5
  286. package/lib/cjs/geometry3d/PointHelpers.js.map +1 -1
  287. package/lib/cjs/geometry3d/PointStreaming.js.map +1 -1
  288. package/lib/cjs/geometry3d/PolygonOps.d.ts +6 -2
  289. package/lib/cjs/geometry3d/PolygonOps.d.ts.map +1 -1
  290. package/lib/cjs/geometry3d/PolygonOps.js +31 -22
  291. package/lib/cjs/geometry3d/PolygonOps.js.map +1 -1
  292. package/lib/cjs/geometry3d/PolylineCompressionByEdgeOffset.js.map +1 -1
  293. package/lib/cjs/geometry3d/PolylineOps.d.ts +16 -1
  294. package/lib/cjs/geometry3d/PolylineOps.d.ts.map +1 -1
  295. package/lib/cjs/geometry3d/PolylineOps.js +55 -0
  296. package/lib/cjs/geometry3d/PolylineOps.js.map +1 -1
  297. package/lib/cjs/geometry3d/Range.d.ts +134 -94
  298. package/lib/cjs/geometry3d/Range.d.ts.map +1 -1
  299. package/lib/cjs/geometry3d/Range.js +297 -145
  300. package/lib/cjs/geometry3d/Range.js.map +1 -1
  301. package/lib/cjs/geometry3d/Ray2d.d.ts +69 -0
  302. package/lib/cjs/geometry3d/Ray2d.d.ts.map +1 -0
  303. package/lib/cjs/geometry3d/Ray2d.js +146 -0
  304. package/lib/cjs/geometry3d/Ray2d.js.map +1 -0
  305. package/lib/cjs/geometry3d/Ray3d.d.ts.map +1 -1
  306. package/lib/cjs/geometry3d/Ray3d.js.map +1 -1
  307. package/lib/cjs/geometry3d/ReusableObjectCache.js.map +1 -1
  308. package/lib/cjs/geometry3d/Segment1d.js.map +1 -1
  309. package/lib/cjs/geometry3d/SortablePolygon.js.map +1 -1
  310. package/lib/cjs/geometry3d/Transform.d.ts +10 -3
  311. package/lib/cjs/geometry3d/Transform.d.ts.map +1 -1
  312. package/lib/cjs/geometry3d/Transform.js +18 -6
  313. package/lib/cjs/geometry3d/Transform.js.map +1 -1
  314. package/lib/cjs/geometry3d/UVSurfaceOps.js.map +1 -1
  315. package/lib/cjs/geometry3d/XYZProps.js.map +1 -1
  316. package/lib/cjs/geometry3d/YawPitchRollAngles.js.map +1 -1
  317. package/lib/cjs/geometry4d/Map4d.js.map +1 -1
  318. package/lib/cjs/geometry4d/Matrix4d.js.map +1 -1
  319. package/lib/cjs/geometry4d/MomentData.js.map +1 -1
  320. package/lib/cjs/geometry4d/PlaneByOriginAndVectors4d.js.map +1 -1
  321. package/lib/cjs/geometry4d/Point4d.js.map +1 -1
  322. package/lib/cjs/numerics/BandedSystem.js.map +1 -1
  323. package/lib/cjs/numerics/BezierPolynomials.js.map +1 -1
  324. package/lib/cjs/numerics/ClusterableArray.js.map +1 -1
  325. package/lib/cjs/numerics/Complex.js.map +1 -1
  326. package/lib/cjs/numerics/ConvexPolygon2d.d.ts +7 -49
  327. package/lib/cjs/numerics/ConvexPolygon2d.d.ts.map +1 -1
  328. package/lib/cjs/numerics/ConvexPolygon2d.js +16 -107
  329. package/lib/cjs/numerics/ConvexPolygon2d.js.map +1 -1
  330. package/lib/cjs/numerics/Newton.js.map +1 -1
  331. package/lib/cjs/numerics/PascalCoefficients.js.map +1 -1
  332. package/lib/cjs/numerics/PolarData.js.map +1 -1
  333. package/lib/cjs/numerics/Polynomials.d.ts.map +1 -1
  334. package/lib/cjs/numerics/Polynomials.js +0 -2
  335. package/lib/cjs/numerics/Polynomials.js.map +1 -1
  336. package/lib/cjs/numerics/Quadrature.js +5 -5
  337. package/lib/cjs/numerics/Quadrature.js.map +1 -1
  338. package/lib/cjs/numerics/Range1dArray.js.map +1 -1
  339. package/lib/cjs/numerics/TriDiagonalSystem.js.map +1 -1
  340. package/lib/cjs/numerics/UnionFind.js.map +1 -1
  341. package/lib/cjs/numerics/UsageSums.js.map +1 -1
  342. package/lib/cjs/polyface/AuxData.js.map +1 -1
  343. package/lib/cjs/polyface/BoxTopology.js.map +1 -1
  344. package/lib/cjs/polyface/FacetFaceData.js.map +1 -1
  345. package/lib/cjs/polyface/FacetLocationDetail.js.map +1 -1
  346. package/lib/cjs/polyface/FacetOrientation.js.map +1 -1
  347. package/lib/cjs/polyface/GreedyTriangulationBetweenLineStrings.js.map +1 -1
  348. package/lib/cjs/polyface/IndexedEdgeMatcher.js +1 -1
  349. package/lib/cjs/polyface/IndexedEdgeMatcher.js.map +1 -1
  350. package/lib/cjs/polyface/IndexedPolyfaceVisitor.js.map +1 -1
  351. package/lib/cjs/polyface/Polyface.js.map +1 -1
  352. package/lib/cjs/polyface/PolyfaceBuilder.d.ts.map +1 -1
  353. package/lib/cjs/polyface/PolyfaceBuilder.js +2 -2
  354. package/lib/cjs/polyface/PolyfaceBuilder.js.map +1 -1
  355. package/lib/cjs/polyface/PolyfaceClip.js.map +1 -1
  356. package/lib/cjs/polyface/PolyfaceData.js.map +1 -1
  357. package/lib/cjs/polyface/PolyfaceQuery.d.ts +93 -14
  358. package/lib/cjs/polyface/PolyfaceQuery.d.ts.map +1 -1
  359. package/lib/cjs/polyface/PolyfaceQuery.js +173 -34
  360. package/lib/cjs/polyface/PolyfaceQuery.js.map +1 -1
  361. package/lib/cjs/polyface/RangeLengthData.js.map +1 -1
  362. package/lib/cjs/polyface/TaggedNumericData.js +1 -1
  363. package/lib/cjs/polyface/TaggedNumericData.js.map +1 -1
  364. package/lib/cjs/polyface/TriangleCandidate.js.map +1 -1
  365. package/lib/cjs/polyface/multiclip/BuildAverageNormalsContext.js +2 -2
  366. package/lib/cjs/polyface/multiclip/BuildAverageNormalsContext.js.map +1 -1
  367. package/lib/cjs/polyface/multiclip/GriddedRaggedRange2dSet.d.ts +27 -19
  368. package/lib/cjs/polyface/multiclip/GriddedRaggedRange2dSet.d.ts.map +1 -1
  369. package/lib/cjs/polyface/multiclip/GriddedRaggedRange2dSet.js +30 -12
  370. package/lib/cjs/polyface/multiclip/GriddedRaggedRange2dSet.js.map +1 -1
  371. package/lib/cjs/polyface/multiclip/GriddedRaggedRange2dSetWithOverflow.d.ts +12 -8
  372. package/lib/cjs/polyface/multiclip/GriddedRaggedRange2dSetWithOverflow.d.ts.map +1 -1
  373. package/lib/cjs/polyface/multiclip/GriddedRaggedRange2dSetWithOverflow.js +18 -4
  374. package/lib/cjs/polyface/multiclip/GriddedRaggedRange2dSetWithOverflow.js.map +1 -1
  375. package/lib/cjs/polyface/multiclip/LinearSearchRange2dArray.d.ts +3 -4
  376. package/lib/cjs/polyface/multiclip/LinearSearchRange2dArray.d.ts.map +1 -1
  377. package/lib/cjs/polyface/multiclip/LinearSearchRange2dArray.js +3 -5
  378. package/lib/cjs/polyface/multiclip/LinearSearchRange2dArray.js.map +1 -1
  379. package/lib/cjs/polyface/multiclip/OffsetMeshContext.js.map +1 -1
  380. package/lib/cjs/polyface/multiclip/Range2dSearchInterface.d.ts +15 -12
  381. package/lib/cjs/polyface/multiclip/Range2dSearchInterface.d.ts.map +1 -1
  382. package/lib/cjs/polyface/multiclip/Range2dSearchInterface.js.map +1 -1
  383. package/lib/cjs/polyface/multiclip/RangeSearch.js.map +1 -1
  384. package/lib/cjs/polyface/multiclip/SweepLineStringToFacetContext.d.ts +38 -0
  385. package/lib/cjs/polyface/multiclip/SweepLineStringToFacetContext.d.ts.map +1 -1
  386. package/lib/cjs/polyface/multiclip/SweepLineStringToFacetContext.js +104 -1
  387. package/lib/cjs/polyface/multiclip/SweepLineStringToFacetContext.js.map +1 -1
  388. package/lib/cjs/polyface/multiclip/XYPointBuckets.js.map +1 -1
  389. package/lib/cjs/serialization/BGFBAccessors.js.map +1 -1
  390. package/lib/cjs/serialization/BGFBReader.js.map +1 -1
  391. package/lib/cjs/serialization/BGFBWriter.js.map +1 -1
  392. package/lib/cjs/serialization/BentleyGeometryFlatBuffer.js.map +1 -1
  393. package/lib/cjs/serialization/DeepCompare.js.map +1 -1
  394. package/lib/cjs/serialization/GeometrySamples.d.ts +11 -0
  395. package/lib/cjs/serialization/GeometrySamples.d.ts.map +1 -1
  396. package/lib/cjs/serialization/GeometrySamples.js +30 -0
  397. package/lib/cjs/serialization/GeometrySamples.js.map +1 -1
  398. package/lib/cjs/serialization/IModelJsonSchema.d.ts +2 -7
  399. package/lib/cjs/serialization/IModelJsonSchema.d.ts.map +1 -1
  400. package/lib/cjs/serialization/IModelJsonSchema.js +2 -7
  401. package/lib/cjs/serialization/IModelJsonSchema.js.map +1 -1
  402. package/lib/cjs/solid/Box.js.map +1 -1
  403. package/lib/cjs/solid/Cone.js.map +1 -1
  404. package/lib/cjs/solid/LinearSweep.d.ts +2 -1
  405. package/lib/cjs/solid/LinearSweep.d.ts.map +1 -1
  406. package/lib/cjs/solid/LinearSweep.js.map +1 -1
  407. package/lib/cjs/solid/RotationalSweep.d.ts +2 -1
  408. package/lib/cjs/solid/RotationalSweep.d.ts.map +1 -1
  409. package/lib/cjs/solid/RotationalSweep.js.map +1 -1
  410. package/lib/cjs/solid/RuledSweep.d.ts +2 -1
  411. package/lib/cjs/solid/RuledSweep.d.ts.map +1 -1
  412. package/lib/cjs/solid/RuledSweep.js.map +1 -1
  413. package/lib/cjs/solid/SolidPrimitive.js.map +1 -1
  414. package/lib/cjs/solid/Sphere.js.map +1 -1
  415. package/lib/cjs/solid/SweepContour.d.ts +2 -2
  416. package/lib/cjs/solid/SweepContour.d.ts.map +1 -1
  417. package/lib/cjs/solid/SweepContour.js +9 -0
  418. package/lib/cjs/solid/SweepContour.js.map +1 -1
  419. package/lib/cjs/solid/TorusPipe.js.map +1 -1
  420. package/lib/cjs/topology/ChainMerge.js +1 -1
  421. package/lib/cjs/topology/ChainMerge.js.map +1 -1
  422. package/lib/cjs/topology/Graph.js.map +1 -1
  423. package/lib/cjs/topology/HalfEdgeGraphFromIndexedLoopsContext.js.map +1 -1
  424. package/lib/cjs/topology/HalfEdgeGraphSearch.d.ts.map +1 -1
  425. package/lib/cjs/topology/HalfEdgeGraphSearch.js +1 -1
  426. package/lib/cjs/topology/HalfEdgeGraphSearch.js.map +1 -1
  427. package/lib/cjs/topology/HalfEdgeGraphSpineContext.js +1 -1
  428. package/lib/cjs/topology/HalfEdgeGraphSpineContext.js.map +1 -1
  429. package/lib/cjs/topology/HalfEdgeGraphValidation.js.map +1 -1
  430. package/lib/cjs/topology/HalfEdgeMarkSet.js.map +1 -1
  431. package/lib/cjs/topology/HalfEdgeNodeXYZUV.js.map +1 -1
  432. package/lib/cjs/topology/HalfEdgePointInGraphSearch.js.map +1 -1
  433. package/lib/cjs/topology/HalfEdgePositionDetail.js.map +1 -1
  434. package/lib/cjs/topology/HalfEdgePriorityQueue.d.ts.map +1 -1
  435. package/lib/cjs/topology/HalfEdgePriorityQueue.js +1 -1
  436. package/lib/cjs/topology/HalfEdgePriorityQueue.js.map +1 -1
  437. package/lib/cjs/topology/InsertAndRetriangulateContext.js.map +1 -1
  438. package/lib/cjs/topology/MaskManager.js.map +1 -1
  439. package/lib/cjs/topology/Merging.js.map +1 -1
  440. package/lib/cjs/topology/RegularizeFace.js +3 -3
  441. package/lib/cjs/topology/RegularizeFace.js.map +1 -1
  442. package/lib/cjs/topology/SignedDataSummary.js.map +1 -1
  443. package/lib/cjs/topology/SpaceTriangulation.js.map +1 -1
  444. package/lib/cjs/topology/Triangulation.js +1 -1
  445. package/lib/cjs/topology/Triangulation.js.map +1 -1
  446. package/lib/cjs/topology/XYParitySearchContext.js.map +1 -1
  447. package/lib/esm/Constant.js.map +1 -1
  448. package/lib/esm/Geometry.js.map +1 -1
  449. package/lib/esm/bspline/AkimaCurve3d.js.map +1 -1
  450. package/lib/esm/bspline/BSpline1dNd.js.map +1 -1
  451. package/lib/esm/bspline/BSplineCurve.d.ts +1 -1
  452. package/lib/esm/bspline/BSplineCurve.d.ts.map +1 -1
  453. package/lib/esm/bspline/BSplineCurve.js +1 -1
  454. package/lib/esm/bspline/BSplineCurve.js.map +1 -1
  455. package/lib/esm/bspline/BSplineCurve3dH.js.map +1 -1
  456. package/lib/esm/bspline/BSplineCurveOps.js.map +1 -1
  457. package/lib/esm/bspline/BSplineSurface.d.ts.map +1 -1
  458. package/lib/esm/bspline/BSplineSurface.js +1 -1
  459. package/lib/esm/bspline/BSplineSurface.js.map +1 -1
  460. package/lib/esm/bspline/Bezier1dNd.js.map +1 -1
  461. package/lib/esm/bspline/BezierCurve3d.js.map +1 -1
  462. package/lib/esm/bspline/BezierCurve3dH.js.map +1 -1
  463. package/lib/esm/bspline/BezierCurveBase.d.ts +1 -1
  464. package/lib/esm/bspline/BezierCurveBase.d.ts.map +1 -1
  465. package/lib/esm/bspline/BezierCurveBase.js +1 -1
  466. package/lib/esm/bspline/BezierCurveBase.js.map +1 -1
  467. package/lib/esm/bspline/InterpolationCurve3d.js.map +1 -1
  468. package/lib/esm/bspline/KnotVector.js.map +1 -1
  469. package/lib/esm/bspline/SurfaceLocationDetail.js.map +1 -1
  470. package/lib/esm/clipping/AlternatingConvexClipTree.d.ts +15 -17
  471. package/lib/esm/clipping/AlternatingConvexClipTree.d.ts.map +1 -1
  472. package/lib/esm/clipping/AlternatingConvexClipTree.js +24 -20
  473. package/lib/esm/clipping/AlternatingConvexClipTree.js.map +1 -1
  474. package/lib/esm/clipping/BooleanClipFactory.d.ts +28 -28
  475. package/lib/esm/clipping/BooleanClipFactory.d.ts.map +1 -1
  476. package/lib/esm/clipping/BooleanClipFactory.js +28 -28
  477. package/lib/esm/clipping/BooleanClipFactory.js.map +1 -1
  478. package/lib/esm/clipping/BooleanClipNode.d.ts +11 -11
  479. package/lib/esm/clipping/BooleanClipNode.d.ts.map +1 -1
  480. package/lib/esm/clipping/BooleanClipNode.js +11 -11
  481. package/lib/esm/clipping/BooleanClipNode.js.map +1 -1
  482. package/lib/esm/clipping/ClipPlane.d.ts +73 -76
  483. package/lib/esm/clipping/ClipPlane.d.ts.map +1 -1
  484. package/lib/esm/clipping/ClipPlane.js +105 -86
  485. package/lib/esm/clipping/ClipPlane.js.map +1 -1
  486. package/lib/esm/clipping/ClipPrimitive.d.ts +78 -47
  487. package/lib/esm/clipping/ClipPrimitive.d.ts.map +1 -1
  488. package/lib/esm/clipping/ClipPrimitive.js +112 -54
  489. package/lib/esm/clipping/ClipPrimitive.js.map +1 -1
  490. package/lib/esm/clipping/ClipUtils.d.ts +54 -44
  491. package/lib/esm/clipping/ClipUtils.d.ts.map +1 -1
  492. package/lib/esm/clipping/ClipUtils.js +33 -29
  493. package/lib/esm/clipping/ClipUtils.js.map +1 -1
  494. package/lib/esm/clipping/ClipVector.d.ts +39 -25
  495. package/lib/esm/clipping/ClipVector.d.ts.map +1 -1
  496. package/lib/esm/clipping/ClipVector.js +35 -23
  497. package/lib/esm/clipping/ClipVector.js.map +1 -1
  498. package/lib/esm/clipping/ConvexClipPlaneSet.d.ts +61 -38
  499. package/lib/esm/clipping/ConvexClipPlaneSet.d.ts.map +1 -1
  500. package/lib/esm/clipping/ConvexClipPlaneSet.js +64 -41
  501. package/lib/esm/clipping/ConvexClipPlaneSet.js.map +1 -1
  502. package/lib/esm/clipping/UnionOfConvexClipPlaneSets.d.ts +49 -30
  503. package/lib/esm/clipping/UnionOfConvexClipPlaneSets.d.ts.map +1 -1
  504. package/lib/esm/clipping/UnionOfConvexClipPlaneSets.js +50 -30
  505. package/lib/esm/clipping/UnionOfConvexClipPlaneSets.js.map +1 -1
  506. package/lib/esm/clipping/internalContexts/LineStringOffsetClipperContext.d.ts +2 -2
  507. package/lib/esm/clipping/internalContexts/LineStringOffsetClipperContext.d.ts.map +1 -1
  508. package/lib/esm/clipping/internalContexts/LineStringOffsetClipperContext.js +2 -2
  509. package/lib/esm/clipping/internalContexts/LineStringOffsetClipperContext.js.map +1 -1
  510. package/lib/esm/core-geometry.d.ts +5 -1
  511. package/lib/esm/core-geometry.d.ts.map +1 -1
  512. package/lib/esm/core-geometry.js +5 -1
  513. package/lib/esm/core-geometry.js.map +1 -1
  514. package/lib/esm/curve/Arc3d.d.ts +4 -3
  515. package/lib/esm/curve/Arc3d.d.ts.map +1 -1
  516. package/lib/esm/curve/Arc3d.js +6 -4
  517. package/lib/esm/curve/Arc3d.js.map +1 -1
  518. package/lib/esm/curve/ConstructCurveBetweenCurves.js.map +1 -1
  519. package/lib/esm/curve/CoordinateXYZ.js.map +1 -1
  520. package/lib/esm/curve/CurveChain.js.map +1 -1
  521. package/lib/esm/curve/CurveChainWithDistanceIndex.d.ts +62 -42
  522. package/lib/esm/curve/CurveChainWithDistanceIndex.d.ts.map +1 -1
  523. package/lib/esm/curve/CurveChainWithDistanceIndex.js +70 -47
  524. package/lib/esm/curve/CurveChainWithDistanceIndex.js.map +1 -1
  525. package/lib/esm/curve/CurveCollection.d.ts +36 -26
  526. package/lib/esm/curve/CurveCollection.d.ts.map +1 -1
  527. package/lib/esm/curve/CurveCollection.js +46 -39
  528. package/lib/esm/curve/CurveCollection.js.map +1 -1
  529. package/lib/esm/curve/CurveCurve.d.ts +6 -2
  530. package/lib/esm/curve/CurveCurve.d.ts.map +1 -1
  531. package/lib/esm/curve/CurveCurve.js +13 -9
  532. package/lib/esm/curve/CurveCurve.js.map +1 -1
  533. package/lib/esm/curve/CurveCurveCloseApproachXY.d.ts +74 -68
  534. package/lib/esm/curve/CurveCurveCloseApproachXY.d.ts.map +1 -1
  535. package/lib/esm/curve/CurveCurveCloseApproachXY.js +100 -108
  536. package/lib/esm/curve/CurveCurveCloseApproachXY.js.map +1 -1
  537. package/lib/esm/curve/CurveCurveIntersectXY.d.ts +46 -48
  538. package/lib/esm/curve/CurveCurveIntersectXY.d.ts.map +1 -1
  539. package/lib/esm/curve/CurveCurveIntersectXY.js +72 -61
  540. package/lib/esm/curve/CurveCurveIntersectXY.js.map +1 -1
  541. package/lib/esm/curve/CurveCurveIntersectXYZ.d.ts +32 -38
  542. package/lib/esm/curve/CurveCurveIntersectXYZ.d.ts.map +1 -1
  543. package/lib/esm/curve/CurveCurveIntersectXYZ.js +86 -97
  544. package/lib/esm/curve/CurveCurveIntersectXYZ.js.map +1 -1
  545. package/lib/esm/curve/CurveExtendMode.js.map +1 -1
  546. package/lib/esm/curve/CurveFactory.d.ts +67 -3
  547. package/lib/esm/curve/CurveFactory.d.ts.map +1 -1
  548. package/lib/esm/curve/CurveFactory.js +74 -6
  549. package/lib/esm/curve/CurveFactory.js.map +1 -1
  550. package/lib/esm/curve/CurveLocationDetail.d.ts +6 -6
  551. package/lib/esm/curve/CurveLocationDetail.d.ts.map +1 -1
  552. package/lib/esm/curve/CurveLocationDetail.js +9 -7
  553. package/lib/esm/curve/CurveLocationDetail.js.map +1 -1
  554. package/lib/esm/curve/CurveOps.d.ts +77 -0
  555. package/lib/esm/curve/CurveOps.d.ts.map +1 -0
  556. package/lib/esm/curve/CurveOps.js +156 -0
  557. package/lib/esm/curve/CurveOps.js.map +1 -0
  558. package/lib/esm/curve/CurvePrimitive.d.ts +26 -18
  559. package/lib/esm/curve/CurvePrimitive.d.ts.map +1 -1
  560. package/lib/esm/curve/CurvePrimitive.js +4 -3
  561. package/lib/esm/curve/CurvePrimitive.js.map +1 -1
  562. package/lib/esm/curve/CurveProcessor.js.map +1 -1
  563. package/lib/esm/curve/CurveWireMomentsXYZ.js.map +1 -1
  564. package/lib/esm/curve/GeometryQuery.d.ts +2 -2
  565. package/lib/esm/curve/GeometryQuery.d.ts.map +1 -1
  566. package/lib/esm/curve/GeometryQuery.js +2 -2
  567. package/lib/esm/curve/GeometryQuery.js.map +1 -1
  568. package/lib/esm/curve/LineSegment3d.d.ts +7 -5
  569. package/lib/esm/curve/LineSegment3d.d.ts.map +1 -1
  570. package/lib/esm/curve/LineSegment3d.js +5 -5
  571. package/lib/esm/curve/LineSegment3d.js.map +1 -1
  572. package/lib/esm/curve/LineString3d.d.ts +2 -2
  573. package/lib/esm/curve/LineString3d.d.ts.map +1 -1
  574. package/lib/esm/curve/LineString3d.js +2 -2
  575. package/lib/esm/curve/LineString3d.js.map +1 -1
  576. package/lib/esm/curve/Loop.d.ts +7 -5
  577. package/lib/esm/curve/Loop.d.ts.map +1 -1
  578. package/lib/esm/curve/Loop.js +18 -6
  579. package/lib/esm/curve/Loop.js.map +1 -1
  580. package/lib/esm/curve/OffsetOptions.d.ts +97 -0
  581. package/lib/esm/curve/OffsetOptions.d.ts.map +1 -0
  582. package/lib/esm/curve/OffsetOptions.js +161 -0
  583. package/lib/esm/curve/OffsetOptions.js.map +1 -0
  584. package/lib/esm/curve/ParityRegion.d.ts +7 -7
  585. package/lib/esm/curve/ParityRegion.d.ts.map +1 -1
  586. package/lib/esm/curve/ParityRegion.js +19 -11
  587. package/lib/esm/curve/ParityRegion.js.map +1 -1
  588. package/lib/esm/curve/Path.d.ts +6 -6
  589. package/lib/esm/curve/Path.d.ts.map +1 -1
  590. package/lib/esm/curve/Path.js +15 -9
  591. package/lib/esm/curve/Path.js.map +1 -1
  592. package/lib/esm/curve/PointString3d.js.map +1 -1
  593. package/lib/esm/curve/ProxyCurve.d.ts +5 -7
  594. package/lib/esm/curve/ProxyCurve.d.ts.map +1 -1
  595. package/lib/esm/curve/ProxyCurve.js +7 -7
  596. package/lib/esm/curve/ProxyCurve.js.map +1 -1
  597. package/lib/esm/curve/Query/ConsolidateAdjacentPrimitivesContext.js.map +1 -1
  598. package/lib/esm/curve/Query/CurveSplitContext.js.map +1 -1
  599. package/lib/esm/curve/Query/CylindricalRange.js.map +1 -1
  600. package/lib/esm/curve/Query/InOutTests.js.map +1 -1
  601. package/lib/esm/curve/Query/PlanarSubdivision.js.map +1 -1
  602. package/lib/esm/curve/Query/StrokeCountChain.js.map +1 -1
  603. package/lib/esm/curve/Query/StrokeCountMap.js.map +1 -1
  604. package/lib/esm/curve/RegionMomentsXY.js.map +1 -1
  605. package/lib/esm/curve/RegionOps.d.ts +76 -56
  606. package/lib/esm/curve/RegionOps.d.ts.map +1 -1
  607. package/lib/esm/curve/RegionOps.js +84 -61
  608. package/lib/esm/curve/RegionOps.js.map +1 -1
  609. package/lib/esm/curve/RegionOpsClassificationSweeps.js +2 -2
  610. package/lib/esm/curve/RegionOpsClassificationSweeps.js.map +1 -1
  611. package/lib/esm/curve/StrokeOptions.d.ts.map +1 -1
  612. package/lib/esm/curve/StrokeOptions.js +6 -2
  613. package/lib/esm/curve/StrokeOptions.js.map +1 -1
  614. package/lib/esm/curve/UnionRegion.d.ts +6 -5
  615. package/lib/esm/curve/UnionRegion.d.ts.map +1 -1
  616. package/lib/esm/curve/UnionRegion.js +17 -8
  617. package/lib/esm/curve/UnionRegion.js.map +1 -1
  618. package/lib/esm/curve/internalContexts/AppendPlaneIntersectionStrokeHandler.js.map +1 -1
  619. package/lib/esm/curve/{ChainCollectorContext.d.ts → internalContexts/ChainCollectorContext.d.ts} +4 -4
  620. package/lib/esm/curve/internalContexts/ChainCollectorContext.d.ts.map +1 -0
  621. package/lib/esm/curve/{ChainCollectorContext.js → internalContexts/ChainCollectorContext.js} +4 -4
  622. package/lib/esm/curve/internalContexts/ChainCollectorContext.js.map +1 -0
  623. package/lib/esm/curve/internalContexts/CloneCurvesContext.js.map +1 -1
  624. package/lib/esm/curve/internalContexts/CloneWithExpandedLineStrings.js.map +1 -1
  625. package/lib/esm/curve/internalContexts/ClosestPointStrokeHandler.js.map +1 -1
  626. package/lib/esm/curve/internalContexts/CountLinearPartsSearchContext.js.map +1 -1
  627. package/lib/esm/curve/internalContexts/CurveLengthContext.js.map +1 -1
  628. package/lib/esm/curve/internalContexts/CurveOffsetXYHandler.js.map +1 -1
  629. package/lib/esm/curve/internalContexts/GapSearchContext.d.ts +2 -1
  630. package/lib/esm/curve/internalContexts/GapSearchContext.d.ts.map +1 -1
  631. package/lib/esm/curve/internalContexts/GapSearchContext.js +6 -2
  632. package/lib/esm/curve/internalContexts/GapSearchContext.js.map +1 -1
  633. package/lib/esm/curve/internalContexts/MultiChainCollector.d.ts +59 -70
  634. package/lib/esm/curve/internalContexts/MultiChainCollector.d.ts.map +1 -1
  635. package/lib/esm/curve/internalContexts/MultiChainCollector.js +129 -218
  636. package/lib/esm/curve/internalContexts/MultiChainCollector.js.map +1 -1
  637. package/lib/esm/curve/internalContexts/NewtonRtoRStrokeHandler.js.map +1 -1
  638. package/lib/esm/curve/internalContexts/PlaneAltitudeRangeContext.d.ts +14 -8
  639. package/lib/esm/curve/internalContexts/PlaneAltitudeRangeContext.d.ts.map +1 -1
  640. package/lib/esm/curve/internalContexts/PlaneAltitudeRangeContext.js +14 -8
  641. package/lib/esm/curve/internalContexts/PlaneAltitudeRangeContext.js.map +1 -1
  642. package/lib/esm/curve/internalContexts/PolygonOffsetContext.d.ts +23 -95
  643. package/lib/esm/curve/internalContexts/PolygonOffsetContext.d.ts.map +1 -1
  644. package/lib/esm/curve/internalContexts/PolygonOffsetContext.js +86 -173
  645. package/lib/esm/curve/internalContexts/PolygonOffsetContext.js.map +1 -1
  646. package/lib/esm/curve/internalContexts/SumLengthsContext.d.ts.map +1 -1
  647. package/lib/esm/curve/internalContexts/SumLengthsContext.js +4 -1
  648. package/lib/esm/curve/internalContexts/SumLengthsContext.js.map +1 -1
  649. package/lib/esm/curve/internalContexts/TransformInPlaceContext.js.map +1 -1
  650. package/lib/esm/curve/spiral/AustralianRailCorpXYEvaluator.js.map +1 -1
  651. package/lib/esm/curve/spiral/ClothoidSeries.js.map +1 -1
  652. package/lib/esm/curve/spiral/CubicEvaluator.js.map +1 -1
  653. package/lib/esm/curve/spiral/CzechSpiralEvaluator.js.map +1 -1
  654. package/lib/esm/curve/spiral/DirectHalfCosineSpiralEvaluator.js.map +1 -1
  655. package/lib/esm/curve/spiral/DirectSpiral3d.js.map +1 -1
  656. package/lib/esm/curve/spiral/IntegratedSpiral3d.js +1 -1
  657. package/lib/esm/curve/spiral/IntegratedSpiral3d.js.map +1 -1
  658. package/lib/esm/curve/spiral/MXCubicAlongArcSpiralEvaluator.js.map +1 -1
  659. package/lib/esm/curve/spiral/NormalizedTransition.js.map +1 -1
  660. package/lib/esm/curve/spiral/PolishCubicSpiralEvaluator.js.map +1 -1
  661. package/lib/esm/curve/spiral/TransitionConditionalProperties.js.map +1 -1
  662. package/lib/esm/curve/spiral/TransitionSpiral3d.d.ts +1 -1
  663. package/lib/esm/curve/spiral/TransitionSpiral3d.d.ts.map +1 -1
  664. package/lib/esm/curve/spiral/TransitionSpiral3d.js +1 -1
  665. package/lib/esm/curve/spiral/TransitionSpiral3d.js.map +1 -1
  666. package/lib/esm/curve/spiral/XYCurveEvaluator.js +1 -1
  667. package/lib/esm/curve/spiral/XYCurveEvaluator.js.map +1 -1
  668. package/lib/esm/geometry3d/Angle.d.ts +9 -0
  669. package/lib/esm/geometry3d/Angle.d.ts.map +1 -1
  670. package/lib/esm/geometry3d/Angle.js +13 -0
  671. package/lib/esm/geometry3d/Angle.js.map +1 -1
  672. package/lib/esm/geometry3d/AngleSweep.js.map +1 -1
  673. package/lib/esm/geometry3d/BarycentricTriangle.js.map +1 -1
  674. package/lib/esm/geometry3d/BilinearPatch.d.ts +43 -48
  675. package/lib/esm/geometry3d/BilinearPatch.d.ts.map +1 -1
  676. package/lib/esm/geometry3d/BilinearPatch.js +51 -55
  677. package/lib/esm/geometry3d/BilinearPatch.js.map +1 -1
  678. package/lib/esm/geometry3d/CoincidentGeometryOps.js.map +1 -1
  679. package/lib/esm/geometry3d/Ellipsoid.d.ts +1 -1
  680. package/lib/esm/geometry3d/Ellipsoid.js +1 -1
  681. package/lib/esm/geometry3d/Ellipsoid.js.map +1 -1
  682. package/lib/esm/geometry3d/FrameBuilder.d.ts.map +1 -1
  683. package/lib/esm/geometry3d/FrameBuilder.js +13 -11
  684. package/lib/esm/geometry3d/FrameBuilder.js.map +1 -1
  685. package/lib/esm/geometry3d/FrustumAnimation.js.map +1 -1
  686. package/lib/esm/geometry3d/GeometryHandler.d.ts +103 -97
  687. package/lib/esm/geometry3d/GeometryHandler.d.ts.map +1 -1
  688. package/lib/esm/geometry3d/GeometryHandler.js +247 -124
  689. package/lib/esm/geometry3d/GeometryHandler.js.map +1 -1
  690. package/lib/esm/geometry3d/GrowableBlockedArray.d.ts.map +1 -1
  691. package/lib/esm/geometry3d/GrowableBlockedArray.js +1 -1
  692. package/lib/esm/geometry3d/GrowableBlockedArray.js.map +1 -1
  693. package/lib/esm/geometry3d/GrowableFloat64Array.d.ts.map +1 -1
  694. package/lib/esm/geometry3d/GrowableFloat64Array.js +1 -1
  695. package/lib/esm/geometry3d/GrowableFloat64Array.js.map +1 -1
  696. package/lib/esm/geometry3d/GrowableXYArray.js.map +1 -1
  697. package/lib/esm/geometry3d/GrowableXYZArray.js.map +1 -1
  698. package/lib/esm/geometry3d/IndexedCollectionInterval.js.map +1 -1
  699. package/lib/esm/geometry3d/IndexedXYCollection.js.map +1 -1
  700. package/lib/esm/geometry3d/IndexedXYZCollection.js.map +1 -1
  701. package/lib/esm/geometry3d/LongitudeLatitudeAltitude.js.map +1 -1
  702. package/lib/esm/geometry3d/Matrix3d.d.ts +18 -0
  703. package/lib/esm/geometry3d/Matrix3d.d.ts.map +1 -1
  704. package/lib/esm/geometry3d/Matrix3d.js +32 -5
  705. package/lib/esm/geometry3d/Matrix3d.js.map +1 -1
  706. package/lib/esm/geometry3d/OrderedRotationAngles.js.map +1 -1
  707. package/lib/esm/geometry3d/Plane3d.d.ts +41 -32
  708. package/lib/esm/geometry3d/Plane3d.d.ts.map +1 -1
  709. package/lib/esm/geometry3d/Plane3d.js +11 -8
  710. package/lib/esm/geometry3d/Plane3d.js.map +1 -1
  711. package/lib/esm/geometry3d/Plane3dByOriginAndUnitNormal.d.ts +37 -34
  712. package/lib/esm/geometry3d/Plane3dByOriginAndUnitNormal.d.ts.map +1 -1
  713. package/lib/esm/geometry3d/Plane3dByOriginAndUnitNormal.js +65 -43
  714. package/lib/esm/geometry3d/Plane3dByOriginAndUnitNormal.js.map +1 -1
  715. package/lib/esm/geometry3d/Plane3dByOriginAndVectors.d.ts +36 -32
  716. package/lib/esm/geometry3d/Plane3dByOriginAndVectors.d.ts.map +1 -1
  717. package/lib/esm/geometry3d/Plane3dByOriginAndVectors.js +37 -32
  718. package/lib/esm/geometry3d/Plane3dByOriginAndVectors.js.map +1 -1
  719. package/lib/esm/geometry3d/Point2dArrayCarrier.js.map +1 -1
  720. package/lib/esm/geometry3d/Point2dVector2d.d.ts +8 -9
  721. package/lib/esm/geometry3d/Point2dVector2d.d.ts.map +1 -1
  722. package/lib/esm/geometry3d/Point2dVector2d.js +9 -10
  723. package/lib/esm/geometry3d/Point2dVector2d.js.map +1 -1
  724. package/lib/esm/geometry3d/Point3dArrayCarrier.js.map +1 -1
  725. package/lib/esm/geometry3d/Point3dVector3d.d.ts +12 -4
  726. package/lib/esm/geometry3d/Point3dVector3d.d.ts.map +1 -1
  727. package/lib/esm/geometry3d/Point3dVector3d.js +18 -5
  728. package/lib/esm/geometry3d/Point3dVector3d.js.map +1 -1
  729. package/lib/esm/geometry3d/PointHelpers.d.ts.map +1 -1
  730. package/lib/esm/geometry3d/PointHelpers.js +5 -5
  731. package/lib/esm/geometry3d/PointHelpers.js.map +1 -1
  732. package/lib/esm/geometry3d/PointStreaming.js.map +1 -1
  733. package/lib/esm/geometry3d/PolygonOps.d.ts +6 -2
  734. package/lib/esm/geometry3d/PolygonOps.d.ts.map +1 -1
  735. package/lib/esm/geometry3d/PolygonOps.js +31 -22
  736. package/lib/esm/geometry3d/PolygonOps.js.map +1 -1
  737. package/lib/esm/geometry3d/PolylineCompressionByEdgeOffset.js.map +1 -1
  738. package/lib/esm/geometry3d/PolylineOps.d.ts +16 -1
  739. package/lib/esm/geometry3d/PolylineOps.d.ts.map +1 -1
  740. package/lib/esm/geometry3d/PolylineOps.js +56 -1
  741. package/lib/esm/geometry3d/PolylineOps.js.map +1 -1
  742. package/lib/esm/geometry3d/Range.d.ts +134 -94
  743. package/lib/esm/geometry3d/Range.d.ts.map +1 -1
  744. package/lib/esm/geometry3d/Range.js +297 -145
  745. package/lib/esm/geometry3d/Range.js.map +1 -1
  746. package/lib/esm/geometry3d/Ray2d.d.ts +69 -0
  747. package/lib/esm/geometry3d/Ray2d.d.ts.map +1 -0
  748. package/lib/esm/geometry3d/Ray2d.js +142 -0
  749. package/lib/esm/geometry3d/Ray2d.js.map +1 -0
  750. package/lib/esm/geometry3d/Ray3d.d.ts.map +1 -1
  751. package/lib/esm/geometry3d/Ray3d.js.map +1 -1
  752. package/lib/esm/geometry3d/ReusableObjectCache.js.map +1 -1
  753. package/lib/esm/geometry3d/Segment1d.js.map +1 -1
  754. package/lib/esm/geometry3d/SortablePolygon.js.map +1 -1
  755. package/lib/esm/geometry3d/Transform.d.ts +10 -3
  756. package/lib/esm/geometry3d/Transform.d.ts.map +1 -1
  757. package/lib/esm/geometry3d/Transform.js +18 -6
  758. package/lib/esm/geometry3d/Transform.js.map +1 -1
  759. package/lib/esm/geometry3d/UVSurfaceOps.js.map +1 -1
  760. package/lib/esm/geometry3d/XYZProps.js.map +1 -1
  761. package/lib/esm/geometry3d/YawPitchRollAngles.js.map +1 -1
  762. package/lib/esm/geometry4d/Map4d.js.map +1 -1
  763. package/lib/esm/geometry4d/Matrix4d.js.map +1 -1
  764. package/lib/esm/geometry4d/MomentData.js.map +1 -1
  765. package/lib/esm/geometry4d/PlaneByOriginAndVectors4d.js.map +1 -1
  766. package/lib/esm/geometry4d/Point4d.js.map +1 -1
  767. package/lib/esm/numerics/BandedSystem.js.map +1 -1
  768. package/lib/esm/numerics/BezierPolynomials.js.map +1 -1
  769. package/lib/esm/numerics/ClusterableArray.js.map +1 -1
  770. package/lib/esm/numerics/Complex.js.map +1 -1
  771. package/lib/esm/numerics/ConvexPolygon2d.d.ts +7 -49
  772. package/lib/esm/numerics/ConvexPolygon2d.d.ts.map +1 -1
  773. package/lib/esm/numerics/ConvexPolygon2d.js +14 -104
  774. package/lib/esm/numerics/ConvexPolygon2d.js.map +1 -1
  775. package/lib/esm/numerics/Newton.js.map +1 -1
  776. package/lib/esm/numerics/PascalCoefficients.js.map +1 -1
  777. package/lib/esm/numerics/PolarData.js.map +1 -1
  778. package/lib/esm/numerics/Polynomials.d.ts.map +1 -1
  779. package/lib/esm/numerics/Polynomials.js +0 -2
  780. package/lib/esm/numerics/Polynomials.js.map +1 -1
  781. package/lib/esm/numerics/Quadrature.js +5 -5
  782. package/lib/esm/numerics/Quadrature.js.map +1 -1
  783. package/lib/esm/numerics/Range1dArray.js.map +1 -1
  784. package/lib/esm/numerics/TriDiagonalSystem.js.map +1 -1
  785. package/lib/esm/numerics/UnionFind.js.map +1 -1
  786. package/lib/esm/numerics/UsageSums.js.map +1 -1
  787. package/lib/esm/polyface/AuxData.js.map +1 -1
  788. package/lib/esm/polyface/BoxTopology.js.map +1 -1
  789. package/lib/esm/polyface/FacetFaceData.js.map +1 -1
  790. package/lib/esm/polyface/FacetLocationDetail.js.map +1 -1
  791. package/lib/esm/polyface/FacetOrientation.js.map +1 -1
  792. package/lib/esm/polyface/GreedyTriangulationBetweenLineStrings.js.map +1 -1
  793. package/lib/esm/polyface/IndexedEdgeMatcher.js +1 -1
  794. package/lib/esm/polyface/IndexedEdgeMatcher.js.map +1 -1
  795. package/lib/esm/polyface/IndexedPolyfaceVisitor.js.map +1 -1
  796. package/lib/esm/polyface/Polyface.js.map +1 -1
  797. package/lib/esm/polyface/PolyfaceBuilder.d.ts.map +1 -1
  798. package/lib/esm/polyface/PolyfaceBuilder.js +2 -2
  799. package/lib/esm/polyface/PolyfaceBuilder.js.map +1 -1
  800. package/lib/esm/polyface/PolyfaceClip.js.map +1 -1
  801. package/lib/esm/polyface/PolyfaceData.js.map +1 -1
  802. package/lib/esm/polyface/PolyfaceQuery.d.ts +93 -14
  803. package/lib/esm/polyface/PolyfaceQuery.d.ts.map +1 -1
  804. package/lib/esm/polyface/PolyfaceQuery.js +173 -35
  805. package/lib/esm/polyface/PolyfaceQuery.js.map +1 -1
  806. package/lib/esm/polyface/RangeLengthData.js.map +1 -1
  807. package/lib/esm/polyface/TaggedNumericData.js +1 -1
  808. package/lib/esm/polyface/TaggedNumericData.js.map +1 -1
  809. package/lib/esm/polyface/TriangleCandidate.js.map +1 -1
  810. package/lib/esm/polyface/multiclip/BuildAverageNormalsContext.js +2 -2
  811. package/lib/esm/polyface/multiclip/BuildAverageNormalsContext.js.map +1 -1
  812. package/lib/esm/polyface/multiclip/GriddedRaggedRange2dSet.d.ts +27 -19
  813. package/lib/esm/polyface/multiclip/GriddedRaggedRange2dSet.d.ts.map +1 -1
  814. package/lib/esm/polyface/multiclip/GriddedRaggedRange2dSet.js +30 -12
  815. package/lib/esm/polyface/multiclip/GriddedRaggedRange2dSet.js.map +1 -1
  816. package/lib/esm/polyface/multiclip/GriddedRaggedRange2dSetWithOverflow.d.ts +12 -8
  817. package/lib/esm/polyface/multiclip/GriddedRaggedRange2dSetWithOverflow.d.ts.map +1 -1
  818. package/lib/esm/polyface/multiclip/GriddedRaggedRange2dSetWithOverflow.js +18 -4
  819. package/lib/esm/polyface/multiclip/GriddedRaggedRange2dSetWithOverflow.js.map +1 -1
  820. package/lib/esm/polyface/multiclip/LinearSearchRange2dArray.d.ts +3 -4
  821. package/lib/esm/polyface/multiclip/LinearSearchRange2dArray.d.ts.map +1 -1
  822. package/lib/esm/polyface/multiclip/LinearSearchRange2dArray.js +3 -5
  823. package/lib/esm/polyface/multiclip/LinearSearchRange2dArray.js.map +1 -1
  824. package/lib/esm/polyface/multiclip/OffsetMeshContext.js.map +1 -1
  825. package/lib/esm/polyface/multiclip/Range2dSearchInterface.d.ts +15 -12
  826. package/lib/esm/polyface/multiclip/Range2dSearchInterface.d.ts.map +1 -1
  827. package/lib/esm/polyface/multiclip/Range2dSearchInterface.js.map +1 -1
  828. package/lib/esm/polyface/multiclip/RangeSearch.js.map +1 -1
  829. package/lib/esm/polyface/multiclip/SweepLineStringToFacetContext.d.ts +38 -0
  830. package/lib/esm/polyface/multiclip/SweepLineStringToFacetContext.d.ts.map +1 -1
  831. package/lib/esm/polyface/multiclip/SweepLineStringToFacetContext.js +102 -1
  832. package/lib/esm/polyface/multiclip/SweepLineStringToFacetContext.js.map +1 -1
  833. package/lib/esm/polyface/multiclip/XYPointBuckets.js.map +1 -1
  834. package/lib/esm/serialization/BGFBAccessors.js.map +1 -1
  835. package/lib/esm/serialization/BGFBReader.js.map +1 -1
  836. package/lib/esm/serialization/BGFBWriter.js.map +1 -1
  837. package/lib/esm/serialization/BentleyGeometryFlatBuffer.js.map +1 -1
  838. package/lib/esm/serialization/DeepCompare.js.map +1 -1
  839. package/lib/esm/serialization/GeometrySamples.d.ts +11 -0
  840. package/lib/esm/serialization/GeometrySamples.d.ts.map +1 -1
  841. package/lib/esm/serialization/GeometrySamples.js +30 -0
  842. package/lib/esm/serialization/GeometrySamples.js.map +1 -1
  843. package/lib/esm/serialization/IModelJsonSchema.d.ts +2 -7
  844. package/lib/esm/serialization/IModelJsonSchema.d.ts.map +1 -1
  845. package/lib/esm/serialization/IModelJsonSchema.js +2 -7
  846. package/lib/esm/serialization/IModelJsonSchema.js.map +1 -1
  847. package/lib/esm/solid/Box.js.map +1 -1
  848. package/lib/esm/solid/Cone.js.map +1 -1
  849. package/lib/esm/solid/LinearSweep.d.ts +2 -1
  850. package/lib/esm/solid/LinearSweep.d.ts.map +1 -1
  851. package/lib/esm/solid/LinearSweep.js.map +1 -1
  852. package/lib/esm/solid/RotationalSweep.d.ts +2 -1
  853. package/lib/esm/solid/RotationalSweep.d.ts.map +1 -1
  854. package/lib/esm/solid/RotationalSweep.js.map +1 -1
  855. package/lib/esm/solid/RuledSweep.d.ts +2 -1
  856. package/lib/esm/solid/RuledSweep.d.ts.map +1 -1
  857. package/lib/esm/solid/RuledSweep.js.map +1 -1
  858. package/lib/esm/solid/SolidPrimitive.js.map +1 -1
  859. package/lib/esm/solid/Sphere.js.map +1 -1
  860. package/lib/esm/solid/SweepContour.d.ts +2 -2
  861. package/lib/esm/solid/SweepContour.d.ts.map +1 -1
  862. package/lib/esm/solid/SweepContour.js +9 -0
  863. package/lib/esm/solid/SweepContour.js.map +1 -1
  864. package/lib/esm/solid/TorusPipe.js.map +1 -1
  865. package/lib/esm/topology/ChainMerge.js +1 -1
  866. package/lib/esm/topology/ChainMerge.js.map +1 -1
  867. package/lib/esm/topology/Graph.js.map +1 -1
  868. package/lib/esm/topology/HalfEdgeGraphFromIndexedLoopsContext.js.map +1 -1
  869. package/lib/esm/topology/HalfEdgeGraphSearch.d.ts.map +1 -1
  870. package/lib/esm/topology/HalfEdgeGraphSearch.js +1 -1
  871. package/lib/esm/topology/HalfEdgeGraphSearch.js.map +1 -1
  872. package/lib/esm/topology/HalfEdgeGraphSpineContext.js +1 -1
  873. package/lib/esm/topology/HalfEdgeGraphSpineContext.js.map +1 -1
  874. package/lib/esm/topology/HalfEdgeGraphValidation.js.map +1 -1
  875. package/lib/esm/topology/HalfEdgeMarkSet.js.map +1 -1
  876. package/lib/esm/topology/HalfEdgeNodeXYZUV.js.map +1 -1
  877. package/lib/esm/topology/HalfEdgePointInGraphSearch.js.map +1 -1
  878. package/lib/esm/topology/HalfEdgePositionDetail.js.map +1 -1
  879. package/lib/esm/topology/HalfEdgePriorityQueue.d.ts.map +1 -1
  880. package/lib/esm/topology/HalfEdgePriorityQueue.js +1 -1
  881. package/lib/esm/topology/HalfEdgePriorityQueue.js.map +1 -1
  882. package/lib/esm/topology/InsertAndRetriangulateContext.js.map +1 -1
  883. package/lib/esm/topology/MaskManager.js.map +1 -1
  884. package/lib/esm/topology/Merging.js.map +1 -1
  885. package/lib/esm/topology/RegularizeFace.js +3 -3
  886. package/lib/esm/topology/RegularizeFace.js.map +1 -1
  887. package/lib/esm/topology/SignedDataSummary.js.map +1 -1
  888. package/lib/esm/topology/SpaceTriangulation.js.map +1 -1
  889. package/lib/esm/topology/Triangulation.js +1 -1
  890. package/lib/esm/topology/Triangulation.js.map +1 -1
  891. package/lib/esm/topology/XYParitySearchContext.js.map +1 -1
  892. package/package.json +6 -17
  893. package/lib/cjs/curve/ChainCollectorContext.d.ts.map +0 -1
  894. package/lib/cjs/curve/ChainCollectorContext.js.map +0 -1
  895. package/lib/esm/curve/ChainCollectorContext.d.ts.map +0 -1
  896. package/lib/esm/curve/ChainCollectorContext.js.map +0 -1
@@ -11,41 +11,42 @@ import { Geometry } from "../Geometry";
11
11
  import { SmallSystem } from "../numerics/Polynomials";
12
12
  import { Plane3dByOriginAndVectors } from "./Plane3dByOriginAndVectors";
13
13
  import { Point3d } from "./Point3dVector3d";
14
+ // cspell:word uparrow, rightarrow
14
15
  /**
15
- * * A Bilinear patch is defined by its 4 corner points.
16
- * * the corner points do not have to be coplanar
17
- *
18
- * * v direction (up)
19
- * |
20
- * |
21
- * |
22
- * point01---A1-----------point11
23
- * | | |
24
- * B0----X------------B1
25
- * | | |
26
- * point00--A0-----------point10 -----------> u direction
27
- *
28
- * * To evaluate aa point at (u,v), the following are equivalent:
29
- * * interpolate with u to get both A0 and A1, viz
16
+ * A bilinear patch is a surface defined by its 4 corner points.
17
+ * * The corner points do not have to be coplanar, but if they are, the quadrilateral should be convex to avoid a self-intersecting surface.
18
+ * ```
19
+ * equation
20
+ * \begin{matrix}
21
+ * v\text{-direction}\\
22
+ * \uparrow\\
23
+ * \text{point01} &\cdots &\text{A1} &\cdots &\text{point11}\\
24
+ * \vdots &&\vdots &&\vdots\\
25
+ * \text{B0} &\cdots &\text{X} &\cdots &\text{B1}\\
26
+ * \vdots &&\vdots &&\vdots\\
27
+ * \text{point00} &\cdots &\text{A0} &\cdots &\text{point10} &\rightarrow~u\text{-direction}
28
+ * \end{matrix}
29
+ * ```
30
+ * * To evaluate the point at (u,v), the following are equivalent:
31
+ * * interpolate first with u then with v:
30
32
  * * A0 = interpolate between point00 and point10 at fraction u
31
33
  * * A1 = interpolate between point01 and point11 at fraction u
32
34
  * * X = interpolate between A0 and A1 at fraction v
33
- * * interpolate first with v to get B0 and B1, viz
35
+ * * interpolate first with v then with u:
34
36
  * * B0 = interpolate between point00 and point01 at fraction v
35
37
  * * B1 = interpolate between point10 and point11 at fraction v
36
38
  * * X = interpolate between B0 and B1 at fraction u
37
- * * sum all at once as
38
- * * X = (1-u)* (1-v) *point00 + (1-u)*v * point01 + u * (1-v) *point10 + u* v * point11
39
- *
40
- * @internal
39
+ * * sum all at once:
40
+ * * X = (1-u)(1-v)point00 + (1-u)(v)point01 + (u)(1-v)point10 + (u)(v)point11
41
+ * @public
41
42
  */
42
43
  export class BilinearPatch {
43
44
  /**
44
- * Capture (not clone) corner points, in u direction at v=0, then in same direction at v=1
45
+ * Capture (not clone) corners to create a new BilinearPatch.
45
46
  * @param point00 Point at uv=0,0
46
47
  * @param point10 Point at uv=1,0
47
48
  * @param point10 Point at uv=0,1
48
- * @param point11 Point at uv=11
49
+ * @param point11 Point at uv=1,1
49
50
  */
50
51
  constructor(point00, point10, point01, point11) {
51
52
  this.point00 = point00;
@@ -53,32 +54,32 @@ export class BilinearPatch {
53
54
  this.point01 = point01;
54
55
  this.point11 = point11;
55
56
  }
56
- /** clone (not capture) corners to create a new BilinearPatch
57
+ /**
58
+ * Clone (not capture) corners to create a new BilinearPatch.
57
59
  * @param point00 Point at uv=0,0
58
60
  * @param point10 Point at uv=1,0
59
61
  * @param point10 Point at uv=0,1
60
- * @param point11 Point at uv=11
62
+ * @param point11 Point at uv=1,1
61
63
  */
62
64
  static create(point00, point10, point01, point11) {
63
65
  return new BilinearPatch(point00.clone(), point10.clone(), point01.clone(), point11.clone());
64
66
  }
65
- /** create a patch with from xyz values of the 4 corners
66
- */
67
+ /** Create a patch from xyz values of the 4 corners. */
67
68
  static createXYZ(x00, y00, z00, x10, y10, z10, x01, y01, z01, x11, y11, z11) {
68
69
  return new BilinearPatch(Point3d.create(x00, y00, z00), Point3d.create(x10, y10, z10), Point3d.create(x01, y01, z01), Point3d.create(x11, y11, z11));
69
70
  }
70
- /** return a clone with same coordinates */
71
+ /** Return a cloned patch. */
71
72
  clone() {
72
73
  return new BilinearPatch(this.point00.clone(), this.point10.clone(), this.point01.clone(), this.point11.clone());
73
74
  }
74
- /** test equality of the 4 points */
75
+ /** Test equality of the 4 points. */
75
76
  isAlmostEqual(other) {
76
77
  return this.point00.isAlmostEqual(other.point00)
77
78
  && this.point10.isAlmostEqual(other.point10)
78
79
  && this.point01.isAlmostEqual(other.point01)
79
80
  && this.point11.isAlmostEqual(other.point11);
80
81
  }
81
- /** Apply the transform to each point */
82
+ /** Apply the transform to each point. */
82
83
  tryTransformInPlace(transform) {
83
84
  transform.multiplyPoint3d(this.point00, this.point00);
84
85
  transform.multiplyPoint3d(this.point10, this.point10);
@@ -86,17 +87,13 @@ export class BilinearPatch {
86
87
  transform.multiplyPoint3d(this.point11, this.point11);
87
88
  return true;
88
89
  }
89
- /**
90
- * return a cloned and transformed patch.
91
- * @param transform
92
- */
90
+ /** Return a cloned and transformed patch. */
93
91
  cloneTransformed(transform) {
94
92
  const result = this.clone();
95
93
  result.tryTransformInPlace(transform);
96
94
  return result;
97
95
  }
98
- /** Extend a range by the range of the(optionally transformed) patch
99
- */
96
+ /** Extend a range by the range of the (optionally transformed) patch. */
100
97
  extendRange(range, transform) {
101
98
  if (transform) {
102
99
  range.extendTransformedPoint(transform, this.point00);
@@ -111,9 +108,11 @@ export class BilinearPatch {
111
108
  range.extendPoint(this.point11);
112
109
  }
113
110
  }
114
- /** Evaluate as a uv surface
115
- * @param u fractional position in minor (phi)
116
- * @param v fractional position on major (theta) arc
111
+ /**
112
+ * Convert fractional u and v coordinates to surface point
113
+ * @param u fractional coordinate in u direction
114
+ * @param v fractional coordinate in v direction
115
+ * @param result optional pre-allocated point
117
116
  */
118
117
  uvFractionToPoint(u, v, result) {
119
118
  const f00 = (1.0 - u) * (1.0 - v);
@@ -123,8 +122,9 @@ export class BilinearPatch {
123
122
  return Point3d.create(f00 * this.point00.x + f10 * this.point10.x + f01 * this.point01.x + f11 * this.point11.x, f00 * this.point00.y + f10 * this.point10.y + f01 * this.point01.y + f11 * this.point11.y, f00 * this.point00.z + f10 * this.point10.z + f01 * this.point01.z + f11 * this.point11.z, result);
124
123
  }
125
124
  /** Evaluate as a uv surface, returning point and two derivative vectors.
126
- * @param u fractional position
127
- * @param v fractional position
125
+ * @param u fractional coordinate in u direction
126
+ * @param v fractional coordinate in v direction
127
+ * @param result optional pre-allocated carrier for point and vectors
128
128
  */
129
129
  uvFractionToPointAndTangents(u, v, result) {
130
130
  const u0 = 1.0 - u;
@@ -139,7 +139,7 @@ export class BilinearPatch {
139
139
  // v derivative ..
140
140
  u0 * (this.point01.x - this.point00.x) + u * (this.point11.x - this.point10.x), u0 * (this.point01.y - this.point00.y) + u * (this.point11.y - this.point10.y), u0 * (this.point01.z - this.point00.z) + u * (this.point11.z - this.point10.z), result);
141
141
  }
142
- /** if data[ib][pivotColumn] is larger (abs) than data[ia][pivotColumn] swap the iA and iB arrays */
142
+ /** If data[iB][pivotColumn] is larger in absolute value than data[iA][pivotColumn], then swap rows iA and iB. */
143
143
  static conditionalPivot(pivotColumn, data, iA, iB) {
144
144
  if (Math.abs(data[iB][pivotColumn]) > Math.abs(data[iA][pivotColumn])) {
145
145
  const q = data[iA];
@@ -148,7 +148,7 @@ export class BilinearPatch {
148
148
  }
149
149
  }
150
150
  /**
151
- * Compute the (points of) intersection with a ray.
151
+ * Compute the points of intersection with a ray.
152
152
  * @param ray ray in space
153
153
  * @returns 1 or 2 points if there are intersections, undefined if no intersections
154
154
  */
@@ -157,17 +157,17 @@ export class BilinearPatch {
157
157
  const vectorV = this.point01.minus(this.point00);
158
158
  const vectorW = this.point11.minus(this.point10);
159
159
  vectorW.subtractInPlace(vectorV);
160
- // coefficients of (each component of)
161
- // `ray.origin + t * ray.direction = point00 + u * vectorU + v * vectorV + u*v*vectorW`
162
- // for x as typical direction as x, the scalar equation with coefficient order for arrays is
163
- // `0 = -ray.origin.x * t + (point00.x - ray.origin.x) + u * vectorU.x + v * vectorV.x + u * v * vectorW.x`
164
- // (and that particular equation is invoked to isolate t when uv is known)
160
+ // We seek t, u, v such that:
161
+ // `ray.origin + t*ray.direction = point00 + u*vectorU + v*vectorV + u*v*vectorW`
162
+ // For typical direction as x, the scalar equation with coefficient order for arrays is:
163
+ // `0 = -t*ray.direction.x + (point00.x - ray.origin.x) + u*vectorU.x + v*vectorV.x + u*v*vectorW.x`
164
+ // and this particular equation is invoked to compute t when u and v are known.
165
165
  const coffs = [
166
166
  new Float64Array([-ray.direction.x, this.point00.x - ray.origin.x, vectorU.x, vectorV.x, vectorW.x]),
167
167
  new Float64Array([-ray.direction.y, this.point00.y - ray.origin.y, vectorU.y, vectorV.y, vectorW.y]),
168
- new Float64Array([-ray.direction.z, this.point00.z - ray.origin.z, vectorU.z, vectorV.z, vectorW.z])
168
+ new Float64Array([-ray.direction.z, this.point00.z - ray.origin.z, vectorU.z, vectorV.z, vectorW.z]),
169
169
  ];
170
- // bring the largest ray.direction coefficient to the 0 equation.
170
+ // swap rows so that the equation with largest ray.direction coefficient is first.
171
171
  BilinearPatch.conditionalPivot(0, coffs, 0, 1);
172
172
  BilinearPatch.conditionalPivot(0, coffs, 0, 2);
173
173
  SmallSystem.eliminateFromPivot(coffs[0], 0, coffs[1], -1.0);
@@ -184,15 +184,11 @@ export class BilinearPatch {
184
184
  }
185
185
  return undefined;
186
186
  }
187
- /**
188
- * Returns the larger of the u-direction edge lengths at v=0 and v=1
189
- */
187
+ /** Returns the larger of the u-direction edge lengths at v=0 and v=1. */
190
188
  maxUEdgeLength() {
191
189
  return Geometry.maxXY(this.point00.distance(this.point10), this.point01.distance(this.point11));
192
190
  }
193
- /**
194
- * Returns the larger of the v-direction edge lengths at u=0 and u=1
195
- */
191
+ /** Returns the larger of the v-direction edge lengths at u=0 and u=1. */
196
192
  maxVEdgeLength() {
197
193
  return Geometry.maxXY(this.point00.distance(this.point01), this.point10.distance(this.point11));
198
194
  }
@@ -1 +1 @@
1
- {"version":3,"file":"BilinearPatch.js","sourceRoot":"","sources":["../../../src/geometry3d/BilinearPatch.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F;;GAEG;AAEH,OAAO,EAAE,6BAA6B,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAC1G,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,WAA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O,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;IAClG,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\n/** @packageDocumentation\r\n * @module Solid\r\n */\r\n\r\nimport { CurveAndSurfaceLocationDetail, UVSurfaceLocationDetail } from \"../bspline/SurfaceLocationDetail\";\r\nimport { CurveLocationDetail } from \"../curve/CurveLocationDetail\";\r\nimport { Geometry } from \"../Geometry\";\r\nimport { SmallSystem } from \"../numerics/Polynomials\";\r\nimport { UVSurface } from \"./GeometryHandler\";\r\nimport { Plane3dByOriginAndVectors } from \"./Plane3dByOriginAndVectors\";\r\nimport { Point3d } from \"./Point3dVector3d\";\r\nimport { Range3d } from \"./Range\";\r\nimport { Ray3d } from \"./Ray3d\";\r\nimport { Transform } from \"./Transform\";\r\n\r\n/**\r\n * * A Bilinear patch is defined by its 4 corner points.\r\n * * the corner points do not have to be coplanar\r\n *\r\n * * v direction (up)\r\n * |\r\n * |\r\n * |\r\n * point01---A1-----------point11\r\n * | | |\r\n * B0----X------------B1\r\n * | | |\r\n * point00--A0-----------point10 -----------> u direction\r\n *\r\n * * To evaluate aa point at (u,v), the following are equivalent:\r\n * * interpolate with u to get both A0 and A1, viz\r\n * * A0 = interpolate between point00 and point10 at fraction u\r\n * * A1 = interpolate between point01 and point11 at fraction u\r\n * * X = interpolate between A0 and A1 at fraction v\r\n * * interpolate first with v to get B0 and B1, viz\r\n * * B0 = interpolate between point00 and point01 at fraction v\r\n * * B1 = interpolate between point10 and point11 at fraction v\r\n * * X = interpolate between B0 and B1 at fraction u\r\n * * sum all at once as\r\n * * X = (1-u)* (1-v) *point00 + (1-u)*v * point01 + u * (1-v) *point10 + u* v * point11\r\n *\r\n * @internal\r\n */\r\nexport class BilinearPatch implements UVSurface {\r\n /** corner at parametric coordinate (0,0) */\r\n public point00: Point3d;\r\n /** corner at parametric coordinate (1,0) */\r\n public point10: Point3d;\r\n /** corner at parametric coordinate (0,1) */\r\n public point01: Point3d;\r\n /** corner at parametric coordinate (1,1) */\r\n public point11: Point3d;\r\n /**\r\n * Capture (not clone) corner points, in u direction at v=0, then in same direction at v=1\r\n * @param point00 Point at uv=0,0\r\n * @param point10 Point at uv=1,0\r\n * @param point10 Point at uv=0,1\r\n * @param point11 Point at uv=11\r\n */\r\n public constructor(point00: Point3d, point10: Point3d, point01: Point3d, point11: Point3d) {\r\n this.point00 = point00;\r\n this.point10 = point10;\r\n this.point01 = point01;\r\n this.point11 = point11;\r\n }\r\n /** clone (not capture) corners to create a new BilinearPatch\r\n * @param point00 Point at uv=0,0\r\n * @param point10 Point at uv=1,0\r\n * @param point10 Point at uv=0,1\r\n * @param point11 Point at uv=11\r\n */\r\n public static create(point00: Point3d, point10: Point3d, point01: Point3d, point11: Point3d) {\r\n return new BilinearPatch(point00.clone(), point10.clone(), point01.clone(), point11.clone());\r\n }\r\n\r\n /** create a patch with from xyz values of the 4 corners\r\n */\r\n public static createXYZ(x00: number, y00: number, z00: number,\r\n x10: number, y10: number, z10: number,\r\n x01: number, y01: number, z01: number,\r\n x11: number, y11: number, z11: number) {\r\n return new BilinearPatch(Point3d.create(x00, y00, z00),\r\n Point3d.create(x10, y10, z10),\r\n Point3d.create(x01, y01, z01),\r\n Point3d.create(x11, y11, z11));\r\n }\r\n\r\n /** return a clone with same coordinates */\r\n public clone(): BilinearPatch {\r\n return new BilinearPatch(\r\n this.point00.clone(),\r\n this.point10.clone(),\r\n this.point01.clone(),\r\n this.point11.clone());\r\n }\r\n /** test equality of the 4 points */\r\n public isAlmostEqual(other: BilinearPatch): boolean {\r\n return this.point00.isAlmostEqual(other.point00)\r\n && this.point10.isAlmostEqual(other.point10)\r\n && this.point01.isAlmostEqual(other.point01)\r\n && this.point11.isAlmostEqual(other.point11);\r\n }\r\n /** Apply the transform to each point */\r\n public tryTransformInPlace(transform: Transform): boolean {\r\n transform.multiplyPoint3d(this.point00, this.point00);\r\n transform.multiplyPoint3d(this.point10, this.point10);\r\n transform.multiplyPoint3d(this.point01, this.point01);\r\n transform.multiplyPoint3d(this.point11, this.point11);\r\n return true;\r\n }\r\n /**\r\n * return a cloned and transformed patch.\r\n * @param transform\r\n */\r\n public cloneTransformed(transform: Transform): BilinearPatch | undefined {\r\n const result = this.clone();\r\n result.tryTransformInPlace(transform);\r\n return result;\r\n }\r\n /** Extend a range by the range of the(optionally transformed) patch\r\n */\r\n public extendRange(range: Range3d, transform?: Transform) {\r\n if (transform) {\r\n range.extendTransformedPoint(transform, this.point00);\r\n range.extendTransformedPoint(transform, this.point10);\r\n range.extendTransformedPoint(transform, this.point01);\r\n range.extendTransformedPoint(transform, this.point11);\r\n } else {\r\n range.extendPoint(this.point00);\r\n range.extendPoint(this.point10);\r\n range.extendPoint(this.point01);\r\n range.extendPoint(this.point11);\r\n }\r\n }\r\n /** Evaluate as a uv surface\r\n * @param u fractional position in minor (phi)\r\n * @param v fractional position on major (theta) arc\r\n */\r\n public uvFractionToPoint(u: number, v: number, result?: Point3d): Point3d {\r\n const f00 = (1.0 - u) * (1.0 - v);\r\n const f10 = u * (1.0 - v);\r\n const f01 = (1.0 - u) * v;\r\n const f11 = u * v;\r\n return Point3d.create(\r\n f00 * this.point00.x + f10 * this.point10.x + f01 * this.point01.x + f11 * this.point11.x,\r\n f00 * this.point00.y + f10 * this.point10.y + f01 * this.point01.y + f11 * this.point11.y,\r\n f00 * this.point00.z + f10 * this.point10.z + f01 * this.point01.z + f11 * this.point11.z,\r\n result);\r\n }\r\n /** Evaluate as a uv surface, returning point and two derivative vectors.\r\n * @param u fractional position\r\n * @param v fractional position\r\n */\r\n public uvFractionToPointAndTangents(u: number, v: number, result?: Plane3dByOriginAndVectors): Plane3dByOriginAndVectors {\r\n const u0 = 1.0 - u;\r\n const v0 = 1.0 - v;\r\n const f00 = u0 * v0;\r\n const f10 = u * v0;\r\n const f01 = u0 * v;\r\n const f11 = u * v;\r\n return Plane3dByOriginAndVectors.createOriginAndVectorsXYZ(\r\n f00 * this.point00.x + f10 * this.point10.x + f01 * this.point01.x + f11 * this.point11.x,\r\n f00 * this.point00.y + f10 * this.point10.y + f01 * this.point01.y + f11 * this.point11.y,\r\n f00 * this.point00.z + f10 * this.point10.z + f01 * this.point01.z + f11 * this.point11.z,\r\n // u derivative ..\r\n v0 * (this.point10.x - this.point00.x) + v * (this.point11.x - this.point01.x),\r\n v0 * (this.point10.y - this.point00.y) + v * (this.point11.y - this.point01.y),\r\n v0 * (this.point10.z - this.point00.z) + v * (this.point11.z - this.point01.z),\r\n // v derivative ..\r\n u0 * (this.point01.x - this.point00.x) + u * (this.point11.x - this.point10.x),\r\n u0 * (this.point01.y - this.point00.y) + u * (this.point11.y - this.point10.y),\r\n u0 * (this.point01.z - this.point00.z) + u * (this.point11.z - this.point10.z),\r\n result);\r\n }\r\n /** if data[ib][pivotColumn] is larger (abs) than data[ia][pivotColumn] swap the iA and iB arrays */\r\n private static conditionalPivot(pivotColumn: number, data: Float64Array[], iA: number, iB: number) {\r\n if (Math.abs(data[iB][pivotColumn]) > Math.abs(data[iA][pivotColumn])) {\r\n const q = data[iA];\r\n data[iA] = data[iB];\r\n data[iB] = q;\r\n }\r\n }\r\n /**\r\n * Compute the (points of) intersection with a ray.\r\n * @param ray ray in space\r\n * @returns 1 or 2 points if there are intersections, undefined if no intersections\r\n */\r\n public intersectRay(ray: Ray3d): CurveAndSurfaceLocationDetail[] | undefined {\r\n const vectorU = this.point10.minus(this.point00);\r\n const vectorV = this.point01.minus(this.point00);\r\n const vectorW = this.point11.minus(this.point10);\r\n vectorW.subtractInPlace(vectorV);\r\n // coefficients of (each component of)\r\n // `ray.origin + t * ray.direction = point00 + u * vectorU + v * vectorV + u*v*vectorW`\r\n // for x as typical direction as x, the scalar equation with coefficient order for arrays is\r\n // `0 = -ray.origin.x * t + (point00.x - ray.origin.x) + u * vectorU.x + v * vectorV.x + u * v * vectorW.x`\r\n // (and that particular equation is invoked to isolate t when uv is known)\r\n const coffs = [\r\n new Float64Array([-ray.direction.x, this.point00.x - ray.origin.x, vectorU.x, vectorV.x, vectorW.x]),\r\n new Float64Array([-ray.direction.y, this.point00.y - ray.origin.y, vectorU.y, vectorV.y, vectorW.y]),\r\n new Float64Array([-ray.direction.z, this.point00.z - ray.origin.z, vectorU.z, vectorV.z, vectorW.z])];\r\n // bring the largest ray.direction coefficient to the 0 equation.\r\n BilinearPatch.conditionalPivot(0, coffs, 0, 1);\r\n BilinearPatch.conditionalPivot(0, coffs, 0, 2);\r\n SmallSystem.eliminateFromPivot(coffs[0], 0, coffs[1], -1.0);\r\n SmallSystem.eliminateFromPivot(coffs[0], 0, coffs[2], -1.0);\r\n const uvArray = SmallSystem.solveBilinearPair(\r\n coffs[1][1], coffs[1][2], coffs[1][3], coffs[1][4],\r\n coffs[2][1], coffs[2][2], coffs[2][3], coffs[2][4]);\r\n if (uvArray) {\r\n const result: CurveAndSurfaceLocationDetail[] = [];\r\n for (const uv of uvArray) {\r\n const t = -(coffs[0][1] + coffs[0][2] * uv.x + (coffs[0][3] + coffs[0][4] * uv.x) * uv.y) / coffs[0][0];\r\n const point = ray.fractionToPoint(t);\r\n result.push(new CurveAndSurfaceLocationDetail(\r\n CurveLocationDetail.createRayFractionPoint(ray, t, point),\r\n UVSurfaceLocationDetail.createSurfaceUVPoint(this, uv, point)));\r\n }\r\n return result;\r\n }\r\n return undefined;\r\n }\r\n /**\r\n * Returns the larger of the u-direction edge lengths at v=0 and v=1\r\n */\r\n public maxUEdgeLength(): number {\r\n return Geometry.maxXY(this.point00.distance(this.point10), this.point01.distance(this.point11));\r\n }\r\n /**\r\n * Returns the larger of the v-direction edge lengths at u=0 and u=1\r\n */\r\n public maxVEdgeLength(): number {\r\n return Geometry.maxXY(this.point00.distance(this.point01), this.point10.distance(this.point11));\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"BilinearPatch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KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;IAClG,CAAC;IACD,yEAAyE;IAClE,cAAc;QACnB,OAAO,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;IAClG,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\n/** @packageDocumentation\n * @module Solid\n */\n\nimport { CurveAndSurfaceLocationDetail, UVSurfaceLocationDetail } from \"../bspline/SurfaceLocationDetail\";\nimport { CurveLocationDetail } from \"../curve/CurveLocationDetail\";\nimport { Geometry } from \"../Geometry\";\nimport { SmallSystem } from \"../numerics/Polynomials\";\nimport { UVSurface } from \"./GeometryHandler\";\nimport { Plane3dByOriginAndVectors } from \"./Plane3dByOriginAndVectors\";\nimport { Point3d } from \"./Point3dVector3d\";\nimport { Range3d } from \"./Range\";\nimport { Ray3d } from \"./Ray3d\";\nimport { Transform } from \"./Transform\";\n\n// cspell:word uparrow, rightarrow\n\n/**\n * A bilinear patch is a surface defined by its 4 corner points.\n * * The corner points do not have to be coplanar, but if they are, the quadrilateral should be convex to avoid a self-intersecting surface.\n * ```\n * equation\n * \\begin{matrix}\n * v\\text{-direction}\\\\\n * \\uparrow\\\\\n * \\text{point01} &\\cdots &\\text{A1} &\\cdots &\\text{point11}\\\\\n * \\vdots &&\\vdots &&\\vdots\\\\\n * \\text{B0} &\\cdots &\\text{X} &\\cdots &\\text{B1}\\\\\n * \\vdots &&\\vdots &&\\vdots\\\\\n * \\text{point00} &\\cdots &\\text{A0} &\\cdots &\\text{point10} &\\rightarrow~u\\text{-direction}\n * \\end{matrix}\n * ```\n * * To evaluate the point at (u,v), the following are equivalent:\n * * interpolate first with u then with v:\n * * A0 = interpolate between point00 and point10 at fraction u\n * * A1 = interpolate between point01 and point11 at fraction u\n * * X = interpolate between A0 and A1 at fraction v\n * * interpolate first with v then with u:\n * * B0 = interpolate between point00 and point01 at fraction v\n * * B1 = interpolate between point10 and point11 at fraction v\n * * X = interpolate between B0 and B1 at fraction u\n * * sum all at once:\n * * X = (1-u)(1-v)point00 + (1-u)(v)point01 + (u)(1-v)point10 + (u)(v)point11\n * @public\n */\nexport class BilinearPatch implements UVSurface {\n /** corner at parametric coordinate (0,0) */\n public point00: Point3d;\n /** corner at parametric coordinate (1,0) */\n public point10: Point3d;\n /** corner at parametric coordinate (0,1) */\n public point01: Point3d;\n /** corner at parametric coordinate (1,1) */\n public point11: Point3d;\n /**\n * Capture (not clone) corners to create a new BilinearPatch.\n * @param point00 Point at uv=0,0\n * @param point10 Point at uv=1,0\n * @param point10 Point at uv=0,1\n * @param point11 Point at uv=1,1\n */\n public constructor(point00: Point3d, point10: Point3d, point01: Point3d, point11: Point3d) {\n this.point00 = point00;\n this.point10 = point10;\n this.point01 = point01;\n this.point11 = point11;\n }\n /**\n * Clone (not capture) corners to create a new BilinearPatch.\n * @param point00 Point at uv=0,0\n * @param point10 Point at uv=1,0\n * @param point10 Point at uv=0,1\n * @param point11 Point at uv=1,1\n */\n public static create(point00: Point3d, point10: Point3d, point01: Point3d, point11: Point3d) {\n return new BilinearPatch(point00.clone(), point10.clone(), point01.clone(), point11.clone());\n }\n /** Create a patch from xyz values of the 4 corners. */\n public static createXYZ(\n x00: number, y00: number, z00: number,\n x10: number, y10: number, z10: number,\n x01: number, y01: number, z01: number,\n x11: number, y11: number, z11: number,\n ) {\n return new BilinearPatch(\n Point3d.create(x00, y00, z00),\n Point3d.create(x10, y10, z10),\n Point3d.create(x01, y01, z01),\n Point3d.create(x11, y11, z11),\n );\n }\n /** Return a cloned patch. */\n public clone(): BilinearPatch {\n return new BilinearPatch(\n this.point00.clone(),\n this.point10.clone(),\n this.point01.clone(),\n this.point11.clone(),\n );\n }\n /** Test equality of the 4 points. */\n public isAlmostEqual(other: BilinearPatch): boolean {\n return this.point00.isAlmostEqual(other.point00)\n && this.point10.isAlmostEqual(other.point10)\n && this.point01.isAlmostEqual(other.point01)\n && this.point11.isAlmostEqual(other.point11);\n }\n /** Apply the transform to each point. */\n public tryTransformInPlace(transform: Transform): boolean {\n transform.multiplyPoint3d(this.point00, this.point00);\n transform.multiplyPoint3d(this.point10, this.point10);\n transform.multiplyPoint3d(this.point01, this.point01);\n transform.multiplyPoint3d(this.point11, this.point11);\n return true;\n }\n /** Return a cloned and transformed patch. */\n public cloneTransformed(transform: Transform): BilinearPatch | undefined {\n const result = this.clone();\n result.tryTransformInPlace(transform);\n return result;\n }\n /** Extend a range by the range of the (optionally transformed) patch. */\n public extendRange(range: Range3d, transform?: Transform) {\n if (transform) {\n range.extendTransformedPoint(transform, this.point00);\n range.extendTransformedPoint(transform, this.point10);\n range.extendTransformedPoint(transform, this.point01);\n range.extendTransformedPoint(transform, this.point11);\n } else {\n range.extendPoint(this.point00);\n range.extendPoint(this.point10);\n range.extendPoint(this.point01);\n range.extendPoint(this.point11);\n }\n }\n /**\n * Convert fractional u and v coordinates to surface point\n * @param u fractional coordinate in u direction\n * @param v fractional coordinate in v direction\n * @param result optional pre-allocated point\n */\n public uvFractionToPoint(u: number, v: number, result?: Point3d): Point3d {\n const f00 = (1.0 - u) * (1.0 - v);\n const f10 = u * (1.0 - v);\n const f01 = (1.0 - u) * v;\n const f11 = u * v;\n return Point3d.create(\n f00 * this.point00.x + f10 * this.point10.x + f01 * this.point01.x + f11 * this.point11.x,\n f00 * this.point00.y + f10 * this.point10.y + f01 * this.point01.y + f11 * this.point11.y,\n f00 * this.point00.z + f10 * this.point10.z + f01 * this.point01.z + f11 * this.point11.z,\n result,\n );\n }\n /** Evaluate as a uv surface, returning point and two derivative vectors.\n * @param u fractional coordinate in u direction\n * @param v fractional coordinate in v direction\n * @param result optional pre-allocated carrier for point and vectors\n */\n public uvFractionToPointAndTangents(u: number, v: number, result?: Plane3dByOriginAndVectors): Plane3dByOriginAndVectors {\n const u0 = 1.0 - u;\n const v0 = 1.0 - v;\n const f00 = u0 * v0;\n const f10 = u * v0;\n const f01 = u0 * v;\n const f11 = u * v;\n return Plane3dByOriginAndVectors.createOriginAndVectorsXYZ(\n f00 * this.point00.x + f10 * this.point10.x + f01 * this.point01.x + f11 * this.point11.x,\n f00 * this.point00.y + f10 * this.point10.y + f01 * this.point01.y + f11 * this.point11.y,\n f00 * this.point00.z + f10 * this.point10.z + f01 * this.point01.z + f11 * this.point11.z,\n // u derivative ..\n v0 * (this.point10.x - this.point00.x) + v * (this.point11.x - this.point01.x),\n v0 * (this.point10.y - this.point00.y) + v * (this.point11.y - this.point01.y),\n v0 * (this.point10.z - this.point00.z) + v * (this.point11.z - this.point01.z),\n // v derivative ..\n u0 * (this.point01.x - this.point00.x) + u * (this.point11.x - this.point10.x),\n u0 * (this.point01.y - this.point00.y) + u * (this.point11.y - this.point10.y),\n u0 * (this.point01.z - this.point00.z) + u * (this.point11.z - this.point10.z),\n result,\n );\n }\n /** If data[iB][pivotColumn] is larger in absolute value than data[iA][pivotColumn], then swap rows iA and iB. */\n private static conditionalPivot(pivotColumn: number, data: Float64Array[], iA: number, iB: number) {\n if (Math.abs(data[iB][pivotColumn]) > Math.abs(data[iA][pivotColumn])) {\n const q = data[iA];\n data[iA] = data[iB];\n data[iB] = q;\n }\n }\n /**\n * Compute the points of intersection with a ray.\n * @param ray ray in space\n * @returns 1 or 2 points if there are intersections, undefined if no intersections\n */\n public intersectRay(ray: Ray3d): CurveAndSurfaceLocationDetail[] | undefined {\n const vectorU = this.point10.minus(this.point00);\n const vectorV = this.point01.minus(this.point00);\n const vectorW = this.point11.minus(this.point10);\n vectorW.subtractInPlace(vectorV);\n // We seek t, u, v such that:\n // `ray.origin + t*ray.direction = point00 + u*vectorU + v*vectorV + u*v*vectorW`\n // For typical direction as x, the scalar equation with coefficient order for arrays is:\n // `0 = -t*ray.direction.x + (point00.x - ray.origin.x) + u*vectorU.x + v*vectorV.x + u*v*vectorW.x`\n // and this particular equation is invoked to compute t when u and v are known.\n const coffs = [\n new Float64Array([-ray.direction.x, this.point00.x - ray.origin.x, vectorU.x, vectorV.x, vectorW.x]),\n new Float64Array([-ray.direction.y, this.point00.y - ray.origin.y, vectorU.y, vectorV.y, vectorW.y]),\n new Float64Array([-ray.direction.z, this.point00.z - ray.origin.z, vectorU.z, vectorV.z, vectorW.z]),\n ];\n // swap rows so that the equation with largest ray.direction coefficient is first.\n BilinearPatch.conditionalPivot(0, coffs, 0, 1);\n BilinearPatch.conditionalPivot(0, coffs, 0, 2);\n SmallSystem.eliminateFromPivot(coffs[0], 0, coffs[1], -1.0);\n SmallSystem.eliminateFromPivot(coffs[0], 0, coffs[2], -1.0);\n const uvArray = SmallSystem.solveBilinearPair(\n coffs[1][1], coffs[1][2], coffs[1][3], coffs[1][4],\n coffs[2][1], coffs[2][2], coffs[2][3], coffs[2][4],\n );\n if (uvArray) {\n const result: CurveAndSurfaceLocationDetail[] = [];\n for (const uv of uvArray) {\n const t = -(coffs[0][1] + coffs[0][2] * uv.x + (coffs[0][3] + coffs[0][4] * uv.x) * uv.y) / coffs[0][0];\n const point = ray.fractionToPoint(t);\n result.push(new CurveAndSurfaceLocationDetail(\n CurveLocationDetail.createRayFractionPoint(ray, t, point),\n UVSurfaceLocationDetail.createSurfaceUVPoint(this, uv, point)),\n );\n }\n return result;\n }\n return undefined;\n }\n /** Returns the larger of the u-direction edge lengths at v=0 and v=1. */\n public maxUEdgeLength(): number {\n return Geometry.maxXY(this.point00.distance(this.point10), this.point01.distance(this.point11));\n }\n /** Returns the larger of the v-direction edge lengths at u=0 and u=1. */\n public maxVEdgeLength(): number {\n return Geometry.maxXY(this.point00.distance(this.point01), this.point10.distance(this.point11));\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"CoincidentGeometryOps.js","sourceRoot":"","sources":["../../../src/geometry3d/CoincidentGeometryOps.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F;;GAEG;AACH,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE7C,OAAO,EAAE,mBAAmB,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AAE5F,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAW,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC;;;;;GAKG;AACH,MAAM,OAAO,uBAAuB;IAMlC,IAAW,SAAS;QAClB,OAAO,IAAI,CAAC,UAAU,CAAC;IACzB,CAAC;IACD,YAAoB,YAAoB,QAAQ,CAAC,mBAAmB;QAClE,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC;IAC9B,CAAC;IACM,MAAM,CAAC,MAAM,CAAC,YAAoB,QAAQ,CAAC,mBAAmB;QACnE,OAAO,IAAI,uBAAuB,CAAC,SAAS,CAAC,CAAC;IAChD,CAAC;IACD;;;OAGG;IACI,MAAM,CAAC,0CAA0C,CAAC,MAA2B,EAAE,EAAU,EAAE,EAAU,EAC1G,MAAe,EAAE,MAAe,EAAE,OAAgB,KAAK;QACvD,IAAI,IAAI,EAAE;YACR,MAAM,CAAC,QAAQ,GAAG,EAAE,CAAC;YACrB,MAAM,CAAC,SAAS,GAAG,EAAE,CAAC;SACvB;aAAM;YACL,MAAM,CAAC,QAAQ,GAAG,EAAE,CAAC;YACrB,MAAM,CAAC,SAAS,GAAG,EAAE,CAAC;SACvB;QACD,MAAM,CAAC,KAAK,GAAG,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,QAAQ,EAAE,MA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AAC,CAAC,EAAE,MAAM,CAAC,CAAC;gCACpG,MAAM,OAAO,GAAG,mBAAmB,CAAC,wBAAwB,CAAC,IAAI,EAAE,eAAe,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC;gCACpG,MAAM,GAAG,IAAI,CAAC,gBAAgB,CAAC,MAAM,EAAE,uBAAuB,CAAC,aAAa,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC;6BACjG;yBACF;wBACD,OAAO,MAAM,KAAK,SAAS,IAAI,MAAM,CAAC,MAAM,GAAG,IAAI,CAAC;oBACtD,CAAC,CAAC;oBAEF,4BAA4B,CAAC,cAAc,EAAE,KAAK,CAAC,CAAC,CAAE,wDAAwD;oBAE9G,yEAAyE;oBACzE,IAAI,UAAU,IAAI,eAAe;wBAC/B,4BAA4B,CAAC,SAAS,CAAC,MAAM,CAAC,UAAU,GAAG,eAAe,EAAE,UAAU,GAAG,eAAe,CAAC,EAAE,IAAI,CAAC,CAAC;yBAC9G,IAAI,UAAU,KAAK,GAAG;wBACzB,4BAA4B,CAAC,SAAS,CAAC,MAAM,CAAC,UAAU,GAAG,eAAe,EAAE,UAAU,GAAG,eAAe,CAAC,EAAE,IAAI,CAAC,CAAC;iBACpH;aACF;SACF;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\n/** @packageDocumentation\r\n * @module CartesianGeometry\r\n */\r\nimport { assert } from \"@itwin/core-bentley\";\r\nimport { Arc3d } from \"../curve/Arc3d\";\r\nimport { CurveLocationDetail, CurveLocationDetailPair } from \"../curve/CurveLocationDetail\";\r\nimport { CurvePrimitive } from \"../curve/CurvePrimitive\";\r\nimport { Geometry } from \"../Geometry\";\r\nimport { AngleSweep } from \"./AngleSweep\";\r\nimport { Point3d, Vector3d } from \"./Point3dVector3d\";\r\nimport { Segment1d } from \"./Segment1d\";\r\n\r\n/**\r\n * `CoincidentGeometryQuery` has methods useful in testing for overlapping geometry.\r\n * * Each instance carries tolerance information that can be reused over extended call sequences.\r\n * * These methods are expected to be called internally by CurveCurve intersection methods.\r\n * @internal\r\n */\r\nexport class CoincidentGeometryQuery {\r\n private _vectorU?: Vector3d;\r\n private _vectorV?: Vector3d;\r\n private _point0?: Point3d;\r\n private _point1?: Point3d;\r\n private _tolerance: number;\r\n public get tolerance(): number {\r\n return this._tolerance;\r\n }\r\n private constructor(tolerance: number = Geometry.smallMetricDistance) {\r\n this._tolerance = tolerance;\r\n }\r\n public static create(tolerance: number = Geometry.smallMetricDistance): CoincidentGeometryQuery {\r\n return new CoincidentGeometryQuery(tolerance);\r\n }\r\n /**\r\n * * Assign both the fraction and fraction1 values in the detail, possibly swapped.\r\n * * reevaluate the points as simple interpolation between given points.\r\n */\r\n public static assignDetailInterpolatedFractionsAndPoints(detail: CurveLocationDetail, f0: number, f1: number,\r\n pointA: Point3d, pointB: Point3d, swap: boolean = false) {\r\n if (swap) {\r\n detail.fraction = f1;\r\n detail.fraction1 = f0;\r\n } else {\r\n detail.fraction = f0;\r\n detail.fraction1 = f1;\r\n }\r\n detail.point = pointA.interpolate(detail.fraction, pointB, detail.point);\r\n detail.point1 = pointA.interpolate(detail.fraction1, pointB, detail.point1);\r\n\r\n }\r\n\r\n /** Return a curve location detail with projection of a `spacePoint` to the line segment with `pointA` and `pointB`\r\n *\r\n */\r\n public projectPointToSegmentXY(spacePoint: Point3d, pointA: Point3d, pointB: Point3d): CurveLocationDetail {\r\n this._vectorU = Vector3d.createStartEnd(pointA, pointB, this._vectorU);\r\n this._vectorV = Vector3d.createStartEnd(pointA, spacePoint, this._vectorV);\r\n const uDotU = this._vectorU.dotProductXY(this._vectorU);\r\n const uDotV = this._vectorU.dotProductXY(this._vectorV);\r\n const fraction = Geometry.safeDivideFraction(uDotV, uDotU, 0.0);\r\n return CurveLocationDetail.createCurveFractionPoint(undefined, fraction,\r\n pointA.interpolate(fraction, pointB));\r\n }\r\n /**\r\n * * project `pointA0` and `pointA1` onto the segment with `pointB0` and `pointB1`\r\n * * In the returned detail pair, the `detailA` has fractions along segmentA, and `detailB` has fractions along segment B\r\n * @param pointA0 start point of segment A\r\n * @param pointA1 end point of segment A\r\n * @param pointB0 start point of segment B\r\n * @param pointB1 end point of segment B\r\n */\r\n public coincidentSegmentRangeXY(pointA0: Point3d, pointA1: Point3d, pointB0: Point3d, pointB1: Point3d, restrictToBounds: boolean = true): CurveLocationDetailPair | undefined {\r\n const detailA0OnB = this.projectPointToSegmentXY(pointA0, pointB0, pointB1);\r\n if (pointA0.distanceXY(detailA0OnB.point) > this._tolerance)\r\n return undefined;\r\n const detailA1OnB = this.projectPointToSegmentXY(pointA1, pointB0, pointB1);\r\n if (pointA1.distanceXY(detailA1OnB.point) > this._tolerance)\r\n return undefined;\r\n\r\n const detailB0OnA = this.projectPointToSegmentXY(pointB0, pointA0, pointA1);\r\n if (pointB0.distanceXY(detailB0OnA.point) > this._tolerance)\r\n return undefined;\r\n const detailB1OnA = this.projectPointToSegmentXY(pointB1, pointA0, pointA1);\r\n if (pointB1.distanceXY(detailB1OnA.point) > this._tolerance)\r\n return undefined;\r\n\r\n detailA0OnB.fraction1 = detailA1OnB.fraction;\r\n detailA0OnB.point1 = detailA1OnB.point; // capture -- detailA1OnB is not reused.\r\n detailB0OnA.fraction1 = detailB1OnA.fraction;\r\n detailB0OnA.point1 = detailB1OnA.point;\r\n if (!restrictToBounds)\r\n return CurveLocationDetailPair.createCapture(detailB0OnA, detailA0OnB);\r\n\r\n const segment = Segment1d.create(detailB0OnA.fraction, detailB0OnA.fraction1);\r\n if (segment.clampDirectedTo01()) {\r\n const f0 = segment.x0;\r\n const f1 = segment.x1;\r\n const h0 = detailB0OnA.inverseInterpolateFraction(f0);\r\n const h1 = detailB0OnA.inverseInterpolateFraction(f1);\r\n // recompute fractions and points..\r\n CoincidentGeometryQuery.assignDetailInterpolatedFractionsAndPoints(detailB0OnA, f0, f1, pointA0, pointA1, f0 > f1);\r\n CoincidentGeometryQuery.assignDetailInterpolatedFractionsAndPoints(detailA0OnB, h0, h1, pointB0, pointB1, h0 > h1);\r\n return CurveLocationDetailPair.createCapture(detailB0OnA, detailA0OnB);\r\n } else {\r\n if (segment.signedDelta() < 0.0) {\r\n if (detailB0OnA.point.isAlmostEqual(pointA0, this.tolerance)) {\r\n detailB0OnA.collapseToStart();\r\n detailA0OnB.collapseToStart();\r\n return CurveLocationDetailPair.createCapture(detailB0OnA, detailA0OnB);\r\n }\r\n if (detailB0OnA.point1.isAlmostEqual(pointA1, this.tolerance)) {\r\n detailB0OnA.collapseToEnd();\r\n detailA0OnB.collapseToEnd();\r\n return CurveLocationDetailPair.createCapture(detailB0OnA, detailA0OnB);\r\n }\r\n } else {\r\n if (detailB0OnA.point.isAlmostEqual(pointA1, this.tolerance)) {\r\n detailB0OnA.collapseToStart();\r\n detailA0OnB.collapseToEnd();\r\n return CurveLocationDetailPair.createCapture(detailB0OnA, detailA0OnB);\r\n }\r\n if (detailB0OnA.point1.isAlmostEqual(pointA0, this.tolerance)) {\r\n detailB0OnA.collapseToEnd();\r\n detailA0OnB.collapseToStart();\r\n return CurveLocationDetailPair.createCapture(detailB0OnA, detailA0OnB);\r\n }\r\n }\r\n }\r\n return undefined;\r\n }\r\n /**\r\n * Create a CurveLocationDetailPair for a coincident interval of two overlapping curves\r\n * @param cpA curveA\r\n * @param cpB curveB\r\n * @param fractionsOnA coincident interval of curveB in fraction space of curveA\r\n * @param fractionB0 curveB start in fraction space of curveA\r\n * @param fractionB1 curveB end in fraction space of curveA\r\n * @param reverse whether curveB and curveA have opposite direction\r\n */\r\n private createDetailPair(cpA: CurvePrimitive, cpB: CurvePrimitive, fractionsOnA: Segment1d, fractionB0: number, fractionB1: number, reverse: boolean): CurveLocationDetailPair | undefined {\r\n const deltaB = fractionB1 - fractionB0;\r\n const g0 = Geometry.conditionalDivideFraction(fractionsOnA.x0 - fractionB0, deltaB);\r\n const g1 = Geometry.conditionalDivideFraction(fractionsOnA.x1 - fractionB0, deltaB);\r\n if (g0 !== undefined && g1 !== undefined) {\r\n const detailA = CurveLocationDetail.createCurveEvaluatedFractionFraction(cpA, fractionsOnA.x0, fractionsOnA.x1);\r\n const detailB = CurveLocationDetail.createCurveEvaluatedFractionFraction(cpB, g0, g1);\r\n if (reverse)\r\n detailA.swapFractionsAndPoints();\r\n return CurveLocationDetailPair.createCapture(detailA, detailB);\r\n }\r\n return undefined;\r\n }\r\n private appendDetailPair(result: CurveLocationDetailPair[] | undefined, pair: CurveLocationDetailPair | undefined): CurveLocationDetailPair[] | undefined {\r\n if (pair === undefined)\r\n return result;\r\n if (result === undefined)\r\n return [pair];\r\n result.push(pair);\r\n return result;\r\n }\r\n /**\r\n * Test if 2 arcs have coinciding portions.\r\n * @param arcA\r\n * @param arcB\r\n * @param _restrictToBounds\r\n * @return 0, 1, or 2 overlap points/intervals\r\n */\r\n public coincidentArcIntersectionXY(arcA: Arc3d, arcB: Arc3d, _restrictToBounds: boolean = true): CurveLocationDetailPair[] | undefined {\r\n let result: CurveLocationDetailPair[] | undefined;\r\n if (arcA.center.isAlmostEqual(arcB.center, this.tolerance)) {\r\n const matrixBToA = arcA.matrixRef.multiplyMatrixInverseMatrix(arcB.matrixRef);\r\n if (matrixBToA) {\r\n const ux = matrixBToA.at(0, 0); const uy = matrixBToA.at(1, 0);\r\n const vx = matrixBToA.at(0, 1); const vy = matrixBToA.at(1, 1);\r\n const ru = Geometry.hypotenuseXY(ux, uy);\r\n const rv = Geometry.hypotenuseXY(vx, vy);\r\n const dot = Geometry.dotProductXYXY(ux, uy, vx, vy);\r\n const cross = Geometry.crossProductXYXY(ux, uy, vx, vy);\r\n if (Geometry.isAlmostEqualNumber(ru, 1.0)\r\n && Geometry.isAlmostEqualNumber(rv, 1.0)\r\n && Geometry.isAlmostEqualNumber(0, dot)) {\r\n const alphaB0Radians = Math.atan2(uy, ux); // angular position of arcB 0 point in arcA sweep\r\n const sweepDirection = cross > 0 ? 1.0 : -1.0; // 1 if arcB parameter space sweeps in same direction as arcA, -1 if opposite\r\n const betaStartRadians = alphaB0Radians + sweepDirection * arcB.sweep.startRadians; // arcB start in arcA parameter space\r\n const betaEndRadians = alphaB0Radians + sweepDirection * arcB.sweep.endRadians; // arcB end in arcA parameter space\r\n const fractionSpacesReversed = (sweepDirection * arcA.sweep.sweepRadians * arcB.sweep.sweepRadians) < 0;\r\n const sweepB = AngleSweep.createStartEndRadians(betaStartRadians, betaEndRadians);\r\n const sweepA = arcA.sweep;\r\n const fractionPeriodA = sweepA.fractionPeriod();\r\n const fractionB0 = sweepA.radiansToPositivePeriodicFraction(sweepB.startRadians); // arcB start in arcA fraction space\r\n assert(fractionB0 >= 0.0);\r\n const fractionSweep = sweepB.sweepRadians / sweepA.sweepRadians; // arcB sweep in arcA fraction space\r\n const fractionB1 = fractionB0 + fractionSweep; // arcB end in arcA fraction space\r\n const fractionSweepB = Segment1d.create(fractionB0, fractionB1);\r\n\r\n /** lambda to add a coincident interval or isolated intersection, given inputs in arcA fraction space\r\n * @param arcBInArcAFractionSpace span of arcB in arcA fraction space. On return, clamped to [0,1] if nontrivial.\r\n * @param testStartOfArcA if no nontrivial coincident interval was found, look for an isolated intersection at the start (true) or end (false) of arcA\r\n * @returns whether a detail pair was appended to result\r\n */\r\n const appendCoincidentIntersection = (arcBInArcAFractionSpace: Segment1d, testStartOfArcA: boolean): boolean => {\r\n const size = result ? result.length : 0;\r\n const arcBStart = arcBInArcAFractionSpace.x0;\r\n const arcBEnd = arcBInArcAFractionSpace.x1;\r\n if (arcBInArcAFractionSpace.clampDirectedTo01() && !Geometry.isSmallRelative(arcBInArcAFractionSpace.absoluteDelta())) {\r\n result = this.appendDetailPair(result, this.createDetailPair(arcA, arcB, arcBInArcAFractionSpace, arcBStart, arcBEnd, fractionSpacesReversed));\r\n } else { // test isolated intersection\r\n const testStartOfArcB = fractionSpacesReversed ? testStartOfArcA : !testStartOfArcA;\r\n const arcAPt = this._point0 = testStartOfArcA ? arcA.startPoint(this._point0): arcA.endPoint(this._point0);\r\n const arcBPt = this._point1 = testStartOfArcB ? arcB.startPoint(this._point1): arcB.endPoint(this._point1);\r\n if (arcAPt.isAlmostEqual(arcBPt, this.tolerance)) {\r\n const detailA = CurveLocationDetail.createCurveFractionPoint(arcA, testStartOfArcA ? 0 : 1, arcAPt);\r\n const detailB = CurveLocationDetail.createCurveFractionPoint(arcB, testStartOfArcB ? 0 : 1, arcBPt);\r\n result = this.appendDetailPair(result, CurveLocationDetailPair.createCapture(detailA, detailB));\r\n }\r\n }\r\n return result !== undefined && result.length > size;\r\n };\r\n\r\n appendCoincidentIntersection(fractionSweepB, false); // compute overlap in strict interior, or at end of arcA\r\n\r\n // check overlap at start of arcA with a periodic shift of fractionSweepB\r\n if (fractionB1 >= fractionPeriodA)\r\n appendCoincidentIntersection(Segment1d.create(fractionB0 - fractionPeriodA, fractionB1 - fractionPeriodA), true);\r\n else if (fractionB0 === 0.0)\r\n appendCoincidentIntersection(Segment1d.create(fractionB0 + fractionPeriodA, fractionB1 + fractionPeriodA), true);\r\n }\r\n }\r\n }\r\n return result;\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"CoincidentGeometryOps.js","sourceRoot":"","sources":["../../../src/geometry3d/CoincidentGeometryOps.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F;;GAEG;AACH,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE7C,OAAO,EAAE,mBAAmB,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AAE5F,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAW,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE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9G,yEAAyE;oBACzE,IAAI,UAAU,IAAI,eAAe;wBAC/B,4BAA4B,CAAC,SAAS,CAAC,MAAM,CAAC,UAAU,GAAG,eAAe,EAAE,UAAU,GAAG,eAAe,CAAC,EAAE,IAAI,CAAC,CAAC;yBAC9G,IAAI,UAAU,KAAK,GAAG;wBACzB,4BAA4B,CAAC,SAAS,CAAC,MAAM,CAAC,UAAU,GAAG,eAAe,EAAE,UAAU,GAAG,eAAe,CAAC,EAAE,IAAI,CAAC,CAAC;iBACpH;aACF;SACF;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\n/** @packageDocumentation\n * @module CartesianGeometry\n */\nimport { assert } from \"@itwin/core-bentley\";\nimport { Arc3d } from \"../curve/Arc3d\";\nimport { CurveLocationDetail, CurveLocationDetailPair } from \"../curve/CurveLocationDetail\";\nimport { CurvePrimitive } from \"../curve/CurvePrimitive\";\nimport { Geometry } from \"../Geometry\";\nimport { AngleSweep } from \"./AngleSweep\";\nimport { Point3d, Vector3d } from \"./Point3dVector3d\";\nimport { Segment1d } from \"./Segment1d\";\n\n/**\n * `CoincidentGeometryQuery` has methods useful in testing for overlapping geometry.\n * * Each instance carries tolerance information that can be reused over extended call sequences.\n * * These methods are expected to be called internally by CurveCurve intersection methods.\n * @internal\n */\nexport class CoincidentGeometryQuery {\n private _vectorU?: Vector3d;\n private _vectorV?: Vector3d;\n private _point0?: Point3d;\n private _point1?: Point3d;\n private _tolerance: number;\n public get tolerance(): number {\n return this._tolerance;\n }\n private constructor(tolerance: number = Geometry.smallMetricDistance) {\n this._tolerance = tolerance;\n }\n public static create(tolerance: number = Geometry.smallMetricDistance): CoincidentGeometryQuery {\n return new CoincidentGeometryQuery(tolerance);\n }\n /**\n * * Assign both the fraction and fraction1 values in the detail, possibly swapped.\n * * reevaluate the points as simple interpolation between given points.\n */\n public static assignDetailInterpolatedFractionsAndPoints(detail: CurveLocationDetail, f0: number, f1: number,\n pointA: Point3d, pointB: Point3d, swap: boolean = false) {\n if (swap) {\n detail.fraction = f1;\n detail.fraction1 = f0;\n } else {\n detail.fraction = f0;\n detail.fraction1 = f1;\n }\n detail.point = pointA.interpolate(detail.fraction, pointB, detail.point);\n detail.point1 = pointA.interpolate(detail.fraction1, pointB, detail.point1);\n\n }\n\n /** Return a curve location detail with projection of a `spacePoint` to the line segment with `pointA` and `pointB`\n *\n */\n public projectPointToSegmentXY(spacePoint: Point3d, pointA: Point3d, pointB: Point3d): CurveLocationDetail {\n this._vectorU = Vector3d.createStartEnd(pointA, pointB, this._vectorU);\n this._vectorV = Vector3d.createStartEnd(pointA, spacePoint, this._vectorV);\n const uDotU = this._vectorU.dotProductXY(this._vectorU);\n const uDotV = this._vectorU.dotProductXY(this._vectorV);\n const fraction = Geometry.safeDivideFraction(uDotV, uDotU, 0.0);\n return CurveLocationDetail.createCurveFractionPoint(undefined, fraction,\n pointA.interpolate(fraction, pointB));\n }\n /**\n * * project `pointA0` and `pointA1` onto the segment with `pointB0` and `pointB1`\n * * In the returned detail pair, the `detailA` has fractions along segmentA, and `detailB` has fractions along segment B\n * @param pointA0 start point of segment A\n * @param pointA1 end point of segment A\n * @param pointB0 start point of segment B\n * @param pointB1 end point of segment B\n */\n public coincidentSegmentRangeXY(pointA0: Point3d, pointA1: Point3d, pointB0: Point3d, pointB1: Point3d, restrictToBounds: boolean = true): CurveLocationDetailPair | undefined {\n const detailA0OnB = this.projectPointToSegmentXY(pointA0, pointB0, pointB1);\n if (pointA0.distanceXY(detailA0OnB.point) > this._tolerance)\n return undefined;\n const detailA1OnB = this.projectPointToSegmentXY(pointA1, pointB0, pointB1);\n if (pointA1.distanceXY(detailA1OnB.point) > this._tolerance)\n return undefined;\n\n const detailB0OnA = this.projectPointToSegmentXY(pointB0, pointA0, pointA1);\n if (pointB0.distanceXY(detailB0OnA.point) > this._tolerance)\n return undefined;\n const detailB1OnA = this.projectPointToSegmentXY(pointB1, pointA0, pointA1);\n if (pointB1.distanceXY(detailB1OnA.point) > this._tolerance)\n return undefined;\n\n detailA0OnB.fraction1 = detailA1OnB.fraction;\n detailA0OnB.point1 = detailA1OnB.point; // capture -- detailA1OnB is not reused.\n detailB0OnA.fraction1 = detailB1OnA.fraction;\n detailB0OnA.point1 = detailB1OnA.point;\n if (!restrictToBounds)\n return CurveLocationDetailPair.createCapture(detailB0OnA, detailA0OnB);\n\n const segment = Segment1d.create(detailB0OnA.fraction, detailB0OnA.fraction1);\n if (segment.clampDirectedTo01()) {\n const f0 = segment.x0;\n const f1 = segment.x1;\n const h0 = detailB0OnA.inverseInterpolateFraction(f0);\n const h1 = detailB0OnA.inverseInterpolateFraction(f1);\n // recompute fractions and points..\n CoincidentGeometryQuery.assignDetailInterpolatedFractionsAndPoints(detailB0OnA, f0, f1, pointA0, pointA1, f0 > f1);\n CoincidentGeometryQuery.assignDetailInterpolatedFractionsAndPoints(detailA0OnB, h0, h1, pointB0, pointB1, h0 > h1);\n return CurveLocationDetailPair.createCapture(detailB0OnA, detailA0OnB);\n } else {\n if (segment.signedDelta() < 0.0) {\n if (detailB0OnA.point.isAlmostEqual(pointA0, this.tolerance)) {\n detailB0OnA.collapseToStart();\n detailA0OnB.collapseToStart();\n return CurveLocationDetailPair.createCapture(detailB0OnA, detailA0OnB);\n }\n if (detailB0OnA.point1.isAlmostEqual(pointA1, this.tolerance)) {\n detailB0OnA.collapseToEnd();\n detailA0OnB.collapseToEnd();\n return CurveLocationDetailPair.createCapture(detailB0OnA, detailA0OnB);\n }\n } else {\n if (detailB0OnA.point.isAlmostEqual(pointA1, this.tolerance)) {\n detailB0OnA.collapseToStart();\n detailA0OnB.collapseToEnd();\n return CurveLocationDetailPair.createCapture(detailB0OnA, detailA0OnB);\n }\n if (detailB0OnA.point1.isAlmostEqual(pointA0, this.tolerance)) {\n detailB0OnA.collapseToEnd();\n detailA0OnB.collapseToStart();\n return CurveLocationDetailPair.createCapture(detailB0OnA, detailA0OnB);\n }\n }\n }\n return undefined;\n }\n /**\n * Create a CurveLocationDetailPair for a coincident interval of two overlapping curves\n * @param cpA curveA\n * @param cpB curveB\n * @param fractionsOnA coincident interval of curveB in fraction space of curveA\n * @param fractionB0 curveB start in fraction space of curveA\n * @param fractionB1 curveB end in fraction space of curveA\n * @param reverse whether curveB and curveA have opposite direction\n */\n private createDetailPair(cpA: CurvePrimitive, cpB: CurvePrimitive, fractionsOnA: Segment1d, fractionB0: number, fractionB1: number, reverse: boolean): CurveLocationDetailPair | undefined {\n const deltaB = fractionB1 - fractionB0;\n const g0 = Geometry.conditionalDivideFraction(fractionsOnA.x0 - fractionB0, deltaB);\n const g1 = Geometry.conditionalDivideFraction(fractionsOnA.x1 - fractionB0, deltaB);\n if (g0 !== undefined && g1 !== undefined) {\n const detailA = CurveLocationDetail.createCurveEvaluatedFractionFraction(cpA, fractionsOnA.x0, fractionsOnA.x1);\n const detailB = CurveLocationDetail.createCurveEvaluatedFractionFraction(cpB, g0, g1);\n if (reverse)\n detailA.swapFractionsAndPoints();\n return CurveLocationDetailPair.createCapture(detailA, detailB);\n }\n return undefined;\n }\n private appendDetailPair(result: CurveLocationDetailPair[] | undefined, pair: CurveLocationDetailPair | undefined): CurveLocationDetailPair[] | undefined {\n if (pair === undefined)\n return result;\n if (result === undefined)\n return [pair];\n result.push(pair);\n return result;\n }\n /**\n * Test if 2 arcs have coinciding portions.\n * @param arcA\n * @param arcB\n * @param _restrictToBounds\n * @return 0, 1, or 2 overlap points/intervals\n */\n public coincidentArcIntersectionXY(arcA: Arc3d, arcB: Arc3d, _restrictToBounds: boolean = true): CurveLocationDetailPair[] | undefined {\n let result: CurveLocationDetailPair[] | undefined;\n if (arcA.center.isAlmostEqual(arcB.center, this.tolerance)) {\n const matrixBToA = arcA.matrixRef.multiplyMatrixInverseMatrix(arcB.matrixRef);\n if (matrixBToA) {\n const ux = matrixBToA.at(0, 0); const uy = matrixBToA.at(1, 0);\n const vx = matrixBToA.at(0, 1); const vy = matrixBToA.at(1, 1);\n const ru = Geometry.hypotenuseXY(ux, uy);\n const rv = Geometry.hypotenuseXY(vx, vy);\n const dot = Geometry.dotProductXYXY(ux, uy, vx, vy);\n const cross = Geometry.crossProductXYXY(ux, uy, vx, vy);\n if (Geometry.isAlmostEqualNumber(ru, 1.0)\n && Geometry.isAlmostEqualNumber(rv, 1.0)\n && Geometry.isAlmostEqualNumber(0, dot)) {\n const alphaB0Radians = Math.atan2(uy, ux); // angular position of arcB 0 point in arcA sweep\n const sweepDirection = cross > 0 ? 1.0 : -1.0; // 1 if arcB parameter space sweeps in same direction as arcA, -1 if opposite\n const betaStartRadians = alphaB0Radians + sweepDirection * arcB.sweep.startRadians; // arcB start in arcA parameter space\n const betaEndRadians = alphaB0Radians + sweepDirection * arcB.sweep.endRadians; // arcB end in arcA parameter space\n const fractionSpacesReversed = (sweepDirection * arcA.sweep.sweepRadians * arcB.sweep.sweepRadians) < 0;\n const sweepB = AngleSweep.createStartEndRadians(betaStartRadians, betaEndRadians);\n const sweepA = arcA.sweep;\n const fractionPeriodA = sweepA.fractionPeriod();\n const fractionB0 = sweepA.radiansToPositivePeriodicFraction(sweepB.startRadians); // arcB start in arcA fraction space\n assert(fractionB0 >= 0.0);\n const fractionSweep = sweepB.sweepRadians / sweepA.sweepRadians; // arcB sweep in arcA fraction space\n const fractionB1 = fractionB0 + fractionSweep; // arcB end in arcA fraction space\n const fractionSweepB = Segment1d.create(fractionB0, fractionB1);\n\n /** lambda to add a coincident interval or isolated intersection, given inputs in arcA fraction space\n * @param arcBInArcAFractionSpace span of arcB in arcA fraction space. On return, clamped to [0,1] if nontrivial.\n * @param testStartOfArcA if no nontrivial coincident interval was found, look for an isolated intersection at the start (true) or end (false) of arcA\n * @returns whether a detail pair was appended to result\n */\n const appendCoincidentIntersection = (arcBInArcAFractionSpace: Segment1d, testStartOfArcA: boolean): boolean => {\n const size = result ? result.length : 0;\n const arcBStart = arcBInArcAFractionSpace.x0;\n const arcBEnd = arcBInArcAFractionSpace.x1;\n if (arcBInArcAFractionSpace.clampDirectedTo01() && !Geometry.isSmallRelative(arcBInArcAFractionSpace.absoluteDelta())) {\n result = this.appendDetailPair(result, this.createDetailPair(arcA, arcB, arcBInArcAFractionSpace, arcBStart, arcBEnd, fractionSpacesReversed));\n } else { // test isolated intersection\n const testStartOfArcB = fractionSpacesReversed ? testStartOfArcA : !testStartOfArcA;\n const arcAPt = this._point0 = testStartOfArcA ? arcA.startPoint(this._point0): arcA.endPoint(this._point0);\n const arcBPt = this._point1 = testStartOfArcB ? arcB.startPoint(this._point1): arcB.endPoint(this._point1);\n if (arcAPt.isAlmostEqual(arcBPt, this.tolerance)) {\n const detailA = CurveLocationDetail.createCurveFractionPoint(arcA, testStartOfArcA ? 0 : 1, arcAPt);\n const detailB = CurveLocationDetail.createCurveFractionPoint(arcB, testStartOfArcB ? 0 : 1, arcBPt);\n result = this.appendDetailPair(result, CurveLocationDetailPair.createCapture(detailA, detailB));\n }\n }\n return result !== undefined && result.length > size;\n };\n\n appendCoincidentIntersection(fractionSweepB, false); // compute overlap in strict interior, or at end of arcA\n\n // check overlap at start of arcA with a periodic shift of fractionSweepB\n if (fractionB1 >= fractionPeriodA)\n appendCoincidentIntersection(Segment1d.create(fractionB0 - fractionPeriodA, fractionB1 - fractionPeriodA), true);\n else if (fractionB0 === 0.0)\n appendCoincidentIntersection(Segment1d.create(fractionB0 + fractionPeriodA, fractionB1 + fractionPeriodA), true);\n }\n }\n }\n return result;\n }\n}\n"]}
@@ -328,7 +328,7 @@ export declare class GeodesicPathPoint {
328
328
  private static _vectorCross?;
329
329
  /** Evaluate the newton function and derivatives:
330
330
  * `(UAB cross UCB) dot d1cross`
331
- * with as the central data, UAB = vector from pointA to pointB, UCB = vector from pointC to pointA.
331
+ * with as the central data, UAB = vector from pointA to pointB, UCB = vector from pointC to pointB.
332
332
  * * Return order is:
333
333
  * * values[0] = the function
334
334
  * * values[1] = derivative wrt pointA.phi
@@ -876,7 +876,7 @@ export class GeodesicPathPoint {
876
876
  }
877
877
  /** Evaluate the newton function and derivatives:
878
878
  * `(UAB cross UCB) dot d1cross`
879
- * with as the central data, UAB = vector from pointA to pointB, UCB = vector from pointC to pointA.
879
+ * with as the central data, UAB = vector from pointA to pointB, UCB = vector from pointC to pointB.
880
880
  * * Return order is:
881
881
  * * values[0] = the function
882
882
  * * values[1] = derivative wrt pointA.phi