@itwin/core-geometry 5.2.0-dev.20 → 5.2.0-dev.21

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 (450) hide show
  1. package/CHANGELOG.md +6 -1
  2. package/lib/cjs/Constant.js.map +1 -1
  3. package/lib/cjs/Geometry.js.map +1 -1
  4. package/lib/cjs/bspline/AkimaCurve3d.js.map +1 -1
  5. package/lib/cjs/bspline/BSpline1dNd.js.map +1 -1
  6. package/lib/cjs/bspline/BSplineCurve.js.map +1 -1
  7. package/lib/cjs/bspline/BSplineCurve3dH.js.map +1 -1
  8. package/lib/cjs/bspline/BSplineCurveOps.js.map +1 -1
  9. package/lib/cjs/bspline/BSplineSurface.js.map +1 -1
  10. package/lib/cjs/bspline/Bezier1dNd.js.map +1 -1
  11. package/lib/cjs/bspline/BezierCurve3d.js.map +1 -1
  12. package/lib/cjs/bspline/BezierCurve3dH.js.map +1 -1
  13. package/lib/cjs/bspline/BezierCurveBase.js.map +1 -1
  14. package/lib/cjs/bspline/InterpolationCurve3d.js.map +1 -1
  15. package/lib/cjs/bspline/KnotVector.js.map +1 -1
  16. package/lib/cjs/bspline/SurfaceLocationDetail.js.map +1 -1
  17. package/lib/cjs/clipping/AlternatingConvexClipTree.js.map +1 -1
  18. package/lib/cjs/clipping/BooleanClipFactory.js.map +1 -1
  19. package/lib/cjs/clipping/BooleanClipNode.js.map +1 -1
  20. package/lib/cjs/clipping/ClipPlane.js.map +1 -1
  21. package/lib/cjs/clipping/ClipPrimitive.js.map +1 -1
  22. package/lib/cjs/clipping/ClipUtils.js.map +1 -1
  23. package/lib/cjs/clipping/ClipVector.js.map +1 -1
  24. package/lib/cjs/clipping/ConvexClipPlaneSet.js.map +1 -1
  25. package/lib/cjs/clipping/UnionOfConvexClipPlaneSets.js.map +1 -1
  26. package/lib/cjs/clipping/internalContexts/LineStringOffsetClipperContext.js.map +1 -1
  27. package/lib/cjs/core-geometry.js.map +1 -1
  28. package/lib/cjs/curve/Arc3d.js.map +1 -1
  29. package/lib/cjs/curve/ConstructCurveBetweenCurves.js.map +1 -1
  30. package/lib/cjs/curve/CoordinateXYZ.js.map +1 -1
  31. package/lib/cjs/curve/CurveChainWithDistanceIndex.js.map +1 -1
  32. package/lib/cjs/curve/CurveCollection.js.map +1 -1
  33. package/lib/cjs/curve/CurveCurve.js.map +1 -1
  34. package/lib/cjs/curve/CurveExtendMode.js.map +1 -1
  35. package/lib/cjs/curve/CurveFactory.js.map +1 -1
  36. package/lib/cjs/curve/CurveLocationDetail.js.map +1 -1
  37. package/lib/cjs/curve/CurveOps.js.map +1 -1
  38. package/lib/cjs/curve/CurvePrimitive.js.map +1 -1
  39. package/lib/cjs/curve/CurveProcessor.js.map +1 -1
  40. package/lib/cjs/curve/CurveTypes.js.map +1 -1
  41. package/lib/cjs/curve/CurveWireMomentsXYZ.js.map +1 -1
  42. package/lib/cjs/curve/GeometryQuery.js.map +1 -1
  43. package/lib/cjs/curve/LineSegment3d.js.map +1 -1
  44. package/lib/cjs/curve/LineString3d.js.map +1 -1
  45. package/lib/cjs/curve/Loop.js.map +1 -1
  46. package/lib/cjs/curve/OffsetOptions.js.map +1 -1
  47. package/lib/cjs/curve/ParityRegion.js.map +1 -1
  48. package/lib/cjs/curve/Path.js.map +1 -1
  49. package/lib/cjs/curve/PointString3d.js.map +1 -1
  50. package/lib/cjs/curve/ProxyCurve.js.map +1 -1
  51. package/lib/cjs/curve/Query/ConsolidateAdjacentPrimitivesContext.js.map +1 -1
  52. package/lib/cjs/curve/Query/CurveSplitContext.js.map +1 -1
  53. package/lib/cjs/curve/Query/CylindricalRange.js.map +1 -1
  54. package/lib/cjs/curve/Query/InOutTests.js.map +1 -1
  55. package/lib/cjs/curve/Query/PlanarSubdivision.js.map +1 -1
  56. package/lib/cjs/curve/Query/StrokeCountChain.js.map +1 -1
  57. package/lib/cjs/curve/Query/StrokeCountMap.js.map +1 -1
  58. package/lib/cjs/curve/RegionMomentsXY.js.map +1 -1
  59. package/lib/cjs/curve/RegionOps.js.map +1 -1
  60. package/lib/cjs/curve/RegionOpsClassificationSweeps.js.map +1 -1
  61. package/lib/cjs/curve/StrokeOptions.js.map +1 -1
  62. package/lib/cjs/curve/UnionRegion.js.map +1 -1
  63. package/lib/cjs/curve/internalContexts/AnnounceTangentStrokeHandler.js.map +1 -1
  64. package/lib/cjs/curve/internalContexts/AppendPlaneIntersectionStrokeHandler.js.map +1 -1
  65. package/lib/cjs/curve/internalContexts/ChainCollectorContext.js.map +1 -1
  66. package/lib/cjs/curve/internalContexts/CloneCurvesContext.js.map +1 -1
  67. package/lib/cjs/curve/internalContexts/CloneWithExpandedLineStrings.js.map +1 -1
  68. package/lib/cjs/curve/internalContexts/ClosestPointStrokeHandler.js.map +1 -1
  69. package/lib/cjs/curve/internalContexts/CountLinearPartsSearchContext.js.map +1 -1
  70. package/lib/cjs/curve/internalContexts/CurveCurveCloseApproachXY.js.map +1 -1
  71. package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.js.map +1 -1
  72. package/lib/cjs/curve/internalContexts/CurveCurveIntersectXYZ.js.map +1 -1
  73. package/lib/cjs/curve/internalContexts/CurveLengthContext.js.map +1 -1
  74. package/lib/cjs/curve/internalContexts/CurveOffsetXYHandler.js.map +1 -1
  75. package/lib/cjs/curve/internalContexts/EllipticalArcApproximationContext.js.map +1 -1
  76. package/lib/cjs/curve/internalContexts/GapSearchContext.js.map +1 -1
  77. package/lib/cjs/curve/internalContexts/MultiChainCollector.js.map +1 -1
  78. package/lib/cjs/curve/internalContexts/NewtonRtoRStrokeHandler.js.map +1 -1
  79. package/lib/cjs/curve/internalContexts/PlaneAltitudeRangeContext.js.map +1 -1
  80. package/lib/cjs/curve/internalContexts/PolygonOffsetContext.js.map +1 -1
  81. package/lib/cjs/curve/internalContexts/SumLengthsContext.js.map +1 -1
  82. package/lib/cjs/curve/internalContexts/TransferWithSplitArcs.js.map +1 -1
  83. package/lib/cjs/curve/internalContexts/TransformInPlaceContext.js.map +1 -1
  84. package/lib/cjs/curve/spiral/AustralianRailCorpXYEvaluator.js.map +1 -1
  85. package/lib/cjs/curve/spiral/ClothoidSeries.js.map +1 -1
  86. package/lib/cjs/curve/spiral/CubicEvaluator.js.map +1 -1
  87. package/lib/cjs/curve/spiral/CzechSpiralEvaluator.js.map +1 -1
  88. package/lib/cjs/curve/spiral/DirectHalfCosineSpiralEvaluator.js.map +1 -1
  89. package/lib/cjs/curve/spiral/DirectSpiral3d.js.map +1 -1
  90. package/lib/cjs/curve/spiral/IntegratedSpiral3d.js.map +1 -1
  91. package/lib/cjs/curve/spiral/MXCubicAlongArcSpiralEvaluator.js.map +1 -1
  92. package/lib/cjs/curve/spiral/NormalizedTransition.js.map +1 -1
  93. package/lib/cjs/curve/spiral/PolishCubicSpiralEvaluator.js.map +1 -1
  94. package/lib/cjs/curve/spiral/TransitionConditionalProperties.js.map +1 -1
  95. package/lib/cjs/curve/spiral/TransitionSpiral3d.js.map +1 -1
  96. package/lib/cjs/curve/spiral/XYCurveEvaluator.js.map +1 -1
  97. package/lib/cjs/geometry3d/Angle.js.map +1 -1
  98. package/lib/cjs/geometry3d/AngleSweep.js.map +1 -1
  99. package/lib/cjs/geometry3d/BarycentricTriangle.js.map +1 -1
  100. package/lib/cjs/geometry3d/BilinearPatch.js.map +1 -1
  101. package/lib/cjs/geometry3d/CoincidentGeometryOps.js.map +1 -1
  102. package/lib/cjs/geometry3d/Ellipsoid.js.map +1 -1
  103. package/lib/cjs/geometry3d/FrameBuilder.js.map +1 -1
  104. package/lib/cjs/geometry3d/FrustumAnimation.js.map +1 -1
  105. package/lib/cjs/geometry3d/GeometryHandler.js.map +1 -1
  106. package/lib/cjs/geometry3d/GrowableBlockedArray.js.map +1 -1
  107. package/lib/cjs/geometry3d/GrowableFloat64Array.js.map +1 -1
  108. package/lib/cjs/geometry3d/GrowableXYArray.js.map +1 -1
  109. package/lib/cjs/geometry3d/GrowableXYZArray.js.map +1 -1
  110. package/lib/cjs/geometry3d/IndexedCollectionInterval.js.map +1 -1
  111. package/lib/cjs/geometry3d/IndexedXYCollection.js.map +1 -1
  112. package/lib/cjs/geometry3d/IndexedXYZCollection.js.map +1 -1
  113. package/lib/cjs/geometry3d/LongitudeLatitudeAltitude.js.map +1 -1
  114. package/lib/cjs/geometry3d/Matrix3d.js.map +1 -1
  115. package/lib/cjs/geometry3d/OrderedRotationAngles.js.map +1 -1
  116. package/lib/cjs/geometry3d/Plane3d.js.map +1 -1
  117. package/lib/cjs/geometry3d/Plane3dByOriginAndUnitNormal.js.map +1 -1
  118. package/lib/cjs/geometry3d/Plane3dByOriginAndVectors.js.map +1 -1
  119. package/lib/cjs/geometry3d/Point2dArrayCarrier.js.map +1 -1
  120. package/lib/cjs/geometry3d/Point2dVector2d.js.map +1 -1
  121. package/lib/cjs/geometry3d/Point3dArrayCarrier.js.map +1 -1
  122. package/lib/cjs/geometry3d/Point3dVector3d.js.map +1 -1
  123. package/lib/cjs/geometry3d/PointHelpers.js.map +1 -1
  124. package/lib/cjs/geometry3d/PointStreaming.js.map +1 -1
  125. package/lib/cjs/geometry3d/PolygonOps.js.map +1 -1
  126. package/lib/cjs/geometry3d/PolylineCompressionByEdgeOffset.js.map +1 -1
  127. package/lib/cjs/geometry3d/PolylineOps.js.map +1 -1
  128. package/lib/cjs/geometry3d/Range.js.map +1 -1
  129. package/lib/cjs/geometry3d/Ray2d.js.map +1 -1
  130. package/lib/cjs/geometry3d/Ray3d.js.map +1 -1
  131. package/lib/cjs/geometry3d/ReusableObjectCache.js.map +1 -1
  132. package/lib/cjs/geometry3d/Segment1d.js.map +1 -1
  133. package/lib/cjs/geometry3d/SortablePolygon.js.map +1 -1
  134. package/lib/cjs/geometry3d/Transform.js.map +1 -1
  135. package/lib/cjs/geometry3d/UVSurfaceOps.js.map +1 -1
  136. package/lib/cjs/geometry3d/XYZProps.js.map +1 -1
  137. package/lib/cjs/geometry3d/YawPitchRollAngles.js.map +1 -1
  138. package/lib/cjs/geometry4d/Map4d.js.map +1 -1
  139. package/lib/cjs/geometry4d/Matrix4d.js.map +1 -1
  140. package/lib/cjs/geometry4d/MomentData.js.map +1 -1
  141. package/lib/cjs/geometry4d/PlaneByOriginAndVectors4d.js.map +1 -1
  142. package/lib/cjs/geometry4d/Point4d.js.map +1 -1
  143. package/lib/cjs/numerics/BandedSystem.js.map +1 -1
  144. package/lib/cjs/numerics/BezierPolynomials.js.map +1 -1
  145. package/lib/cjs/numerics/ClusterableArray.js.map +1 -1
  146. package/lib/cjs/numerics/Complex.js.map +1 -1
  147. package/lib/cjs/numerics/ConvexPolygon2d.js.map +1 -1
  148. package/lib/cjs/numerics/Newton.js.map +1 -1
  149. package/lib/cjs/numerics/PascalCoefficients.js.map +1 -1
  150. package/lib/cjs/numerics/PolarData.js.map +1 -1
  151. package/lib/cjs/numerics/Polynomials.js.map +1 -1
  152. package/lib/cjs/numerics/Quadrature.js.map +1 -1
  153. package/lib/cjs/numerics/Range1dArray.js.map +1 -1
  154. package/lib/cjs/numerics/SmallSystem.js.map +1 -1
  155. package/lib/cjs/numerics/TriDiagonalSystem.js.map +1 -1
  156. package/lib/cjs/numerics/UnionFind.js.map +1 -1
  157. package/lib/cjs/numerics/UsageSums.js.map +1 -1
  158. package/lib/cjs/polyface/AuxData.js.map +1 -1
  159. package/lib/cjs/polyface/BoxTopology.js.map +1 -1
  160. package/lib/cjs/polyface/FacetFaceData.js.map +1 -1
  161. package/lib/cjs/polyface/FacetLocationDetail.js.map +1 -1
  162. package/lib/cjs/polyface/FacetOrientation.js.map +1 -1
  163. package/lib/cjs/polyface/GreedyTriangulationBetweenLineStrings.js.map +1 -1
  164. package/lib/cjs/polyface/IndexedEdgeMatcher.js.map +1 -1
  165. package/lib/cjs/polyface/IndexedPolyfaceVisitor.js.map +1 -1
  166. package/lib/cjs/polyface/IndexedPolyfaceWalker.js.map +1 -1
  167. package/lib/cjs/polyface/Polyface.js.map +1 -1
  168. package/lib/cjs/polyface/PolyfaceBuilder.js.map +1 -1
  169. package/lib/cjs/polyface/PolyfaceClip.js.map +1 -1
  170. package/lib/cjs/polyface/PolyfaceData.js.map +1 -1
  171. package/lib/cjs/polyface/PolyfaceQuery.js.map +1 -1
  172. package/lib/cjs/polyface/RangeLengthData.js.map +1 -1
  173. package/lib/cjs/polyface/RangeTree/LineString3dRangeTreeContext.js.map +1 -1
  174. package/lib/cjs/polyface/RangeTree/MinimumValueTester.js.map +1 -1
  175. package/lib/cjs/polyface/RangeTree/Point3dArrayRangeTreeContext.js.map +1 -1
  176. package/lib/cjs/polyface/RangeTree/PolyfaceRangeTreeContext.js.map +1 -1
  177. package/lib/cjs/polyface/RangeTree/RangeTreeNode.js.map +1 -1
  178. package/lib/cjs/polyface/RangeTree/RangeTreeSearchHandlers.js.map +1 -1
  179. package/lib/cjs/polyface/TaggedNumericData.js.map +1 -1
  180. package/lib/cjs/polyface/TriangleCandidate.js.map +1 -1
  181. package/lib/cjs/polyface/multiclip/BuildAverageNormalsContext.js.map +1 -1
  182. package/lib/cjs/polyface/multiclip/GriddedRaggedRange2dSet.js.map +1 -1
  183. package/lib/cjs/polyface/multiclip/GriddedRaggedRange2dSetWithOverflow.js.map +1 -1
  184. package/lib/cjs/polyface/multiclip/LinearSearchRange2dArray.js.map +1 -1
  185. package/lib/cjs/polyface/multiclip/OffsetMeshContext.js.map +1 -1
  186. package/lib/cjs/polyface/multiclip/Range2dSearchInterface.js.map +1 -1
  187. package/lib/cjs/polyface/multiclip/RangeSearch.js.map +1 -1
  188. package/lib/cjs/polyface/multiclip/SweepLineStringToFacetContext.js.map +1 -1
  189. package/lib/cjs/polyface/multiclip/XYPointBuckets.js.map +1 -1
  190. package/lib/cjs/serialization/BGFBAccessors.js.map +1 -1
  191. package/lib/cjs/serialization/BGFBReader.js.map +1 -1
  192. package/lib/cjs/serialization/BGFBWriter.js.map +1 -1
  193. package/lib/cjs/serialization/BentleyGeometryFlatBuffer.js.map +1 -1
  194. package/lib/cjs/serialization/DeepCompare.js.map +1 -1
  195. package/lib/cjs/serialization/GeometrySamples.js.map +1 -1
  196. package/lib/cjs/serialization/IModelJsonSchema.js.map +1 -1
  197. package/lib/cjs/serialization/SerializationHelpers.js.map +1 -1
  198. package/lib/cjs/solid/Box.js.map +1 -1
  199. package/lib/cjs/solid/Cone.js.map +1 -1
  200. package/lib/cjs/solid/LinearSweep.js.map +1 -1
  201. package/lib/cjs/solid/RotationalSweep.js.map +1 -1
  202. package/lib/cjs/solid/RuledSweep.js.map +1 -1
  203. package/lib/cjs/solid/SolidPrimitive.js.map +1 -1
  204. package/lib/cjs/solid/Sphere.js.map +1 -1
  205. package/lib/cjs/solid/SweepContour.js.map +1 -1
  206. package/lib/cjs/solid/TorusPipe.js.map +1 -1
  207. package/lib/cjs/topology/ChainMerge.js.map +1 -1
  208. package/lib/cjs/topology/Graph.js.map +1 -1
  209. package/lib/cjs/topology/HalfEdgeGraphFromIndexedLoopsContext.js.map +1 -1
  210. package/lib/cjs/topology/HalfEdgeGraphSearch.js.map +1 -1
  211. package/lib/cjs/topology/HalfEdgeGraphSpineContext.js.map +1 -1
  212. package/lib/cjs/topology/HalfEdgeGraphValidation.js.map +1 -1
  213. package/lib/cjs/topology/HalfEdgeMarkSet.js.map +1 -1
  214. package/lib/cjs/topology/HalfEdgeNodeXYZUV.js.map +1 -1
  215. package/lib/cjs/topology/HalfEdgePointInGraphSearch.js.map +1 -1
  216. package/lib/cjs/topology/HalfEdgePositionDetail.js.map +1 -1
  217. package/lib/cjs/topology/HalfEdgePriorityQueue.js.map +1 -1
  218. package/lib/cjs/topology/InsertAndRetriangulateContext.js.map +1 -1
  219. package/lib/cjs/topology/MaskManager.js.map +1 -1
  220. package/lib/cjs/topology/Merging.js.map +1 -1
  221. package/lib/cjs/topology/RegularizeFace.js.map +1 -1
  222. package/lib/cjs/topology/SignedDataSummary.js.map +1 -1
  223. package/lib/cjs/topology/SpaceTriangulation.js.map +1 -1
  224. package/lib/cjs/topology/Triangulation.js.map +1 -1
  225. package/lib/cjs/topology/XYParitySearchContext.js.map +1 -1
  226. package/lib/esm/Constant.js.map +1 -1
  227. package/lib/esm/Geometry.js.map +1 -1
  228. package/lib/esm/bspline/AkimaCurve3d.js.map +1 -1
  229. package/lib/esm/bspline/BSpline1dNd.js.map +1 -1
  230. package/lib/esm/bspline/BSplineCurve.js.map +1 -1
  231. package/lib/esm/bspline/BSplineCurve3dH.js.map +1 -1
  232. package/lib/esm/bspline/BSplineCurveOps.js.map +1 -1
  233. package/lib/esm/bspline/BSplineSurface.js.map +1 -1
  234. package/lib/esm/bspline/Bezier1dNd.js.map +1 -1
  235. package/lib/esm/bspline/BezierCurve3d.js.map +1 -1
  236. package/lib/esm/bspline/BezierCurve3dH.js.map +1 -1
  237. package/lib/esm/bspline/BezierCurveBase.js.map +1 -1
  238. package/lib/esm/bspline/InterpolationCurve3d.js.map +1 -1
  239. package/lib/esm/bspline/KnotVector.js.map +1 -1
  240. package/lib/esm/bspline/SurfaceLocationDetail.js.map +1 -1
  241. package/lib/esm/clipping/AlternatingConvexClipTree.js.map +1 -1
  242. package/lib/esm/clipping/BooleanClipFactory.js.map +1 -1
  243. package/lib/esm/clipping/BooleanClipNode.js.map +1 -1
  244. package/lib/esm/clipping/ClipPlane.js.map +1 -1
  245. package/lib/esm/clipping/ClipPrimitive.js.map +1 -1
  246. package/lib/esm/clipping/ClipUtils.js.map +1 -1
  247. package/lib/esm/clipping/ClipVector.js.map +1 -1
  248. package/lib/esm/clipping/ConvexClipPlaneSet.js.map +1 -1
  249. package/lib/esm/clipping/UnionOfConvexClipPlaneSets.js.map +1 -1
  250. package/lib/esm/clipping/internalContexts/LineStringOffsetClipperContext.js.map +1 -1
  251. package/lib/esm/core-geometry.js.map +1 -1
  252. package/lib/esm/curve/Arc3d.js.map +1 -1
  253. package/lib/esm/curve/ConstructCurveBetweenCurves.js.map +1 -1
  254. package/lib/esm/curve/CoordinateXYZ.js.map +1 -1
  255. package/lib/esm/curve/CurveChainWithDistanceIndex.js.map +1 -1
  256. package/lib/esm/curve/CurveCollection.js.map +1 -1
  257. package/lib/esm/curve/CurveCurve.js.map +1 -1
  258. package/lib/esm/curve/CurveExtendMode.js.map +1 -1
  259. package/lib/esm/curve/CurveFactory.js.map +1 -1
  260. package/lib/esm/curve/CurveLocationDetail.js.map +1 -1
  261. package/lib/esm/curve/CurveOps.js.map +1 -1
  262. package/lib/esm/curve/CurvePrimitive.js.map +1 -1
  263. package/lib/esm/curve/CurveProcessor.js.map +1 -1
  264. package/lib/esm/curve/CurveTypes.js.map +1 -1
  265. package/lib/esm/curve/CurveWireMomentsXYZ.js.map +1 -1
  266. package/lib/esm/curve/GeometryQuery.js.map +1 -1
  267. package/lib/esm/curve/LineSegment3d.js.map +1 -1
  268. package/lib/esm/curve/LineString3d.js.map +1 -1
  269. package/lib/esm/curve/Loop.js.map +1 -1
  270. package/lib/esm/curve/OffsetOptions.js.map +1 -1
  271. package/lib/esm/curve/ParityRegion.js.map +1 -1
  272. package/lib/esm/curve/Path.js.map +1 -1
  273. package/lib/esm/curve/PointString3d.js.map +1 -1
  274. package/lib/esm/curve/ProxyCurve.js.map +1 -1
  275. package/lib/esm/curve/Query/ConsolidateAdjacentPrimitivesContext.js.map +1 -1
  276. package/lib/esm/curve/Query/CurveSplitContext.js.map +1 -1
  277. package/lib/esm/curve/Query/CylindricalRange.js.map +1 -1
  278. package/lib/esm/curve/Query/InOutTests.js.map +1 -1
  279. package/lib/esm/curve/Query/PlanarSubdivision.js.map +1 -1
  280. package/lib/esm/curve/Query/StrokeCountChain.js.map +1 -1
  281. package/lib/esm/curve/Query/StrokeCountMap.js.map +1 -1
  282. package/lib/esm/curve/RegionMomentsXY.js.map +1 -1
  283. package/lib/esm/curve/RegionOps.js.map +1 -1
  284. package/lib/esm/curve/RegionOpsClassificationSweeps.js.map +1 -1
  285. package/lib/esm/curve/StrokeOptions.js.map +1 -1
  286. package/lib/esm/curve/UnionRegion.js.map +1 -1
  287. package/lib/esm/curve/internalContexts/AnnounceTangentStrokeHandler.js.map +1 -1
  288. package/lib/esm/curve/internalContexts/AppendPlaneIntersectionStrokeHandler.js.map +1 -1
  289. package/lib/esm/curve/internalContexts/ChainCollectorContext.js.map +1 -1
  290. package/lib/esm/curve/internalContexts/CloneCurvesContext.js.map +1 -1
  291. package/lib/esm/curve/internalContexts/CloneWithExpandedLineStrings.js.map +1 -1
  292. package/lib/esm/curve/internalContexts/ClosestPointStrokeHandler.js.map +1 -1
  293. package/lib/esm/curve/internalContexts/CountLinearPartsSearchContext.js.map +1 -1
  294. package/lib/esm/curve/internalContexts/CurveCurveCloseApproachXY.js.map +1 -1
  295. package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.js.map +1 -1
  296. package/lib/esm/curve/internalContexts/CurveCurveIntersectXYZ.js.map +1 -1
  297. package/lib/esm/curve/internalContexts/CurveLengthContext.js.map +1 -1
  298. package/lib/esm/curve/internalContexts/CurveOffsetXYHandler.js.map +1 -1
  299. package/lib/esm/curve/internalContexts/EllipticalArcApproximationContext.js.map +1 -1
  300. package/lib/esm/curve/internalContexts/GapSearchContext.js.map +1 -1
  301. package/lib/esm/curve/internalContexts/MultiChainCollector.js.map +1 -1
  302. package/lib/esm/curve/internalContexts/NewtonRtoRStrokeHandler.js.map +1 -1
  303. package/lib/esm/curve/internalContexts/PlaneAltitudeRangeContext.js.map +1 -1
  304. package/lib/esm/curve/internalContexts/PolygonOffsetContext.js.map +1 -1
  305. package/lib/esm/curve/internalContexts/SumLengthsContext.js.map +1 -1
  306. package/lib/esm/curve/internalContexts/TransferWithSplitArcs.js.map +1 -1
  307. package/lib/esm/curve/internalContexts/TransformInPlaceContext.js.map +1 -1
  308. package/lib/esm/curve/spiral/AustralianRailCorpXYEvaluator.js.map +1 -1
  309. package/lib/esm/curve/spiral/ClothoidSeries.js.map +1 -1
  310. package/lib/esm/curve/spiral/CubicEvaluator.js.map +1 -1
  311. package/lib/esm/curve/spiral/CzechSpiralEvaluator.js.map +1 -1
  312. package/lib/esm/curve/spiral/DirectHalfCosineSpiralEvaluator.js.map +1 -1
  313. package/lib/esm/curve/spiral/DirectSpiral3d.js.map +1 -1
  314. package/lib/esm/curve/spiral/IntegratedSpiral3d.js.map +1 -1
  315. package/lib/esm/curve/spiral/MXCubicAlongArcSpiralEvaluator.js.map +1 -1
  316. package/lib/esm/curve/spiral/NormalizedTransition.js.map +1 -1
  317. package/lib/esm/curve/spiral/PolishCubicSpiralEvaluator.js.map +1 -1
  318. package/lib/esm/curve/spiral/TransitionConditionalProperties.js.map +1 -1
  319. package/lib/esm/curve/spiral/TransitionSpiral3d.js.map +1 -1
  320. package/lib/esm/curve/spiral/XYCurveEvaluator.js.map +1 -1
  321. package/lib/esm/geometry3d/Angle.js.map +1 -1
  322. package/lib/esm/geometry3d/AngleSweep.js.map +1 -1
  323. package/lib/esm/geometry3d/BarycentricTriangle.js.map +1 -1
  324. package/lib/esm/geometry3d/BilinearPatch.js.map +1 -1
  325. package/lib/esm/geometry3d/CoincidentGeometryOps.js.map +1 -1
  326. package/lib/esm/geometry3d/Ellipsoid.js.map +1 -1
  327. package/lib/esm/geometry3d/FrameBuilder.js.map +1 -1
  328. package/lib/esm/geometry3d/FrustumAnimation.js.map +1 -1
  329. package/lib/esm/geometry3d/GeometryHandler.js.map +1 -1
  330. package/lib/esm/geometry3d/GrowableBlockedArray.js.map +1 -1
  331. package/lib/esm/geometry3d/GrowableFloat64Array.js.map +1 -1
  332. package/lib/esm/geometry3d/GrowableXYArray.js.map +1 -1
  333. package/lib/esm/geometry3d/GrowableXYZArray.js.map +1 -1
  334. package/lib/esm/geometry3d/IndexedCollectionInterval.js.map +1 -1
  335. package/lib/esm/geometry3d/IndexedXYCollection.js.map +1 -1
  336. package/lib/esm/geometry3d/IndexedXYZCollection.js.map +1 -1
  337. package/lib/esm/geometry3d/LongitudeLatitudeAltitude.js.map +1 -1
  338. package/lib/esm/geometry3d/Matrix3d.js.map +1 -1
  339. package/lib/esm/geometry3d/OrderedRotationAngles.js.map +1 -1
  340. package/lib/esm/geometry3d/Plane3d.js.map +1 -1
  341. package/lib/esm/geometry3d/Plane3dByOriginAndUnitNormal.js.map +1 -1
  342. package/lib/esm/geometry3d/Plane3dByOriginAndVectors.js.map +1 -1
  343. package/lib/esm/geometry3d/Point2dArrayCarrier.js.map +1 -1
  344. package/lib/esm/geometry3d/Point2dVector2d.js.map +1 -1
  345. package/lib/esm/geometry3d/Point3dArrayCarrier.js.map +1 -1
  346. package/lib/esm/geometry3d/Point3dVector3d.js.map +1 -1
  347. package/lib/esm/geometry3d/PointHelpers.js.map +1 -1
  348. package/lib/esm/geometry3d/PointStreaming.js.map +1 -1
  349. package/lib/esm/geometry3d/PolygonOps.js.map +1 -1
  350. package/lib/esm/geometry3d/PolylineCompressionByEdgeOffset.js.map +1 -1
  351. package/lib/esm/geometry3d/PolylineOps.js.map +1 -1
  352. package/lib/esm/geometry3d/Range.js.map +1 -1
  353. package/lib/esm/geometry3d/Ray2d.js.map +1 -1
  354. package/lib/esm/geometry3d/Ray3d.js.map +1 -1
  355. package/lib/esm/geometry3d/ReusableObjectCache.js.map +1 -1
  356. package/lib/esm/geometry3d/Segment1d.js.map +1 -1
  357. package/lib/esm/geometry3d/SortablePolygon.js.map +1 -1
  358. package/lib/esm/geometry3d/Transform.js.map +1 -1
  359. package/lib/esm/geometry3d/UVSurfaceOps.js.map +1 -1
  360. package/lib/esm/geometry3d/XYZProps.js.map +1 -1
  361. package/lib/esm/geometry3d/YawPitchRollAngles.js.map +1 -1
  362. package/lib/esm/geometry4d/Map4d.js.map +1 -1
  363. package/lib/esm/geometry4d/Matrix4d.js.map +1 -1
  364. package/lib/esm/geometry4d/MomentData.js.map +1 -1
  365. package/lib/esm/geometry4d/PlaneByOriginAndVectors4d.js.map +1 -1
  366. package/lib/esm/geometry4d/Point4d.js.map +1 -1
  367. package/lib/esm/numerics/BandedSystem.js.map +1 -1
  368. package/lib/esm/numerics/BezierPolynomials.js.map +1 -1
  369. package/lib/esm/numerics/ClusterableArray.js.map +1 -1
  370. package/lib/esm/numerics/Complex.js.map +1 -1
  371. package/lib/esm/numerics/ConvexPolygon2d.js.map +1 -1
  372. package/lib/esm/numerics/Newton.js.map +1 -1
  373. package/lib/esm/numerics/PascalCoefficients.js.map +1 -1
  374. package/lib/esm/numerics/PolarData.js.map +1 -1
  375. package/lib/esm/numerics/Polynomials.js.map +1 -1
  376. package/lib/esm/numerics/Quadrature.js.map +1 -1
  377. package/lib/esm/numerics/Range1dArray.js.map +1 -1
  378. package/lib/esm/numerics/SmallSystem.js.map +1 -1
  379. package/lib/esm/numerics/TriDiagonalSystem.js.map +1 -1
  380. package/lib/esm/numerics/UnionFind.js.map +1 -1
  381. package/lib/esm/numerics/UsageSums.js.map +1 -1
  382. package/lib/esm/polyface/AuxData.js.map +1 -1
  383. package/lib/esm/polyface/BoxTopology.js.map +1 -1
  384. package/lib/esm/polyface/FacetFaceData.js.map +1 -1
  385. package/lib/esm/polyface/FacetLocationDetail.js.map +1 -1
  386. package/lib/esm/polyface/FacetOrientation.js.map +1 -1
  387. package/lib/esm/polyface/GreedyTriangulationBetweenLineStrings.js.map +1 -1
  388. package/lib/esm/polyface/IndexedEdgeMatcher.js.map +1 -1
  389. package/lib/esm/polyface/IndexedPolyfaceVisitor.js.map +1 -1
  390. package/lib/esm/polyface/IndexedPolyfaceWalker.js.map +1 -1
  391. package/lib/esm/polyface/Polyface.js.map +1 -1
  392. package/lib/esm/polyface/PolyfaceBuilder.js.map +1 -1
  393. package/lib/esm/polyface/PolyfaceClip.js.map +1 -1
  394. package/lib/esm/polyface/PolyfaceData.js.map +1 -1
  395. package/lib/esm/polyface/PolyfaceQuery.js.map +1 -1
  396. package/lib/esm/polyface/RangeLengthData.js.map +1 -1
  397. package/lib/esm/polyface/RangeTree/LineString3dRangeTreeContext.js.map +1 -1
  398. package/lib/esm/polyface/RangeTree/MinimumValueTester.js.map +1 -1
  399. package/lib/esm/polyface/RangeTree/Point3dArrayRangeTreeContext.js.map +1 -1
  400. package/lib/esm/polyface/RangeTree/PolyfaceRangeTreeContext.js.map +1 -1
  401. package/lib/esm/polyface/RangeTree/RangeTreeNode.js.map +1 -1
  402. package/lib/esm/polyface/RangeTree/RangeTreeSearchHandlers.js.map +1 -1
  403. package/lib/esm/polyface/TaggedNumericData.js.map +1 -1
  404. package/lib/esm/polyface/TriangleCandidate.js.map +1 -1
  405. package/lib/esm/polyface/multiclip/BuildAverageNormalsContext.js.map +1 -1
  406. package/lib/esm/polyface/multiclip/GriddedRaggedRange2dSet.js.map +1 -1
  407. package/lib/esm/polyface/multiclip/GriddedRaggedRange2dSetWithOverflow.js.map +1 -1
  408. package/lib/esm/polyface/multiclip/LinearSearchRange2dArray.js.map +1 -1
  409. package/lib/esm/polyface/multiclip/OffsetMeshContext.js.map +1 -1
  410. package/lib/esm/polyface/multiclip/Range2dSearchInterface.js.map +1 -1
  411. package/lib/esm/polyface/multiclip/RangeSearch.js.map +1 -1
  412. package/lib/esm/polyface/multiclip/SweepLineStringToFacetContext.js.map +1 -1
  413. package/lib/esm/polyface/multiclip/XYPointBuckets.js.map +1 -1
  414. package/lib/esm/serialization/BGFBAccessors.js.map +1 -1
  415. package/lib/esm/serialization/BGFBReader.js.map +1 -1
  416. package/lib/esm/serialization/BGFBWriter.js.map +1 -1
  417. package/lib/esm/serialization/BentleyGeometryFlatBuffer.js.map +1 -1
  418. package/lib/esm/serialization/DeepCompare.js.map +1 -1
  419. package/lib/esm/serialization/GeometrySamples.js.map +1 -1
  420. package/lib/esm/serialization/IModelJsonSchema.js.map +1 -1
  421. package/lib/esm/serialization/SerializationHelpers.js.map +1 -1
  422. package/lib/esm/solid/Box.js.map +1 -1
  423. package/lib/esm/solid/Cone.js.map +1 -1
  424. package/lib/esm/solid/LinearSweep.js.map +1 -1
  425. package/lib/esm/solid/RotationalSweep.js.map +1 -1
  426. package/lib/esm/solid/RuledSweep.js.map +1 -1
  427. package/lib/esm/solid/SolidPrimitive.js.map +1 -1
  428. package/lib/esm/solid/Sphere.js.map +1 -1
  429. package/lib/esm/solid/SweepContour.js.map +1 -1
  430. package/lib/esm/solid/TorusPipe.js.map +1 -1
  431. package/lib/esm/topology/ChainMerge.js.map +1 -1
  432. package/lib/esm/topology/Graph.js.map +1 -1
  433. package/lib/esm/topology/HalfEdgeGraphFromIndexedLoopsContext.js.map +1 -1
  434. package/lib/esm/topology/HalfEdgeGraphSearch.js.map +1 -1
  435. package/lib/esm/topology/HalfEdgeGraphSpineContext.js.map +1 -1
  436. package/lib/esm/topology/HalfEdgeGraphValidation.js.map +1 -1
  437. package/lib/esm/topology/HalfEdgeMarkSet.js.map +1 -1
  438. package/lib/esm/topology/HalfEdgeNodeXYZUV.js.map +1 -1
  439. package/lib/esm/topology/HalfEdgePointInGraphSearch.js.map +1 -1
  440. package/lib/esm/topology/HalfEdgePositionDetail.js.map +1 -1
  441. package/lib/esm/topology/HalfEdgePriorityQueue.js.map +1 -1
  442. package/lib/esm/topology/InsertAndRetriangulateContext.js.map +1 -1
  443. package/lib/esm/topology/MaskManager.js.map +1 -1
  444. package/lib/esm/topology/Merging.js.map +1 -1
  445. package/lib/esm/topology/RegularizeFace.js.map +1 -1
  446. package/lib/esm/topology/SignedDataSummary.js.map +1 -1
  447. package/lib/esm/topology/SpaceTriangulation.js.map +1 -1
  448. package/lib/esm/topology/Triangulation.js.map +1 -1
  449. package/lib/esm/topology/XYParitySearchContext.js.map +1 -1
  450. package/package.json +3 -3
