@itwin/core-geometry 5.1.0-dev.9 → 5.2.0-dev.1
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.
- package/CHANGELOG.md +58 -1
- package/lib/cjs/Geometry.d.ts +18 -10
- package/lib/cjs/Geometry.d.ts.map +1 -1
- package/lib/cjs/Geometry.js +13 -3
- package/lib/cjs/Geometry.js.map +1 -1
- package/lib/cjs/bspline/BSpline1dNd.d.ts +1 -1
- package/lib/cjs/bspline/BSpline1dNd.js +1 -1
- package/lib/cjs/bspline/BSpline1dNd.js.map +1 -1
- package/lib/cjs/bspline/BSplineCurve.d.ts.map +1 -1
- package/lib/cjs/bspline/BSplineCurve.js +7 -1
- package/lib/cjs/bspline/BSplineCurve.js.map +1 -1
- package/lib/cjs/bspline/BSplineSurface.d.ts +4 -3
- package/lib/cjs/bspline/BSplineSurface.d.ts.map +1 -1
- package/lib/cjs/bspline/BSplineSurface.js +4 -5
- package/lib/cjs/bspline/BSplineSurface.js.map +1 -1
- package/lib/cjs/clipping/ClipPlane.d.ts +7 -5
- package/lib/cjs/clipping/ClipPlane.d.ts.map +1 -1
- package/lib/cjs/clipping/ClipPlane.js +9 -5
- package/lib/cjs/clipping/ClipPlane.js.map +1 -1
- package/lib/cjs/clipping/ClipUtils.d.ts.map +1 -1
- package/lib/cjs/clipping/ClipUtils.js +5 -3
- package/lib/cjs/clipping/ClipUtils.js.map +1 -1
- package/lib/cjs/clipping/ConvexClipPlaneSet.d.ts +1 -2
- package/lib/cjs/clipping/ConvexClipPlaneSet.d.ts.map +1 -1
- package/lib/cjs/clipping/ConvexClipPlaneSet.js +13 -25
- package/lib/cjs/clipping/ConvexClipPlaneSet.js.map +1 -1
- package/lib/cjs/clipping/UnionOfConvexClipPlaneSets.d.ts +1 -2
- package/lib/cjs/clipping/UnionOfConvexClipPlaneSets.d.ts.map +1 -1
- package/lib/cjs/clipping/UnionOfConvexClipPlaneSets.js +1 -2
- package/lib/cjs/clipping/UnionOfConvexClipPlaneSets.js.map +1 -1
- package/lib/cjs/core-geometry.d.ts +2 -0
- package/lib/cjs/core-geometry.d.ts.map +1 -1
- package/lib/cjs/core-geometry.js +2 -0
- package/lib/cjs/core-geometry.js.map +1 -1
- package/lib/cjs/curve/Arc3d.d.ts +54 -32
- package/lib/cjs/curve/Arc3d.d.ts.map +1 -1
- package/lib/cjs/curve/Arc3d.js +56 -37
- package/lib/cjs/curve/Arc3d.js.map +1 -1
- package/lib/cjs/curve/CurveCollection.d.ts +40 -1
- package/lib/cjs/curve/CurveCollection.d.ts.map +1 -1
- package/lib/cjs/curve/CurveCollection.js +90 -0
- package/lib/cjs/curve/CurveCollection.js.map +1 -1
- package/lib/cjs/curve/CurveFactory.d.ts +3 -2
- package/lib/cjs/curve/CurveFactory.d.ts.map +1 -1
- package/lib/cjs/curve/CurveFactory.js +6 -5
- package/lib/cjs/curve/CurveFactory.js.map +1 -1
- package/lib/cjs/curve/CurveLocationDetail.d.ts +27 -25
- package/lib/cjs/curve/CurveLocationDetail.d.ts.map +1 -1
- package/lib/cjs/curve/CurveLocationDetail.js +30 -25
- package/lib/cjs/curve/CurveLocationDetail.js.map +1 -1
- package/lib/cjs/curve/CurvePrimitive.d.ts +9 -2
- package/lib/cjs/curve/CurvePrimitive.d.ts.map +1 -1
- package/lib/cjs/curve/CurvePrimitive.js +11 -0
- package/lib/cjs/curve/CurvePrimitive.js.map +1 -1
- package/lib/cjs/curve/CurveTypes.d.ts +1 -1
- package/lib/cjs/curve/CurveTypes.js.map +1 -1
- package/lib/cjs/curve/LineSegment3d.d.ts +2 -0
- package/lib/cjs/curve/LineSegment3d.d.ts.map +1 -1
- package/lib/cjs/curve/LineSegment3d.js +4 -0
- package/lib/cjs/curve/LineSegment3d.js.map +1 -1
- package/lib/cjs/curve/LineString3d.d.ts +7 -0
- package/lib/cjs/curve/LineString3d.d.ts.map +1 -1
- package/lib/cjs/curve/LineString3d.js +15 -3
- package/lib/cjs/curve/LineString3d.js.map +1 -1
- package/lib/cjs/curve/Query/ConsolidateAdjacentPrimitivesContext.d.ts.map +1 -1
- package/lib/cjs/curve/Query/ConsolidateAdjacentPrimitivesContext.js +37 -8
- package/lib/cjs/curve/Query/ConsolidateAdjacentPrimitivesContext.js.map +1 -1
- package/lib/cjs/curve/Query/PlanarSubdivision.d.ts +34 -8
- package/lib/cjs/curve/Query/PlanarSubdivision.d.ts.map +1 -1
- package/lib/cjs/curve/Query/PlanarSubdivision.js +129 -33
- package/lib/cjs/curve/Query/PlanarSubdivision.js.map +1 -1
- package/lib/cjs/curve/Query/StrokeCountChain.d.ts +4 -3
- package/lib/cjs/curve/Query/StrokeCountChain.d.ts.map +1 -1
- package/lib/cjs/curve/Query/StrokeCountChain.js +20 -9
- package/lib/cjs/curve/Query/StrokeCountChain.js.map +1 -1
- package/lib/cjs/curve/RegionMomentsXY.d.ts +2 -1
- package/lib/cjs/curve/RegionMomentsXY.d.ts.map +1 -1
- package/lib/cjs/curve/RegionMomentsXY.js +26 -41
- package/lib/cjs/curve/RegionMomentsXY.js.map +1 -1
- package/lib/cjs/curve/RegionOps.d.ts +74 -39
- package/lib/cjs/curve/RegionOps.d.ts.map +1 -1
- package/lib/cjs/curve/RegionOps.js +146 -46
- package/lib/cjs/curve/RegionOps.js.map +1 -1
- package/lib/cjs/curve/RegionOpsClassificationSweeps.d.ts +36 -27
- package/lib/cjs/curve/RegionOpsClassificationSweeps.d.ts.map +1 -1
- package/lib/cjs/curve/RegionOpsClassificationSweeps.js +161 -55
- package/lib/cjs/curve/RegionOpsClassificationSweeps.js.map +1 -1
- package/lib/cjs/curve/StrokeOptions.d.ts +1 -1
- package/lib/cjs/curve/StrokeOptions.js +1 -1
- package/lib/cjs/curve/StrokeOptions.js.map +1 -1
- package/lib/cjs/curve/internalContexts/AnnounceTangentStrokeHandler.js.map +1 -1
- package/lib/cjs/curve/internalContexts/CurveCurveCloseApproachXY.d.ts +2 -2
- package/lib/cjs/curve/internalContexts/CurveCurveCloseApproachXY.js +6 -6
- package/lib/cjs/curve/internalContexts/CurveCurveCloseApproachXY.js.map +1 -1
- package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.d.ts +0 -1
- package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.d.ts.map +1 -1
- package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.js +58 -32
- package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.js.map +1 -1
- package/lib/cjs/curve/internalContexts/PolygonOffsetContext.d.ts.map +1 -1
- package/lib/cjs/curve/internalContexts/PolygonOffsetContext.js +0 -1
- package/lib/cjs/curve/internalContexts/PolygonOffsetContext.js.map +1 -1
- package/lib/cjs/curve/internalContexts/TransferWithSplitArcs.d.ts +14 -0
- package/lib/cjs/curve/internalContexts/TransferWithSplitArcs.d.ts.map +1 -0
- package/lib/cjs/curve/internalContexts/TransferWithSplitArcs.js +34 -0
- package/lib/cjs/curve/internalContexts/TransferWithSplitArcs.js.map +1 -0
- package/lib/cjs/geometry3d/AngleSweep.d.ts +25 -18
- package/lib/cjs/geometry3d/AngleSweep.d.ts.map +1 -1
- package/lib/cjs/geometry3d/AngleSweep.js +32 -18
- package/lib/cjs/geometry3d/AngleSweep.js.map +1 -1
- package/lib/cjs/geometry3d/CoincidentGeometryOps.d.ts +8 -7
- package/lib/cjs/geometry3d/CoincidentGeometryOps.d.ts.map +1 -1
- package/lib/cjs/geometry3d/CoincidentGeometryOps.js +19 -25
- package/lib/cjs/geometry3d/CoincidentGeometryOps.js.map +1 -1
- package/lib/cjs/geometry3d/Ellipsoid.js +1 -1
- package/lib/cjs/geometry3d/Ellipsoid.js.map +1 -1
- package/lib/cjs/geometry3d/GrowableXYArray.d.ts +1 -1
- package/lib/cjs/geometry3d/GrowableXYArray.js +1 -1
- package/lib/cjs/geometry3d/GrowableXYArray.js.map +1 -1
- package/lib/cjs/geometry3d/GrowableXYZArray.d.ts +8 -3
- package/lib/cjs/geometry3d/GrowableXYZArray.d.ts.map +1 -1
- package/lib/cjs/geometry3d/GrowableXYZArray.js +21 -3
- package/lib/cjs/geometry3d/GrowableXYZArray.js.map +1 -1
- package/lib/cjs/geometry3d/IndexedXYZCollection.d.ts +11 -1
- package/lib/cjs/geometry3d/IndexedXYZCollection.d.ts.map +1 -1
- package/lib/cjs/geometry3d/IndexedXYZCollection.js +21 -3
- package/lib/cjs/geometry3d/IndexedXYZCollection.js.map +1 -1
- package/lib/cjs/geometry3d/Plane3d.d.ts +2 -0
- package/lib/cjs/geometry3d/Plane3d.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Plane3d.js +6 -1
- package/lib/cjs/geometry3d/Plane3d.js.map +1 -1
- package/lib/cjs/geometry3d/Plane3dByOriginAndUnitNormal.d.ts +2 -0
- package/lib/cjs/geometry3d/Plane3dByOriginAndUnitNormal.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Plane3dByOriginAndUnitNormal.js +6 -1
- package/lib/cjs/geometry3d/Plane3dByOriginAndUnitNormal.js.map +1 -1
- package/lib/cjs/geometry3d/Plane3dByOriginAndVectors.d.ts +8 -2
- package/lib/cjs/geometry3d/Plane3dByOriginAndVectors.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Plane3dByOriginAndVectors.js +18 -10
- package/lib/cjs/geometry3d/Plane3dByOriginAndVectors.js.map +1 -1
- package/lib/cjs/geometry3d/Point2dVector2d.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Point2dVector2d.js +0 -2
- package/lib/cjs/geometry3d/Point2dVector2d.js.map +1 -1
- package/lib/cjs/geometry3d/Point3dVector3d.d.ts +4 -4
- package/lib/cjs/geometry3d/Point3dVector3d.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Point3dVector3d.js +4 -5
- package/lib/cjs/geometry3d/Point3dVector3d.js.map +1 -1
- package/lib/cjs/geometry3d/PointHelpers.d.ts +7 -7
- package/lib/cjs/geometry3d/PointHelpers.d.ts.map +1 -1
- package/lib/cjs/geometry3d/PointHelpers.js +66 -26
- package/lib/cjs/geometry3d/PointHelpers.js.map +1 -1
- package/lib/cjs/geometry3d/PolygonOps.d.ts +49 -2
- package/lib/cjs/geometry3d/PolygonOps.d.ts.map +1 -1
- package/lib/cjs/geometry3d/PolygonOps.js +38 -2
- package/lib/cjs/geometry3d/PolygonOps.js.map +1 -1
- package/lib/cjs/geometry3d/PolylineCompressionByEdgeOffset.d.ts +13 -6
- package/lib/cjs/geometry3d/PolylineCompressionByEdgeOffset.d.ts.map +1 -1
- package/lib/cjs/geometry3d/PolylineCompressionByEdgeOffset.js +16 -9
- package/lib/cjs/geometry3d/PolylineCompressionByEdgeOffset.js.map +1 -1
- package/lib/cjs/geometry3d/PolylineOps.d.ts +5 -4
- package/lib/cjs/geometry3d/PolylineOps.d.ts.map +1 -1
- package/lib/cjs/geometry3d/PolylineOps.js +5 -4
- package/lib/cjs/geometry3d/PolylineOps.js.map +1 -1
- package/lib/cjs/geometry3d/Range.d.ts +18 -10
- package/lib/cjs/geometry3d/Range.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Range.js +32 -10
- package/lib/cjs/geometry3d/Range.js.map +1 -1
- package/lib/cjs/geometry3d/Ray2d.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Ray2d.js +0 -1
- package/lib/cjs/geometry3d/Ray2d.js.map +1 -1
- package/lib/cjs/geometry3d/Ray3d.d.ts +7 -9
- package/lib/cjs/geometry3d/Ray3d.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Ray3d.js +23 -45
- package/lib/cjs/geometry3d/Ray3d.js.map +1 -1
- package/lib/cjs/geometry3d/ReusableObjectCache.d.ts +39 -29
- package/lib/cjs/geometry3d/ReusableObjectCache.d.ts.map +1 -1
- package/lib/cjs/geometry3d/ReusableObjectCache.js +49 -35
- package/lib/cjs/geometry3d/ReusableObjectCache.js.map +1 -1
- package/lib/cjs/geometry3d/SortablePolygon.d.ts +1 -4
- package/lib/cjs/geometry3d/SortablePolygon.d.ts.map +1 -1
- package/lib/cjs/geometry3d/SortablePolygon.js +48 -43
- package/lib/cjs/geometry3d/SortablePolygon.js.map +1 -1
- package/lib/cjs/geometry3d/Transform.d.ts +21 -2
- package/lib/cjs/geometry3d/Transform.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Transform.js +32 -13
- package/lib/cjs/geometry3d/Transform.js.map +1 -1
- package/lib/cjs/geometry4d/Point4d.d.ts +8 -5
- package/lib/cjs/geometry4d/Point4d.d.ts.map +1 -1
- package/lib/cjs/geometry4d/Point4d.js +27 -16
- package/lib/cjs/geometry4d/Point4d.js.map +1 -1
- package/lib/cjs/numerics/BezierPolynomials.d.ts +2 -0
- package/lib/cjs/numerics/BezierPolynomials.d.ts.map +1 -1
- package/lib/cjs/numerics/BezierPolynomials.js +11 -0
- package/lib/cjs/numerics/BezierPolynomials.js.map +1 -1
- package/lib/cjs/numerics/SmallSystem.d.ts +77 -36
- package/lib/cjs/numerics/SmallSystem.d.ts.map +1 -1
- package/lib/cjs/numerics/SmallSystem.js +129 -73
- package/lib/cjs/numerics/SmallSystem.js.map +1 -1
- package/lib/cjs/polyface/FacetOrientation.d.ts +1 -1
- package/lib/cjs/polyface/FacetOrientation.js +1 -1
- package/lib/cjs/polyface/FacetOrientation.js.map +1 -1
- package/lib/cjs/polyface/IndexedEdgeMatcher.d.ts +55 -40
- package/lib/cjs/polyface/IndexedEdgeMatcher.d.ts.map +1 -1
- package/lib/cjs/polyface/IndexedEdgeMatcher.js +83 -75
- package/lib/cjs/polyface/IndexedEdgeMatcher.js.map +1 -1
- package/lib/cjs/polyface/IndexedPolyfaceVisitor.d.ts +15 -14
- package/lib/cjs/polyface/IndexedPolyfaceVisitor.d.ts.map +1 -1
- package/lib/cjs/polyface/IndexedPolyfaceVisitor.js +47 -38
- package/lib/cjs/polyface/IndexedPolyfaceVisitor.js.map +1 -1
- package/lib/cjs/polyface/IndexedPolyfaceWalker.d.ts +26 -19
- package/lib/cjs/polyface/IndexedPolyfaceWalker.d.ts.map +1 -1
- package/lib/cjs/polyface/IndexedPolyfaceWalker.js +51 -32
- package/lib/cjs/polyface/IndexedPolyfaceWalker.js.map +1 -1
- package/lib/cjs/polyface/Polyface.d.ts +19 -5
- package/lib/cjs/polyface/Polyface.d.ts.map +1 -1
- package/lib/cjs/polyface/Polyface.js +18 -2
- package/lib/cjs/polyface/Polyface.js.map +1 -1
- package/lib/cjs/polyface/PolyfaceBuilder.d.ts +1 -1
- package/lib/cjs/polyface/PolyfaceBuilder.js +6 -6
- package/lib/cjs/polyface/PolyfaceBuilder.js.map +1 -1
- package/lib/cjs/polyface/PolyfaceClip.d.ts +19 -18
- package/lib/cjs/polyface/PolyfaceClip.d.ts.map +1 -1
- package/lib/cjs/polyface/PolyfaceClip.js +39 -42
- package/lib/cjs/polyface/PolyfaceClip.js.map +1 -1
- package/lib/cjs/polyface/PolyfaceData.d.ts +1 -1
- package/lib/cjs/polyface/PolyfaceData.js +1 -1
- package/lib/cjs/polyface/PolyfaceData.js.map +1 -1
- package/lib/cjs/polyface/PolyfaceQuery.d.ts +119 -78
- package/lib/cjs/polyface/PolyfaceQuery.d.ts.map +1 -1
- package/lib/cjs/polyface/PolyfaceQuery.js +315 -231
- package/lib/cjs/polyface/PolyfaceQuery.js.map +1 -1
- package/lib/cjs/polyface/RangeTree/RangeTreeNode.d.ts +3 -3
- package/lib/cjs/polyface/RangeTree/RangeTreeNode.d.ts.map +1 -1
- package/lib/cjs/polyface/RangeTree/RangeTreeNode.js +3 -3
- package/lib/cjs/polyface/RangeTree/RangeTreeNode.js.map +1 -1
- package/lib/cjs/polyface/multiclip/SweepLineStringToFacetContext.d.ts +7 -6
- package/lib/cjs/polyface/multiclip/SweepLineStringToFacetContext.d.ts.map +1 -1
- package/lib/cjs/polyface/multiclip/SweepLineStringToFacetContext.js +8 -9
- package/lib/cjs/polyface/multiclip/SweepLineStringToFacetContext.js.map +1 -1
- package/lib/cjs/serialization/BGFBReader.d.ts.map +1 -1
- package/lib/cjs/serialization/BGFBReader.js +2 -3
- package/lib/cjs/serialization/BGFBReader.js.map +1 -1
- package/lib/cjs/serialization/BGFBWriter.d.ts.map +1 -1
- package/lib/cjs/serialization/BGFBWriter.js +2 -4
- package/lib/cjs/serialization/BGFBWriter.js.map +1 -1
- package/lib/cjs/serialization/GeometrySamples.d.ts +1 -1
- package/lib/cjs/serialization/GeometrySamples.d.ts.map +1 -1
- package/lib/cjs/serialization/GeometrySamples.js +3 -3
- package/lib/cjs/serialization/GeometrySamples.js.map +1 -1
- package/lib/cjs/serialization/IModelJsonSchema.d.ts +3 -3
- package/lib/cjs/serialization/IModelJsonSchema.d.ts.map +1 -1
- package/lib/cjs/serialization/IModelJsonSchema.js +5 -5
- package/lib/cjs/serialization/IModelJsonSchema.js.map +1 -1
- package/lib/cjs/solid/Box.d.ts.map +1 -1
- package/lib/cjs/solid/Box.js +7 -0
- package/lib/cjs/solid/Box.js.map +1 -1
- package/lib/cjs/solid/Cone.d.ts.map +1 -1
- package/lib/cjs/solid/Cone.js +6 -0
- package/lib/cjs/solid/Cone.js.map +1 -1
- package/lib/cjs/solid/LinearSweep.d.ts +2 -3
- package/lib/cjs/solid/LinearSweep.d.ts.map +1 -1
- package/lib/cjs/solid/LinearSweep.js +11 -7
- package/lib/cjs/solid/LinearSweep.js.map +1 -1
- package/lib/cjs/solid/RotationalSweep.d.ts +2 -2
- package/lib/cjs/solid/RotationalSweep.js +2 -2
- package/lib/cjs/solid/RotationalSweep.js.map +1 -1
- package/lib/cjs/solid/RuledSweep.d.ts +1 -1
- package/lib/cjs/solid/RuledSweep.d.ts.map +1 -1
- package/lib/cjs/solid/RuledSweep.js +5 -1
- package/lib/cjs/solid/RuledSweep.js.map +1 -1
- package/lib/cjs/solid/Sphere.d.ts.map +1 -1
- package/lib/cjs/solid/Sphere.js +6 -3
- package/lib/cjs/solid/Sphere.js.map +1 -1
- package/lib/cjs/solid/SweepContour.d.ts +1 -1
- package/lib/cjs/solid/SweepContour.js +1 -1
- package/lib/cjs/solid/SweepContour.js.map +1 -1
- package/lib/cjs/solid/TorusPipe.d.ts.map +1 -1
- package/lib/cjs/solid/TorusPipe.js +4 -0
- package/lib/cjs/solid/TorusPipe.js.map +1 -1
- package/lib/cjs/topology/ChainMerge.d.ts +1 -1
- package/lib/cjs/topology/ChainMerge.js +1 -1
- package/lib/cjs/topology/ChainMerge.js.map +1 -1
- package/lib/cjs/topology/Graph.d.ts +64 -14
- package/lib/cjs/topology/Graph.d.ts.map +1 -1
- package/lib/cjs/topology/Graph.js +149 -32
- package/lib/cjs/topology/Graph.js.map +1 -1
- package/lib/cjs/topology/HalfEdgeGraphSearch.d.ts +3 -2
- package/lib/cjs/topology/HalfEdgeGraphSearch.d.ts.map +1 -1
- package/lib/cjs/topology/HalfEdgeGraphSearch.js +3 -2
- package/lib/cjs/topology/HalfEdgeGraphSearch.js.map +1 -1
- package/lib/cjs/topology/Merging.d.ts +0 -1
- package/lib/cjs/topology/Merging.d.ts.map +1 -1
- package/lib/cjs/topology/Merging.js +49 -46
- package/lib/cjs/topology/Merging.js.map +1 -1
- package/lib/cjs/topology/RegularizeFace.d.ts.map +1 -1
- package/lib/cjs/topology/RegularizeFace.js +2 -1
- package/lib/cjs/topology/RegularizeFace.js.map +1 -1
- package/lib/cjs/topology/Triangulation.d.ts +9 -14
- package/lib/cjs/topology/Triangulation.d.ts.map +1 -1
- package/lib/cjs/topology/Triangulation.js +29 -22
- package/lib/cjs/topology/Triangulation.js.map +1 -1
- package/lib/esm/Geometry.d.ts +18 -10
- package/lib/esm/Geometry.d.ts.map +1 -1
- package/lib/esm/Geometry.js +13 -3
- package/lib/esm/Geometry.js.map +1 -1
- package/lib/esm/bspline/BSpline1dNd.d.ts +1 -1
- package/lib/esm/bspline/BSpline1dNd.js +1 -1
- package/lib/esm/bspline/BSpline1dNd.js.map +1 -1
- package/lib/esm/bspline/BSplineCurve.d.ts.map +1 -1
- package/lib/esm/bspline/BSplineCurve.js +7 -1
- package/lib/esm/bspline/BSplineCurve.js.map +1 -1
- package/lib/esm/bspline/BSplineSurface.d.ts +4 -3
- package/lib/esm/bspline/BSplineSurface.d.ts.map +1 -1
- package/lib/esm/bspline/BSplineSurface.js +4 -5
- package/lib/esm/bspline/BSplineSurface.js.map +1 -1
- package/lib/esm/clipping/ClipPlane.d.ts +7 -5
- package/lib/esm/clipping/ClipPlane.d.ts.map +1 -1
- package/lib/esm/clipping/ClipPlane.js +9 -5
- package/lib/esm/clipping/ClipPlane.js.map +1 -1
- package/lib/esm/clipping/ClipUtils.d.ts.map +1 -1
- package/lib/esm/clipping/ClipUtils.js +5 -3
- package/lib/esm/clipping/ClipUtils.js.map +1 -1
- package/lib/esm/clipping/ConvexClipPlaneSet.d.ts +1 -2
- package/lib/esm/clipping/ConvexClipPlaneSet.d.ts.map +1 -1
- package/lib/esm/clipping/ConvexClipPlaneSet.js +13 -25
- package/lib/esm/clipping/ConvexClipPlaneSet.js.map +1 -1
- package/lib/esm/clipping/UnionOfConvexClipPlaneSets.d.ts +1 -2
- package/lib/esm/clipping/UnionOfConvexClipPlaneSets.d.ts.map +1 -1
- package/lib/esm/clipping/UnionOfConvexClipPlaneSets.js +1 -2
- package/lib/esm/clipping/UnionOfConvexClipPlaneSets.js.map +1 -1
- package/lib/esm/core-geometry.d.ts +2 -0
- package/lib/esm/core-geometry.d.ts.map +1 -1
- package/lib/esm/core-geometry.js +2 -0
- package/lib/esm/core-geometry.js.map +1 -1
- package/lib/esm/curve/Arc3d.d.ts +54 -32
- package/lib/esm/curve/Arc3d.d.ts.map +1 -1
- package/lib/esm/curve/Arc3d.js +56 -37
- package/lib/esm/curve/Arc3d.js.map +1 -1
- package/lib/esm/curve/CurveCollection.d.ts +40 -1
- package/lib/esm/curve/CurveCollection.d.ts.map +1 -1
- package/lib/esm/curve/CurveCollection.js +90 -0
- package/lib/esm/curve/CurveCollection.js.map +1 -1
- package/lib/esm/curve/CurveFactory.d.ts +3 -2
- package/lib/esm/curve/CurveFactory.d.ts.map +1 -1
- package/lib/esm/curve/CurveFactory.js +6 -5
- package/lib/esm/curve/CurveFactory.js.map +1 -1
- package/lib/esm/curve/CurveLocationDetail.d.ts +27 -25
- package/lib/esm/curve/CurveLocationDetail.d.ts.map +1 -1
- package/lib/esm/curve/CurveLocationDetail.js +30 -25
- package/lib/esm/curve/CurveLocationDetail.js.map +1 -1
- package/lib/esm/curve/CurvePrimitive.d.ts +9 -2
- package/lib/esm/curve/CurvePrimitive.d.ts.map +1 -1
- package/lib/esm/curve/CurvePrimitive.js +11 -0
- package/lib/esm/curve/CurvePrimitive.js.map +1 -1
- package/lib/esm/curve/CurveTypes.d.ts +1 -1
- package/lib/esm/curve/CurveTypes.js.map +1 -1
- package/lib/esm/curve/LineSegment3d.d.ts +2 -0
- package/lib/esm/curve/LineSegment3d.d.ts.map +1 -1
- package/lib/esm/curve/LineSegment3d.js +4 -0
- package/lib/esm/curve/LineSegment3d.js.map +1 -1
- package/lib/esm/curve/LineString3d.d.ts +7 -0
- package/lib/esm/curve/LineString3d.d.ts.map +1 -1
- package/lib/esm/curve/LineString3d.js +15 -3
- package/lib/esm/curve/LineString3d.js.map +1 -1
- package/lib/esm/curve/Query/ConsolidateAdjacentPrimitivesContext.d.ts.map +1 -1
- package/lib/esm/curve/Query/ConsolidateAdjacentPrimitivesContext.js +37 -8
- package/lib/esm/curve/Query/ConsolidateAdjacentPrimitivesContext.js.map +1 -1
- package/lib/esm/curve/Query/PlanarSubdivision.d.ts +34 -8
- package/lib/esm/curve/Query/PlanarSubdivision.d.ts.map +1 -1
- package/lib/esm/curve/Query/PlanarSubdivision.js +131 -35
- package/lib/esm/curve/Query/PlanarSubdivision.js.map +1 -1
- package/lib/esm/curve/Query/StrokeCountChain.d.ts +4 -3
- package/lib/esm/curve/Query/StrokeCountChain.d.ts.map +1 -1
- package/lib/esm/curve/Query/StrokeCountChain.js +20 -9
- package/lib/esm/curve/Query/StrokeCountChain.js.map +1 -1
- package/lib/esm/curve/RegionMomentsXY.d.ts +2 -1
- package/lib/esm/curve/RegionMomentsXY.d.ts.map +1 -1
- package/lib/esm/curve/RegionMomentsXY.js +26 -41
- package/lib/esm/curve/RegionMomentsXY.js.map +1 -1
- package/lib/esm/curve/RegionOps.d.ts +74 -39
- package/lib/esm/curve/RegionOps.d.ts.map +1 -1
- package/lib/esm/curve/RegionOps.js +146 -46
- package/lib/esm/curve/RegionOps.js.map +1 -1
- package/lib/esm/curve/RegionOpsClassificationSweeps.d.ts +36 -27
- package/lib/esm/curve/RegionOpsClassificationSweeps.d.ts.map +1 -1
- package/lib/esm/curve/RegionOpsClassificationSweeps.js +161 -56
- package/lib/esm/curve/RegionOpsClassificationSweeps.js.map +1 -1
- package/lib/esm/curve/StrokeOptions.d.ts +1 -1
- package/lib/esm/curve/StrokeOptions.js +1 -1
- package/lib/esm/curve/StrokeOptions.js.map +1 -1
- package/lib/esm/curve/internalContexts/AnnounceTangentStrokeHandler.js.map +1 -1
- package/lib/esm/curve/internalContexts/CurveCurveCloseApproachXY.d.ts +2 -2
- package/lib/esm/curve/internalContexts/CurveCurveCloseApproachXY.js +6 -6
- package/lib/esm/curve/internalContexts/CurveCurveCloseApproachXY.js.map +1 -1
- package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.d.ts +0 -1
- package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.d.ts.map +1 -1
- package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.js +58 -32
- package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.js.map +1 -1
- package/lib/esm/curve/internalContexts/PolygonOffsetContext.d.ts.map +1 -1
- package/lib/esm/curve/internalContexts/PolygonOffsetContext.js +0 -1
- package/lib/esm/curve/internalContexts/PolygonOffsetContext.js.map +1 -1
- package/lib/esm/curve/internalContexts/TransferWithSplitArcs.d.ts +14 -0
- package/lib/esm/curve/internalContexts/TransferWithSplitArcs.d.ts.map +1 -0
- package/lib/esm/curve/internalContexts/TransferWithSplitArcs.js +30 -0
- package/lib/esm/curve/internalContexts/TransferWithSplitArcs.js.map +1 -0
- package/lib/esm/geometry3d/AngleSweep.d.ts +25 -18
- package/lib/esm/geometry3d/AngleSweep.d.ts.map +1 -1
- package/lib/esm/geometry3d/AngleSweep.js +32 -18
- package/lib/esm/geometry3d/AngleSweep.js.map +1 -1
- package/lib/esm/geometry3d/CoincidentGeometryOps.d.ts +8 -7
- package/lib/esm/geometry3d/CoincidentGeometryOps.d.ts.map +1 -1
- package/lib/esm/geometry3d/CoincidentGeometryOps.js +19 -25
- package/lib/esm/geometry3d/CoincidentGeometryOps.js.map +1 -1
- package/lib/esm/geometry3d/Ellipsoid.js +1 -1
- package/lib/esm/geometry3d/Ellipsoid.js.map +1 -1
- package/lib/esm/geometry3d/GrowableXYArray.d.ts +1 -1
- package/lib/esm/geometry3d/GrowableXYArray.js +1 -1
- package/lib/esm/geometry3d/GrowableXYArray.js.map +1 -1
- package/lib/esm/geometry3d/GrowableXYZArray.d.ts +8 -3
- package/lib/esm/geometry3d/GrowableXYZArray.d.ts.map +1 -1
- package/lib/esm/geometry3d/GrowableXYZArray.js +21 -3
- package/lib/esm/geometry3d/GrowableXYZArray.js.map +1 -1
- package/lib/esm/geometry3d/IndexedXYZCollection.d.ts +11 -1
- package/lib/esm/geometry3d/IndexedXYZCollection.d.ts.map +1 -1
- package/lib/esm/geometry3d/IndexedXYZCollection.js +21 -3
- package/lib/esm/geometry3d/IndexedXYZCollection.js.map +1 -1
- package/lib/esm/geometry3d/Plane3d.d.ts +2 -0
- package/lib/esm/geometry3d/Plane3d.d.ts.map +1 -1
- package/lib/esm/geometry3d/Plane3d.js +6 -1
- package/lib/esm/geometry3d/Plane3d.js.map +1 -1
- package/lib/esm/geometry3d/Plane3dByOriginAndUnitNormal.d.ts +2 -0
- package/lib/esm/geometry3d/Plane3dByOriginAndUnitNormal.d.ts.map +1 -1
- package/lib/esm/geometry3d/Plane3dByOriginAndUnitNormal.js +6 -1
- package/lib/esm/geometry3d/Plane3dByOriginAndUnitNormal.js.map +1 -1
- package/lib/esm/geometry3d/Plane3dByOriginAndVectors.d.ts +8 -2
- package/lib/esm/geometry3d/Plane3dByOriginAndVectors.d.ts.map +1 -1
- package/lib/esm/geometry3d/Plane3dByOriginAndVectors.js +18 -10
- package/lib/esm/geometry3d/Plane3dByOriginAndVectors.js.map +1 -1
- package/lib/esm/geometry3d/Point2dVector2d.d.ts.map +1 -1
- package/lib/esm/geometry3d/Point2dVector2d.js +0 -2
- package/lib/esm/geometry3d/Point2dVector2d.js.map +1 -1
- package/lib/esm/geometry3d/Point3dVector3d.d.ts +4 -4
- package/lib/esm/geometry3d/Point3dVector3d.d.ts.map +1 -1
- package/lib/esm/geometry3d/Point3dVector3d.js +4 -5
- package/lib/esm/geometry3d/Point3dVector3d.js.map +1 -1
- package/lib/esm/geometry3d/PointHelpers.d.ts +7 -7
- package/lib/esm/geometry3d/PointHelpers.d.ts.map +1 -1
- package/lib/esm/geometry3d/PointHelpers.js +66 -26
- package/lib/esm/geometry3d/PointHelpers.js.map +1 -1
- package/lib/esm/geometry3d/PolygonOps.d.ts +49 -2
- package/lib/esm/geometry3d/PolygonOps.d.ts.map +1 -1
- package/lib/esm/geometry3d/PolygonOps.js +38 -2
- package/lib/esm/geometry3d/PolygonOps.js.map +1 -1
- package/lib/esm/geometry3d/PolylineCompressionByEdgeOffset.d.ts +13 -6
- package/lib/esm/geometry3d/PolylineCompressionByEdgeOffset.d.ts.map +1 -1
- package/lib/esm/geometry3d/PolylineCompressionByEdgeOffset.js +16 -9
- package/lib/esm/geometry3d/PolylineCompressionByEdgeOffset.js.map +1 -1
- package/lib/esm/geometry3d/PolylineOps.d.ts +5 -4
- package/lib/esm/geometry3d/PolylineOps.d.ts.map +1 -1
- package/lib/esm/geometry3d/PolylineOps.js +5 -4
- package/lib/esm/geometry3d/PolylineOps.js.map +1 -1
- package/lib/esm/geometry3d/Range.d.ts +18 -10
- package/lib/esm/geometry3d/Range.d.ts.map +1 -1
- package/lib/esm/geometry3d/Range.js +32 -10
- package/lib/esm/geometry3d/Range.js.map +1 -1
- package/lib/esm/geometry3d/Ray2d.d.ts.map +1 -1
- package/lib/esm/geometry3d/Ray2d.js +0 -1
- package/lib/esm/geometry3d/Ray2d.js.map +1 -1
- package/lib/esm/geometry3d/Ray3d.d.ts +7 -9
- package/lib/esm/geometry3d/Ray3d.d.ts.map +1 -1
- package/lib/esm/geometry3d/Ray3d.js +23 -45
- package/lib/esm/geometry3d/Ray3d.js.map +1 -1
- package/lib/esm/geometry3d/ReusableObjectCache.d.ts +39 -29
- package/lib/esm/geometry3d/ReusableObjectCache.d.ts.map +1 -1
- package/lib/esm/geometry3d/ReusableObjectCache.js +47 -33
- package/lib/esm/geometry3d/ReusableObjectCache.js.map +1 -1
- package/lib/esm/geometry3d/SortablePolygon.d.ts +1 -4
- package/lib/esm/geometry3d/SortablePolygon.d.ts.map +1 -1
- package/lib/esm/geometry3d/SortablePolygon.js +48 -43
- package/lib/esm/geometry3d/SortablePolygon.js.map +1 -1
- package/lib/esm/geometry3d/Transform.d.ts +21 -2
- package/lib/esm/geometry3d/Transform.d.ts.map +1 -1
- package/lib/esm/geometry3d/Transform.js +32 -13
- package/lib/esm/geometry3d/Transform.js.map +1 -1
- package/lib/esm/geometry4d/Point4d.d.ts +8 -5
- package/lib/esm/geometry4d/Point4d.d.ts.map +1 -1
- package/lib/esm/geometry4d/Point4d.js +27 -16
- package/lib/esm/geometry4d/Point4d.js.map +1 -1
- package/lib/esm/numerics/BezierPolynomials.d.ts +2 -0
- package/lib/esm/numerics/BezierPolynomials.d.ts.map +1 -1
- package/lib/esm/numerics/BezierPolynomials.js +11 -0
- package/lib/esm/numerics/BezierPolynomials.js.map +1 -1
- package/lib/esm/numerics/SmallSystem.d.ts +77 -36
- package/lib/esm/numerics/SmallSystem.d.ts.map +1 -1
- package/lib/esm/numerics/SmallSystem.js +129 -73
- package/lib/esm/numerics/SmallSystem.js.map +1 -1
- package/lib/esm/polyface/FacetOrientation.d.ts +1 -1
- package/lib/esm/polyface/FacetOrientation.js +1 -1
- package/lib/esm/polyface/FacetOrientation.js.map +1 -1
- package/lib/esm/polyface/IndexedEdgeMatcher.d.ts +55 -40
- package/lib/esm/polyface/IndexedEdgeMatcher.d.ts.map +1 -1
- package/lib/esm/polyface/IndexedEdgeMatcher.js +83 -75
- package/lib/esm/polyface/IndexedEdgeMatcher.js.map +1 -1
- package/lib/esm/polyface/IndexedPolyfaceVisitor.d.ts +15 -14
- package/lib/esm/polyface/IndexedPolyfaceVisitor.d.ts.map +1 -1
- package/lib/esm/polyface/IndexedPolyfaceVisitor.js +47 -38
- package/lib/esm/polyface/IndexedPolyfaceVisitor.js.map +1 -1
- package/lib/esm/polyface/IndexedPolyfaceWalker.d.ts +26 -19
- package/lib/esm/polyface/IndexedPolyfaceWalker.d.ts.map +1 -1
- package/lib/esm/polyface/IndexedPolyfaceWalker.js +51 -32
- package/lib/esm/polyface/IndexedPolyfaceWalker.js.map +1 -1
- package/lib/esm/polyface/Polyface.d.ts +19 -5
- package/lib/esm/polyface/Polyface.d.ts.map +1 -1
- package/lib/esm/polyface/Polyface.js +18 -2
- package/lib/esm/polyface/Polyface.js.map +1 -1
- package/lib/esm/polyface/PolyfaceBuilder.d.ts +1 -1
- package/lib/esm/polyface/PolyfaceBuilder.js +6 -6
- package/lib/esm/polyface/PolyfaceBuilder.js.map +1 -1
- package/lib/esm/polyface/PolyfaceClip.d.ts +19 -18
- package/lib/esm/polyface/PolyfaceClip.d.ts.map +1 -1
- package/lib/esm/polyface/PolyfaceClip.js +39 -42
- package/lib/esm/polyface/PolyfaceClip.js.map +1 -1
- package/lib/esm/polyface/PolyfaceData.d.ts +1 -1
- package/lib/esm/polyface/PolyfaceData.js +1 -1
- package/lib/esm/polyface/PolyfaceData.js.map +1 -1
- package/lib/esm/polyface/PolyfaceQuery.d.ts +119 -78
- package/lib/esm/polyface/PolyfaceQuery.d.ts.map +1 -1
- package/lib/esm/polyface/PolyfaceQuery.js +316 -232
- package/lib/esm/polyface/PolyfaceQuery.js.map +1 -1
- package/lib/esm/polyface/RangeTree/RangeTreeNode.d.ts +3 -3
- package/lib/esm/polyface/RangeTree/RangeTreeNode.d.ts.map +1 -1
- package/lib/esm/polyface/RangeTree/RangeTreeNode.js +3 -3
- package/lib/esm/polyface/RangeTree/RangeTreeNode.js.map +1 -1
- package/lib/esm/polyface/multiclip/SweepLineStringToFacetContext.d.ts +7 -6
- package/lib/esm/polyface/multiclip/SweepLineStringToFacetContext.d.ts.map +1 -1
- package/lib/esm/polyface/multiclip/SweepLineStringToFacetContext.js +8 -9
- package/lib/esm/polyface/multiclip/SweepLineStringToFacetContext.js.map +1 -1
- package/lib/esm/serialization/BGFBReader.d.ts.map +1 -1
- package/lib/esm/serialization/BGFBReader.js +2 -3
- package/lib/esm/serialization/BGFBReader.js.map +1 -1
- package/lib/esm/serialization/BGFBWriter.d.ts.map +1 -1
- package/lib/esm/serialization/BGFBWriter.js +2 -4
- package/lib/esm/serialization/BGFBWriter.js.map +1 -1
- package/lib/esm/serialization/GeometrySamples.d.ts +1 -1
- package/lib/esm/serialization/GeometrySamples.d.ts.map +1 -1
- package/lib/esm/serialization/GeometrySamples.js +3 -3
- package/lib/esm/serialization/GeometrySamples.js.map +1 -1
- package/lib/esm/serialization/IModelJsonSchema.d.ts +3 -3
- package/lib/esm/serialization/IModelJsonSchema.d.ts.map +1 -1
- package/lib/esm/serialization/IModelJsonSchema.js +5 -5
- package/lib/esm/serialization/IModelJsonSchema.js.map +1 -1
- package/lib/esm/solid/Box.d.ts.map +1 -1
- package/lib/esm/solid/Box.js +7 -0
- package/lib/esm/solid/Box.js.map +1 -1
- package/lib/esm/solid/Cone.d.ts.map +1 -1
- package/lib/esm/solid/Cone.js +6 -0
- package/lib/esm/solid/Cone.js.map +1 -1
- package/lib/esm/solid/LinearSweep.d.ts +2 -3
- package/lib/esm/solid/LinearSweep.d.ts.map +1 -1
- package/lib/esm/solid/LinearSweep.js +11 -7
- package/lib/esm/solid/LinearSweep.js.map +1 -1
- package/lib/esm/solid/RotationalSweep.d.ts +2 -2
- package/lib/esm/solid/RotationalSweep.js +2 -2
- package/lib/esm/solid/RotationalSweep.js.map +1 -1
- package/lib/esm/solid/RuledSweep.d.ts +1 -1
- package/lib/esm/solid/RuledSweep.d.ts.map +1 -1
- package/lib/esm/solid/RuledSweep.js +5 -1
- package/lib/esm/solid/RuledSweep.js.map +1 -1
- package/lib/esm/solid/Sphere.d.ts.map +1 -1
- package/lib/esm/solid/Sphere.js +6 -3
- package/lib/esm/solid/Sphere.js.map +1 -1
- package/lib/esm/solid/SweepContour.d.ts +1 -1
- package/lib/esm/solid/SweepContour.js +1 -1
- package/lib/esm/solid/SweepContour.js.map +1 -1
- package/lib/esm/solid/TorusPipe.d.ts.map +1 -1
- package/lib/esm/solid/TorusPipe.js +4 -0
- package/lib/esm/solid/TorusPipe.js.map +1 -1
- package/lib/esm/topology/ChainMerge.d.ts +1 -1
- package/lib/esm/topology/ChainMerge.js +1 -1
- package/lib/esm/topology/ChainMerge.js.map +1 -1
- package/lib/esm/topology/Graph.d.ts +64 -14
- package/lib/esm/topology/Graph.d.ts.map +1 -1
- package/lib/esm/topology/Graph.js +149 -32
- package/lib/esm/topology/Graph.js.map +1 -1
- package/lib/esm/topology/HalfEdgeGraphSearch.d.ts +3 -2
- package/lib/esm/topology/HalfEdgeGraphSearch.d.ts.map +1 -1
- package/lib/esm/topology/HalfEdgeGraphSearch.js +3 -2
- package/lib/esm/topology/HalfEdgeGraphSearch.js.map +1 -1
- package/lib/esm/topology/Merging.d.ts +0 -1
- package/lib/esm/topology/Merging.d.ts.map +1 -1
- package/lib/esm/topology/Merging.js +49 -46
- package/lib/esm/topology/Merging.js.map +1 -1
- package/lib/esm/topology/RegularizeFace.d.ts.map +1 -1
- package/lib/esm/topology/RegularizeFace.js +2 -1
- package/lib/esm/topology/RegularizeFace.js.map +1 -1
- package/lib/esm/topology/Triangulation.d.ts +9 -14
- package/lib/esm/topology/Triangulation.d.ts.map +1 -1
- package/lib/esm/topology/Triangulation.js +29 -22
- package/lib/esm/topology/Triangulation.js.map +1 -1
- package/package.json +7 -6
|
@@ -43,36 +43,37 @@ export declare class PolyfaceClip {
|
|
|
43
43
|
* * Return all surviving clip as a new mesh.
|
|
44
44
|
* * WARNING: The new mesh is "points only" -- parameters, normals, etc are not interpolated
|
|
45
45
|
*/
|
|
46
|
-
static clipPolyfaceClipPlaneWithClosureFace(
|
|
46
|
+
static clipPolyfaceClipPlaneWithClosureFace(source: Polyface | PolyfaceVisitor, clipper: ClipPlane, insideClip?: boolean, buildClosureFaces?: boolean): IndexedPolyface;
|
|
47
47
|
/** Clip each facet of polyface to the ClipPlane.
|
|
48
48
|
* * Return all surviving clip as a new mesh.
|
|
49
49
|
* * WARNING: The new mesh is "points only" -- parameters, normals, etc are not interpolated
|
|
50
50
|
*/
|
|
51
|
-
static clipPolyfaceClipPlane(
|
|
52
|
-
/**
|
|
53
|
-
*
|
|
51
|
+
static clipPolyfaceClipPlane(source: Polyface | PolyfaceVisitor, clipper: ClipPlane, insideClip?: boolean, buildClosureFaces?: boolean): IndexedPolyface;
|
|
52
|
+
/**
|
|
53
|
+
* Clip each facet to the clipper.
|
|
54
|
+
* * Return surviving facets as a new mesh.
|
|
54
55
|
* * WARNING: The new mesh is "points only".
|
|
55
56
|
*/
|
|
56
|
-
static clipPolyfaceConvexClipPlaneSet(
|
|
57
|
-
/** Clip each facet
|
|
57
|
+
static clipPolyfaceConvexClipPlaneSet(source: Polyface | PolyfaceVisitor, clipper: ConvexClipPlaneSet): IndexedPolyface;
|
|
58
|
+
/** Clip each facet to the clippers.
|
|
58
59
|
* * Add inside, outside fragments to builderA, builderB
|
|
59
60
|
* * This does not consider params, normals, colors. Just points.
|
|
60
61
|
* * outputSelect determines how the clip output is structured
|
|
61
62
|
* * 0 outputs all shards -- this may have many interior edges.
|
|
62
63
|
* * 1 stitches shards together to get cleaner facets.
|
|
63
64
|
*/
|
|
64
|
-
static clipPolyfaceUnionOfConvexClipPlaneSetsToBuilders(
|
|
65
|
+
static clipPolyfaceUnionOfConvexClipPlaneSetsToBuilders(source: Polyface | PolyfaceVisitor, allClippers: UnionOfConvexClipPlaneSets, destination: ClippedPolyfaceBuilders, outputSelector?: number): void;
|
|
65
66
|
private static addRegion;
|
|
66
67
|
private static cleanupAndAddRegion;
|
|
67
68
|
private static addPolygonToBuilderAndDropToCache;
|
|
68
69
|
private static addPolygonArrayToBuilderAndDropToCache;
|
|
69
70
|
private static createChainContextsForConvexClipPlaneSet;
|
|
70
|
-
/** Clip each facet
|
|
71
|
+
/** Clip each facet to the clippers.
|
|
71
72
|
* * Add inside, outside fragments to builderA, builderB
|
|
72
73
|
* * This does not consider params, normals, colors. Just points.
|
|
73
74
|
* @internal
|
|
74
75
|
*/
|
|
75
|
-
static clipPolyfaceConvexClipPlaneSetToBuilders(
|
|
76
|
+
static clipPolyfaceConvexClipPlaneSetToBuilders(source: Polyface | PolyfaceVisitor, clipper: ConvexClipPlaneSet, destination: ClippedPolyfaceBuilders): void;
|
|
76
77
|
/**
|
|
77
78
|
*
|
|
78
79
|
* @param visitor visitor for all facets of interest (entire polyface)
|
|
@@ -102,26 +103,26 @@ export declare class PolyfaceClip {
|
|
|
102
103
|
* @param destination
|
|
103
104
|
*/
|
|
104
105
|
private static addClosureFacets;
|
|
105
|
-
/** Clip each facet
|
|
106
|
+
/** Clip each facet to the clippers.
|
|
106
107
|
* * Add inside, outside fragments to builderA, builderB
|
|
107
108
|
* * This does not consider params, normals, colors. Just points.
|
|
108
109
|
* @internal
|
|
109
110
|
*/
|
|
110
|
-
static clipPolyfaceClipPlaneToBuilders(
|
|
111
|
-
/** Clip each facet
|
|
111
|
+
static clipPolyfaceClipPlaneToBuilders(source: Polyface | PolyfaceVisitor, clipper: PlaneAltitudeEvaluator, destination: ClippedPolyfaceBuilders): void;
|
|
112
|
+
/** Clip each facet to the clipper.
|
|
112
113
|
* * accumulate inside and outside facets -- to destination.builderA and destination.builderB
|
|
113
|
-
* * if `destination.buildClosureFaces` is set,
|
|
114
|
-
* * This method parses
|
|
114
|
+
* * if `destination.buildClosureFaces` is set, also build closure facets.
|
|
115
|
+
* * This method parses the variant input types and calls a more specific method.
|
|
115
116
|
* * WARNING: The new mesh is "points only".
|
|
116
117
|
* * outputSelect applies only for UnionOfConvexClipPlaneSets -- see [[PolyfaceClip.clipPolyfaceUnionOfConvexClipPlaneSetsToBuilders]]
|
|
117
118
|
*/
|
|
118
|
-
static clipPolyfaceInsideOutside(
|
|
119
|
-
/** Clip each facet
|
|
119
|
+
static clipPolyfaceInsideOutside(source: Polyface | PolyfaceVisitor, clipper: ClipPlane | ConvexClipPlaneSet | UnionOfConvexClipPlaneSets, destination: ClippedPolyfaceBuilders, outputSelect?: number): void;
|
|
120
|
+
/** Clip each facet to the clipper.
|
|
120
121
|
* * This method parses the variant input types and calls a more specific method.
|
|
121
122
|
* * To get both inside and outside parts, use clipPolyfaceInsideOutside
|
|
122
123
|
* * WARNING: The new mesh is "points only".
|
|
123
124
|
*/
|
|
124
|
-
static clipPolyface(
|
|
125
|
+
static clipPolyface(source: Polyface | PolyfaceVisitor, clipper: ClipPlane | ConvexClipPlaneSet): Polyface | undefined;
|
|
125
126
|
/**
|
|
126
127
|
* Drape the region onto the mesh.
|
|
127
128
|
* * This method computes the portion of the input mesh that lies inside the clipper generated from sweeping the input region in the given direction.
|
|
@@ -142,7 +143,7 @@ export declare class PolyfaceClip {
|
|
|
142
143
|
/** Intersect each facet with the clip plane. (Producing intersection edges.)
|
|
143
144
|
* * Return all edges chained as array of LineString3d.
|
|
144
145
|
*/
|
|
145
|
-
static sectionPolyfaceClipPlane(
|
|
146
|
+
static sectionPolyfaceClipPlane(source: Polyface | PolyfaceVisitor, clipper: ClipPlane): LineString3d[];
|
|
146
147
|
/**
|
|
147
148
|
* * Split facets of mesh "A" into parts that are
|
|
148
149
|
* * under mesh "B"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PolyfaceClip.d.ts","sourceRoot":"","sources":["../../../src/polyface/PolyfaceClip.ts"],"names":[],"mappings":"AAUA,OAAO,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AE,QAAQ,EAAE,OAAO,CAAC,EAAE,aAAa,GAAG,eAAe,GAAG,SAAS;IAgB5J;;;;;MAKE;IACF,OAAO,CAAC,MAAM,CAAC,mBAAmB;IAYlC;;OAEG;WACW,wBAAwB,CAAC,MAAM,EAAE,QAAQ,GAAG,eAAe,EAAE,OAAO,EAAE,SAAS,GAAG,YAAY,EAAE;IAe9G;;;;;;;;;;;;;;OAcG;WACW,+CAA+C,CAAC,QAAQ,EAAE,eAAe,EAAE,QAAQ,EAAE,eAAe,EAAE,cAAc,EAAE,eAAe,GAAG,SAAS,EAAE,aAAa,EAAE,eAAe,GAAG,SAAS,GAAG,IAAI;IAsClN;;;;;;;;;;;;;;;;OAgBG;WACW,cAAc,CAAC,KAAK,EAAE,eAAe,EAAE,KAAK,EAAE,eAAe,GAAG;QAAE,WAAW,EAAE,eAAe,CAAC;QAAC,UAAU,EAAE,eAAe,CAAA;KAAE;CAe5I"}
|
|
@@ -91,24 +91,26 @@ export class PolyfaceClip {
|
|
|
91
91
|
* * Return all surviving clip as a new mesh.
|
|
92
92
|
* * WARNING: The new mesh is "points only" -- parameters, normals, etc are not interpolated
|
|
93
93
|
*/
|
|
94
|
-
static clipPolyfaceClipPlaneWithClosureFace(
|
|
95
|
-
return this.clipPolyfaceClipPlane(
|
|
94
|
+
static clipPolyfaceClipPlaneWithClosureFace(source, clipper, insideClip = true, buildClosureFaces = true) {
|
|
95
|
+
return this.clipPolyfaceClipPlane(source, clipper, insideClip, buildClosureFaces);
|
|
96
96
|
}
|
|
97
97
|
/** Clip each facet of polyface to the ClipPlane.
|
|
98
98
|
* * Return all surviving clip as a new mesh.
|
|
99
99
|
* * WARNING: The new mesh is "points only" -- parameters, normals, etc are not interpolated
|
|
100
100
|
*/
|
|
101
|
-
static clipPolyfaceClipPlane(
|
|
101
|
+
static clipPolyfaceClipPlane(source, clipper, insideClip = true, buildClosureFaces = false) {
|
|
102
102
|
const builders = ClippedPolyfaceBuilders.create(insideClip, !insideClip, buildClosureFaces);
|
|
103
|
-
this.clipPolyfaceInsideOutside(
|
|
103
|
+
this.clipPolyfaceInsideOutside(source, clipper, builders);
|
|
104
104
|
return builders.claimPolyface(insideClip ? 0 : 1, true);
|
|
105
105
|
}
|
|
106
|
-
/**
|
|
107
|
-
*
|
|
106
|
+
/**
|
|
107
|
+
* Clip each facet to the clipper.
|
|
108
|
+
* * Return surviving facets as a new mesh.
|
|
108
109
|
* * WARNING: The new mesh is "points only".
|
|
109
110
|
*/
|
|
110
|
-
static clipPolyfaceConvexClipPlaneSet(
|
|
111
|
-
const visitor =
|
|
111
|
+
static clipPolyfaceConvexClipPlaneSet(source, clipper) {
|
|
112
|
+
const visitor = source instanceof Polyface ? source.createVisitor(0) : source;
|
|
113
|
+
visitor.setNumWrap(0);
|
|
112
114
|
const builder = PolyfaceBuilder.create();
|
|
113
115
|
const work = new GrowableXYZArray(10);
|
|
114
116
|
for (visitor.reset(); visitor.moveToNextFacet();) {
|
|
@@ -118,21 +120,18 @@ export class PolyfaceClip {
|
|
|
118
120
|
}
|
|
119
121
|
return builder.claimPolyface(true);
|
|
120
122
|
}
|
|
121
|
-
/** Clip each facet
|
|
123
|
+
/** Clip each facet to the clippers.
|
|
122
124
|
* * Add inside, outside fragments to builderA, builderB
|
|
123
125
|
* * This does not consider params, normals, colors. Just points.
|
|
124
126
|
* * outputSelect determines how the clip output is structured
|
|
125
127
|
* * 0 outputs all shards -- this may have many interior edges.
|
|
126
128
|
* * 1 stitches shards together to get cleaner facets.
|
|
127
129
|
*/
|
|
128
|
-
static clipPolyfaceUnionOfConvexClipPlaneSetsToBuilders(
|
|
129
|
-
if (polyface instanceof Polyface) {
|
|
130
|
-
this.clipPolyfaceUnionOfConvexClipPlaneSetsToBuilders(polyface.createVisitor(0), allClippers, destination, outputSelector);
|
|
131
|
-
return;
|
|
132
|
-
}
|
|
130
|
+
static clipPolyfaceUnionOfConvexClipPlaneSetsToBuilders(source, allClippers, destination, outputSelector = 1) {
|
|
133
131
|
const builderA = destination.builderA;
|
|
134
132
|
const builderB = destination.builderB;
|
|
135
|
-
const visitor =
|
|
133
|
+
const visitor = source instanceof Polyface ? source.createVisitor(0) : source;
|
|
134
|
+
visitor.setNumWrap(0);
|
|
136
135
|
const cache = new GrowableXYZArrayCache();
|
|
137
136
|
const insideShards = [];
|
|
138
137
|
const outsideShards = [];
|
|
@@ -263,24 +262,23 @@ export class PolyfaceClip {
|
|
|
263
262
|
}
|
|
264
263
|
return chainContexts;
|
|
265
264
|
}
|
|
266
|
-
/** Clip each facet
|
|
265
|
+
/** Clip each facet to the clippers.
|
|
267
266
|
* * Add inside, outside fragments to builderA, builderB
|
|
268
267
|
* * This does not consider params, normals, colors. Just points.
|
|
269
268
|
* @internal
|
|
270
269
|
*/
|
|
271
|
-
static clipPolyfaceConvexClipPlaneSetToBuilders(
|
|
270
|
+
static clipPolyfaceConvexClipPlaneSetToBuilders(source, clipper, destination) {
|
|
272
271
|
const builderA = destination.builderA;
|
|
273
272
|
const builderB = destination.builderB;
|
|
274
|
-
const visitor =
|
|
273
|
+
const visitor = source instanceof Polyface ? source.createVisitor(0) : source;
|
|
274
|
+
visitor.setNumWrap(0);
|
|
275
275
|
const cache = new GrowableXYZArrayCache();
|
|
276
276
|
const outsideParts = [];
|
|
277
277
|
for (visitor.reset(); visitor.moveToNextFacet();) {
|
|
278
|
-
// !!! currentCandidates and next candidates are empty at this point !!!
|
|
279
278
|
const insidePart = clipper.clipInsidePushOutside(visitor.point, outsideParts, cache);
|
|
280
279
|
if (insidePart === undefined) {
|
|
281
280
|
// everything is out ... outsideParts might be fragmented. Save only the original polygon
|
|
282
281
|
builderB?.addPolygonGrowableXYZArray(visitor.point);
|
|
283
|
-
cache.dropToCache(insidePart);
|
|
284
282
|
cache.dropAllToCache(outsideParts);
|
|
285
283
|
}
|
|
286
284
|
this.addPolygonToBuilderAndDropToCache(insidePart, builderA, cache);
|
|
@@ -416,15 +414,16 @@ export class PolyfaceClip {
|
|
|
416
414
|
}
|
|
417
415
|
}
|
|
418
416
|
}
|
|
419
|
-
/** Clip each facet
|
|
417
|
+
/** Clip each facet to the clippers.
|
|
420
418
|
* * Add inside, outside fragments to builderA, builderB
|
|
421
419
|
* * This does not consider params, normals, colors. Just points.
|
|
422
420
|
* @internal
|
|
423
421
|
*/
|
|
424
|
-
static clipPolyfaceClipPlaneToBuilders(
|
|
422
|
+
static clipPolyfaceClipPlaneToBuilders(source, clipper, destination) {
|
|
425
423
|
const builderA = destination.builderA;
|
|
426
424
|
const builderB = destination.builderB;
|
|
427
|
-
const visitor =
|
|
425
|
+
const visitor = source instanceof Polyface ? source.createVisitor(0) : source;
|
|
426
|
+
visitor.setNumWrap(0);
|
|
428
427
|
const cache = new GrowableXYZArrayCache();
|
|
429
428
|
const inside = cache.grabFromCache();
|
|
430
429
|
const outside = cache.grabFromCache();
|
|
@@ -441,34 +440,31 @@ export class PolyfaceClip {
|
|
|
441
440
|
cache.dropToCache(inside);
|
|
442
441
|
cache.dropToCache(outside);
|
|
443
442
|
}
|
|
444
|
-
/** Clip each facet
|
|
443
|
+
/** Clip each facet to the clipper.
|
|
445
444
|
* * accumulate inside and outside facets -- to destination.builderA and destination.builderB
|
|
446
|
-
* * if `destination.buildClosureFaces` is set,
|
|
447
|
-
* * This method parses
|
|
445
|
+
* * if `destination.buildClosureFaces` is set, also build closure facets.
|
|
446
|
+
* * This method parses the variant input types and calls a more specific method.
|
|
448
447
|
* * WARNING: The new mesh is "points only".
|
|
449
448
|
* * outputSelect applies only for UnionOfConvexClipPlaneSets -- see [[PolyfaceClip.clipPolyfaceUnionOfConvexClipPlaneSetsToBuilders]]
|
|
450
449
|
*/
|
|
451
|
-
static clipPolyfaceInsideOutside(
|
|
452
|
-
if (clipper instanceof ClipPlane)
|
|
453
|
-
this.clipPolyfaceClipPlaneToBuilders(
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
else if (clipper instanceof UnionOfConvexClipPlaneSets) {
|
|
459
|
-
this.clipPolyfaceUnionOfConvexClipPlaneSetsToBuilders(polyface, clipper, destination, outputSelect);
|
|
460
|
-
}
|
|
450
|
+
static clipPolyfaceInsideOutside(source, clipper, destination, outputSelect = 0) {
|
|
451
|
+
if (clipper instanceof ClipPlane)
|
|
452
|
+
this.clipPolyfaceClipPlaneToBuilders(source, clipper, destination);
|
|
453
|
+
else if (clipper instanceof ConvexClipPlaneSet)
|
|
454
|
+
this.clipPolyfaceConvexClipPlaneSetToBuilders(source, clipper, destination);
|
|
455
|
+
else if (clipper instanceof UnionOfConvexClipPlaneSets)
|
|
456
|
+
this.clipPolyfaceUnionOfConvexClipPlaneSetsToBuilders(source, clipper, destination, outputSelect);
|
|
461
457
|
}
|
|
462
|
-
/** Clip each facet
|
|
458
|
+
/** Clip each facet to the clipper.
|
|
463
459
|
* * This method parses the variant input types and calls a more specific method.
|
|
464
460
|
* * To get both inside and outside parts, use clipPolyfaceInsideOutside
|
|
465
461
|
* * WARNING: The new mesh is "points only".
|
|
466
462
|
*/
|
|
467
|
-
static clipPolyface(
|
|
463
|
+
static clipPolyface(source, clipper) {
|
|
468
464
|
if (clipper instanceof ClipPlane)
|
|
469
|
-
return this.clipPolyfaceClipPlane(
|
|
465
|
+
return this.clipPolyfaceClipPlane(source, clipper);
|
|
470
466
|
if (clipper instanceof ConvexClipPlaneSet)
|
|
471
|
-
return this.clipPolyfaceConvexClipPlaneSet(
|
|
467
|
+
return this.clipPolyfaceConvexClipPlaneSet(source, clipper);
|
|
472
468
|
// (The if tests exhaust the type space -- this line is unreachable.)
|
|
473
469
|
return undefined;
|
|
474
470
|
}
|
|
@@ -518,9 +514,10 @@ export class PolyfaceClip {
|
|
|
518
514
|
/** Intersect each facet with the clip plane. (Producing intersection edges.)
|
|
519
515
|
* * Return all edges chained as array of LineString3d.
|
|
520
516
|
*/
|
|
521
|
-
static sectionPolyfaceClipPlane(
|
|
517
|
+
static sectionPolyfaceClipPlane(source, clipper) {
|
|
522
518
|
const chainContext = ChainMergeContext.create();
|
|
523
|
-
const visitor =
|
|
519
|
+
const visitor = source instanceof Polyface ? source.createVisitor(0) : source;
|
|
520
|
+
visitor.setNumWrap(0);
|
|
524
521
|
const work = new GrowableXYZArray(10);
|
|
525
522
|
const point0 = Point3d.create();
|
|
526
523
|
const point1 = Point3d.create();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PolyfaceClip.js","sourceRoot":"","sources":["../../../src/polyface/PolyfaceClip.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F;;GAEG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAE,0BAA0B,EAAE,MAAM,wCAAwC,CAAC;AAEpF,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AACrC,OAAO,EAAE,kBAAkB,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AACnE,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,QAAQ,EAA0B,MAAM,aAAa,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAClE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,8BAA8B,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtF,OAAO,EAAE,OAAO,EAAW,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAChE,OAAO,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAE1E,OAAO,EAAE,YAA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AG,CAAC,EAAE,CAAC;oBACtB,mGAAmG;oBACnG,8BAA8B,CAAC,oCAAoC,CAAC,YAAY,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,aAAa,CAAC,CAAC;oBACvH,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,IAAI,cAAc;wBACpC,cAAc,CAAC,0BAA0B,CAAC,KAAK,CAAC,CAAC;oBACnD,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,IAAI,aAAa;wBACnC,aAAa,CAAC,0BAA0B,CAAC,KAAK,CAAC,CAAC;gBACpD,CAAC;gBACD,OAAO,IAAI,CAAC;YACd,CAAC,CAAC,CAAC;QACL,CAAC;IACH,CAAC;IAED;;;;;;;;;;;;;;;;OAgBG;IACI,MAAM,CAAC,cAAc,CAAC,KAAsB,EAAE,KAAsB;QACzE,MAAM,QAAQ,GAAG,KAAK,CAAC,aAAa,EAAE,CAAC;QACvC,MAAM,QAAQ,GAAG,KAAK,CAAC,aAAa,EAAE,CAAC;QACvC,MAAM,cAAc,GAAG,eAAe,CAAC,MAAM,EAAE,CAAC;QAChD,MAAM,aAAa,GAAG,eAAe,CAAC,MAAM,EAAE,CAAC;QAC/C,cAAc,CAAC,uBAAuB,EAAE,CAAC;QACzC,IAAI,CAAC,+CAA+C,CAAC,QAAQ,EAAE,QAAQ,EAAE,cAAc,EAAE,aAAa,CAAC,CAAC;QACxG,cAAc,CAAC,uBAAuB,EAAE,CAAC;QACzC,aAAa,CAAC,uBAAuB,EAAE,CAAC;QACxC,IAAI,CAAC,+CAA+C,CAAC,QAAQ,EAAE,QAAQ,EAAE,aAAa,EAAE,cAAc,CAAC,CAAC;QACxG,OAAO;YACL,WAAW,EAAE,cAAc,CAAC,aAAa,EAAE;YAC3C,UAAU,EAAE,aAAa,CAAC,aAAa,EAAE;SAC1C,CAAC;IACJ,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\n/** @packageDocumentation\n * @module Polyface\n */\n\nimport { assert } from \"@itwin/core-bentley\";\nimport { ClipPlane } from \"../clipping/ClipPlane\";\nimport { ConvexClipPlaneSet } from \"../clipping/ConvexClipPlaneSet\";\nimport { UnionOfConvexClipPlaneSets } from \"../clipping/UnionOfConvexClipPlaneSets\";\nimport { AnyRegion } from \"../curve/CurveTypes\";\nimport { LineString3d } from \"../curve/LineString3d\";\nimport { Loop } from \"../curve/Loop\";\nimport { RegionBinaryOpType, RegionOps } from \"../curve/RegionOps\";\nimport { StrokeOptions } from \"../curve/StrokeOptions\";\nimport { UnionRegion } from \"../curve/UnionRegion\";\nimport { Geometry, PlaneAltitudeEvaluator } from \"../Geometry\";\nimport { FrameBuilder } from \"../geometry3d/FrameBuilder\";\nimport { GrowableXYZArray } from \"../geometry3d/GrowableXYZArray\";\nimport { Point3d, Vector3d } from \"../geometry3d/Point3dVector3d\";\nimport { IndexedXYZCollectionPolygonOps, PolygonOps } from \"../geometry3d/PolygonOps\";\nimport { Range1d, Range2d, Range3d } from \"../geometry3d/Range\";\nimport { GrowableXYZArrayCache } from \"../geometry3d/ReusableObjectCache\";\nimport { Transform } from \"../geometry3d/Transform\";\nimport { SweepContour } from \"../solid/SweepContour\";\nimport { ChainMergeContext } from \"../topology/ChainMerge\";\nimport { RangeSearch } from \"./multiclip/RangeSearch\";\nimport { IndexedPolyface, Polyface, PolyfaceVisitor } from \"./Polyface\";\nimport { PolyfaceBuilder } from \"./PolyfaceBuilder\";\nimport { PolyfaceQuery } from \"./PolyfaceQuery\";\n\n/**\n * carrier for a point array with an index into UnionOfConvexClipPlaneSets\n * @private\n */\nclass ClipCandidate {\n public nextConvexSetIndex: number;\n public points: GrowableXYZArray;\n public constructor(points: GrowableXYZArray, nextConvexSetIndex: number) {\n this.nextConvexSetIndex = nextConvexSetIndex;\n this.points = points;\n }\n}\n\n/**\n * A pair of [[PolyfaceBuilder]] objects, for use by clippers that emit inside and outside parts.\n * * @public\n */\nexport class ClippedPolyfaceBuilders {\n /** An available builder. Typically the \"inside\" parts */\n public builderA?: PolyfaceBuilder;\n /** An available builder. Typically the \"outside\" parts */\n public builderB?: PolyfaceBuilder;\n /** request to construct cut faces */\n public buildClosureFaces?: boolean;\n private constructor(builderA: PolyfaceBuilder | undefined, builderB: PolyfaceBuilder | undefined, buildClosureFaces: boolean = false) {\n this.builderA = builderA;\n this.builderB = builderB;\n this.buildClosureFaces = buildClosureFaces;\n }\n /**\n * Static constructor with default options for the builders.\n * @param keepInside whether to collect clipped facets inside the clipper to `this.builderA` (default true)\n * @param keepOutside whether to collect clipped facets outside the clipper to `this.builderB` (default false)\n * @param buildSideFaces whether to add side facets to active builders (default false)\n */\n public static create(keepInside: boolean = true, keepOutside: boolean = false, buildSideFaces: boolean = false) {\n return new ClippedPolyfaceBuilders(keepInside ? PolyfaceBuilder.create() : undefined, keepOutside ? PolyfaceBuilder.create() : undefined, buildSideFaces);\n }\n\n /**\n * Return the computed facets from the selected builder.\n * @param selector the polyface to return: 0 - builderA (typically inside facets), 1 - builderB (typically outside facets)\n * @param fixup whether to clean up the polyface\n * @param tolerance compression tolerance (default [[Geometry.smallMetricDistance]]).\n */\n public claimPolyface(selector: 0 | 1, fixup: boolean, tolerance: number = Geometry.smallMetricDistance): IndexedPolyface | undefined {\n const builder = selector === 0 ? this.builderA : this.builderB;\n if (builder) {\n let polyface = builder.claimPolyface(true, tolerance);\n if (fixup) {\n polyface = PolyfaceQuery.cloneWithTVertexFixup(polyface);\n polyface = PolyfaceQuery.cloneWithDanglingEdgesRemoved(polyface);\n }\n return polyface;\n }\n return undefined;\n }\n}\n/** PolyfaceClip is a static class gathering operations using Polyfaces and clippers.\n * @public\n */\nexport class PolyfaceClip {\n /** Clip each facet of polyface to the ClipPlane.\n * * Return all surviving clip as a new mesh.\n * * WARNING: The new mesh is \"points only\" -- parameters, normals, etc are not interpolated\n */\n public static clipPolyfaceClipPlaneWithClosureFace(polyface: Polyface, clipper: ClipPlane, insideClip: boolean = true, buildClosureFaces: boolean = true): IndexedPolyface {\n return this.clipPolyfaceClipPlane(polyface, clipper, insideClip, buildClosureFaces);\n }\n /** Clip each facet of polyface to the ClipPlane.\n * * Return all surviving clip as a new mesh.\n * * WARNING: The new mesh is \"points only\" -- parameters, normals, etc are not interpolated\n */\n public static clipPolyfaceClipPlane(polyface: Polyface, clipper: ClipPlane, insideClip: boolean = true, buildClosureFaces: boolean = false): IndexedPolyface {\n const builders = ClippedPolyfaceBuilders.create(insideClip, !insideClip, buildClosureFaces);\n this.clipPolyfaceInsideOutside(polyface, clipper, builders);\n return builders.claimPolyface(insideClip ? 0 : 1, true)!;\n }\n\n /** Clip each facet of polyface to the ClipPlane.\n * * Return surviving clip as a new mesh.\n * * WARNING: The new mesh is \"points only\".\n */\n public static clipPolyfaceConvexClipPlaneSet(polyface: Polyface, clipper: ConvexClipPlaneSet): IndexedPolyface {\n const visitor = polyface.createVisitor(0);\n const builder = PolyfaceBuilder.create();\n const work = new GrowableXYZArray(10);\n for (visitor.reset(); visitor.moveToNextFacet();) {\n clipper.clipConvexPolygonInPlace(visitor.point, work);\n if (visitor.point.length > 2)\n builder.addPolygonGrowableXYZArray(visitor.point);\n }\n return builder.claimPolyface(true);\n }\n\n /** Clip each facet of polyface to the the clippers.\n * * Add inside, outside fragments to builderA, builderB\n * * This does not consider params, normals, colors. Just points.\n * * outputSelect determines how the clip output is structured\n * * 0 outputs all shards -- this may have many interior edges.\n * * 1 stitches shards together to get cleaner facets.\n */\n public static clipPolyfaceUnionOfConvexClipPlaneSetsToBuilders(polyface: Polyface | PolyfaceVisitor, allClippers: UnionOfConvexClipPlaneSets, destination: ClippedPolyfaceBuilders, outputSelector: number = 1) {\n if (polyface instanceof Polyface) {\n this.clipPolyfaceUnionOfConvexClipPlaneSetsToBuilders(polyface.createVisitor(0), allClippers, destination, outputSelector);\n return;\n }\n const builderA = destination.builderA;\n const builderB = destination.builderB;\n const visitor = polyface; // alias; we have a visitor now\n const cache = new GrowableXYZArrayCache();\n const insideShards: GrowableXYZArray[] = [];\n const outsideShards: GrowableXYZArray[] = [];\n const residualPolygons: ClipCandidate[] = [];\n let candidate: ClipCandidate | undefined;\n const outsideParts: GrowableXYZArray[] = [];\n\n const numConvexSet = allClippers.convexSets.length;\n for (visitor.reset(); visitor.moveToNextFacet();) {\n residualPolygons.push(new ClipCandidate(cache.grabAndFill(visitor.point), 0));\n while ((candidate = residualPolygons.pop()) !== undefined) {\n const convexSetIndex = candidate.nextConvexSetIndex;\n if (convexSetIndex >= numConvexSet) {\n // ths remnant polygon is OUT ...\n if (candidate.points.length > 2)\n outsideShards.push(candidate.points);\n } else {\n const clipper = allClippers.convexSets[convexSetIndex];\n outsideParts.length = 0; // NO NO -- why isn't it empty from prior step cleanup?\n const insidePart = clipper.clipInsidePushOutside(candidate.points, outsideParts, cache);\n if (insidePart) {\n if (insidePart.length > 2)\n insideShards.push(insidePart);\n // Keep outside parts active for clip by later facets . . .\n for (const outsidePolygon of outsideParts) {\n residualPolygons.push(new ClipCandidate(outsidePolygon, convexSetIndex + 1));\n }\n } else {\n // Nothing was insidePart. The outside parts might be split by intermediate steps -- but all the pieces are there.\n candidate.nextConvexSetIndex++;\n residualPolygons.push(candidate);\n }\n outsideParts.length = 0;\n }\n }\n if (outsideShards.length === 0) {\n builderA?.addPolygonGrowableXYZArray(visitor.point);\n } else if (insideShards.length === 0) {\n // the facet spanned clippers but is intact outside\n builderB?.addPolygonGrowableXYZArray(visitor.point);\n } else {\n const localToWorld = FrameBuilder.createRightHandedFrame(undefined, visitor.point);\n let worldToLocal: Transform | undefined;\n if (outputSelector === 1 && localToWorld !== undefined\n && undefined !== (worldToLocal = localToWorld.inverse())) {\n this.cleanupAndAddRegion(builderA, insideShards, worldToLocal, localToWorld);\n this.cleanupAndAddRegion(builderB, outsideShards, worldToLocal, localToWorld);\n } else {\n for (const shard of insideShards)\n this.addPolygonToBuilderAndDropToCache(shard, builderA, cache);\n for (const shard of outsideShards)\n this.addPolygonToBuilderAndDropToCache(shard, builderB, cache);\n }\n }\n outsideShards.length = 0;\n insideShards.length = 0;\n }\n cache.dropAllToCache(outsideParts);\n if (destination.buildClosureFaces) {\n for (const clipper of allClippers.convexSets) {\n this.buildClosureFacesForConvexSet(visitor, clipper, destination, cache);\n }\n }\n }\n private static addRegion(builder: PolyfaceBuilder | undefined, region: AnyRegion | undefined) {\n if (builder !== undefined && region !== undefined) {\n if (region instanceof Loop && region.children.length === 1 && region.children[0] instanceof LineString3d) {\n builder.addPolygonGrowableXYZArray(region.children[0].packedPoints);\n } else if (region instanceof UnionRegion) {\n for (const child of region.children)\n this.addRegion(builder, child);\n } else {\n assert(false, \"unexpected region encountered\");\n }\n }\n }\n // WARNING: shards are transformed into local system, not reverted!!!\n private static cleanupAndAddRegion(builder: PolyfaceBuilder | undefined, shards: GrowableXYZArray[],\n worldToLocal: Transform | undefined, localToWorld: Transform | undefined) {\n if (builder !== undefined && shards.length > 0) {\n if (worldToLocal)\n GrowableXYZArray.multiplyTransformInPlace(worldToLocal, shards);\n const outsidePieces = RegionOps.polygonBooleanXYToLoops(shards, RegionBinaryOpType.Union, []);\n if (outsidePieces && outsidePieces.children.length > 0) {\n RegionOps.consolidateAdjacentPrimitives(outsidePieces); // source of the T-vertices removed in claimPolyface\n const options = new StrokeOptions();\n options.maximizeConvexFacets = true;\n const localFacets = RegionOps.facetRegionXY(outsidePieces, options);\n if (localFacets) {\n // prefer to add non-convex facets\n builder.addIndexedPolyface(localFacets, false, localToWorld);\n } else { // failsafe; we don't expect to get here\n if (localToWorld)\n outsidePieces.tryTransformInPlace(localToWorld);\n this.addRegion(builder, outsidePieces); // possibly non-convex!\n }\n }\n }\n }\n private static addPolygonToBuilderAndDropToCache(polygon: GrowableXYZArray | undefined, builder: PolyfaceBuilder | undefined, cache: GrowableXYZArrayCache) {\n if (polygon) {\n if (builder)\n builder.addPolygonGrowableXYZArray(polygon);\n cache.dropToCache(polygon);\n }\n }\n private static addPolygonArrayToBuilderAndDropToCache(polygonArray: GrowableXYZArray[], builder: PolyfaceBuilder | undefined, cache: GrowableXYZArrayCache) {\n let polygon;\n while ((polygon = polygonArray.pop()) !== undefined) {\n this.addPolygonToBuilderAndDropToCache(polygon, builder, cache);\n }\n }\n private static createChainContextsForConvexClipPlaneSet(clipper: ConvexClipPlaneSet): ChainMergeContext[] {\n const chainContexts = [];\n for (const plane of clipper.planes) {\n if (!plane.interior) {\n const c = ChainMergeContext.create();\n c.plane = plane;\n c.convexClipper = clipper;\n chainContexts.push(c);\n }\n }\n return chainContexts;\n }\n\n /** Clip each facet of polyface to the the clippers.\n * * Add inside, outside fragments to builderA, builderB\n * * This does not consider params, normals, colors. Just points.\n * @internal\n */\n public static clipPolyfaceConvexClipPlaneSetToBuilders(polyface: Polyface, clipper: ConvexClipPlaneSet, destination: ClippedPolyfaceBuilders) {\n const builderA = destination.builderA;\n const builderB = destination.builderB;\n const visitor = polyface.createVisitor(0);\n const cache = new GrowableXYZArrayCache();\n const outsideParts: GrowableXYZArray[] = [];\n for (visitor.reset(); visitor.moveToNextFacet();) {\n // !!! currentCandidates and next candidates are empty at this point !!!\n const insidePart = clipper.clipInsidePushOutside(visitor.point, outsideParts, cache);\n if (insidePart === undefined) {\n // everything is out ... outsideParts might be fragmented. Save only the original polygon\n builderB?.addPolygonGrowableXYZArray(visitor.point);\n cache.dropToCache(insidePart);\n cache.dropAllToCache(outsideParts);\n }\n this.addPolygonToBuilderAndDropToCache(insidePart, builderA, cache);\n this.addPolygonArrayToBuilderAndDropToCache(outsideParts, builderB, cache);\n }\n this.buildClosureFacesForConvexSet(visitor, clipper, destination, cache);\n }\n /**\n *\n * @param visitor visitor for all facets of interest (entire polyface)\n * @param clipper ConvexClipPlaneSet to apply\n * @param destination builders to receive inside, outside parts\n * @param cache GrowableArray cache.\n */\n private static buildClosureFacesForConvexSet(visitor: PolyfaceVisitor, clipper: ConvexClipPlaneSet, destination: ClippedPolyfaceBuilders,\n cache: GrowableXYZArrayCache) {\n if (destination.buildClosureFaces) {\n const chainContexts = this.createChainContextsForConvexClipPlaneSet(clipper);\n const workPoints = cache.grabFromCache();\n const facetPoints = cache.grabFromCache();\n for (visitor.reset(); visitor.moveToNextFacet();) {\n for (const chainContext of chainContexts) {\n const plane = chainContext.plane;\n facetPoints.clear();\n facetPoints.pushFrom(visitor.point);\n IndexedXYZCollectionPolygonOps.clipConvexPolygonInPlace(plane!, facetPoints, workPoints);\n chainContext.addSegmentsOnPlane(facetPoints, true);\n }\n }\n cache.dropToCache(facetPoints);\n cache.dropToCache(workPoints);\n for (const chainContext of chainContexts) {\n this.addClosureFacets(chainContext, destination, cache);\n }\n }\n }\n\n /**\n *\n * @param visitor visitor for all facets of interest (entire polyface)\n * @param clipper ConvexClipPlaneSet to apply\n * @param destination builders to receive inside, outside parts\n * @param cache GrowableArray cache.\n */\n private static buildClosureFacesForPlane(visitor: PolyfaceVisitor, plane: PlaneAltitudeEvaluator, destination: ClippedPolyfaceBuilders,\n cache: GrowableXYZArrayCache) {\n if (destination.buildClosureFaces) {\n const chainContext = ChainMergeContext.create();\n chainContext.plane = plane;\n const workPoints = cache.grabFromCache();\n const facetPoints = cache.grabFromCache();\n for (visitor.reset(); visitor.moveToNextFacet();) {\n facetPoints.clear();\n facetPoints.pushFrom(visitor.point);\n IndexedXYZCollectionPolygonOps.clipConvexPolygonInPlace(plane, facetPoints, workPoints);\n chainContext.addSegmentsOnPlane(facetPoints, true);\n }\n cache.dropToCache(facetPoints);\n cache.dropToCache(workPoints);\n this.addClosureFacets(chainContext, destination, cache);\n }\n }\n private static evaluateInwardPlaneNormal(plane: PlaneAltitudeEvaluator, scale: number): Vector3d {\n return Vector3d.create(plane.velocityXYZ(scale, 0, 0), plane.velocityXYZ(0, scale, 0), plane.velocityXYZ(0, 0, scale));\n }\n /**\n * * Triangulate the contour.\n * * Add all the triangles to both builders\n * * reversed in builderB.\n */\n private static addClippedContour(contour: SweepContour, clipper: ConvexClipPlaneSet | undefined, destination: ClippedPolyfaceBuilders, cache: GrowableXYZArrayCache) {\n const polygonA = cache.grabFromCache();\n const polygonB = cache.grabFromCache();\n if (destination.builderB)\n destination.builderB.toggleReversedFacetFlag();\n contour.announceFacets((facets: IndexedPolyface) => {\n const visitor = facets.createVisitor();\n // The contour facets are convex .. easy clip ..\n for (visitor.reset(); visitor.moveToNextFacet();) {\n polygonA.clear();\n polygonA.pushFromGrowableXYZArray(visitor.point);\n clipper?.clipConvexPolygonInPlace(polygonA, polygonB);\n if (polygonA.length > 2) {\n destination.builderA?.addPolygonGrowableXYZArray(polygonA);\n destination.builderB?.addPolygonGrowableXYZArray(polygonA);\n }\n }\n }, undefined);\n if (destination.builderB)\n destination.builderB.toggleReversedFacetFlag();\n cache.dropToCache(polygonA);\n cache.dropToCache(polygonB);\n }\n\n /**\n * Gather loops out of the ChainMergeContext. Add to destination arrays.\n * @param chainContext ASSUMED TO HAVE A PLANE\n * @param destination\n */\n private static addClosureFacets(chainContext: ChainMergeContext, destination: ClippedPolyfaceBuilders, cache: GrowableXYZArrayCache) {\n const clipper = chainContext.convexClipper;\n const plane = chainContext.plane!;\n const outwardNormal = this.evaluateInwardPlaneNormal(plane, -1.0);\n chainContext.clusterAndMergeVerticesXYZ();\n const loops = chainContext.collectMaximalGrowableXYZArrays();\n if (loops.length > 1) {\n const loopSets = PolygonOps.sortOuterAndHoleLoops(loops, outwardNormal);\n for (const loopSet of loopSets) {\n PolygonOps.orientLoopsCCWForOutwardNormalInPlace(loopSet, outwardNormal);\n const contour = SweepContour.createForPolygon(loopSet, outwardNormal);\n if (contour !== undefined) {\n if (clipper) {\n this.addClippedContour(contour, clipper, destination, cache);\n } else {\n if (destination.builderA)\n contour.emitFacets(destination.builderA, false);\n if (destination.builderB)\n contour.emitFacets(destination.builderB, true);\n }\n }\n }\n } else {\n PolygonOps.orientLoopsCCWForOutwardNormalInPlace(loops, outwardNormal);\n const contour = SweepContour.createForPolygon(loops, outwardNormal);\n if (contour !== undefined) {\n if (clipper) {\n this.addClippedContour(contour, clipper, destination, cache);\n } else {\n if (destination.builderA)\n contour.emitFacets(destination.builderA, false);\n if (destination.builderB)\n contour.emitFacets(destination.builderB, true);\n }\n }\n }\n }\n\n /** Clip each facet of polyface to the the clippers.\n * * Add inside, outside fragments to builderA, builderB\n * * This does not consider params, normals, colors. Just points.\n * @internal\n */\n public static clipPolyfaceClipPlaneToBuilders(polyface: Polyface, clipper: PlaneAltitudeEvaluator, destination: ClippedPolyfaceBuilders) {\n const builderA = destination.builderA;\n const builderB = destination.builderB;\n const visitor = polyface.createVisitor(0);\n const cache = new GrowableXYZArrayCache();\n const inside = cache.grabFromCache();\n const outside = cache.grabFromCache();\n const range = Range1d.createNull();\n for (visitor.reset(); visitor.moveToNextFacet();) {\n // !!! currentCandidates and next candidates are empty at this point !!!\n IndexedXYZCollectionPolygonOps.splitConvexPolygonInsideOutsidePlane(clipper, visitor.point, inside, outside, range);\n if (builderA)\n builderA.addPolygonGrowableXYZArray(inside);\n if (builderB)\n builderB.addPolygonGrowableXYZArray(outside);\n }\n this.buildClosureFacesForPlane(visitor, clipper, destination, cache);\n cache.dropToCache(inside);\n cache.dropToCache(outside);\n }\n\n /** Clip each facet of polyface to the ClipPlane or ConvexClipPlaneSet\n * * accumulate inside and outside facets -- to destination.builderA and destination.builderB\n * * if `destination.buildClosureFaces` is set, and also build closure facets\n * * This method parses the variant input types and calls a more specific method.\n * * WARNING: The new mesh is \"points only\".\n * * outputSelect applies only for UnionOfConvexClipPlaneSets -- see [[PolyfaceClip.clipPolyfaceUnionOfConvexClipPlaneSetsToBuilders]]\n */\n public static clipPolyfaceInsideOutside(polyface: Polyface, clipper: ClipPlane | ConvexClipPlaneSet | UnionOfConvexClipPlaneSets, destination: ClippedPolyfaceBuilders,\n outputSelect: number = 0) {\n if (clipper instanceof ClipPlane) {\n this.clipPolyfaceClipPlaneToBuilders(polyface, clipper, destination);\n } else if (clipper instanceof ConvexClipPlaneSet) {\n this.clipPolyfaceConvexClipPlaneSetToBuilders(polyface, clipper, destination);\n } else if (clipper instanceof UnionOfConvexClipPlaneSets) {\n this.clipPolyfaceUnionOfConvexClipPlaneSetsToBuilders(polyface, clipper, destination, outputSelect);\n }\n }\n /** Clip each facet of polyface to the ClipPlane or ConvexClipPlaneSet\n * * This method parses the variant input types and calls a more specific method.\n * * To get both inside and outside parts, use clipPolyfaceInsideOutside\n * * WARNING: The new mesh is \"points only\".\n */\n public static clipPolyface(polyface: Polyface, clipper: ClipPlane | ConvexClipPlaneSet): Polyface | undefined {\n if (clipper instanceof ClipPlane)\n return this.clipPolyfaceClipPlane(polyface, clipper);\n if (clipper instanceof ConvexClipPlaneSet)\n return this.clipPolyfaceConvexClipPlaneSet(polyface, clipper);\n // (The if tests exhaust the type space -- this line is unreachable.)\n return undefined;\n }\n /**\n * Drape the region onto the mesh.\n * * This method computes the portion of the input mesh that lies inside the clipper generated from sweeping the input region in the given direction.\n * @param mesh input mesh, untouched\n * @param region planar region to drape onto mesh\n * @param sweepVector optional sweep direction for region, magnitude unused. If undefined, sweep is along the region normal.\n * @param options how to stroke the region boundary\n * @returns clipped facets. No other mesh data but vertices appear in output.\n */\n public static drapeRegion(mesh: Polyface | PolyfaceVisitor, region: AnyRegion, sweepVector?: Vector3d, options?: StrokeOptions): IndexedPolyface | undefined {\n if (mesh instanceof Polyface)\n return this.drapeRegion(mesh.createVisitor(0), region, sweepVector, options);\n const contour = SweepContour.createForLinearSweep(region);\n if (!contour)\n return undefined;\n let sweep = sweepVector;\n if (sweepVector && contour.localToWorld.matrix.dotColumnZ(sweepVector) < 0.0)\n sweep = sweepVector.scale(-1); // avoid inverted clipper\n const clipper = contour.sweepToUnionOfConvexClipPlaneSets(sweep, false, false, options);\n if (!clipper)\n return undefined;\n const builders = ClippedPolyfaceBuilders.create(true); // we want only the facets inside the clipper\n this.clipPolyfaceUnionOfConvexClipPlaneSetsToBuilders(mesh, clipper, builders, 1);\n return builders.claimPolyface(0, true);\n }\n /** Find consecutive points around a polygon (with implied closure edge) that are ON a plane\n * @param points array of points around polygon. Closure edge is implied.\n * @param chainContext context receiving edges\n * @param point0 work point\n * @param point1 work point\n */\n private static collectEdgesOnPlane(points: GrowableXYZArray, clipper: ClipPlane, chainContext: ChainMergeContext, point0: Point3d, point1: Point3d) {\n const n = points.length;\n if (n > 1) {\n points.getPoint3dAtUncheckedPointIndex(n - 1, point0);\n for (let i = 0; i < n; i++) {\n points.getPoint3dAtUncheckedPointIndex(i, point1);\n if (clipper.isPointOn(point0) && clipper.isPointOn(point1))\n chainContext.addSegment(point0, point1);\n point0.setFromPoint3d(point1);\n }\n }\n }\n /** Intersect each facet with the clip plane. (Producing intersection edges.)\n * * Return all edges chained as array of LineString3d.\n */\n public static sectionPolyfaceClipPlane(polyface: Polyface, clipper: ClipPlane): LineString3d[] {\n const chainContext = ChainMergeContext.create();\n\n const visitor = polyface.createVisitor(0);\n const work = new GrowableXYZArray(10);\n const point0 = Point3d.create();\n const point1 = Point3d.create();\n for (visitor.reset(); visitor.moveToNextFacet();) {\n clipper.clipConvexPolygonInPlace(visitor.point, work, true);\n this.collectEdgesOnPlane(visitor.point, clipper, chainContext, point0, point1);\n }\n chainContext.clusterAndMergeVerticesXYZ();\n return chainContext.collectMaximalChains();\n }\n\n /**\n * * Split facets of mesh \"A\" into parts that are\n * * under mesh \"B\"\n * * over mesh \"B\"\n * * both meshes are represented by visitors rather than the meshes themselves\n * * If the data in-hand is a mesh, call with `mesh.createVisitor`\n * * The respective clip parts are fed to caller-supplied builders.\n * * Caller may set either or both builders to toggle facet order (e.g. toggle the lower facets to make them \"point down\" in cut-fill application)\n * * This step is commonly one-half of \"cut fill\".\n * * A \"cut fill\" wrapper will call this twice with the visitor and builder roles reversed.\n * * Both polyfaces are assumed convex with CCW orientation viewed from above.\n * @param visitorA iterator over polyface to be split.\n * @param visitorB iterator over polyface that acts as a splitter\n * @param orientUnderMeshDownward if true, the \"meshAUnderB\" output is oriented with its normals reversed so it can act as the bottom side of a cut-fill pair.\n */\n public static clipPolyfaceUnderOverConvexPolyfaceIntoBuilders(visitorA: PolyfaceVisitor, visitorB: PolyfaceVisitor,\n builderAUnderB: PolyfaceBuilder | undefined,\n builderAOverB: PolyfaceBuilder | undefined) {\n const rangeDataA = PolyfaceQuery.collectRangeLengthData(visitorA);\n const searchA = RangeSearch.create2dSearcherForRangeLengthData<number>(rangeDataA);\n if (!searchA)\n return;\n const range = Range3d.create();\n for (visitorA.reset(); visitorA.moveToNextFacet();) {\n visitorA.point.setRange(range);\n searchA.addRange(range, visitorA.currentReadIndex());\n }\n const xyClip = new GrowableXYZArray(10);\n const workArray = new GrowableXYZArray(10);\n const xyFrustum = ConvexClipPlaneSet.createEmpty();\n const below = new GrowableXYZArray(10);\n const above = new GrowableXYZArray(10);\n const planeOfFacet = ClipPlane.createNormalAndPointXYZXYZ(0, 0, 1, 0, 0, 0)!;\n const altitudeRange = Range1d.createNull();\n\n for (visitorB.reset(); visitorB.moveToNextFacet();) {\n visitorB.point.setRange(range);\n ConvexClipPlaneSet.setPlaneAndXYLoopCCW(visitorB.point, planeOfFacet, xyFrustum);\n searchA.searchRange2d(range, (_rangeA: Range2d, readIndexA: number) => {\n visitorA.moveToReadIndex(readIndexA);\n xyFrustum.polygonClip(visitorA.point, xyClip, workArray);\n // builderAOverB.addPolygonGrowableXYZArray(xyClip);\n if (xyClip.length > 0) {\n // planeOfFacet.convexPolygonSplitInsideOutsideGrowableArrays(xyClip, below, above, altitudeRange);\n IndexedXYZCollectionPolygonOps.splitConvexPolygonInsideOutsidePlane(planeOfFacet, xyClip, below, above, altitudeRange);\n if (below.length > 0 && builderAUnderB)\n builderAUnderB.addPolygonGrowableXYZArray(below);\n if (above.length > 0 && builderAOverB)\n builderAOverB.addPolygonGrowableXYZArray(above);\n }\n return true;\n });\n }\n }\n\n /**\n * * Split facets into vertically overlapping sections\n * * both meshes are represented by visitors rather than the meshes themselves\n * * If the data in-hand is a mesh, call with `mesh.createVisitor`\n * * The respective clip parts are returned as separate meshes.\n * * Caller may set either or both builders to toggle facet order (e.g. toggle the lower facets to make them \"point down\" in cut-fill application)\n * * Both polyfaces are assumed convex with CCW orientation viewed from above.\n * * Each output contains some facets from meshA and some from meshB:\n * * meshAUnderB -- areas where meshA is underneath mesh B.\n * * If A is \"design surface\" and B is existing DTM, this is \"cut\" volume\n * * meshAOverB -- areas where meshB is over meshB.\n * * If A is \"design surface\" and B is existing DTM, this is \"fill\" volume\n *\n * @param visitorA iterator over polyface to be split.\n * @param visitorB iterator over polyface that acts as a splitter\n * @param orientUnderMeshDownward if true, the \"meshAUnderB\" output is oriented with its normals reversed so it can act as the bottom side of a cut-fill pair.\n */\n public static computeCutFill(meshA: IndexedPolyface, meshB: IndexedPolyface): { meshAUnderB: IndexedPolyface, meshAOverB: IndexedPolyface } {\n const visitorA = meshA.createVisitor();\n const visitorB = meshB.createVisitor();\n const builderAUnderB = PolyfaceBuilder.create();\n const builderAOverB = PolyfaceBuilder.create();\n builderAUnderB.toggleReversedFacetFlag();\n this.clipPolyfaceUnderOverConvexPolyfaceIntoBuilders(visitorA, visitorB, builderAUnderB, builderAOverB);\n builderAUnderB.toggleReversedFacetFlag();\n builderAOverB.toggleReversedFacetFlag();\n this.clipPolyfaceUnderOverConvexPolyfaceIntoBuilders(visitorB, visitorA, builderAOverB, builderAUnderB);\n return {\n meshAUnderB: builderAUnderB.claimPolyface(),\n meshAOverB: builderAOverB.claimPolyface(),\n };\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"PolyfaceClip.js","sourceRoot":"","sources":["../../../src/polyface/PolyfaceClip.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F;;GAEG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAE,0BAA0B,EAA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,IAAI,aAAa;wBACnC,aAAa,CAAC,0BAA0B,CAAC,KAAK,CAAC,CAAC;gBACpD,CAAC;gBACD,OAAO,IAAI,CAAC;YACd,CAAC,CAAC,CAAC;QACL,CAAC;IACH,CAAC;IAED;;;;;;;;;;;;;;;;OAgBG;IACI,MAAM,CAAC,cAAc,CAAC,KAAsB,EAAE,KAAsB;QACzE,MAAM,QAAQ,GAAG,KAAK,CAAC,aAAa,EAAE,CAAC;QACvC,MAAM,QAAQ,GAAG,KAAK,CAAC,aAAa,EAAE,CAAC;QACvC,MAAM,cAAc,GAAG,eAAe,CAAC,MAAM,EAAE,CAAC;QAChD,MAAM,aAAa,GAAG,eAAe,CAAC,MAAM,EAAE,CAAC;QAC/C,cAAc,CAAC,uBAAuB,EAAE,CAAC;QACzC,IAAI,CAAC,+CAA+C,CAAC,QAAQ,EAAE,QAAQ,EAAE,cAAc,EAAE,aAAa,CAAC,CAAC;QACxG,cAAc,CAAC,uBAAuB,EAAE,CAAC;QACzC,aAAa,CAAC,uBAAuB,EAAE,CAAC;QACxC,IAAI,CAAC,+CAA+C,CAAC,QAAQ,EAAE,QAAQ,EAAE,aAAa,EAAE,cAAc,CAAC,CAAC;QACxG,OAAO;YACL,WAAW,EAAE,cAAc,CAAC,aAAa,EAAE;YAC3C,UAAU,EAAE,aAAa,CAAC,aAAa,EAAE;SAC1C,CAAC;IACJ,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\n/** @packageDocumentation\n * @module Polyface\n */\n\nimport { assert } from \"@itwin/core-bentley\";\nimport { ClipPlane } from \"../clipping/ClipPlane\";\nimport { ConvexClipPlaneSet } from \"../clipping/ConvexClipPlaneSet\";\nimport { UnionOfConvexClipPlaneSets } from \"../clipping/UnionOfConvexClipPlaneSets\";\nimport { AnyRegion } from \"../curve/CurveTypes\";\nimport { LineString3d } from \"../curve/LineString3d\";\nimport { Loop } from \"../curve/Loop\";\nimport { RegionBinaryOpType, RegionOps } from \"../curve/RegionOps\";\nimport { StrokeOptions } from \"../curve/StrokeOptions\";\nimport { UnionRegion } from \"../curve/UnionRegion\";\nimport { Geometry, PlaneAltitudeEvaluator } from \"../Geometry\";\nimport { FrameBuilder } from \"../geometry3d/FrameBuilder\";\nimport { GrowableXYZArray } from \"../geometry3d/GrowableXYZArray\";\nimport { Point3d, Vector3d } from \"../geometry3d/Point3dVector3d\";\nimport { IndexedXYZCollectionPolygonOps, PolygonOps } from \"../geometry3d/PolygonOps\";\nimport { Range1d, Range2d, Range3d } from \"../geometry3d/Range\";\nimport { GrowableXYZArrayCache } from \"../geometry3d/ReusableObjectCache\";\nimport { Transform } from \"../geometry3d/Transform\";\nimport { SweepContour } from \"../solid/SweepContour\";\nimport { ChainMergeContext } from \"../topology/ChainMerge\";\nimport { RangeSearch } from \"./multiclip/RangeSearch\";\nimport { IndexedPolyface, Polyface, PolyfaceVisitor } from \"./Polyface\";\nimport { PolyfaceBuilder } from \"./PolyfaceBuilder\";\nimport { PolyfaceQuery } from \"./PolyfaceQuery\";\n\n/**\n * carrier for a point array with an index into UnionOfConvexClipPlaneSets\n * @private\n */\nclass ClipCandidate {\n public nextConvexSetIndex: number;\n public points: GrowableXYZArray;\n public constructor(points: GrowableXYZArray, nextConvexSetIndex: number) {\n this.nextConvexSetIndex = nextConvexSetIndex;\n this.points = points;\n }\n}\n\n/**\n * A pair of [[PolyfaceBuilder]] objects, for use by clippers that emit inside and outside parts.\n * * @public\n */\nexport class ClippedPolyfaceBuilders {\n /** An available builder. Typically the \"inside\" parts */\n public builderA?: PolyfaceBuilder;\n /** An available builder. Typically the \"outside\" parts */\n public builderB?: PolyfaceBuilder;\n /** request to construct cut faces */\n public buildClosureFaces?: boolean;\n private constructor(builderA: PolyfaceBuilder | undefined, builderB: PolyfaceBuilder | undefined, buildClosureFaces: boolean = false) {\n this.builderA = builderA;\n this.builderB = builderB;\n this.buildClosureFaces = buildClosureFaces;\n }\n /**\n * Static constructor with default options for the builders.\n * @param keepInside whether to collect clipped facets inside the clipper to `this.builderA` (default true)\n * @param keepOutside whether to collect clipped facets outside the clipper to `this.builderB` (default false)\n * @param buildSideFaces whether to add side facets to active builders (default false)\n */\n public static create(keepInside: boolean = true, keepOutside: boolean = false, buildSideFaces: boolean = false): ClippedPolyfaceBuilders {\n return new ClippedPolyfaceBuilders(keepInside ? PolyfaceBuilder.create() : undefined, keepOutside ? PolyfaceBuilder.create() : undefined, buildSideFaces);\n }\n\n /**\n * Return the computed facets from the selected builder.\n * @param selector the polyface to return: 0 - builderA (typically inside facets), 1 - builderB (typically outside facets)\n * @param fixup whether to clean up the polyface\n * @param tolerance compression tolerance (default [[Geometry.smallMetricDistance]]).\n */\n public claimPolyface(selector: 0 | 1, fixup: boolean, tolerance: number = Geometry.smallMetricDistance): IndexedPolyface | undefined {\n const builder = selector === 0 ? this.builderA : this.builderB;\n if (builder) {\n let polyface = builder.claimPolyface(true, tolerance);\n if (fixup) {\n polyface = PolyfaceQuery.cloneWithTVertexFixup(polyface);\n polyface = PolyfaceQuery.cloneWithDanglingEdgesRemoved(polyface);\n }\n return polyface;\n }\n return undefined;\n }\n}\n/** PolyfaceClip is a static class gathering operations using Polyfaces and clippers.\n * @public\n */\nexport class PolyfaceClip {\n /** Clip each facet of polyface to the ClipPlane.\n * * Return all surviving clip as a new mesh.\n * * WARNING: The new mesh is \"points only\" -- parameters, normals, etc are not interpolated\n */\n public static clipPolyfaceClipPlaneWithClosureFace(source: Polyface | PolyfaceVisitor, clipper: ClipPlane, insideClip: boolean = true, buildClosureFaces: boolean = true): IndexedPolyface {\n return this.clipPolyfaceClipPlane(source, clipper, insideClip, buildClosureFaces);\n }\n /** Clip each facet of polyface to the ClipPlane.\n * * Return all surviving clip as a new mesh.\n * * WARNING: The new mesh is \"points only\" -- parameters, normals, etc are not interpolated\n */\n public static clipPolyfaceClipPlane(source: Polyface | PolyfaceVisitor, clipper: ClipPlane, insideClip: boolean = true, buildClosureFaces: boolean = false): IndexedPolyface {\n const builders = ClippedPolyfaceBuilders.create(insideClip, !insideClip, buildClosureFaces);\n this.clipPolyfaceInsideOutside(source, clipper, builders);\n return builders.claimPolyface(insideClip ? 0 : 1, true)!;\n }\n\n /**\n * Clip each facet to the clipper.\n * * Return surviving facets as a new mesh.\n * * WARNING: The new mesh is \"points only\".\n */\n public static clipPolyfaceConvexClipPlaneSet(source: Polyface | PolyfaceVisitor, clipper: ConvexClipPlaneSet): IndexedPolyface {\n const visitor = source instanceof Polyface ? source.createVisitor(0) : source;\n visitor.setNumWrap(0);\n const builder = PolyfaceBuilder.create();\n const work = new GrowableXYZArray(10);\n for (visitor.reset(); visitor.moveToNextFacet();) {\n clipper.clipConvexPolygonInPlace(visitor.point, work);\n if (visitor.point.length > 2)\n builder.addPolygonGrowableXYZArray(visitor.point);\n }\n return builder.claimPolyface(true);\n }\n\n /** Clip each facet to the clippers.\n * * Add inside, outside fragments to builderA, builderB\n * * This does not consider params, normals, colors. Just points.\n * * outputSelect determines how the clip output is structured\n * * 0 outputs all shards -- this may have many interior edges.\n * * 1 stitches shards together to get cleaner facets.\n */\n public static clipPolyfaceUnionOfConvexClipPlaneSetsToBuilders(source: Polyface | PolyfaceVisitor, allClippers: UnionOfConvexClipPlaneSets, destination: ClippedPolyfaceBuilders, outputSelector: number = 1): void {\n const builderA = destination.builderA;\n const builderB = destination.builderB;\n const visitor = source instanceof Polyface ? source.createVisitor(0) : source;\n visitor.setNumWrap(0);\n const cache = new GrowableXYZArrayCache();\n const insideShards: GrowableXYZArray[] = [];\n const outsideShards: GrowableXYZArray[] = [];\n const residualPolygons: ClipCandidate[] = [];\n let candidate: ClipCandidate | undefined;\n const outsideParts: GrowableXYZArray[] = [];\n\n const numConvexSet = allClippers.convexSets.length;\n for (visitor.reset(); visitor.moveToNextFacet();) {\n residualPolygons.push(new ClipCandidate(cache.grabAndFill(visitor.point), 0));\n while ((candidate = residualPolygons.pop()) !== undefined) {\n const convexSetIndex = candidate.nextConvexSetIndex;\n if (convexSetIndex >= numConvexSet) {\n // ths remnant polygon is OUT ...\n if (candidate.points.length > 2)\n outsideShards.push(candidate.points);\n } else {\n const clipper = allClippers.convexSets[convexSetIndex];\n outsideParts.length = 0; // NO NO -- why isn't it empty from prior step cleanup?\n const insidePart = clipper.clipInsidePushOutside(candidate.points, outsideParts, cache);\n if (insidePart) {\n if (insidePart.length > 2)\n insideShards.push(insidePart);\n // Keep outside parts active for clip by later facets . . .\n for (const outsidePolygon of outsideParts) {\n residualPolygons.push(new ClipCandidate(outsidePolygon, convexSetIndex + 1));\n }\n } else {\n // Nothing was insidePart. The outside parts might be split by intermediate steps -- but all the pieces are there.\n candidate.nextConvexSetIndex++;\n residualPolygons.push(candidate);\n }\n outsideParts.length = 0;\n }\n }\n if (outsideShards.length === 0) {\n builderA?.addPolygonGrowableXYZArray(visitor.point);\n } else if (insideShards.length === 0) {\n // the facet spanned clippers but is intact outside\n builderB?.addPolygonGrowableXYZArray(visitor.point);\n } else {\n const localToWorld = FrameBuilder.createRightHandedFrame(undefined, visitor.point);\n let worldToLocal: Transform | undefined;\n if (outputSelector === 1 && localToWorld !== undefined\n && undefined !== (worldToLocal = localToWorld.inverse())) {\n this.cleanupAndAddRegion(builderA, insideShards, worldToLocal, localToWorld);\n this.cleanupAndAddRegion(builderB, outsideShards, worldToLocal, localToWorld);\n } else {\n for (const shard of insideShards)\n this.addPolygonToBuilderAndDropToCache(shard, builderA, cache);\n for (const shard of outsideShards)\n this.addPolygonToBuilderAndDropToCache(shard, builderB, cache);\n }\n }\n outsideShards.length = 0;\n insideShards.length = 0;\n }\n cache.dropAllToCache(outsideParts);\n if (destination.buildClosureFaces) {\n for (const clipper of allClippers.convexSets) {\n this.buildClosureFacesForConvexSet(visitor, clipper, destination, cache);\n }\n }\n }\n private static addRegion(builder: PolyfaceBuilder | undefined, region: AnyRegion | undefined): void {\n if (builder !== undefined && region !== undefined) {\n if (region instanceof Loop && region.children.length === 1 && region.children[0] instanceof LineString3d) {\n builder.addPolygonGrowableXYZArray(region.children[0].packedPoints);\n } else if (region instanceof UnionRegion) {\n for (const child of region.children)\n this.addRegion(builder, child);\n } else {\n assert(false, \"unexpected region encountered\");\n }\n }\n }\n // WARNING: shards are transformed into local system, not reverted!!!\n private static cleanupAndAddRegion(builder: PolyfaceBuilder | undefined, shards: GrowableXYZArray[], worldToLocal: Transform | undefined, localToWorld: Transform | undefined): void {\n if (builder !== undefined && shards.length > 0) {\n if (worldToLocal)\n GrowableXYZArray.multiplyTransformInPlace(worldToLocal, shards);\n const outsidePieces = RegionOps.polygonBooleanXYToLoops(shards, RegionBinaryOpType.Union, []);\n if (outsidePieces && outsidePieces.children.length > 0) {\n RegionOps.consolidateAdjacentPrimitives(outsidePieces); // source of the T-vertices removed in claimPolyface\n const options = new StrokeOptions();\n options.maximizeConvexFacets = true;\n const localFacets = RegionOps.facetRegionXY(outsidePieces, options);\n if (localFacets) {\n // prefer to add non-convex facets\n builder.addIndexedPolyface(localFacets, false, localToWorld);\n } else { // failsafe; we don't expect to get here\n if (localToWorld)\n outsidePieces.tryTransformInPlace(localToWorld);\n this.addRegion(builder, outsidePieces); // possibly non-convex!\n }\n }\n }\n }\n private static addPolygonToBuilderAndDropToCache(polygon: GrowableXYZArray | undefined, builder: PolyfaceBuilder | undefined, cache: GrowableXYZArrayCache): void {\n if (polygon) {\n if (builder)\n builder.addPolygonGrowableXYZArray(polygon);\n cache.dropToCache(polygon);\n }\n }\n private static addPolygonArrayToBuilderAndDropToCache(polygonArray: GrowableXYZArray[], builder: PolyfaceBuilder | undefined, cache: GrowableXYZArrayCache): void {\n let polygon;\n while ((polygon = polygonArray.pop()) !== undefined) {\n this.addPolygonToBuilderAndDropToCache(polygon, builder, cache);\n }\n }\n private static createChainContextsForConvexClipPlaneSet(clipper: ConvexClipPlaneSet): ChainMergeContext[] {\n const chainContexts = [];\n for (const plane of clipper.planes) {\n if (!plane.interior) {\n const c = ChainMergeContext.create();\n c.plane = plane;\n c.convexClipper = clipper;\n chainContexts.push(c);\n }\n }\n return chainContexts;\n }\n\n /** Clip each facet to the clippers.\n * * Add inside, outside fragments to builderA, builderB\n * * This does not consider params, normals, colors. Just points.\n * @internal\n */\n public static clipPolyfaceConvexClipPlaneSetToBuilders(source: Polyface | PolyfaceVisitor, clipper: ConvexClipPlaneSet, destination: ClippedPolyfaceBuilders): void {\n const builderA = destination.builderA;\n const builderB = destination.builderB;\n const visitor = source instanceof Polyface ? source.createVisitor(0) : source;\n visitor.setNumWrap(0);\n const cache = new GrowableXYZArrayCache();\n const outsideParts: GrowableXYZArray[] = [];\n for (visitor.reset(); visitor.moveToNextFacet();) {\n const insidePart = clipper.clipInsidePushOutside(visitor.point, outsideParts, cache);\n if (insidePart === undefined) {\n // everything is out ... outsideParts might be fragmented. Save only the original polygon\n builderB?.addPolygonGrowableXYZArray(visitor.point);\n cache.dropAllToCache(outsideParts);\n }\n this.addPolygonToBuilderAndDropToCache(insidePart, builderA, cache);\n this.addPolygonArrayToBuilderAndDropToCache(outsideParts, builderB, cache);\n }\n this.buildClosureFacesForConvexSet(visitor, clipper, destination, cache);\n }\n /**\n *\n * @param visitor visitor for all facets of interest (entire polyface)\n * @param clipper ConvexClipPlaneSet to apply\n * @param destination builders to receive inside, outside parts\n * @param cache GrowableArray cache.\n */\n private static buildClosureFacesForConvexSet(visitor: PolyfaceVisitor, clipper: ConvexClipPlaneSet, destination: ClippedPolyfaceBuilders, cache: GrowableXYZArrayCache): void {\n if (destination.buildClosureFaces) {\n const chainContexts = this.createChainContextsForConvexClipPlaneSet(clipper);\n const workPoints = cache.grabFromCache();\n const facetPoints = cache.grabFromCache();\n for (visitor.reset(); visitor.moveToNextFacet();) {\n for (const chainContext of chainContexts) {\n const plane = chainContext.plane;\n facetPoints.clear();\n facetPoints.pushFrom(visitor.point);\n IndexedXYZCollectionPolygonOps.clipConvexPolygonInPlace(plane!, facetPoints, workPoints);\n chainContext.addSegmentsOnPlane(facetPoints, true);\n }\n }\n cache.dropToCache(facetPoints);\n cache.dropToCache(workPoints);\n for (const chainContext of chainContexts) {\n this.addClosureFacets(chainContext, destination, cache);\n }\n }\n }\n\n /**\n *\n * @param visitor visitor for all facets of interest (entire polyface)\n * @param clipper ConvexClipPlaneSet to apply\n * @param destination builders to receive inside, outside parts\n * @param cache GrowableArray cache.\n */\n private static buildClosureFacesForPlane(visitor: PolyfaceVisitor, plane: PlaneAltitudeEvaluator, destination: ClippedPolyfaceBuilders, cache: GrowableXYZArrayCache): void {\n if (destination.buildClosureFaces) {\n const chainContext = ChainMergeContext.create();\n chainContext.plane = plane;\n const workPoints = cache.grabFromCache();\n const facetPoints = cache.grabFromCache();\n for (visitor.reset(); visitor.moveToNextFacet();) {\n facetPoints.clear();\n facetPoints.pushFrom(visitor.point);\n IndexedXYZCollectionPolygonOps.clipConvexPolygonInPlace(plane, facetPoints, workPoints);\n chainContext.addSegmentsOnPlane(facetPoints, true);\n }\n cache.dropToCache(facetPoints);\n cache.dropToCache(workPoints);\n this.addClosureFacets(chainContext, destination, cache);\n }\n }\n private static evaluateInwardPlaneNormal(plane: PlaneAltitudeEvaluator, scale: number): Vector3d {\n return Vector3d.create(plane.velocityXYZ(scale, 0, 0), plane.velocityXYZ(0, scale, 0), plane.velocityXYZ(0, 0, scale));\n }\n /**\n * * Triangulate the contour.\n * * Add all the triangles to both builders\n * * reversed in builderB.\n */\n private static addClippedContour(contour: SweepContour, clipper: ConvexClipPlaneSet | undefined, destination: ClippedPolyfaceBuilders, cache: GrowableXYZArrayCache): void {\n const polygonA = cache.grabFromCache();\n const polygonB = cache.grabFromCache();\n if (destination.builderB)\n destination.builderB.toggleReversedFacetFlag();\n contour.announceFacets((facets: IndexedPolyface) => {\n const visitor = facets.createVisitor();\n // The contour facets are convex .. easy clip ..\n for (visitor.reset(); visitor.moveToNextFacet();) {\n polygonA.clear();\n polygonA.pushFromGrowableXYZArray(visitor.point);\n clipper?.clipConvexPolygonInPlace(polygonA, polygonB);\n if (polygonA.length > 2) {\n destination.builderA?.addPolygonGrowableXYZArray(polygonA);\n destination.builderB?.addPolygonGrowableXYZArray(polygonA);\n }\n }\n }, undefined);\n if (destination.builderB)\n destination.builderB.toggleReversedFacetFlag();\n cache.dropToCache(polygonA);\n cache.dropToCache(polygonB);\n }\n\n /**\n * Gather loops out of the ChainMergeContext. Add to destination arrays.\n * @param chainContext ASSUMED TO HAVE A PLANE\n * @param destination\n */\n private static addClosureFacets(chainContext: ChainMergeContext, destination: ClippedPolyfaceBuilders, cache: GrowableXYZArrayCache): void {\n const clipper = chainContext.convexClipper;\n const plane = chainContext.plane!;\n const outwardNormal = this.evaluateInwardPlaneNormal(plane, -1.0);\n chainContext.clusterAndMergeVerticesXYZ();\n const loops = chainContext.collectMaximalGrowableXYZArrays();\n if (loops.length > 1) {\n const loopSets = PolygonOps.sortOuterAndHoleLoops(loops, outwardNormal);\n for (const loopSet of loopSets) {\n PolygonOps.orientLoopsCCWForOutwardNormalInPlace(loopSet, outwardNormal);\n const contour = SweepContour.createForPolygon(loopSet, outwardNormal);\n if (contour !== undefined) {\n if (clipper) {\n this.addClippedContour(contour, clipper, destination, cache);\n } else {\n if (destination.builderA)\n contour.emitFacets(destination.builderA, false);\n if (destination.builderB)\n contour.emitFacets(destination.builderB, true);\n }\n }\n }\n } else {\n PolygonOps.orientLoopsCCWForOutwardNormalInPlace(loops, outwardNormal);\n const contour = SweepContour.createForPolygon(loops, outwardNormal);\n if (contour !== undefined) {\n if (clipper) {\n this.addClippedContour(contour, clipper, destination, cache);\n } else {\n if (destination.builderA)\n contour.emitFacets(destination.builderA, false);\n if (destination.builderB)\n contour.emitFacets(destination.builderB, true);\n }\n }\n }\n }\n\n /** Clip each facet to the clippers.\n * * Add inside, outside fragments to builderA, builderB\n * * This does not consider params, normals, colors. Just points.\n * @internal\n */\n public static clipPolyfaceClipPlaneToBuilders(source: Polyface | PolyfaceVisitor, clipper: PlaneAltitudeEvaluator, destination: ClippedPolyfaceBuilders): void {\n const builderA = destination.builderA;\n const builderB = destination.builderB;\n const visitor = source instanceof Polyface ? source.createVisitor(0) : source;\n visitor.setNumWrap(0);\n const cache = new GrowableXYZArrayCache();\n const inside = cache.grabFromCache();\n const outside = cache.grabFromCache();\n const range = Range1d.createNull();\n for (visitor.reset(); visitor.moveToNextFacet();) {\n // !!! currentCandidates and next candidates are empty at this point !!!\n IndexedXYZCollectionPolygonOps.splitConvexPolygonInsideOutsidePlane(clipper, visitor.point, inside, outside, range);\n if (builderA)\n builderA.addPolygonGrowableXYZArray(inside);\n if (builderB)\n builderB.addPolygonGrowableXYZArray(outside);\n }\n this.buildClosureFacesForPlane(visitor, clipper, destination, cache);\n cache.dropToCache(inside);\n cache.dropToCache(outside);\n }\n\n /** Clip each facet to the clipper.\n * * accumulate inside and outside facets -- to destination.builderA and destination.builderB\n * * if `destination.buildClosureFaces` is set, also build closure facets.\n * * This method parses the variant input types and calls a more specific method.\n * * WARNING: The new mesh is \"points only\".\n * * outputSelect applies only for UnionOfConvexClipPlaneSets -- see [[PolyfaceClip.clipPolyfaceUnionOfConvexClipPlaneSetsToBuilders]]\n */\n public static clipPolyfaceInsideOutside(source: Polyface | PolyfaceVisitor, clipper: ClipPlane | ConvexClipPlaneSet | UnionOfConvexClipPlaneSets, destination: ClippedPolyfaceBuilders, outputSelect: number = 0): void {\n if (clipper instanceof ClipPlane)\n this.clipPolyfaceClipPlaneToBuilders(source, clipper, destination);\n else if (clipper instanceof ConvexClipPlaneSet)\n this.clipPolyfaceConvexClipPlaneSetToBuilders(source, clipper, destination);\n else if (clipper instanceof UnionOfConvexClipPlaneSets)\n this.clipPolyfaceUnionOfConvexClipPlaneSetsToBuilders(source, clipper, destination, outputSelect);\n }\n /** Clip each facet to the clipper.\n * * This method parses the variant input types and calls a more specific method.\n * * To get both inside and outside parts, use clipPolyfaceInsideOutside\n * * WARNING: The new mesh is \"points only\".\n */\n public static clipPolyface(source: Polyface | PolyfaceVisitor, clipper: ClipPlane | ConvexClipPlaneSet): Polyface | undefined {\n if (clipper instanceof ClipPlane)\n return this.clipPolyfaceClipPlane(source, clipper);\n if (clipper instanceof ConvexClipPlaneSet)\n return this.clipPolyfaceConvexClipPlaneSet(source, clipper);\n // (The if tests exhaust the type space -- this line is unreachable.)\n return undefined;\n }\n /**\n * Drape the region onto the mesh.\n * * This method computes the portion of the input mesh that lies inside the clipper generated from sweeping the input region in the given direction.\n * @param mesh input mesh, untouched\n * @param region planar region to drape onto mesh\n * @param sweepVector optional sweep direction for region, magnitude unused. If undefined, sweep is along the region normal.\n * @param options how to stroke the region boundary\n * @returns clipped facets. No other mesh data but vertices appear in output.\n */\n public static drapeRegion(mesh: Polyface | PolyfaceVisitor, region: AnyRegion, sweepVector?: Vector3d, options?: StrokeOptions): IndexedPolyface | undefined {\n if (mesh instanceof Polyface)\n return this.drapeRegion(mesh.createVisitor(0), region, sweepVector, options);\n const contour = SweepContour.createForLinearSweep(region);\n if (!contour)\n return undefined;\n let sweep = sweepVector;\n if (sweepVector && contour.localToWorld.matrix.dotColumnZ(sweepVector) < 0.0)\n sweep = sweepVector.scale(-1); // avoid inverted clipper\n const clipper = contour.sweepToUnionOfConvexClipPlaneSets(sweep, false, false, options);\n if (!clipper)\n return undefined;\n const builders = ClippedPolyfaceBuilders.create(true); // we want only the facets inside the clipper\n this.clipPolyfaceUnionOfConvexClipPlaneSetsToBuilders(mesh, clipper, builders, 1);\n return builders.claimPolyface(0, true);\n }\n /** Find consecutive points around a polygon (with implied closure edge) that are ON a plane\n * @param points array of points around polygon. Closure edge is implied.\n * @param chainContext context receiving edges\n * @param point0 work point\n * @param point1 work point\n */\n private static collectEdgesOnPlane(points: GrowableXYZArray, clipper: ClipPlane, chainContext: ChainMergeContext, point0: Point3d, point1: Point3d): void {\n const n = points.length;\n if (n > 1) {\n points.getPoint3dAtUncheckedPointIndex(n - 1, point0);\n for (let i = 0; i < n; i++) {\n points.getPoint3dAtUncheckedPointIndex(i, point1);\n if (clipper.isPointOn(point0) && clipper.isPointOn(point1))\n chainContext.addSegment(point0, point1);\n point0.setFromPoint3d(point1);\n }\n }\n }\n /** Intersect each facet with the clip plane. (Producing intersection edges.)\n * * Return all edges chained as array of LineString3d.\n */\n public static sectionPolyfaceClipPlane(source: Polyface | PolyfaceVisitor, clipper: ClipPlane): LineString3d[] {\n const chainContext = ChainMergeContext.create();\n const visitor = source instanceof Polyface ? source.createVisitor(0) : source;\n visitor.setNumWrap(0);\n const work = new GrowableXYZArray(10);\n const point0 = Point3d.create();\n const point1 = Point3d.create();\n for (visitor.reset(); visitor.moveToNextFacet();) {\n clipper.clipConvexPolygonInPlace(visitor.point, work, true);\n this.collectEdgesOnPlane(visitor.point, clipper, chainContext, point0, point1);\n }\n chainContext.clusterAndMergeVerticesXYZ();\n return chainContext.collectMaximalChains();\n }\n\n /**\n * * Split facets of mesh \"A\" into parts that are\n * * under mesh \"B\"\n * * over mesh \"B\"\n * * both meshes are represented by visitors rather than the meshes themselves\n * * If the data in-hand is a mesh, call with `mesh.createVisitor`\n * * The respective clip parts are fed to caller-supplied builders.\n * * Caller may set either or both builders to toggle facet order (e.g. toggle the lower facets to make them \"point down\" in cut-fill application)\n * * This step is commonly one-half of \"cut fill\".\n * * A \"cut fill\" wrapper will call this twice with the visitor and builder roles reversed.\n * * Both polyfaces are assumed convex with CCW orientation viewed from above.\n * @param visitorA iterator over polyface to be split.\n * @param visitorB iterator over polyface that acts as a splitter\n * @param orientUnderMeshDownward if true, the \"meshAUnderB\" output is oriented with its normals reversed so it can act as the bottom side of a cut-fill pair.\n */\n public static clipPolyfaceUnderOverConvexPolyfaceIntoBuilders(visitorA: PolyfaceVisitor, visitorB: PolyfaceVisitor, builderAUnderB: PolyfaceBuilder | undefined, builderAOverB: PolyfaceBuilder | undefined): void {\n const rangeDataA = PolyfaceQuery.collectRangeLengthData(visitorA);\n const searchA = RangeSearch.create2dSearcherForRangeLengthData<number>(rangeDataA);\n if (!searchA)\n return;\n const range = Range3d.create();\n for (visitorA.reset(); visitorA.moveToNextFacet();) {\n visitorA.point.setRange(range);\n searchA.addRange(range, visitorA.currentReadIndex());\n }\n const xyClip = new GrowableXYZArray(10);\n const workArray = new GrowableXYZArray(10);\n const xyFrustum = ConvexClipPlaneSet.createEmpty();\n const below = new GrowableXYZArray(10);\n const above = new GrowableXYZArray(10);\n const planeOfFacet = ClipPlane.createNormalAndPointXYZXYZ(0, 0, 1, 0, 0, 0)!;\n const altitudeRange = Range1d.createNull();\n\n for (visitorB.reset(); visitorB.moveToNextFacet();) {\n visitorB.point.setRange(range);\n ConvexClipPlaneSet.setPlaneAndXYLoopCCW(visitorB.point, planeOfFacet, xyFrustum);\n searchA.searchRange2d(range, (_rangeA: Range2d, readIndexA: number) => {\n visitorA.moveToReadIndex(readIndexA);\n xyFrustum.polygonClip(visitorA.point, xyClip, workArray);\n // builderAOverB.addPolygonGrowableXYZArray(xyClip);\n if (xyClip.length > 0) {\n // planeOfFacet.convexPolygonSplitInsideOutsideGrowableArrays(xyClip, below, above, altitudeRange);\n IndexedXYZCollectionPolygonOps.splitConvexPolygonInsideOutsidePlane(planeOfFacet, xyClip, below, above, altitudeRange);\n if (below.length > 0 && builderAUnderB)\n builderAUnderB.addPolygonGrowableXYZArray(below);\n if (above.length > 0 && builderAOverB)\n builderAOverB.addPolygonGrowableXYZArray(above);\n }\n return true;\n });\n }\n }\n\n /**\n * * Split facets into vertically overlapping sections\n * * both meshes are represented by visitors rather than the meshes themselves\n * * If the data in-hand is a mesh, call with `mesh.createVisitor`\n * * The respective clip parts are returned as separate meshes.\n * * Caller may set either or both builders to toggle facet order (e.g. toggle the lower facets to make them \"point down\" in cut-fill application)\n * * Both polyfaces are assumed convex with CCW orientation viewed from above.\n * * Each output contains some facets from meshA and some from meshB:\n * * meshAUnderB -- areas where meshA is underneath mesh B.\n * * If A is \"design surface\" and B is existing DTM, this is \"cut\" volume\n * * meshAOverB -- areas where meshB is over meshB.\n * * If A is \"design surface\" and B is existing DTM, this is \"fill\" volume\n *\n * @param visitorA iterator over polyface to be split.\n * @param visitorB iterator over polyface that acts as a splitter\n * @param orientUnderMeshDownward if true, the \"meshAUnderB\" output is oriented with its normals reversed so it can act as the bottom side of a cut-fill pair.\n */\n public static computeCutFill(meshA: IndexedPolyface, meshB: IndexedPolyface): { meshAUnderB: IndexedPolyface, meshAOverB: IndexedPolyface } {\n const visitorA = meshA.createVisitor();\n const visitorB = meshB.createVisitor();\n const builderAUnderB = PolyfaceBuilder.create();\n const builderAOverB = PolyfaceBuilder.create();\n builderAUnderB.toggleReversedFacetFlag();\n this.clipPolyfaceUnderOverConvexPolyfaceIntoBuilders(visitorA, visitorB, builderAUnderB, builderAOverB);\n builderAUnderB.toggleReversedFacetFlag();\n builderAOverB.toggleReversedFacetFlag();\n this.clipPolyfaceUnderOverConvexPolyfaceIntoBuilders(visitorB, visitorA, builderAOverB, builderAUnderB);\n return {\n meshAUnderB: builderAUnderB.claimPolyface(),\n meshAOverB: builderAOverB.claimPolyface(),\n };\n }\n}\n"]}
|
|
@@ -187,7 +187,7 @@ export declare class PolyfaceData {
|
|
|
187
187
|
resizeAllArrays(length: number): void;
|
|
188
188
|
/**
|
|
189
189
|
* Resize all data arrays to the specified `length`.
|
|
190
|
-
* @deprecated in 4.
|
|
190
|
+
* @deprecated in 4.5.0 - will not be removed until after 2026-06-13. Because name is misleading. Call [[PolyfaceData.resizeAllArrays]] instead.
|
|
191
191
|
*/
|
|
192
192
|
resizeAllDataArrays(length: number): void;
|
|
193
193
|
/** Return the range of the point array (optionally transformed). */
|
|
@@ -503,7 +503,7 @@ export class PolyfaceData {
|
|
|
503
503
|
}
|
|
504
504
|
/**
|
|
505
505
|
* Resize all data arrays to the specified `length`.
|
|
506
|
-
* @deprecated in 4.
|
|
506
|
+
* @deprecated in 4.5.0 - will not be removed until after 2026-06-13. Because name is misleading. Call [[PolyfaceData.resizeAllArrays]] instead.
|
|
507
507
|
*/
|
|
508
508
|
resizeAllDataArrays(length) {
|
|
509
509
|
if (length > this.point.length) {
|