@itwin/core-geometry 5.0.0-dev.3 → 5.0.0-dev.34

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 (730) hide show
  1. package/CHANGELOG.md +19 -1
  2. package/lib/cjs/Constant.js +17 -17
  3. package/lib/cjs/Constant.js.map +1 -1
  4. package/lib/cjs/Geometry.js +35 -35
  5. package/lib/cjs/Geometry.js.map +1 -1
  6. package/lib/cjs/bspline/AkimaCurve3d.js.map +1 -1
  7. package/lib/cjs/bspline/BSpline1dNd.js.map +1 -1
  8. package/lib/cjs/bspline/BSplineCurve.js.map +1 -1
  9. package/lib/cjs/bspline/BSplineCurve3dH.js.map +1 -1
  10. package/lib/cjs/bspline/BSplineCurveOps.d.ts.map +1 -1
  11. package/lib/cjs/bspline/BSplineCurveOps.js +18 -21
  12. package/lib/cjs/bspline/BSplineCurveOps.js.map +1 -1
  13. package/lib/cjs/bspline/BSplineSurface.js.map +1 -1
  14. package/lib/cjs/bspline/Bezier1dNd.js.map +1 -1
  15. package/lib/cjs/bspline/BezierCurve3d.js.map +1 -1
  16. package/lib/cjs/bspline/BezierCurve3dH.js.map +1 -1
  17. package/lib/cjs/bspline/BezierCurveBase.d.ts.map +1 -1
  18. package/lib/cjs/bspline/BezierCurveBase.js.map +1 -1
  19. package/lib/cjs/bspline/InterpolationCurve3d.js.map +1 -1
  20. package/lib/cjs/bspline/KnotVector.js +2 -2
  21. package/lib/cjs/bspline/KnotVector.js.map +1 -1
  22. package/lib/cjs/bspline/SurfaceLocationDetail.js.map +1 -1
  23. package/lib/cjs/clipping/AlternatingConvexClipTree.js +2 -2
  24. package/lib/cjs/clipping/AlternatingConvexClipTree.js.map +1 -1
  25. package/lib/cjs/clipping/BooleanClipFactory.js.map +1 -1
  26. package/lib/cjs/clipping/BooleanClipNode.js.map +1 -1
  27. package/lib/cjs/clipping/ClipPlane.js +1 -1
  28. package/lib/cjs/clipping/ClipPlane.js.map +1 -1
  29. package/lib/cjs/clipping/ClipPrimitive.js.map +1 -1
  30. package/lib/cjs/clipping/ClipUtils.js +1 -1
  31. package/lib/cjs/clipping/ClipUtils.js.map +1 -1
  32. package/lib/cjs/clipping/ClipVector.js +1 -1
  33. package/lib/cjs/clipping/ClipVector.js.map +1 -1
  34. package/lib/cjs/clipping/ConvexClipPlaneSet.js +3 -3
  35. package/lib/cjs/clipping/ConvexClipPlaneSet.js.map +1 -1
  36. package/lib/cjs/clipping/UnionOfConvexClipPlaneSets.js +1 -1
  37. package/lib/cjs/clipping/UnionOfConvexClipPlaneSets.js.map +1 -1
  38. package/lib/cjs/clipping/internalContexts/LineStringOffsetClipperContext.js.map +1 -1
  39. package/lib/cjs/core-geometry.js.map +1 -1
  40. package/lib/cjs/curve/Arc3d.d.ts +40 -8
  41. package/lib/cjs/curve/Arc3d.d.ts.map +1 -1
  42. package/lib/cjs/curve/Arc3d.js +80 -22
  43. package/lib/cjs/curve/Arc3d.js.map +1 -1
  44. package/lib/cjs/curve/ConstructCurveBetweenCurves.js.map +1 -1
  45. package/lib/cjs/curve/CoordinateXYZ.js.map +1 -1
  46. package/lib/cjs/curve/CurveChainWithDistanceIndex.js +4 -4
  47. package/lib/cjs/curve/CurveChainWithDistanceIndex.js.map +1 -1
  48. package/lib/cjs/curve/CurveCollection.d.ts +16 -2
  49. package/lib/cjs/curve/CurveCollection.d.ts.map +1 -1
  50. package/lib/cjs/curve/CurveCollection.js +33 -2
  51. package/lib/cjs/curve/CurveCollection.js.map +1 -1
  52. package/lib/cjs/curve/CurveCurve.js.map +1 -1
  53. package/lib/cjs/curve/CurveExtendMode.js.map +1 -1
  54. package/lib/cjs/curve/CurveFactory.d.ts +87 -53
  55. package/lib/cjs/curve/CurveFactory.d.ts.map +1 -1
  56. package/lib/cjs/curve/CurveFactory.js +213 -135
  57. package/lib/cjs/curve/CurveFactory.js.map +1 -1
  58. package/lib/cjs/curve/CurveLocationDetail.js.map +1 -1
  59. package/lib/cjs/curve/CurveOps.js.map +1 -1
  60. package/lib/cjs/curve/CurvePrimitive.js.map +1 -1
  61. package/lib/cjs/curve/CurveProcessor.js.map +1 -1
  62. package/lib/cjs/curve/CurveTypes.js.map +1 -1
  63. package/lib/cjs/curve/CurveWireMomentsXYZ.js.map +1 -1
  64. package/lib/cjs/curve/GeometryQuery.js.map +1 -1
  65. package/lib/cjs/curve/LineSegment3d.js.map +1 -1
  66. package/lib/cjs/curve/LineString3d.d.ts +12 -8
  67. package/lib/cjs/curve/LineString3d.d.ts.map +1 -1
  68. package/lib/cjs/curve/LineString3d.js +34 -13
  69. package/lib/cjs/curve/LineString3d.js.map +1 -1
  70. package/lib/cjs/curve/Loop.d.ts +12 -6
  71. package/lib/cjs/curve/Loop.d.ts.map +1 -1
  72. package/lib/cjs/curve/Loop.js +12 -6
  73. package/lib/cjs/curve/Loop.js.map +1 -1
  74. package/lib/cjs/curve/OffsetOptions.js.map +1 -1
  75. package/lib/cjs/curve/ParityRegion.js.map +1 -1
  76. package/lib/cjs/curve/Path.js.map +1 -1
  77. package/lib/cjs/curve/PointString3d.js.map +1 -1
  78. package/lib/cjs/curve/ProxyCurve.js.map +1 -1
  79. package/lib/cjs/curve/Query/ConsolidateAdjacentPrimitivesContext.js.map +1 -1
  80. package/lib/cjs/curve/Query/CurveSplitContext.js.map +1 -1
  81. package/lib/cjs/curve/Query/CylindricalRange.d.ts +8 -6
  82. package/lib/cjs/curve/Query/CylindricalRange.d.ts.map +1 -1
  83. package/lib/cjs/curve/Query/CylindricalRange.js +13 -9
  84. package/lib/cjs/curve/Query/CylindricalRange.js.map +1 -1
  85. package/lib/cjs/curve/Query/InOutTests.js.map +1 -1
  86. package/lib/cjs/curve/Query/PlanarSubdivision.js.map +1 -1
  87. package/lib/cjs/curve/Query/StrokeCountChain.js.map +1 -1
  88. package/lib/cjs/curve/Query/StrokeCountMap.js.map +1 -1
  89. package/lib/cjs/curve/RegionMomentsXY.js.map +1 -1
  90. package/lib/cjs/curve/RegionOps.js.map +1 -1
  91. package/lib/cjs/curve/RegionOpsClassificationSweeps.js +1 -1
  92. package/lib/cjs/curve/RegionOpsClassificationSweeps.js.map +1 -1
  93. package/lib/cjs/curve/StrokeOptions.d.ts +4 -4
  94. package/lib/cjs/curve/StrokeOptions.d.ts.map +1 -1
  95. package/lib/cjs/curve/StrokeOptions.js +1 -1
  96. package/lib/cjs/curve/StrokeOptions.js.map +1 -1
  97. package/lib/cjs/curve/UnionRegion.js.map +1 -1
  98. package/lib/cjs/curve/internalContexts/AppendPlaneIntersectionStrokeHandler.js.map +1 -1
  99. package/lib/cjs/curve/internalContexts/ChainCollectorContext.js.map +1 -1
  100. package/lib/cjs/curve/internalContexts/CloneCurvesContext.js.map +1 -1
  101. package/lib/cjs/curve/internalContexts/CloneWithExpandedLineStrings.js.map +1 -1
  102. package/lib/cjs/curve/internalContexts/ClosestPointStrokeHandler.js.map +1 -1
  103. package/lib/cjs/curve/internalContexts/CountLinearPartsSearchContext.js.map +1 -1
  104. package/lib/cjs/curve/internalContexts/CurveCurveCloseApproachXY.js +5 -5
  105. package/lib/cjs/curve/internalContexts/CurveCurveCloseApproachXY.js.map +1 -1
  106. package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.js +13 -13
  107. package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.js.map +1 -1
  108. package/lib/cjs/curve/internalContexts/CurveCurveIntersectXYZ.js +5 -5
  109. package/lib/cjs/curve/internalContexts/CurveCurveIntersectXYZ.js.map +1 -1
  110. package/lib/cjs/curve/internalContexts/CurveLengthContext.js.map +1 -1
  111. package/lib/cjs/curve/internalContexts/CurveOffsetXYHandler.js.map +1 -1
  112. package/lib/cjs/curve/internalContexts/EllipticalArcApproximationContext.d.ts.map +1 -1
  113. package/lib/cjs/curve/internalContexts/EllipticalArcApproximationContext.js +29 -23
  114. package/lib/cjs/curve/internalContexts/EllipticalArcApproximationContext.js.map +1 -1
  115. package/lib/cjs/curve/internalContexts/GapSearchContext.js.map +1 -1
  116. package/lib/cjs/curve/internalContexts/MultiChainCollector.js.map +1 -1
  117. package/lib/cjs/curve/internalContexts/NewtonRtoRStrokeHandler.js.map +1 -1
  118. package/lib/cjs/curve/internalContexts/PlaneAltitudeRangeContext.js.map +1 -1
  119. package/lib/cjs/curve/internalContexts/PolygonOffsetContext.js +4 -4
  120. package/lib/cjs/curve/internalContexts/PolygonOffsetContext.js.map +1 -1
  121. package/lib/cjs/curve/internalContexts/SumLengthsContext.js.map +1 -1
  122. package/lib/cjs/curve/internalContexts/TransformInPlaceContext.js.map +1 -1
  123. package/lib/cjs/curve/spiral/AustralianRailCorpXYEvaluator.js.map +1 -1
  124. package/lib/cjs/curve/spiral/ClothoidSeries.js.map +1 -1
  125. package/lib/cjs/curve/spiral/CubicEvaluator.js.map +1 -1
  126. package/lib/cjs/curve/spiral/CzechSpiralEvaluator.js.map +1 -1
  127. package/lib/cjs/curve/spiral/DirectHalfCosineSpiralEvaluator.js.map +1 -1
  128. package/lib/cjs/curve/spiral/DirectSpiral3d.js.map +1 -1
  129. package/lib/cjs/curve/spiral/IntegratedSpiral3d.js +2 -2
  130. package/lib/cjs/curve/spiral/IntegratedSpiral3d.js.map +1 -1
  131. package/lib/cjs/curve/spiral/MXCubicAlongArcSpiralEvaluator.js.map +1 -1
  132. package/lib/cjs/curve/spiral/NormalizedTransition.js.map +1 -1
  133. package/lib/cjs/curve/spiral/PolishCubicSpiralEvaluator.js.map +1 -1
  134. package/lib/cjs/curve/spiral/TransitionConditionalProperties.js.map +1 -1
  135. package/lib/cjs/curve/spiral/TransitionSpiral3d.js.map +1 -1
  136. package/lib/cjs/curve/spiral/XYCurveEvaluator.js.map +1 -1
  137. package/lib/cjs/geometry3d/Angle.js +16 -16
  138. package/lib/cjs/geometry3d/Angle.js.map +1 -1
  139. package/lib/cjs/geometry3d/AngleSweep.d.ts +1 -1
  140. package/lib/cjs/geometry3d/AngleSweep.d.ts.map +1 -1
  141. package/lib/cjs/geometry3d/AngleSweep.js +1 -1
  142. package/lib/cjs/geometry3d/AngleSweep.js.map +1 -1
  143. package/lib/cjs/geometry3d/BarycentricTriangle.d.ts +14 -8
  144. package/lib/cjs/geometry3d/BarycentricTriangle.d.ts.map +1 -1
  145. package/lib/cjs/geometry3d/BarycentricTriangle.js +17 -8
  146. package/lib/cjs/geometry3d/BarycentricTriangle.js.map +1 -1
  147. package/lib/cjs/geometry3d/BilinearPatch.js.map +1 -1
  148. package/lib/cjs/geometry3d/CoincidentGeometryOps.js.map +1 -1
  149. package/lib/cjs/geometry3d/Ellipsoid.js.map +1 -1
  150. package/lib/cjs/geometry3d/FrameBuilder.js +4 -4
  151. package/lib/cjs/geometry3d/FrameBuilder.js.map +1 -1
  152. package/lib/cjs/geometry3d/FrustumAnimation.js.map +1 -1
  153. package/lib/cjs/geometry3d/GeometryHandler.js.map +1 -1
  154. package/lib/cjs/geometry3d/GrowableBlockedArray.js.map +1 -1
  155. package/lib/cjs/geometry3d/GrowableFloat64Array.d.ts +2 -0
  156. package/lib/cjs/geometry3d/GrowableFloat64Array.d.ts.map +1 -1
  157. package/lib/cjs/geometry3d/GrowableFloat64Array.js +4 -0
  158. package/lib/cjs/geometry3d/GrowableFloat64Array.js.map +1 -1
  159. package/lib/cjs/geometry3d/GrowableXYArray.js.map +1 -1
  160. package/lib/cjs/geometry3d/GrowableXYZArray.d.ts +32 -10
  161. package/lib/cjs/geometry3d/GrowableXYZArray.d.ts.map +1 -1
  162. package/lib/cjs/geometry3d/GrowableXYZArray.js +54 -16
  163. package/lib/cjs/geometry3d/GrowableXYZArray.js.map +1 -1
  164. package/lib/cjs/geometry3d/IndexedCollectionInterval.js.map +1 -1
  165. package/lib/cjs/geometry3d/IndexedXYCollection.js.map +1 -1
  166. package/lib/cjs/geometry3d/IndexedXYZCollection.d.ts +13 -2
  167. package/lib/cjs/geometry3d/IndexedXYZCollection.d.ts.map +1 -1
  168. package/lib/cjs/geometry3d/IndexedXYZCollection.js +24 -10
  169. package/lib/cjs/geometry3d/IndexedXYZCollection.js.map +1 -1
  170. package/lib/cjs/geometry3d/LongitudeLatitudeAltitude.js.map +1 -1
  171. package/lib/cjs/geometry3d/Matrix3d.d.ts +11 -8
  172. package/lib/cjs/geometry3d/Matrix3d.d.ts.map +1 -1
  173. package/lib/cjs/geometry3d/Matrix3d.js +36 -34
  174. package/lib/cjs/geometry3d/Matrix3d.js.map +1 -1
  175. package/lib/cjs/geometry3d/OrderedRotationAngles.js +2 -2
  176. package/lib/cjs/geometry3d/OrderedRotationAngles.js.map +1 -1
  177. package/lib/cjs/geometry3d/Plane3d.js.map +1 -1
  178. package/lib/cjs/geometry3d/Plane3dByOriginAndUnitNormal.js.map +1 -1
  179. package/lib/cjs/geometry3d/Plane3dByOriginAndVectors.js.map +1 -1
  180. package/lib/cjs/geometry3d/Point2dArrayCarrier.js.map +1 -1
  181. package/lib/cjs/geometry3d/Point2dVector2d.js.map +1 -1
  182. package/lib/cjs/geometry3d/Point3dArrayCarrier.js +1 -1
  183. package/lib/cjs/geometry3d/Point3dArrayCarrier.js.map +1 -1
  184. package/lib/cjs/geometry3d/Point3dVector3d.d.ts +6 -6
  185. package/lib/cjs/geometry3d/Point3dVector3d.js +6 -6
  186. package/lib/cjs/geometry3d/Point3dVector3d.js.map +1 -1
  187. package/lib/cjs/geometry3d/PointHelpers.js +5 -5
  188. package/lib/cjs/geometry3d/PointHelpers.js.map +1 -1
  189. package/lib/cjs/geometry3d/PointStreaming.js.map +1 -1
  190. package/lib/cjs/geometry3d/PolygonOps.d.ts +12 -6
  191. package/lib/cjs/geometry3d/PolygonOps.d.ts.map +1 -1
  192. package/lib/cjs/geometry3d/PolygonOps.js +117 -70
  193. package/lib/cjs/geometry3d/PolygonOps.js.map +1 -1
  194. package/lib/cjs/geometry3d/PolylineCompressionByEdgeOffset.js +3 -3
  195. package/lib/cjs/geometry3d/PolylineCompressionByEdgeOffset.js.map +1 -1
  196. package/lib/cjs/geometry3d/PolylineOps.d.ts +9 -5
  197. package/lib/cjs/geometry3d/PolylineOps.d.ts.map +1 -1
  198. package/lib/cjs/geometry3d/PolylineOps.js +9 -5
  199. package/lib/cjs/geometry3d/PolylineOps.js.map +1 -1
  200. package/lib/cjs/geometry3d/Range.js +4 -4
  201. package/lib/cjs/geometry3d/Range.js.map +1 -1
  202. package/lib/cjs/geometry3d/Ray2d.js.map +1 -1
  203. package/lib/cjs/geometry3d/Ray3d.js.map +1 -1
  204. package/lib/cjs/geometry3d/ReusableObjectCache.js.map +1 -1
  205. package/lib/cjs/geometry3d/Segment1d.js.map +1 -1
  206. package/lib/cjs/geometry3d/SortablePolygon.js.map +1 -1
  207. package/lib/cjs/geometry3d/Transform.js.map +1 -1
  208. package/lib/cjs/geometry3d/UVSurfaceOps.js.map +1 -1
  209. package/lib/cjs/geometry3d/XYZProps.js.map +1 -1
  210. package/lib/cjs/geometry3d/YawPitchRollAngles.js.map +1 -1
  211. package/lib/cjs/geometry4d/Map4d.js.map +1 -1
  212. package/lib/cjs/geometry4d/Matrix4d.js.map +1 -1
  213. package/lib/cjs/geometry4d/MomentData.d.ts +72 -73
  214. package/lib/cjs/geometry4d/MomentData.d.ts.map +1 -1
  215. package/lib/cjs/geometry4d/MomentData.js +62 -64
  216. package/lib/cjs/geometry4d/MomentData.js.map +1 -1
  217. package/lib/cjs/geometry4d/PlaneByOriginAndVectors4d.js.map +1 -1
  218. package/lib/cjs/geometry4d/Point4d.js.map +1 -1
  219. package/lib/cjs/numerics/BandedSystem.js.map +1 -1
  220. package/lib/cjs/numerics/BezierPolynomials.js.map +1 -1
  221. package/lib/cjs/numerics/ClusterableArray.js +13 -13
  222. package/lib/cjs/numerics/ClusterableArray.js.map +1 -1
  223. package/lib/cjs/numerics/Complex.js.map +1 -1
  224. package/lib/cjs/numerics/ConvexPolygon2d.js.map +1 -1
  225. package/lib/cjs/numerics/Newton.js.map +1 -1
  226. package/lib/cjs/numerics/PascalCoefficients.js +1 -1
  227. package/lib/cjs/numerics/PascalCoefficients.js.map +1 -1
  228. package/lib/cjs/numerics/PolarData.js +1 -1
  229. package/lib/cjs/numerics/PolarData.js.map +1 -1
  230. package/lib/cjs/numerics/Polynomials.d.ts +5 -5
  231. package/lib/cjs/numerics/Polynomials.js +32 -32
  232. package/lib/cjs/numerics/Polynomials.js.map +1 -1
  233. package/lib/cjs/numerics/Quadrature.js +20 -20
  234. package/lib/cjs/numerics/Quadrature.js.map +1 -1
  235. package/lib/cjs/numerics/Range1dArray.js.map +1 -1
  236. package/lib/cjs/numerics/SmallSystem.js.map +1 -1
  237. package/lib/cjs/numerics/TriDiagonalSystem.js.map +1 -1
  238. package/lib/cjs/numerics/UnionFind.js.map +1 -1
  239. package/lib/cjs/numerics/UsageSums.js.map +1 -1
  240. package/lib/cjs/polyface/AuxData.d.ts +2 -2
  241. package/lib/cjs/polyface/AuxData.d.ts.map +1 -1
  242. package/lib/cjs/polyface/AuxData.js +11 -3
  243. package/lib/cjs/polyface/AuxData.js.map +1 -1
  244. package/lib/cjs/polyface/BoxTopology.js +67 -67
  245. package/lib/cjs/polyface/BoxTopology.js.map +1 -1
  246. package/lib/cjs/polyface/FacetFaceData.js.map +1 -1
  247. package/lib/cjs/polyface/FacetLocationDetail.js.map +1 -1
  248. package/lib/cjs/polyface/FacetOrientation.js.map +1 -1
  249. package/lib/cjs/polyface/GreedyTriangulationBetweenLineStrings.js +2 -2
  250. package/lib/cjs/polyface/GreedyTriangulationBetweenLineStrings.js.map +1 -1
  251. package/lib/cjs/polyface/IndexedEdgeMatcher.d.ts +27 -20
  252. package/lib/cjs/polyface/IndexedEdgeMatcher.d.ts.map +1 -1
  253. package/lib/cjs/polyface/IndexedEdgeMatcher.js +56 -30
  254. package/lib/cjs/polyface/IndexedEdgeMatcher.js.map +1 -1
  255. package/lib/cjs/polyface/IndexedPolyfaceVisitor.d.ts +2 -1
  256. package/lib/cjs/polyface/IndexedPolyfaceVisitor.d.ts.map +1 -1
  257. package/lib/cjs/polyface/IndexedPolyfaceVisitor.js +2 -1
  258. package/lib/cjs/polyface/IndexedPolyfaceVisitor.js.map +1 -1
  259. package/lib/cjs/polyface/Polyface.d.ts +3 -5
  260. package/lib/cjs/polyface/Polyface.d.ts.map +1 -1
  261. package/lib/cjs/polyface/Polyface.js +6 -13
  262. package/lib/cjs/polyface/Polyface.js.map +1 -1
  263. package/lib/cjs/polyface/PolyfaceBuilder.d.ts +14 -7
  264. package/lib/cjs/polyface/PolyfaceBuilder.d.ts.map +1 -1
  265. package/lib/cjs/polyface/PolyfaceBuilder.js +59 -64
  266. package/lib/cjs/polyface/PolyfaceBuilder.js.map +1 -1
  267. package/lib/cjs/polyface/PolyfaceClip.js.map +1 -1
  268. package/lib/cjs/polyface/PolyfaceData.d.ts +13 -3
  269. package/lib/cjs/polyface/PolyfaceData.d.ts.map +1 -1
  270. package/lib/cjs/polyface/PolyfaceData.js +26 -9
  271. package/lib/cjs/polyface/PolyfaceData.js.map +1 -1
  272. package/lib/cjs/polyface/PolyfaceQuery.d.ts +2 -2
  273. package/lib/cjs/polyface/PolyfaceQuery.d.ts.map +1 -1
  274. package/lib/cjs/polyface/PolyfaceQuery.js +11 -10
  275. package/lib/cjs/polyface/PolyfaceQuery.js.map +1 -1
  276. package/lib/cjs/polyface/RangeLengthData.js.map +1 -1
  277. package/lib/cjs/polyface/RangeTree/LineString3dRangeTreeContext.js.map +1 -1
  278. package/lib/cjs/polyface/RangeTree/MinimumValueTester.js.map +1 -1
  279. package/lib/cjs/polyface/RangeTree/Point3dArrayRangeTreeContext.js.map +1 -1
  280. package/lib/cjs/polyface/RangeTree/PolyfaceRangeTreeContext.js.map +1 -1
  281. package/lib/cjs/polyface/RangeTree/RangeTreeNode.js.map +1 -1
  282. package/lib/cjs/polyface/RangeTree/RangeTreeSearchHandlers.js.map +1 -1
  283. package/lib/cjs/polyface/TaggedNumericData.js.map +1 -1
  284. package/lib/cjs/polyface/TriangleCandidate.js.map +1 -1
  285. package/lib/cjs/polyface/multiclip/BuildAverageNormalsContext.js.map +1 -1
  286. package/lib/cjs/polyface/multiclip/GriddedRaggedRange2dSet.js.map +1 -1
  287. package/lib/cjs/polyface/multiclip/GriddedRaggedRange2dSetWithOverflow.js.map +1 -1
  288. package/lib/cjs/polyface/multiclip/LinearSearchRange2dArray.js.map +1 -1
  289. package/lib/cjs/polyface/multiclip/OffsetMeshContext.js.map +1 -1
  290. package/lib/cjs/polyface/multiclip/Range2dSearchInterface.js.map +1 -1
  291. package/lib/cjs/polyface/multiclip/RangeSearch.js +5 -5
  292. package/lib/cjs/polyface/multiclip/RangeSearch.js.map +1 -1
  293. package/lib/cjs/polyface/multiclip/SweepLineStringToFacetContext.js.map +1 -1
  294. package/lib/cjs/polyface/multiclip/XYPointBuckets.js.map +1 -1
  295. package/lib/cjs/serialization/BGFBAccessors.js.map +1 -1
  296. package/lib/cjs/serialization/BGFBReader.js +22 -22
  297. package/lib/cjs/serialization/BGFBReader.js.map +1 -1
  298. package/lib/cjs/serialization/BGFBWriter.js.map +1 -1
  299. package/lib/cjs/serialization/BentleyGeometryFlatBuffer.js.map +1 -1
  300. package/lib/cjs/serialization/DeepCompare.js.map +1 -1
  301. package/lib/cjs/serialization/GeometrySamples.d.ts +5 -5
  302. package/lib/cjs/serialization/GeometrySamples.d.ts.map +1 -1
  303. package/lib/cjs/serialization/GeometrySamples.js +112 -112
  304. package/lib/cjs/serialization/GeometrySamples.js.map +1 -1
  305. package/lib/cjs/serialization/IModelJsonSchema.js.map +1 -1
  306. package/lib/cjs/serialization/SerializationHelpers.js.map +1 -1
  307. package/lib/cjs/solid/Box.d.ts +9 -3
  308. package/lib/cjs/solid/Box.d.ts.map +1 -1
  309. package/lib/cjs/solid/Box.js +10 -5
  310. package/lib/cjs/solid/Box.js.map +1 -1
  311. package/lib/cjs/solid/Cone.d.ts +3 -2
  312. package/lib/cjs/solid/Cone.d.ts.map +1 -1
  313. package/lib/cjs/solid/Cone.js +3 -3
  314. package/lib/cjs/solid/Cone.js.map +1 -1
  315. package/lib/cjs/solid/LinearSweep.d.ts +9 -3
  316. package/lib/cjs/solid/LinearSweep.d.ts.map +1 -1
  317. package/lib/cjs/solid/LinearSweep.js +9 -4
  318. package/lib/cjs/solid/LinearSweep.js.map +1 -1
  319. package/lib/cjs/solid/RotationalSweep.d.ts +15 -4
  320. package/lib/cjs/solid/RotationalSweep.d.ts.map +1 -1
  321. package/lib/cjs/solid/RotationalSweep.js +20 -7
  322. package/lib/cjs/solid/RotationalSweep.js.map +1 -1
  323. package/lib/cjs/solid/RuledSweep.d.ts +35 -26
  324. package/lib/cjs/solid/RuledSweep.d.ts.map +1 -1
  325. package/lib/cjs/solid/RuledSweep.js +41 -28
  326. package/lib/cjs/solid/RuledSweep.js.map +1 -1
  327. package/lib/cjs/solid/SolidPrimitive.d.ts +12 -11
  328. package/lib/cjs/solid/SolidPrimitive.d.ts.map +1 -1
  329. package/lib/cjs/solid/SolidPrimitive.js +8 -5
  330. package/lib/cjs/solid/SolidPrimitive.js.map +1 -1
  331. package/lib/cjs/solid/Sphere.d.ts +17 -7
  332. package/lib/cjs/solid/Sphere.d.ts.map +1 -1
  333. package/lib/cjs/solid/Sphere.js +22 -16
  334. package/lib/cjs/solid/Sphere.js.map +1 -1
  335. package/lib/cjs/solid/SweepContour.d.ts +25 -16
  336. package/lib/cjs/solid/SweepContour.d.ts.map +1 -1
  337. package/lib/cjs/solid/SweepContour.js +25 -16
  338. package/lib/cjs/solid/SweepContour.js.map +1 -1
  339. package/lib/cjs/solid/TorusPipe.d.ts +8 -2
  340. package/lib/cjs/solid/TorusPipe.d.ts.map +1 -1
  341. package/lib/cjs/solid/TorusPipe.js +9 -5
  342. package/lib/cjs/solid/TorusPipe.js.map +1 -1
  343. package/lib/cjs/topology/ChainMerge.js +4 -4
  344. package/lib/cjs/topology/ChainMerge.js.map +1 -1
  345. package/lib/cjs/topology/Graph.js +5 -5
  346. package/lib/cjs/topology/Graph.js.map +1 -1
  347. package/lib/cjs/topology/HalfEdgeGraphFromIndexedLoopsContext.js.map +1 -1
  348. package/lib/cjs/topology/HalfEdgeGraphSearch.js.map +1 -1
  349. package/lib/cjs/topology/HalfEdgeGraphSpineContext.js +2 -2
  350. package/lib/cjs/topology/HalfEdgeGraphSpineContext.js.map +1 -1
  351. package/lib/cjs/topology/HalfEdgeGraphValidation.js.map +1 -1
  352. package/lib/cjs/topology/HalfEdgeMarkSet.js.map +1 -1
  353. package/lib/cjs/topology/HalfEdgeNodeXYZUV.js.map +1 -1
  354. package/lib/cjs/topology/HalfEdgePointInGraphSearch.js.map +1 -1
  355. package/lib/cjs/topology/HalfEdgePositionDetail.js.map +1 -1
  356. package/lib/cjs/topology/HalfEdgePriorityQueue.js.map +1 -1
  357. package/lib/cjs/topology/InsertAndRetriangulateContext.js.map +1 -1
  358. package/lib/cjs/topology/MaskManager.js.map +1 -1
  359. package/lib/cjs/topology/Merging.js.map +1 -1
  360. package/lib/cjs/topology/RegularizeFace.js.map +1 -1
  361. package/lib/cjs/topology/SignedDataSummary.js.map +1 -1
  362. package/lib/cjs/topology/SpaceTriangulation.js.map +1 -1
  363. package/lib/cjs/topology/Triangulation.js +11 -11
  364. package/lib/cjs/topology/Triangulation.js.map +1 -1
  365. package/lib/cjs/topology/XYParitySearchContext.js.map +1 -1
  366. package/lib/esm/Constant.js +17 -17
  367. package/lib/esm/Constant.js.map +1 -1
  368. package/lib/esm/Geometry.js +35 -35
  369. package/lib/esm/Geometry.js.map +1 -1
  370. package/lib/esm/bspline/AkimaCurve3d.js.map +1 -1
  371. package/lib/esm/bspline/BSpline1dNd.js.map +1 -1
  372. package/lib/esm/bspline/BSplineCurve.js.map +1 -1
  373. package/lib/esm/bspline/BSplineCurve3dH.js.map +1 -1
  374. package/lib/esm/bspline/BSplineCurveOps.d.ts.map +1 -1
  375. package/lib/esm/bspline/BSplineCurveOps.js +18 -21
  376. package/lib/esm/bspline/BSplineCurveOps.js.map +1 -1
  377. package/lib/esm/bspline/BSplineSurface.js.map +1 -1
  378. package/lib/esm/bspline/Bezier1dNd.js.map +1 -1
  379. package/lib/esm/bspline/BezierCurve3d.js.map +1 -1
  380. package/lib/esm/bspline/BezierCurve3dH.js.map +1 -1
  381. package/lib/esm/bspline/BezierCurveBase.d.ts.map +1 -1
  382. package/lib/esm/bspline/BezierCurveBase.js.map +1 -1
  383. package/lib/esm/bspline/InterpolationCurve3d.js.map +1 -1
  384. package/lib/esm/bspline/KnotVector.js +2 -2
  385. package/lib/esm/bspline/KnotVector.js.map +1 -1
  386. package/lib/esm/bspline/SurfaceLocationDetail.js.map +1 -1
  387. package/lib/esm/clipping/AlternatingConvexClipTree.js +2 -2
  388. package/lib/esm/clipping/AlternatingConvexClipTree.js.map +1 -1
  389. package/lib/esm/clipping/BooleanClipFactory.js.map +1 -1
  390. package/lib/esm/clipping/BooleanClipNode.js.map +1 -1
  391. package/lib/esm/clipping/ClipPlane.js +1 -1
  392. package/lib/esm/clipping/ClipPlane.js.map +1 -1
  393. package/lib/esm/clipping/ClipPrimitive.js.map +1 -1
  394. package/lib/esm/clipping/ClipUtils.js +1 -1
  395. package/lib/esm/clipping/ClipUtils.js.map +1 -1
  396. package/lib/esm/clipping/ClipVector.js +1 -1
  397. package/lib/esm/clipping/ClipVector.js.map +1 -1
  398. package/lib/esm/clipping/ConvexClipPlaneSet.js +3 -3
  399. package/lib/esm/clipping/ConvexClipPlaneSet.js.map +1 -1
  400. package/lib/esm/clipping/UnionOfConvexClipPlaneSets.js +1 -1
  401. package/lib/esm/clipping/UnionOfConvexClipPlaneSets.js.map +1 -1
  402. package/lib/esm/clipping/internalContexts/LineStringOffsetClipperContext.js.map +1 -1
  403. package/lib/esm/core-geometry.js.map +1 -1
  404. package/lib/esm/curve/Arc3d.d.ts +40 -8
  405. package/lib/esm/curve/Arc3d.d.ts.map +1 -1
  406. package/lib/esm/curve/Arc3d.js +80 -22
  407. package/lib/esm/curve/Arc3d.js.map +1 -1
  408. package/lib/esm/curve/ConstructCurveBetweenCurves.js.map +1 -1
  409. package/lib/esm/curve/CoordinateXYZ.js.map +1 -1
  410. package/lib/esm/curve/CurveChainWithDistanceIndex.js +4 -4
  411. package/lib/esm/curve/CurveChainWithDistanceIndex.js.map +1 -1
  412. package/lib/esm/curve/CurveCollection.d.ts +16 -2
  413. package/lib/esm/curve/CurveCollection.d.ts.map +1 -1
  414. package/lib/esm/curve/CurveCollection.js +33 -2
  415. package/lib/esm/curve/CurveCollection.js.map +1 -1
  416. package/lib/esm/curve/CurveCurve.js.map +1 -1
  417. package/lib/esm/curve/CurveExtendMode.js.map +1 -1
  418. package/lib/esm/curve/CurveFactory.d.ts +87 -53
  419. package/lib/esm/curve/CurveFactory.d.ts.map +1 -1
  420. package/lib/esm/curve/CurveFactory.js +213 -135
  421. package/lib/esm/curve/CurveFactory.js.map +1 -1
  422. package/lib/esm/curve/CurveLocationDetail.js.map +1 -1
  423. package/lib/esm/curve/CurveOps.js.map +1 -1
  424. package/lib/esm/curve/CurvePrimitive.js.map +1 -1
  425. package/lib/esm/curve/CurveProcessor.js.map +1 -1
  426. package/lib/esm/curve/CurveTypes.js.map +1 -1
  427. package/lib/esm/curve/CurveWireMomentsXYZ.js.map +1 -1
  428. package/lib/esm/curve/GeometryQuery.js.map +1 -1
  429. package/lib/esm/curve/LineSegment3d.js.map +1 -1
  430. package/lib/esm/curve/LineString3d.d.ts +12 -8
  431. package/lib/esm/curve/LineString3d.d.ts.map +1 -1
  432. package/lib/esm/curve/LineString3d.js +34 -13
  433. package/lib/esm/curve/LineString3d.js.map +1 -1
  434. package/lib/esm/curve/Loop.d.ts +12 -6
  435. package/lib/esm/curve/Loop.d.ts.map +1 -1
  436. package/lib/esm/curve/Loop.js +12 -6
  437. package/lib/esm/curve/Loop.js.map +1 -1
  438. package/lib/esm/curve/OffsetOptions.js.map +1 -1
  439. package/lib/esm/curve/ParityRegion.js.map +1 -1
  440. package/lib/esm/curve/Path.js.map +1 -1
  441. package/lib/esm/curve/PointString3d.js.map +1 -1
  442. package/lib/esm/curve/ProxyCurve.js.map +1 -1
  443. package/lib/esm/curve/Query/ConsolidateAdjacentPrimitivesContext.js.map +1 -1
  444. package/lib/esm/curve/Query/CurveSplitContext.js.map +1 -1
  445. package/lib/esm/curve/Query/CylindricalRange.d.ts +8 -6
  446. package/lib/esm/curve/Query/CylindricalRange.d.ts.map +1 -1
  447. package/lib/esm/curve/Query/CylindricalRange.js +13 -9
  448. package/lib/esm/curve/Query/CylindricalRange.js.map +1 -1
  449. package/lib/esm/curve/Query/InOutTests.js.map +1 -1
  450. package/lib/esm/curve/Query/PlanarSubdivision.js.map +1 -1
  451. package/lib/esm/curve/Query/StrokeCountChain.js.map +1 -1
  452. package/lib/esm/curve/Query/StrokeCountMap.js.map +1 -1
  453. package/lib/esm/curve/RegionMomentsXY.js.map +1 -1
  454. package/lib/esm/curve/RegionOps.js.map +1 -1
  455. package/lib/esm/curve/RegionOpsClassificationSweeps.js +1 -1
  456. package/lib/esm/curve/RegionOpsClassificationSweeps.js.map +1 -1
  457. package/lib/esm/curve/StrokeOptions.d.ts +4 -4
  458. package/lib/esm/curve/StrokeOptions.d.ts.map +1 -1
  459. package/lib/esm/curve/StrokeOptions.js +1 -1
  460. package/lib/esm/curve/StrokeOptions.js.map +1 -1
  461. package/lib/esm/curve/UnionRegion.js.map +1 -1
  462. package/lib/esm/curve/internalContexts/AppendPlaneIntersectionStrokeHandler.js.map +1 -1
  463. package/lib/esm/curve/internalContexts/ChainCollectorContext.js.map +1 -1
  464. package/lib/esm/curve/internalContexts/CloneCurvesContext.js.map +1 -1
  465. package/lib/esm/curve/internalContexts/CloneWithExpandedLineStrings.js.map +1 -1
  466. package/lib/esm/curve/internalContexts/ClosestPointStrokeHandler.js.map +1 -1
  467. package/lib/esm/curve/internalContexts/CountLinearPartsSearchContext.js.map +1 -1
  468. package/lib/esm/curve/internalContexts/CurveCurveCloseApproachXY.js +5 -5
  469. package/lib/esm/curve/internalContexts/CurveCurveCloseApproachXY.js.map +1 -1
  470. package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.js +13 -13
  471. package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.js.map +1 -1
  472. package/lib/esm/curve/internalContexts/CurveCurveIntersectXYZ.js +5 -5
  473. package/lib/esm/curve/internalContexts/CurveCurveIntersectXYZ.js.map +1 -1
  474. package/lib/esm/curve/internalContexts/CurveLengthContext.js.map +1 -1
  475. package/lib/esm/curve/internalContexts/CurveOffsetXYHandler.js.map +1 -1
  476. package/lib/esm/curve/internalContexts/EllipticalArcApproximationContext.d.ts.map +1 -1
  477. package/lib/esm/curve/internalContexts/EllipticalArcApproximationContext.js +29 -23
  478. package/lib/esm/curve/internalContexts/EllipticalArcApproximationContext.js.map +1 -1
  479. package/lib/esm/curve/internalContexts/GapSearchContext.js.map +1 -1
  480. package/lib/esm/curve/internalContexts/MultiChainCollector.js.map +1 -1
  481. package/lib/esm/curve/internalContexts/NewtonRtoRStrokeHandler.js.map +1 -1
  482. package/lib/esm/curve/internalContexts/PlaneAltitudeRangeContext.js.map +1 -1
  483. package/lib/esm/curve/internalContexts/PolygonOffsetContext.js +4 -4
  484. package/lib/esm/curve/internalContexts/PolygonOffsetContext.js.map +1 -1
  485. package/lib/esm/curve/internalContexts/SumLengthsContext.js.map +1 -1
  486. package/lib/esm/curve/internalContexts/TransformInPlaceContext.js.map +1 -1
  487. package/lib/esm/curve/spiral/AustralianRailCorpXYEvaluator.js.map +1 -1
  488. package/lib/esm/curve/spiral/ClothoidSeries.js.map +1 -1
  489. package/lib/esm/curve/spiral/CubicEvaluator.js.map +1 -1
  490. package/lib/esm/curve/spiral/CzechSpiralEvaluator.js.map +1 -1
  491. package/lib/esm/curve/spiral/DirectHalfCosineSpiralEvaluator.js.map +1 -1
  492. package/lib/esm/curve/spiral/DirectSpiral3d.js.map +1 -1
  493. package/lib/esm/curve/spiral/IntegratedSpiral3d.js +2 -2
  494. package/lib/esm/curve/spiral/IntegratedSpiral3d.js.map +1 -1
  495. package/lib/esm/curve/spiral/MXCubicAlongArcSpiralEvaluator.js.map +1 -1
  496. package/lib/esm/curve/spiral/NormalizedTransition.js.map +1 -1
  497. package/lib/esm/curve/spiral/PolishCubicSpiralEvaluator.js.map +1 -1
  498. package/lib/esm/curve/spiral/TransitionConditionalProperties.js.map +1 -1
  499. package/lib/esm/curve/spiral/TransitionSpiral3d.js.map +1 -1
  500. package/lib/esm/curve/spiral/XYCurveEvaluator.js.map +1 -1
  501. package/lib/esm/geometry3d/Angle.js +16 -16
  502. package/lib/esm/geometry3d/Angle.js.map +1 -1
  503. package/lib/esm/geometry3d/AngleSweep.d.ts +1 -1
  504. package/lib/esm/geometry3d/AngleSweep.d.ts.map +1 -1
  505. package/lib/esm/geometry3d/AngleSweep.js +1 -1
  506. package/lib/esm/geometry3d/AngleSweep.js.map +1 -1
  507. package/lib/esm/geometry3d/BarycentricTriangle.d.ts +14 -8
  508. package/lib/esm/geometry3d/BarycentricTriangle.d.ts.map +1 -1
  509. package/lib/esm/geometry3d/BarycentricTriangle.js +17 -8
  510. package/lib/esm/geometry3d/BarycentricTriangle.js.map +1 -1
  511. package/lib/esm/geometry3d/BilinearPatch.js.map +1 -1
  512. package/lib/esm/geometry3d/CoincidentGeometryOps.js.map +1 -1
  513. package/lib/esm/geometry3d/Ellipsoid.js.map +1 -1
  514. package/lib/esm/geometry3d/FrameBuilder.js +4 -4
  515. package/lib/esm/geometry3d/FrameBuilder.js.map +1 -1
  516. package/lib/esm/geometry3d/FrustumAnimation.js.map +1 -1
  517. package/lib/esm/geometry3d/GeometryHandler.js.map +1 -1
  518. package/lib/esm/geometry3d/GrowableBlockedArray.js.map +1 -1
  519. package/lib/esm/geometry3d/GrowableFloat64Array.d.ts +2 -0
  520. package/lib/esm/geometry3d/GrowableFloat64Array.d.ts.map +1 -1
  521. package/lib/esm/geometry3d/GrowableFloat64Array.js +4 -0
  522. package/lib/esm/geometry3d/GrowableFloat64Array.js.map +1 -1
  523. package/lib/esm/geometry3d/GrowableXYArray.js.map +1 -1
  524. package/lib/esm/geometry3d/GrowableXYZArray.d.ts +32 -10
  525. package/lib/esm/geometry3d/GrowableXYZArray.d.ts.map +1 -1
  526. package/lib/esm/geometry3d/GrowableXYZArray.js +54 -16
  527. package/lib/esm/geometry3d/GrowableXYZArray.js.map +1 -1
  528. package/lib/esm/geometry3d/IndexedCollectionInterval.js.map +1 -1
  529. package/lib/esm/geometry3d/IndexedXYCollection.js.map +1 -1
  530. package/lib/esm/geometry3d/IndexedXYZCollection.d.ts +13 -2
  531. package/lib/esm/geometry3d/IndexedXYZCollection.d.ts.map +1 -1
  532. package/lib/esm/geometry3d/IndexedXYZCollection.js +24 -10
  533. package/lib/esm/geometry3d/IndexedXYZCollection.js.map +1 -1
  534. package/lib/esm/geometry3d/LongitudeLatitudeAltitude.js.map +1 -1
  535. package/lib/esm/geometry3d/Matrix3d.d.ts +11 -8
  536. package/lib/esm/geometry3d/Matrix3d.d.ts.map +1 -1
  537. package/lib/esm/geometry3d/Matrix3d.js +36 -34
  538. package/lib/esm/geometry3d/Matrix3d.js.map +1 -1
  539. package/lib/esm/geometry3d/OrderedRotationAngles.js +2 -2
  540. package/lib/esm/geometry3d/OrderedRotationAngles.js.map +1 -1
  541. package/lib/esm/geometry3d/Plane3d.js.map +1 -1
  542. package/lib/esm/geometry3d/Plane3dByOriginAndUnitNormal.js.map +1 -1
  543. package/lib/esm/geometry3d/Plane3dByOriginAndVectors.js.map +1 -1
  544. package/lib/esm/geometry3d/Point2dArrayCarrier.js.map +1 -1
  545. package/lib/esm/geometry3d/Point2dVector2d.js.map +1 -1
  546. package/lib/esm/geometry3d/Point3dArrayCarrier.js +1 -1
  547. package/lib/esm/geometry3d/Point3dArrayCarrier.js.map +1 -1
  548. package/lib/esm/geometry3d/Point3dVector3d.d.ts +6 -6
  549. package/lib/esm/geometry3d/Point3dVector3d.js +6 -6
  550. package/lib/esm/geometry3d/Point3dVector3d.js.map +1 -1
  551. package/lib/esm/geometry3d/PointHelpers.js +5 -5
  552. package/lib/esm/geometry3d/PointHelpers.js.map +1 -1
  553. package/lib/esm/geometry3d/PointStreaming.js.map +1 -1
  554. package/lib/esm/geometry3d/PolygonOps.d.ts +12 -6
  555. package/lib/esm/geometry3d/PolygonOps.d.ts.map +1 -1
  556. package/lib/esm/geometry3d/PolygonOps.js +117 -70
  557. package/lib/esm/geometry3d/PolygonOps.js.map +1 -1
  558. package/lib/esm/geometry3d/PolylineCompressionByEdgeOffset.js +3 -3
  559. package/lib/esm/geometry3d/PolylineCompressionByEdgeOffset.js.map +1 -1
  560. package/lib/esm/geometry3d/PolylineOps.d.ts +9 -5
  561. package/lib/esm/geometry3d/PolylineOps.d.ts.map +1 -1
  562. package/lib/esm/geometry3d/PolylineOps.js +9 -5
  563. package/lib/esm/geometry3d/PolylineOps.js.map +1 -1
  564. package/lib/esm/geometry3d/Range.js +4 -4
  565. package/lib/esm/geometry3d/Range.js.map +1 -1
  566. package/lib/esm/geometry3d/Ray2d.js.map +1 -1
  567. package/lib/esm/geometry3d/Ray3d.js.map +1 -1
  568. package/lib/esm/geometry3d/ReusableObjectCache.js.map +1 -1
  569. package/lib/esm/geometry3d/Segment1d.js.map +1 -1
  570. package/lib/esm/geometry3d/SortablePolygon.js.map +1 -1
  571. package/lib/esm/geometry3d/Transform.js.map +1 -1
  572. package/lib/esm/geometry3d/UVSurfaceOps.js.map +1 -1
  573. package/lib/esm/geometry3d/XYZProps.js.map +1 -1
  574. package/lib/esm/geometry3d/YawPitchRollAngles.js.map +1 -1
  575. package/lib/esm/geometry4d/Map4d.js.map +1 -1
  576. package/lib/esm/geometry4d/Matrix4d.js.map +1 -1
  577. package/lib/esm/geometry4d/MomentData.d.ts +72 -73
  578. package/lib/esm/geometry4d/MomentData.d.ts.map +1 -1
  579. package/lib/esm/geometry4d/MomentData.js +62 -64
  580. package/lib/esm/geometry4d/MomentData.js.map +1 -1
  581. package/lib/esm/geometry4d/PlaneByOriginAndVectors4d.js.map +1 -1
  582. package/lib/esm/geometry4d/Point4d.js.map +1 -1
  583. package/lib/esm/numerics/BandedSystem.js.map +1 -1
  584. package/lib/esm/numerics/BezierPolynomials.js.map +1 -1
  585. package/lib/esm/numerics/ClusterableArray.js +13 -13
  586. package/lib/esm/numerics/ClusterableArray.js.map +1 -1
  587. package/lib/esm/numerics/Complex.js.map +1 -1
  588. package/lib/esm/numerics/ConvexPolygon2d.js.map +1 -1
  589. package/lib/esm/numerics/Newton.js.map +1 -1
  590. package/lib/esm/numerics/PascalCoefficients.js +1 -1
  591. package/lib/esm/numerics/PascalCoefficients.js.map +1 -1
  592. package/lib/esm/numerics/PolarData.js +1 -1
  593. package/lib/esm/numerics/PolarData.js.map +1 -1
  594. package/lib/esm/numerics/Polynomials.d.ts +5 -5
  595. package/lib/esm/numerics/Polynomials.js +32 -32
  596. package/lib/esm/numerics/Polynomials.js.map +1 -1
  597. package/lib/esm/numerics/Quadrature.js +20 -20
  598. package/lib/esm/numerics/Quadrature.js.map +1 -1
  599. package/lib/esm/numerics/Range1dArray.js.map +1 -1
  600. package/lib/esm/numerics/SmallSystem.js.map +1 -1
  601. package/lib/esm/numerics/TriDiagonalSystem.js.map +1 -1
  602. package/lib/esm/numerics/UnionFind.js.map +1 -1
  603. package/lib/esm/numerics/UsageSums.js.map +1 -1
  604. package/lib/esm/polyface/AuxData.d.ts +2 -2
  605. package/lib/esm/polyface/AuxData.d.ts.map +1 -1
  606. package/lib/esm/polyface/AuxData.js +11 -3
  607. package/lib/esm/polyface/AuxData.js.map +1 -1
  608. package/lib/esm/polyface/BoxTopology.js +67 -67
  609. package/lib/esm/polyface/BoxTopology.js.map +1 -1
  610. package/lib/esm/polyface/FacetFaceData.js.map +1 -1
  611. package/lib/esm/polyface/FacetLocationDetail.js.map +1 -1
  612. package/lib/esm/polyface/FacetOrientation.js.map +1 -1
  613. package/lib/esm/polyface/GreedyTriangulationBetweenLineStrings.js +2 -2
  614. package/lib/esm/polyface/GreedyTriangulationBetweenLineStrings.js.map +1 -1
  615. package/lib/esm/polyface/IndexedEdgeMatcher.d.ts +27 -20
  616. package/lib/esm/polyface/IndexedEdgeMatcher.d.ts.map +1 -1
  617. package/lib/esm/polyface/IndexedEdgeMatcher.js +56 -30
  618. package/lib/esm/polyface/IndexedEdgeMatcher.js.map +1 -1
  619. package/lib/esm/polyface/IndexedPolyfaceVisitor.d.ts +2 -1
  620. package/lib/esm/polyface/IndexedPolyfaceVisitor.d.ts.map +1 -1
  621. package/lib/esm/polyface/IndexedPolyfaceVisitor.js +2 -1
  622. package/lib/esm/polyface/IndexedPolyfaceVisitor.js.map +1 -1
  623. package/lib/esm/polyface/Polyface.d.ts +3 -5
  624. package/lib/esm/polyface/Polyface.d.ts.map +1 -1
  625. package/lib/esm/polyface/Polyface.js +6 -13
  626. package/lib/esm/polyface/Polyface.js.map +1 -1
  627. package/lib/esm/polyface/PolyfaceBuilder.d.ts +14 -7
  628. package/lib/esm/polyface/PolyfaceBuilder.d.ts.map +1 -1
  629. package/lib/esm/polyface/PolyfaceBuilder.js +60 -65
  630. package/lib/esm/polyface/PolyfaceBuilder.js.map +1 -1
  631. package/lib/esm/polyface/PolyfaceClip.js.map +1 -1
  632. package/lib/esm/polyface/PolyfaceData.d.ts +13 -3
  633. package/lib/esm/polyface/PolyfaceData.d.ts.map +1 -1
  634. package/lib/esm/polyface/PolyfaceData.js +26 -9
  635. package/lib/esm/polyface/PolyfaceData.js.map +1 -1
  636. package/lib/esm/polyface/PolyfaceQuery.d.ts +2 -2
  637. package/lib/esm/polyface/PolyfaceQuery.d.ts.map +1 -1
  638. package/lib/esm/polyface/PolyfaceQuery.js +11 -10
  639. package/lib/esm/polyface/PolyfaceQuery.js.map +1 -1
  640. package/lib/esm/polyface/RangeLengthData.js.map +1 -1
  641. package/lib/esm/polyface/RangeTree/LineString3dRangeTreeContext.js.map +1 -1
  642. package/lib/esm/polyface/RangeTree/MinimumValueTester.js.map +1 -1
  643. package/lib/esm/polyface/RangeTree/Point3dArrayRangeTreeContext.js.map +1 -1
  644. package/lib/esm/polyface/RangeTree/PolyfaceRangeTreeContext.js.map +1 -1
  645. package/lib/esm/polyface/RangeTree/RangeTreeNode.js.map +1 -1
  646. package/lib/esm/polyface/RangeTree/RangeTreeSearchHandlers.js.map +1 -1
  647. package/lib/esm/polyface/TaggedNumericData.js.map +1 -1
  648. package/lib/esm/polyface/TriangleCandidate.js.map +1 -1
  649. package/lib/esm/polyface/multiclip/BuildAverageNormalsContext.js.map +1 -1
  650. package/lib/esm/polyface/multiclip/GriddedRaggedRange2dSet.js.map +1 -1
  651. package/lib/esm/polyface/multiclip/GriddedRaggedRange2dSetWithOverflow.js.map +1 -1
  652. package/lib/esm/polyface/multiclip/LinearSearchRange2dArray.js.map +1 -1
  653. package/lib/esm/polyface/multiclip/OffsetMeshContext.js.map +1 -1
  654. package/lib/esm/polyface/multiclip/Range2dSearchInterface.js.map +1 -1
  655. package/lib/esm/polyface/multiclip/RangeSearch.js +5 -5
  656. package/lib/esm/polyface/multiclip/RangeSearch.js.map +1 -1
  657. package/lib/esm/polyface/multiclip/SweepLineStringToFacetContext.js.map +1 -1
  658. package/lib/esm/polyface/multiclip/XYPointBuckets.js.map +1 -1
  659. package/lib/esm/serialization/BGFBAccessors.js.map +1 -1
  660. package/lib/esm/serialization/BGFBReader.js +22 -22
  661. package/lib/esm/serialization/BGFBReader.js.map +1 -1
  662. package/lib/esm/serialization/BGFBWriter.js.map +1 -1
  663. package/lib/esm/serialization/BentleyGeometryFlatBuffer.js.map +1 -1
  664. package/lib/esm/serialization/DeepCompare.js.map +1 -1
  665. package/lib/esm/serialization/GeometrySamples.d.ts +5 -5
  666. package/lib/esm/serialization/GeometrySamples.d.ts.map +1 -1
  667. package/lib/esm/serialization/GeometrySamples.js +112 -112
  668. package/lib/esm/serialization/GeometrySamples.js.map +1 -1
  669. package/lib/esm/serialization/IModelJsonSchema.js.map +1 -1
  670. package/lib/esm/serialization/SerializationHelpers.js.map +1 -1
  671. package/lib/esm/solid/Box.d.ts +9 -3
  672. package/lib/esm/solid/Box.d.ts.map +1 -1
  673. package/lib/esm/solid/Box.js +10 -5
  674. package/lib/esm/solid/Box.js.map +1 -1
  675. package/lib/esm/solid/Cone.d.ts +3 -2
  676. package/lib/esm/solid/Cone.d.ts.map +1 -1
  677. package/lib/esm/solid/Cone.js +3 -3
  678. package/lib/esm/solid/Cone.js.map +1 -1
  679. package/lib/esm/solid/LinearSweep.d.ts +9 -3
  680. package/lib/esm/solid/LinearSweep.d.ts.map +1 -1
  681. package/lib/esm/solid/LinearSweep.js +9 -4
  682. package/lib/esm/solid/LinearSweep.js.map +1 -1
  683. package/lib/esm/solid/RotationalSweep.d.ts +15 -4
  684. package/lib/esm/solid/RotationalSweep.d.ts.map +1 -1
  685. package/lib/esm/solid/RotationalSweep.js +20 -7
  686. package/lib/esm/solid/RotationalSweep.js.map +1 -1
  687. package/lib/esm/solid/RuledSweep.d.ts +35 -26
  688. package/lib/esm/solid/RuledSweep.d.ts.map +1 -1
  689. package/lib/esm/solid/RuledSweep.js +41 -28
  690. package/lib/esm/solid/RuledSweep.js.map +1 -1
  691. package/lib/esm/solid/SolidPrimitive.d.ts +12 -11
  692. package/lib/esm/solid/SolidPrimitive.d.ts.map +1 -1
  693. package/lib/esm/solid/SolidPrimitive.js +8 -5
  694. package/lib/esm/solid/SolidPrimitive.js.map +1 -1
  695. package/lib/esm/solid/Sphere.d.ts +17 -7
  696. package/lib/esm/solid/Sphere.d.ts.map +1 -1
  697. package/lib/esm/solid/Sphere.js +22 -16
  698. package/lib/esm/solid/Sphere.js.map +1 -1
  699. package/lib/esm/solid/SweepContour.d.ts +25 -16
  700. package/lib/esm/solid/SweepContour.d.ts.map +1 -1
  701. package/lib/esm/solid/SweepContour.js +25 -16
  702. package/lib/esm/solid/SweepContour.js.map +1 -1
  703. package/lib/esm/solid/TorusPipe.d.ts +8 -2
  704. package/lib/esm/solid/TorusPipe.d.ts.map +1 -1
  705. package/lib/esm/solid/TorusPipe.js +9 -5
  706. package/lib/esm/solid/TorusPipe.js.map +1 -1
  707. package/lib/esm/topology/ChainMerge.js +4 -4
  708. package/lib/esm/topology/ChainMerge.js.map +1 -1
  709. package/lib/esm/topology/Graph.js +5 -5
  710. package/lib/esm/topology/Graph.js.map +1 -1
  711. package/lib/esm/topology/HalfEdgeGraphFromIndexedLoopsContext.js.map +1 -1
  712. package/lib/esm/topology/HalfEdgeGraphSearch.js.map +1 -1
  713. package/lib/esm/topology/HalfEdgeGraphSpineContext.js +2 -2
  714. package/lib/esm/topology/HalfEdgeGraphSpineContext.js.map +1 -1
  715. package/lib/esm/topology/HalfEdgeGraphValidation.js.map +1 -1
  716. package/lib/esm/topology/HalfEdgeMarkSet.js.map +1 -1
  717. package/lib/esm/topology/HalfEdgeNodeXYZUV.js.map +1 -1
  718. package/lib/esm/topology/HalfEdgePointInGraphSearch.js.map +1 -1
  719. package/lib/esm/topology/HalfEdgePositionDetail.js.map +1 -1
  720. package/lib/esm/topology/HalfEdgePriorityQueue.js.map +1 -1
  721. package/lib/esm/topology/InsertAndRetriangulateContext.js.map +1 -1
  722. package/lib/esm/topology/MaskManager.js.map +1 -1
  723. package/lib/esm/topology/Merging.js.map +1 -1
  724. package/lib/esm/topology/RegularizeFace.js.map +1 -1
  725. package/lib/esm/topology/SignedDataSummary.js.map +1 -1
  726. package/lib/esm/topology/SpaceTriangulation.js.map +1 -1
  727. package/lib/esm/topology/Triangulation.js +11 -11
  728. package/lib/esm/topology/Triangulation.js.map +1 -1
  729. package/lib/esm/topology/XYParitySearchContext.js.map +1 -1
  730. package/package.json +5 -5