@@ -1 +1 @@
1
- {"version":3,"file":"ConvexClipPlaneSet.js","sourceRoot":"","sources":["../../../src/clipping/ConvexClipPlaneSet.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAQ/F,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEvC,OAAO,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAC1E,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAElE,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAClD,OAAO,EAAE,4BAA4B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AE,MAA2B;QAEnE,MAAM,GAAG,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;QAClC,IAAI,GAAG,GAAG,CAAC,CAAC;QACZ,IAAI,aAAa,CAAC,6BAA6B,CAAC,UAAU,CAAC;YACzD,GAAG,GAAG,aAAa,CAAC,qBAAqB,CAAC,UAAU,CAAC,CAAC;QACxD,MAAM,KAAK,GAAG,GAAG,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,6DAA6D;QACnG,MAAM,MAAM,GAAG,QAAQ,CAAC,MAAM,EAAE,CAAC;QACjC,MAAM,KAAK,GAAG,4BAA4B,CAAC,aAAa,EAAE,CAAC;QAC3D,MAAM,OAAO,GAAG,UAAU,YAAY,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC;QAC1F,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;QACtB,KAAK,OAAO,CAAC,KAAK,EAAE,EAAE,OAAO,CAAC,eAAe,EAAE,GAAI,CAAC;YAClD,IAAI,SAAS,KAAK,UAAU,CAAC,YAAY,CAAC,OAAO,CAAC,KAAK,EAAE,MAAM,CAAC,EAAE,CAAC;gBACjE,MAAM,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;gBAC3B,IAAI,SAAS,KAAK,4BAA4B,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,EAAG,EAAE,MAAM,EAAE,KAAK,CAAC;oBAC1F,MAAM,CAAC,mBAAmB,CAAC,KAAK,CAAC,CAAC;YACtC,CAAC;QACH,CAAC;QACD,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC;IAC1C,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\n/** @packageDocumentation\n * @module CartesianGeometry\n */\n\nimport { Arc3d } from \"../curve/Arc3d\";\nimport { AnnounceNumberNumber, AnnounceNumberNumberCurvePrimitive } from \"../curve/CurvePrimitive\";\nimport { Geometry } from \"../Geometry\";\nimport { Angle } from \"../geometry3d/Angle\";\nimport { GrowableFloat64Array } from \"../geometry3d/GrowableFloat64Array\";\nimport { GrowableXYZArray } from \"../geometry3d/GrowableXYZArray\";\nimport { IndexedXYZCollection } from \"../geometry3d/IndexedXYZCollection\";\nimport { Matrix3d } from \"../geometry3d/Matrix3d\";\nimport { Plane3dByOriginAndUnitNormal } from \"../geometry3d/Plane3dByOriginAndUnitNormal\";\nimport { Point3d, Vector3d } from \"../geometry3d/Point3dVector3d\";\nimport { IndexedXYZCollectionPolygonOps, PolygonOps } from \"../geometry3d/PolygonOps\";\nimport { Range1d, Range3d } from \"../geometry3d/Range\";\nimport { Ray3d } from \"../geometry3d/Ray3d\";\nimport { GrowableXYZArrayCache } from \"../geometry3d/ReusableObjectCache\";\nimport { Transform } from \"../geometry3d/Transform\";\nimport { Matrix4d } from \"../geometry4d/Matrix4d\";\nimport { Polyface, PolyfaceVisitor } from \"../polyface/Polyface\";\nimport { PolyfaceQuery } from \"../polyface/PolyfaceQuery\";\nimport { ClipPlane, ClipPlaneProps } from \"./ClipPlane\";\nimport { Clipper, ClipPlaneContainment, ClipUtilities, PolygonClipper } from \"./ClipUtils\";\n\n/** Wire format describing a [[ConvexClipPlaneSet]].\n * @public\n */\nexport type ConvexClipPlaneSetProps = ClipPlaneProps[];\n\n/**\n * A ConvexClipPlaneSet is a collection of ClipPlanes, often used for bounding regions of space.\n * @public\n */\nexport class ConvexClipPlaneSet implements Clipper, PolygonClipper {\n /** Value acting as \"at infinity\" for coordinates along a ray. */\n public static readonly hugeVal = 1e37;\n /** Planes that define the convex set. */\n private _planes: ClipPlane[];\n // private _parity: number; <--- Not yet used\n // public get parity() { return this._parity; }\n // public set parity(value: number) { this._parity = value; }\n private constructor(planes?: ClipPlane[]) {\n // this._parity = 1;\n this._planes = planes ? planes : [];\n }\n /**\n * Return an array containing all the planes of the convex set.\n * * Note that this has no leading keyword identifying it as a ConvexClipPlaneSet.\n */\n public toJSON(): ConvexClipPlaneSetProps {\n const val: ClipPlaneProps[] = [];\n for (const plane of this._planes)\n val.push(plane.toJSON());\n return val;\n }\n /**\n * Extract clip planes from a json array `[ clipPlane, clipPlane ]`.\n * * Non-clipPlane members are ignored.\n */\n public static fromJSON(json: ConvexClipPlaneSetProps | undefined, result?: ConvexClipPlaneSet): ConvexClipPlaneSet {\n result = result ? result : new ConvexClipPlaneSet();\n result._planes.length = 0;\n if (!Array.isArray(json))\n return result;\n for (const thisJson of json) {\n const plane = ClipPlane.fromJSON(thisJson);\n if (plane)\n result._planes.push(plane);\n }\n return result;\n }\n /**\n * Return true if all members are almostEqual to corresponding members of other. This includes identical order in array.\n * @param other clip plane to compare\n */\n public isAlmostEqual(other: ConvexClipPlaneSet): boolean {\n if (this._planes.length !== other._planes.length)\n return false;\n for (let i = 0; i < this._planes.length; i++)\n if (!this._planes[i].isAlmostEqual(other._planes[i]))\n return false;\n return true;\n }\n /**\n * Create ConvexClipPlaneSet from an array of planes.\n * * Each plane reference in the `planes` array is taken into the result.\n * * The input array itself is NOT taken into the result.\n */\n public static createPlanes(\n planes: (ClipPlane | Plane3dByOriginAndUnitNormal)[], result?: ConvexClipPlaneSet,\n ): ConvexClipPlaneSet {\n result = result ? result : new ConvexClipPlaneSet();\n for (const plane of planes) {\n if (plane instanceof ClipPlane) {\n result._planes.push(plane);\n } else if (plane instanceof Plane3dByOriginAndUnitNormal) {\n const clipPlane = ClipPlane.createPlane(plane);\n result._planes.push(clipPlane);\n }\n }\n return result;\n }\n /**\n * Create new convex set using selected planes of a Range3d.\n * @param range range with coordinates\n * @param lowX true to clip at the low x plane\n * @param highX true to clip at the high x plane\n * @param lowY true to clip at the low y plane\n * @param highY true to clip at the high z plane\n * @param lowZ true to clip at the low z plane\n * @param highZ true to clip at the high z plane\n */\n public static createRange3dPlanes(\n range: Range3d,\n lowX: boolean = true,\n highX: boolean = true,\n lowY: boolean = true,\n highY: boolean = true,\n lowZ: boolean = true,\n highZ: boolean = true,\n ): ConvexClipPlaneSet {\n const result = ConvexClipPlaneSet.createEmpty();\n\n if (lowX)\n result.planes.push(ClipPlane.createNormalAndPointXYZXYZ(1, 0, 0, range.low.x, 0, 0)!);\n if (highX)\n result.planes.push(ClipPlane.createNormalAndPointXYZXYZ(-1, 0, 0, range.high.x, 0, 0)!);\n\n if (lowY)\n result.planes.push(ClipPlane.createNormalAndPointXYZXYZ(0, 1, 0, 0, range.low.y, 0)!);\n if (highY)\n result.planes.push(ClipPlane.createNormalAndPointXYZXYZ(0, -1, 0, 0, range.high.y, 0)!);\n\n if (lowZ)\n result.planes.push(ClipPlane.createNormalAndPointXYZXYZ(0, 0, 1, 0, 0, range.low.z)!);\n if (highZ)\n result.planes.push(ClipPlane.createNormalAndPointXYZXYZ(0, 0, -1, 0, 0, range.high.z)!);\n\n return result;\n }\n /** Create an empty `ConvexClipPlaneSet` */\n public static createEmpty(result?: ConvexClipPlaneSet): ConvexClipPlaneSet {\n if (result) {\n result._planes.length = 0;\n return result;\n }\n return new ConvexClipPlaneSet();\n }\n /** Negate all planes of the set. */\n public negateAllPlanes(): void {\n for (const plane of this._planes)\n plane.negateInPlace();\n }\n /**\n * Create a convex clip plane set that clips to `x0 <= x <= x1` and `y0 <= y <= y1`.\n * * Note that there is no test for the usual ordering `x0 <= x1` or `y0 <= y1`.\n * * if the usual ordering is violated, the convex set is an empty set.\n * * More details can be found at docs/learning/geometry/Clipping.md\n */\n public static createXYBox(\n x0: number, y0: number, x1: number, y1: number, result?: ConvexClipPlaneSet,\n ): ConvexClipPlaneSet {\n result = result ? result : new ConvexClipPlaneSet();\n result._planes.length = 0;\n const clip0 = ClipPlane.createNormalAndDistance(Vector3d.create(-1, 0, 0), -x1, false, true);\n const clip1 = ClipPlane.createNormalAndDistance(Vector3d.create(1, 0, 0), x0, false, true);\n const clip2 = ClipPlane.createNormalAndDistance(Vector3d.create(0, -1, 0), -y1, false, true);\n const clip3 = ClipPlane.createNormalAndDistance(Vector3d.create(0, 1, 0), y0, false, true);\n if (clip0 && clip1 && clip2 && clip3) {\n result._planes.push(clip0, clip1, clip2, clip3);\n }\n return result;\n }\n /**\n * Create a convex set containing a half space for each edge between points of a polyline.\n * * Caller is responsible for assuring the polyline is convex.\n * @param points array of points. Only xy parts are considered.\n * @param interior array whose boolean value is used as both the `interior` and `invisible` bits of the plane for the\n * succeeding segment. If this array is not provided, both are false.\n * @param leftIsInside if true, the interior is \"to the left\" of the segments. If false, interior is \"to the right\".\n */\n public static createXYPolyLine(\n points: Point3d[], interior: boolean[] | undefined, leftIsInside: boolean, result?: ConvexClipPlaneSet,\n ): ConvexClipPlaneSet {\n result = result ? result : new ConvexClipPlaneSet();\n result._planes.length = 0;\n for (let i0 = 0; (i0 + 1) < points.length; i0++) {\n const edgeVector: Vector3d = Vector3d.createStartEnd(points[i0], points[i0 + 1]);\n const perp: Vector3d = edgeVector.unitPerpendicularXY();\n perp.z = 0.0;\n\n if (!leftIsInside)\n perp.scaleInPlace(-1.0);\n\n const perpNormalized = perp.normalize();\n if (perpNormalized) {\n const flag = interior !== undefined ? interior[i0] : false;\n const clip = ClipPlane.createNormalAndPoint(perp, points[i0], flag, flag);\n if (clip) {\n result._planes.push(clip);\n }\n }\n }\n return result;\n }\n /**\n * Create a convexClipPlaneSet with planes whose \"inside\" normal is to the left of each segment.\n * @param points array of points.\n */\n public static createXYPolyLineInsideLeft(points: Point3d[], result?: ConvexClipPlaneSet): ConvexClipPlaneSet {\n result = result ? result : new ConvexClipPlaneSet();\n result._planes.length = 0;\n for (let i0 = 0; (i0 + 1) < points.length; i0++) {\n const edgeVector: Vector3d = Vector3d.createStartEnd(points[i0], points[i0 + 1]);\n const perp: Vector3d = edgeVector.unitPerpendicularXY();\n perp.z = 0.0;\n\n const perpNormalized = perp.normalize();\n if (perpNormalized) {\n const clip = ClipPlane.createNormalAndPoint(perp, points[i0], false, false);\n if (clip) { result._planes.push(clip); }\n }\n }\n return result;\n }\n /**\n * Set (or reset) a plane and ConvexClipPlaneSet for a convex array, such as a convex facet used for xy clip.\n * * The planeOfPolygon is (re)initialized with the normal from 3 points, but not otherwise referenced.\n * * The ConvexClipPlaneSet is filled with outward normals of the facet edges as viewed to xy plane.\n * @param points\n * @param result\n */\n public static setPlaneAndXYLoopCCW(points: GrowableXYZArray, planeOfPolygon: ClipPlane, frustum: ConvexClipPlaneSet) {\n const i0 = points.length - 1;\n const n = points.length;\n let x0 = points.getXAtUncheckedPointIndex(i0);\n let y0 = points.getYAtUncheckedPointIndex(i0);\n let x1, y1, nx, ny;\n frustum._planes.length = 0;\n const z0 = points.getZAtUncheckedPointIndex(i0); // z for planes can stay fixed\n const planeNormal = points.crossProductIndexIndexIndex(0, 2, 1)!;\n ClipPlane.createNormalAndPointXYZXYZ(planeNormal.x, planeNormal.y, planeNormal.z, x0, y0, z0, false, false, planeOfPolygon);\n if (planeNormal.normalizeInPlace()) {\n for (let i1 = 0; i1 < n; i1++, x0 = x1, y0 = y1) {\n x1 = points.getXAtUncheckedPointIndex(i1);\n y1 = points.getYAtUncheckedPointIndex(i1);\n nx = -(y1 - y0);\n ny = x1 - x0;\n const clipper = ClipPlane.createNormalAndPointXYZXYZ(nx, ny, 0, x1, y1, z0);\n if (clipper)\n frustum._planes.push(clipper);\n }\n }\n }\n /** Deep clone of all planes. */\n public clone(result?: ConvexClipPlaneSet): ConvexClipPlaneSet {\n result = result ? result : new ConvexClipPlaneSet();\n result._planes.length = 0;\n for (const plane of this._planes)\n result._planes.push(plane.clone());\n return result;\n }\n /** Return the (reference to the) array of `ClipPlane` */\n public get planes(): ClipPlane[] {\n return this._planes;\n }\n /**\n * Test if there is any intersection with a ray defined by origin and direction.\n * * Optionally record the range (null or otherwise) in caller-allocated result.\n * * If the ray is unbounded inside the clip, result can contain positive or negative\n * \"Geometry.largeCoordinateResult\" values.\n * * If no result is provide, there are no object allocations.\n * @param result optional Range1d to receive parameters along the ray.\n */\n public hasIntersectionWithRay(ray: Ray3d, result?: Range1d, tolerance: number = Geometry.smallMetricDistance): boolean {\n // form low and high values in locals that do not require allocation.\n // transfer to caller-supplied result at end\n let t0 = -Geometry.largeCoordinateResult;\n let t1 = Geometry.largeCoordinateResult;\n if (result)\n result.setNull();\n const velocityTolerance = 1.0e-13;\n for (const plane of this._planes) {\n const vD = plane.velocity(ray.direction);\n const vN = plane.altitude(ray.origin);\n\n if (Math.abs(vD) <= velocityTolerance) {\n // Ray is parallel... No need to continue testing if outside halfspace.\n if (vN < -tolerance)\n return false; // and result is a null range.\n } else {\n const rayFraction = - vN / vD;\n if (vD < 0.0) {\n if (rayFraction < t1)\n t1 = rayFraction;\n } else {\n if (rayFraction > t0)\n t0 = rayFraction;\n }\n }\n }\n if (t1 < t0)\n return false; // and result is a null range.\n if (result) {\n result.extendX(t0);\n result.extendX(t1);\n }\n return true;\n }\n /**\n * Multiply all the ClipPlanes DPoint4d by matrix.\n * @param matrix matrix to apply.\n * @param invert if true, use in verse of the matrix.\n * @param transpose if true, use the transpose of the matrix (or inverse, per invert parameter)\n * * Note that if matrixA is applied to all of space, the matrix to send to this method to get a corresponding effect\n * on the plane is the inverse transpose of matrixA.\n * * Callers that will apply the same matrix to many planes should pre-invert the matrix for efficiency.\n * * Both params default to true to get the full effect of transforming space.\n * @param matrix matrix to apply\n */\n public multiplyPlanesByMatrix4d(matrix: Matrix4d, invert: boolean = true, transpose: boolean = true): boolean {\n if (invert) { // form inverse once here, reuse for all planes\n const inverse = matrix.createInverse();\n if (!inverse)\n return false;\n return this.multiplyPlanesByMatrix4d(inverse, false, transpose);\n }\n for (const plane of this._planes) {\n plane.multiplyPlaneByMatrix4d(matrix, false, transpose);\n }\n return true;\n }\n /** Return true if `point` satisfies `point.isPointInside` for all planes */\n public isPointInside(point: Point3d): boolean {\n for (const plane of this._planes) {\n // Defaults to strict inside check. Other clipping classes may use \"on or inside\" check for the \"on\" case\n if (!plane.isPointInside(point))\n return false;\n }\n return true;\n }\n\n /** Return true if `point` satisfies `point.isPointOnOrInside` for all planes */\n public isPointOnOrInside(point: Point3d, tolerance: number = Geometry.smallMetricDistance): boolean {\n const interiorTolerance = Math.abs(tolerance); // Interior tolerance should always be positive. (TFS# 246598).\n for (const plane of this._planes) {\n if (!plane.isPointOnOrInside(point, (plane.interior ? interiorTolerance : tolerance)))\n return false;\n }\n return true;\n }\n /**\n * Test if a sphere is completely inside the convex set.\n * @param centerPoint center of sphere\n * @param radius radius of sphere.\n */\n public isSphereInside(centerPoint: Point3d, radius: number): boolean {\n const r1 = Math.abs(radius) + Geometry.smallMetricDistance;\n for (const plane of this._planes) {\n if (!plane.isPointOnOrInside(centerPoint, r1)) {\n return false;\n }\n }\n return true;\n }\n /**\n * Find the parts of the line segment (if any) that is within the convex clip volume.\n * * The line segment is defined by `pointA` and `pointB`.\n * * The input fractional interval from `fraction0` to `fraction1` (increasing) is the active part to consider.\n * * To clip to the usual bounded line segment, start with fractions (0,1).\n * If the clip volume is unbounded, the line interval may also be unbounded.\n * * An unbounded line portion will have fraction coordinates positive or negative `Number.MAX_VALUE`.\n * @param f0 fraction that is the initial lower fraction of the active interval (e.g., 0.0 for bounded segment).\n * @param f1 fraction that is the initial upper fraction of the active interval (e.g., 1.0 for bounded segment).\n * @param pointA segment start (fraction 0)\n * @param pointB segment end (fraction 1)\n * @param announce function to be called to announce a fraction interval that is within the convex clip volume.\n * @returns true if a segment was announced, false if entirely outside.\n */\n public announceClippedSegmentIntervals(\n f0: number, f1: number, pointA: Point3d, pointB: Point3d, announce?: AnnounceNumberNumber,\n ): boolean {\n let fraction: number | undefined;\n if (f1 < f0)\n return false;\n for (const plane of this._planes) {\n const hA = -plane.altitude(pointA);\n const hB = -plane.altitude(pointB);\n fraction = Geometry.conditionalDivideFraction(-hA, (hB - hA));\n if (fraction === undefined) {\n // Line parallel to the plane. If positive, it is all OUT\n if (hA > 0.0)\n return false;\n } else if (hB > hA) { // STRICTLY moving outward\n if (fraction < f0)\n return false;\n if (fraction < f1)\n f1 = fraction;\n } else if (hA > hB) { // STRICTLY moving inward\n if (fraction > f1)\n return false;\n if (fraction > f0)\n f0 = fraction;\n } else {\n // Strictly equal evaluations\n if (hA > 0.0)\n return false;\n }\n }\n if (f1 >= f0) {\n if (announce)\n announce(f0, f1);\n return true;\n }\n return false;\n }\n private static _clipArcFractionArray = new GrowableFloat64Array();\n /**\n * Find fractional parts of the arc that are within this ClipPlaneSet, and announce each as\n * * `announce(fraction, fraction, curve)`\n */\n public announceClippedArcIntervals(arc: Arc3d, announce?: AnnounceNumberNumberCurvePrimitive): boolean {\n const breaks = ConvexClipPlaneSet._clipArcFractionArray;\n breaks.clear();\n for (const clipPlane of this.planes) {\n clipPlane.appendIntersectionRadians(arc, breaks);\n }\n arc.sweep.radiansArrayToPositivePeriodicFractions(breaks);\n return ClipUtilities.selectIntervals01(arc, breaks, this, announce);\n }\n /**\n * Find the parts of the (unbounded) line segment (if any) that is within the convex clip volume.\n * @param pointA segment start (fraction 0)\n * @param pointB segment end (fraction 1)\n * @param announce function to be called to announce a fraction interval that is within the convex clip volume.\n * @returns true if a segment was announced, false if entirely outside.\n */\n public clipUnboundedSegment(pointA: Point3d, pointB: Point3d, announce?: AnnounceNumberNumber): boolean {\n return this.announceClippedSegmentIntervals(-Number.MAX_VALUE, Number.MAX_VALUE, pointA, pointB, announce);\n }\n /** transform each plane in place. */\n public transformInPlace(transform: Transform) {\n for (const plane of this._planes) {\n plane.transformInPlace(transform);\n }\n }\n /**\n * Clip a polygon to the inside of the convex set.\n * * Results with 2 or fewer points are ignored.\n * * Other than ensuring capacity in the arrays, there are no object allocations during execution of this function.\n * @param xyz input points.\n * @param work work buffer\n * @param tolerance tolerance for \"on plane\" decision.\n */\n public clipConvexPolygonInPlace(\n xyz: GrowableXYZArray, work: GrowableXYZArray, tolerance: number = Geometry.smallMetricDistance,\n ): void {\n for (const plane of this._planes) {\n plane.clipConvexPolygonInPlace(xyz, work, true, tolerance);\n if (xyz.length < 3)\n return;\n }\n }\n /**\n * Clip a convex polygon to (a single) inside part and (possibly many) outside parts.\n * @param xyz input polygon.\n * @param outsideFragments an array to receive (via push, with no preliminary clear) outside fragments\n * @param arrayCache cache for work arrays.\n * @return the surviving inside part (if any)\n */\n public clipInsidePushOutside(\n xyz: IndexedXYZCollection, outsideFragments: GrowableXYZArray[] | undefined, arrayCache: GrowableXYZArrayCache,\n ): GrowableXYZArray | undefined {\n const perpendicularRange = Range1d.createNull();\n let newInside = arrayCache.grabFromCache();\n let newOutside = arrayCache.grabFromCache();\n let insidePart = arrayCache.grabFromCache(); // this is empty ...\n insidePart.pushFrom(xyz);\n // While looping through planes . .\n // the outside part for the current plane is definitely outside and can be stashed to the final outside\n // the inside part for the current plane passes forward to be further split by the remaining planes.\n for (const plane of this._planes) {\n IndexedXYZCollectionPolygonOps.splitConvexPolygonInsideOutsidePlane(\n plane, insidePart, newInside, newOutside, perpendicularRange,\n );\n if (newOutside.length > 0) {\n // the newOutside fragment is definitely outside the ConvexClipPlaneSet\n if (outsideFragments) // save the definitely outside part as return data.\n ClipUtilities.captureOrDrop(newOutside, 3, outsideFragments, arrayCache);\n newOutside = arrayCache.grabFromCache();\n if (newInside.length === 0) {\n insidePart.length = 0;\n break;\n }\n // insideWork is changed ... swap it with insidePart\n arrayCache.dropToCache(insidePart);\n insidePart = newInside;\n newInside = arrayCache.grabFromCache();\n }\n // outside clip was empty .. insideWork is identical to insidePart .. let insidePart feed through to the next clipper.\n }\n // at break or fall out ...\n // ALWAYS drop `newInside` and `newOutside` to the cache\n arrayCache.dropToCache(newInside);\n arrayCache.dropToCache(newOutside);\n // if `insidePart` is alive, return it to caller. Otherwise drop it to cache and return undefined.\n if (insidePart.length > 0)\n return insidePart;\n arrayCache.dropToCache(insidePart);\n return undefined;\n }\n /**\n * Returns 1, 2, or 3 based on whether point array is strongly inside, ambiguous, or strongly outside respectively.\n * * This has a peculiar expected use case as a very fast pre-filter for more precise clipping.\n * * The expected point set is for a polygon.\n * * Hence any clipping will eventually have to consider the lines between the points.\n * * This method looks for the special case of a single clip plane that has all the points outside.\n * * In this case the whole polygon must be outside.\n * * Note that this does not detect a polygon that is outside but \"crosses a corner\" -- it is mixed with respect to\n * multiple planes.\n */\n public classifyPointContainment(points: Point3d[], onIsOutside: boolean): ClipPlaneContainment {\n let allInside = true;\n const onTolerance = onIsOutside ? 1.0e-8 : -1.0e-8;\n const interiorTolerance = 1.0e-8; // Interior tolerance should always be positive\n\n for (const plane of this._planes) {\n let nOutside = 0;\n for (const point of points) {\n if (plane.altitude(point) < (plane.interior ? interiorTolerance : onTolerance)) {\n nOutside++;\n allInside = false;\n }\n }\n if (nOutside === points.length)\n return ClipPlaneContainment.StronglyOutside;\n }\n return allInside ? ClipPlaneContainment.StronglyInside : ClipPlaneContainment.Ambiguous;\n }\n /**\n * * Create a convex clip set for a polygon swept with possible tilt angle.\n * * planes are constructed by ClipPlane.createEdgeAndUpVector, using successive points from the array.\n * * If the first and last points match, the polygon area is checked. If the area is negative, points are used in\n * reverse order.\n * * If first and last points do not match, points are used in order given\n * @param points polygon points. (Closure point optional)\n * @param upVector primary sweep direction, as applied by ClipPlane.createEdgeAndUpVector\n * @param tiltAngle angle to tilt sweep planes away from the sweep direction.\n */\n public static createSweptPolyline(\n points: Point3d[], upVector: Vector3d, tiltAngle?: Angle,\n ): ConvexClipPlaneSet | undefined {\n const result = ConvexClipPlaneSet.createEmpty();\n let reverse = false;\n if (points.length > 3 && points[0].isAlmostEqual(points[points.length - 1])) {\n const polygonNormal: Vector3d = PolygonOps.areaNormal(points);\n const normalDot = polygonNormal.dotProduct(upVector);\n if (normalDot > 0.0)\n reverse = true;\n }\n for (let i = 0; (i + 1) < points.length; i++) {\n if (reverse) {\n const toAdd = ClipPlane.createEdgeAndUpVector(points[i + 1], points[i], upVector, tiltAngle);\n if (toAdd) { // clipPlane creation could result in undefined\n result.addPlaneToConvexSet(toAdd);\n } else {\n return undefined;\n }\n } else {\n const toAdd = ClipPlane.createEdgeAndUpVector(points[i], points[i + 1], upVector, tiltAngle);\n if (toAdd) { // clipPlane creation could result in undefined\n result.addPlaneToConvexSet(toAdd);\n } else {\n return undefined;\n }\n }\n }\n return result;\n }\n /**\n * Add a plane to the convex set.\n * @param plane plane to add\n */\n public addPlaneToConvexSet(plane: ClipPlane | Plane3dByOriginAndUnitNormal | undefined) {\n if (plane instanceof ClipPlane)\n this._planes.push(plane);\n else if (plane instanceof Plane3dByOriginAndUnitNormal)\n this._planes.push(ClipPlane.createPlane(plane));\n }\n /**\n * Test many points. Distribute them to arrays depending on in/out result.\n * @param points points to test\n * @param inOrOn points that are in or on the set\n * @param out points that are out.\n */\n public clipPointsOnOrInside(points: Point3d[], inOrOn: Point3d[], out: Point3d[]) {\n inOrOn.length = 0;\n out.length = 0;\n for (const xyz of points) {\n if (this.isPointOnOrInside(xyz, 0.0)) {\n inOrOn.push(xyz);\n } else {\n out.push(xyz);\n }\n }\n }\n /**\n * Clip a polygon to the planes of the clip plane set.\n * * For a convex input polygon, the output is another convex polygon.\n * * For a non-convex input, the output may have double-back edges along plane intersections. This is still a\n * valid clip in a parity sense.\n * * The containingPlane parameter allows callers within ConvexClipPlane set to bypass planes known to contain\n * the polygon.\n * @param input polygon, usually convex.\n * @param output output polygon\n * @param work work array.\n * @param containingPlane if this plane is found in the convex set, it is NOT applied.\n */\n public polygonClip(\n input: GrowableXYZArray | Point3d[], output: GrowableXYZArray, work: GrowableXYZArray, planeToSkip?: ClipPlane,\n ): void {\n if (input instanceof GrowableXYZArray)\n input.clone(output);\n else\n GrowableXYZArray.create(input, output);\n\n for (const plane of this._planes) {\n if (planeToSkip === plane)\n continue;\n if (output.length === 0)\n break;\n plane.clipConvexPolygonInPlace(output, work);\n }\n }\n /**\n * * Define new planes in this ConvexClipPlaneSet so it clips to the inside of a polygon.\n * * always create planes for the swept edges of the polygon\n * * optionally (with nonzero sideSelect) create a cap plane using the polygon normal.\n * @param points Points of a bounding polygon\n * @param sweepDirection direction to sweep.\n * @param sideSelect 0 to have no cap polygon, 1 if the sweep vector side is in, -1 if sweep vector side is out.\n */\n public reloadSweptPolygon(points: Point3d[], sweepDirection: Vector3d, sideSelect: number): number {\n this._planes.length = 0;\n const n = points.length;\n if (n <= 2)\n return 0;\n\n const planeNormal: Vector3d = PolygonOps.areaNormal(points);\n const isCCW = sweepDirection.dotProduct(planeNormal) > 0.0;\n\n const delta = isCCW ? 1 : n - 1;\n for (let i = 0; i < n; i++) {\n const i1 = (i + delta) % n;\n const xyz0: Point3d = points[i];\n const xyz1: Point3d = points[i1];\n if (xyz0.isAlmostEqual(xyz1))\n continue;\n const edgeVector: Vector3d = Vector3d.createStartEnd(xyz0, xyz1);\n const inwardNormal: Vector3d = Vector3d.createCrossProduct(sweepDirection.x, sweepDirection.y, sweepDirection.z,\n edgeVector.x, edgeVector.y, edgeVector.z);\n const inwardNormalNormalized = inwardNormal.normalize();\n let distance;\n if (inwardNormalNormalized) { // should never fail... simply a check due to the format of the normalize function return\n distance = inwardNormalNormalized.dotProduct(xyz0);\n const clipToAdd = ClipPlane.createNormalAndDistance(inwardNormalNormalized, distance, false, false);\n if (clipToAdd) { this._planes.push(clipToAdd); } // clipPlane creation could result in undefined\n }\n }\n if (sideSelect !== 0.0) {\n let planeNormalNormalized = planeNormal.normalize();\n if (planeNormalNormalized) { // Again.. should never fail\n const a = sweepDirection.dotProduct(planeNormalNormalized) * sideSelect;\n if (a < 0.0)\n planeNormalNormalized = planeNormalNormalized.negate();\n const xyz0: Point3d = points[0];\n const distance = planeNormalNormalized.dotProduct(xyz0);\n const clipToAdd = ClipPlane.createNormalAndDistance(planeNormalNormalized, distance, false, false);\n if (clipToAdd) { this._planes.push(clipToAdd); } // clipPlane creation could result in undefined\n }\n }\n return isCCW ? 1 : -1;\n }\n /**\n * Compute intersections among all combinations of 3 planes in the convex set.\n * * optionally throw out points that are not in the set.\n * * optionally push the points in the caller-supplied point array.\n * * optionally extend a caller supplied range.\n * * In the common case where the convex set is (a) a slab or (b) a view frustum, there will be 8 points and the\n * range is the range of the convex set.\n * * If the convex set is unbounded, the range only contains the range of the accepted (corner) points, and the\n * range is not a representative of the \"range of all points in the set\".\n * @param points (optional) array to which computed points are to be added.\n * @param rangeToExtend (optional) range to be extended by the computed points\n * @param transform (optional) transform to apply to the accepted points.\n * @param testContainment if true, test each point to see if it is within the convex set. (send false if confident\n * that the convex set is rectilinear set such as a slab. Send true if chiseled corners are possible).\n * @returns number of points.\n */\n public computePlanePlanePlaneIntersections(\n points: Point3d[] | undefined,\n rangeToExtend: Range3d | undefined,\n transform?: Transform,\n testContainment: boolean = true,\n ): number {\n const normalRows = Matrix3d.createIdentity();\n const allPlanes = this._planes;\n const n = allPlanes.length;\n let numPoints = 0; // explicitly count points -- can't wait to end for points.length because it may be an optional output.\n for (let i = 0; i < n; i++) {\n for (let j = i + 1; j < n; j++)\n for (let k = j + 1; k < n; k++) {\n Matrix3d.createRowValues(\n allPlanes[i].inwardNormalRef.x, allPlanes[i].inwardNormalRef.y, allPlanes[i].inwardNormalRef.z,\n allPlanes[j].inwardNormalRef.x, allPlanes[j].inwardNormalRef.y, allPlanes[j].inwardNormalRef.z,\n allPlanes[k].inwardNormalRef.x, allPlanes[k].inwardNormalRef.y, allPlanes[k].inwardNormalRef.z,\n normalRows);\n if (normalRows.computeCachedInverse(false)) {\n const xyz = normalRows.multiplyInverseXYZAsPoint3d(allPlanes[i].distance, allPlanes[j].distance, allPlanes[k].distance)!;\n if (!testContainment || this.isPointOnOrInside(xyz, Geometry.smallMetricDistance)) {\n numPoints++;\n if (transform)\n transform.multiplyPoint3d(xyz, xyz);\n if (points)\n points.push(xyz);\n if (rangeToExtend)\n rangeToExtend.extendPoint(xyz);\n }\n }\n }\n }\n return numPoints;\n }\n /**\n * Set the `invisible` property on each plane of the convex set.\n * @param invisible value to store\n */\n public setInvisible(invisible: boolean) {\n for (const plane of this._planes) {\n plane.setInvisible(invisible);\n }\n }\n /**\n * Add planes for z-direction clip between low and high z levels.\n * @param invisible value to apply to the `invisible` bit for the new planes\n * @param zLow low z value. The plane clips out points with z below this.\n * @param zHigh high z value. The plane clips out points with z above this.\n */\n public addZClipPlanes(invisible: boolean, zLow?: number, zHigh?: number) {\n if (zLow !== undefined)\n this._planes.push(ClipPlane.createNormalAndDistance(Vector3d.create(0, 0, 1), zLow, invisible)!);\n if (zHigh !== undefined)\n this._planes.push(ClipPlane.createNormalAndDistance(Vector3d.create(0, 0, -1), -zHigh, invisible)!);\n }\n /**\n * Implement appendPolygonClip, as defined in interface PolygonClipper.\n * @param xyz convex polygon. This is not changed.\n * @param insideFragments Array to receive \"inside\" fragments. Each fragment is a GrowableXYZArray grabbed from\n * the cache. This is NOT cleared.\n * @param outsideFragments Array to receive \"outside\" fragments. Each fragment is a GrowableXYZArray grabbed from\n * the cache. This is NOT cleared.\n * @param arrayCache cache for reusable GrowableXYZArray.\n */\n public appendPolygonClip(\n xyz: IndexedXYZCollection,\n insideFragments: GrowableXYZArray[],\n outsideFragments: GrowableXYZArray[],\n arrayCache: GrowableXYZArrayCache,\n ): void {\n const newInside = this.clipInsidePushOutside(xyz, outsideFragments, arrayCache);\n if (newInside)\n insideFragments.push(newInside);\n }\n /**\n * Create a convex clip set from a convex mesh.\n * * Create a plane for each facet.\n * * Assemble the planes as a single clip plane set.\n * * If the facets are closed by edge pairing, use the sign of the computed volume to point the plane normals inward.\n * * If the facets are not closed, the facet orientation determines plane orientation.\n * * The implication of this is that if the facets are a convex volume, the returned clip plane set is convex.\n * @param convexMesh input mesh. For best results, the mesh should be closed and convex.\n * @param result optional preallocated result to reuse and return\n * @return clipper and volume (zero if mesh is not closed)\n */\n public static createConvexPolyface(\n convexMesh: Polyface | PolyfaceVisitor, result?: ConvexClipPlaneSet,\n ): { clipper: ConvexClipPlaneSet, volume: number } {\n result = this.createEmpty(result);\n let vol = 0;\n if (PolyfaceQuery.isPolyfaceClosedByEdgePairing(convexMesh))\n vol = PolyfaceQuery.sumTetrahedralVolumes(convexMesh);\n const scale = vol > 0.0 ? -1.0 : 1.0; // point clipper normals inward if mesh normals point outward\n const normal = Vector3d.create();\n const plane = Plane3dByOriginAndUnitNormal.createXYPlane();\n const visitor = convexMesh instanceof Polyface ? convexMesh.createVisitor(0) : convexMesh;\n visitor.setNumWrap(0);\n for (visitor.reset(); visitor.moveToNextFacet(); ) {\n if (undefined !== PolygonOps.areaNormalGo(visitor.point, normal)) {\n normal.scaleInPlace(scale);\n if (undefined !== Plane3dByOriginAndUnitNormal.create(visitor.point.front()!, normal, plane))\n result.addPlaneToConvexSet(plane);\n }\n }\n return { clipper: result, volume: vol };\n }\n\n // FUNCTIONS SKIPPED DUE TO BSPLINES, VU, OR NON-USAGE IN NATIVE CODE----------------------------------------------------------------\n\n // Uses bsplines... skipping for now:\n // public convexAppendIntervalsFromBspline();\n\n // Uses pushing and clearing from/to a cache and added functionality for arrays. . . skipping for now\n // public convexPolygonClipInsideOutside(input: Point3d[], inside: Point3d[], outside: Point3d[], work1: Point3d[], work2: Point3d[],\n // clearOutside: boolean, distanceTolerance: number)\n}\n"]}
1
+ {"version":3,"file":"ConvexClipPlaneSet.js","sourceRoot":"","sources":["../../../src/clipping/ConvexClipPlaneSet.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAQ/F,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEvC,OAAO,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAC1E,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAElE,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAClD,OAAO,EAAE,4BAA4B,EAAE,MAAM,4CAA4C,CAAC;AAC1F,OAAO,EAAW,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,8BAA8B,EAAE,UAAU,EAAE,MAAM,0BAA0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6B,CAAC,UAAU,CAAC;YACzD,GAAG,GAAG,aAAa,CAAC,qBAAqB,CAAC,UAAU,CAAC,CAAC;QACxD,MAAM,KAAK,GAAG,GAAG,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,6DAA6D;QACnG,MAAM,MAAM,GAAG,QAAQ,CAAC,MAAM,EAAE,CAAC;QACjC,MAAM,KAAK,GAAG,4BAA4B,CAAC,aAAa,EAAE,CAAC;QAC3D,MAAM,OAAO,GAAG,UAAU,YAAY,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC;QAC1F,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;QACtB,KAAK,OAAO,CAAC,KAAK,EAAE,EAAE,OAAO,CAAC,eAAe,EAAE,GAAI,CAAC;YAClD,IAAI,SAAS,KAAK,UAAU,CAAC,YAAY,CAAC,OAAO,CAAC,KAAK,EAAE,MAAM,CAAC,EAAE,CAAC;gBACjE,MAAM,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;gBAC3B,IAAI,SAAS,KAAK,4BAA4B,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,EAAG,EAAE,MAAM,EAAE,KAAK,CAAC;oBAC1F,MAAM,CAAC,mBAAmB,CAAC,KAAK,CAAC,CAAC;YACtC,CAAC;QACH,CAAC;QACD,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC;IAC1C,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\n/** @packageDocumentation\r\n * @module CartesianGeometry\r\n */\r\n\r\nimport { Arc3d } from \"../curve/Arc3d\";\r\nimport { AnnounceNumberNumber, AnnounceNumberNumberCurvePrimitive } from \"../curve/CurvePrimitive\";\r\nimport { Geometry } from \"../Geometry\";\r\nimport { Angle } from \"../geometry3d/Angle\";\r\nimport { GrowableFloat64Array } from \"../geometry3d/GrowableFloat64Array\";\r\nimport { GrowableXYZArray } from \"../geometry3d/GrowableXYZArray\";\r\nimport { IndexedXYZCollection } from \"../geometry3d/IndexedXYZCollection\";\r\nimport { Matrix3d } from \"../geometry3d/Matrix3d\";\r\nimport { Plane3dByOriginAndUnitNormal } from \"../geometry3d/Plane3dByOriginAndUnitNormal\";\r\nimport { Point3d, Vector3d } from \"../geometry3d/Point3dVector3d\";\r\nimport { IndexedXYZCollectionPolygonOps, PolygonOps } from \"../geometry3d/PolygonOps\";\r\nimport { Range1d, Range3d } from \"../geometry3d/Range\";\r\nimport { Ray3d } from \"../geometry3d/Ray3d\";\r\nimport { GrowableXYZArrayCache } from \"../geometry3d/ReusableObjectCache\";\r\nimport { Transform } from \"../geometry3d/Transform\";\r\nimport { Matrix4d } from \"../geometry4d/Matrix4d\";\r\nimport { Polyface, PolyfaceVisitor } from \"../polyface/Polyface\";\r\nimport { PolyfaceQuery } from \"../polyface/PolyfaceQuery\";\r\nimport { ClipPlane, ClipPlaneProps } from \"./ClipPlane\";\r\nimport { Clipper, ClipPlaneContainment, ClipUtilities, PolygonClipper } from \"./ClipUtils\";\r\n\r\n/** Wire format describing a [[ConvexClipPlaneSet]].\r\n * @public\r\n */\r\nexport type ConvexClipPlaneSetProps = ClipPlaneProps[];\r\n\r\n/**\r\n * A ConvexClipPlaneSet is a collection of ClipPlanes, often used for bounding regions of space.\r\n * @public\r\n */\r\nexport class ConvexClipPlaneSet implements Clipper, PolygonClipper {\r\n /** Value acting as \"at infinity\" for coordinates along a ray. */\r\n public static readonly hugeVal = 1e37;\r\n /** Planes that define the convex set. */\r\n private _planes: ClipPlane[];\r\n // private _parity: number; <--- Not yet used\r\n // public get parity() { return this._parity; }\r\n // public set parity(value: number) { this._parity = value; }\r\n private constructor(planes?: ClipPlane[]) {\r\n // this._parity = 1;\r\n this._planes = planes ? planes : [];\r\n }\r\n /**\r\n * Return an array containing all the planes of the convex set.\r\n * * Note that this has no leading keyword identifying it as a ConvexClipPlaneSet.\r\n */\r\n public toJSON(): ConvexClipPlaneSetProps {\r\n const val: ClipPlaneProps[] = [];\r\n for (const plane of this._planes)\r\n val.push(plane.toJSON());\r\n return val;\r\n }\r\n /**\r\n * Extract clip planes from a json array `[ clipPlane, clipPlane ]`.\r\n * * Non-clipPlane members are ignored.\r\n */\r\n public static fromJSON(json: ConvexClipPlaneSetProps | undefined, result?: ConvexClipPlaneSet): ConvexClipPlaneSet {\r\n result = result ? result : new ConvexClipPlaneSet();\r\n result._planes.length = 0;\r\n if (!Array.isArray(json))\r\n return result;\r\n for (const thisJson of json) {\r\n const plane = ClipPlane.fromJSON(thisJson);\r\n if (plane)\r\n result._planes.push(plane);\r\n }\r\n return result;\r\n }\r\n /**\r\n * Return true if all members are almostEqual to corresponding members of other. This includes identical order in array.\r\n * @param other clip plane to compare\r\n */\r\n public isAlmostEqual(other: ConvexClipPlaneSet): boolean {\r\n if (this._planes.length !== other._planes.length)\r\n return false;\r\n for (let i = 0; i < this._planes.length; i++)\r\n if (!this._planes[i].isAlmostEqual(other._planes[i]))\r\n return false;\r\n return true;\r\n }\r\n /**\r\n * Create ConvexClipPlaneSet from an array of planes.\r\n * * Each plane reference in the `planes` array is taken into the result.\r\n * * The input array itself is NOT taken into the result.\r\n */\r\n public static createPlanes(\r\n planes: (ClipPlane | Plane3dByOriginAndUnitNormal)[], result?: ConvexClipPlaneSet,\r\n ): ConvexClipPlaneSet {\r\n result = result ? result : new ConvexClipPlaneSet();\r\n for (const plane of planes) {\r\n if (plane instanceof ClipPlane) {\r\n result._planes.push(plane);\r\n } else if (plane instanceof Plane3dByOriginAndUnitNormal) {\r\n const clipPlane = ClipPlane.createPlane(plane);\r\n result._planes.push(clipPlane);\r\n }\r\n }\r\n return result;\r\n }\r\n /**\r\n * Create new convex set using selected planes of a Range3d.\r\n * @param range range with coordinates\r\n * @param lowX true to clip at the low x plane\r\n * @param highX true to clip at the high x plane\r\n * @param lowY true to clip at the low y plane\r\n * @param highY true to clip at the high z plane\r\n * @param lowZ true to clip at the low z plane\r\n * @param highZ true to clip at the high z plane\r\n */\r\n public static createRange3dPlanes(\r\n range: Range3d,\r\n lowX: boolean = true,\r\n highX: boolean = true,\r\n lowY: boolean = true,\r\n highY: boolean = true,\r\n lowZ: boolean = true,\r\n highZ: boolean = true,\r\n ): ConvexClipPlaneSet {\r\n const result = ConvexClipPlaneSet.createEmpty();\r\n\r\n if (lowX)\r\n result.planes.push(ClipPlane.createNormalAndPointXYZXYZ(1, 0, 0, range.low.x, 0, 0)!);\r\n if (highX)\r\n result.planes.push(ClipPlane.createNormalAndPointXYZXYZ(-1, 0, 0, range.high.x, 0, 0)!);\r\n\r\n if (lowY)\r\n result.planes.push(ClipPlane.createNormalAndPointXYZXYZ(0, 1, 0, 0, range.low.y, 0)!);\r\n if (highY)\r\n result.planes.push(ClipPlane.createNormalAndPointXYZXYZ(0, -1, 0, 0, range.high.y, 0)!);\r\n\r\n if (lowZ)\r\n result.planes.push(ClipPlane.createNormalAndPointXYZXYZ(0, 0, 1, 0, 0, range.low.z)!);\r\n if (highZ)\r\n result.planes.push(ClipPlane.createNormalAndPointXYZXYZ(0, 0, -1, 0, 0, range.high.z)!);\r\n\r\n return result;\r\n }\r\n /** Create an empty `ConvexClipPlaneSet` */\r\n public static createEmpty(result?: ConvexClipPlaneSet): ConvexClipPlaneSet {\r\n if (result) {\r\n result._planes.length = 0;\r\n return result;\r\n }\r\n return new ConvexClipPlaneSet();\r\n }\r\n /** Negate all planes of the set. */\r\n public negateAllPlanes(): void {\r\n for (const plane of this._planes)\r\n plane.negateInPlace();\r\n }\r\n /**\r\n * Create a convex clip plane set that clips to `x0 <= x <= x1` and `y0 <= y <= y1`.\r\n * * Note that there is no test for the usual ordering `x0 <= x1` or `y0 <= y1`.\r\n * * if the usual ordering is violated, the convex set is an empty set.\r\n * * More details can be found at docs/learning/geometry/Clipping.md\r\n */\r\n public static createXYBox(\r\n x0: number, y0: number, x1: number, y1: number, result?: ConvexClipPlaneSet,\r\n ): ConvexClipPlaneSet {\r\n result = result ? result : new ConvexClipPlaneSet();\r\n result._planes.length = 0;\r\n const clip0 = ClipPlane.createNormalAndDistance(Vector3d.create(-1, 0, 0), -x1, false, true);\r\n const clip1 = ClipPlane.createNormalAndDistance(Vector3d.create(1, 0, 0), x0, false, true);\r\n const clip2 = ClipPlane.createNormalAndDistance(Vector3d.create(0, -1, 0), -y1, false, true);\r\n const clip3 = ClipPlane.createNormalAndDistance(Vector3d.create(0, 1, 0), y0, false, true);\r\n if (clip0 && clip1 && clip2 && clip3) {\r\n result._planes.push(clip0, clip1, clip2, clip3);\r\n }\r\n return result;\r\n }\r\n /**\r\n * Create a convex set containing a half space for each edge between points of a polyline.\r\n * * Caller is responsible for assuring the polyline is convex.\r\n * @param points array of points. Only xy parts are considered.\r\n * @param interior array whose boolean value is used as both the `interior` and `invisible` bits of the plane for the\r\n * succeeding segment. If this array is not provided, both are false.\r\n * @param leftIsInside if true, the interior is \"to the left\" of the segments. If false, interior is \"to the right\".\r\n */\r\n public static createXYPolyLine(\r\n points: Point3d[], interior: boolean[] | undefined, leftIsInside: boolean, result?: ConvexClipPlaneSet,\r\n ): ConvexClipPlaneSet {\r\n result = result ? result : new ConvexClipPlaneSet();\r\n result._planes.length = 0;\r\n for (let i0 = 0; (i0 + 1) < points.length; i0++) {\r\n const edgeVector: Vector3d = Vector3d.createStartEnd(points[i0], points[i0 + 1]);\r\n const perp: Vector3d = edgeVector.unitPerpendicularXY();\r\n perp.z = 0.0;\r\n\r\n if (!leftIsInside)\r\n perp.scaleInPlace(-1.0);\r\n\r\n const perpNormalized = perp.normalize();\r\n if (perpNormalized) {\r\n const flag = interior !== undefined ? interior[i0] : false;\r\n const clip = ClipPlane.createNormalAndPoint(perp, points[i0], flag, flag);\r\n if (clip) {\r\n result._planes.push(clip);\r\n }\r\n }\r\n }\r\n return result;\r\n }\r\n /**\r\n * Create a convexClipPlaneSet with planes whose \"inside\" normal is to the left of each segment.\r\n * @param points array of points.\r\n */\r\n public static createXYPolyLineInsideLeft(points: Point3d[], result?: ConvexClipPlaneSet): ConvexClipPlaneSet {\r\n result = result ? result : new ConvexClipPlaneSet();\r\n result._planes.length = 0;\r\n for (let i0 = 0; (i0 + 1) < points.length; i0++) {\r\n const edgeVector: Vector3d = Vector3d.createStartEnd(points[i0], points[i0 + 1]);\r\n const perp: Vector3d = edgeVector.unitPerpendicularXY();\r\n perp.z = 0.0;\r\n\r\n const perpNormalized = perp.normalize();\r\n if (perpNormalized) {\r\n const clip = ClipPlane.createNormalAndPoint(perp, points[i0], false, false);\r\n if (clip) { result._planes.push(clip); }\r\n }\r\n }\r\n return result;\r\n }\r\n /**\r\n * Set (or reset) a plane and ConvexClipPlaneSet for a convex array, such as a convex facet used for xy clip.\r\n * * The planeOfPolygon is (re)initialized with the normal from 3 points, but not otherwise referenced.\r\n * * The ConvexClipPlaneSet is filled with outward normals of the facet edges as viewed to xy plane.\r\n * @param points\r\n * @param result\r\n */\r\n public static setPlaneAndXYLoopCCW(points: GrowableXYZArray, planeOfPolygon: ClipPlane, frustum: ConvexClipPlaneSet) {\r\n const i0 = points.length - 1;\r\n const n = points.length;\r\n let x0 = points.getXAtUncheckedPointIndex(i0);\r\n let y0 = points.getYAtUncheckedPointIndex(i0);\r\n let x1, y1, nx, ny;\r\n frustum._planes.length = 0;\r\n const z0 = points.getZAtUncheckedPointIndex(i0); // z for planes can stay fixed\r\n const planeNormal = points.crossProductIndexIndexIndex(0, 2, 1)!;\r\n ClipPlane.createNormalAndPointXYZXYZ(planeNormal.x, planeNormal.y, planeNormal.z, x0, y0, z0, false, false, planeOfPolygon);\r\n if (planeNormal.normalizeInPlace()) {\r\n for (let i1 = 0; i1 < n; i1++, x0 = x1, y0 = y1) {\r\n x1 = points.getXAtUncheckedPointIndex(i1);\r\n y1 = points.getYAtUncheckedPointIndex(i1);\r\n nx = -(y1 - y0);\r\n ny = x1 - x0;\r\n const clipper = ClipPlane.createNormalAndPointXYZXYZ(nx, ny, 0, x1, y1, z0);\r\n if (clipper)\r\n frustum._planes.push(clipper);\r\n }\r\n }\r\n }\r\n /** Deep clone of all planes. */\r\n public clone(result?: ConvexClipPlaneSet): ConvexClipPlaneSet {\r\n result = result ? result : new ConvexClipPlaneSet();\r\n result._planes.length = 0;\r\n for (const plane of this._planes)\r\n result._planes.push(plane.clone());\r\n return result;\r\n }\r\n /** Return the (reference to the) array of `ClipPlane` */\r\n public get planes(): ClipPlane[] {\r\n return this._planes;\r\n }\r\n /**\r\n * Test if there is any intersection with a ray defined by origin and direction.\r\n * * Optionally record the range (null or otherwise) in caller-allocated result.\r\n * * If the ray is unbounded inside the clip, result can contain positive or negative\r\n * \"Geometry.largeCoordinateResult\" values.\r\n * * If no result is provide, there are no object allocations.\r\n * @param result optional Range1d to receive parameters along the ray.\r\n */\r\n public hasIntersectionWithRay(ray: Ray3d, result?: Range1d, tolerance: number = Geometry.smallMetricDistance): boolean {\r\n // form low and high values in locals that do not require allocation.\r\n // transfer to caller-supplied result at end\r\n let t0 = -Geometry.largeCoordinateResult;\r\n let t1 = Geometry.largeCoordinateResult;\r\n if (result)\r\n result.setNull();\r\n const velocityTolerance = 1.0e-13;\r\n for (const plane of this._planes) {\r\n const vD = plane.velocity(ray.direction);\r\n const vN = plane.altitude(ray.origin);\r\n\r\n if (Math.abs(vD) <= velocityTolerance) {\r\n // Ray is parallel... No need to continue testing if outside halfspace.\r\n if (vN < -tolerance)\r\n return false; // and result is a null range.\r\n } else {\r\n const rayFraction = - vN / vD;\r\n if (vD < 0.0) {\r\n if (rayFraction < t1)\r\n t1 = rayFraction;\r\n } else {\r\n if (rayFraction > t0)\r\n t0 = rayFraction;\r\n }\r\n }\r\n }\r\n if (t1 < t0)\r\n return false; // and result is a null range.\r\n if (result) {\r\n result.extendX(t0);\r\n result.extendX(t1);\r\n }\r\n return true;\r\n }\r\n /**\r\n * Multiply all the ClipPlanes DPoint4d by matrix.\r\n * @param matrix matrix to apply.\r\n * @param invert if true, use in verse of the matrix.\r\n * @param transpose if true, use the transpose of the matrix (or inverse, per invert parameter)\r\n * * Note that if matrixA is applied to all of space, the matrix to send to this method to get a corresponding effect\r\n * on the plane is the inverse transpose of matrixA.\r\n * * Callers that will apply the same matrix to many planes should pre-invert the matrix for efficiency.\r\n * * Both params default to true to get the full effect of transforming space.\r\n * @param matrix matrix to apply\r\n */\r\n public multiplyPlanesByMatrix4d(matrix: Matrix4d, invert: boolean = true, transpose: boolean = true): boolean {\r\n if (invert) { // form inverse once here, reuse for all planes\r\n const inverse = matrix.createInverse();\r\n if (!inverse)\r\n return false;\r\n return this.multiplyPlanesByMatrix4d(inverse, false, transpose);\r\n }\r\n for (const plane of this._planes) {\r\n plane.multiplyPlaneByMatrix4d(matrix, false, transpose);\r\n }\r\n return true;\r\n }\r\n /** Return true if `point` satisfies `point.isPointInside` for all planes */\r\n public isPointInside(point: Point3d): boolean {\r\n for (const plane of this._planes) {\r\n // Defaults to strict inside check. Other clipping classes may use \"on or inside\" check for the \"on\" case\r\n if (!plane.isPointInside(point))\r\n return false;\r\n }\r\n return true;\r\n }\r\n\r\n /** Return true if `point` satisfies `point.isPointOnOrInside` for all planes */\r\n public isPointOnOrInside(point: Point3d, tolerance: number = Geometry.smallMetricDistance): boolean {\r\n const interiorTolerance = Math.abs(tolerance); // Interior tolerance should always be positive. (TFS# 246598).\r\n for (const plane of this._planes) {\r\n if (!plane.isPointOnOrInside(point, (plane.interior ? interiorTolerance : tolerance)))\r\n return false;\r\n }\r\n return true;\r\n }\r\n /**\r\n * Test if a sphere is completely inside the convex set.\r\n * @param centerPoint center of sphere\r\n * @param radius radius of sphere.\r\n */\r\n public isSphereInside(centerPoint: Point3d, radius: number): boolean {\r\n const r1 = Math.abs(radius) + Geometry.smallMetricDistance;\r\n for (const plane of this._planes) {\r\n if (!plane.isPointOnOrInside(centerPoint, r1)) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n }\r\n /**\r\n * Find the parts of the line segment (if any) that is within the convex clip volume.\r\n * * The line segment is defined by `pointA` and `pointB`.\r\n * * The input fractional interval from `fraction0` to `fraction1` (increasing) is the active part to consider.\r\n * * To clip to the usual bounded line segment, start with fractions (0,1).\r\n * If the clip volume is unbounded, the line interval may also be unbounded.\r\n * * An unbounded line portion will have fraction coordinates positive or negative `Number.MAX_VALUE`.\r\n * @param f0 fraction that is the initial lower fraction of the active interval (e.g., 0.0 for bounded segment).\r\n * @param f1 fraction that is the initial upper fraction of the active interval (e.g., 1.0 for bounded segment).\r\n * @param pointA segment start (fraction 0)\r\n * @param pointB segment end (fraction 1)\r\n * @param announce function to be called to announce a fraction interval that is within the convex clip volume.\r\n * @returns true if a segment was announced, false if entirely outside.\r\n */\r\n public announceClippedSegmentIntervals(\r\n f0: number, f1: number, pointA: Point3d, pointB: Point3d, announce?: AnnounceNumberNumber,\r\n ): boolean {\r\n let fraction: number | undefined;\r\n if (f1 < f0)\r\n return false;\r\n for (const plane of this._planes) {\r\n const hA = -plane.altitude(pointA);\r\n const hB = -plane.altitude(pointB);\r\n fraction = Geometry.conditionalDivideFraction(-hA, (hB - hA));\r\n if (fraction === undefined) {\r\n // Line parallel to the plane. If positive, it is all OUT\r\n if (hA > 0.0)\r\n return false;\r\n } else if (hB > hA) { // STRICTLY moving outward\r\n if (fraction < f0)\r\n return false;\r\n if (fraction < f1)\r\n f1 = fraction;\r\n } else if (hA > hB) { // STRICTLY moving inward\r\n if (fraction > f1)\r\n return false;\r\n if (fraction > f0)\r\n f0 = fraction;\r\n } else {\r\n // Strictly equal evaluations\r\n if (hA > 0.0)\r\n return false;\r\n }\r\n }\r\n if (f1 >= f0) {\r\n if (announce)\r\n announce(f0, f1);\r\n return true;\r\n }\r\n return false;\r\n }\r\n private static _clipArcFractionArray = new GrowableFloat64Array();\r\n /**\r\n * Find fractional parts of the arc that are within this ClipPlaneSet, and announce each as\r\n * * `announce(fraction, fraction, curve)`\r\n */\r\n public announceClippedArcIntervals(arc: Arc3d, announce?: AnnounceNumberNumberCurvePrimitive): boolean {\r\n const breaks = ConvexClipPlaneSet._clipArcFractionArray;\r\n breaks.clear();\r\n for (const clipPlane of this.planes) {\r\n clipPlane.appendIntersectionRadians(arc, breaks);\r\n }\r\n arc.sweep.radiansArrayToPositivePeriodicFractions(breaks);\r\n return ClipUtilities.selectIntervals01(arc, breaks, this, announce);\r\n }\r\n /**\r\n * Find the parts of the (unbounded) line segment (if any) that is within the convex clip volume.\r\n * @param pointA segment start (fraction 0)\r\n * @param pointB segment end (fraction 1)\r\n * @param announce function to be called to announce a fraction interval that is within the convex clip volume.\r\n * @returns true if a segment was announced, false if entirely outside.\r\n */\r\n public clipUnboundedSegment(pointA: Point3d, pointB: Point3d, announce?: AnnounceNumberNumber): boolean {\r\n return this.announceClippedSegmentIntervals(-Number.MAX_VALUE, Number.MAX_VALUE, pointA, pointB, announce);\r\n }\r\n /** transform each plane in place. */\r\n public transformInPlace(transform: Transform) {\r\n for (const plane of this._planes) {\r\n plane.transformInPlace(transform);\r\n }\r\n }\r\n /**\r\n * Clip a polygon to the inside of the convex set.\r\n * * Results with 2 or fewer points are ignored.\r\n * * Other than ensuring capacity in the arrays, there are no object allocations during execution of this function.\r\n * @param xyz input points.\r\n * @param work work buffer\r\n * @param tolerance tolerance for \"on plane\" decision.\r\n */\r\n public clipConvexPolygonInPlace(\r\n xyz: GrowableXYZArray, work: GrowableXYZArray, tolerance: number = Geometry.smallMetricDistance,\r\n ): void {\r\n for (const plane of this._planes) {\r\n plane.clipConvexPolygonInPlace(xyz, work, true, tolerance);\r\n if (xyz.length < 3)\r\n return;\r\n }\r\n }\r\n /**\r\n * Clip a convex polygon to (a single) inside part and (possibly many) outside parts.\r\n * @param xyz input polygon.\r\n * @param outsideFragments an array to receive (via push, with no preliminary clear) outside fragments\r\n * @param arrayCache cache for work arrays.\r\n * @return the surviving inside part (if any)\r\n */\r\n public clipInsidePushOutside(\r\n xyz: IndexedXYZCollection, outsideFragments: GrowableXYZArray[] | undefined, arrayCache: GrowableXYZArrayCache,\r\n ): GrowableXYZArray | undefined {\r\n const perpendicularRange = Range1d.createNull();\r\n let newInside = arrayCache.grabFromCache();\r\n let newOutside = arrayCache.grabFromCache();\r\n let insidePart = arrayCache.grabFromCache(); // this is empty ...\r\n insidePart.pushFrom(xyz);\r\n // While looping through planes . .\r\n // the outside part for the current plane is definitely outside and can be stashed to the final outside\r\n // the inside part for the current plane passes forward to be further split by the remaining planes.\r\n for (const plane of this._planes) {\r\n IndexedXYZCollectionPolygonOps.splitConvexPolygonInsideOutsidePlane(\r\n plane, insidePart, newInside, newOutside, perpendicularRange,\r\n );\r\n if (newOutside.length > 0) {\r\n // the newOutside fragment is definitely outside the ConvexClipPlaneSet\r\n if (outsideFragments) // save the definitely outside part as return data.\r\n ClipUtilities.captureOrDrop(newOutside, 3, outsideFragments, arrayCache);\r\n newOutside = arrayCache.grabFromCache();\r\n if (newInside.length === 0) {\r\n insidePart.length = 0;\r\n break;\r\n }\r\n // insideWork is changed ... swap it with insidePart\r\n arrayCache.dropToCache(insidePart);\r\n insidePart = newInside;\r\n newInside = arrayCache.grabFromCache();\r\n }\r\n // outside clip was empty .. insideWork is identical to insidePart .. let insidePart feed through to the next clipper.\r\n }\r\n // at break or fall out ...\r\n // ALWAYS drop `newInside` and `newOutside` to the cache\r\n arrayCache.dropToCache(newInside);\r\n arrayCache.dropToCache(newOutside);\r\n // if `insidePart` is alive, return it to caller. Otherwise drop it to cache and return undefined.\r\n if (insidePart.length > 0)\r\n return insidePart;\r\n arrayCache.dropToCache(insidePart);\r\n return undefined;\r\n }\r\n /**\r\n * Returns 1, 2, or 3 based on whether point array is strongly inside, ambiguous, or strongly outside respectively.\r\n * * This has a peculiar expected use case as a very fast pre-filter for more precise clipping.\r\n * * The expected point set is for a polygon.\r\n * * Hence any clipping will eventually have to consider the lines between the points.\r\n * * This method looks for the special case of a single clip plane that has all the points outside.\r\n * * In this case the whole polygon must be outside.\r\n * * Note that this does not detect a polygon that is outside but \"crosses a corner\" -- it is mixed with respect to\r\n * multiple planes.\r\n */\r\n public classifyPointContainment(points: Point3d[], onIsOutside: boolean): ClipPlaneContainment {\r\n let allInside = true;\r\n const onTolerance = onIsOutside ? 1.0e-8 : -1.0e-8;\r\n const interiorTolerance = 1.0e-8; // Interior tolerance should always be positive\r\n\r\n for (const plane of this._planes) {\r\n let nOutside = 0;\r\n for (const point of points) {\r\n if (plane.altitude(point) < (plane.interior ? interiorTolerance : onTolerance)) {\r\n nOutside++;\r\n allInside = false;\r\n }\r\n }\r\n if (nOutside === points.length)\r\n return ClipPlaneContainment.StronglyOutside;\r\n }\r\n return allInside ? ClipPlaneContainment.StronglyInside : ClipPlaneContainment.Ambiguous;\r\n }\r\n /**\r\n * * Create a convex clip set for a polygon swept with possible tilt angle.\r\n * * planes are constructed by ClipPlane.createEdgeAndUpVector, using successive points from the array.\r\n * * If the first and last points match, the polygon area is checked. If the area is negative, points are used in\r\n * reverse order.\r\n * * If first and last points do not match, points are used in order given\r\n * @param points polygon points. (Closure point optional)\r\n * @param upVector primary sweep direction, as applied by ClipPlane.createEdgeAndUpVector\r\n * @param tiltAngle angle to tilt sweep planes away from the sweep direction.\r\n */\r\n public static createSweptPolyline(\r\n points: Point3d[], upVector: Vector3d, tiltAngle?: Angle,\r\n ): ConvexClipPlaneSet | undefined {\r\n const result = ConvexClipPlaneSet.createEmpty();\r\n let reverse = false;\r\n if (points.length > 3 && points[0].isAlmostEqual(points[points.length - 1])) {\r\n const polygonNormal: Vector3d = PolygonOps.areaNormal(points);\r\n const normalDot = polygonNormal.dotProduct(upVector);\r\n if (normalDot > 0.0)\r\n reverse = true;\r\n }\r\n for (let i = 0; (i + 1) < points.length; i++) {\r\n if (reverse) {\r\n const toAdd = ClipPlane.createEdgeAndUpVector(points[i + 1], points[i], upVector, tiltAngle);\r\n if (toAdd) { // clipPlane creation could result in undefined\r\n result.addPlaneToConvexSet(toAdd);\r\n } else {\r\n return undefined;\r\n }\r\n } else {\r\n const toAdd = ClipPlane.createEdgeAndUpVector(points[i], points[i + 1], upVector, tiltAngle);\r\n if (toAdd) { // clipPlane creation could result in undefined\r\n result.addPlaneToConvexSet(toAdd);\r\n } else {\r\n return undefined;\r\n }\r\n }\r\n }\r\n return result;\r\n }\r\n /**\r\n * Add a plane to the convex set.\r\n * @param plane plane to add\r\n */\r\n public addPlaneToConvexSet(plane: ClipPlane | Plane3dByOriginAndUnitNormal | undefined) {\r\n if (plane instanceof ClipPlane)\r\n this._planes.push(plane);\r\n else if (plane instanceof Plane3dByOriginAndUnitNormal)\r\n this._planes.push(ClipPlane.createPlane(plane));\r\n }\r\n /**\r\n * Test many points. Distribute them to arrays depending on in/out result.\r\n * @param points points to test\r\n * @param inOrOn points that are in or on the set\r\n * @param out points that are out.\r\n */\r\n public clipPointsOnOrInside(points: Point3d[], inOrOn: Point3d[], out: Point3d[]) {\r\n inOrOn.length = 0;\r\n out.length = 0;\r\n for (const xyz of points) {\r\n if (this.isPointOnOrInside(xyz, 0.0)) {\r\n inOrOn.push(xyz);\r\n } else {\r\n out.push(xyz);\r\n }\r\n }\r\n }\r\n /**\r\n * Clip a polygon to the planes of the clip plane set.\r\n * * For a convex input polygon, the output is another convex polygon.\r\n * * For a non-convex input, the output may have double-back edges along plane intersections. This is still a\r\n * valid clip in a parity sense.\r\n * * The containingPlane parameter allows callers within ConvexClipPlane set to bypass planes known to contain\r\n * the polygon.\r\n * @param input polygon, usually convex.\r\n * @param output output polygon\r\n * @param work work array.\r\n * @param containingPlane if this plane is found in the convex set, it is NOT applied.\r\n */\r\n public polygonClip(\r\n input: GrowableXYZArray | Point3d[], output: GrowableXYZArray, work: GrowableXYZArray, planeToSkip?: ClipPlane,\r\n ): void {\r\n if (input instanceof GrowableXYZArray)\r\n input.clone(output);\r\n else\r\n GrowableXYZArray.create(input, output);\r\n\r\n for (const plane of this._planes) {\r\n if (planeToSkip === plane)\r\n continue;\r\n if (output.length === 0)\r\n break;\r\n plane.clipConvexPolygonInPlace(output, work);\r\n }\r\n }\r\n /**\r\n * * Define new planes in this ConvexClipPlaneSet so it clips to the inside of a polygon.\r\n * * always create planes for the swept edges of the polygon\r\n * * optionally (with nonzero sideSelect) create a cap plane using the polygon normal.\r\n * @param points Points of a bounding polygon\r\n * @param sweepDirection direction to sweep.\r\n * @param sideSelect 0 to have no cap polygon, 1 if the sweep vector side is in, -1 if sweep vector side is out.\r\n */\r\n public reloadSweptPolygon(points: Point3d[], sweepDirection: Vector3d, sideSelect: number): number {\r\n this._planes.length = 0;\r\n const n = points.length;\r\n if (n <= 2)\r\n return 0;\r\n\r\n const planeNormal: Vector3d = PolygonOps.areaNormal(points);\r\n const isCCW = sweepDirection.dotProduct(planeNormal) > 0.0;\r\n\r\n const delta = isCCW ? 1 : n - 1;\r\n for (let i = 0; i < n; i++) {\r\n const i1 = (i + delta) % n;\r\n const xyz0: Point3d = points[i];\r\n const xyz1: Point3d = points[i1];\r\n if (xyz0.isAlmostEqual(xyz1))\r\n continue;\r\n const edgeVector: Vector3d = Vector3d.createStartEnd(xyz0, xyz1);\r\n const inwardNormal: Vector3d = Vector3d.createCrossProduct(sweepDirection.x, sweepDirection.y, sweepDirection.z,\r\n edgeVector.x, edgeVector.y, edgeVector.z);\r\n const inwardNormalNormalized = inwardNormal.normalize();\r\n let distance;\r\n if (inwardNormalNormalized) { // should never fail... simply a check due to the format of the normalize function return\r\n distance = inwardNormalNormalized.dotProduct(xyz0);\r\n const clipToAdd = ClipPlane.createNormalAndDistance(inwardNormalNormalized, distance, false, false);\r\n if (clipToAdd) { this._planes.push(clipToAdd); } // clipPlane creation could result in undefined\r\n }\r\n }\r\n if (sideSelect !== 0.0) {\r\n let planeNormalNormalized = planeNormal.normalize();\r\n if (planeNormalNormalized) { // Again.. should never fail\r\n const a = sweepDirection.dotProduct(planeNormalNormalized) * sideSelect;\r\n if (a < 0.0)\r\n planeNormalNormalized = planeNormalNormalized.negate();\r\n const xyz0: Point3d = points[0];\r\n const distance = planeNormalNormalized.dotProduct(xyz0);\r\n const clipToAdd = ClipPlane.createNormalAndDistance(planeNormalNormalized, distance, false, false);\r\n if (clipToAdd) { this._planes.push(clipToAdd); } // clipPlane creation could result in undefined\r\n }\r\n }\r\n return isCCW ? 1 : -1;\r\n }\r\n /**\r\n * Compute intersections among all combinations of 3 planes in the convex set.\r\n * * optionally throw out points that are not in the set.\r\n * * optionally push the points in the caller-supplied point array.\r\n * * optionally extend a caller supplied range.\r\n * * In the common case where the convex set is (a) a slab or (b) a view frustum, there will be 8 points and the\r\n * range is the range of the convex set.\r\n * * If the convex set is unbounded, the range only contains the range of the accepted (corner) points, and the\r\n * range is not a representative of the \"range of all points in the set\".\r\n * @param points (optional) array to which computed points are to be added.\r\n * @param rangeToExtend (optional) range to be extended by the computed points\r\n * @param transform (optional) transform to apply to the accepted points.\r\n * @param testContainment if true, test each point to see if it is within the convex set. (send false if confident\r\n * that the convex set is rectilinear set such as a slab. Send true if chiseled corners are possible).\r\n * @returns number of points.\r\n */\r\n public computePlanePlanePlaneIntersections(\r\n points: Point3d[] | undefined,\r\n rangeToExtend: Range3d | undefined,\r\n transform?: Transform,\r\n testContainment: boolean = true,\r\n ): number {\r\n const normalRows = Matrix3d.createIdentity();\r\n const allPlanes = this._planes;\r\n const n = allPlanes.length;\r\n let numPoints = 0; // explicitly count points -- can't wait to end for points.length because it may be an optional output.\r\n for (let i = 0; i < n; i++) {\r\n for (let j = i + 1; j < n; j++)\r\n for (let k = j + 1; k < n; k++) {\r\n Matrix3d.createRowValues(\r\n allPlanes[i].inwardNormalRef.x, allPlanes[i].inwardNormalRef.y, allPlanes[i].inwardNormalRef.z,\r\n allPlanes[j].inwardNormalRef.x, allPlanes[j].inwardNormalRef.y, allPlanes[j].inwardNormalRef.z,\r\n allPlanes[k].inwardNormalRef.x, allPlanes[k].inwardNormalRef.y, allPlanes[k].inwardNormalRef.z,\r\n normalRows);\r\n if (normalRows.computeCachedInverse(false)) {\r\n const xyz = normalRows.multiplyInverseXYZAsPoint3d(allPlanes[i].distance, allPlanes[j].distance, allPlanes[k].distance)!;\r\n if (!testContainment || this.isPointOnOrInside(xyz, Geometry.smallMetricDistance)) {\r\n numPoints++;\r\n if (transform)\r\n transform.multiplyPoint3d(xyz, xyz);\r\n if (points)\r\n points.push(xyz);\r\n if (rangeToExtend)\r\n rangeToExtend.extendPoint(xyz);\r\n }\r\n }\r\n }\r\n }\r\n return numPoints;\r\n }\r\n /**\r\n * Set the `invisible` property on each plane of the convex set.\r\n * @param invisible value to store\r\n */\r\n public setInvisible(invisible: boolean) {\r\n for (const plane of this._planes) {\r\n plane.setInvisible(invisible);\r\n }\r\n }\r\n /**\r\n * Add planes for z-direction clip between low and high z levels.\r\n * @param invisible value to apply to the `invisible` bit for the new planes\r\n * @param zLow low z value. The plane clips out points with z below this.\r\n * @param zHigh high z value. The plane clips out points with z above this.\r\n */\r\n public addZClipPlanes(invisible: boolean, zLow?: number, zHigh?: number) {\r\n if (zLow !== undefined)\r\n this._planes.push(ClipPlane.createNormalAndDistance(Vector3d.create(0, 0, 1), zLow, invisible)!);\r\n if (zHigh !== undefined)\r\n this._planes.push(ClipPlane.createNormalAndDistance(Vector3d.create(0, 0, -1), -zHigh, invisible)!);\r\n }\r\n /**\r\n * Implement appendPolygonClip, as defined in interface PolygonClipper.\r\n * @param xyz convex polygon. This is not changed.\r\n * @param insideFragments Array to receive \"inside\" fragments. Each fragment is a GrowableXYZArray grabbed from\r\n * the cache. This is NOT cleared.\r\n * @param outsideFragments Array to receive \"outside\" fragments. Each fragment is a GrowableXYZArray grabbed from\r\n * the cache. This is NOT cleared.\r\n * @param arrayCache cache for reusable GrowableXYZArray.\r\n */\r\n public appendPolygonClip(\r\n xyz: IndexedXYZCollection,\r\n insideFragments: GrowableXYZArray[],\r\n outsideFragments: GrowableXYZArray[],\r\n arrayCache: GrowableXYZArrayCache,\r\n ): void {\r\n const newInside = this.clipInsidePushOutside(xyz, outsideFragments, arrayCache);\r\n if (newInside)\r\n insideFragments.push(newInside);\r\n }\r\n /**\r\n * Create a convex clip set from a convex mesh.\r\n * * Create a plane for each facet.\r\n * * Assemble the planes as a single clip plane set.\r\n * * If the facets are closed by edge pairing, use the sign of the computed volume to point the plane normals inward.\r\n * * If the facets are not closed, the facet orientation determines plane orientation.\r\n * * The implication of this is that if the facets are a convex volume, the returned clip plane set is convex.\r\n * @param convexMesh input mesh. For best results, the mesh should be closed and convex.\r\n * @param result optional preallocated result to reuse and return\r\n * @return clipper and volume (zero if mesh is not closed)\r\n */\r\n public static createConvexPolyface(\r\n convexMesh: Polyface | PolyfaceVisitor, result?: ConvexClipPlaneSet,\r\n ): { clipper: ConvexClipPlaneSet, volume: number } {\r\n result = this.createEmpty(result);\r\n let vol = 0;\r\n if (PolyfaceQuery.isPolyfaceClosedByEdgePairing(convexMesh))\r\n vol = PolyfaceQuery.sumTetrahedralVolumes(convexMesh);\r\n const scale = vol > 0.0 ? -1.0 : 1.0; // point clipper normals inward if mesh normals point outward\r\n const normal = Vector3d.create();\r\n const plane = Plane3dByOriginAndUnitNormal.createXYPlane();\r\n const visitor = convexMesh instanceof Polyface ? convexMesh.createVisitor(0) : convexMesh;\r\n visitor.setNumWrap(0);\r\n for (visitor.reset(); visitor.moveToNextFacet(); ) {\r\n if (undefined !== PolygonOps.areaNormalGo(visitor.point, normal)) {\r\n normal.scaleInPlace(scale);\r\n if (undefined !== Plane3dByOriginAndUnitNormal.create(visitor.point.front()!, normal, plane))\r\n result.addPlaneToConvexSet(plane);\r\n }\r\n }\r\n return { clipper: result, volume: vol };\r\n }\r\n\r\n // FUNCTIONS SKIPPED DUE TO BSPLINES, VU, OR NON-USAGE IN NATIVE CODE----------------------------------------------------------------\r\n\r\n // Uses bsplines... skipping for now:\r\n // public convexAppendIntervalsFromBspline();\r\n\r\n // Uses pushing and clearing from/to a cache and added functionality for arrays. . . skipping for now\r\n // public convexPolygonClipInsideOutside(input: Point3d[], inside: Point3d[], outside: Point3d[], work1: Point3d[], work2: Point3d[],\r\n // clearOutside: boolean, distanceTolerance: number)\r\n}\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"UnionOfConvexClipPlaneSets.js","sourceRoot":"","sources":["../../../src/clipping/UnionOfConvexClipPlaneSets.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAKH,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAC1E,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAGlE,OAAO,EAAE,OAAO,EAAW,MAAM,qBAAqB,CAAC;AAGvD,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAGpD,OAAO,EAAW,oBAAoB,EAAE,aAAa,EAAkB,MAAM,aAAa,CAAC;AAC3F,OAAO,EAAE,kBAAkB,EAA2B,MAAM,sBAAsB,CAAC;AAQnF;;;;;GAKG;AACH,MAAM,OAAO,0BAA0B;IAC7B,WAAW,CAAuB;IAC1C,uFAAuF;IACvF,IAAW,UAAU;QACnB,OAAO,IAAI,CAAC,WAAW,CAAC;IAC1B,CAAC;IACD;QACE,IAAI,CAAC,WAAW,GAAG,EAAE,CAAC;IACxB,CAAC;IACD,0EAA0E;IACnE,MAAM;QACX,MAAM,GAAG,GAA8B,EAAE,CAAC;QAC1C,KAAK,MAAM,MAAM,IAAI,IAAI,CAAC,WAAW;YACnC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC;QAC5B,OAAO,GAAG,CAAC;IACb,CAAC;IACD,sEAAsE;IAC/D,MAAM,CAAC,QAAQ,CACpB,IAAiD,EAAE,MAAmC;QAEtF,MAAM,GAAG,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,0BAA0B,EAAE,CAAC;QAC5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AuC,CAAC,eAAe,EAAE,cAAc,EAAE,GAAG,EAAE,UAAU,CAAC,CAAC;aACrG,IAAI,eAAe,CAAC,MAAM,KAAK,cAAc;YAChD,aAAa,CAAC,uCAAuC,CAAC,gBAAgB,EAAE,eAAe,EAAE,GAAG,EAAE,UAAU,CAAC,CAAC;IAC9G,CAAC;;AAGH;;;;;;;;;;;;;;EAcE","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/** @packageDocumentation\n * @module CartesianGeometry\n */\n\nimport { Arc3d } from \"../curve/Arc3d\";\nimport { AnnounceNumberNumberCurvePrimitive } from \"../curve/CurvePrimitive\";\nimport { LineSegment3d } from \"../curve/LineSegment3d\";\nimport { Geometry } from \"../Geometry\";\nimport { GrowableFloat64Array } from \"../geometry3d/GrowableFloat64Array\";\nimport { GrowableXYZArray } from \"../geometry3d/GrowableXYZArray\";\nimport { IndexedXYZCollection } from \"../geometry3d/IndexedXYZCollection\";\nimport { Point3d } from \"../geometry3d/Point3dVector3d\";\nimport { Range1d, Range3d } from \"../geometry3d/Range\";\nimport { Ray3d } from \"../geometry3d/Ray3d\";\nimport { GrowableXYZArrayCache } from \"../geometry3d/ReusableObjectCache\";\nimport { Segment1d } from \"../geometry3d/Segment1d\";\nimport { Transform } from \"../geometry3d/Transform\";\nimport { Matrix4d } from \"../geometry4d/Matrix4d\";\nimport { Clipper, ClipPlaneContainment, ClipUtilities, PolygonClipper } from \"./ClipUtils\";\nimport { ConvexClipPlaneSet, ConvexClipPlaneSetProps } from \"./ConvexClipPlaneSet\";\n\n/**\n * Wire format describing a [[UnionOfConvexClipPlaneSets]].\n * @public\n */\nexport type UnionOfConvexClipPlaneSetsProps = ConvexClipPlaneSetProps[];\n\n/**\n * A collection of ConvexClipPlaneSets.\n * * A point is \"in\" the clip plane set if it is \"in\" one or more of the ConvexClipPlaneSet\n * * Hence the boolean logic is that the ClipPlaneSet is a UNION of its constituents.\n * @public\n */\nexport class UnionOfConvexClipPlaneSets implements Clipper, PolygonClipper {\n private _convexSets: ConvexClipPlaneSet[];\n /** (property accessor) Return the (reference to the) array of `ConvexClipPlaneSet` */\n public get convexSets(): ConvexClipPlaneSet[] {\n return this._convexSets;\n }\n private constructor() {\n this._convexSets = [];\n }\n /** Return an array with the `toJSON` form of each `ConvexClipPlaneSet` */\n public toJSON(): UnionOfConvexClipPlaneSetsProps {\n const val: ConvexClipPlaneSetProps[] = [];\n for (const convex of this._convexSets)\n val.push(convex.toJSON());\n return val;\n }\n /** Convert json `UnionOfConvexClipPlaneSets`, using `setFromJSON`. */\n public static fromJSON(\n json: UnionOfConvexClipPlaneSetsProps | undefined, result?: UnionOfConvexClipPlaneSets,\n ): UnionOfConvexClipPlaneSets {\n result = result ? result : new UnionOfConvexClipPlaneSets();\n result._convexSets.length = 0;\n if (!Array.isArray(json))\n return result;\n\n for (const thisJson of json)\n result._convexSets.push(ConvexClipPlaneSet.fromJSON(thisJson));\n return result;\n }\n /** Create a `UnionOfConvexClipPlaneSets` with no members. */\n public static createEmpty(result?: UnionOfConvexClipPlaneSets): UnionOfConvexClipPlaneSets {\n if (result) {\n result._convexSets.length = 0;\n return result;\n }\n return new UnionOfConvexClipPlaneSets();\n }\n /**\n * Return true if all member convex sets are almostEqual to corresponding members of other. This includes\n * identical order in array.\n * @param other clip plane to compare.\n */\n public isAlmostEqual(other: UnionOfConvexClipPlaneSets): boolean {\n if (this._convexSets.length !== other._convexSets.length)\n return false;\n for (let i = 0; i < this._convexSets.length; i++)\n if (!this._convexSets[i].isAlmostEqual(other._convexSets[i]))\n return false;\n return true;\n }\n /** Create a `UnionOfConvexClipPlaneSets` with given `ConvexClipPlaneSet` members. */\n public static createConvexSets(\n convexSets: ConvexClipPlaneSet[], result?: UnionOfConvexClipPlaneSets,\n ): UnionOfConvexClipPlaneSets {\n result = result ? result : new UnionOfConvexClipPlaneSets();\n for (const set of convexSets)\n result._convexSets.push(set);\n return result;\n }\n /** Return a deep copy. */\n public clone(result?: UnionOfConvexClipPlaneSets): UnionOfConvexClipPlaneSets {\n result = result ? result : new UnionOfConvexClipPlaneSets();\n result._convexSets.length = 0;\n for (const convexSet of this._convexSets)\n result._convexSets.push(convexSet.clone());\n return result;\n }\n /**\n * Append `toAdd` to the array of `ConvexClipPlaneSet`.\n * * undefined toAdd is ignored.\n */\n public addConvexSet(toAdd: ConvexClipPlaneSet | undefined) {\n if (toAdd)\n this._convexSets.push(toAdd);\n }\n /**\n * Test if there is any intersection with a ray defined by origin and direction.\n * * Optionally record the range (null or otherwise) in caller-allocated result.\n * * If the ray is unbounded inside the clip, result can contain positive or negative\n * \"Geometry.largeCoordinateResult\" values.\n * * If no result is provide, there are no object allocations.\n * @param maximalRange optional Range1d to receive parameters along the ray.\n */\n public hasIntersectionWithRay(ray: Ray3d, maximalRange?: Range1d): boolean {\n if (maximalRange === undefined) {\n // if complete result is not requested, return after any hit.\n for (const planeSet of this._convexSets) {\n if (planeSet.hasIntersectionWithRay(ray))\n return true;\n }\n return false;\n }\n maximalRange.setNull();\n const rangeA = Range1d.createNull();\n for (const planeSet of this._convexSets) {\n if (planeSet.hasIntersectionWithRay(ray, rangeA))\n maximalRange.extendRange(rangeA);\n }\n return !maximalRange.isNull;\n }\n /**\n * Return true if true is returned for any contained convex set returns true for\n * `convexSet.isPointInside (point, tolerance)`.\n */\n public isPointInside(point: Point3d): boolean {\n for (const convexSet of this._convexSets) {\n if (convexSet.isPointInside(point)) {\n return true;\n }\n }\n return false;\n }\n /**\n * Return true if true is returned for any contained convex set returns true for\n * `convexSet.isPointOnOrInside (point, tolerance)`.\n */\n public isPointOnOrInside(point: Point3d, tolerance: number = Geometry.smallMetricDistance): boolean {\n for (const convexSet of this._convexSets) {\n if (convexSet.isPointOnOrInside(point, tolerance))\n return true;\n }\n return false;\n }\n /**\n * Return true if true is returned for any contained convex set returns true for\n * `convexSet.isSphereOnOrInside (point, tolerance)`.\n */\n public isSphereInside(point: Point3d, radius: number) {\n for (const convexSet of this._convexSets) {\n if (convexSet.isSphereInside(point, radius))\n return true;\n }\n return false;\n }\n /** Test if any part of a line segment is within the volume. */\n public isAnyPointInOrOnFromSegment(segment: LineSegment3d): boolean {\n for (const convexSet of this._convexSets) {\n if (convexSet.announceClippedSegmentIntervals(0.0, 1.0, segment.point0Ref, segment.point1Ref))\n return true;\n }\n return false;\n }\n // Intervals must be Segment1d array, as there may be multiple intervals along segment that pass through set regions,\n // and so splitting the intervals into segments aids in better organization\n /** Returns the fractions of the segment that pass through the set region, as 1 dimensional pieces. */\n public appendIntervalsFromSegment(segment: LineSegment3d, intervals: Segment1d[]) {\n for (const convexSet of this._convexSets) {\n convexSet.announceClippedSegmentIntervals(0.0, 1.0, segment.point0Ref, segment.point1Ref,\n (fraction0: number, fraction1: number) =>\n intervals.push(Segment1d.create(fraction0, fraction1)));\n }\n }\n /** Apply `transform` to all the ConvexClipPlaneSet's. */\n public transformInPlace(transform: Transform) {\n for (const convexSet of this._convexSets) {\n convexSet.transformInPlace(transform);\n }\n }\n /** Returns 1, 2, or 3 based on whether point is strongly inside, ambiguous, or strongly outside respectively. */\n public classifyPointContainment(points: Point3d[], onIsOutside: boolean): number {\n for (const convexSet of this._convexSets) {\n const thisStatus = convexSet.classifyPointContainment(points, onIsOutside);\n if (thisStatus !== ClipPlaneContainment.StronglyOutside)\n return thisStatus;\n }\n return ClipPlaneContainment.StronglyOutside;\n }\n /**\n * Clip a polygon using this ClipPlaneSet, returning new polygon boundaries. Note that each polygon may lie\n * next to the previous, or be disconnected.\n */\n public polygonClip(input: GrowableXYZArray | Point3d[], output: GrowableXYZArray[]) {\n output.length = 0;\n if (Array.isArray(input))\n input = GrowableXYZArray.create(input);\n const work = new GrowableXYZArray();\n for (const convexSet of this._convexSets) {\n const convexSetOutput = new GrowableXYZArray();\n convexSet.polygonClip(input, convexSetOutput, work);\n if (convexSetOutput.length !== 0)\n output.push(convexSetOutput);\n }\n }\n /**\n * Announce clipSegment() for each convexSet in this ClipPlaneSet.\n * * all clipPlaneSets are inspected.\n * * announced intervals are for each individual clipPlaneSet -- adjacent intervals are not consolidated.\n * @param f0 active interval start.\n * @param f1 active interval end.\n * @param pointA line segment start.\n * @param pointB line segment end.\n * @param announce function to announce interval.\n * @returns Return true if any announcements are made.\n */\n public announceClippedSegmentIntervals(\n f0: number, f1: number, pointA: Point3d, pointB: Point3d, announce?: (fraction0: number, fraction1: number) => void,\n ): boolean {\n let numAnnounce = 0;\n for (const convexSet of this._convexSets) {\n if (convexSet.announceClippedSegmentIntervals(f0, f1, pointA, pointB, announce))\n numAnnounce++;\n }\n return numAnnounce > 0;\n }\n private static _clipArcFractionArray = new GrowableFloat64Array();\n /**\n * Find parts of an arc that are inside any member clipper.\n * Announce each with `announce(startFraction, endFraction, this)`\n */\n public announceClippedArcIntervals(arc: Arc3d, announce?: AnnounceNumberNumberCurvePrimitive): boolean {\n const breaks = UnionOfConvexClipPlaneSets._clipArcFractionArray;\n breaks.clear();\n for (const convexSet of this._convexSets) {\n for (const clipPlane of convexSet.planes) {\n clipPlane.appendIntersectionRadians(arc, breaks);\n }\n }\n arc.sweep.radiansArrayToPositivePeriodicFractions(breaks);\n return ClipUtilities.selectIntervals01(arc, breaks, this, announce);\n }\n /**\n * Collect the output from computePlanePlanePlaneIntersections in all the contained convex sets.\n * @param points (optional) array to which computed points are to be added.\n * @param rangeToExtend (optional) range to be extended by the computed points.\n * @param transform (optional) transform to apply to the accepted points.\n * @param testContainment if true, test each point to see if it is within the convex set (send false if confident\n * that the convex set is rectilinear set such as a slab. Send true if chiseled corners are possible).\n * @returns number of points.\n */\n public computePlanePlanePlaneIntersectionsInAllConvexSets(\n points: Point3d[] | undefined, rangeToExtend: Range3d | undefined, transform?: Transform, testContainment: boolean = true,\n ): number {\n let n = 0;\n for (const convexSet of this._convexSets) {\n n += convexSet.computePlanePlanePlaneIntersections(points, rangeToExtend, transform, testContainment);\n }\n return n;\n }\n /**\n * Multiply all ClipPlanes DPoint4d by matrix.\n * @param matrix matrix to apply.\n * @param invert if true, use in verse of the matrix.\n * @param transpose if true, use the transpose of the matrix (or inverse, per invert parameter).\n * * Note that if matrixA is applied to all of space, the matrix to send to this method to get a corresponding effect\n * on the plane is the inverse transpose of matrixA.\n * * Callers that will apply the same matrix to many planes should pre-invert the matrix for efficiency.\n * * Both params default to true to get the full effect of transforming space.\n * @param matrix matrix to apply\n */\n public multiplyPlanesByMatrix4d(matrix: Matrix4d, invert: boolean = true, transpose: boolean = true): boolean {\n if (invert) { // form inverse once here, reuse for all planes\n const inverse = matrix.createInverse();\n if (!inverse)\n return false;\n return this.multiplyPlanesByMatrix4d(inverse, false, transpose);\n }\n // (no inversion -- no failures possible)\n for (const convexSet of this._convexSets) {\n convexSet.multiplyPlanesByMatrix4d(matrix, false, transpose);\n }\n return true;\n }\n /** Recursively call `setInvisible` on all member convex sets. */\n public setInvisible(invisible: boolean) {\n for (const convexSet of this._convexSets) {\n convexSet.setInvisible(invisible);\n }\n }\n /** add convex sets that accept points below `zLow` and above `zHigh` */\n public addOutsideZClipSets(invisible: boolean, zLow?: number, zHigh?: number) {\n if (zLow) {\n const convexSet = ConvexClipPlaneSet.createEmpty();\n convexSet.addZClipPlanes(invisible, zLow);\n this._convexSets.push(convexSet);\n }\n if (zHigh) {\n const convexSet = ConvexClipPlaneSet.createEmpty();\n convexSet.addZClipPlanes(invisible, undefined, zHigh);\n this._convexSets.push(convexSet);\n }\n }\n /** Move convex sets from source.*/\n public takeConvexSets(source: UnionOfConvexClipPlaneSets) {\n let convexSet;\n while ((undefined !== (convexSet = source._convexSets.pop()))) {\n this._convexSets.push(convexSet);\n }\n }\n /**\n * Implement appendPolygonClip, as defined in interface PolygonClipper.\n * @param xyz convex polygon. This is not changed.\n * @param insideFragments Array to receive \"inside\" fragments. Each fragment is a GrowableXYZArray grabbed from\n * the cache. This is NOT cleared.\n * @param outsideFragments Array to receive \"outside\" fragments. Each fragment is a GrowableXYZArray grabbed from\n * the cache. This is NOT cleared.\n * @param arrayCache cache for reusable GrowableXYZArray.\n */\n public appendPolygonClip(\n xyz: IndexedXYZCollection,\n insideFragments: GrowableXYZArray[],\n outsideFragments: GrowableXYZArray[],\n arrayCache: GrowableXYZArrayCache,\n ): void {\n const oldOutsideCount = outsideFragments.length;\n const oldInsideCount = insideFragments.length;\n let carryForwardA = [arrayCache.grabAndFill(xyz)];\n let carryForwardB: GrowableXYZArray[] = [];\n let tempAB;\n let shard;\n // At each convex set, carryForwardA is all the fragments that have been outside all previous convex sets.\n // Clip each such fragment to the current set, sending the outside parts to carryForwardB, which will got to the next clipper\n // The final surviving carryForward really is out.\n for (const c of this._convexSets) {\n while (undefined !== (shard = carryForwardA.pop())) {\n c.appendPolygonClip(shard, insideFragments, carryForwardB, arrayCache);\n arrayCache.dropToCache(shard);\n }\n tempAB = carryForwardB;\n carryForwardB = carryForwardA; // and that is empty\n carryForwardA = tempAB;\n }\n while (undefined !== (shard = carryForwardA.pop())) {\n outsideFragments.push(shard);\n }\n if (outsideFragments.length === oldOutsideCount)\n ClipUtilities.restoreSingletonInPlaceOfMultipleShards(insideFragments, oldInsideCount, xyz, arrayCache);\n else if (insideFragments.length === oldInsideCount)\n ClipUtilities.restoreSingletonInPlaceOfMultipleShards(outsideFragments, oldOutsideCount, xyz, arrayCache);\n }\n}\n\n/* FUNCTIONS SKIPPED DUE TO BSPLINES, VU, OR NON-USAGE IN NATIVE CODE----------------------------------------------------------------\n\nInvolves vu: skipping for now...\n public fromSweptPolygon(points: Point3d[], directions: Vector3d[]): ClipPlaneSet;\n public parseConcavePolygonPlanes(...)\n\nUses bsplines... skipping for now:\n public appendIntervalsClipPlaneSetFromCurve();\n\nUses bsplines... skipping for now:\n public isAnyPointInOrOnFrom();\n\nSkipped fromSweptPolygon(...), which is overloaded function from first, due to presence of vu\n public fromSweptPolygon(points: Point3d[], directions: Vector3d[], shapes: Point3d[])\n*/\n"]}
1
+ {"version":3,"file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EAAE,eAAe,EAAE,GAAG,EAAE,UAAU,CAAC,CAAC;IAC9G,CAAC;;AAGH;;;;;;;;;;;;;;EAcE","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/** @packageDocumentation\r\n * @module CartesianGeometry\r\n */\r\n\r\nimport { Arc3d } from \"../curve/Arc3d\";\r\nimport { AnnounceNumberNumberCurvePrimitive } from \"../curve/CurvePrimitive\";\r\nimport { LineSegment3d } from \"../curve/LineSegment3d\";\r\nimport { Geometry } from \"../Geometry\";\r\nimport { GrowableFloat64Array } from \"../geometry3d/GrowableFloat64Array\";\r\nimport { GrowableXYZArray } from \"../geometry3d/GrowableXYZArray\";\r\nimport { IndexedXYZCollection } from \"../geometry3d/IndexedXYZCollection\";\r\nimport { Point3d } from \"../geometry3d/Point3dVector3d\";\r\nimport { Range1d, Range3d } from \"../geometry3d/Range\";\r\nimport { Ray3d } from \"../geometry3d/Ray3d\";\r\nimport { GrowableXYZArrayCache } from \"../geometry3d/ReusableObjectCache\";\r\nimport { Segment1d } from \"../geometry3d/Segment1d\";\r\nimport { Transform } from \"../geometry3d/Transform\";\r\nimport { Matrix4d } from \"../geometry4d/Matrix4d\";\r\nimport { Clipper, ClipPlaneContainment, ClipUtilities, PolygonClipper } from \"./ClipUtils\";\r\nimport { ConvexClipPlaneSet, ConvexClipPlaneSetProps } from \"./ConvexClipPlaneSet\";\r\n\r\n/**\r\n * Wire format describing a [[UnionOfConvexClipPlaneSets]].\r\n * @public\r\n */\r\nexport type UnionOfConvexClipPlaneSetsProps = ConvexClipPlaneSetProps[];\r\n\r\n/**\r\n * A collection of ConvexClipPlaneSets.\r\n * * A point is \"in\" the clip plane set if it is \"in\" one or more of the ConvexClipPlaneSet\r\n * * Hence the boolean logic is that the ClipPlaneSet is a UNION of its constituents.\r\n * @public\r\n */\r\nexport class UnionOfConvexClipPlaneSets implements Clipper, PolygonClipper {\r\n private _convexSets: ConvexClipPlaneSet[];\r\n /** (property accessor) Return the (reference to the) array of `ConvexClipPlaneSet` */\r\n public get convexSets(): ConvexClipPlaneSet[] {\r\n return this._convexSets;\r\n }\r\n private constructor() {\r\n this._convexSets = [];\r\n }\r\n /** Return an array with the `toJSON` form of each `ConvexClipPlaneSet` */\r\n public toJSON(): UnionOfConvexClipPlaneSetsProps {\r\n const val: ConvexClipPlaneSetProps[] = [];\r\n for (const convex of this._convexSets)\r\n val.push(convex.toJSON());\r\n return val;\r\n }\r\n /** Convert json `UnionOfConvexClipPlaneSets`, using `setFromJSON`. */\r\n public static fromJSON(\r\n json: UnionOfConvexClipPlaneSetsProps | undefined, result?: UnionOfConvexClipPlaneSets,\r\n ): UnionOfConvexClipPlaneSets {\r\n result = result ? result : new UnionOfConvexClipPlaneSets();\r\n result._convexSets.length = 0;\r\n if (!Array.isArray(json))\r\n return result;\r\n\r\n for (const thisJson of json)\r\n result._convexSets.push(ConvexClipPlaneSet.fromJSON(thisJson));\r\n return result;\r\n }\r\n /** Create a `UnionOfConvexClipPlaneSets` with no members. */\r\n public static createEmpty(result?: UnionOfConvexClipPlaneSets): UnionOfConvexClipPlaneSets {\r\n if (result) {\r\n result._convexSets.length = 0;\r\n return result;\r\n }\r\n return new UnionOfConvexClipPlaneSets();\r\n }\r\n /**\r\n * Return true if all member convex sets are almostEqual to corresponding members of other. This includes\r\n * identical order in array.\r\n * @param other clip plane to compare.\r\n */\r\n public isAlmostEqual(other: UnionOfConvexClipPlaneSets): boolean {\r\n if (this._convexSets.length !== other._convexSets.length)\r\n return false;\r\n for (let i = 0; i < this._convexSets.length; i++)\r\n if (!this._convexSets[i].isAlmostEqual(other._convexSets[i]))\r\n return false;\r\n return true;\r\n }\r\n /** Create a `UnionOfConvexClipPlaneSets` with given `ConvexClipPlaneSet` members. */\r\n public static createConvexSets(\r\n convexSets: ConvexClipPlaneSet[], result?: UnionOfConvexClipPlaneSets,\r\n ): UnionOfConvexClipPlaneSets {\r\n result = result ? result : new UnionOfConvexClipPlaneSets();\r\n for (const set of convexSets)\r\n result._convexSets.push(set);\r\n return result;\r\n }\r\n /** Return a deep copy. */\r\n public clone(result?: UnionOfConvexClipPlaneSets): UnionOfConvexClipPlaneSets {\r\n result = result ? result : new UnionOfConvexClipPlaneSets();\r\n result._convexSets.length = 0;\r\n for (const convexSet of this._convexSets)\r\n result._convexSets.push(convexSet.clone());\r\n return result;\r\n }\r\n /**\r\n * Append `toAdd` to the array of `ConvexClipPlaneSet`.\r\n * * undefined toAdd is ignored.\r\n */\r\n public addConvexSet(toAdd: ConvexClipPlaneSet | undefined) {\r\n if (toAdd)\r\n this._convexSets.push(toAdd);\r\n }\r\n /**\r\n * Test if there is any intersection with a ray defined by origin and direction.\r\n * * Optionally record the range (null or otherwise) in caller-allocated result.\r\n * * If the ray is unbounded inside the clip, result can contain positive or negative\r\n * \"Geometry.largeCoordinateResult\" values.\r\n * * If no result is provide, there are no object allocations.\r\n * @param maximalRange optional Range1d to receive parameters along the ray.\r\n */\r\n public hasIntersectionWithRay(ray: Ray3d, maximalRange?: Range1d): boolean {\r\n if (maximalRange === undefined) {\r\n // if complete result is not requested, return after any hit.\r\n for (const planeSet of this._convexSets) {\r\n if (planeSet.hasIntersectionWithRay(ray))\r\n return true;\r\n }\r\n return false;\r\n }\r\n maximalRange.setNull();\r\n const rangeA = Range1d.createNull();\r\n for (const planeSet of this._convexSets) {\r\n if (planeSet.hasIntersectionWithRay(ray, rangeA))\r\n maximalRange.extendRange(rangeA);\r\n }\r\n return !maximalRange.isNull;\r\n }\r\n /**\r\n * Return true if true is returned for any contained convex set returns true for\r\n * `convexSet.isPointInside (point, tolerance)`.\r\n */\r\n public isPointInside(point: Point3d): boolean {\r\n for (const convexSet of this._convexSets) {\r\n if (convexSet.isPointInside(point)) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n }\r\n /**\r\n * Return true if true is returned for any contained convex set returns true for\r\n * `convexSet.isPointOnOrInside (point, tolerance)`.\r\n */\r\n public isPointOnOrInside(point: Point3d, tolerance: number = Geometry.smallMetricDistance): boolean {\r\n for (const convexSet of this._convexSets) {\r\n if (convexSet.isPointOnOrInside(point, tolerance))\r\n return true;\r\n }\r\n return false;\r\n }\r\n /**\r\n * Return true if true is returned for any contained convex set returns true for\r\n * `convexSet.isSphereOnOrInside (point, tolerance)`.\r\n */\r\n public isSphereInside(point: Point3d, radius: number) {\r\n for (const convexSet of this._convexSets) {\r\n if (convexSet.isSphereInside(point, radius))\r\n return true;\r\n }\r\n return false;\r\n }\r\n /** Test if any part of a line segment is within the volume. */\r\n public isAnyPointInOrOnFromSegment(segment: LineSegment3d): boolean {\r\n for (const convexSet of this._convexSets) {\r\n if (convexSet.announceClippedSegmentIntervals(0.0, 1.0, segment.point0Ref, segment.point1Ref))\r\n return true;\r\n }\r\n return false;\r\n }\r\n // Intervals must be Segment1d array, as there may be multiple intervals along segment that pass through set regions,\r\n // and so splitting the intervals into segments aids in better organization\r\n /** Returns the fractions of the segment that pass through the set region, as 1 dimensional pieces. */\r\n public appendIntervalsFromSegment(segment: LineSegment3d, intervals: Segment1d[]) {\r\n for (const convexSet of this._convexSets) {\r\n convexSet.announceClippedSegmentIntervals(0.0, 1.0, segment.point0Ref, segment.point1Ref,\r\n (fraction0: number, fraction1: number) =>\r\n intervals.push(Segment1d.create(fraction0, fraction1)));\r\n }\r\n }\r\n /** Apply `transform` to all the ConvexClipPlaneSet's. */\r\n public transformInPlace(transform: Transform) {\r\n for (const convexSet of this._convexSets) {\r\n convexSet.transformInPlace(transform);\r\n }\r\n }\r\n /** Returns 1, 2, or 3 based on whether point is strongly inside, ambiguous, or strongly outside respectively. */\r\n public classifyPointContainment(points: Point3d[], onIsOutside: boolean): number {\r\n for (const convexSet of this._convexSets) {\r\n const thisStatus = convexSet.classifyPointContainment(points, onIsOutside);\r\n if (thisStatus !== ClipPlaneContainment.StronglyOutside)\r\n return thisStatus;\r\n }\r\n return ClipPlaneContainment.StronglyOutside;\r\n }\r\n /**\r\n * Clip a polygon using this ClipPlaneSet, returning new polygon boundaries. Note that each polygon may lie\r\n * next to the previous, or be disconnected.\r\n */\r\n public polygonClip(input: GrowableXYZArray | Point3d[], output: GrowableXYZArray[]) {\r\n output.length = 0;\r\n if (Array.isArray(input))\r\n input = GrowableXYZArray.create(input);\r\n const work = new GrowableXYZArray();\r\n for (const convexSet of this._convexSets) {\r\n const convexSetOutput = new GrowableXYZArray();\r\n convexSet.polygonClip(input, convexSetOutput, work);\r\n if (convexSetOutput.length !== 0)\r\n output.push(convexSetOutput);\r\n }\r\n }\r\n /**\r\n * Announce clipSegment() for each convexSet in this ClipPlaneSet.\r\n * * all clipPlaneSets are inspected.\r\n * * announced intervals are for each individual clipPlaneSet -- adjacent intervals are not consolidated.\r\n * @param f0 active interval start.\r\n * @param f1 active interval end.\r\n * @param pointA line segment start.\r\n * @param pointB line segment end.\r\n * @param announce function to announce interval.\r\n * @returns Return true if any announcements are made.\r\n */\r\n public announceClippedSegmentIntervals(\r\n f0: number, f1: number, pointA: Point3d, pointB: Point3d, announce?: (fraction0: number, fraction1: number) => void,\r\n ): boolean {\r\n let numAnnounce = 0;\r\n for (const convexSet of this._convexSets) {\r\n if (convexSet.announceClippedSegmentIntervals(f0, f1, pointA, pointB, announce))\r\n numAnnounce++;\r\n }\r\n return numAnnounce > 0;\r\n }\r\n private static _clipArcFractionArray = new GrowableFloat64Array();\r\n /**\r\n * Find parts of an arc that are inside any member clipper.\r\n * Announce each with `announce(startFraction, endFraction, this)`\r\n */\r\n public announceClippedArcIntervals(arc: Arc3d, announce?: AnnounceNumberNumberCurvePrimitive): boolean {\r\n const breaks = UnionOfConvexClipPlaneSets._clipArcFractionArray;\r\n breaks.clear();\r\n for (const convexSet of this._convexSets) {\r\n for (const clipPlane of convexSet.planes) {\r\n clipPlane.appendIntersectionRadians(arc, breaks);\r\n }\r\n }\r\n arc.sweep.radiansArrayToPositivePeriodicFractions(breaks);\r\n return ClipUtilities.selectIntervals01(arc, breaks, this, announce);\r\n }\r\n /**\r\n * Collect the output from computePlanePlanePlaneIntersections in all the contained convex sets.\r\n * @param points (optional) array to which computed points are to be added.\r\n * @param rangeToExtend (optional) range to be extended by the computed points.\r\n * @param transform (optional) transform to apply to the accepted points.\r\n * @param testContainment if true, test each point to see if it is within the convex set (send false if confident\r\n * that the convex set is rectilinear set such as a slab. Send true if chiseled corners are possible).\r\n * @returns number of points.\r\n */\r\n public computePlanePlanePlaneIntersectionsInAllConvexSets(\r\n points: Point3d[] | undefined, rangeToExtend: Range3d | undefined, transform?: Transform, testContainment: boolean = true,\r\n ): number {\r\n let n = 0;\r\n for (const convexSet of this._convexSets) {\r\n n += convexSet.computePlanePlanePlaneIntersections(points, rangeToExtend, transform, testContainment);\r\n }\r\n return n;\r\n }\r\n /**\r\n * Multiply all ClipPlanes DPoint4d by matrix.\r\n * @param matrix matrix to apply.\r\n * @param invert if true, use in verse of the matrix.\r\n * @param transpose if true, use the transpose of the matrix (or inverse, per invert parameter).\r\n * * Note that if matrixA is applied to all of space, the matrix to send to this method to get a corresponding effect\r\n * on the plane is the inverse transpose of matrixA.\r\n * * Callers that will apply the same matrix to many planes should pre-invert the matrix for efficiency.\r\n * * Both params default to true to get the full effect of transforming space.\r\n * @param matrix matrix to apply\r\n */\r\n public multiplyPlanesByMatrix4d(matrix: Matrix4d, invert: boolean = true, transpose: boolean = true): boolean {\r\n if (invert) { // form inverse once here, reuse for all planes\r\n const inverse = matrix.createInverse();\r\n if (!inverse)\r\n return false;\r\n return this.multiplyPlanesByMatrix4d(inverse, false, transpose);\r\n }\r\n // (no inversion -- no failures possible)\r\n for (const convexSet of this._convexSets) {\r\n convexSet.multiplyPlanesByMatrix4d(matrix, false, transpose);\r\n }\r\n return true;\r\n }\r\n /** Recursively call `setInvisible` on all member convex sets. */\r\n public setInvisible(invisible: boolean) {\r\n for (const convexSet of this._convexSets) {\r\n convexSet.setInvisible(invisible);\r\n }\r\n }\r\n /** add convex sets that accept points below `zLow` and above `zHigh` */\r\n public addOutsideZClipSets(invisible: boolean, zLow?: number, zHigh?: number) {\r\n if (zLow) {\r\n const convexSet = ConvexClipPlaneSet.createEmpty();\r\n convexSet.addZClipPlanes(invisible, zLow);\r\n this._convexSets.push(convexSet);\r\n }\r\n if (zHigh) {\r\n const convexSet = ConvexClipPlaneSet.createEmpty();\r\n convexSet.addZClipPlanes(invisible, undefined, zHigh);\r\n this._convexSets.push(convexSet);\r\n }\r\n }\r\n /** Move convex sets from source.*/\r\n public takeConvexSets(source: UnionOfConvexClipPlaneSets) {\r\n let convexSet;\r\n while ((undefined !== (convexSet = source._convexSets.pop()))) {\r\n this._convexSets.push(convexSet);\r\n }\r\n }\r\n /**\r\n * Implement appendPolygonClip, as defined in interface PolygonClipper.\r\n * @param xyz convex polygon. This is not changed.\r\n * @param insideFragments Array to receive \"inside\" fragments. Each fragment is a GrowableXYZArray grabbed from\r\n * the cache. This is NOT cleared.\r\n * @param outsideFragments Array to receive \"outside\" fragments. Each fragment is a GrowableXYZArray grabbed from\r\n * the cache. This is NOT cleared.\r\n * @param arrayCache cache for reusable GrowableXYZArray.\r\n */\r\n public appendPolygonClip(\r\n xyz: IndexedXYZCollection,\r\n insideFragments: GrowableXYZArray[],\r\n outsideFragments: GrowableXYZArray[],\r\n arrayCache: GrowableXYZArrayCache,\r\n ): void {\r\n const oldOutsideCount = outsideFragments.length;\r\n const oldInsideCount = insideFragments.length;\r\n let carryForwardA = [arrayCache.grabAndFill(xyz)];\r\n let carryForwardB: GrowableXYZArray[] = [];\r\n let tempAB;\r\n let shard;\r\n // At each convex set, carryForwardA is all the fragments that have been outside all previous convex sets.\r\n // Clip each such fragment to the current set, sending the outside parts to carryForwardB, which will got to the next clipper\r\n // The final surviving carryForward really is out.\r\n for (const c of this._convexSets) {\r\n while (undefined !== (shard = carryForwardA.pop())) {\r\n c.appendPolygonClip(shard, insideFragments, carryForwardB, arrayCache);\r\n arrayCache.dropToCache(shard);\r\n }\r\n tempAB = carryForwardB;\r\n carryForwardB = carryForwardA; // and that is empty\r\n carryForwardA = tempAB;\r\n }\r\n while (undefined !== (shard = carryForwardA.pop())) {\r\n outsideFragments.push(shard);\r\n }\r\n if (outsideFragments.length === oldOutsideCount)\r\n ClipUtilities.restoreSingletonInPlaceOfMultipleShards(insideFragments, oldInsideCount, xyz, arrayCache);\r\n else if (insideFragments.length === oldInsideCount)\r\n ClipUtilities.restoreSingletonInPlaceOfMultipleShards(outsideFragments, oldOutsideCount, xyz, arrayCache);\r\n }\r\n}\r\n\r\n/* FUNCTIONS SKIPPED DUE TO BSPLINES, VU, OR NON-USAGE IN NATIVE CODE----------------------------------------------------------------\r\n\r\nInvolves vu: skipping for now...\r\n public fromSweptPolygon(points: Point3d[], directions: Vector3d[]): ClipPlaneSet;\r\n public parseConcavePolygonPlanes(...)\r\n\r\nUses bsplines... skipping for now:\r\n public appendIntervalsClipPlaneSetFromCurve();\r\n\r\nUses bsplines... skipping for now:\r\n public isAnyPointInOrOnFrom();\r\n\r\nSkipped fromSweptPolygon(...), which is overloaded function from first, due to presence of vu\r\n public fromSweptPolygon(points: Point3d[], directions: Vector3d[], shapes: Point3d[])\r\n*/\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"LineStringOffsetClipperContext.js","sourceRoot":"","sources":["../../../../src/clipping/internalContexts/LineStringOffsetClipperContext.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE1C,OAAO,EAAE,0BAA0B,EAAE,MAAM,+BAA+B,CAAC;AAC3E,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC;;;GAGG;AACH,MAAM,OAAO,8BAA8B;IACjC,mBAAmB,CAAS;IAC5B,oBAAoB,CAAS;IAC7B,YAAY,CAAS;IAC7B,YAAoB,kBAA0B,E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B,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,WAAW,EAAE,WAAW,EAAE,WAAW,CAAC,CAAC;gBACxF,OAAO,EAAE,cAAc,CAAC,KAAK,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;gBACvC,IAAI,OAAO;oBACT,MAAM,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;YACjC,CAAC;QACH,CAAC;aAAM,CAAC;YACN,8CAA8C;YAC9C,MAAM,OAAO,GAAG,kBAAkB,CAAC,WAAW,EAAE,CAAC;YACjD,OAAO,EAAE,cAAc,CAAC,KAAK,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;YACvC,IAAI,OAAO,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC;gBAC3B,MAAM,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;QACjC,CAAC;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\nimport { Geometry } from \"../../Geometry\";\nimport { Point3d, Vector3d } from \"../../geometry3d/Point3dVector3d\";\nimport { UnionOfConvexClipPlaneSets } from \"../UnionOfConvexClipPlaneSets\";\nimport { ConvexClipPlaneSet } from \"../ConvexClipPlaneSet\";\nimport { ClipPlane } from \"../ClipPlane\";\nimport { IndexedXYZCollection } from \"../../geometry3d/IndexedXYZCollection\";\n/**\n * Class for building clip sets for offset regions.\n * @internal\n */\nexport class LineStringOffsetClipperContext {\n private _positiveOffsetLeft: number;\n private _positiveOffsetRight: number;\n private _turnDegrees: number;\n private constructor(positiveOffsetLeft: number, positiveOffsetRight: number) {\n this._positiveOffsetLeft = positiveOffsetLeft;\n this._positiveOffsetRight = positiveOffsetRight;\n this._turnDegrees = 60.0;\n }\n /**\n * Create a unit vector from point i to point i+1.\n * If closed, do point indexing with\n * * index less than 0 get final segment\n * * index at or beyond points.length-1 wraps to first segment\n * @param points\n * @param index0\n * @param closed indicates that first and last points are identical and need wrap logic.\n */\n public static createUnit(\n points: IndexedXYZCollection, index0: number, closed: boolean, xyOnly: boolean = true,\n ): Vector3d | undefined {\n // pick two indices of active points, allowing for wrap if needed:\n // normally use index0 and index0 + 1\n // but apply wrap if appropriate, and shift ahead of needed.\n let k0 = index0;\n let k1 = index0 + 1;\n const last = points.length - 1;\n if (closed) {\n if (index0 < 0) {\n k0 = last - 1; k1 = last;\n } else if (index0 >= last) {\n k0 = 0; k1 = 1;\n }\n } else {\n if (index0 === 0) {\n k0 = 0; k1 = 1;\n } else if (k1 > last) {\n k0 = last - 1;\n k1 = last;\n }\n }\n const result = points.vectorIndexIndex(k0, k1);\n if (result) {\n if (xyOnly)\n result.z = 0.0;\n return result.normalize(result);\n }\n return undefined;\n }\n private static createDirectedPlane(\n basePoint: Point3d, vector: Vector3d, shift: number, normalScale: number, interior: boolean = false,\n ): ClipPlane | undefined {\n return ClipPlane.createNormalAndPointXYZXYZ(\n vector.x * normalScale, vector.y * normalScale, vector.z * normalScale,\n basePoint.x + shift * vector.x, basePoint.y + shift * vector.y, basePoint.z + shift * vector.z,\n interior, interior,\n );\n }\n /**\n * Create (if needed) the chamfer cutback plane for a turn.\n * @param clipSet set to receive the plane\n * @param point central point\n * @param unitA incoming vector\n * @param unitB outgoing vector\n */\n private createChamferCut(clipSet: ConvexClipPlaneSet, point: Point3d, unitA: Vector3d, unitB: Vector3d) {\n const degreesA = unitA.angleToXY(unitB).degrees;\n if (Math.abs(degreesA) > this._turnDegrees) {\n const perpAB = unitA.interpolate(0.5, unitB);\n perpAB.rotate90CCWXY(perpAB);\n perpAB.normalizeInPlace();\n if (degreesA > 0)\n clipSet.addPlaneToConvexSet(\n LineStringOffsetClipperContext.createDirectedPlane(point, perpAB, -this._positiveOffsetRight, 1.0, false),\n );\n else\n clipSet.addPlaneToConvexSet(\n LineStringOffsetClipperContext.createDirectedPlane(point, perpAB, this._positiveOffsetLeft, -1.0, false),\n );\n }\n }\n private createOffsetFromSegment(\n pointA: Point3d,\n pointB: Point3d,\n unitA: Vector3d | undefined,\n unitB: Vector3d | undefined,\n unitC: Vector3d | undefined,\n ): ConvexClipPlaneSet | undefined {\n if (unitB === undefined)\n return undefined;\n if (unitA === undefined)\n unitA = unitB;\n if (unitC === undefined)\n unitC = unitB;\n const unitAB = unitA.interpolate(0.5, unitB);\n unitAB.normalizeInPlace();\n const perpB = unitB.rotate90CCWXY();\n const unitBC = unitB.interpolate(0.5, unitC);\n unitBC.normalizeInPlace();\n const clipSet = ConvexClipPlaneSet.createEmpty();\n clipSet.addPlaneToConvexSet(\n LineStringOffsetClipperContext.createDirectedPlane(pointA, perpB, this._positiveOffsetLeft, -1.0, false),\n );\n clipSet.addPlaneToConvexSet(\n LineStringOffsetClipperContext.createDirectedPlane(pointA, perpB, -this._positiveOffsetRight, 1.0, false),\n );\n clipSet.addPlaneToConvexSet(\n LineStringOffsetClipperContext.createDirectedPlane(pointA, unitAB, 0, 1.0, true),\n );\n clipSet.addPlaneToConvexSet(\n LineStringOffsetClipperContext.createDirectedPlane(pointB, unitBC, 0, -1.0, true),\n );\n this.createChamferCut(clipSet, pointA, unitA, unitB);\n this.createChamferCut(clipSet, pointB, unitB, unitC);\n /*\n const degreesA = unitA.angleToXY(unitB).degrees;\n if (Math.abs(degreesA) > this._turnDegrees) {\n const perpAB = unitA.interpolate(0.5, unitB);\n perpAB.rotate90CCWXY(perpAB);\n perpAB.normalizeInPlace();\n if (degreesA > 0)\n clipSet.addPlaneToConvexSet(BuildingCodeRegionOffsetsOps.createDirectedPlane(pointA, perpAB, -this._positiveOffsetRight, 1.0));\n else\n clipSet.addPlaneToConvexSet(BuildingCodeRegionOffsetsOps.createDirectedPlane(pointA, perpAB, -this._positiveOffsetLeft, -1.0));\n }\n const degreesB = unitB.angleToXY(unitC).degrees;\n if (Math.abs(degreesB) > this._turnDegrees) {\n const perpBC = unitB.interpolate(0.5, unitC);\n perpBC.rotate90CCWXY(perpBC);\n perpBC.normalizeInPlace();\n if (degreesB > 0)\n clipSet.addPlaneToConvexSet(BuildingCodeRegionOffsetsOps.createDirectedPlane(pointB, perpBC, -this._positiveOffsetRight, 1.0));\n else\n clipSet.addPlaneToConvexSet(BuildingCodeRegionOffsetsOps.createDirectedPlane(pointB, perpBC, -this._positiveOffsetLeft, -1.0));\n }\n */\n return clipSet;\n }\n /**\n * @param points\n * @param positiveOffsetLeft offset to left. 0 is clip on the path.\n * @param positiveOffsetRight offset to the right. 0 is clip on the path.\n * @param z0 z for lower clipping plane. If undefined, unbounded in positive z\n * @param z1 z for upper clipping plane. If undefined, unbounded in negative z.\n */\n public static createClipBetweenOffsets(\n points: IndexedXYZCollection,\n positiveOffsetLeft: number,\n positiveOffsetRight: number,\n z0: number | undefined,\n z1: number | undefined,\n ): UnionOfConvexClipPlaneSets {\n const context = new LineStringOffsetClipperContext(positiveOffsetLeft, positiveOffsetRight);\n const result = UnionOfConvexClipPlaneSets.createEmpty();\n if (points.length > 1) {\n const closed = Geometry.isSmallMetricDistance(points.distanceIndexIndex(0, points.length - 1)!);\n for (let i = 0; i + 1 < points.length; i++) {\n const unitVectorA = this.createUnit(points, i - 1, closed);\n const unitVectorB = this.createUnit(points, i, closed);\n const unitVectorC = this.createUnit(points, i + 1, closed);\n const clipSet = context.createOffsetFromSegment(points.getPoint3dAtUncheckedPointIndex(i),\n points.getPoint3dAtUncheckedPointIndex(i + 1), unitVectorA, unitVectorB, unitVectorC);\n clipSet?.addZClipPlanes(false, z0, z1);\n if (clipSet)\n result.addConvexSet(clipSet);\n }\n } else {\n // make a singleton clipper with the z values.\n const clipSet = ConvexClipPlaneSet.createEmpty();\n clipSet?.addZClipPlanes(false, z0, z1);\n if (clipSet.planes.length > 0)\n result.addConvexSet(clipSet);\n }\n return result;\n }\n}\n"]}
1
+ {"version":3,"file":"LineStringOffsetClipperContext.js","sourceRoot":"","sources":["../../../../src/clipping/internalContexts/LineStringOffsetClipperCont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U,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC,CAAC;gBAC3D,MAAM,WAAW,GAAG,IAAI,CAAC,UAAU,CAAC,MAAM,EAAE,CAAC,EAAE,MAAM,CAAC,CAAC;gBACvD,MAAM,WAAW,GAAG,IAAI,CAAC,UAAU,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC,CAAC;gBAC3D,MAAM,OAAO,GAAG,OAAO,CAAC,uBAAuB,CAAC,MAAM,CAAC,+BAA+B,CAAC,CAAC,CAAC,EACvF,MAAM,CAAC,+BAA+B,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,WAAW,EAAE,WAAW,EAAE,WAAW,CAAC,CAAC;gBACxF,OAAO,EAAE,cAAc,CAAC,KAAK,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;gBACvC,IAAI,OAAO;oBACT,MAAM,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;YACjC,CAAC;QACH,CAAC;aAAM,CAAC;YACN,8CAA8C;YAC9C,MAAM,OAAO,GAAG,kBAAkB,CAAC,WAAW,EAAE,CAAC;YACjD,OAAO,EAAE,cAAc,CAAC,KAAK,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;YACvC,IAAI,OAAO,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC;gBAC3B,MAAM,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;QACjC,CAAC;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\nimport { Geometry } from \"../../Geometry\";\r\nimport { Point3d, Vector3d } from \"../../geometry3d/Point3dVector3d\";\r\nimport { UnionOfConvexClipPlaneSets } from \"../UnionOfConvexClipPlaneSets\";\r\nimport { ConvexClipPlaneSet } from \"../ConvexClipPlaneSet\";\r\nimport { ClipPlane } from \"../ClipPlane\";\r\nimport { IndexedXYZCollection } from \"../../geometry3d/IndexedXYZCollection\";\r\n/**\r\n * Class for building clip sets for offset regions.\r\n * @internal\r\n */\r\nexport class LineStringOffsetClipperContext {\r\n private _positiveOffsetLeft: number;\r\n private _positiveOffsetRight: number;\r\n private _turnDegrees: number;\r\n private constructor(positiveOffsetLeft: number, positiveOffsetRight: number) {\r\n this._positiveOffsetLeft = positiveOffsetLeft;\r\n this._positiveOffsetRight = positiveOffsetRight;\r\n this._turnDegrees = 60.0;\r\n }\r\n /**\r\n * Create a unit vector from point i to point i+1.\r\n * If closed, do point indexing with\r\n * * index less than 0 get final segment\r\n * * index at or beyond points.length-1 wraps to first segment\r\n * @param points\r\n * @param index0\r\n * @param closed indicates that first and last points are identical and need wrap logic.\r\n */\r\n public static createUnit(\r\n points: IndexedXYZCollection, index0: number, closed: boolean, xyOnly: boolean = true,\r\n ): Vector3d | undefined {\r\n // pick two indices of active points, allowing for wrap if needed:\r\n // normally use index0 and index0 + 1\r\n // but apply wrap if appropriate, and shift ahead of needed.\r\n let k0 = index0;\r\n let k1 = index0 + 1;\r\n const last = points.length - 1;\r\n if (closed) {\r\n if (index0 < 0) {\r\n k0 = last - 1; k1 = last;\r\n } else if (index0 >= last) {\r\n k0 = 0; k1 = 1;\r\n }\r\n } else {\r\n if (index0 === 0) {\r\n k0 = 0; k1 = 1;\r\n } else if (k1 > last) {\r\n k0 = last - 1;\r\n k1 = last;\r\n }\r\n }\r\n const result = points.vectorIndexIndex(k0, k1);\r\n if (result) {\r\n if (xyOnly)\r\n result.z = 0.0;\r\n return result.normalize(result);\r\n }\r\n return undefined;\r\n }\r\n private static createDirectedPlane(\r\n basePoint: Point3d, vector: Vector3d, shift: number, normalScale: number, interior: boolean = false,\r\n ): ClipPlane | undefined {\r\n return ClipPlane.createNormalAndPointXYZXYZ(\r\n vector.x * normalScale, vector.y * normalScale, vector.z * normalScale,\r\n basePoint.x + shift * vector.x, basePoint.y + shift * vector.y, basePoint.z + shift * vector.z,\r\n interior, interior,\r\n );\r\n }\r\n /**\r\n * Create (if needed) the chamfer cutback plane for a turn.\r\n * @param clipSet set to receive the plane\r\n * @param point central point\r\n * @param unitA incoming vector\r\n * @param unitB outgoing vector\r\n */\r\n private createChamferCut(clipSet: ConvexClipPlaneSet, point: Point3d, unitA: Vector3d, unitB: Vector3d) {\r\n const degreesA = unitA.angleToXY(unitB).degrees;\r\n if (Math.abs(degreesA) > this._turnDegrees) {\r\n const perpAB = unitA.interpolate(0.5, unitB);\r\n perpAB.rotate90CCWXY(perpAB);\r\n perpAB.normalizeInPlace();\r\n if (degreesA > 0)\r\n clipSet.addPlaneToConvexSet(\r\n LineStringOffsetClipperContext.createDirectedPlane(point, perpAB, -this._positiveOffsetRight, 1.0, false),\r\n );\r\n else\r\n clipSet.addPlaneToConvexSet(\r\n LineStringOffsetClipperContext.createDirectedPlane(point, perpAB, this._positiveOffsetLeft, -1.0, false),\r\n );\r\n }\r\n }\r\n private createOffsetFromSegment(\r\n pointA: Point3d,\r\n pointB: Point3d,\r\n unitA: Vector3d | undefined,\r\n unitB: Vector3d | undefined,\r\n unitC: Vector3d | undefined,\r\n ): ConvexClipPlaneSet | undefined {\r\n if (unitB === undefined)\r\n return undefined;\r\n if (unitA === undefined)\r\n unitA = unitB;\r\n if (unitC === undefined)\r\n unitC = unitB;\r\n const unitAB = unitA.interpolate(0.5, unitB);\r\n unitAB.normalizeInPlace();\r\n const perpB = unitB.rotate90CCWXY();\r\n const unitBC = unitB.interpolate(0.5, unitC);\r\n unitBC.normalizeInPlace();\r\n const clipSet = ConvexClipPlaneSet.createEmpty();\r\n clipSet.addPlaneToConvexSet(\r\n LineStringOffsetClipperContext.createDirectedPlane(pointA, perpB, this._positiveOffsetLeft, -1.0, false),\r\n );\r\n clipSet.addPlaneToConvexSet(\r\n LineStringOffsetClipperContext.createDirectedPlane(pointA, perpB, -this._positiveOffsetRight, 1.0, false),\r\n );\r\n clipSet.addPlaneToConvexSet(\r\n LineStringOffsetClipperContext.createDirectedPlane(pointA, unitAB, 0, 1.0, true),\r\n );\r\n clipSet.addPlaneToConvexSet(\r\n LineStringOffsetClipperContext.createDirectedPlane(pointB, unitBC, 0, -1.0, true),\r\n );\r\n this.createChamferCut(clipSet, pointA, unitA, unitB);\r\n this.createChamferCut(clipSet, pointB, unitB, unitC);\r\n /*\r\n const degreesA = unitA.angleToXY(unitB).degrees;\r\n if (Math.abs(degreesA) > this._turnDegrees) {\r\n const perpAB = unitA.interpolate(0.5, unitB);\r\n perpAB.rotate90CCWXY(perpAB);\r\n perpAB.normalizeInPlace();\r\n if (degreesA > 0)\r\n clipSet.addPlaneToConvexSet(BuildingCodeRegionOffsetsOps.createDirectedPlane(pointA, perpAB, -this._positiveOffsetRight, 1.0));\r\n else\r\n clipSet.addPlaneToConvexSet(BuildingCodeRegionOffsetsOps.createDirectedPlane(pointA, perpAB, -this._positiveOffsetLeft, -1.0));\r\n }\r\n const degreesB = unitB.angleToXY(unitC).degrees;\r\n if (Math.abs(degreesB) > this._turnDegrees) {\r\n const perpBC = unitB.interpolate(0.5, unitC);\r\n perpBC.rotate90CCWXY(perpBC);\r\n perpBC.normalizeInPlace();\r\n if (degreesB > 0)\r\n clipSet.addPlaneToConvexSet(BuildingCodeRegionOffsetsOps.createDirectedPlane(pointB, perpBC, -this._positiveOffsetRight, 1.0));\r\n else\r\n clipSet.addPlaneToConvexSet(BuildingCodeRegionOffsetsOps.createDirectedPlane(pointB, perpBC, -this._positiveOffsetLeft, -1.0));\r\n }\r\n */\r\n return clipSet;\r\n }\r\n /**\r\n * @param points\r\n * @param positiveOffsetLeft offset to left. 0 is clip on the path.\r\n * @param positiveOffsetRight offset to the right. 0 is clip on the path.\r\n * @param z0 z for lower clipping plane. If undefined, unbounded in positive z\r\n * @param z1 z for upper clipping plane. If undefined, unbounded in negative z.\r\n */\r\n public static createClipBetweenOffsets(\r\n points: IndexedXYZCollection,\r\n positiveOffsetLeft: number,\r\n positiveOffsetRight: number,\r\n z0: number | undefined,\r\n z1: number | undefined,\r\n ): UnionOfConvexClipPlaneSets {\r\n const context = new LineStringOffsetClipperContext(positiveOffsetLeft, positiveOffsetRight);\r\n const result = UnionOfConvexClipPlaneSets.createEmpty();\r\n if (points.length > 1) {\r\n const closed = Geometry.isSmallMetricDistance(points.distanceIndexIndex(0, points.length - 1)!);\r\n for (let i = 0; i + 1 < points.length; i++) {\r\n const unitVectorA = this.createUnit(points, i - 1, closed);\r\n const unitVectorB = this.createUnit(points, i, closed);\r\n const unitVectorC = this.createUnit(points, i + 1, closed);\r\n const clipSet = context.createOffsetFromSegment(points.getPoint3dAtUncheckedPointIndex(i),\r\n points.getPoint3dAtUncheckedPointIndex(i + 1), unitVectorA, unitVectorB, unitVectorC);\r\n clipSet?.addZClipPlanes(false, z0, z1);\r\n if (clipSet)\r\n result.addConvexSet(clipSet);\r\n }\r\n } else {\r\n // make a singleton clipper with the z values.\r\n const clipSet = ConvexClipPlaneSet.createEmpty();\r\n clipSet?.addZClipPlanes(false, z0, z1);\r\n if (clipSet.planes.length > 0)\r\n result.addConvexSet(clipSet);\r\n }\r\n return result;\r\n }\r\n}\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"core-geometry.js","sourceRoot":"","sources":["../../src/core-geometry.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F;;GAEG;AAEH,UAAU;AACV,+GAA+G;AAC/G,wDAAwD;AACxD,+FAA+F;AAC/F,6HAA6H;AAC7H,kEAAkE;AAElE;;;GAGG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,4CAA4C;AAC5C;;;;;;;;;GASG;AACH,8CAA8C;AAE9C;;;;;;;;GAQG;AACH,kCAAkC;AAElC;;;;;;;;;;;;GAYG;AACH,gCAAgC;AAChC;;;GAGG;AACH,mCAAmC;AACnC;;;GAGG;AACH,mCAAmC;AACnC;;;;GAIG;AACH,wCAAwC;AACxC;;;;;;;;;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EAAE,MAAM,2CAA2C,CAAC","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 Utility\n */\n\n// REMARK:\n// The docs-group-description comments are followed by empty classes with names corresponding to the doc-group.\n// Normally (in committed code) these are commented out.\n// The comments have distinctive strings so that simple search and replace can make the \"real\".\n// This is useful when working on the documentation: When the empty classes are present, VSCode will format the doc comments\n// for and display them when the mouse hovers over the class name.\n\n/**\n * @docs-package-description\n * The core-geometry package contains classes for working with geometry: points, vectors, curves, surfaces, and analytic solids\n */\n/**\n * @docs-group-description CartesianGeometry\n * Points, Vectors, Planes, and Transformations for x,y,z geometry.\n * * Fundamental cartesian geometry objects:\n * * Point2d, Point3d -- points with x,y,z coordinates\n * * Vector2d, Vector3d -- vectors with x,y,z coordinates\n * * Matrix3d -- 3x3 matrix\n * * * commonly used for pure rotations\n * * * scale and skew entries are also allowed.\n * * Transform -- an origin and axes.\n * * Range1d, Range2d, Range3d -- subsets of 1d, 2d, and 3d space bounded by low and high values.\n * * Ray3d -- a ray defined by origin and direction vector\n * * Plane3d -- an abstract base class extended by Plane3dByOriginAndNormal, Plane3dByOriginAndUnitNormal, Point4d, and ClipPlane\n * * Plane3dByOriginAndUnitNormal -- a plane defined by an origin and a single vector which is perpendicular to the plane\n * * plane3dByOriginAndVectors -- a plane defined by an origin and two vectors in the plane.\n * * Angles\n * * Angle -- a strongly typed angle object whose method names make it clear whether input and outputs are degrees or radians.\n * * AngleSweep -- an angular interval\n * * LatitudeLongitudeNumber -- carrier for position and altitude on sphere or ellipsoid\n * * YawPitchAndRollAngles -- 3 angles that define a rotated coordinate system.\n * * Utility classes\n * * FrameBuilder -- construction of coordinate frames from mixed data sources.\n * * ClipPlane -- a single plane\n * * ConvexClipPlaneSet -- an array of planes bounding a convex volume\n * * ClipPlaneSet -- an array of ConvexClipPlaneSet, defining the union of their volumes\n * * BilinearPatch -- twisted quadrilateral defined by 4 points\n * * BarycentricTriangle -- triangle defined by 3 points.\n * * Constant -- various numeric values exported as readonly constants\n */\n// doc:export class CartesianGeometryDoc { }\n/**\n * @docs-group-description ArraysAndInterfaces\n * These classes support array operations and inheritance-based algorithms.\n * * Arrays\n * * GrowableArray -- A carrier for a Float64Array, with methods that hide reallocation of the underlying array as contents are added.\n * * Point2dArray, Point3dArray, Point4dArray, Vector3dArray -- miscellaneous operations on arrays of 2d and 3d points.\n * * Interfaces\n * * GeometryHandler -- a double-dispatch protocol used for efficient implementation of algorithms that work on many geometry types.\n *\n */\n// doc:export class ArraysAndInterfacesDoc { }\n\n/**\n * @docs-group-description Bspline\n * A bspline curve or surface is used for curved freeform geometry defined by controls points (sometimes called poles).\n * * BSplineCurve -- a curve defined by control points (which are not on the curve)\n * * InterpolationCurve -- a curve defined by passthrough points, with \"good\" visual properties\n * * BSplineSurfaceXYZ -- a surface with XYZ\n * * BsplineSurfaceXYZW -- a surface with weighted (rational) XYZ coordinates\n * * KnotVector -- vector of breakpoints in bspline definitions.\n */\n// doc:export class BsplineDoc { }\n\n/**\n * @docs-group-description Curve\n * Curves in the GeometryQuery hierarchy: LineSegment3d, LineString3d, Arc3d, TransitionSpiral3d\n * * CurvePrimitive -- base class for parametric curves\n * * LineSegment3d -- a (bounded) portion of an unbounded line\n * * Arc3d -- a circular or elliptic arc\n * * LineString3d -- a sequence of points joined by line segments\n * * TransitionSpiral -- controlled transition between curvatures\n * * Support classes\n * * PointString3d -- a sequence of isolated points\n * * StrokeOptions -- tolerances to describe stroking accuracy\n * * RecursiveCurveProcessor, RecursiveCurveProcessorWithStack -- algorithmic support for trees with CurvePrimitives at the leaf level.\n */\n// doc:export class CurveDoc { }\n/**\n * @docs-group-description Numerics\n * The Numerics classes have geometric and numeric methods used during large algorithms in other classes.\n */\n// doc:export class NumericsDoc { }\n/**\n * @docs-group-description Polyface\n * A Polyface is a mesh structure with arrays of points that are shared among multiple incident facets.\n */\n// doc:export class PolyfaceDoc { }\n/**\n * @docs-group-description Serialization\n * These classes are related to serialization of geometry classes.\n * * IModelJson.Reader, IModelJson.Writer -- Conversion of in-memory geometry objects to json objects for persistence and transmission.\n */\n// doc:export class SerializationDoc { }\n/**\n * @docs-group-description Solid\n * Analytic Solids in the GeometryQuery hierarchy: Box, Sphere, Cone, TorusPipe, LinearSweep, RotationalSweep, RuledSweep\n * * Box -- a box solid. This is usually rectangular on all faces, but can in one directly like a view frustum\n * * Sphere -- a sphere\n * * Cone -- a cone or cylinder\n * * TorusPipe -- a pipe elbow\n * * LinearSweep -- a linear sweep of a base contour\n * * RotationalSweep -- a rotational sweep of a base contour\n * * RuledSweep -- two or more similarly structured contours joined by linear rule lines.\n */\n// doc:export class SolidDOc { }\n/**\n * @docs-group-description Topology\n * The Topology classes provide adjacency structures used in triangulations.\n */\n// doc:export class TopologyDoc { }\n/**\n * @docs-group-description RangeSearch\n * Support classes for searching collections of ranges.\n */\nexport * from \"./geometry3d/Angle\";\nexport * from \"./geometry3d/AngleSweep\";\nexport * from \"./geometry3d/LongitudeLatitudeAltitude\";\nexport * from \"./geometry3d/BarycentricTriangle\";\nexport * from \"./geometry3d/BilinearPatch\";\nexport * from \"./geometry3d/Ellipsoid\";\nexport * from \"./geometry3d/FrameBuilder\";\nexport * from \"./geometry3d/FrustumAnimation\";\nexport * from \"./geometry3d/GeometryHandler\";\nexport * from \"./geometry3d/GrowableBlockedArray\";\nexport * from \"./geometry3d/GrowableFloat64Array\";\nexport * from \"./geometry3d/GrowableXYArray\";\nexport * from \"./geometry3d/GrowableXYZArray\";\nexport * from \"./geometry3d/IndexedCollectionInterval\";\nexport * from \"./geometry3d/IndexedXYCollection\";\nexport * from \"./geometry3d/IndexedXYZCollection\";\nexport * from \"./geometry3d/Matrix3d\";\nexport * from \"./geometry3d/OrderedRotationAngles\";\nexport * from \"./geometry3d/Plane3d\";\nexport * from \"./geometry3d/Plane3dByOriginAndUnitNormal\";\nexport * from \"./geometry3d/Plane3dByOriginAndVectors\";\nexport * from \"./geometry3d/Point2dArrayCarrier\";\nexport * from \"./geometry3d/Point2dVector2d\";\nexport * from \"./geometry3d/Point3dVector3d\";\nexport * from \"./geometry3d/PointHelpers\";\nexport * from \"./geometry3d/Point3dArrayCarrier\";\nexport * from \"./geometry3d/PolylineOps\";\nexport * from \"./geometry3d/PolygonOps\";\nexport * from \"./geometry3d/Range\";\nexport * from \"./geometry3d/Ray2d\";\nexport * from \"./geometry3d/Ray3d\";\nexport * from \"./geometry3d/ReusableObjectCache\";\nexport * from \"./geometry3d/Segment1d\";\nexport * from \"./geometry3d/Transform\";\nexport * from \"./geometry3d/UVSurfaceOps\";\nexport * from \"./geometry3d/XYZProps\";\nexport * from \"./geometry3d/YawPitchRollAngles\";\n\nexport * from \"./Geometry\";\nexport * from \"./Constant\";\nexport * from \"./clipping/BooleanClipFactory\";\nexport * from \"./clipping/ClipPlane\";\nexport * from \"./clipping/ConvexClipPlaneSet\";\nexport * from \"./clipping/UnionOfConvexClipPlaneSets\";\nexport * from \"./clipping/ClipPrimitive\";\nexport * from \"./clipping/ClipVector\";\nexport * from \"./clipping/ClipUtils\";\nexport * from \"./numerics/ConvexPolygon2d\";\nexport * from \"./geometry4d/PlaneByOriginAndVectors4d\";\nexport * from \"./geometry4d/Point4d\";\nexport * from \"./geometry4d/Matrix4d\";\nexport * from \"./geometry4d/Map4d\";\nexport * from \"./geometry4d/MomentData\";\nexport * from \"./numerics/BezierPolynomials\";\nexport * from \"./numerics/ClusterableArray\";\nexport * from \"./numerics/Complex\";\nexport * from \"./numerics/ConvexPolygon2d\";\nexport * from \"./numerics/PascalCoefficients\";\nexport * from \"./numerics/Quadrature\";\nexport * from \"./numerics/Range1dArray\";\nexport * from \"./numerics/SmallSystem\";\nexport * from \"./numerics/TriDiagonalSystem\";\n\nexport * from \"./curve/Arc3d\";\nexport * from \"./curve/ConstructCurveBetweenCurves\";\nexport * from \"./curve/CoordinateXYZ\";\nexport * from \"./curve/CurveTypes\";\nexport * from \"./curve/CurveChainWithDistanceIndex\";\nexport * from \"./curve/CurveExtendMode\";\nexport * from \"./curve/CurveCollection\";\nexport * from \"./curve/CurveCurve\";\nexport * from \"./curve/CurveLocationDetail\";\nexport * from \"./curve/CurveFactory\";\nexport * from \"./curve/CurveOps\";\nexport * from \"./curve/CurvePrimitive\";\nexport * from \"./curve/CurveProcessor\";\nexport * from \"./curve/GeometryQuery\";\nexport * from \"./curve/LineSegment3d\";\nexport * from \"./curve/LineString3d\";\nexport * from \"./curve/Loop\";\nexport * from \"./curve/OffsetOptions\";\nexport * from \"./curve/ParityRegion\";\nexport * from \"./curve/Path\";\nexport * from \"./curve/RegionMomentsXY\";\nexport * from \"./curve/RegionOps\";\nexport * from \"./curve/PointString3d\";\nexport * from \"./curve/ProxyCurve\";\nexport * from \"./curve/StrokeOptions\";\nexport * from \"./curve/spiral/TransitionSpiral3d\";\nexport * from \"./curve/spiral/IntegratedSpiral3d\";\nexport * from \"./curve/spiral/DirectSpiral3d\";\nexport * from \"./curve/UnionRegion\";\nexport * from \"./curve/Query/StrokeCountMap\";\nexport * from \"./solid/Box\";\nexport * from \"./solid/Cone\";\nexport * from \"./solid/LinearSweep\";\nexport * from \"./solid/RotationalSweep\";\nexport * from \"./solid/RuledSweep\";\nexport * from \"./solid/SolidPrimitive\";\nexport * from \"./solid/Sphere\";\nexport * from \"./solid/SweepContour\";\nexport * from \"./solid/TorusPipe\";\nexport * from \"./bspline/AkimaCurve3d\";\nexport * from \"./bspline/Bezier1dNd\";\nexport * from \"./bspline/BezierCurveBase\";\nexport * from \"./bspline/BezierCurve3d\";\nexport * from \"./bspline/BezierCurve3dH\";\nexport * from \"./bspline/BSplineCurve\";\nexport * from \"./bspline/BSplineCurveOps\";\nexport * from \"./bspline/BSpline1dNd\";\nexport * from \"./bspline/BSplineCurve3dH\";\nexport * from \"./bspline/BSplineSurface\";\nexport * from \"./bspline/InterpolationCurve3d\";\nexport * from \"./bspline/KnotVector\";\nexport * from \"./polyface/AuxData\";\nexport * from \"./polyface/BoxTopology\";\nexport * from \"./polyface/FacetFaceData\";\nexport * from \"./polyface/Polyface\";\nexport * from \"./polyface/FacetLocationDetail\";\nexport * from \"./polyface/IndexedEdgeMatcher\";\nexport * from \"./polyface/IndexedPolyfaceVisitor\";\nexport * from \"./polyface/IndexedPolyfaceWalker\";\nexport * from \"./polyface/multiclip/GriddedRaggedRange2dSet\";\nexport * from \"./polyface/multiclip/GriddedRaggedRange2dSetWithOverflow\";\nexport * from \"./polyface/PolyfaceBuilder\";\nexport * from \"./polyface/PolyfaceData\";\nexport * from \"./polyface/PolyfaceQuery\";\nexport * from \"./polyface/PolyfaceClip\";\nexport * from \"./polyface/RangeTree/Point3dArrayRangeTreeContext\";\nexport * from \"./polyface/RangeTree/LineString3dRangeTreeContext\";\nexport * from \"./polyface/RangeTree/PolyfaceRangeTreeContext\";\nexport * from \"./polyface/TaggedNumericData\";\nexport * from \"./topology/SpaceTriangulation\";\nexport * from \"./serialization/IModelJsonSchema\";\nexport * from \"./serialization/DeepCompare\";\nexport * from \"./serialization/GeometrySamples\";\nexport * from \"./serialization/SerializationHelpers\";\nexport { BentleyGeometryFlatBuffer } from \"./serialization/BentleyGeometryFlatBuffer\";\n"]}
1
+ {"version":3,"file":"core-geometry.js","sourceRoot":"","sources":["../../src/core-geometry.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F;;GAEG;AAEH,UAAU;AACV,+GAA+G;AAC/G,wDAAwD;AACxD,+FAA+F;AAC/F,6HAA6H;AAC7H,kEAAkE;AAElE;;;GAGG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,4CAA4C;AAC5C;;;;;;;;;GASG;AACH,8CAA8C;AAE9C;;;;;;;;GAQG;AACH,kCAAkC;AAElC;;;;;;;;;;;;GAYG;AACH,gCAAgC;AAChC;;;GAGG;AACH,mCAAmC;AACnC;;;GAGG;AACH,mCAAmC;AACnC;;;;G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,CAAC;AACrD,OAAO,EAAE,yBAAyB,EAAE,MAAM,2CAA2C,CAAC","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 Utility\r\n */\r\n\r\n// REMARK:\r\n// The docs-group-description comments are followed by empty classes with names corresponding to the doc-group.\r\n// Normally (in committed code) these are commented out.\r\n// The comments have distinctive strings so that simple search and replace can make the \"real\".\r\n// This is useful when working on the documentation: When the empty classes are present, VSCode will format the doc comments\r\n// for and display them when the mouse hovers over the class name.\r\n\r\n/**\r\n * @docs-package-description\r\n * The core-geometry package contains classes for working with geometry: points, vectors, curves, surfaces, and analytic solids\r\n */\r\n/**\r\n * @docs-group-description CartesianGeometry\r\n * Points, Vectors, Planes, and Transformations for x,y,z geometry.\r\n * * Fundamental cartesian geometry objects:\r\n * * Point2d, Point3d -- points with x,y,z coordinates\r\n * * Vector2d, Vector3d -- vectors with x,y,z coordinates\r\n * * Matrix3d -- 3x3 matrix\r\n * * * commonly used for pure rotations\r\n * * * scale and skew entries are also allowed.\r\n * * Transform -- an origin and axes.\r\n * * Range1d, Range2d, Range3d -- subsets of 1d, 2d, and 3d space bounded by low and high values.\r\n * * Ray3d -- a ray defined by origin and direction vector\r\n * * Plane3d -- an abstract base class extended by Plane3dByOriginAndNormal, Plane3dByOriginAndUnitNormal, Point4d, and ClipPlane\r\n * * Plane3dByOriginAndUnitNormal -- a plane defined by an origin and a single vector which is perpendicular to the plane\r\n * * plane3dByOriginAndVectors -- a plane defined by an origin and two vectors in the plane.\r\n * * Angles\r\n * * Angle -- a strongly typed angle object whose method names make it clear whether input and outputs are degrees or radians.\r\n * * AngleSweep -- an angular interval\r\n * * LatitudeLongitudeNumber -- carrier for position and altitude on sphere or ellipsoid\r\n * * YawPitchAndRollAngles -- 3 angles that define a rotated coordinate system.\r\n * * Utility classes\r\n * * FrameBuilder -- construction of coordinate frames from mixed data sources.\r\n * * ClipPlane -- a single plane\r\n * * ConvexClipPlaneSet -- an array of planes bounding a convex volume\r\n * * ClipPlaneSet -- an array of ConvexClipPlaneSet, defining the union of their volumes\r\n * * BilinearPatch -- twisted quadrilateral defined by 4 points\r\n * * BarycentricTriangle -- triangle defined by 3 points.\r\n * * Constant -- various numeric values exported as readonly constants\r\n */\r\n// doc:export class CartesianGeometryDoc { }\r\n/**\r\n * @docs-group-description ArraysAndInterfaces\r\n * These classes support array operations and inheritance-based algorithms.\r\n * * Arrays\r\n * * GrowableArray -- A carrier for a Float64Array, with methods that hide reallocation of the underlying array as contents are added.\r\n * * Point2dArray, Point3dArray, Point4dArray, Vector3dArray -- miscellaneous operations on arrays of 2d and 3d points.\r\n * * Interfaces\r\n * * GeometryHandler -- a double-dispatch protocol used for efficient implementation of algorithms that work on many geometry types.\r\n *\r\n */\r\n// doc:export class ArraysAndInterfacesDoc { }\r\n\r\n/**\r\n * @docs-group-description Bspline\r\n * A bspline curve or surface is used for curved freeform geometry defined by controls points (sometimes called poles).\r\n * * BSplineCurve -- a curve defined by control points (which are not on the curve)\r\n * * InterpolationCurve -- a curve defined by passthrough points, with \"good\" visual properties\r\n * * BSplineSurfaceXYZ -- a surface with XYZ\r\n * * BsplineSurfaceXYZW -- a surface with weighted (rational) XYZ coordinates\r\n * * KnotVector -- vector of breakpoints in bspline definitions.\r\n */\r\n// doc:export class BsplineDoc { }\r\n\r\n/**\r\n * @docs-group-description Curve\r\n * Curves in the GeometryQuery hierarchy: LineSegment3d, LineString3d, Arc3d, TransitionSpiral3d\r\n * * CurvePrimitive -- base class for parametric curves\r\n * * LineSegment3d -- a (bounded) portion of an unbounded line\r\n * * Arc3d -- a circular or elliptic arc\r\n * * LineString3d -- a sequence of points joined by line segments\r\n * * TransitionSpiral -- controlled transition between curvatures\r\n * * Support classes\r\n * * PointString3d -- a sequence of isolated points\r\n * * StrokeOptions -- tolerances to describe stroking accuracy\r\n * * RecursiveCurveProcessor, RecursiveCurveProcessorWithStack -- algorithmic support for trees with CurvePrimitives at the leaf level.\r\n */\r\n// doc:export class CurveDoc { }\r\n/**\r\n * @docs-group-description Numerics\r\n * The Numerics classes have geometric and numeric methods used during large algorithms in other classes.\r\n */\r\n// doc:export class NumericsDoc { }\r\n/**\r\n * @docs-group-description Polyface\r\n * A Polyface is a mesh structure with arrays of points that are shared among multiple incident facets.\r\n */\r\n// doc:export class PolyfaceDoc { }\r\n/**\r\n * @docs-group-description Serialization\r\n * These classes are related to serialization of geometry classes.\r\n * * IModelJson.Reader, IModelJson.Writer -- Conversion of in-memory geometry objects to json objects for persistence and transmission.\r\n */\r\n// doc:export class SerializationDoc { }\r\n/**\r\n * @docs-group-description Solid\r\n * Analytic Solids in the GeometryQuery hierarchy: Box, Sphere, Cone, TorusPipe, LinearSweep, RotationalSweep, RuledSweep\r\n * * Box -- a box solid. This is usually rectangular on all faces, but can in one directly like a view frustum\r\n * * Sphere -- a sphere\r\n * * Cone -- a cone or cylinder\r\n * * TorusPipe -- a pipe elbow\r\n * * LinearSweep -- a linear sweep of a base contour\r\n * * RotationalSweep -- a rotational sweep of a base contour\r\n * * RuledSweep -- two or more similarly structured contours joined by linear rule lines.\r\n */\r\n// doc:export class SolidDOc { }\r\n/**\r\n * @docs-group-description Topology\r\n * The Topology classes provide adjacency structures used in triangulations.\r\n */\r\n// doc:export class TopologyDoc { }\r\n/**\r\n * @docs-group-description RangeSearch\r\n * Support classes for searching collections of ranges.\r\n */\r\nexport * from \"./geometry3d/Angle\";\r\nexport * from \"./geometry3d/AngleSweep\";\r\nexport * from \"./geometry3d/LongitudeLatitudeAltitude\";\r\nexport * from \"./geometry3d/BarycentricTriangle\";\r\nexport * from \"./geometry3d/BilinearPatch\";\r\nexport * from \"./geometry3d/Ellipsoid\";\r\nexport * from \"./geometry3d/FrameBuilder\";\r\nexport * from \"./geometry3d/FrustumAnimation\";\r\nexport * from \"./geometry3d/GeometryHandler\";\r\nexport * from \"./geometry3d/GrowableBlockedArray\";\r\nexport * from \"./geometry3d/GrowableFloat64Array\";\r\nexport * from \"./geometry3d/GrowableXYArray\";\r\nexport * from \"./geometry3d/GrowableXYZArray\";\r\nexport * from \"./geometry3d/IndexedCollectionInterval\";\r\nexport * from \"./geometry3d/IndexedXYCollection\";\r\nexport * from \"./geometry3d/IndexedXYZCollection\";\r\nexport * from \"./geometry3d/Matrix3d\";\r\nexport * from \"./geometry3d/OrderedRotationAngles\";\r\nexport * from \"./geometry3d/Plane3d\";\r\nexport * from \"./geometry3d/Plane3dByOriginAndUnitNormal\";\r\nexport * from \"./geometry3d/Plane3dByOriginAndVectors\";\r\nexport * from \"./geometry3d/Point2dArrayCarrier\";\r\nexport * from \"./geometry3d/Point2dVector2d\";\r\nexport * from \"./geometry3d/Point3dVector3d\";\r\nexport * from \"./geometry3d/PointHelpers\";\r\nexport * from \"./geometry3d/Point3dArrayCarrier\";\r\nexport * from \"./geometry3d/PolylineOps\";\r\nexport * from \"./geometry3d/PolygonOps\";\r\nexport * from \"./geometry3d/Range\";\r\nexport * from \"./geometry3d/Ray2d\";\r\nexport * from \"./geometry3d/Ray3d\";\r\nexport * from \"./geometry3d/ReusableObjectCache\";\r\nexport * from \"./geometry3d/Segment1d\";\r\nexport * from \"./geometry3d/Transform\";\r\nexport * from \"./geometry3d/UVSurfaceOps\";\r\nexport * from \"./geometry3d/XYZProps\";\r\nexport * from \"./geometry3d/YawPitchRollAngles\";\r\n\r\nexport * from \"./Geometry\";\r\nexport * from \"./Constant\";\r\nexport * from \"./clipping/BooleanClipFactory\";\r\nexport * from \"./clipping/ClipPlane\";\r\nexport * from \"./clipping/ConvexClipPlaneSet\";\r\nexport * from \"./clipping/UnionOfConvexClipPlaneSets\";\r\nexport * from \"./clipping/ClipPrimitive\";\r\nexport * from \"./clipping/ClipVector\";\r\nexport * from \"./clipping/ClipUtils\";\r\nexport * from \"./numerics/ConvexPolygon2d\";\r\nexport * from \"./geometry4d/PlaneByOriginAndVectors4d\";\r\nexport * from \"./geometry4d/Point4d\";\r\nexport * from \"./geometry4d/Matrix4d\";\r\nexport * from \"./geometry4d/Map4d\";\r\nexport * from \"./geometry4d/MomentData\";\r\nexport * from \"./numerics/BezierPolynomials\";\r\nexport * from \"./numerics/ClusterableArray\";\r\nexport * from \"./numerics/Complex\";\r\nexport * from \"./numerics/ConvexPolygon2d\";\r\nexport * from \"./numerics/PascalCoefficients\";\r\nexport * from \"./numerics/Quadrature\";\r\nexport * from \"./numerics/Range1dArray\";\r\nexport * from \"./numerics/SmallSystem\";\r\nexport * from \"./numerics/TriDiagonalSystem\";\r\n\r\nexport * from \"./curve/Arc3d\";\r\nexport * from \"./curve/ConstructCurveBetweenCurves\";\r\nexport * from \"./curve/CoordinateXYZ\";\r\nexport * from \"./curve/CurveTypes\";\r\nexport * from \"./curve/CurveChainWithDistanceIndex\";\r\nexport * from \"./curve/CurveExtendMode\";\r\nexport * from \"./curve/CurveCollection\";\r\nexport * from \"./curve/CurveCurve\";\r\nexport * from \"./curve/CurveLocationDetail\";\r\nexport * from \"./curve/CurveFactory\";\r\nexport * from \"./curve/CurveOps\";\r\nexport * from \"./curve/CurvePrimitive\";\r\nexport * from \"./curve/CurveProcessor\";\r\nexport * from \"./curve/GeometryQuery\";\r\nexport * from \"./curve/LineSegment3d\";\r\nexport * from \"./curve/LineString3d\";\r\nexport * from \"./curve/Loop\";\r\nexport * from \"./curve/OffsetOptions\";\r\nexport * from \"./curve/ParityRegion\";\r\nexport * from \"./curve/Path\";\r\nexport * from \"./curve/RegionMomentsXY\";\r\nexport * from \"./curve/RegionOps\";\r\nexport * from \"./curve/PointString3d\";\r\nexport * from \"./curve/ProxyCurve\";\r\nexport * from \"./curve/StrokeOptions\";\r\nexport * from \"./curve/spiral/TransitionSpiral3d\";\r\nexport * from \"./curve/spiral/IntegratedSpiral3d\";\r\nexport * from \"./curve/spiral/DirectSpiral3d\";\r\nexport * from \"./curve/UnionRegion\";\r\nexport * from \"./curve/Query/StrokeCountMap\";\r\nexport * from \"./solid/Box\";\r\nexport * from \"./solid/Cone\";\r\nexport * from \"./solid/LinearSweep\";\r\nexport * from \"./solid/RotationalSweep\";\r\nexport * from \"./solid/RuledSweep\";\r\nexport * from \"./solid/SolidPrimitive\";\r\nexport * from \"./solid/Sphere\";\r\nexport * from \"./solid/SweepContour\";\r\nexport * from \"./solid/TorusPipe\";\r\nexport * from \"./bspline/AkimaCurve3d\";\r\nexport * from \"./bspline/Bezier1dNd\";\r\nexport * from \"./bspline/BezierCurveBase\";\r\nexport * from \"./bspline/BezierCurve3d\";\r\nexport * from \"./bspline/BezierCurve3dH\";\r\nexport * from \"./bspline/BSplineCurve\";\r\nexport * from \"./bspline/BSplineCurveOps\";\r\nexport * from \"./bspline/BSpline1dNd\";\r\nexport * from \"./bspline/BSplineCurve3dH\";\r\nexport * from \"./bspline/BSplineSurface\";\r\nexport * from \"./bspline/InterpolationCurve3d\";\r\nexport * from \"./bspline/KnotVector\";\r\nexport * from \"./polyface/AuxData\";\r\nexport * from \"./polyface/BoxTopology\";\r\nexport * from \"./polyface/FacetFaceData\";\r\nexport * from \"./polyface/Polyface\";\r\nexport * from \"./polyface/FacetLocationDetail\";\r\nexport * from \"./polyface/IndexedEdgeMatcher\";\r\nexport * from \"./polyface/IndexedPolyfaceVisitor\";\r\nexport * from \"./polyface/IndexedPolyfaceWalker\";\r\nexport * from \"./polyface/multiclip/GriddedRaggedRange2dSet\";\r\nexport * from \"./polyface/multiclip/GriddedRaggedRange2dSetWithOverflow\";\r\nexport * from \"./polyface/PolyfaceBuilder\";\r\nexport * from \"./polyface/PolyfaceData\";\r\nexport * from \"./polyface/PolyfaceQuery\";\r\nexport * from \"./polyface/PolyfaceClip\";\r\nexport * from \"./polyface/RangeTree/Point3dArrayRangeTreeContext\";\r\nexport * from \"./polyface/RangeTree/LineString3dRangeTreeContext\";\r\nexport * from \"./polyface/RangeTree/PolyfaceRangeTreeContext\";\r\nexport * from \"./polyface/TaggedNumericData\";\r\nexport * from \"./topology/SpaceTriangulation\";\r\nexport * from \"./serialization/IModelJsonSchema\";\r\nexport * from \"./serialization/DeepCompare\";\r\nexport * from \"./serialization/GeometrySamples\";\r\nexport * from \"./serialization/SerializationHelpers\";\r\nexport { BentleyGeometryFlatBuffer } from \"./serialization/BentleyGeometryFlatBuffer\";\r\n"]}