@@ -20,27 +20,31 @@ export declare class SweepContour {
20
20
  localToWorld: Transform;
21
21
  /** Axis used only in rotational case. */
22
22
  axis: Ray3d | undefined;
23
- /** caches */
23
+ /** Caches */
24
24
  private _xyStrokes?;
25
25
  private _facets?;
26
26
  private constructor();
27
- /** Create for linear sweep.
27
+ /**
28
+ * Create for linear sweep.
28
29
  * @param contour curve to sweep, CAPTURED. For best results, contour should be planar.
29
30
  * @param defaultNormal optional default normal for guiding coordinate frame setup.
30
31
  */
31
32
  static createForLinearSweep(contour: AnyCurve, defaultNormal?: Vector3d): SweepContour | undefined;
32
- /** Create for linear sweep.
33
- * @param points polygon to sweep, CAPTURED as a Loop. Closure point is optional. If multiple polygons are passed in, parity logic is employed.
33
+ /**
34
+ * Create for linear sweep.
35
+ * @param points polygon to sweep, CAPTURED as a Loop. Closure point is optional. If multiple polygons are passed in,
36
+ * parity logic is employed.
34
37
  * For best results, all points should be coplanar.
35
38
  * @param defaultNormal optional default normal for guiding coordinate frame setup.
36
39
  */
37
40
  static createForPolygon(points: MultiLineStringDataVariant, defaultNormal?: Vector3d): SweepContour | undefined;
38
- /** Create for rotational sweep.
39
- * @param contour curve to sweep, CAPTURED. For best results, contour should be planar.
41
+ /**
42
+ * Create for rotational sweep.
43
+ * @param contour curve to sweep, CAPTURED. For best results, contour should be coplanar with axis.
40
44
  * @param axis rotation axis
41
45
  */
42
46
  static createForRotation(contour: AnyCurve, axis: Ray3d): SweepContour | undefined;
43
- /** Return (Reference to) the curves */
47
+ /** Return (Reference to) the curves. */
44
48
  getCurves(): CurveCollection;
45
49
  /**
46
50
  * Apply `transform` to the curves, axis.
@@ -53,14 +57,15 @@ export declare class SweepContour {
53
57
  cloneTransformed(transform: Transform): SweepContour | undefined;
54
58
  /** Test for near equality of curves, frame, and axis. */
55
59
  isAlmostEqual(other: any): boolean;
56
- /** Recompute the local strokes cache for this contour */
60
+ /** Recompute the local strokes cache for this contour. */
57
61
  computeXYStrokes(options?: StrokeOptions): void;
58
- /** Return cached contour strokes */
62
+ /** Return cached contour strokes. */
59
63
  get xyStrokes(): CurveCollection | undefined;
60
64
  /**
61
65
  * Build the (cached) internal facets for the contour.
62
66
  * @param options primarily how to stroke the contour, but also how to facet it.
63
- * * By default, a triangulation is computed, but if `options.maximizeConvexFacets === true`, edges between coplanar triangles are removed to return maximally convex facets.
67
+ * * By default, a triangulation is computed, but if `options.maximizeConvexFacets === true`, edges between coplanar
68
+ * triangles are removed to return maximally convex facets.
64
69
  */
65
70
  buildFacets(options?: StrokeOptions): void;
66
71
  /**
@@ -68,21 +73,25 @@ export declare class SweepContour {
68
73
  * * This protects against PolyfaceBuilder reusing facets constructed with different options settings.
69
74
  */
70
75
  purgeFacets(): void;
71
- /** Emit facets to a builder.
76
+ /**
77
+ * Emit facets to a builder.
72
78
  * This method may cache and reuse facets over multiple calls.
73
79
  */
74
80
  emitFacets(builder: PolyfaceBuilder, reverse: boolean, transform?: Transform): void;
75
- /** Emit facets to a function
81
+ /**
82
+ * Emit facets to a function.
76
83
  * This method may cache and reuse facets over multiple calls.
77
- * @param announce callback to receive the facet set
78
- * @param options how to stroke the contour
84
+ * @param announce callback to receive the facet set.
85
+ * @param options how to stroke the contour.
79
86
  */
80
87
  announceFacets(announce: (facets: IndexedPolyface) => void, options?: StrokeOptions): void;
81
88
  /**
82
89
  * Create a UnionOfConvexClipPlaneSets that clips to the swept faceted contour region.
83
90
  * @param sweepVector the sweep direction and distance:
84
- * * If undefined, the sweep direction is along the contour normal and no caps are constructed (the sweep is infinite in both directions).
85
- * * If defined, the returned clipper is inverted if and only if sweepVector is in the opposite half-space as the computed contour normal.
91
+ * * If undefined, the sweep direction is along the contour normal and no caps are constructed (the sweep is infinite
92
+ * in both directions).
93
+ * * If defined, the returned clipper is inverted if and only if sweepVector is in the opposite half-space as the
94
+ * computed contour normal.
86
95
  * @param cap0 construct a clip plane equal to the contour plane. Note that `sweepVector` must be defined.
87
96
  * @param cap1 construct a clip plane parallel to the contour plane at the end of `sweepVector`.
88
97
  * @param options how to stroke the contour
@@ -1 +1 @@
1
- {"version":3,"file":"SweepContour.d.ts","sourceRoot":"","sources":["../../../src/solid/SweepContour.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,0BAA0B,EAAE,MAAM,wCAAwC,CAAC;AACpF,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAE3D,OAAO,EAAE,QAAQ,EAAa,MAAM,qBAAqB,CAAC;AAM1D,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAEvD,OAAO,EAAE,0BA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,MAAM,EAAE,eAAe,KAAK,IAAI,EAAE,OAAO,CAAC,EAAE,aAAa,GAAG,IAAI;IAKjG;;;;;;;;;;;OAWG;IACI,iCAAiC,CACtC,WAAW,CAAC,EAAE,QAAQ,EAAE,IAAI,GAAE,OAAe,EAAE,IAAI,GAAE,OAAe,EAAE,OAAO,CAAC,EAAE,aAAa,GAC5F,0BAA0B,GAAG,SAAS;CA8C1C"}
@@ -36,7 +36,8 @@ export class SweepContour {
36
36
  this.localToWorld = map;
37
37
  this.axis = axis;
38
38
  }
39
- /** Create for linear sweep.
39
+ /**
40
+ * Create for linear sweep.
40
41
  * @param contour curve to sweep, CAPTURED. For best results, contour should be planar.
41
42
  * @param defaultNormal optional default normal for guiding coordinate frame setup.
42
43
  */
@@ -47,8 +48,10 @@ export class SweepContour {
47
48
  }
48
49
  return undefined;
49
50
  }
50
- /** Create for linear sweep.
51
- * @param points polygon to sweep, CAPTURED as a Loop. Closure point is optional. If multiple polygons are passed in, parity logic is employed.
51
+ /**
52
+ * Create for linear sweep.
53
+ * @param points polygon to sweep, CAPTURED as a Loop. Closure point is optional. If multiple polygons are passed in,
54
+ * parity logic is employed.
52
55
  * For best results, all points should be coplanar.
53
56
  * @param defaultNormal optional default normal for guiding coordinate frame setup.
54
57
  */
@@ -70,8 +73,9 @@ export class SweepContour {
70
73
  }
71
74
  return undefined;
72
75
  }
73
- /** Create for rotational sweep.
74
- * @param contour curve to sweep, CAPTURED. For best results, contour should be planar.
76
+ /**
77
+ * Create for rotational sweep.
78
+ * @param contour curve to sweep, CAPTURED. For best results, contour should be coplanar with axis.
75
79
  * @param axis rotation axis
76
80
  */
77
81
  static createForRotation(contour, axis) {
@@ -82,7 +86,7 @@ export class SweepContour {
82
86
  }
83
87
  return undefined;
84
88
  }
85
- /** Return (Reference to) the curves */
89
+ /** Return (Reference to) the curves. */
86
90
  getCurves() { return this.curves; }
87
91
  /**
88
92
  * Apply `transform` to the curves, axis.
@@ -130,7 +134,7 @@ export class SweepContour {
130
134
  return false;
131
135
  return true;
132
136
  }
133
- /** Recompute the local strokes cache for this contour */
137
+ /** Recompute the local strokes cache for this contour. */
134
138
  computeXYStrokes(options) {
135
139
  this._xyStrokes = undefined;
136
140
  const worldToLocal = this.localToWorld.inverse();
@@ -140,14 +144,15 @@ export class SweepContour {
140
144
  this._xyStrokes = strokes;
141
145
  }
142
146
  }
143
- /** Return cached contour strokes */
147
+ /** Return cached contour strokes. */
144
148
  get xyStrokes() {
145
149
  return this._xyStrokes;
146
150
  }
147
151
  /**
148
152
  * Build the (cached) internal facets for the contour.
149
153
  * @param options primarily how to stroke the contour, but also how to facet it.
150
- * * By default, a triangulation is computed, but if `options.maximizeConvexFacets === true`, edges between coplanar triangles are removed to return maximally convex facets.
154
+ * * By default, a triangulation is computed, but if `options.maximizeConvexFacets === true`, edges between coplanar
155
+ * triangles are removed to return maximally convex facets.
151
156
  */
152
157
  buildFacets(options) {
153
158
  if (this._facets)
@@ -170,7 +175,8 @@ export class SweepContour {
170
175
  purgeFacets() {
171
176
  this._facets = undefined;
172
177
  }
173
- /** Emit facets to a builder.
178
+ /**
179
+ * Emit facets to a builder.
174
180
  * This method may cache and reuse facets over multiple calls.
175
181
  */
176
182
  emitFacets(builder, reverse, transform) {
@@ -178,10 +184,11 @@ export class SweepContour {
178
184
  if (this._facets)
179
185
  builder.addIndexedPolyface(this._facets, reverse, transform);
180
186
  }
181
- /** Emit facets to a function
187
+ /**
188
+ * Emit facets to a function.
182
189
  * This method may cache and reuse facets over multiple calls.
183
- * @param announce callback to receive the facet set
184
- * @param options how to stroke the contour
190
+ * @param announce callback to receive the facet set.
191
+ * @param options how to stroke the contour.
185
192
  */
186
193
  announceFacets(announce, options) {
187
194
  this.buildFacets(options);
@@ -191,8 +198,10 @@ export class SweepContour {
191
198
  /**
192
199
  * Create a UnionOfConvexClipPlaneSets that clips to the swept faceted contour region.
193
200
  * @param sweepVector the sweep direction and distance:
194
- * * If undefined, the sweep direction is along the contour normal and no caps are constructed (the sweep is infinite in both directions).
195
- * * If defined, the returned clipper is inverted if and only if sweepVector is in the opposite half-space as the computed contour normal.
201
+ * * If undefined, the sweep direction is along the contour normal and no caps are constructed (the sweep is infinite
202
+ * in both directions).
203
+ * * If defined, the returned clipper is inverted if and only if sweepVector is in the opposite half-space as the
204
+ * computed contour normal.
196
205
  * @param cap0 construct a clip plane equal to the contour plane. Note that `sweepVector` must be defined.
197
206
  * @param cap1 construct a clip plane parallel to the contour plane at the end of `sweepVector`.
198
207
  * @param options how to stroke the contour
@@ -206,7 +215,7 @@ export class SweepContour {
206
215
  sweepVector = this.localToWorld.matrix.columnZ();
207
216
  }
208
217
  options.maximizeConvexFacets = true; // produce fewer ConvexClipPlaneSets
209
- // It's a trip around the barn, but it's easy to make a polyface and scan it . . .
218
+ // it's a trip around the barn, but it's easy to make a polyface and scan it
210
219
  this.buildFacets(options);
211
220
  const facets = this._facets;
212
221
  if (facets) {
@@ -1 +1 @@
1
- {"version":3,"file":"SweepContour.js","sourceRoot":"","sources":["../../../src/solid/SweepContour.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F;;GAEG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAE,0BAA0B,EAAE,MAAM,wCAAwC,CAAC;AAEpF,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAEzD,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AACrC,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AACrC,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE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WAAW,EAAE,CAAC;gBACjD,IAAI,IAAI;oBACN,OAAO,CAAC,mBAAmB,CAAC,SAAS,CAAC,oBAAoB,CAAC,aAAa,EAAE,YAAY,CAAC,CAAC,CAAC;gBAC3F,IAAI,IAAI;oBACN,OAAO,CAAC,mBAAmB,CAAC,SAAS,CAAC,oBAAoB,CAAC,aAAa,EAAE,YAAY,CAAC,CAAC,CAAC;gBAC3F,MAAM,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;YAC/B,CAAC;YACD,OAAO,MAAM,CAAC;QAChB,CAAC;QACD,OAAO,SAAS,CAAC;IACnB,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 { ClipPlane } from \"../clipping/ClipPlane\";\r\nimport { ConvexClipPlaneSet } from \"../clipping/ConvexClipPlaneSet\";\r\nimport { UnionOfConvexClipPlaneSets } from \"../clipping/UnionOfConvexClipPlaneSets\";\r\nimport { CurveCollection } from \"../curve/CurveCollection\";\r\nimport { CurvePrimitive } from \"../curve/CurvePrimitive\";\r\nimport { AnyCurve, AnyRegion } from \"../curve/CurveTypes\";\r\nimport { LineString3d } from \"../curve/LineString3d\";\r\nimport { Loop } from \"../curve/Loop\";\r\nimport { ParityRegion } from \"../curve/ParityRegion\";\r\nimport { Path } from \"../curve/Path\";\r\nimport { RegionOps } from \"../curve/RegionOps\";\r\nimport { StrokeOptions } from \"../curve/StrokeOptions\";\r\nimport { FrameBuilder } from \"../geometry3d/FrameBuilder\";\r\nimport { MultiLineStringDataVariant } from \"../geometry3d/IndexedXYZCollection\";\r\nimport { Point3d, Vector3d } from \"../geometry3d/Point3dVector3d\";\r\nimport { Ray3d } from \"../geometry3d/Ray3d\";\r\nimport { Transform } from \"../geometry3d/Transform\";\r\nimport { IndexedPolyface } from \"../polyface/Polyface\";\r\nimport { PolyfaceBuilder } from \"../polyface/PolyfaceBuilder\";\r\n\r\n/**\r\n * Sweepable planar contour with Transform for local to world interaction.\r\n * * The surface/solid classes `LinearSweep`, `RotationalSweep`, `RuledSweep` use this for their swept contours.\r\n * @public\r\n */\r\nexport class SweepContour {\r\n /** The underlying curve collection, in its world coordinates position. */\r\n public curves: CurveCollection;\r\n /** coordinate frame that in which the curves are all in the xy plane. */\r\n public localToWorld: Transform;\r\n /** Axis used only in rotational case. */\r\n public axis: Ray3d | undefined;\r\n\r\n /** caches */\r\n private _xyStrokes?: CurveCollection;\r\n private _facets?: IndexedPolyface;\r\n\r\n private constructor(contour: AnyCurve, map: Transform, axis: Ray3d | undefined) {\r\n if (contour instanceof CurvePrimitive) {\r\n // this.curves is a CurveCollection (not AnyCurve) so that contour type determines closure.\r\n // This is the only time we detect CurvePrimitive closure and wrap as a relevant CurveChain.\r\n // Note that we are ASSUMING closure means planar here. This is potentially problematic.\r\n const primitive = contour;\r\n contour = contour.startPoint().isAlmostEqual(contour.endPoint()) ? new Loop() : new Path();\r\n contour.tryAddChild(primitive);\r\n }\r\n this.curves = contour;\r\n this.localToWorld = map;\r\n this.axis = axis;\r\n }\r\n /** Create for linear sweep.\r\n * @param contour curve to sweep, CAPTURED. For best results, contour should be planar.\r\n * @param defaultNormal optional default normal for guiding coordinate frame setup.\r\n */\r\n public static createForLinearSweep(contour: AnyCurve, defaultNormal?: Vector3d): SweepContour | undefined {\r\n const localToWorld = FrameBuilder.createRightHandedFrame(defaultNormal, contour);\r\n if (localToWorld) {\r\n return new SweepContour(contour, localToWorld, undefined);\r\n }\r\n return undefined;\r\n }\r\n /** Create for linear sweep.\r\n * @param points polygon to sweep, CAPTURED as a Loop. Closure point is optional. If multiple polygons are passed in, parity logic is employed.\r\n * For best results, all points should be coplanar.\r\n * @param defaultNormal optional default normal for guiding coordinate frame setup.\r\n */\r\n public static createForPolygon(points: MultiLineStringDataVariant, defaultNormal?: Vector3d): SweepContour | undefined {\r\n const localToWorld = FrameBuilder.createRightHandedFrame(defaultNormal, points);\r\n if (localToWorld) {\r\n const linestrings = LineString3d.createArrayOfLineString3d(points);\r\n const loops = [];\r\n for (const ls of linestrings) {\r\n ls.addClosurePoint();\r\n loops.push(Loop.create(ls));\r\n }\r\n if (loops.length === 1) {\r\n return new SweepContour(loops[0], localToWorld, undefined);\r\n } else if (loops.length > 1) {\r\n return new SweepContour(ParityRegion.createLoops(loops), localToWorld, undefined);\r\n }\r\n }\r\n return undefined;\r\n }\r\n /** Create for rotational sweep.\r\n * @param contour curve to sweep, CAPTURED. For best results, contour should be planar.\r\n * @param axis rotation axis\r\n */\r\n public static createForRotation(contour: AnyCurve, axis: Ray3d): SweepContour | undefined {\r\n // createRightHandedFrame -- the axis is a last-gasp resolver for in-plane vectors.\r\n const localToWorld = FrameBuilder.createRightHandedFrame(undefined, contour, axis);\r\n if (localToWorld) {\r\n return new SweepContour(contour, localToWorld, axis.clone());\r\n }\r\n return undefined;\r\n }\r\n /** Return (Reference to) the curves */\r\n public getCurves(): CurveCollection { return this.curves; }\r\n /**\r\n * Apply `transform` to the curves, axis.\r\n * * The local to world frame is reconstructed for the transformed curves.\r\n */\r\n public tryTransformInPlace(transform: Transform): boolean {\r\n if (this.curves.tryTransformInPlace(transform)) {\r\n if (this.axis)\r\n this.axis.transformInPlace(transform);\r\n\r\n const localToWorld = this.axis !== undefined\r\n ? FrameBuilder.createRightHandedFrame(undefined, this.curves, this.axis)\r\n : FrameBuilder.createRightHandedFrame(undefined, this.curves);\r\n if (localToWorld) {\r\n this.localToWorld.setFrom(localToWorld);\r\n this._xyStrokes = undefined;\r\n return true;\r\n }\r\n }\r\n return false;\r\n }\r\n /** Return a deep clone. */\r\n public clone(): SweepContour {\r\n return new SweepContour(this.curves.clone(), this.localToWorld.clone(), this.axis);\r\n }\r\n /** Return a transformed clone. */\r\n public cloneTransformed(transform: Transform): SweepContour | undefined {\r\n const newContour = this.clone();\r\n if (newContour.tryTransformInPlace(transform))\r\n return newContour;\r\n return undefined;\r\n }\r\n /** Test for near equality of curves, frame, and axis. */\r\n public isAlmostEqual(other: any): boolean {\r\n if (! (other instanceof SweepContour))\r\n return false;\r\n if (!this.curves.isAlmostEqual(other.curves))\r\n return false;\r\n if (!this.localToWorld.isAlmostEqual(other.localToWorld))\r\n return false;\r\n if (this.axis && other.axis) {\r\n if (!this.axis.isAlmostEqual(other.axis))\r\n return false;\r\n } else if (this.axis || other.axis)\r\n return false;\r\n return true;\r\n }\r\n\r\n /** Recompute the local strokes cache for this contour */\r\n public computeXYStrokes(options?: StrokeOptions): void {\r\n this._xyStrokes = undefined;\r\n const worldToLocal = this.localToWorld.inverse();\r\n if (worldToLocal) {\r\n const strokes = this.curves.cloneStroked(options);\r\n if (strokes.tryTransformInPlace(worldToLocal))\r\n this._xyStrokes = strokes;\r\n }\r\n }\r\n /** Return cached contour strokes */\r\n public get xyStrokes(): CurveCollection | undefined {\r\n return this._xyStrokes;\r\n }\r\n\r\n /**\r\n * Build the (cached) internal facets for the contour.\r\n * @param options primarily how to stroke the contour, but also how to facet it.\r\n * * By default, a triangulation is computed, but if `options.maximizeConvexFacets === true`, edges between coplanar triangles are removed to return maximally convex facets.\r\n */\r\n public buildFacets(options?: StrokeOptions): void {\r\n if (this._facets)\r\n return;\r\n if (!this.curves.isAnyRegion())\r\n return;\r\n const worldToLocal = this.localToWorld.inverse();\r\n if (!worldToLocal)\r\n return;\r\n const localRegion = this.curves.cloneTransformed(worldToLocal) as AnyRegion | undefined;\r\n if (!localRegion)\r\n return;\r\n if (this._facets = RegionOps.facetRegionXY(localRegion, options))\r\n this._facets.tryTransformInPlace(this.localToWorld);\r\n }\r\n /**\r\n * Delete facet cache.\r\n * * This protects against PolyfaceBuilder reusing facets constructed with different options settings.\r\n */\r\n public purgeFacets() {\r\n this._facets = undefined;\r\n }\r\n /** Emit facets to a builder.\r\n * This method may cache and reuse facets over multiple calls.\r\n */\r\n public emitFacets(builder: PolyfaceBuilder, reverse: boolean, transform?: Transform) {\r\n this.buildFacets(builder.options);\r\n if (this._facets)\r\n builder.addIndexedPolyface(this._facets, reverse, transform);\r\n }\r\n /** Emit facets to a function\r\n * This method may cache and reuse facets over multiple calls.\r\n * @param announce callback to receive the facet set\r\n * @param options how to stroke the contour\r\n */\r\n public announceFacets(announce: (facets: IndexedPolyface) => void, options?: StrokeOptions): void {\r\n this.buildFacets(options);\r\n if (this._facets)\r\n announce(this._facets);\r\n }\r\n /**\r\n * Create a UnionOfConvexClipPlaneSets that clips to the swept faceted contour region.\r\n * @param sweepVector the sweep direction and distance:\r\n * * If undefined, the sweep direction is along the contour normal and no caps are constructed (the sweep is infinite in both directions).\r\n * * If defined, the returned clipper is inverted if and only if sweepVector is in the opposite half-space as the computed contour normal.\r\n * @param cap0 construct a clip plane equal to the contour plane. Note that `sweepVector` must be defined.\r\n * @param cap1 construct a clip plane parallel to the contour plane at the end of `sweepVector`.\r\n * @param options how to stroke the contour\r\n * @returns clipper defined by faceting then sweeping the contour region\r\n */\r\n public sweepToUnionOfConvexClipPlaneSets(sweepVector?: Vector3d, cap0: boolean = false, cap1: boolean = false, options?: StrokeOptions): UnionOfConvexClipPlaneSets | undefined {\r\n if (!options)\r\n options = StrokeOptions.createForFacets();\r\n if (!sweepVector) {\r\n cap0 = cap1 = false;\r\n sweepVector = this.localToWorld.matrix.columnZ();\r\n }\r\n options.maximizeConvexFacets = true; // produce fewer ConvexClipPlaneSets\r\n // It's a trip around the barn, but it's easy to make a polyface and scan it . . .\r\n this.buildFacets(options);\r\n const facets = this._facets;\r\n if (facets) {\r\n const point0 = Point3d.create();\r\n const point1 = Point3d.create();\r\n const result = UnionOfConvexClipPlaneSets.createEmpty();\r\n const visitor = facets.createVisitor(1);\r\n for (visitor.reset(); visitor.moveToNextFacet();) {\r\n const numEdges = visitor.point.length - 1;\r\n const clipper = ConvexClipPlaneSet.createEmpty();\r\n for (let i = 0; i < numEdges; i++) {\r\n visitor.point.getPoint3dAtUncheckedPointIndex(i, point0);\r\n visitor.point.getPoint3dAtUncheckedPointIndex(i + 1, point1);\r\n const plane = ClipPlane.createEdgeAndUpVector(point1, point0, sweepVector);\r\n const visible = visitor.edgeVisible[i];\r\n plane?.setFlags(!visible, !visible);\r\n clipper.addPlaneToConvexSet(plane);\r\n }\r\n result.addConvexSet(clipper);\r\n }\r\n if (cap0 || cap1) {\r\n const zVector = this.localToWorld.matrix.columnZ();\r\n const plane0Origin = this.localToWorld.getOrigin();\r\n const plane1Origin = plane0Origin.plus(sweepVector);\r\n const inwardNormal0 = zVector.clone();\r\n const inwardNormal1 = zVector.negate();\r\n const clipper = ConvexClipPlaneSet.createEmpty();\r\n if (cap0)\r\n clipper.addPlaneToConvexSet(ClipPlane.createNormalAndPoint(inwardNormal0, plane0Origin));\r\n if (cap1)\r\n clipper.addPlaneToConvexSet(ClipPlane.createNormalAndPoint(inwardNormal1, plane1Origin));\r\n result.addConvexSet(clipper);\r\n }\r\n return result;\r\n }\r\n return undefined;\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"SweepContour.js","sourceRoot":"","sources":["../../../src/solid/SweepContour.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F;;GAEG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAE,0BAA0B,EAAE,MAAM,wCAAwC,CAAC;AAEpF,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAEzD,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AACrC,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AACrC,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,E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AAa,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;gBACvC,MAAM,OAAO,GAAG,kBAAkB,CAAC,WAAW,EAAE,CAAC;gBACjD,IAAI,IAAI;oBACN,OAAO,CAAC,mBAAmB,CAAC,SAAS,CAAC,oBAAoB,CAAC,aAAa,EAAE,YAAY,CAAC,CAAC,CAAC;gBAC3F,IAAI,IAAI;oBACN,OAAO,CAAC,mBAAmB,CAAC,SAAS,CAAC,oBAAoB,CAAC,aAAa,EAAE,YAAY,CAAC,CAAC,CAAC;gBAC3F,MAAM,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;YAC/B,CAAC;YACD,OAAO,MAAM,CAAC;QAChB,CAAC;QACD,OAAO,SAAS,CAAC;IACnB,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 { ClipPlane } from \"../clipping/ClipPlane\";\nimport { ConvexClipPlaneSet } from \"../clipping/ConvexClipPlaneSet\";\nimport { UnionOfConvexClipPlaneSets } from \"../clipping/UnionOfConvexClipPlaneSets\";\nimport { CurveCollection } from \"../curve/CurveCollection\";\nimport { CurvePrimitive } from \"../curve/CurvePrimitive\";\nimport { AnyCurve, AnyRegion } from \"../curve/CurveTypes\";\nimport { LineString3d } from \"../curve/LineString3d\";\nimport { Loop } from \"../curve/Loop\";\nimport { ParityRegion } from \"../curve/ParityRegion\";\nimport { Path } from \"../curve/Path\";\nimport { RegionOps } from \"../curve/RegionOps\";\nimport { StrokeOptions } from \"../curve/StrokeOptions\";\nimport { FrameBuilder } from \"../geometry3d/FrameBuilder\";\nimport { MultiLineStringDataVariant } from \"../geometry3d/IndexedXYZCollection\";\nimport { Point3d, Vector3d } from \"../geometry3d/Point3dVector3d\";\nimport { Ray3d } from \"../geometry3d/Ray3d\";\nimport { Transform } from \"../geometry3d/Transform\";\nimport { IndexedPolyface } from \"../polyface/Polyface\";\nimport { PolyfaceBuilder } from \"../polyface/PolyfaceBuilder\";\n\n/**\n * Sweepable planar contour with Transform for local to world interaction.\n * * The surface/solid classes `LinearSweep`, `RotationalSweep`, `RuledSweep` use this for their swept contours.\n * @public\n */\nexport class SweepContour {\n /** The underlying curve collection, in its world coordinates position. */\n public curves: CurveCollection;\n /** coordinate frame that in which the curves are all in the xy plane. */\n public localToWorld: Transform;\n /** Axis used only in rotational case. */\n public axis: Ray3d | undefined;\n /** Caches */\n private _xyStrokes?: CurveCollection;\n private _facets?: IndexedPolyface;\n\n private constructor(contour: AnyCurve, map: Transform, axis: Ray3d | undefined) {\n if (contour instanceof CurvePrimitive) {\n // this.curves is a CurveCollection (not AnyCurve) so that contour type determines closure.\n // This is the only time we detect CurvePrimitive closure and wrap as a relevant CurveChain.\n // Note that we are ASSUMING closure means planar here. This is potentially problematic.\n const primitive = contour;\n contour = contour.startPoint().isAlmostEqual(contour.endPoint()) ? new Loop() : new Path();\n contour.tryAddChild(primitive);\n }\n this.curves = contour;\n this.localToWorld = map;\n this.axis = axis;\n }\n /**\n * Create for linear sweep.\n * @param contour curve to sweep, CAPTURED. For best results, contour should be planar.\n * @param defaultNormal optional default normal for guiding coordinate frame setup.\n */\n public static createForLinearSweep(contour: AnyCurve, defaultNormal?: Vector3d): SweepContour | undefined {\n const localToWorld = FrameBuilder.createRightHandedFrame(defaultNormal, contour);\n if (localToWorld) {\n return new SweepContour(contour, localToWorld, undefined);\n }\n return undefined;\n }\n /**\n * Create for linear sweep.\n * @param points polygon to sweep, CAPTURED as a Loop. Closure point is optional. If multiple polygons are passed in,\n * parity logic is employed.\n * For best results, all points should be coplanar.\n * @param defaultNormal optional default normal for guiding coordinate frame setup.\n */\n public static createForPolygon(points: MultiLineStringDataVariant, defaultNormal?: Vector3d): SweepContour | undefined {\n const localToWorld = FrameBuilder.createRightHandedFrame(defaultNormal, points);\n if (localToWorld) {\n const linestrings = LineString3d.createArrayOfLineString3d(points);\n const loops = [];\n for (const ls of linestrings) {\n ls.addClosurePoint();\n loops.push(Loop.create(ls));\n }\n if (loops.length === 1) {\n return new SweepContour(loops[0], localToWorld, undefined);\n } else if (loops.length > 1) {\n return new SweepContour(ParityRegion.createLoops(loops), localToWorld, undefined);\n }\n }\n return undefined;\n }\n /**\n * Create for rotational sweep.\n * @param contour curve to sweep, CAPTURED. For best results, contour should be coplanar with axis.\n * @param axis rotation axis\n */\n public static createForRotation(contour: AnyCurve, axis: Ray3d): SweepContour | undefined {\n // createRightHandedFrame -- the axis is a last-gasp resolver for in-plane vectors.\n const localToWorld = FrameBuilder.createRightHandedFrame(undefined, contour, axis);\n if (localToWorld) {\n return new SweepContour(contour, localToWorld, axis.clone());\n }\n return undefined;\n }\n /** Return (Reference to) the curves. */\n public getCurves(): CurveCollection { return this.curves; }\n /**\n * Apply `transform` to the curves, axis.\n * * The local to world frame is reconstructed for the transformed curves.\n */\n public tryTransformInPlace(transform: Transform): boolean {\n if (this.curves.tryTransformInPlace(transform)) {\n if (this.axis)\n this.axis.transformInPlace(transform);\n const localToWorld = this.axis !== undefined\n ? FrameBuilder.createRightHandedFrame(undefined, this.curves, this.axis)\n : FrameBuilder.createRightHandedFrame(undefined, this.curves);\n if (localToWorld) {\n this.localToWorld.setFrom(localToWorld);\n this._xyStrokes = undefined;\n return true;\n }\n }\n return false;\n }\n /** Return a deep clone. */\n public clone(): SweepContour {\n return new SweepContour(this.curves.clone(), this.localToWorld.clone(), this.axis);\n }\n /** Return a transformed clone. */\n public cloneTransformed(transform: Transform): SweepContour | undefined {\n const newContour = this.clone();\n if (newContour.tryTransformInPlace(transform))\n return newContour;\n return undefined;\n }\n /** Test for near equality of curves, frame, and axis. */\n public isAlmostEqual(other: any): boolean {\n if (!(other instanceof SweepContour))\n return false;\n if (!this.curves.isAlmostEqual(other.curves))\n return false;\n if (!this.localToWorld.isAlmostEqual(other.localToWorld))\n return false;\n if (this.axis && other.axis) {\n if (!this.axis.isAlmostEqual(other.axis))\n return false;\n } else if (this.axis || other.axis)\n return false;\n return true;\n }\n /** Recompute the local strokes cache for this contour. */\n public computeXYStrokes(options?: StrokeOptions): void {\n this._xyStrokes = undefined;\n const worldToLocal = this.localToWorld.inverse();\n if (worldToLocal) {\n const strokes = this.curves.cloneStroked(options);\n if (strokes.tryTransformInPlace(worldToLocal))\n this._xyStrokes = strokes;\n }\n }\n /** Return cached contour strokes. */\n public get xyStrokes(): CurveCollection | undefined {\n return this._xyStrokes;\n }\n /**\n * Build the (cached) internal facets for the contour.\n * @param options primarily how to stroke the contour, but also how to facet it.\n * * By default, a triangulation is computed, but if `options.maximizeConvexFacets === true`, edges between coplanar\n * triangles are removed to return maximally convex facets.\n */\n public buildFacets(options?: StrokeOptions): void {\n if (this._facets)\n return;\n if (!this.curves.isAnyRegion())\n return;\n const worldToLocal = this.localToWorld.inverse();\n if (!worldToLocal)\n return;\n const localRegion = this.curves.cloneTransformed(worldToLocal) as AnyRegion | undefined;\n if (!localRegion)\n return;\n if (this._facets = RegionOps.facetRegionXY(localRegion, options))\n this._facets.tryTransformInPlace(this.localToWorld);\n }\n /**\n * Delete facet cache.\n * * This protects against PolyfaceBuilder reusing facets constructed with different options settings.\n */\n public purgeFacets() {\n this._facets = undefined;\n }\n /**\n * Emit facets to a builder.\n * This method may cache and reuse facets over multiple calls.\n */\n public emitFacets(builder: PolyfaceBuilder, reverse: boolean, transform?: Transform) {\n this.buildFacets(builder.options);\n if (this._facets)\n builder.addIndexedPolyface(this._facets, reverse, transform);\n }\n /**\n * Emit facets to a function.\n * This method may cache and reuse facets over multiple calls.\n * @param announce callback to receive the facet set.\n * @param options how to stroke the contour.\n */\n public announceFacets(announce: (facets: IndexedPolyface) => void, options?: StrokeOptions): void {\n this.buildFacets(options);\n if (this._facets)\n announce(this._facets);\n }\n /**\n * Create a UnionOfConvexClipPlaneSets that clips to the swept faceted contour region.\n * @param sweepVector the sweep direction and distance:\n * * If undefined, the sweep direction is along the contour normal and no caps are constructed (the sweep is infinite\n * in both directions).\n * * If defined, the returned clipper is inverted if and only if sweepVector is in the opposite half-space as the\n * computed contour normal.\n * @param cap0 construct a clip plane equal to the contour plane. Note that `sweepVector` must be defined.\n * @param cap1 construct a clip plane parallel to the contour plane at the end of `sweepVector`.\n * @param options how to stroke the contour\n * @returns clipper defined by faceting then sweeping the contour region\n */\n public sweepToUnionOfConvexClipPlaneSets(\n sweepVector?: Vector3d, cap0: boolean = false, cap1: boolean = false, options?: StrokeOptions,\n ): UnionOfConvexClipPlaneSets | undefined {\n if (!options)\n options = StrokeOptions.createForFacets();\n if (!sweepVector) {\n cap0 = cap1 = false;\n sweepVector = this.localToWorld.matrix.columnZ();\n }\n options.maximizeConvexFacets = true; // produce fewer ConvexClipPlaneSets\n // it's a trip around the barn, but it's easy to make a polyface and scan it\n this.buildFacets(options);\n const facets = this._facets;\n if (facets) {\n const point0 = Point3d.create();\n const point1 = Point3d.create();\n const result = UnionOfConvexClipPlaneSets.createEmpty();\n const visitor = facets.createVisitor(1);\n for (visitor.reset(); visitor.moveToNextFacet();) {\n const numEdges = visitor.point.length - 1;\n const clipper = ConvexClipPlaneSet.createEmpty();\n for (let i = 0; i < numEdges; i++) {\n visitor.point.getPoint3dAtUncheckedPointIndex(i, point0);\n visitor.point.getPoint3dAtUncheckedPointIndex(i + 1, point1);\n const plane = ClipPlane.createEdgeAndUpVector(point1, point0, sweepVector);\n const visible = visitor.edgeVisible[i];\n plane?.setFlags(!visible, !visible);\n clipper.addPlaneToConvexSet(plane);\n }\n result.addConvexSet(clipper);\n }\n if (cap0 || cap1) {\n const zVector = this.localToWorld.matrix.columnZ();\n const plane0Origin = this.localToWorld.getOrigin();\n const plane1Origin = plane0Origin.plus(sweepVector);\n const inwardNormal0 = zVector.clone();\n const inwardNormal1 = zVector.negate();\n const clipper = ConvexClipPlaneSet.createEmpty();\n if (cap0)\n clipper.addPlaneToConvexSet(ClipPlane.createNormalAndPoint(inwardNormal0, plane0Origin));\n if (cap1)\n clipper.addPlaneToConvexSet(ClipPlane.createNormalAndPoint(inwardNormal1, plane1Origin));\n result.addConvexSet(clipper);\n }\n return result;\n }\n return undefined;\n }\n}\n"]}
@@ -47,9 +47,15 @@ export declare class TorusPipe extends SolidPrimitive implements UVSurface, UVSu
47
47
  protected constructor(map: Transform, radiusA: number, radiusB: number, sweep: Angle, capped: boolean);
48
48
  /** return a copy of the TorusPipe */
49
49
  clone(): TorusPipe;
50
- /** Apply `transform` to the local coordinate system. */
50
+ /**
51
+ * Apply `transform` to the local coordinate system.
52
+ * * Fails if the transformation is singular.
53
+ */
51
54
  tryTransformInPlace(transform: Transform): boolean;
52
- /** Clone this TorusPipe and transform the clone */
55
+ /**
56
+ * Clone this TorusPipe and transform the clone.
57
+ * * Fails if the transformation is singular.
58
+ */
53
59
  cloneTransformed(transform: Transform): TorusPipe | undefined;
54
60
  /** Create a new `TorusPipe`
55
61
  * @param frame local to world transformation. For best results, the matrix part should be a pure rotation.
@@ -1 +1 @@
1
- {"version":3,"file":"TorusPipe.d.ts","sourceRoot":"","sources":["../../../src/solid/TorusPipe.ts"],"names":[],"mappings":"AAKA;;GAEG;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAIvD,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAE5C,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,8BAA8B,EAAE,MAAM,+BAA+B,CAAC;AAC3G,OAAO,EAAE,yBAAyB,EAAE,MAAM,yCAAyC,CAAC;AACpF,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AACzD,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,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;IAyB5D;OACG;IACI,kBAAkB,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM;IAC5C,4EAA4E;IACrE,yBAAyB,CAAC,OAAO,EAAE,eAAe,GAAG,GAAG;IAI/D;;;OAGG;IACI,gBAAgB,CAAC,CAAC,EAAE,MAAM,GAAG,eAAe,GAAG,SAAS;IAW/D,gFAAgF;IACzE,gBAAgB,CAAC,SAAS,EAAE,MAAM,GAAG,eAAe,GAAG,SAAS;IAavE,yDAAyD;IAClD,WAAW,CAAC,aAAa,EAAE,OAAO,EAAE,SAAS,CAAC,EAAE,SAAS;IAmDhE;;;OAGG;IACI,iBAAiB,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,OAAO,GAAG,OAAO;IAUzE;;;OAGG;IACI,4BAA4B,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,yBAAyB,GAAG,yBAAyB;IAoBxH;;;;OAIG;IACI,wBAAwB,IAAI,QAAQ;IAK3C;;OAEG;IACH,IAAW,cAAc,IAAI,OAAO,CAEnC;CAEF"}
@@ -57,19 +57,23 @@ export class TorusPipe extends SolidPrimitive {
57
57
  result._isReversed = this._isReversed;
58
58
  return result;
59
59
  }
60
- /** Apply `transform` to the local coordinate system. */
60
+ /**
61
+ * Apply `transform` to the local coordinate system.
62
+ * * Fails if the transformation is singular.
63
+ */
61
64
  tryTransformInPlace(transform) {
62
65
  if (transform.matrix.isSingular())
63
66
  return false;
64
67
  transform.multiplyTransformTransform(this._localToWorld, this._localToWorld);
65
68
  return true;
66
69
  }
67
- /** Clone this TorusPipe and transform the clone */
70
+ /**
71
+ * Clone this TorusPipe and transform the clone.
72
+ * * Fails if the transformation is singular.
73
+ */
68
74
  cloneTransformed(transform) {
69
75
  const result = this.clone();
70
- if (!result.tryTransformInPlace(transform))
71
- return undefined;
72
- return result;
76
+ return result.tryTransformInPlace(transform) ? result : undefined;
73
77
  }
74
78
  /** Create a new `TorusPipe`
75
79
  * @param frame local to world transformation. For best results, the matrix part should be a pure rotation.
@@ -1 +1 @@
1
- {"version":3,"file":"TorusPipe.js","sourceRoot":"","sources":["../../../src/solid/TorusPipe.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F;;GAEG;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAGvC,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AACrC,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AACrC,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAEtD,OAAO,EAAE,yBAAyB,EAAE,MAAM,yCAAyC,CAAC;AACpF,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AAGzD,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,OAAO,SAAU,SAAQ,cAAc;IAU3C,qCAAqC;IACrC,YAAsB,GAAc,EAAE,OAAe,EAAE,OAAe,EAAE,KAAY,EAAE,MAAe;QACnG,KAAK,CAAC,MAAM,CAAC,CAAC;QAXhB,wCAAwC;QACxB,uBAAkB,GAAG,WAAW,CAAC;QAW/C,IAAI,CAAC,aAAa,GAAG,GAAG,CAAC;QACzB,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;QACxB,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;QACxB,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;QACpB,IAAI,CAAC,WAAW,GAAG,KAAK,CAAC;IAC3B,CAAC;IACD,qCAAqC;IAC9B,KAAK;QACV,MAAM,MAAM,GAAG,IAAI,SAA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AC,sBAAsB,CACrD,IAAI,CAAC,aAAa,CAAC,WAAW,CAAC,QAAQ,GAAG,GAAG,EAAE,QAAQ,GAAG,GAAG,EAAE,OAAO,CAAC,EACvE,IAAI,CAAC,aAAa,CAAC,iBAAiB,CAAC,CAAC,QAAQ,GAAG,OAAO,GAAG,IAAI,EAAE,CAAC,QAAQ,GAAG,OAAO,GAAG,IAAI,EAAE,OAAO,GAAG,IAAI,CAAC,EAC5G,IAAI,CAAC,aAAa,CAAC,iBAAiB,CAAC,CAAC,GAAG,GAAG,QAAQ,GAAG,MAAM,EAAE,GAAG,GAAG,QAAQ,GAAG,MAAM,EAAE,CAAC,CAAC,EAC1F,MAAM,CAAC,CAAC;IACZ,CAAC;IACD;;;;OAIG;IACI,wBAAwB;QAC7B,MAAM,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,cAAc,EAAE,CAAC,CAAC;QAC1C,MAAM,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,cAAc,EAAE,CAAC,CAAC;QAC1C,OAAO,QAAQ,CAAC,MAAM,CAAC,CAAC,GAAG,IAAI,CAAC,EAAE,GAAG,GAAG,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IAC3E,CAAC;IACD;;OAEG;IACH,IAAW,cAAc;QACvB,OAAO,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC;IACjD,CAAC;CAEF","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 { Arc3d } from \"../curve/Arc3d\";\r\nimport { CurveCollection } from \"../curve/CurveCollection\";\r\nimport { GeometryQuery } from \"../curve/GeometryQuery\";\r\nimport { Loop } from \"../curve/Loop\";\r\nimport { Path } from \"../curve/Path\";\r\nimport { Geometry } from \"../Geometry\";\r\nimport { Angle } from \"../geometry3d/Angle\";\r\nimport { AngleSweep } from \"../geometry3d/AngleSweep\";\r\nimport { GeometryHandler, UVSurface, UVSurfaceIsoParametricDistance } from \"../geometry3d/GeometryHandler\";\r\nimport { Plane3dByOriginAndVectors } from \"../geometry3d/Plane3dByOriginAndVectors\";\r\nimport { Vector2d } from \"../geometry3d/Point2dVector2d\";\r\nimport { Point3d, Vector3d } from \"../geometry3d/Point3dVector3d\";\r\nimport { Range3d } from \"../geometry3d/Range\";\r\nimport { Transform } from \"../geometry3d/Transform\";\r\nimport { SolidPrimitive } from \"./SolidPrimitive\";\r\n\r\n/**\r\n * A torus pipe is a partial torus (donut).\r\n * * In its local coordinate system, the z-axis passes through the donut hole.\r\n * * The \"major hoop\" circular arc is defined for theta in the angular sweep. Its formula in local coordinates:\r\n * * `vectorTheta0 = (radiusA, 0, 0)`\r\n * * `vectorTheta90 = (0, radiusA, 0)`\r\n * * `M(theta) = vectorTheta0 * cos(theta) + vectorTheta90 * sin(theta)`\r\n * * The \"minor hoop\" circular arc is defined for phi in [0,2pi]. Its formula, centered at the origin:\r\n * * `vectorPhi0 = (radiusB * cos(theta), radiusB * sin(theta), 0)`\r\n * * `vectorPhi90 = (0, 0, radiusB)`\r\n * * `m(phi) = vectorPhi0 * cos(phi) + vectorPhi90 * sin(phi)`\r\n * * Thus the torus pipe in local coordinates has the formula:\r\n * * `T(theta, phi) = M(theta) + m(phi)`\r\n * * The stored form of the torus pipe is oriented for positive volume:\r\n * * Both radii are positive, with radiusA >= radiusB > 0\r\n * * The sweep is positive\r\n * * The coordinate system has positive determinant.\r\n * * For uv parameterization,\r\n * * u is around the minor hoop, with u in [0,1] mapping to phi in [0, 2pi]\r\n * * v is along the major hoop, with v in [0,1] mapping to theta in the angular sweep\r\n * * a constant v section is a full circle\r\n * * a constant u section is an arc with the same angular sweep as the torusPipe\r\n * @public\r\n */\r\nexport class TorusPipe extends SolidPrimitive implements UVSurface, UVSurfaceIsoParametricDistance {\r\n /** String name for schema properties */\r\n public readonly solidPrimitiveType = \"torusPipe\";\r\n\r\n private _localToWorld: Transform; // nominally rigid, but x,z column scales contribute to radiusA,radiusB\r\n private _radiusA: number; // radius of (large) circle in xy plane\r\n private _radiusB: number; // radius of (small) circle in xz plane.\r\n private _sweep: Angle;\r\n private _isReversed: boolean;\r\n\r\n // constructor captures the pointers!\r\n protected constructor(map: Transform, radiusA: number, radiusB: number, sweep: Angle, capped: boolean) {\r\n super(capped);\r\n this._localToWorld = map;\r\n this._radiusA = radiusA;\r\n this._radiusB = radiusB;\r\n this._sweep = sweep;\r\n this._isReversed = false;\r\n }\r\n /** return a copy of the TorusPipe */\r\n public clone(): TorusPipe {\r\n const result = new TorusPipe(this._localToWorld.clone(), this._radiusA, this._radiusB, this._sweep.clone(), this.capped);\r\n result._isReversed = this._isReversed;\r\n return result;\r\n }\r\n /** Apply `transform` to the local coordinate system. */\r\n public tryTransformInPlace(transform: Transform): boolean {\r\n if (transform.matrix.isSingular())\r\n return false;\r\n transform.multiplyTransformTransform(this._localToWorld, this._localToWorld);\r\n return true;\r\n }\r\n /** Clone this TorusPipe and transform the clone */\r\n public cloneTransformed(transform: Transform): TorusPipe | undefined {\r\n const result = this.clone();\r\n if (!result.tryTransformInPlace(transform))\r\n return undefined;\r\n return result;\r\n }\r\n /** Create a new `TorusPipe`\r\n * @param frame local to world transformation. For best results, the matrix part should be a pure rotation.\r\n * @param majorRadius major hoop radius\r\n * @param minorRadius minor hoop radius\r\n * @param sweep sweep angle for major circle, with positive sweep from x axis towards y axis.\r\n * @param capped true for circular caps\r\n */\r\n public static createInFrame(frame: Transform, majorRadius: number, minorRadius: number, sweep: Angle, capped: boolean): TorusPipe | undefined {\r\n // force near-zero radii to true zero\r\n majorRadius = Math.abs(Geometry.correctSmallMetricDistance(majorRadius));\r\n minorRadius = Math.abs(Geometry.correctSmallMetricDistance(minorRadius));\r\n if (majorRadius < minorRadius)\r\n return undefined;\r\n if (majorRadius === 0.0)\r\n return undefined;\r\n if (minorRadius === 0.0)\r\n return undefined;\r\n if (sweep.isAlmostZero)\r\n return undefined;\r\n\r\n // remove mirror and negative sweep\r\n let yScale = 1.0;\r\n let zScale = 1.0;\r\n let isReversed = false;\r\n if (frame.matrix.determinant() < 0.0)\r\n zScale *= -1.0;\r\n const sweep1 = sweep.clone();\r\n if (sweep.radians < 0.0) {\r\n sweep1.setRadians(-sweep.radians);\r\n zScale *= -1.0;\r\n yScale *= -1.0;\r\n isReversed = true;\r\n }\r\n const frame1 = frame.clone();\r\n frame1.matrix.scaleColumnsInPlace(1, yScale, zScale);\r\n\r\n const result = new TorusPipe(frame1, majorRadius, minorRadius, sweep1, capped);\r\n result._isReversed = isReversed;\r\n return result;\r\n }\r\n\r\n /** Create a TorusPipe from the typical parameters of the Dgn file */\r\n public static createDgnTorusPipe(center: Point3d, vectorX: Vector3d, vectorY: Vector3d, majorRadius: number, minorRadius: number, sweep: Angle, capped: boolean) {\r\n const vectorZ = vectorX.unitCrossProductWithDefault(vectorY, 0, 0, 1);\r\n const frame = Transform.createOriginAndMatrixColumns(center, vectorX, vectorY, vectorZ);\r\n return TorusPipe.createInFrame(frame, majorRadius, minorRadius, sweep, capped);\r\n }\r\n /**\r\n * Create a TorusPipe from major arc and minor radius.\r\n * For best results, `arc` should be circular; otherwise, circularity is coerced.\r\n */\r\n public static createAlongArc(arc: Arc3d, minorRadius: number, capped: boolean): TorusPipe | undefined {\r\n if (!Angle.isAlmostEqualRadiansAllowPeriodShift(0.0, arc.sweep.startRadians))\r\n arc = arc.cloneInRotatedBasis(arc.sweep.startAngle);\r\n if (!arc.isCircular) { // ensure circularity by squaring the axes and equating their lengths\r\n const perpVector90 = arc.perpendicularVector.sizedCrossProduct(arc.vector0, arc.matrixRef.columnXMagnitude());\r\n if (!perpVector90)\r\n return undefined;\r\n arc = Arc3d.create(arc.center, arc.vector0, perpVector90, arc.sweep);\r\n }\r\n const data = arc.toScaledMatrix3d();\r\n const rigidFrame = Transform.createOriginAndMatrix(arc.center, data.axes);\r\n return TorusPipe.createInFrame(rigidFrame, data.r0, minorRadius, Angle.createRadians(arc.sweep.sweepRadians), capped);\r\n }\r\n\r\n /** Return a coordinate frame (right handed, unit axes)\r\n * * origin at center of major circle\r\n * * major circle in plane of first two columns\r\n * * last column perpendicular to first two\r\n */\r\n public getConstructiveFrame(): Transform | undefined {\r\n return this._localToWorld.cloneRigid();\r\n }\r\n /** Return the center of the torus pipe (inside the donut hole) */\r\n public cloneCenter(): Point3d { return this._localToWorld.getOrigin(); }\r\n /** return unit vector along the x axis (in the major hoop plane) */\r\n public cloneVectorX(): Vector3d {\r\n const xAxis = this._localToWorld.matrix.columnX();\r\n return xAxis.normalizeWithDefault(1, 0, 0, xAxis);\r\n }\r\n /** return unit vector along the y axis (in the major hoop plane) */\r\n public cloneVectorY(): Vector3d {\r\n const yAxis = this._localToWorld.matrix.columnY();\r\n return yAxis.normalizeWithDefault(0, 1, 0, yAxis);\r\n }\r\n /** return unit vector along the z axis */\r\n public cloneVectorZ(): Vector3d {\r\n const zAxis = this._localToWorld.matrix.columnZ();\r\n return zAxis.normalizeWithDefault(0, 0, 1, zAxis);\r\n }\r\n /** get the major hoop radius (`radiusA`) in world coordinates */\r\n public getMajorRadius(): number { return this._radiusA * this._localToWorld.matrix.columnXMagnitude(); }\r\n /** get the minor hoop radius (`radiusB`) in world coordinates */\r\n public getMinorRadius(): number { return this._radiusB * this._localToWorld.matrix.columnZMagnitude(); }\r\n /** get the sweep angle along the major circle. */\r\n public getSweepAngle(): Angle { return this._sweep.clone(); }\r\n /** Ask if this TorusPipe is labeled as reversed */\r\n public getIsReversed(): boolean { return this._isReversed; }\r\n /** Return the sweep angle as a fraction of full 360 degrees (2PI radians) */\r\n public getThetaFraction(): number { return this._sweep.radians / (Math.PI * 2.0); }\r\n /** Return a (clone of) the TorusPipe's local to world transformation. */\r\n public cloneLocalToWorld(): Transform { return this._localToWorld.clone(); }\r\n /** ask if `other` is an instance of `TorusPipe` */\r\n public isSameGeometryClass(other: any): boolean { return other instanceof TorusPipe; }\r\n\r\n /** test if `this` and `other` have nearly equal geometry */\r\n public override isAlmostEqual(other: GeometryQuery): boolean {\r\n if (other instanceof TorusPipe) {\r\n if ((!this._sweep.isFullCircle) && this.capped !== other.capped)\r\n return false;\r\n // Compare getter output so that we can equate TorusPipes created/transformed in equivalent ways.\r\n // In particular, the column vectors contribute their scale to the radii, so we ignore their length.\r\n if (!this.cloneCenter().isAlmostEqual(other.cloneCenter()))\r\n return false;\r\n if (!this.cloneVectorX().isAlmostEqual(other.cloneVectorX()))\r\n return false;\r\n if (!this.cloneVectorY().isAlmostEqual(other.cloneVectorY()))\r\n return false;\r\n if (!this.cloneVectorZ().isAlmostEqual(other.cloneVectorZ()))\r\n return false;\r\n if (!Geometry.isSameCoordinate(this.getMinorRadius(), other.getMinorRadius()))\r\n return false;\r\n if (!Geometry.isSameCoordinate(this.getMajorRadius(), other.getMajorRadius()))\r\n return false;\r\n if (!this.getSweepAngle().isAlmostEqualNoPeriodShift(other.getSweepAngle()))\r\n return false;\r\n // ignore _isReversed; it doesn't affect geometry\r\n return true;\r\n }\r\n return false;\r\n }\r\n /** Return the angle (in radians) for given fractional position around the major hoop.\r\n */\r\n public vFractionToRadians(v: number): number { return this._sweep.radians * v; }\r\n /** Second step of double dispatch: call `handler.handleTorusPipe(this)` */\r\n public dispatchToGeometryHandler(handler: GeometryHandler): any {\r\n return handler.handleTorusPipe(this);\r\n }\r\n\r\n /**\r\n * Return the Arc3d section at vFraction. For the TorusPipe, this is a minor circle.\r\n * @param vFraction fractional position along the sweep direction\r\n */\r\n public constantVSection(v: number): CurveCollection | undefined {\r\n const thetaRadians = this.vFractionToRadians(v);\r\n const c0 = Math.cos(thetaRadians);\r\n const s0 = Math.sin(thetaRadians);\r\n const majorRadius = this._radiusA;\r\n const minorRadius = this._radiusB;\r\n const center = this._localToWorld.multiplyXYZ(majorRadius * c0, majorRadius * s0, 0);\r\n const vector0 = this._localToWorld.multiplyVectorXYZ(minorRadius * c0, minorRadius * s0, 0);\r\n const vector90 = this._localToWorld.multiplyVectorXYZ(0, 0, minorRadius);\r\n return Loop.create(Arc3d.create(center, vector0, vector90));\r\n }\r\n /** Return an arc at constant u, and arc sweep matching this TorusPipe sweep. */\r\n public constantUSection(uFraction: number): CurveCollection | undefined {\r\n const theta1Radians = this._sweep.radians;\r\n const phiRadians = uFraction * 2 * Math.PI;\r\n const majorRadius = this._radiusA;\r\n const minorRadius = this._radiusB;\r\n const transform = this._localToWorld;\r\n const axes = transform.matrix;\r\n const center = this._localToWorld.multiplyXYZ(0, 0, minorRadius * Math.sin(phiRadians));\r\n const rxy = majorRadius + minorRadius * Math.cos(phiRadians);\r\n const vector0 = axes.multiplyXYZ(rxy, 0, 0);\r\n const vector90 = axes.multiplyXYZ(0, rxy, 0);\r\n return Path.create(Arc3d.create(center, vector0, vector90, AngleSweep.createStartEndRadians(0.0, theta1Radians)));\r\n }\r\n /** extend `rangeToExtend` to include this `TorusPipe` */\r\n public extendRange(rangeToExtend: Range3d, transform?: Transform) {\r\n const theta1Radians = this._sweep.radians;\r\n const majorRadius = this._radiusA;\r\n const minorRadius = this._radiusB;\r\n const transform0 = this._localToWorld;\r\n const numThetaSample = Math.ceil(theta1Radians / (Math.PI / 16.0));\r\n const numHalfPhiSample = 16;\r\n let phi0 = 0;\r\n let dPhi = 0;\r\n let numPhiSample = 0;\r\n let theta = 0;\r\n let cosTheta = 0;\r\n let sinTheta = 0;\r\n let rxy = 0;\r\n let phi = 0;\r\n let j = 0;\r\n const dTheta = theta1Radians / numThetaSample;\r\n for (let i = 0; i <= numThetaSample; i++) {\r\n theta = i * dTheta;\r\n cosTheta = Math.cos(theta);\r\n sinTheta = Math.sin(theta);\r\n // At the ends, do the entire phi circle.\r\n // Otherwise only do the outer half\r\n if (i === 0 || i === numThetaSample) {\r\n phi0 = -Math.PI;\r\n dPhi = 2.0 * Math.PI / numHalfPhiSample;\r\n numPhiSample = numHalfPhiSample;\r\n } else {\r\n phi0 = -0.5 * Math.PI;\r\n dPhi = Math.PI / numHalfPhiSample;\r\n numPhiSample = 2 * numHalfPhiSample - 1;\r\n }\r\n if (transform) {\r\n for (j = 0; j <= numPhiSample; j++) {\r\n phi = phi0 + j * dPhi;\r\n rxy = majorRadius + minorRadius * Math.cos(phi);\r\n rangeToExtend.extendTransformTransformedXYZ(transform, transform0,\r\n cosTheta * rxy, sinTheta * rxy,\r\n Math.sin(phi) * minorRadius);\r\n }\r\n } else {\r\n for (j = 0; j <= numPhiSample; j++) {\r\n phi = phi0 + j * dPhi;\r\n rxy = majorRadius + minorRadius * Math.cos(phi);\r\n rangeToExtend.extendTransformedXYZ(transform0,\r\n cosTheta * rxy, sinTheta * rxy,\r\n Math.sin(phi) * minorRadius);\r\n }\r\n }\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 thetaRadians = v * this._sweep.radians;\r\n const phiRadians = u * Math.PI * 2.0;\r\n const cosTheta = Math.cos(thetaRadians);\r\n const sinTheta = Math.sin(thetaRadians);\r\n const majorRadius = this._radiusA;\r\n const minorRadius = this._radiusB;\r\n const rxy = majorRadius + Math.cos(phiRadians) * minorRadius;\r\n return this._localToWorld.multiplyXYZ(rxy * cosTheta, rxy * sinTheta, minorRadius * Math.sin(phiRadians), result);\r\n }\r\n /** Evaluate as a uv surface, returning point and two vectors.\r\n * @param u fractional position in minor (phi)\r\n * @param v fractional position on major (theta) arc\r\n */\r\n public uvFractionToPointAndTangents(u: number, v: number, result?: Plane3dByOriginAndVectors): Plane3dByOriginAndVectors {\r\n const thetaRadians = v * this._sweep.radians;\r\n const phiRadians = u * Math.PI * 2.0;\r\n const fTheta = this._sweep.radians;\r\n const fPhi = Math.PI * 2.0;\r\n const cosTheta = Math.cos(thetaRadians);\r\n const sinTheta = Math.sin(thetaRadians);\r\n const sinPhi = Math.sin(phiRadians);\r\n const cosPhi = Math.cos(phiRadians);\r\n const majorRadius = this._radiusA;\r\n const minorRadius = this._radiusB;\r\n const rxy = majorRadius + Math.cos(phiRadians) * minorRadius;\r\n const rSinPhi = minorRadius * sinPhi;\r\n const rCosPhi = minorRadius * cosPhi; // appears only as derivative of rSinPhi.\r\n return Plane3dByOriginAndVectors.createOriginAndVectors(\r\n this._localToWorld.multiplyXYZ(cosTheta * rxy, sinTheta * rxy, rSinPhi),\r\n this._localToWorld.multiplyVectorXYZ(-cosTheta * rSinPhi * fPhi, -sinTheta * rSinPhi * fPhi, rCosPhi * fPhi),\r\n this._localToWorld.multiplyVectorXYZ(-rxy * sinTheta * fTheta, rxy * cosTheta * fTheta, 0),\r\n result);\r\n }\r\n /**\r\n * Directional distance query\r\n * * u direction is around the (full) minor hoop\r\n * * v direction is around the outer radius, sum of (absolute values of) major and minor radii.\r\n */\r\n public maxIsoParametricDistance(): Vector2d {\r\n const a = Math.abs(this.getMajorRadius());\r\n const b = Math.abs(this.getMinorRadius());\r\n return Vector2d.create(b * Math.PI * 2.0, (a + b) * this._sweep.radians);\r\n }\r\n /**\r\n * @return true if this is a closed volume.\r\n */\r\n public get isClosedVolume(): boolean {\r\n return this.capped || this._sweep.isFullCircle;\r\n }\r\n\r\n}\r\n"]}
1
+ {"version":3,"file":"TorusPipe.js","sourceRoot":"","sources":["../../../src/solid/TorusPipe.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F;;GAEG;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAGvC,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AACrC,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AACrC,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CA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AAC;IACD;;;;OAIG;IACI,wBAAwB;QAC7B,MAAM,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,cAAc,EAAE,CAAC,CAAC;QAC1C,MAAM,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,cAAc,EAAE,CAAC,CAAC;QAC1C,OAAO,QAAQ,CAAC,MAAM,CAAC,CAAC,GAAG,IAAI,CAAC,EAAE,GAAG,GAAG,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IAC3E,CAAC;IACD;;OAEG;IACH,IAAW,cAAc;QACvB,OAAO,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC;IACjD,CAAC;CAEF","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 { Arc3d } from \"../curve/Arc3d\";\nimport { CurveCollection } from \"../curve/CurveCollection\";\nimport { GeometryQuery } from \"../curve/GeometryQuery\";\nimport { Loop } from \"../curve/Loop\";\nimport { Path } from \"../curve/Path\";\nimport { Geometry } from \"../Geometry\";\nimport { Angle } from \"../geometry3d/Angle\";\nimport { AngleSweep } from \"../geometry3d/AngleSweep\";\nimport { GeometryHandler, UVSurface, UVSurfaceIsoParametricDistance } from \"../geometry3d/GeometryHandler\";\nimport { Plane3dByOriginAndVectors } from \"../geometry3d/Plane3dByOriginAndVectors\";\nimport { Vector2d } from \"../geometry3d/Point2dVector2d\";\nimport { Point3d, Vector3d } from \"../geometry3d/Point3dVector3d\";\nimport { Range3d } from \"../geometry3d/Range\";\nimport { Transform } from \"../geometry3d/Transform\";\nimport { SolidPrimitive } from \"./SolidPrimitive\";\n\n/**\n * A torus pipe is a partial torus (donut).\n * * In its local coordinate system, the z-axis passes through the donut hole.\n * * The \"major hoop\" circular arc is defined for theta in the angular sweep. Its formula in local coordinates:\n * * `vectorTheta0 = (radiusA, 0, 0)`\n * * `vectorTheta90 = (0, radiusA, 0)`\n * * `M(theta) = vectorTheta0 * cos(theta) + vectorTheta90 * sin(theta)`\n * * The \"minor hoop\" circular arc is defined for phi in [0,2pi]. Its formula, centered at the origin:\n * * `vectorPhi0 = (radiusB * cos(theta), radiusB * sin(theta), 0)`\n * * `vectorPhi90 = (0, 0, radiusB)`\n * * `m(phi) = vectorPhi0 * cos(phi) + vectorPhi90 * sin(phi)`\n * * Thus the torus pipe in local coordinates has the formula:\n * * `T(theta, phi) = M(theta) + m(phi)`\n * * The stored form of the torus pipe is oriented for positive volume:\n * * Both radii are positive, with radiusA >= radiusB > 0\n * * The sweep is positive\n * * The coordinate system has positive determinant.\n * * For uv parameterization,\n * * u is around the minor hoop, with u in [0,1] mapping to phi in [0, 2pi]\n * * v is along the major hoop, with v in [0,1] mapping to theta in the angular sweep\n * * a constant v section is a full circle\n * * a constant u section is an arc with the same angular sweep as the torusPipe\n * @public\n */\nexport class TorusPipe extends SolidPrimitive implements UVSurface, UVSurfaceIsoParametricDistance {\n /** String name for schema properties */\n public readonly solidPrimitiveType = \"torusPipe\";\n\n private _localToWorld: Transform; // nominally rigid, but x,z column scales contribute to radiusA,radiusB\n private _radiusA: number; // radius of (large) circle in xy plane\n private _radiusB: number; // radius of (small) circle in xz plane.\n private _sweep: Angle;\n private _isReversed: boolean;\n\n // constructor captures the pointers!\n protected constructor(map: Transform, radiusA: number, radiusB: number, sweep: Angle, capped: boolean) {\n super(capped);\n this._localToWorld = map;\n this._radiusA = radiusA;\n this._radiusB = radiusB;\n this._sweep = sweep;\n this._isReversed = false;\n }\n /** return a copy of the TorusPipe */\n public clone(): TorusPipe {\n const result = new TorusPipe(this._localToWorld.clone(), this._radiusA, this._radiusB, this._sweep.clone(), this.capped);\n result._isReversed = this._isReversed;\n return result;\n }\n /**\n * Apply `transform` to the local coordinate system.\n * * Fails if the transformation is singular.\n */\n public tryTransformInPlace(transform: Transform): boolean {\n if (transform.matrix.isSingular())\n return false;\n transform.multiplyTransformTransform(this._localToWorld, this._localToWorld);\n return true;\n }\n /**\n * Clone this TorusPipe and transform the clone.\n * * Fails if the transformation is singular.\n */\n public cloneTransformed(transform: Transform): TorusPipe | undefined {\n const result = this.clone();\n return result.tryTransformInPlace(transform) ? result : undefined;\n }\n /** Create a new `TorusPipe`\n * @param frame local to world transformation. For best results, the matrix part should be a pure rotation.\n * @param majorRadius major hoop radius\n * @param minorRadius minor hoop radius\n * @param sweep sweep angle for major circle, with positive sweep from x axis towards y axis.\n * @param capped true for circular caps\n */\n public static createInFrame(frame: Transform, majorRadius: number, minorRadius: number, sweep: Angle, capped: boolean): TorusPipe | undefined {\n // force near-zero radii to true zero\n majorRadius = Math.abs(Geometry.correctSmallMetricDistance(majorRadius));\n minorRadius = Math.abs(Geometry.correctSmallMetricDistance(minorRadius));\n if (majorRadius < minorRadius)\n return undefined;\n if (majorRadius === 0.0)\n return undefined;\n if (minorRadius === 0.0)\n return undefined;\n if (sweep.isAlmostZero)\n return undefined;\n\n // remove mirror and negative sweep\n let yScale = 1.0;\n let zScale = 1.0;\n let isReversed = false;\n if (frame.matrix.determinant() < 0.0)\n zScale *= -1.0;\n const sweep1 = sweep.clone();\n if (sweep.radians < 0.0) {\n sweep1.setRadians(-sweep.radians);\n zScale *= -1.0;\n yScale *= -1.0;\n isReversed = true;\n }\n const frame1 = frame.clone();\n frame1.matrix.scaleColumnsInPlace(1, yScale, zScale);\n\n const result = new TorusPipe(frame1, majorRadius, minorRadius, sweep1, capped);\n result._isReversed = isReversed;\n return result;\n }\n\n /** Create a TorusPipe from the typical parameters of the Dgn file */\n public static createDgnTorusPipe(center: Point3d, vectorX: Vector3d, vectorY: Vector3d, majorRadius: number, minorRadius: number, sweep: Angle, capped: boolean) {\n const vectorZ = vectorX.unitCrossProductWithDefault(vectorY, 0, 0, 1);\n const frame = Transform.createOriginAndMatrixColumns(center, vectorX, vectorY, vectorZ);\n return TorusPipe.createInFrame(frame, majorRadius, minorRadius, sweep, capped);\n }\n /**\n * Create a TorusPipe from major arc and minor radius.\n * For best results, `arc` should be circular; otherwise, circularity is coerced.\n */\n public static createAlongArc(arc: Arc3d, minorRadius: number, capped: boolean): TorusPipe | undefined {\n if (!Angle.isAlmostEqualRadiansAllowPeriodShift(0.0, arc.sweep.startRadians))\n arc = arc.cloneInRotatedBasis(arc.sweep.startAngle);\n if (!arc.isCircular) { // ensure circularity by squaring the axes and equating their lengths\n const perpVector90 = arc.perpendicularVector.sizedCrossProduct(arc.vector0, arc.matrixRef.columnXMagnitude());\n if (!perpVector90)\n return undefined;\n arc = Arc3d.create(arc.center, arc.vector0, perpVector90, arc.sweep);\n }\n const data = arc.toScaledMatrix3d();\n const rigidFrame = Transform.createOriginAndMatrix(arc.center, data.axes);\n return TorusPipe.createInFrame(rigidFrame, data.r0, minorRadius, Angle.createRadians(arc.sweep.sweepRadians), capped);\n }\n\n /** Return a coordinate frame (right handed, unit axes)\n * * origin at center of major circle\n * * major circle in plane of first two columns\n * * last column perpendicular to first two\n */\n public getConstructiveFrame(): Transform | undefined {\n return this._localToWorld.cloneRigid();\n }\n /** Return the center of the torus pipe (inside the donut hole) */\n public cloneCenter(): Point3d { return this._localToWorld.getOrigin(); }\n /** return unit vector along the x axis (in the major hoop plane) */\n public cloneVectorX(): Vector3d {\n const xAxis = this._localToWorld.matrix.columnX();\n return xAxis.normalizeWithDefault(1, 0, 0, xAxis);\n }\n /** return unit vector along the y axis (in the major hoop plane) */\n public cloneVectorY(): Vector3d {\n const yAxis = this._localToWorld.matrix.columnY();\n return yAxis.normalizeWithDefault(0, 1, 0, yAxis);\n }\n /** return unit vector along the z axis */\n public cloneVectorZ(): Vector3d {\n const zAxis = this._localToWorld.matrix.columnZ();\n return zAxis.normalizeWithDefault(0, 0, 1, zAxis);\n }\n /** get the major hoop radius (`radiusA`) in world coordinates */\n public getMajorRadius(): number { return this._radiusA * this._localToWorld.matrix.columnXMagnitude(); }\n /** get the minor hoop radius (`radiusB`) in world coordinates */\n public getMinorRadius(): number { return this._radiusB * this._localToWorld.matrix.columnZMagnitude(); }\n /** get the sweep angle along the major circle. */\n public getSweepAngle(): Angle { return this._sweep.clone(); }\n /** Ask if this TorusPipe is labeled as reversed */\n public getIsReversed(): boolean { return this._isReversed; }\n /** Return the sweep angle as a fraction of full 360 degrees (2PI radians) */\n public getThetaFraction(): number { return this._sweep.radians / (Math.PI * 2.0); }\n /** Return a (clone of) the TorusPipe's local to world transformation. */\n public cloneLocalToWorld(): Transform { return this._localToWorld.clone(); }\n /** ask if `other` is an instance of `TorusPipe` */\n public isSameGeometryClass(other: any): boolean { return other instanceof TorusPipe; }\n\n /** test if `this` and `other` have nearly equal geometry */\n public override isAlmostEqual(other: GeometryQuery): boolean {\n if (other instanceof TorusPipe) {\n if ((!this._sweep.isFullCircle) && this.capped !== other.capped)\n return false;\n // Compare getter output so that we can equate TorusPipes created/transformed in equivalent ways.\n // In particular, the column vectors contribute their scale to the radii, so we ignore their length.\n if (!this.cloneCenter().isAlmostEqual(other.cloneCenter()))\n return false;\n if (!this.cloneVectorX().isAlmostEqual(other.cloneVectorX()))\n return false;\n if (!this.cloneVectorY().isAlmostEqual(other.cloneVectorY()))\n return false;\n if (!this.cloneVectorZ().isAlmostEqual(other.cloneVectorZ()))\n return false;\n if (!Geometry.isSameCoordinate(this.getMinorRadius(), other.getMinorRadius()))\n return false;\n if (!Geometry.isSameCoordinate(this.getMajorRadius(), other.getMajorRadius()))\n return false;\n if (!this.getSweepAngle().isAlmostEqualNoPeriodShift(other.getSweepAngle()))\n return false;\n // ignore _isReversed; it doesn't affect geometry\n return true;\n }\n return false;\n }\n /** Return the angle (in radians) for given fractional position around the major hoop.\n */\n public vFractionToRadians(v: number): number { return this._sweep.radians * v; }\n /** Second step of double dispatch: call `handler.handleTorusPipe(this)` */\n public dispatchToGeometryHandler(handler: GeometryHandler): any {\n return handler.handleTorusPipe(this);\n }\n\n /**\n * Return the Arc3d section at vFraction. For the TorusPipe, this is a minor circle.\n * @param vFraction fractional position along the sweep direction\n */\n public constantVSection(v: number): CurveCollection | undefined {\n const thetaRadians = this.vFractionToRadians(v);\n const c0 = Math.cos(thetaRadians);\n const s0 = Math.sin(thetaRadians);\n const majorRadius = this._radiusA;\n const minorRadius = this._radiusB;\n const center = this._localToWorld.multiplyXYZ(majorRadius * c0, majorRadius * s0, 0);\n const vector0 = this._localToWorld.multiplyVectorXYZ(minorRadius * c0, minorRadius * s0, 0);\n const vector90 = this._localToWorld.multiplyVectorXYZ(0, 0, minorRadius);\n return Loop.create(Arc3d.create(center, vector0, vector90));\n }\n /** Return an arc at constant u, and arc sweep matching this TorusPipe sweep. */\n public constantUSection(uFraction: number): CurveCollection | undefined {\n const theta1Radians = this._sweep.radians;\n const phiRadians = uFraction * 2 * Math.PI;\n const majorRadius = this._radiusA;\n const minorRadius = this._radiusB;\n const transform = this._localToWorld;\n const axes = transform.matrix;\n const center = this._localToWorld.multiplyXYZ(0, 0, minorRadius * Math.sin(phiRadians));\n const rxy = majorRadius + minorRadius * Math.cos(phiRadians);\n const vector0 = axes.multiplyXYZ(rxy, 0, 0);\n const vector90 = axes.multiplyXYZ(0, rxy, 0);\n return Path.create(Arc3d.create(center, vector0, vector90, AngleSweep.createStartEndRadians(0.0, theta1Radians)));\n }\n /** extend `rangeToExtend` to include this `TorusPipe` */\n public extendRange(rangeToExtend: Range3d, transform?: Transform) {\n const theta1Radians = this._sweep.radians;\n const majorRadius = this._radiusA;\n const minorRadius = this._radiusB;\n const transform0 = this._localToWorld;\n const numThetaSample = Math.ceil(theta1Radians / (Math.PI / 16.0));\n const numHalfPhiSample = 16;\n let phi0 = 0;\n let dPhi = 0;\n let numPhiSample = 0;\n let theta = 0;\n let cosTheta = 0;\n let sinTheta = 0;\n let rxy = 0;\n let phi = 0;\n let j = 0;\n const dTheta = theta1Radians / numThetaSample;\n for (let i = 0; i <= numThetaSample; i++) {\n theta = i * dTheta;\n cosTheta = Math.cos(theta);\n sinTheta = Math.sin(theta);\n // At the ends, do the entire phi circle.\n // Otherwise only do the outer half\n if (i === 0 || i === numThetaSample) {\n phi0 = -Math.PI;\n dPhi = 2.0 * Math.PI / numHalfPhiSample;\n numPhiSample = numHalfPhiSample;\n } else {\n phi0 = -0.5 * Math.PI;\n dPhi = Math.PI / numHalfPhiSample;\n numPhiSample = 2 * numHalfPhiSample - 1;\n }\n if (transform) {\n for (j = 0; j <= numPhiSample; j++) {\n phi = phi0 + j * dPhi;\n rxy = majorRadius + minorRadius * Math.cos(phi);\n rangeToExtend.extendTransformTransformedXYZ(transform, transform0,\n cosTheta * rxy, sinTheta * rxy,\n Math.sin(phi) * minorRadius);\n }\n } else {\n for (j = 0; j <= numPhiSample; j++) {\n phi = phi0 + j * dPhi;\n rxy = majorRadius + minorRadius * Math.cos(phi);\n rangeToExtend.extendTransformedXYZ(transform0,\n cosTheta * rxy, sinTheta * rxy,\n Math.sin(phi) * minorRadius);\n }\n }\n }\n }\n /** Evaluate as a uv surface\n * @param u fractional position in minor (phi)\n * @param v fractional position on major (theta) arc\n */\n public uvFractionToPoint(u: number, v: number, result?: Point3d): Point3d {\n const thetaRadians = v * this._sweep.radians;\n const phiRadians = u * Math.PI * 2.0;\n const cosTheta = Math.cos(thetaRadians);\n const sinTheta = Math.sin(thetaRadians);\n const majorRadius = this._radiusA;\n const minorRadius = this._radiusB;\n const rxy = majorRadius + Math.cos(phiRadians) * minorRadius;\n return this._localToWorld.multiplyXYZ(rxy * cosTheta, rxy * sinTheta, minorRadius * Math.sin(phiRadians), result);\n }\n /** Evaluate as a uv surface, returning point and two vectors.\n * @param u fractional position in minor (phi)\n * @param v fractional position on major (theta) arc\n */\n public uvFractionToPointAndTangents(u: number, v: number, result?: Plane3dByOriginAndVectors): Plane3dByOriginAndVectors {\n const thetaRadians = v * this._sweep.radians;\n const phiRadians = u * Math.PI * 2.0;\n const fTheta = this._sweep.radians;\n const fPhi = Math.PI * 2.0;\n const cosTheta = Math.cos(thetaRadians);\n const sinTheta = Math.sin(thetaRadians);\n const sinPhi = Math.sin(phiRadians);\n const cosPhi = Math.cos(phiRadians);\n const majorRadius = this._radiusA;\n const minorRadius = this._radiusB;\n const rxy = majorRadius + Math.cos(phiRadians) * minorRadius;\n const rSinPhi = minorRadius * sinPhi;\n const rCosPhi = minorRadius * cosPhi; // appears only as derivative of rSinPhi.\n return Plane3dByOriginAndVectors.createOriginAndVectors(\n this._localToWorld.multiplyXYZ(cosTheta * rxy, sinTheta * rxy, rSinPhi),\n this._localToWorld.multiplyVectorXYZ(-cosTheta * rSinPhi * fPhi, -sinTheta * rSinPhi * fPhi, rCosPhi * fPhi),\n this._localToWorld.multiplyVectorXYZ(-rxy * sinTheta * fTheta, rxy * cosTheta * fTheta, 0),\n result);\n }\n /**\n * Directional distance query\n * * u direction is around the (full) minor hoop\n * * v direction is around the outer radius, sum of (absolute values of) major and minor radii.\n */\n public maxIsoParametricDistance(): Vector2d {\n const a = Math.abs(this.getMajorRadius());\n const b = Math.abs(this.getMinorRadius());\n return Vector2d.create(b * Math.PI * 2.0, (a + b) * this._sweep.radians);\n }\n /**\n * @return true if this is a closed volume.\n */\n public get isClosedVolume(): boolean {\n return this.capped || this._sweep.isFullCircle;\n }\n\n}\n"]}
@@ -10,6 +10,10 @@ import { HalfEdge, HalfEdgeGraph, HalfEdgeMask } from "./Graph";
10
10
  import { HalfEdgeGraphOps } from "./Merging";
11
11
  /** Internal form of ChainMergeContextOptions -- same field names, but required to have contents. */
12
12
  class ChainMergeContextValidatedOptions {
13
+ /** UNNORMALIZED base vector for sorting.
14
+ * * Actual vector hoisted into an instance is normalized.
15
+ */
16
+ static { this._defaultPrimarySortDirection = Vector3d.create(0.294234298, 0.72391399, 0.45234328798); }
13
17
  /** return a unit vector aligned with optional direction.
14
18
  * * Default return is into the first quadrant at a quirky angle so any perpendicular plane is unlikely to hit many points
15
19
  */
@@ -44,10 +48,6 @@ class ChainMergeContextValidatedOptions {
44
48
  return new ChainMergeContextValidatedOptions(this.tolerance, this.primarySortDirection);
45
49
  }
46
50
  }
47
- /** UNNORMALIZED base vector for sorting.
48
- * * Actual vector hoisted into an instance is normalized.
49
- */
50
- ChainMergeContextValidatedOptions._defaultPrimarySortDirection = Vector3d.create(0.294234298, 0.72391399, 0.45234328798);
51
51
  /**
52
52
  * * Context for assembling line segments into chains.
53
53
  * * Use the context in phases: