@itwin/core-geometry 5.1.0-dev.9 → 5.2.0-dev.2
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 +63 -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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IndexedPolyfaceWalker.js","sourceRoot":"","sources":["../../../src/polyface/IndexedPolyfaceWalker.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F;;GAEG;AAEH,OAAO,EAAE,kBAAkB,EAAuB,MAAM,sBAAsB,CAAC;AAI/E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2DG;AACH,MAAM,OAAO,qBAAqB;IAChC,oCAAoC;IAC5B,SAAS,CAAkB;IACnC,+CAA+C;IACvC,UAAU,CAAqB;IACvC,kBAAkB;IAClB,YAAoB,QAAyB,EAAE,SAA6B;QAC1E,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;QAC1B,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC;IAC9B,CAAC;IACD;;;;OAIG;IACH,IAAW,SAAS;QAClB,OAAO,IAAI,CAAC,UAAU,CAAC;IACzB,CAAC;IAED,0CAA0C;IAC1C,IAAW,QAAQ;QACjB,OAAO,IAAI,CAAC,SAAS,CAAC;IACxB,CAAC;IACD;;;OAGG;IACH,IAAW,OAAO;QAChB,OAAO,IAAI,CAAC,UAAU,KAAK,SAAS,CAAC;IACvC,CAAC;IACD;;;;;;OAMG;IACH,IAAW,WAAW;QACpB,OAAO,IAAI,CAAC,UAAU,KAAK,SAAS,CAAC;IACvC,CAAC;IACD;;;;;;OAMG;IACI,MAAM,CAAC,iBAAiB,CAAC,QAAyB,EAAE,SAAkB;QAC3E,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,gBAAgB,CAAC,SAAS,CAAC;YAC5C,SAAS,GAAG,SAAS,CAAC;QACxB,OAAO,IAAI,qBAAqB,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC;IACxD,CAAC;IACD;;;;;;;;OAQG;IACI,MAAM,CAAC,kBAAkB,CAAC,QAAyB,EAAE,UAAkB,EAAE,oBAA4B,CAA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sB,CAAC,YAAY,EAAE,UAAU,EAAE,SAAS,EAAE,gBAAgB,CAAC,CAAC;QAEtF,MAAM,QAAQ,GAAG,QAAQ,CAAC,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC;QACjD,QAAQ,CAAC,IAAI,CAAC,aAAa,GAAG,IAAI,KAAK,CAAqB,QAAQ,CAAC,CAAC;QACtE,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,QAAQ,EAAE,CAAC,EAAE;YAC/B,QAAQ,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC;QAC7C,KAAK,MAAM,IAAI,IAAI,YAAY,EAAE,CAAC;YAChC,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;gBAC7C,MAAM,EAAE,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC;gBAC9B,MAAM,EAAE,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC;gBAC9B,QAAQ,CAAC,IAAI,CAAC,aAAa,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC;gBACrC,QAAQ,CAAC,IAAI,CAAC,aAAa,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC;YACvC,CAAC;QACH,CAAC;IACH,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 { IndexedEdgeMatcher, SortableEdgeCluster } from \"./IndexedEdgeMatcher\";\nimport { IndexedPolyfaceVisitor } from \"./IndexedPolyfaceVisitor\";\nimport { IndexedPolyface } from \"./Polyface\";\n\n/**\n * The `IndexedPolyfaceWalker` class supports navigation around facets, across edges, and around vertices in an\n * [[IndexedPolyface]].\n * * Compare to the [[IndexedPolyfaceVisitor]] class, which supports the iteration of facets in an `IndexedPolyface`.\n * * A one-time call to [[buildEdgeMateIndices]] creates and populates the `data.edgeMateIndex` array on the input.\n * * This array essentially completes the topology of the `IndexedPolyface` by storing facet adjacency.\n * * After this setup, caller code can create `IndexedPolyfaceWalker` objects via:\n * * `walker = IndexedPolyfaceWalker.createAtFacetIndex(polyface, facetIndex, offsetWithinFacet)`\n * * `walker = IndexedPolyfaceWalker.createAtEdgeIndex(polyface, edgeIndex)`\n * * `walker = IndexedPolyfaceWalker.createAtVisitor(visitor, offsetWithinFacet)`\n * * Once you have a walker object, you can traverse the facet, edge, and vertex loops it references. For\n * example, if `walker.edgeIndex === A`, referring to the right edge of the upper left facet pictured below, then\n * the following are true:\n * * `walker.nextAroundFacet().edgeIndex === B`\n * * `walker.previousAroundFacet().edgeIndex === C`\n * * `walker.edgeMate().edgeIndex === F`\n * * `walker.nextAroundVertex().edgeIndex === E`\n * * `walker.previousAroundVertex().edgeIndex === D`\n* ```\n * # --------- # --------- #\n * | < < < B | F |\n * | ^ | v |\n * | ^ | v |\n * | ^ | v |\n * | C > > > A | D > > > |\n * # --------- # --------- #\n * | < < < E | |\n * | | |\n * | | |\n * | | |\n * # --------- # --------- #\n * ```\n* * When facets are viewed so that the face loops stored in the [[PolyfaceData]] `pointIndex` array have\n * counterclockwise ordering, an edge \"from A to B\" has facet area to the left and the edge to the right. Likewise,\n * the edges \"out of\" locations B, C, E, F, D are directed as depicted above.\n * * With this conventional counterclockwise ordering of face loops, \"next\" is counterclockwise, and \"previous\" is\n * clockwise:\n * * The [[nextAroundFacet]] step is counterclockwise around the facet.\n * * The [[previousAroundFacet]] step is clockwise around the facet.\n * * The [[nextAroundVertex]] step is counterclockwise around the vertex.\n * * The [[previousAroundVertex]] step is clockwise around the vertex.\n * * The `nextAroundFacet` steps for a walker and its [[edgeMate]] are in opposite directions along their shared edge,\n * when that edge is interior. Thus the `edgeMate` step can be seen to iterate an \"edge loop\" of two locations for an\n * interior edges.\n * * Invalid Walkers:\n * * An invalid walker has undefined [[edgeIndex]]. For these walkers, [[isUndefined]] returns true, and [[isValid]]\n * returns false. Traversal operations on an invalid walker return an invalid walker.\n * * Invalid walkers are expected during traversals of a mesh with boundary edges, so calling code must be prepared.\n * Boundary edges have exactly one adjacent facet, so for these edges the `edgeMate` step returns an invalid walker.\n * In the diagram above, the `edgeMate` of boundary edge B is undefined.\n * * Invalid walkers can occur while traversing boundary vertices as well. If an edge lacks an `edgeMate`, then the\n * `previousAroundVertex` step yields an invalid walker, because `previousAroundVertex` is implemented as `edgeMate`\n * followed by `nextAroundFacet`. In the diagram above, the `previousAroundVertex` step at boundary edge B yields\n * undefined walker. Similarly, the `nextAroundVertex` step at edge F yields undefined walker.\n * * Invalid walkers can also occur while traversing a non-manifold mesh. Such meshes feature edge(s) with more than\n * two adjacent facets, or with two adjacent facets that have opposite orientations. These meshes are uncommon, and\n * usually indicate a construction problem.\n * * See [[buildEdgeMateIndices]] for further description of the topological relations.\n * @public\n */\nexport class IndexedPolyfaceWalker {\n /** The polyface being traversed. */\n private _polyface: IndexedPolyface;\n /** The current edgeIndex into the polyface. */\n private _edgeIndex: number | undefined;\n /** Constructor */\n private constructor(polyface: IndexedPolyface, edgeIndex: number | undefined) {\n this._polyface = polyface;\n this._edgeIndex = edgeIndex;\n }\n /**\n * Return the edge index of this walker.\n * * This is an index into the polyface's `data.pointIndex` array.\n * * Can be undefined.\n */\n public get edgeIndex(): number | undefined {\n return this._edgeIndex;\n }\n\n /** Return the polyface of this walker. */\n public get polyface(): IndexedPolyface | undefined {\n return this._polyface;\n }\n /**\n * Return true if the walker's edgeIndex is defined.\n * * This method is the opposite of [[isUndefined]].\n */\n public get isValid(): boolean {\n return this._edgeIndex !== undefined;\n }\n /**\n * Return true if the walker's edgeIndex is undefined.\n * * This method is the opposite of [[isValid]].\n * * This can happen during a walk when the walker `w` reaches an exterior edge, for then\n * `w.edgeMate(w).isUndefined === true`.\n * * This can also happen when methods that return a walker receive invalid input.\n */\n public get isUndefined(): boolean {\n return this._edgeIndex === undefined;\n }\n /**\n * Create a walker for a given polyface at an optional edge.\n * @param polyface reference to the client polyface. This reference is captured (the polyface is not copied).\n * @param edgeIndex optional indication of where to start the walker within the mesh.\n * * If the edgeIndex is valid for the input polyface, the new walker is started there.\n * * If the edgeIndex is undefined or invalid for the input polyface, the walker returns true for [[isUndefined]].\n */\n public static createAtEdgeIndex(polyface: IndexedPolyface, edgeIndex?: number): IndexedPolyfaceWalker {\n if (!polyface.data.isValidEdgeIndex(edgeIndex))\n edgeIndex = undefined;\n return new IndexedPolyfaceWalker(polyface, edgeIndex);\n }\n /**\n * Create a walker for a given polyface at a specified facet.\n * * If `facetIndex` or `offsetWithinFacet` is invalid for the input polyface, the walker returns true for\n * [[isUndefined]].\n * @param polyface the polyface to reference\n * @param facetIndex index of the facet to reference\n * @param offsetWithinFacet optional 0-based offset within the face loop of the facet (default 0). This allows\n * the caller to start the walker at a particular edge of the facet.\n */\n public static createAtFacetIndex(polyface: IndexedPolyface, facetIndex: number, offsetWithinFacet: number = 0): IndexedPolyfaceWalker {\n if (polyface.isValidFacetIndex(facetIndex)) {\n const k0 = polyface.facetIndex0(facetIndex);\n const k1 = polyface.facetIndex1(facetIndex);\n if (0 <= offsetWithinFacet && k0 + offsetWithinFacet < k1)\n return new IndexedPolyfaceWalker(polyface, k0 + offsetWithinFacet);\n }\n return new IndexedPolyfaceWalker(polyface, undefined);\n }\n /**\n * Create a walker at the facet specified by a visitor.\n * @param visitor visitor whose currentReadIndex identifies the facet.\n * @param offsetWithinFacet optional 0-based offset within the face loop of the facet (default 0). This allows\n * the caller to start the walker at a particular edge of the facet.\n */\n public static createAtVisitor(visitor: IndexedPolyfaceVisitor, offsetWithinFacet: number = 0): IndexedPolyfaceWalker {\n const facetIndex = visitor.currentReadIndex();\n return IndexedPolyfaceWalker.createAtFacetIndex(visitor.clientPolyface(), facetIndex, offsetWithinFacet);\n }\n /**\n * Create a new IndexedPolyfaceWalker from the instance.\n * * The returned walker refers to the same polyface.\n * * If `edgeIndex` is undefined, the returned walker refers to the same edge as the instance.\n * * If `edgeIndex` is defined and valid, the returned walker refers to this edge.\n * * If `edgeIndex` is defined but invalid, return undefined.\n */\n public clone(edgeIndex?: number): IndexedPolyfaceWalker | undefined {\n if (edgeIndex === undefined)\n edgeIndex = this._edgeIndex;\n if (this._polyface.data.isValidEdgeIndex(edgeIndex))\n return new IndexedPolyfaceWalker(this._polyface, edgeIndex);\n return undefined;\n }\n /**\n * Load the walker's facet into the given visitor.\n * @returns true if the visitor and walker reference the same polyface and the walker has a valid edge index.\n */\n public loadVisitor(visitor: IndexedPolyfaceVisitor): boolean {\n if (visitor.clientPolyface() !== this._polyface)\n return false;\n const facetIndex = this._polyface.edgeIndexToFacetIndex(this._edgeIndex);\n return (facetIndex !== undefined) ? visitor.moveToReadIndex(facetIndex) : false;\n }\n /**\n * Test if two walkers are at different edges in the same polyface.\n * * If either has undefined edge, return false.\n * * If they are in different polyfaces, return false.\n * * If they are the same edge in the same polyface, return false.\n * * Otherwise return true.\n */\n public isDifferentEdgeInSamePolyface(other: IndexedPolyfaceWalker): boolean {\n if (this.isUndefined || other.isUndefined)\n return false;\n return this._polyface === other._polyface && this._edgeIndex !== other.edgeIndex;\n }\n /**\n * Test if two walkers are in the same polyface at the same edge.\n * * If either has undefined edge, return false.\n * * If they are in different polyfaces, return false.\n * * If they are the same edge in the same polyface, return true.\n */\n public isSameEdge(other: IndexedPolyfaceWalker): boolean {\n return this._polyface === other._polyface && this.isValid && this._edgeIndex === other._edgeIndex;\n }\n\n /**\n * Return a walker with given edgeIndex and polyface from the calling instance.\n * * If `result` is supplied, that walker is filled and returned.\n * * If `result` is not supplied, a new walker is created.\n */\n private createResult(result: undefined | IndexedPolyfaceWalker, edgeIndex: undefined | number): IndexedPolyfaceWalker {\n if (result === undefined)\n return new IndexedPolyfaceWalker(this._polyface, edgeIndex);\n result._polyface = this._polyface;\n result._edgeIndex = edgeIndex;\n return result;\n }\n /**\n * Return a walker (new or reused) at the next edge around the facet.\n * * \"Next\" is in the order of indices in the face loop of this facet.\n * * If the instance has undefined edgeIndex, the result also has undefined edgeIndex.\n * @param result optional receiver to modify and return. May be the same as `this` to move the instance walker\n * to the new location and return it.\n */\n public nextAroundFacet(result?: IndexedPolyfaceWalker): IndexedPolyfaceWalker {\n const k = this._edgeIndex;\n if (k === undefined)\n return this.createResult(result, undefined);\n const facetIndex = this._polyface.edgeIndexToFacetIndex(k);\n if (facetIndex === undefined)\n return this.createResult(result, undefined);\n const k2 = this._polyface.facetIndex1(facetIndex);\n const k1 = k + 1;\n if (k1 < k2)\n return this.createResult(result, k1);\n return this.createResult(result, this._polyface.facetIndex0(facetIndex));\n }\n /**\n * Return a walker (new or reused) at the previous edge around the facet.\n * * \"Previous\" is in the reverse order of indices in the face loop of this facet.\n * * If the instance has undefined edgeIndex, the result also has undefined edgeIndex.\n * @param result optional receiver to modify and return. May be the same as `this` to move the instance walker\n * to the new location and return it.\n */\n public previousAroundFacet(result?: IndexedPolyfaceWalker): IndexedPolyfaceWalker {\n let k = this._edgeIndex;\n if (k === undefined)\n return this.createResult(result, undefined);\n const facetIndex = this._polyface.edgeIndexToFacetIndex(k);\n if (facetIndex === undefined)\n return this.createResult(result, undefined);\n const k0 = this._polyface.facetIndex0(facetIndex);\n if (k === k0)\n k = this._polyface.facetIndex1(facetIndex) - 1;\n else\n k--;\n return this.createResult(result, k);\n }\n /**\n * Return a walker (new or reused) at the edge mate of this walker's edge.\n * * The returned walker has undefined edgeIndex if:\n * * the instance is at a boundary edge, i.e., there is no facet on the other side, or\n * * the instance has undefined edgeIndex.\n * @param result optional receiver to modify and return. May be the same as `this` to move the instance walker\n * to the new location and return it.\n */\n public edgeMate(result?: IndexedPolyfaceWalker): IndexedPolyfaceWalker {\n return this.createResult(result, this._polyface.data.edgeIndexToEdgeMateIndex(this._edgeIndex));\n }\n /**\n * Return a walker (new or reused) at the next outbound edge around the vertex at the base of this walker's edge.\n * * If the facet is viewed so that its \"nextAroundFacet\" direction appears counterclockwise, then the \"next\"\n * outbound edge is counterclockwise around the base vertex.\n * * The returned walker has undefined edgeIndex if:\n * * the previous edge around the facet is a boundary edge, i.e., there is no facet on the other side, or\n * * the instance has undefined edgeIndex.\n * @param result optional receiver to modify and return. May be the same as `this` to move the instance walker\n * to the new location and return it.\n */\n public nextAroundVertex(result?: IndexedPolyfaceWalker): IndexedPolyfaceWalker {\n const result1 = this.previousAroundFacet(result);\n return result1.edgeMate(result1);\n }\n /**\n * Return a walker (new or reused) at the previous outbound edge around the vertex at the base of this walker's edge.\n * * If the facet is viewed so that its \"nextAroundFacet\" direction appears counterclockwise, then the \"previous\"\n * outbound edge is clockwise around the base vertex.\n * * The returned walker has undefined edgeIndex if:\n * * the instance edge is a boundary edge, i.e., there is no facet on the other side, or\n * * the instance has undefined edgeIndex.\n * @param result optional receiver to modify and return. May be the same as `this` to move the instance walker\n * to the new location and return it.\n */\n public previousAroundVertex(result?: IndexedPolyfaceWalker): IndexedPolyfaceWalker {\n const result1 = this.edgeMate(result);\n return result1.nextAroundFacet(result1);\n }\n\n /**\n * Build the edgeMate index array into the polyface's [[PolyfaceData]].\n * After this method:\n * * The array `polyface.data.edgeMateIndex` is defined with the same length as the other PolyfaceData index arrays.\n * * For each interior edge, `polyface.data.edgeIndexToEdgeMateIndex` returns the edgeIndex on the other side of the\n * edge in the adjacent facet.\n * * The conditions for edgeMate matching are:\n * * Given facetIndex f, let `k0 = polyface.facetIndex0(f)` and `k1 = polyface.facetIndex1(f)`.\n * * Every edgeIndex k in the face loop of facet f satisfies `k0 <= k < k1`.\n * * The edge with edgeIndex k starts at the point with index `polyface.data.pointIndex[k]`.\n * * Let kA be an edgeIndex in this range [k0,k1), and let kB be its in-range successor with cyclic wrap, i.e.,\n * `kB === (kA + 1 === k1) ? k0 : kA + 1`.\n * * Then `polyface.data.pointIndex[kA]` and `polyface.data.pointIndex[kB]` are the indices of the points at the\n * start and end of an edge of that facet.\n * * We call kA the _edgeIndex_ for that edge, and kB the _edgeIndex_ for the next edge around the facet.\n * * If kA is an interior edge in a 2-manifold mesh with properly oriented facets, then there is an adjacent facet\n * whose face loop contains edgeIndices kC and kD referencing the same edge vertices in reverse order, i.e.,\n * * `polyface.data.pointIndex[kA] === polyface.data.pointIndex[kD]`\n * * `polyface.data.pointIndex[kB] === polyface.data.pointIndex[kC]`\n * * Given this relationship, we say that edgeIndices kA and kC are _edge mates_.\n * * A non-interior edge either lies on the boundary of the mesh or is non-manifold (having more than two adjacent\n * facets, or one with the wrong orientation). These edges have no edge mate.\n * * These conditions define a conventional manifold mesh where each edge of a facet has at most one partner edge with\n * opposite orientation in an adjacent facet.\n * * After calling this method, the caller can construct `IndexedPolyfaceWalker` objects to traverse the mesh by\n * walking across edges, around faces, and around vertices. Let walkerA have edgeIndex value kA. Then with the\n * aforementioned edgeIndices:\n * * `walkerC = walkerA.edgeMate()` moves across the edge to its other end, at kC.\n * * `walkerB = walkerA.nextAroundFacet()` moves around the facet to the next edge, at kB.\n * * `walkerB.previousAroundFacet()` moves from kB back to kA.\n * * `walkerD = walkerA.previousAroundVertex()` moves around the vertex to the next edge kD.\n * * `walkerD1 = walkerC.nextAroundFacet()` also moves to kD.\n * * `walkerD.nextAroundVertex()` moves from kD back to kA.\n */\n public static buildEdgeMateIndices(polyface: IndexedPolyface): void {\n const matcher = new IndexedEdgeMatcher();\n const numFacet = polyface.facetCount;\n for (let facetIndex = 0; facetIndex < numFacet; facetIndex++) {\n const kStart = polyface.facetIndex0(facetIndex);\n const kEnd = polyface.facetIndex1(facetIndex);\n let k0 = kEnd - 1;\n // sneaky: addEdge 3rd arg is edgeIndex k0 instead of facetIndex; it gets carried around during matching\n for (let k1 = kStart; k1 < kEnd; k0 = k1, k1++)\n matcher.addEdge(polyface.data.pointIndex[k0], polyface.data.pointIndex[k1], k0);\n }\n const matchedPairs: SortableEdgeCluster[] = [];\n const singletons: SortableEdgeCluster[] = [];\n const nullEdges: SortableEdgeCluster[] = [];\n const allOtherClusters: SortableEdgeCluster[] = [];\n matcher.sortAndCollectClusters(matchedPairs, singletons, nullEdges, allOtherClusters);\n\n const numIndex = polyface.data.pointIndex.length;\n polyface.data.edgeMateIndex = new Array<number | undefined>(numIndex);\n for (let i = 0; i < numIndex; i++)\n polyface.data.edgeMateIndex[i] = undefined;\n for (const pair of matchedPairs) {\n if (Array.isArray(pair) && pair.length === 2) {\n const k0 = pair[0].facetIndex;\n const k1 = pair[1].facetIndex;\n polyface.data.edgeMateIndex[k0] = k1;\n polyface.data.edgeMateIndex[k1] = k0;\n }\n }\n }\n}\n\n"]}
|
|
1
|
+
{"version":3,"file":"IndexedPolyfaceWalker.js","sourceRoot":"","sources":["../../../src/polyface/IndexedPolyfaceWalker.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F;;GAEG;AAEH,OAAO,EAAE,kBAAkB,EAAuB,MAAM,sBAAsB,CAAC;AAI/E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4DG;AACH,MAAM,OAAO,qBAAqB;IAChC,oCAAoC;IAC5B,SAAS,CAAkB;IACnC,+CAA+C;IACvC,UAAU,CAAqB;IACvC,kBAAkB;IAClB,YAAoB,QAAyB,EAAE,SAA6B;QAC1E,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;QAC1B,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC;IAC9B,CAAC;IACD;;;;OAIG;IACH,IAAW,SAAS;QAClB,OAAO,IAAI,CAAC,UAAU,CAAC;IACzB,CAAC;IAED,0CAA0C;IAC1C,IAAW,QAAQ;QACjB,OAAO,IAAI,CAAC,SAAS,CAAC;IACxB,CAAC;IACD;;;OAGG;IACH,IAAW,OAAO;QAChB,OAAO,IAAI,CAAC,UAAU,KAAK,SAAS,CAAC;IACvC,CAAC;IACD;;;;;;OAMG;IACH,IAAW,WAAW;QACpB,OAAO,IAAI,CAAC,UAAU,KAAK,SAAS,CAA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CAAC,CAAC,CAAC,UAAU,CAAC;gBACtC,QAAQ,CAAC,IAAI,CAAC,aAAa,CAAC,UAAU,CAAC,GAAG,UAAU,CAAC,CAAC,mCAAmC;gBACzF,QAAQ,CAAC,IAAI,CAAC,aAAa,CAAC,UAAU,CAAC,GAAG,UAAU,CAAC;YACvD,CAAC;QACH,CAAC;QACD,KAAK,MAAM,iBAAiB,IAAI,SAAS,EAAE,CAAC;YAC1C,MAAM,WAAW,GAAG,KAAK,CAAC,OAAO,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC;YAC/F,KAAK,MAAM,QAAQ,IAAI,WAAW,EAAE,CAAC;gBACnC,MAAM,SAAS,GAAG,QAAQ,CAAC,UAAU,CAAC;gBACtC,QAAQ,CAAC,IAAI,CAAC,aAAa,CAAC,SAAS,CAAC,GAAG,SAAS,CAAC,CAAC,+BAA+B;YACrF,CAAC;QACH,CAAC;IACH,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 { IndexedEdgeMatcher, SortableEdgeCluster } from \"./IndexedEdgeMatcher\";\nimport { IndexedPolyfaceVisitor } from \"./IndexedPolyfaceVisitor\";\nimport { IndexedPolyface } from \"./Polyface\";\n\n/**\n * The `IndexedPolyfaceWalker` class supports navigation around facets, across edges, and around vertices in an\n * [[IndexedPolyface]].\n * * Compare to the [[IndexedPolyfaceVisitor]] class, which supports the iteration of facets in an `IndexedPolyface`.\n * * A one-time call to [[buildEdgeMateIndices]] creates and populates the `data.edgeMateIndex` array on the input.\n * * This array essentially completes the topology of the `IndexedPolyface` by storing facet adjacency.\n * * After this setup, caller code can create `IndexedPolyfaceWalker` objects via:\n * * `walker = IndexedPolyfaceWalker.createAtFacetIndex(polyface, facetIndex, offsetWithinFacet)`\n * * `walker = IndexedPolyfaceWalker.createAtEdgeIndex(polyface, edgeIndex)`\n * * `walker = IndexedPolyfaceWalker.createAtVisitor(visitor, offsetWithinFacet)`\n * * Once you have a walker object, you can traverse the facet, edge, and vertex loops it references. For\n * example, if `walker.edgeIndex === A`, referring to the right edge of the upper left facet pictured below, then\n * the following are true:\n * * `walker.nextAroundFacet().edgeIndex === B`\n * * `walker.previousAroundFacet().edgeIndex === C`\n * * `walker.edgeMate().edgeIndex === F`\n * * `walker.nextAroundVertex().edgeIndex === E`\n * * `walker.previousAroundVertex().edgeIndex === D`\n* ```\n * # --------- # --------- #\n * | < < < B | F |\n * | ^ | v |\n * | ^ | v |\n * | ^ | v |\n * | C > > > A | D > > > |\n * # --------- # --------- #\n * | < < < E | |\n * | | |\n * | | |\n * | | |\n * # --------- # --------- #\n * ```\n* * When facets are viewed so that the face loops stored in the [[PolyfaceData]] `pointIndex` array have\n * counterclockwise ordering, an edge \"from A to B\" has facet area to the left and the edge to the right. Likewise,\n * the edges \"out of\" locations B, C, E, F, D are directed as depicted above.\n * * With this conventional counterclockwise ordering of face loops, \"next\" is counterclockwise, and \"previous\" is\n * clockwise:\n * * The [[nextAroundFacet]] step is counterclockwise around the facet.\n * * The [[previousAroundFacet]] step is clockwise around the facet.\n * * The [[nextAroundVertex]] step is counterclockwise around the vertex.\n * * The [[previousAroundVertex]] step is clockwise around the vertex.\n * * The `nextAroundFacet` steps for a walker and its [[edgeMate]] are in opposite directions along their shared edge,\n * when that edge is interior. Thus the `edgeMate` step can be seen to iterate an \"edge loop\" of two locations for an\n * interior edge.\n * * Invalid Walkers:\n * * An invalid walker has undefined [[edgeIndex]]. For these walkers, [[isUndefined]] returns true, and [[isValid]]\n * returns false. Traversal operations on an invalid walker return an invalid walker.\n * * Invalid walkers are expected during traversals of a mesh with boundary edges, so calling code must be prepared.\n * Boundary edges have exactly one adjacent facet, so for these edges the `edgeMate` step returns an invalid walker.\n * In the diagram above, the `edgeMate` of boundary edge B is undefined.\n * * Invalid walkers can occur while traversing boundary vertices as well. If an edge lacks an `edgeMate`, then the\n * `previousAroundVertex` step yields an invalid walker, because `previousAroundVertex` is implemented as `edgeMate`\n * followed by `nextAroundFacet`. In the diagram above, the `previousAroundVertex` step at boundary edge B yields\n * undefined walker. Similarly, the `nextAroundVertex` step at edge F yields undefined walker.\n * * Invalid walkers can also occur while traversing a non-manifold mesh. Such meshes feature edge(s) with more than\n * two adjacent facets, or with two adjacent facets that have opposite orientations. These meshes are uncommon, and\n * usually indicate a construction problem.\n * * Note that a null edge, for which the start and end vertex is the same, does not yield an invalid walker.\n * * See [[buildEdgeMateIndices]] for further description of the topological relations.\n * @public\n */\nexport class IndexedPolyfaceWalker {\n /** The polyface being traversed. */\n private _polyface: IndexedPolyface;\n /** The current edgeIndex into the polyface. */\n private _edgeIndex: number | undefined;\n /** Constructor */\n private constructor(polyface: IndexedPolyface, edgeIndex: number | undefined) {\n this._polyface = polyface;\n this._edgeIndex = edgeIndex;\n }\n /**\n * Return the edge index of this walker.\n * * This is an index into the polyface's `data.pointIndex` array.\n * * Can be undefined.\n */\n public get edgeIndex(): number | undefined {\n return this._edgeIndex;\n }\n\n /** Return the polyface of this walker. */\n public get polyface(): IndexedPolyface {\n return this._polyface;\n }\n /**\n * Return true if the walker's edgeIndex is defined.\n * * This method is the opposite of [[isUndefined]].\n */\n public get isValid(): boolean {\n return this._edgeIndex !== undefined;\n }\n /**\n * Return true if the walker's edgeIndex is undefined.\n * * This method is the opposite of [[isValid]].\n * * This can happen during a walk when the walker `w` reaches an exterior edge, for then\n * `w.edgeMate(w).isUndefined === true`.\n * * This can also happen when methods that return a walker receive invalid input.\n */\n public get isUndefined(): boolean {\n return this._edgeIndex === undefined;\n }\n /** Whether the walker is at a null edge, i.e. an edge with no length. */\n public get isNull(): boolean {\n return this.isValid && this._polyface.data.edgeIndexToEdgeMateIndex(this._edgeIndex) === this._edgeIndex;\n }\n /**\n * Create a walker for a given polyface at an optional edge.\n * @param polyface reference to the client polyface. This reference is captured (the polyface is not copied).\n * @param edgeIndex optional indication of where to start the walker within the mesh.\n * * If the edgeIndex is valid for the input polyface, the new walker is started there.\n * * If the edgeIndex is undefined or invalid for the input polyface, the walker returns true for [[isUndefined]].\n */\n public static createAtEdgeIndex(polyface: IndexedPolyface, edgeIndex?: number): IndexedPolyfaceWalker {\n if (!polyface.data.isValidEdgeIndex(edgeIndex))\n edgeIndex = undefined;\n return new IndexedPolyfaceWalker(polyface, edgeIndex);\n }\n /**\n * Create a walker for a given polyface at a specified facet.\n * * If `facetIndex` or `offsetWithinFacet` is invalid for the input polyface, the walker returns true for\n * [[isUndefined]].\n * @param polyface the polyface to reference\n * @param facetIndex index of the facet to reference\n * @param offsetWithinFacet optional 0-based offset within the face loop of the facet (default 0). This allows\n * the caller to start the walker at a particular edge of the facet.\n */\n public static createAtFacetIndex(polyface: IndexedPolyface, facetIndex: number, offsetWithinFacet: number = 0): IndexedPolyfaceWalker {\n if (polyface.isValidFacetIndex(facetIndex)) {\n const k0 = polyface.facetIndex0(facetIndex);\n const k1 = polyface.facetIndex1(facetIndex);\n if (0 <= offsetWithinFacet && k0 + offsetWithinFacet < k1)\n return new IndexedPolyfaceWalker(polyface, k0 + offsetWithinFacet);\n }\n return new IndexedPolyfaceWalker(polyface, undefined);\n }\n /**\n * Create a walker at the facet specified by a visitor.\n * @param visitor visitor whose currentReadIndex identifies the facet.\n * @param offsetWithinFacet optional 0-based offset within the face loop of the facet (default 0). This allows\n * the caller to start the walker at a particular edge of the facet.\n */\n public static createAtVisitor(visitor: IndexedPolyfaceVisitor, offsetWithinFacet: number = 0): IndexedPolyfaceWalker {\n const facetIndex = visitor.currentReadIndex();\n return IndexedPolyfaceWalker.createAtFacetIndex(visitor.clientPolyface(), facetIndex, offsetWithinFacet);\n }\n /**\n * Create a new IndexedPolyfaceWalker from the instance.\n * * The returned walker refers to the same polyface and edge as the instance.\n * @param result optional receiver to modify and return.\n */\n public clone(result?: IndexedPolyfaceWalker): IndexedPolyfaceWalker {\n if (result) {\n result._polyface = this._polyface;\n result._edgeIndex = this._edgeIndex;\n return result;\n }\n return new IndexedPolyfaceWalker(this._polyface, this._edgeIndex);\n }\n /**\n * Load the walker's facet into the given visitor.\n * @returns true if the visitor and walker reference the same polyface and the walker has a valid edge index.\n */\n public loadVisitor(visitor: IndexedPolyfaceVisitor): boolean {\n if (visitor.clientPolyface() !== this._polyface)\n return false;\n const facetIndex = this._polyface.edgeIndexToFacetIndex(this._edgeIndex);\n return (facetIndex !== undefined) ? visitor.moveToReadIndex(facetIndex) : false;\n }\n /**\n * Test if two walkers are at different edges in the same polyface.\n * * If either has undefined edge, return false.\n * * If they are in different polyfaces, return false.\n * * If they are the same edge in the same polyface, return false.\n * * Otherwise return true.\n */\n public isDifferentEdgeInSamePolyface(other: IndexedPolyfaceWalker): boolean {\n if (this.isUndefined || other.isUndefined)\n return false;\n return this._polyface === other._polyface && this._edgeIndex !== other.edgeIndex;\n }\n /**\n * Test if two walkers are in the same polyface at the same edge.\n * * If either has undefined edge, return false.\n * * If they are in different polyfaces, return false.\n * * If they are the same edge in the same polyface, return true.\n */\n public isSameEdge(other: IndexedPolyfaceWalker): boolean {\n return this._polyface === other._polyface && this.isValid && this._edgeIndex === other._edgeIndex;\n }\n\n /**\n * Return a walker with given edgeIndex and polyface from the calling instance.\n * * If `result` is supplied, that walker is filled and returned.\n * * If `result` is not supplied, a new walker is created.\n */\n private createResult(result: undefined | IndexedPolyfaceWalker, edgeIndex: undefined | number): IndexedPolyfaceWalker {\n if (result === undefined)\n return new IndexedPolyfaceWalker(this._polyface, edgeIndex);\n result._polyface = this._polyface;\n result._edgeIndex = edgeIndex;\n return result;\n }\n /**\n * Return a walker (new or reused) at the next edge around the facet.\n * * \"Next\" is in the order of indices in the face loop of this facet.\n * * If the instance has undefined edgeIndex, the result also has undefined edgeIndex.\n * @param result optional receiver to modify and return. May be the same as `this` to move the instance walker\n * to the new location and return it.\n */\n public nextAroundFacet(result?: IndexedPolyfaceWalker): IndexedPolyfaceWalker {\n const k = this._edgeIndex;\n if (k === undefined)\n return this.createResult(result, undefined);\n const facetIndex = this._polyface.edgeIndexToFacetIndex(k);\n if (facetIndex === undefined)\n return this.createResult(result, undefined);\n const k2 = this._polyface.facetIndex1(facetIndex);\n const k1 = k + 1;\n if (k1 < k2)\n return this.createResult(result, k1);\n return this.createResult(result, this._polyface.facetIndex0(facetIndex));\n }\n /**\n * Return a walker (new or reused) at the previous edge around the facet.\n * * \"Previous\" is in the reverse order of indices in the face loop of this facet.\n * * If the instance has undefined edgeIndex, the result also has undefined edgeIndex.\n * @param result optional receiver to modify and return. May be the same as `this` to move the instance walker\n * to the new location and return it.\n */\n public previousAroundFacet(result?: IndexedPolyfaceWalker): IndexedPolyfaceWalker {\n let k = this._edgeIndex;\n if (k === undefined)\n return this.createResult(result, undefined);\n const facetIndex = this._polyface.edgeIndexToFacetIndex(k);\n if (facetIndex === undefined)\n return this.createResult(result, undefined);\n const k0 = this._polyface.facetIndex0(facetIndex);\n if (k === k0)\n k = this._polyface.facetIndex1(facetIndex) - 1;\n else\n k--;\n return this.createResult(result, k);\n }\n /**\n * Return a walker (new or reused) at the edge mate of this walker's edge.\n * * The returned walker has undefined edgeIndex if:\n * * the instance is at a boundary edge, i.e., there is no facet on the other side, or\n * * the instance has undefined edgeIndex.\n * @param result optional receiver to modify and return. May be the same as `this` to move the instance walker\n * to the new location and return it.\n */\n public edgeMate(result?: IndexedPolyfaceWalker): IndexedPolyfaceWalker {\n return this.createResult(result, this._polyface.data.edgeIndexToEdgeMateIndex(this._edgeIndex));\n }\n /**\n * Return a walker (new or reused) at the next outbound edge around the vertex at the base of this walker's edge.\n * * If the facet is viewed so that its \"nextAroundFacet\" direction appears counterclockwise, then the \"next\"\n * outbound edge is counterclockwise around the base vertex.\n * * The returned walker has undefined edgeIndex if:\n * * the previous edge around the facet is a boundary edge, i.e., there is no facet on the other side, or\n * * the instance has undefined edgeIndex.\n * @param result optional receiver to modify and return. May be the same as `this` to move the instance walker\n * to the new location and return it.\n */\n public nextAroundVertex(result?: IndexedPolyfaceWalker): IndexedPolyfaceWalker {\n const result1 = this.previousAroundFacet(result);\n return result1.edgeMate(result1);\n }\n /**\n * Return a walker (new or reused) at the previous outbound edge around the vertex at the base of this walker's edge.\n * * If the facet is viewed so that its \"nextAroundFacet\" direction appears counterclockwise, then the \"previous\"\n * outbound edge is clockwise around the base vertex.\n * * The returned walker has undefined edgeIndex if:\n * * the instance edge is a boundary edge, i.e., there is no facet on the other side, or\n * * the instance has undefined edgeIndex.\n * @param result optional receiver to modify and return. May be the same as `this` to move the instance walker\n * to the new location and return it.\n */\n public previousAroundVertex(result?: IndexedPolyfaceWalker): IndexedPolyfaceWalker {\n const result1 = this.edgeMate(result);\n return result1.nextAroundFacet(result1);\n }\n\n /**\n * Build the edgeMate index array into the polyface's [[PolyfaceData]].\n * After this method:\n * * The array `polyface.data.edgeMateIndex` is defined with the same length as the other PolyfaceData index arrays.\n * * For each interior edge, `polyface.data.edgeIndexToEdgeMateIndex` returns the edge index on the other side of the\n * edge in the adjacent facet.\n * * The conditions for edgeMate matching are:\n * * Given facetIndex f, let `k0 = polyface.facetIndex0(f)` and `k1 = polyface.facetIndex1(f)`.\n * * Every edge index k in the face loop of facet f satisfies `k0 <= k < k1`.\n * * The edge with edge index k starts at the point with index `polyface.data.pointIndex[k]`.\n * * Let kA be an edge index in this range [k0,k1), and let kB be its in-range successor with cyclic wrap, i.e.,\n * `kB === (kA + 1 === k1) ? k0 : kA + 1`.\n * * Then `polyface.data.pointIndex[kA]` and `polyface.data.pointIndex[kB]` are the indices of the points at the\n * start and end of an edge of that facet.\n * * We call kA the _edge index_ for that edge, and kB the _edge index_ for the next edge around the facet.\n * * If kA is a positive-length interior edge in a 2-manifold mesh with properly oriented facets, then there is\n * an adjacent facet whose face loop contains edge indices kC and kD referencing the same edge vertices in reverse\n * order, i.e.,\n * * `polyface.data.pointIndex[kA] === polyface.data.pointIndex[kD]`\n * * `polyface.data.pointIndex[kB] === polyface.data.pointIndex[kC]`\n * * We call the edge indices kA and kC _edge mates_, denoted in the `edgeMateIndex` array by:\n * * `polyface.data.edgeMateIndex[kA] === kC`\n * * `polyface.data.edgeMateIndex[kC] === kA`\n * * If kA is zero-length interior edge, i.e, it has the same start and end point indices, then we call it a _null\n * edge_, and its edge mate is itself.\n * * A non-interior edge either lies on the boundary of the mesh, or is non-manifold (having more than 2 adjacent\n * facets, or 1 with the wrong orientation). These edges have no edge mate, represented as `undefined` in\n * the `edgeMateIndex` array.\n * * These conditions define a conventional manifold mesh where each edge of a facet has at most one partner edge with\n * opposite orientation in an adjacent facet.\n * * After calling this method, the caller can construct `IndexedPolyfaceWalker` objects to traverse the mesh by\n * walking across edges, around faces, and around vertices. Let walkerA have edge index value kA. Then with the\n * aforementioned edge indices:\n * * `walkerC = walkerA.edgeMate()` moves across the edge to its other end, at kC.\n * * `walkerB = walkerA.nextAroundFacet()` moves around the facet to the next edge, at kB.\n * * `walkerB.previousAroundFacet()` moves from kB back to kA.\n * * `walkerD = walkerA.previousAroundVertex()` moves around the vertex to the next edge kD.\n * * `walkerD1 = walkerC.nextAroundFacet()` also moves to kD.\n * * `walkerD.nextAroundVertex()` moves from kD back to kA.\n */\n public static buildEdgeMateIndices(polyface: IndexedPolyface): void {\n if (polyface.isEmpty) {\n polyface.data.edgeMateIndex = undefined;\n return;\n }\n const matcher = new IndexedEdgeMatcher();\n const numFacet = polyface.facetCount;\n for (let facetIndex = 0; facetIndex < numFacet; facetIndex++) {\n const kStart = polyface.facetIndex0(facetIndex);\n const kEnd = polyface.facetIndex1(facetIndex);\n let k0 = kEnd - 1;\n // sneaky: addEdge 3rd arg is edge index k0 instead of facetIndex; it gets carried around during matching\n for (let k1 = kStart; k1 < kEnd; k0 = k1, k1++)\n matcher.addEdge(polyface.data.pointIndex[k0], polyface.data.pointIndex[k1], k0);\n }\n const matchedPairs: SortableEdgeCluster[] = [];\n const nullEdges: SortableEdgeCluster[] = [];\n matcher.sortAndCollectClusters(matchedPairs, undefined, nullEdges, undefined);\n const numIndex = polyface.data.pointIndex.length;\n polyface.data.edgeMateIndex = new Array<number | undefined>(numIndex);\n for (let i = 0; i < numIndex; i++)\n polyface.data.edgeMateIndex[i] = undefined; // boundary and non-manifold edges have no mate\n for (const pair of matchedPairs) {\n if (Array.isArray(pair) && pair.length === 2) {\n const edgeIndex0 = pair[0].facetIndex;\n const edgeIndex1 = pair[1].facetIndex;\n polyface.data.edgeMateIndex[edgeIndex0] = edgeIndex1; // paired edges point to each other\n polyface.data.edgeMateIndex[edgeIndex1] = edgeIndex0;\n }\n }\n for (const nullEdgeOrCluster of nullEdges) {\n const nullCluster = Array.isArray(nullEdgeOrCluster) ? nullEdgeOrCluster : [nullEdgeOrCluster];\n for (const nullEdge of nullCluster) {\n const edgeIndex = nullEdge.facetIndex;\n polyface.data.edgeMateIndex[edgeIndex] = edgeIndex; // a null edge points to itself\n }\n }\n }\n}\n\n"]}
|
|
@@ -210,7 +210,7 @@ export declare class IndexedPolyface extends Polyface {
|
|
|
210
210
|
addColorIndex(index: number): void;
|
|
211
211
|
/**
|
|
212
212
|
* Clean up the open facet.
|
|
213
|
-
* @deprecated in 4.
|
|
213
|
+
* @deprecated in 4.5.0 - will not be removed until after 2026-06-13. To remove nebulous "open facet" concept from the API. Call [[PolyfaceData.trimAllIndexArrays]]
|
|
214
214
|
* instead.
|
|
215
215
|
*/
|
|
216
216
|
cleanupOpenFacet(): void;
|
|
@@ -276,7 +276,7 @@ export declare class IndexedPolyface extends Polyface {
|
|
|
276
276
|
extendRange(range: Range3d, transform?: Transform): void;
|
|
277
277
|
/**
|
|
278
278
|
* Given the index of a facet, return the data pertaining to the face it is a part of.
|
|
279
|
-
* @deprecated in 4.
|
|
279
|
+
* @deprecated in 4.5.0 - will not be removed until after 2026-06-13. Use [[IndexedPolyface.tryGetFaceData]], which verifies the index is in range.
|
|
280
280
|
*/
|
|
281
281
|
getFaceDataByFacetIndex(facetIndex: number): FacetFaceData;
|
|
282
282
|
/**
|
|
@@ -287,23 +287,35 @@ export declare class IndexedPolyface extends Polyface {
|
|
|
287
287
|
setNewFaceData(endFacetIndex?: number): boolean;
|
|
288
288
|
/** Second step of double dispatch: call `handler.handleIndexedPolyface(this)`. */
|
|
289
289
|
dispatchToGeometryHandler(handler: GeometryHandler): any;
|
|
290
|
+
/** If the input accesses an edgeMateIndex array, return it along with the owning IndexedPolyface. */
|
|
291
|
+
static hasEdgeMateIndex(polyface: Polyface | PolyfaceVisitor): {
|
|
292
|
+
parent: IndexedPolyface;
|
|
293
|
+
edgeMateIndex: Array<number | undefined>;
|
|
294
|
+
} | undefined;
|
|
290
295
|
}
|
|
291
296
|
/**
|
|
292
|
-
* A PolyfaceVisitor manages data while
|
|
297
|
+
* A PolyfaceVisitor manages data while iterating facets.
|
|
293
298
|
* * The polyface visitor holds data for one facet at a time.
|
|
294
299
|
* * The caller can request the position in the addressed polyfaceData as a "readIndex".
|
|
295
300
|
* * The readIndex values (as numbers) are not assumed to be sequential (i.e., they might be contiguous facet indices
|
|
296
301
|
* or the indexing scheme might have gaps at the whim of the particular PolyfaceVisitor implementation).
|
|
302
|
+
* * Example usage:
|
|
303
|
+
* ```
|
|
304
|
+
* const visitor = myPolyface.createVisitor();
|
|
305
|
+
* for (visitor.reset(); visitor.moveToNextFacet(); ) {
|
|
306
|
+
* // process the current facet
|
|
307
|
+
* }
|
|
308
|
+
* ```
|
|
297
309
|
* @public
|
|
298
310
|
*/
|
|
299
311
|
export interface PolyfaceVisitor extends PolyfaceData {
|
|
300
312
|
/** Load data for the facet with given index. */
|
|
301
313
|
moveToReadIndex(index: number): boolean;
|
|
302
|
-
/** Return the
|
|
314
|
+
/** Return the index of the currently loaded facet. */
|
|
303
315
|
currentReadIndex(): number;
|
|
304
316
|
/** Load data for the next facet. */
|
|
305
317
|
moveToNextFacet(): boolean;
|
|
306
|
-
/**
|
|
318
|
+
/** Restart the visitor at the first facet. */
|
|
307
319
|
reset(): void;
|
|
308
320
|
/** Return the point index of vertex i within the currently loaded facet. */
|
|
309
321
|
clientPointIndex(i: number): number;
|
|
@@ -341,5 +353,7 @@ export interface PolyfaceVisitor extends PolyfaceData {
|
|
|
341
353
|
* * Allows implementers to improve the efficiency of e.g., [[PolyfaceQuery.visitorClientFacetCount]].
|
|
342
354
|
*/
|
|
343
355
|
getVisitableFacetCount?(): number;
|
|
356
|
+
/** Create a visitor for a subset of the facets visitable by the instance. */
|
|
357
|
+
createSubsetVisitor?(facetIndices: number[], numWrap: number): PolyfaceVisitor;
|
|
344
358
|
}
|
|
345
359
|
//# sourceMappingURL=Polyface.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Polyface.d.ts","sourceRoot":"","sources":["../../../src/polyface/Polyface.ts"],"names":[],"mappings":"AAKA;;GAEG;AAIH,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAEvD,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAGhE,OAAO,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AACxD,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AAElE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C;;;;GAIG;AACH,8BAAsB,QAAS,SAAQ,aAAa;IAClD,wCAAwC;IACxC,SAAgB,gBAAgB,cAAc;IAC9C,gCAAgC;IACzB,IAAI,EAAE,YAAY,CAAC;IAC1B,kBAAkB;IAClB,SAAS,aAAa,IAAI,EAAE,YAAY;IAIxC;;;OAGG;aACa,a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AAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACpC,6EAA6E;IAC7E,iBAAiB,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACrC,4EAA4E;IAC5E,gBAAgB,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACpC,+EAA+E;IAC/E,cAAc,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAClC,kCAAkC;IAClC,cAAc,IAAI,QAAQ,GAAG,SAAS,CAAC;IACvC;;;;;;;;OAQG;IACH,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,wGAAwG;IACxG,WAAW,IAAI,IAAI,CAAC;IACpB,6FAA6F;IAC7F,YAAY,CAAC,KAAK,EAAE,eAAe,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1D;;;OAGG;IACH,wBAAwB,CAAC,KAAK,EAAE,eAAe,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACzG;;;OAGG;IACH,sBAAsB,CAAC,IAAI,MAAM,CAAC;IAClC,6EAA6E;IAC7E,mBAAmB,CAAC,CAAC,YAAY,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,MAAM,GAAG,eAAe,CAAC;CAChF"}
|
|
@@ -464,7 +464,7 @@ export class IndexedPolyface extends Polyface {
|
|
|
464
464
|
}
|
|
465
465
|
/**
|
|
466
466
|
* Clean up the open facet.
|
|
467
|
-
* @deprecated in 4.
|
|
467
|
+
* @deprecated in 4.5.0 - will not be removed until after 2026-06-13. To remove nebulous "open facet" concept from the API. Call [[PolyfaceData.trimAllIndexArrays]]
|
|
468
468
|
* instead.
|
|
469
469
|
*/
|
|
470
470
|
cleanupOpenFacet() {
|
|
@@ -614,7 +614,7 @@ export class IndexedPolyface extends Polyface {
|
|
|
614
614
|
}
|
|
615
615
|
/**
|
|
616
616
|
* Given the index of a facet, return the data pertaining to the face it is a part of.
|
|
617
|
-
* @deprecated in 4.
|
|
617
|
+
* @deprecated in 4.5.0 - will not be removed until after 2026-06-13. Use [[IndexedPolyface.tryGetFaceData]], which verifies the index is in range.
|
|
618
618
|
*/
|
|
619
619
|
getFaceDataByFacetIndex(facetIndex) {
|
|
620
620
|
return this.data.face[this._facetToFaceData[facetIndex]];
|
|
@@ -654,5 +654,21 @@ export class IndexedPolyface extends Polyface {
|
|
|
654
654
|
dispatchToGeometryHandler(handler) {
|
|
655
655
|
return handler.handleIndexedPolyface(this);
|
|
656
656
|
}
|
|
657
|
+
/** If the input accesses an edgeMateIndex array, return it along with the owning IndexedPolyface. */
|
|
658
|
+
static hasEdgeMateIndex(polyface) {
|
|
659
|
+
let parent;
|
|
660
|
+
if (polyface instanceof Polyface) {
|
|
661
|
+
if (polyface instanceof IndexedPolyface)
|
|
662
|
+
parent = polyface;
|
|
663
|
+
}
|
|
664
|
+
else if (polyface.clientPolyface() && polyface.clientPolyface() instanceof IndexedPolyface)
|
|
665
|
+
parent = polyface.clientPolyface();
|
|
666
|
+
if (parent) {
|
|
667
|
+
const edgeMateIndex = parent.data.edgeMateIndex;
|
|
668
|
+
if (edgeMateIndex && edgeMateIndex.length > 0 && edgeMateIndex.length === parent.data.indexCount)
|
|
669
|
+
return { parent, edgeMateIndex };
|
|
670
|
+
}
|
|
671
|
+
return undefined;
|
|
672
|
+
}
|
|
657
673
|
}
|
|
658
674
|
//# sourceMappingURL=Polyface.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Polyface.js","sourceRoot":"","sources":["../../../src/polyface/Polyface.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F;;GAEG;AAEH,2BAA2B;AAE3B,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEvC,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAChE,O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CAAC,IAAI,CAAC,CAAC,KAAK,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC;QAC5E,OAAO,IAAI,CAAC;IACd,CAAC;IACD,kFAAkF;IAC3E,yBAAyB,CAAC,OAAwB;QACvD,OAAO,OAAO,CAAC,qBAAqB,CAAC,IAAI,CAAC,CAAC;IAC7C,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\n// cspell:word internaldocs\n\nimport { GeometryQuery } from \"../curve/GeometryQuery\";\nimport { Geometry } from \"../Geometry\";\nimport { GeometryHandler } from \"../geometry3d/GeometryHandler\";\nimport { GrowableXYArray } from \"../geometry3d/GrowableXYArray\";\nimport { GrowableXYZArray } from \"../geometry3d/GrowableXYZArray\";\nimport { Point2d } from \"../geometry3d/Point2dVector2d\";\nimport { Point3d, Vector3d } from \"../geometry3d/Point3dVector3d\";\nimport { NumberArray } from \"../geometry3d/PointHelpers\";\nimport { Range1d, Range3d } from \"../geometry3d/Range\";\nimport { Transform } from \"../geometry3d/Transform\";\nimport { FacetFaceData } from \"./FacetFaceData\";\nimport { IndexedPolyfaceVisitor } from \"./IndexedPolyfaceVisitor\";\nimport { PolyfaceData } from \"./PolyfaceData\";\n\n/**\n * A Polyface is an abstract mesh structure (of unspecified implementation) that provides a PolyfaceVisitor\n * to iterate over its facets.\n * @public\n */\nexport abstract class Polyface extends GeometryQuery {\n /** String name for schema properties */\n public readonly geometryCategory = \"polyface\";\n /** Underlying polyface data. */\n public data: PolyfaceData;\n /** Constructor */\n protected constructor(data: PolyfaceData) {\n super();\n this.data = data;\n }\n /**\n * Create and return a visitor for this concrete polyface.\n * @param numWrap the number of vertices to replicate in visitor arrays.\n */\n public abstract createVisitor(numWrap: number): PolyfaceVisitor;\n /**\n * The [[PolyfaceData.twoSided]] flag.\n */\n public get twoSided() {\n return this.data.twoSided;\n }\n public set twoSided(value: boolean) {\n this.data.twoSided = value;\n }\n /**\n * Flag indicating if the mesh closure is unknown (0), open sheet (1), closed solid (2).\n * * A boundary edge of a mesh is defined as an edge with only one connected facet.\n * * Closed solid is a mesh with no boundary edge. Open sheet is a mesh that has boundary edge(s).\n */\n public get expectedClosure(): number {\n return this.data.expectedClosure;\n }\n public set expectedClosure(value: number) {\n this.data.expectedClosure = value;\n }\n /**\n * Check validity of indices into a data array.\n * * It is valid to have both indices and data undefined.\n * * It is NOT valid for just one to be defined.\n * * Index values at indices[indexPositionA <= i < indexPositionB] must be valid indices to the data array.\n * @param indices array of indices.\n * @param indexPositionA first index to test.\n * @param indexPositionB one past final index to test.\n * @param data data array.\n * @param dataLength length of data array.\n */\n public static areIndicesValid(\n indices: number[] | undefined,\n indexPositionA: number,\n indexPositionB: number,\n data: any,\n dataLength: number,\n ): boolean {\n if (indices === undefined && data === undefined)\n return true;\n if (indices === undefined || data === undefined)\n return false;\n if (indexPositionA < 0 || indexPositionA >= indices.length)\n return false;\n if (indexPositionB <= indexPositionA || indexPositionB > indices.length)\n return false;\n for (let i = indexPositionA; i < indexPositionB; i++)\n if (indices[i] < 0 || indices[i] >= dataLength)\n return false;\n return true;\n }\n /** Returns true if this polyface has no facets. */\n public abstract get isEmpty(): boolean;\n /** Returns the number of facets of this polyface. Subclasses should override. */\n public get facetCount(): number | undefined {\n return undefined;\n }\n}\n\n/**\n * An `IndexedPolyface` is a set of facets which can have normal, param, and color arrays with independent point,\n * normal, param, and color indices.\n * @public\n */\nexport class IndexedPolyface extends Polyface { // more info can be found at geometry/internaldocs/Polyface.md\n /**\n * Start indices of all facets of the polyface.\n * * Each element is an index to the `this.data.pointIndex` array entry for a specific facet.\n * * The facet count is `_facetStart.length - 1`.\n * * The face loop for the i_th facet consists of the entries in `this.data.pointIndex` at indices `_facetStart[i]`\n * up to (but not including) `_facetStart[i + 1]`.\n * * Note the array is initialized with one entry (value 0).\n */\n protected _facetStart: number[];\n /**\n * Index to the `this.data.face` array entry for a specific facet.\n * * `_facetToFaceData` has one entry per facet.\n */\n protected _facetToFaceData: number[];\n /**\n * Constructor for a new polyface.\n * @param data PolyfaceData arrays to capture.\n * @param facetStart optional array of facet start indices (e.g. known during clone)\n * @param facetToFacetData optional array of face identifiers (e.g. known during clone)\n */\n protected constructor(data: PolyfaceData, facetStart?: number[], facetToFaceData?: number[]) {\n super(data);\n if (facetStart)\n this._facetStart = facetStart.slice(); // deep copy\n else {\n this._facetStart = [];\n this._facetStart.push(0);\n }\n if (facetToFaceData)\n this._facetToFaceData = facetToFaceData.slice(); // deep copy\n else\n this._facetToFaceData = [];\n }\n\n /** Given an edgeIndex (index into `data.pointIndex`), return the index of the facet containing the edge. */\n public edgeIndexToFacetIndex(k: number | undefined): number | undefined {\n if (k === undefined)\n return undefined;\n return NumberArray.searchStrictlyIncreasingNumbers(this._facetStart, k);\n }\n /**\n * Given an edgeIndex (index into `data.pointIndex`), return the range of the edgeIndices of the containing facet.\n * * If an edge with edgeIndex `k` is found in the facet with facetIndex `f`, then the returned range `r` satisfies\n * `r.low = this.facetIndex0(f) <= k < this.facetIndex1(f) = r.high` and can be used to iterate the facet's face\n * loop. See [[facetIndex0]].\n */\n public edgeIndexToFaceLoop(k: number | undefined): Range1d | undefined {\n const q = this.edgeIndexToFacetIndex(k);\n if (q !== undefined)\n return Range1d.createXX(this.facetIndex0(q), this.facetIndex1(q));\n return undefined;\n }\n\n /** Test if other is an instance of `IndexedPolyface` */\n public isSameGeometryClass(other: any): boolean {\n return other instanceof IndexedPolyface;\n }\n /** Tests for equivalence between two IndexedPolyfaces. */\n public override isAlmostEqual(other: any): boolean {\n if (other instanceof IndexedPolyface) {\n return this.data.isAlmostEqual(other.data) &&\n NumberArray.isExactEqual(this._facetStart, other._facetStart) &&\n NumberArray.isExactEqual(this._facetToFaceData, other._facetToFaceData);\n }\n return false;\n }\n /** Returns true if either the point array or the point index array is empty. */\n public get isEmpty(): boolean {\n return this.data.pointCount === 0 || this.data.pointIndex.length === 0;\n }\n /**\n * Transform the mesh.\n * * If `transform` is a mirror, also reverse the index order around each facet.\n * * Note that this method always returns true. If transforming the normals fails (due to singular matrix or zero\n * normal), the original normal(s) are left unchanged.\n */\n public tryTransformInPlace(transform: Transform): boolean {\n this.data.tryTransformInPlace(transform);\n if (transform.matrix.determinant() < 0)\n this.reverseIndices();\n return true;\n }\n /** Reverse indices for a single facet. */\n public reverseSingleFacet(facetId: number) {\n this.data.reverseIndicesSingleFacet(facetId, this._facetStart);\n }\n /** Return a deep clone. */\n public clone(): IndexedPolyface {\n return new IndexedPolyface(this.data.clone(), this._facetStart.slice(), this._facetToFaceData.slice());\n }\n /**\n * Return a deep clone with transformed points and normals.\n * @see [[IndexedPolyface.tryTransformInPlace]] for details of how transform is done.\n */\n public cloneTransformed(transform: Transform): IndexedPolyface { // we know tryTransformInPlace succeeds.\n const result = this.clone();\n result.tryTransformInPlace(transform);\n return result;\n }\n /** Reverse the order of indices around all facets. */\n public reverseIndices() {\n this.data.reverseIndices(this._facetStart);\n }\n /** Reverse the direction of all normal vectors. */\n public reverseNormals() {\n this.data.reverseNormals();\n }\n /**\n * Return face data using a facet index.\n * * Returns `undefined` if none found.\n * * This is the REFERENCE to the FacetFaceData not a copy.\n */\n public tryGetFaceData(i: number): FacetFaceData | undefined {\n if (i < 0 || i >= this._facetToFaceData.length)\n return undefined;\n const faceIndex = this._facetToFaceData[i];\n if (faceIndex < 0 || faceIndex >= this.data.face.length)\n return undefined;\n return this.data.face[faceIndex];\n }\n /**\n * Add facets from `source` to `this` polyface.\n * * Optionally reverse facet indices as per `PolyfaceData.reverseIndicesSingleFacet()` with `preserveStart = false` and\n * invert source normals.\n * * Optionally apply a `transform` to points and normals.\n * * Will only copy param, normal, color, and face data if we are already tracking them AND/OR the source contains them.\n */\n public addIndexedPolyface(source: IndexedPolyface, reversed: boolean, transform: Transform | undefined) {\n const numSourceFacets = source.facetCount;\n // add point, point index, and edge visibility data\n // note that there is no need to build an intermediate index map since all points are added\n const startOfNewPoints = this.data.point.length;\n const xyz = Point3d.create();\n for (let i = 0; i < source.data.point.length; i++) {\n source.data.point.getPoint3dAtUncheckedPointIndex(i, xyz);\n if (transform) {\n transform.multiplyPoint3d(xyz, xyz);\n this.addPoint(xyz);\n } else\n this.addPoint(xyz);\n }\n for (let i = 0; i < numSourceFacets; i++) {\n const i0 = source._facetStart[i];\n const i1 = source._facetStart[i + 1];\n if (reversed) {\n for (let j = i1; j-- > i0;) { // visibility is transferred from far vertex, e.g., -abc-d => dc-b-a\n this.addPointIndex(\n startOfNewPoints + source.data.pointIndex[j],\n source.data.edgeVisible[j > i0 ? j - 1 : i1 - 1],\n );\n }\n } else {\n for (let j = i0; j < i1; j++) {\n this.addPointIndex(\n startOfNewPoints + source.data.pointIndex[j],\n source.data.edgeVisible[j],\n );\n }\n }\n this.terminateFacet(false);\n }\n // add param and param index data\n if (undefined !== this.data.param && undefined !== source.data.param && undefined !== source.data.paramIndex) {\n const startOfNewParams = this.data.param.length;\n this.data.param.pushFromGrowableXYArray(source.data.param);\n for (let i = 0; i < numSourceFacets; i++) { // expect facet start and ends for points to match normals\n const i0 = source._facetStart[i];\n const i1 = source._facetStart[i + 1];\n if (reversed) {\n for (let j = i1; j-- > i0;)\n this.addParamIndex(startOfNewParams + source.data.paramIndex[j]);\n } else {\n for (let j = i0; j < i1; j++)\n this.addParamIndex(startOfNewParams + source.data.paramIndex[j]);\n }\n }\n }\n // add normal and normal index data\n if (undefined !== this.data.normal && undefined !== source.data.normal && undefined !== source.data.normalIndex) {\n const startOfNewNormals = this.data.normal.length;\n for (let i = 0; i < source.data.normal.length; i++) {\n const sourceNormal = source.data.normal.getVector3dAtCheckedVectorIndex(i)!;\n if (transform)\n transform.multiplyVector(sourceNormal, sourceNormal);\n if (reversed)\n sourceNormal.scaleInPlace(-1.0);\n this.addNormal(sourceNormal);\n }\n for (let i = 0; i < numSourceFacets; i++) { // expect facet start and ends for points to match normals\n const i0 = source._facetStart[i];\n const i1 = source._facetStart[i + 1];\n if (reversed) {\n for (let j = i1; j-- > i0;)\n this.addNormalIndex(startOfNewNormals + source.data.normalIndex[j]);\n } else {\n for (let j = i0; j < i1; j++)\n this.addNormalIndex(startOfNewNormals + source.data.normalIndex[j]);\n }\n }\n }\n // add color and color index data\n if (undefined !== this.data.color && undefined !== source.data.color && undefined !== source.data.colorIndex) {\n const startOfNewColors = this.data.color.length;\n for (const sourceColor of source.data.color)\n this.addColor(sourceColor);\n for (let i = 0; i < numSourceFacets; i++) { // expect facet start and ends for points to match colors\n const i0 = source._facetStart[i];\n const i1 = source._facetStart[i + 1];\n if (reversed) {\n for (let j = i1; j-- > i0;)\n this.addColorIndex(startOfNewColors + source.data.colorIndex[j]);\n } else {\n for (let j = i0; j < i1; j++)\n this.addColorIndex(startOfNewColors + source.data.colorIndex[j]);\n }\n }\n }\n // add face and facetToFace index data\n if (source.data.face.length !== 0) {\n const startOfNewFaceData = this.data.face.length;\n for (const face of source.data.face) {\n const sourceFaceData = face.clone();\n this.data.face.push(sourceFaceData);\n }\n for (const facetToFaceIdx of source._facetToFaceData) {\n this._facetToFaceData.push(startOfNewFaceData + facetToFaceIdx);\n }\n }\n }\n /**\n * Return the total number of indices in zero-terminated style, which includes\n * * all the indices in the packed zero-based table.\n * * one additional index for the zero-terminator of each facet.\n * @note Note that all index arrays (pointIndex, normalIndex, paramIndex, colorIndex) have the same counts, so there\n * is not a separate query for each of them.\n */\n public get zeroTerminatedIndexCount(): number {\n return this.data.pointIndex.length + this._facetStart.length - 1;\n }\n /**\n * Create an empty facet set with coordinate and index data to be supplied later.\n * @param needNormals `true` to allocate empty normal data and index arrays; `false` (default) to leave undefined.\n * @param needParams `true` to allocate empty uv parameter data and index arrays; `false` (default) to leave undefined.\n * @param needColors `true` to allocate empty color data and index arrays; `false` (default) to leave undefined.\n * @param twoSided `true` (default) if the facets are to be considered viewable from the back; `false` if they are amenable to backface culling.\n */\n public static create(\n needNormals: boolean = false,\n needParams: boolean = false,\n needColors: boolean = false,\n twoSided: boolean = true,\n ): IndexedPolyface {\n return new IndexedPolyface(new PolyfaceData(needNormals, needParams, needColors, twoSided));\n }\n /**\n * Add (a clone of) a point to point array.\n * @param point the point.\n * @param priorIndex (optional) index of prior point to check for possible duplicate value.\n * @returns the zero-based index of the added or duplicate point.\n */\n public addPoint(point: Point3d, priorIndex?: number): number {\n if (priorIndex !== undefined) {\n const distance = this.data.point.distanceIndexToPoint(priorIndex, point);\n if (distance !== undefined && Geometry.isSmallMetricDistance(distance))\n return priorIndex;\n }\n this.data.point.pushXYZ(point.x, point.y, point.z);\n return this.data.point.length - 1;\n }\n /**\n * Add a point to point array.\n * @param x the x coordinate of point.\n * @param y the y coordinate of point.\n * @param z the z coordinate of point.\n * @returns the zero-based index of the added point.\n */\n public addPointXYZ(x: number, y: number, z: number): number {\n this.data.point.pushXYZ(x, y, z);\n return this.data.point.length - 1;\n }\n /**\n * Add (a clone of) a uv parameter to the parameter array.\n * @param param the parameter.\n * @returns zero-based index of the added param.\n */\n public addParam(param: Point2d): number {\n if (!this.data.param)\n this.data.param = new GrowableXYArray();\n this.data.param.push(param);\n return this.data.param.length - 1;\n }\n /**\n * Add a uv parameter to the parameter array.\n * @param u the u part of parameter.\n * @param v the v part of parameter.\n * @param priorIndexA first index to check for possible duplicate value.\n * @param priorIndexB second index to check for possible duplicate value.\n * @returns zero-based index of the added or duplicate parameter.\n */\n public addParamUV(u: number, v: number, priorIndexA?: number, priorIndexB?: number): number {\n if (!this.data.param)\n this.data.param = new GrowableXYArray();\n if (priorIndexA !== undefined && this.data.isAlmostEqualParamIndexUV(priorIndexA, u, v))\n return priorIndexA;\n if (priorIndexB !== undefined && this.data.isAlmostEqualParamIndexUV(priorIndexB, u, v))\n return priorIndexB;\n this.data.param.pushXY(u, v);\n return this.data.param.length - 1;\n }\n /**\n * Add (a clone of) a normal vector to the normal array.\n * @param normal the normal vector.\n * @param priorIndexA first index to check for possible duplicate value.\n * @param priorIndexB second index to check for possible duplicate value.\n * @returns zero-based index of the added or duplicate normal.\n */\n public addNormal(normal: Vector3d, priorIndexA?: number, priorIndexB?: number): number {\n // check if `normal` is duplicate of `dataNormal` at index `i`\n const normalIsDuplicate = (i: number) => {\n const distance = this.data.normal!.distanceIndexToPoint(i, normal);\n return distance !== undefined && Geometry.isSmallMetricDistance(distance);\n };\n if (this.data.normal !== undefined) {\n if (priorIndexA !== undefined && normalIsDuplicate(priorIndexA))\n return priorIndexA;\n if (priorIndexB !== undefined && normalIsDuplicate(priorIndexB))\n return priorIndexB;\n // check the tail index for possible duplicate\n if (priorIndexA !== undefined || priorIndexB !== undefined) {\n const tailIndex = this.data.normal.length - 1;\n if (normalIsDuplicate(tailIndex))\n return tailIndex;\n }\n }\n return this.addNormalXYZ(normal.x, normal.y, normal.z);\n }\n /**\n * Add a normal vector to the normal array.\n * @param x the x coordinate of normal.\n * @param y the y coordinate of normal.\n * @param z the z coordinate of normal.\n * @returns zero-based index of the added normal vector.\n */\n public addNormalXYZ(x: number, y: number, z: number): number {\n if (!this.data.normal)\n this.data.normal = new GrowableXYZArray();\n this.data.normal.pushXYZ(x, y, z);\n return this.data.normal.length - 1;\n }\n /**\n * Add a color to the color array\n * @param color the color.\n * @returns zero-based index of the added color.\n */\n public addColor(color: number): number {\n if (!this.data.color)\n this.data.color = [];\n this.data.color.push(color);\n return this.data.color.length - 1;\n }\n /** Add a point index with edge visibility flag. */\n public addPointIndex(index: number, visible: boolean = true): void {\n this.data.pointIndex.push(index);\n this.data.edgeVisible.push(visible);\n }\n /** Add a normal index. */\n public addNormalIndex(index: number): void {\n if (!this.data.normalIndex)\n this.data.normalIndex = [];\n this.data.normalIndex.push(index);\n }\n /** Add a param index. */\n public addParamIndex(index: number): void {\n if (!this.data.paramIndex)\n this.data.paramIndex = [];\n this.data.paramIndex.push(index);\n }\n /** Add a color index. */\n public addColorIndex(index: number): void {\n if (!this.data.colorIndex)\n this.data.colorIndex = [];\n this.data.colorIndex.push(index);\n }\n /**\n * Clean up the open facet.\n * @deprecated in 4.x to remove nebulous \"open facet\" concept from the API. Call [[PolyfaceData.trimAllIndexArrays]]\n * instead.\n */\n public cleanupOpenFacet(): void {\n this.data.trimAllIndexArrays(this.data.pointIndex.length);\n }\n\n /**\n * Validate (the tail of) the active index arrays: point, normal, param, color.\n * @param index0 optional offset into the index arrays at which to start validating indices. Default 0.\n * @param errors optional array appended with error message(s) if invalid indices are encountered\n * @return whether the indices are valid\n */\n public validateAllIndices(index0: number = 0, errors?: string[]): boolean {\n const numPointIndices = this.data.pointIndex.length;\n const messages = errors ?? [];\n if (0 === numPointIndices) {\n messages.push(\"empty pointIndex array\");\n return false;\n }\n if (index0 < 0 || index0 >= numPointIndices) {\n messages.push(\"invalid input offset\");\n return false;\n }\n if (this.data.normalIndex && this.data.normalIndex.length !== numPointIndices)\n messages.push(\"normalIndex count must match pointIndex count\");\n if (this.data.paramIndex && this.data.paramIndex.length !== numPointIndices)\n messages.push(\"paramIndex count must equal pointIndex count\");\n if (this.data.colorIndex && this.data.colorIndex.length !== numPointIndices)\n messages.push(\"colorIndex count must equal pointIndex count\");\n if (this.data.edgeVisible.length !== numPointIndices)\n messages.push(\"visibleIndex count must equal pointIndex count\");\n if (!Polyface.areIndicesValid(this.data.pointIndex, index0, numPointIndices, this.data.point, this.data.point ? this.data.point.length : 0))\n messages.push(\"invalid point index encountered\");\n if (!Polyface.areIndicesValid(this.data.normalIndex, index0, numPointIndices, this.data.normal, this.data.normal ? this.data.normal.length : 0))\n messages.push(\"invalid normal index encountered\");\n if (!Polyface.areIndicesValid(this.data.paramIndex, index0, numPointIndices, this.data.param, this.data.param ? this.data.param.length : 0))\n messages.push(\"invalid param index encountered\");\n if (!Polyface.areIndicesValid(this.data.colorIndex, index0, numPointIndices, this.data.color, this.data.color ? this.data.color.length : 0))\n messages.push(\"invalid color index encountered\");\n if (this.data.edgeMateIndex) {\n if (this.data.edgeMateIndex.length !== numPointIndices)\n messages.push(\"edgeMateIndex count must equal pointIndex count\");\n else if (!this.data.edgeMateIndex.every((i: number | undefined) => i === undefined || this.data.isValidEdgeIndex(i)))\n messages.push(\"invalid edgeMate encountered\");\n }\n return 0 === messages.length;\n }\n\n /**\n * Announce the end of construction of a facet.\n * * Optionally check for:\n * * Same number of indices among all active index arrays -- point, normal, param, color\n * * All indices for the latest facet are within bounds of the respective data arrays.\n * * In error cases, all index arrays are trimmed back to the size when previous facet was terminated.\n * * A return value of `undefined` is normal. Otherwise, a string array of error messages is returned.\n */\n public terminateFacet(validateAllIndices: boolean = true): string[] | undefined {\n const numFacets = this._facetStart.length - 1;\n // number of indices in accepted facets\n const lengthA = this._facetStart[numFacets];\n // number of indices in all facets (accepted facet plus the last facet to be accepted)\n const lengthB = this.data.pointIndex.length;\n if (validateAllIndices) {\n const messages: string[] = [];\n if (lengthB < lengthA + 2)\n messages.push(\"Less than 3 indices in the last facet\");\n this.validateAllIndices(lengthA, messages);\n if (messages.length > 0) {\n this.data.trimAllIndexArrays(lengthA);\n return messages;\n }\n }\n this._facetStart.push(lengthB); // append start index of the future facet\n return undefined;\n }\n /** Number of facets (read-only property). */\n public override get facetCount(): number {\n return this._facetStart.length - 1;\n }\n /** Number of faces (read-only property). */\n public get faceCount(): number {\n return this.data.faceCount;\n }\n /** Number of points (read-only property). */\n public get pointCount(): number {\n return this.data.pointCount;\n }\n /** Number of colors (read-only property). */\n public get colorCount(): number {\n return this.data.colorCount;\n }\n /** Number of parameters (read-only property). */\n public get paramCount(): number {\n return this.data.paramCount;\n }\n /** Number of normals (read-only property). */\n public get normalCount(): number {\n return this.data.normalCount;\n }\n /** Test if `index` is a valid facet index. */\n public isValidFacetIndex(facetIndex: number): boolean {\n return facetIndex >= 0 && facetIndex < this.facetCount;\n }\n /** Return the number of edges in a particular facet. */\n public numEdgeInFacet(facetIndex: number): number {\n if (this.isValidFacetIndex(facetIndex))\n return this._facetStart[facetIndex + 1] - this._facetStart[facetIndex];\n return 0;\n }\n /**\n * Given a valid facet index, return the index at which its face loop starts in the index arrays.\n * * A \"face loop\" is a contiguous block of indices into the parallel polyface index arrays.\n * * Each of these indices represents an edge of a facet, thus it is sometimes called an \"edgeIndex\".\n * * Together with [[facetIndex1]], this method can be used to iterate the face loop of the facet\n * with index `iFacet` as follows:\n * ````\n * for (let iEdge = this.facetIndex0(iFacet); iEdge < this.facetIndex1(iFacet); iEdge++) {\n * const iPoint = this.data.pointIndex[iEdge];\n * const p = this.data.point[iPoint];\n * // ... process the edge of this facet starting at point p\n * }\n * ````\n */\n public facetIndex0(facetIndex: number): number {\n return this._facetStart[facetIndex];\n }\n /**\n * Given a valid facet index, return one past the index at which its face loop ends in the index arrays.\n * * For details, see [[facetIndex0]].\n */\n public facetIndex1(facetIndex: number): number {\n return this._facetStart[facetIndex + 1];\n }\n /** Return a readonly reference to the facetStart array accessed by [[facetIndex0]] and [[facetIndex1]]. */\n public get facetStart(): ReadonlyArray<number> {\n return this._facetStart;\n }\n /** create a visitor for this polyface */\n public createVisitor(numWrap: number = 0): IndexedPolyfaceVisitor {\n return IndexedPolyfaceVisitor.create(this, numWrap);\n }\n /** Return the range of (optionally transformed) points in this mesh. */\n public override range(transform?: Transform, result?: Range3d): Range3d {\n return this.data.range(result, transform);\n }\n /** Extend `range` with coordinates from this mesh. */\n public extendRange(range: Range3d, transform?: Transform): void {\n this.data.range(range, transform);\n }\n /**\n * Given the index of a facet, return the data pertaining to the face it is a part of.\n * @deprecated in 4.x. Use [[IndexedPolyface.tryGetFaceData]], which verifies the index is in range.\n */\n public getFaceDataByFacetIndex(facetIndex: number): FacetFaceData {\n return this.data.face[this._facetToFaceData[facetIndex]];\n }\n /**\n * Set new FacetFaceData.\n * * All terminated facets since the last face declaration will be mapped to a single new FacetFaceData object using\n * facetToFaceData[]. FacetFaceData holds the 2D range of the face. Returns `true` if successful, `false` otherwise.\n */\n public setNewFaceData(endFacetIndex: number = 0): boolean {\n const facetStart = this._facetToFaceData.length;\n if (facetStart >= this._facetStart.length)\n return false;\n if (0 === endFacetIndex) // the default for endFacetIndex is really the last facet\n endFacetIndex = this._facetStart.length; // last facet index corresponds to the future facet\n const faceData = FacetFaceData.createNull();\n const visitor = IndexedPolyfaceVisitor.create(this, 0);\n if (!visitor.moveToReadIndex(facetStart)) { // move visitor to first facet of new face\n return false;\n }\n // if parameter range is provided (by the polyface planeSet clipper) then use it\n const paramDefined = this.data.param !== undefined;\n const setParamRange: boolean = faceData.paramRange.isNull && paramDefined;\n do {\n if (setParamRange && visitor.param !== undefined)\n visitor.param.extendRange(faceData.paramRange);\n } while (visitor.moveToNextFacet() && visitor.currentReadIndex() < endFacetIndex);\n if (paramDefined && !(this.data.param!.length === 0) && faceData.paramDistanceRange.isNull)\n faceData.setParamDistanceRangeFromNewFaceData(this, facetStart, endFacetIndex);\n this.data.face.push(faceData);\n const faceDataIndex = this.data.face.length - 1;\n for (let i = this._facetToFaceData.length; i < endFacetIndex; i++)\n this._facetToFaceData.push(0 === this._facetStart[i] ? 0 : faceDataIndex);\n return true;\n }\n /** Second step of double dispatch: call `handler.handleIndexedPolyface(this)`. */\n public dispatchToGeometryHandler(handler: GeometryHandler): any {\n return handler.handleIndexedPolyface(this);\n }\n}\n\n/**\n * A PolyfaceVisitor manages data while walking through facets.\n * * The polyface visitor holds data for one facet at a time.\n * * The caller can request the position in the addressed polyfaceData as a \"readIndex\".\n * * The readIndex values (as numbers) are not assumed to be sequential (i.e., they might be contiguous facet indices\n * or the indexing scheme might have gaps at the whim of the particular PolyfaceVisitor implementation).\n * @public\n */\nexport interface PolyfaceVisitor extends PolyfaceData {\n /** Load data for the facet with given index. */\n moveToReadIndex(index: number): boolean;\n /** Return the readIndex of the currently loaded facet. */\n currentReadIndex(): number;\n /** Load data for the next facet. */\n moveToNextFacet(): boolean;\n /** Reset to initial state for reading all facets sequentially with moveToNextFacet. */\n reset(): void;\n /** Return the point index of vertex i within the currently loaded facet. */\n clientPointIndex(i: number): number;\n /** Return the param index of vertex i within the currently loaded facet. */\n clientParamIndex(i: number): number;\n /** Return the normal index of vertex i within the currently loaded facet. */\n clientNormalIndex(i: number): number;\n /** Return the color index of vertex i within the currently loaded facet. */\n clientColorIndex(i: number): number;\n /** Return the aux data index of vertex i within the currently loaded facet. */\n clientAuxIndex(i: number): number;\n /** Return the client polyface. */\n clientPolyface(): Polyface | undefined;\n /**\n * Set the number of vertices replicated in visitor arrays (both data and index arrays).\n * * 0,1,2 are the most common values.\n * * Example: suppose `[6,7,8]` is the pointIndex array representing a triangle. First edge would be `6,7`. Second\n * edge is `7,8`. Third edge is `8,6`. To access `6` for the third edge, we have to go back to the start of array.\n * Therefore, it is useful to store `6` at the end of pointIndex array, i.e., `[6,7,8,6]` meaning `numWrap = 1`.\n * * Continuing this example, `numWrap = 2` (i.e., `[6,7,8,6,7]`) is useful when each vertex visit requires\n * the next two points, e.g., to form two adjacent vectors for a cross product.\n */\n setNumWrap(numWrap: number): void;\n /** Clear the contents of the data arrays. Use this along with `pushDataFrom` to build up new facets. */\n clearArrays(): void;\n /** Transfer data from a specified index of the other visitor as new data in this visitor. */\n pushDataFrom(other: PolyfaceVisitor, index: number): void;\n /**\n * Transfer interpolated data from the other visitor.\n * * All data values are interpolated at `fraction` between `other` values at `index0` and `index1`.\n */\n pushInterpolatedDataFrom(other: PolyfaceVisitor, index0: number, fraction: number, index1: number): void;\n /**\n * Return the number of facets this visitor is able to visit.\n * * Allows implementers to improve the efficiency of e.g., [[PolyfaceQuery.visitorClientFacetCount]].\n */\n getVisitableFacetCount?(): number;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"Polyface.js","sourceRoot":"","sources":["../../../src/polyface/Polyface.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F;;GAEG;AAEH,2BAA2B;AAE3B,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa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E,CAAC,GAAG,aAAa,EAAE,CAAC,EAAE;YAC/D,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC,KAAK,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC;QAC5E,OAAO,IAAI,CAAC;IACd,CAAC;IACD,kFAAkF;IAC3E,yBAAyB,CAAC,OAAwB;QACvD,OAAO,OAAO,CAAC,qBAAqB,CAAC,IAAI,CAAC,CAAC;IAC7C,CAAC;IACD,qGAAqG;IAC9F,MAAM,CAAC,gBAAgB,CAAC,QAAoC;QACjE,IAAI,MAAmC,CAAC;QACxC,IAAI,QAAQ,YAAY,QAAQ,EAAE,CAAC;YACjC,IAAI,QAAQ,YAAY,eAAe;gBACrC,MAAM,GAAG,QAAQ,CAAC;QACtB,CAAC;aAAM,IAAI,QAAQ,CAAC,cAAc,EAAE,IAAI,QAAQ,CAAC,cAAc,EAAE,YAAY,eAAe;YAC1F,MAAM,GAAG,QAAQ,CAAC,cAAc,EAAqB,CAAC;QACxD,IAAI,MAAM,EAAE,CAAC;YACX,MAAM,aAAa,GAAG,MAAM,CAAC,IAAI,CAAC,aAAa,CAAC;YAChD,IAAI,aAAa,IAAI,aAAa,CAAC,MAAM,GAAG,CAAC,IAAI,aAAa,CAAC,MAAM,KAAK,MAAM,CAAC,IAAI,CAAC,UAAU;gBAC9F,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,CAAC;QACrC,CAAC;QACD,OAAO,SAAS,CAAC;IACnB,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\n/** @packageDocumentation\n * @module Polyface\n */\n\n// cspell:word internaldocs\n\nimport { GeometryQuery } from \"../curve/GeometryQuery\";\nimport { Geometry } from \"../Geometry\";\nimport { GeometryHandler } from \"../geometry3d/GeometryHandler\";\nimport { GrowableXYArray } from \"../geometry3d/GrowableXYArray\";\nimport { GrowableXYZArray } from \"../geometry3d/GrowableXYZArray\";\nimport { Point2d } from \"../geometry3d/Point2dVector2d\";\nimport { Point3d, Vector3d } from \"../geometry3d/Point3dVector3d\";\nimport { NumberArray } from \"../geometry3d/PointHelpers\";\nimport { Range1d, Range3d } from \"../geometry3d/Range\";\nimport { Transform } from \"../geometry3d/Transform\";\nimport { FacetFaceData } from \"./FacetFaceData\";\nimport { IndexedPolyfaceVisitor } from \"./IndexedPolyfaceVisitor\";\nimport { PolyfaceData } from \"./PolyfaceData\";\n\n/**\n * A Polyface is an abstract mesh structure (of unspecified implementation) that provides a PolyfaceVisitor\n * to iterate over its facets.\n * @public\n */\nexport abstract class Polyface extends GeometryQuery {\n /** String name for schema properties */\n public readonly geometryCategory = \"polyface\";\n /** Underlying polyface data. */\n public data: PolyfaceData;\n /** Constructor */\n protected constructor(data: PolyfaceData) {\n super();\n this.data = data;\n }\n /**\n * Create and return a visitor for this concrete polyface.\n * @param numWrap the number of vertices to replicate in visitor arrays.\n */\n public abstract createVisitor(numWrap: number): PolyfaceVisitor;\n /**\n * The [[PolyfaceData.twoSided]] flag.\n */\n public get twoSided() {\n return this.data.twoSided;\n }\n public set twoSided(value: boolean) {\n this.data.twoSided = value;\n }\n /**\n * Flag indicating if the mesh closure is unknown (0), open sheet (1), closed solid (2).\n * * A boundary edge of a mesh is defined as an edge with only one connected facet.\n * * Closed solid is a mesh with no boundary edge. Open sheet is a mesh that has boundary edge(s).\n */\n public get expectedClosure(): number {\n return this.data.expectedClosure;\n }\n public set expectedClosure(value: number) {\n this.data.expectedClosure = value;\n }\n /**\n * Check validity of indices into a data array.\n * * It is valid to have both indices and data undefined.\n * * It is NOT valid for just one to be defined.\n * * Index values at indices[indexPositionA <= i < indexPositionB] must be valid indices to the data array.\n * @param indices array of indices.\n * @param indexPositionA first index to test.\n * @param indexPositionB one past final index to test.\n * @param data data array.\n * @param dataLength length of data array.\n */\n public static areIndicesValid(\n indices: number[] | undefined,\n indexPositionA: number,\n indexPositionB: number,\n data: any,\n dataLength: number,\n ): boolean {\n if (indices === undefined && data === undefined)\n return true;\n if (indices === undefined || data === undefined)\n return false;\n if (indexPositionA < 0 || indexPositionA >= indices.length)\n return false;\n if (indexPositionB <= indexPositionA || indexPositionB > indices.length)\n return false;\n for (let i = indexPositionA; i < indexPositionB; i++)\n if (indices[i] < 0 || indices[i] >= dataLength)\n return false;\n return true;\n }\n /** Returns true if this polyface has no facets. */\n public abstract get isEmpty(): boolean;\n /** Returns the number of facets of this polyface. Subclasses should override. */\n public get facetCount(): number | undefined {\n return undefined;\n }\n}\n\n/**\n * An `IndexedPolyface` is a set of facets which can have normal, param, and color arrays with independent point,\n * normal, param, and color indices.\n * @public\n */\nexport class IndexedPolyface extends Polyface { // more info can be found at geometry/internaldocs/Polyface.md\n /**\n * Start indices of all facets of the polyface.\n * * Each element is an index to the `this.data.pointIndex` array entry for a specific facet.\n * * The facet count is `_facetStart.length - 1`.\n * * The face loop for the i_th facet consists of the entries in `this.data.pointIndex` at indices `_facetStart[i]`\n * up to (but not including) `_facetStart[i + 1]`.\n * * Note the array is initialized with one entry (value 0).\n */\n protected _facetStart: number[];\n /**\n * Index to the `this.data.face` array entry for a specific facet.\n * * `_facetToFaceData` has one entry per facet.\n */\n protected _facetToFaceData: number[];\n /**\n * Constructor for a new polyface.\n * @param data PolyfaceData arrays to capture.\n * @param facetStart optional array of facet start indices (e.g. known during clone)\n * @param facetToFacetData optional array of face identifiers (e.g. known during clone)\n */\n protected constructor(data: PolyfaceData, facetStart?: number[], facetToFaceData?: number[]) {\n super(data);\n if (facetStart)\n this._facetStart = facetStart.slice(); // deep copy\n else {\n this._facetStart = [];\n this._facetStart.push(0);\n }\n if (facetToFaceData)\n this._facetToFaceData = facetToFaceData.slice(); // deep copy\n else\n this._facetToFaceData = [];\n }\n\n /** Given an edgeIndex (index into `data.pointIndex`), return the index of the facet containing the edge. */\n public edgeIndexToFacetIndex(k: number | undefined): number | undefined {\n if (k === undefined)\n return undefined;\n return NumberArray.searchStrictlyIncreasingNumbers(this._facetStart, k);\n }\n /**\n * Given an edgeIndex (index into `data.pointIndex`), return the range of the edgeIndices of the containing facet.\n * * If an edge with edgeIndex `k` is found in the facet with facetIndex `f`, then the returned range `r` satisfies\n * `r.low = this.facetIndex0(f) <= k < this.facetIndex1(f) = r.high` and can be used to iterate the facet's face\n * loop. See [[facetIndex0]].\n */\n public edgeIndexToFaceLoop(k: number | undefined): Range1d | undefined {\n const q = this.edgeIndexToFacetIndex(k);\n if (q !== undefined)\n return Range1d.createXX(this.facetIndex0(q), this.facetIndex1(q));\n return undefined;\n }\n\n /** Test if other is an instance of `IndexedPolyface` */\n public isSameGeometryClass(other: any): boolean {\n return other instanceof IndexedPolyface;\n }\n /** Tests for equivalence between two IndexedPolyfaces. */\n public override isAlmostEqual(other: any): boolean {\n if (other instanceof IndexedPolyface) {\n return this.data.isAlmostEqual(other.data) &&\n NumberArray.isExactEqual(this._facetStart, other._facetStart) &&\n NumberArray.isExactEqual(this._facetToFaceData, other._facetToFaceData);\n }\n return false;\n }\n /** Returns true if either the point array or the point index array is empty. */\n public get isEmpty(): boolean {\n return this.data.pointCount === 0 || this.data.pointIndex.length === 0;\n }\n /**\n * Transform the mesh.\n * * If `transform` is a mirror, also reverse the index order around each facet.\n * * Note that this method always returns true. If transforming the normals fails (due to singular matrix or zero\n * normal), the original normal(s) are left unchanged.\n */\n public tryTransformInPlace(transform: Transform): boolean {\n this.data.tryTransformInPlace(transform);\n if (transform.matrix.determinant() < 0)\n this.reverseIndices();\n return true;\n }\n /** Reverse indices for a single facet. */\n public reverseSingleFacet(facetId: number) {\n this.data.reverseIndicesSingleFacet(facetId, this._facetStart);\n }\n /** Return a deep clone. */\n public clone(): IndexedPolyface {\n return new IndexedPolyface(this.data.clone(), this._facetStart.slice(), this._facetToFaceData.slice());\n }\n /**\n * Return a deep clone with transformed points and normals.\n * @see [[IndexedPolyface.tryTransformInPlace]] for details of how transform is done.\n */\n public cloneTransformed(transform: Transform): IndexedPolyface { // we know tryTransformInPlace succeeds.\n const result = this.clone();\n result.tryTransformInPlace(transform);\n return result;\n }\n /** Reverse the order of indices around all facets. */\n public reverseIndices() {\n this.data.reverseIndices(this._facetStart);\n }\n /** Reverse the direction of all normal vectors. */\n public reverseNormals() {\n this.data.reverseNormals();\n }\n /**\n * Return face data using a facet index.\n * * Returns `undefined` if none found.\n * * This is the REFERENCE to the FacetFaceData not a copy.\n */\n public tryGetFaceData(i: number): FacetFaceData | undefined {\n if (i < 0 || i >= this._facetToFaceData.length)\n return undefined;\n const faceIndex = this._facetToFaceData[i];\n if (faceIndex < 0 || faceIndex >= this.data.face.length)\n return undefined;\n return this.data.face[faceIndex];\n }\n /**\n * Add facets from `source` to `this` polyface.\n * * Optionally reverse facet indices as per `PolyfaceData.reverseIndicesSingleFacet()` with `preserveStart = false` and\n * invert source normals.\n * * Optionally apply a `transform` to points and normals.\n * * Will only copy param, normal, color, and face data if we are already tracking them AND/OR the source contains them.\n */\n public addIndexedPolyface(source: IndexedPolyface, reversed: boolean, transform: Transform | undefined) {\n const numSourceFacets = source.facetCount;\n // add point, point index, and edge visibility data\n // note that there is no need to build an intermediate index map since all points are added\n const startOfNewPoints = this.data.point.length;\n const xyz = Point3d.create();\n for (let i = 0; i < source.data.point.length; i++) {\n source.data.point.getPoint3dAtUncheckedPointIndex(i, xyz);\n if (transform) {\n transform.multiplyPoint3d(xyz, xyz);\n this.addPoint(xyz);\n } else\n this.addPoint(xyz);\n }\n for (let i = 0; i < numSourceFacets; i++) {\n const i0 = source._facetStart[i];\n const i1 = source._facetStart[i + 1];\n if (reversed) {\n for (let j = i1; j-- > i0;) { // visibility is transferred from far vertex, e.g., -abc-d => dc-b-a\n this.addPointIndex(\n startOfNewPoints + source.data.pointIndex[j],\n source.data.edgeVisible[j > i0 ? j - 1 : i1 - 1],\n );\n }\n } else {\n for (let j = i0; j < i1; j++) {\n this.addPointIndex(\n startOfNewPoints + source.data.pointIndex[j],\n source.data.edgeVisible[j],\n );\n }\n }\n this.terminateFacet(false);\n }\n // add param and param index data\n if (undefined !== this.data.param && undefined !== source.data.param && undefined !== source.data.paramIndex) {\n const startOfNewParams = this.data.param.length;\n this.data.param.pushFromGrowableXYArray(source.data.param);\n for (let i = 0; i < numSourceFacets; i++) { // expect facet start and ends for points to match normals\n const i0 = source._facetStart[i];\n const i1 = source._facetStart[i + 1];\n if (reversed) {\n for (let j = i1; j-- > i0;)\n this.addParamIndex(startOfNewParams + source.data.paramIndex[j]);\n } else {\n for (let j = i0; j < i1; j++)\n this.addParamIndex(startOfNewParams + source.data.paramIndex[j]);\n }\n }\n }\n // add normal and normal index data\n if (undefined !== this.data.normal && undefined !== source.data.normal && undefined !== source.data.normalIndex) {\n const startOfNewNormals = this.data.normal.length;\n for (let i = 0; i < source.data.normal.length; i++) {\n const sourceNormal = source.data.normal.getVector3dAtCheckedVectorIndex(i)!;\n if (transform)\n transform.multiplyVector(sourceNormal, sourceNormal);\n if (reversed)\n sourceNormal.scaleInPlace(-1.0);\n this.addNormal(sourceNormal);\n }\n for (let i = 0; i < numSourceFacets; i++) { // expect facet start and ends for points to match normals\n const i0 = source._facetStart[i];\n const i1 = source._facetStart[i + 1];\n if (reversed) {\n for (let j = i1; j-- > i0;)\n this.addNormalIndex(startOfNewNormals + source.data.normalIndex[j]);\n } else {\n for (let j = i0; j < i1; j++)\n this.addNormalIndex(startOfNewNormals + source.data.normalIndex[j]);\n }\n }\n }\n // add color and color index data\n if (undefined !== this.data.color && undefined !== source.data.color && undefined !== source.data.colorIndex) {\n const startOfNewColors = this.data.color.length;\n for (const sourceColor of source.data.color)\n this.addColor(sourceColor);\n for (let i = 0; i < numSourceFacets; i++) { // expect facet start and ends for points to match colors\n const i0 = source._facetStart[i];\n const i1 = source._facetStart[i + 1];\n if (reversed) {\n for (let j = i1; j-- > i0;)\n this.addColorIndex(startOfNewColors + source.data.colorIndex[j]);\n } else {\n for (let j = i0; j < i1; j++)\n this.addColorIndex(startOfNewColors + source.data.colorIndex[j]);\n }\n }\n }\n // add face and facetToFace index data\n if (source.data.face.length !== 0) {\n const startOfNewFaceData = this.data.face.length;\n for (const face of source.data.face) {\n const sourceFaceData = face.clone();\n this.data.face.push(sourceFaceData);\n }\n for (const facetToFaceIdx of source._facetToFaceData) {\n this._facetToFaceData.push(startOfNewFaceData + facetToFaceIdx);\n }\n }\n }\n /**\n * Return the total number of indices in zero-terminated style, which includes\n * * all the indices in the packed zero-based table.\n * * one additional index for the zero-terminator of each facet.\n * @note Note that all index arrays (pointIndex, normalIndex, paramIndex, colorIndex) have the same counts, so there\n * is not a separate query for each of them.\n */\n public get zeroTerminatedIndexCount(): number {\n return this.data.pointIndex.length + this._facetStart.length - 1;\n }\n /**\n * Create an empty facet set with coordinate and index data to be supplied later.\n * @param needNormals `true` to allocate empty normal data and index arrays; `false` (default) to leave undefined.\n * @param needParams `true` to allocate empty uv parameter data and index arrays; `false` (default) to leave undefined.\n * @param needColors `true` to allocate empty color data and index arrays; `false` (default) to leave undefined.\n * @param twoSided `true` (default) if the facets are to be considered viewable from the back; `false` if they are amenable to backface culling.\n */\n public static create(\n needNormals: boolean = false,\n needParams: boolean = false,\n needColors: boolean = false,\n twoSided: boolean = true,\n ): IndexedPolyface {\n return new IndexedPolyface(new PolyfaceData(needNormals, needParams, needColors, twoSided));\n }\n /**\n * Add (a clone of) a point to point array.\n * @param point the point.\n * @param priorIndex (optional) index of prior point to check for possible duplicate value.\n * @returns the zero-based index of the added or duplicate point.\n */\n public addPoint(point: Point3d, priorIndex?: number): number {\n if (priorIndex !== undefined) {\n const distance = this.data.point.distanceIndexToPoint(priorIndex, point);\n if (distance !== undefined && Geometry.isSmallMetricDistance(distance))\n return priorIndex;\n }\n this.data.point.pushXYZ(point.x, point.y, point.z);\n return this.data.point.length - 1;\n }\n /**\n * Add a point to point array.\n * @param x the x coordinate of point.\n * @param y the y coordinate of point.\n * @param z the z coordinate of point.\n * @returns the zero-based index of the added point.\n */\n public addPointXYZ(x: number, y: number, z: number): number {\n this.data.point.pushXYZ(x, y, z);\n return this.data.point.length - 1;\n }\n /**\n * Add (a clone of) a uv parameter to the parameter array.\n * @param param the parameter.\n * @returns zero-based index of the added param.\n */\n public addParam(param: Point2d): number {\n if (!this.data.param)\n this.data.param = new GrowableXYArray();\n this.data.param.push(param);\n return this.data.param.length - 1;\n }\n /**\n * Add a uv parameter to the parameter array.\n * @param u the u part of parameter.\n * @param v the v part of parameter.\n * @param priorIndexA first index to check for possible duplicate value.\n * @param priorIndexB second index to check for possible duplicate value.\n * @returns zero-based index of the added or duplicate parameter.\n */\n public addParamUV(u: number, v: number, priorIndexA?: number, priorIndexB?: number): number {\n if (!this.data.param)\n this.data.param = new GrowableXYArray();\n if (priorIndexA !== undefined && this.data.isAlmostEqualParamIndexUV(priorIndexA, u, v))\n return priorIndexA;\n if (priorIndexB !== undefined && this.data.isAlmostEqualParamIndexUV(priorIndexB, u, v))\n return priorIndexB;\n this.data.param.pushXY(u, v);\n return this.data.param.length - 1;\n }\n /**\n * Add (a clone of) a normal vector to the normal array.\n * @param normal the normal vector.\n * @param priorIndexA first index to check for possible duplicate value.\n * @param priorIndexB second index to check for possible duplicate value.\n * @returns zero-based index of the added or duplicate normal.\n */\n public addNormal(normal: Vector3d, priorIndexA?: number, priorIndexB?: number): number {\n // check if `normal` is duplicate of `dataNormal` at index `i`\n const normalIsDuplicate = (i: number) => {\n const distance = this.data.normal!.distanceIndexToPoint(i, normal);\n return distance !== undefined && Geometry.isSmallMetricDistance(distance);\n };\n if (this.data.normal !== undefined) {\n if (priorIndexA !== undefined && normalIsDuplicate(priorIndexA))\n return priorIndexA;\n if (priorIndexB !== undefined && normalIsDuplicate(priorIndexB))\n return priorIndexB;\n // check the tail index for possible duplicate\n if (priorIndexA !== undefined || priorIndexB !== undefined) {\n const tailIndex = this.data.normal.length - 1;\n if (normalIsDuplicate(tailIndex))\n return tailIndex;\n }\n }\n return this.addNormalXYZ(normal.x, normal.y, normal.z);\n }\n /**\n * Add a normal vector to the normal array.\n * @param x the x coordinate of normal.\n * @param y the y coordinate of normal.\n * @param z the z coordinate of normal.\n * @returns zero-based index of the added normal vector.\n */\n public addNormalXYZ(x: number, y: number, z: number): number {\n if (!this.data.normal)\n this.data.normal = new GrowableXYZArray();\n this.data.normal.pushXYZ(x, y, z);\n return this.data.normal.length - 1;\n }\n /**\n * Add a color to the color array\n * @param color the color.\n * @returns zero-based index of the added color.\n */\n public addColor(color: number): number {\n if (!this.data.color)\n this.data.color = [];\n this.data.color.push(color);\n return this.data.color.length - 1;\n }\n /** Add a point index with edge visibility flag. */\n public addPointIndex(index: number, visible: boolean = true): void {\n this.data.pointIndex.push(index);\n this.data.edgeVisible.push(visible);\n }\n /** Add a normal index. */\n public addNormalIndex(index: number): void {\n if (!this.data.normalIndex)\n this.data.normalIndex = [];\n this.data.normalIndex.push(index);\n }\n /** Add a param index. */\n public addParamIndex(index: number): void {\n if (!this.data.paramIndex)\n this.data.paramIndex = [];\n this.data.paramIndex.push(index);\n }\n /** Add a color index. */\n public addColorIndex(index: number): void {\n if (!this.data.colorIndex)\n this.data.colorIndex = [];\n this.data.colorIndex.push(index);\n }\n /**\n * Clean up the open facet.\n * @deprecated in 4.5.0 - will not be removed until after 2026-06-13. To remove nebulous \"open facet\" concept from the API. Call [[PolyfaceData.trimAllIndexArrays]]\n * instead.\n */\n public cleanupOpenFacet(): void {\n this.data.trimAllIndexArrays(this.data.pointIndex.length);\n }\n\n /**\n * Validate (the tail of) the active index arrays: point, normal, param, color.\n * @param index0 optional offset into the index arrays at which to start validating indices. Default 0.\n * @param errors optional array appended with error message(s) if invalid indices are encountered\n * @return whether the indices are valid\n */\n public validateAllIndices(index0: number = 0, errors?: string[]): boolean {\n const numPointIndices = this.data.pointIndex.length;\n const messages = errors ?? [];\n if (0 === numPointIndices) {\n messages.push(\"empty pointIndex array\");\n return false;\n }\n if (index0 < 0 || index0 >= numPointIndices) {\n messages.push(\"invalid input offset\");\n return false;\n }\n if (this.data.normalIndex && this.data.normalIndex.length !== numPointIndices)\n messages.push(\"normalIndex count must match pointIndex count\");\n if (this.data.paramIndex && this.data.paramIndex.length !== numPointIndices)\n messages.push(\"paramIndex count must equal pointIndex count\");\n if (this.data.colorIndex && this.data.colorIndex.length !== numPointIndices)\n messages.push(\"colorIndex count must equal pointIndex count\");\n if (this.data.edgeVisible.length !== numPointIndices)\n messages.push(\"visibleIndex count must equal pointIndex count\");\n if (!Polyface.areIndicesValid(this.data.pointIndex, index0, numPointIndices, this.data.point, this.data.point ? this.data.point.length : 0))\n messages.push(\"invalid point index encountered\");\n if (!Polyface.areIndicesValid(this.data.normalIndex, index0, numPointIndices, this.data.normal, this.data.normal ? this.data.normal.length : 0))\n messages.push(\"invalid normal index encountered\");\n if (!Polyface.areIndicesValid(this.data.paramIndex, index0, numPointIndices, this.data.param, this.data.param ? this.data.param.length : 0))\n messages.push(\"invalid param index encountered\");\n if (!Polyface.areIndicesValid(this.data.colorIndex, index0, numPointIndices, this.data.color, this.data.color ? this.data.color.length : 0))\n messages.push(\"invalid color index encountered\");\n if (this.data.edgeMateIndex) {\n if (this.data.edgeMateIndex.length !== numPointIndices)\n messages.push(\"edgeMateIndex count must equal pointIndex count\");\n else if (!this.data.edgeMateIndex.every((i: number | undefined) => i === undefined || this.data.isValidEdgeIndex(i)))\n messages.push(\"invalid edgeMate encountered\");\n }\n return 0 === messages.length;\n }\n\n /**\n * Announce the end of construction of a facet.\n * * Optionally check for:\n * * Same number of indices among all active index arrays -- point, normal, param, color\n * * All indices for the latest facet are within bounds of the respective data arrays.\n * * In error cases, all index arrays are trimmed back to the size when previous facet was terminated.\n * * A return value of `undefined` is normal. Otherwise, a string array of error messages is returned.\n */\n public terminateFacet(validateAllIndices: boolean = true): string[] | undefined {\n const numFacets = this._facetStart.length - 1;\n // number of indices in accepted facets\n const lengthA = this._facetStart[numFacets];\n // number of indices in all facets (accepted facet plus the last facet to be accepted)\n const lengthB = this.data.pointIndex.length;\n if (validateAllIndices) {\n const messages: string[] = [];\n if (lengthB < lengthA + 2)\n messages.push(\"Less than 3 indices in the last facet\");\n this.validateAllIndices(lengthA, messages);\n if (messages.length > 0) {\n this.data.trimAllIndexArrays(lengthA);\n return messages;\n }\n }\n this._facetStart.push(lengthB); // append start index of the future facet\n return undefined;\n }\n /** Number of facets (read-only property). */\n public override get facetCount(): number {\n return this._facetStart.length - 1;\n }\n /** Number of faces (read-only property). */\n public get faceCount(): number {\n return this.data.faceCount;\n }\n /** Number of points (read-only property). */\n public get pointCount(): number {\n return this.data.pointCount;\n }\n /** Number of colors (read-only property). */\n public get colorCount(): number {\n return this.data.colorCount;\n }\n /** Number of parameters (read-only property). */\n public get paramCount(): number {\n return this.data.paramCount;\n }\n /** Number of normals (read-only property). */\n public get normalCount(): number {\n return this.data.normalCount;\n }\n /** Test if `index` is a valid facet index. */\n public isValidFacetIndex(facetIndex: number): boolean {\n return facetIndex >= 0 && facetIndex < this.facetCount;\n }\n /** Return the number of edges in a particular facet. */\n public numEdgeInFacet(facetIndex: number): number {\n if (this.isValidFacetIndex(facetIndex))\n return this._facetStart[facetIndex + 1] - this._facetStart[facetIndex];\n return 0;\n }\n /**\n * Given a valid facet index, return the index at which its face loop starts in the index arrays.\n * * A \"face loop\" is a contiguous block of indices into the parallel polyface index arrays.\n * * Each of these indices represents an edge of a facet, thus it is sometimes called an \"edgeIndex\".\n * * Together with [[facetIndex1]], this method can be used to iterate the face loop of the facet\n * with index `iFacet` as follows:\n * ````\n * for (let iEdge = this.facetIndex0(iFacet); iEdge < this.facetIndex1(iFacet); iEdge++) {\n * const iPoint = this.data.pointIndex[iEdge];\n * const p = this.data.point[iPoint];\n * // ... process the edge of this facet starting at point p\n * }\n * ````\n */\n public facetIndex0(facetIndex: number): number {\n return this._facetStart[facetIndex];\n }\n /**\n * Given a valid facet index, return one past the index at which its face loop ends in the index arrays.\n * * For details, see [[facetIndex0]].\n */\n public facetIndex1(facetIndex: number): number {\n return this._facetStart[facetIndex + 1];\n }\n /** Return a readonly reference to the facetStart array accessed by [[facetIndex0]] and [[facetIndex1]]. */\n public get facetStart(): ReadonlyArray<number> {\n return this._facetStart;\n }\n /** create a visitor for this polyface */\n public createVisitor(numWrap: number = 0): IndexedPolyfaceVisitor {\n return IndexedPolyfaceVisitor.create(this, numWrap);\n }\n /** Return the range of (optionally transformed) points in this mesh. */\n public override range(transform?: Transform, result?: Range3d): Range3d {\n return this.data.range(result, transform);\n }\n /** Extend `range` with coordinates from this mesh. */\n public extendRange(range: Range3d, transform?: Transform): void {\n this.data.range(range, transform);\n }\n /**\n * Given the index of a facet, return the data pertaining to the face it is a part of.\n * @deprecated in 4.5.0 - will not be removed until after 2026-06-13. Use [[IndexedPolyface.tryGetFaceData]], which verifies the index is in range.\n */\n public getFaceDataByFacetIndex(facetIndex: number): FacetFaceData {\n return this.data.face[this._facetToFaceData[facetIndex]];\n }\n /**\n * Set new FacetFaceData.\n * * All terminated facets since the last face declaration will be mapped to a single new FacetFaceData object using\n * facetToFaceData[]. FacetFaceData holds the 2D range of the face. Returns `true` if successful, `false` otherwise.\n */\n public setNewFaceData(endFacetIndex: number = 0): boolean {\n const facetStart = this._facetToFaceData.length;\n if (facetStart >= this._facetStart.length)\n return false;\n if (0 === endFacetIndex) // the default for endFacetIndex is really the last facet\n endFacetIndex = this._facetStart.length; // last facet index corresponds to the future facet\n const faceData = FacetFaceData.createNull();\n const visitor = IndexedPolyfaceVisitor.create(this, 0);\n if (!visitor.moveToReadIndex(facetStart)) { // move visitor to first facet of new face\n return false;\n }\n // if parameter range is provided (by the polyface planeSet clipper) then use it\n const paramDefined = this.data.param !== undefined;\n const setParamRange: boolean = faceData.paramRange.isNull && paramDefined;\n do {\n if (setParamRange && visitor.param !== undefined)\n visitor.param.extendRange(faceData.paramRange);\n } while (visitor.moveToNextFacet() && visitor.currentReadIndex() < endFacetIndex);\n if (paramDefined && !(this.data.param!.length === 0) && faceData.paramDistanceRange.isNull)\n faceData.setParamDistanceRangeFromNewFaceData(this, facetStart, endFacetIndex);\n this.data.face.push(faceData);\n const faceDataIndex = this.data.face.length - 1;\n for (let i = this._facetToFaceData.length; i < endFacetIndex; i++)\n this._facetToFaceData.push(0 === this._facetStart[i] ? 0 : faceDataIndex);\n return true;\n }\n /** Second step of double dispatch: call `handler.handleIndexedPolyface(this)`. */\n public dispatchToGeometryHandler(handler: GeometryHandler): any {\n return handler.handleIndexedPolyface(this);\n }\n /** If the input accesses an edgeMateIndex array, return it along with the owning IndexedPolyface. */\n public static hasEdgeMateIndex(polyface: Polyface | PolyfaceVisitor): { parent: IndexedPolyface, edgeMateIndex: Array<number | undefined> } | undefined {\n let parent: IndexedPolyface | undefined;\n if (polyface instanceof Polyface) {\n if (polyface instanceof IndexedPolyface)\n parent = polyface;\n } else if (polyface.clientPolyface() && polyface.clientPolyface() instanceof IndexedPolyface)\n parent = polyface.clientPolyface() as IndexedPolyface;\n if (parent) {\n const edgeMateIndex = parent.data.edgeMateIndex;\n if (edgeMateIndex && edgeMateIndex.length > 0 && edgeMateIndex.length === parent.data.indexCount)\n return { parent, edgeMateIndex };\n }\n return undefined;\n }\n}\n\n/**\n * A PolyfaceVisitor manages data while iterating facets.\n * * The polyface visitor holds data for one facet at a time.\n * * The caller can request the position in the addressed polyfaceData as a \"readIndex\".\n * * The readIndex values (as numbers) are not assumed to be sequential (i.e., they might be contiguous facet indices\n * or the indexing scheme might have gaps at the whim of the particular PolyfaceVisitor implementation).\n * * Example usage:\n * ```\n * const visitor = myPolyface.createVisitor();\n * for (visitor.reset(); visitor.moveToNextFacet(); ) {\n * // process the current facet\n * }\n * ```\n * @public\n */\nexport interface PolyfaceVisitor extends PolyfaceData {\n /** Load data for the facet with given index. */\n moveToReadIndex(index: number): boolean;\n /** Return the index of the currently loaded facet. */\n currentReadIndex(): number;\n /** Load data for the next facet. */\n moveToNextFacet(): boolean;\n /** Restart the visitor at the first facet. */\n reset(): void;\n /** Return the point index of vertex i within the currently loaded facet. */\n clientPointIndex(i: number): number;\n /** Return the param index of vertex i within the currently loaded facet. */\n clientParamIndex(i: number): number;\n /** Return the normal index of vertex i within the currently loaded facet. */\n clientNormalIndex(i: number): number;\n /** Return the color index of vertex i within the currently loaded facet. */\n clientColorIndex(i: number): number;\n /** Return the aux data index of vertex i within the currently loaded facet. */\n clientAuxIndex(i: number): number;\n /** Return the client polyface. */\n clientPolyface(): Polyface | undefined;\n /**\n * Set the number of vertices replicated in visitor arrays (both data and index arrays).\n * * 0,1,2 are the most common values.\n * * Example: suppose `[6,7,8]` is the pointIndex array representing a triangle. First edge would be `6,7`. Second\n * edge is `7,8`. Third edge is `8,6`. To access `6` for the third edge, we have to go back to the start of array.\n * Therefore, it is useful to store `6` at the end of pointIndex array, i.e., `[6,7,8,6]` meaning `numWrap = 1`.\n * * Continuing this example, `numWrap = 2` (i.e., `[6,7,8,6,7]`) is useful when each vertex visit requires\n * the next two points, e.g., to form two adjacent vectors for a cross product.\n */\n setNumWrap(numWrap: number): void;\n /** Clear the contents of the data arrays. Use this along with `pushDataFrom` to build up new facets. */\n clearArrays(): void;\n /** Transfer data from a specified index of the other visitor as new data in this visitor. */\n pushDataFrom(other: PolyfaceVisitor, index: number): void;\n /**\n * Transfer interpolated data from the other visitor.\n * * All data values are interpolated at `fraction` between `other` values at `index0` and `index1`.\n */\n pushInterpolatedDataFrom(other: PolyfaceVisitor, index0: number, fraction: number, index1: number): void;\n /**\n * Return the number of facets this visitor is able to visit.\n * * Allows implementers to improve the efficiency of e.g., [[PolyfaceQuery.visitorClientFacetCount]].\n */\n getVisitableFacetCount?(): number;\n /** Create a visitor for a subset of the facets visitable by the instance. */\n createSubsetVisitor?(facetIndices: number[], numWrap: number): PolyfaceVisitor;\n}\n"]}
|
|
@@ -278,7 +278,7 @@ export declare class PolyfaceBuilder extends NullGeometryHandler {
|
|
|
278
278
|
* Apply stroke counts to curve primitives.
|
|
279
279
|
* * Recursively visit all children of data.
|
|
280
280
|
* * At each primitive, invoke `computeStrokeCountForOptions` method with options from the builder.
|
|
281
|
-
* @deprecated in 4.
|
|
281
|
+
* @deprecated in 4.8.0 - will not be removed until after 2026-06-13. This method does nothing and is unneeded.
|
|
282
282
|
*/
|
|
283
283
|
applyStrokeCountsToCurvePrimitives(data: AnyCurve | GeometryQuery): void;
|
|
284
284
|
private addBetweenStrokeSetsWithRuledNormals;
|
|
@@ -1066,7 +1066,7 @@ export class PolyfaceBuilder extends NullGeometryHandler {
|
|
|
1066
1066
|
/** Construct facets for a rotational sweep. */
|
|
1067
1067
|
addRotationalSweep(surface) {
|
|
1068
1068
|
const contour = surface.getSweepContourRef();
|
|
1069
|
-
const section0 = StrokeCountSection.
|
|
1069
|
+
const section0 = StrokeCountSection.create(contour.getCurves(), this._options);
|
|
1070
1070
|
const baseStrokes = section0.getStrokes();
|
|
1071
1071
|
// ensure sweep is positive for buildRotationalNormalsInLineStrings
|
|
1072
1072
|
const axis = surface.cloneAxisRay();
|
|
@@ -1110,7 +1110,7 @@ export class PolyfaceBuilder extends NullGeometryHandler {
|
|
|
1110
1110
|
* Apply stroke counts to curve primitives.
|
|
1111
1111
|
* * Recursively visit all children of data.
|
|
1112
1112
|
* * At each primitive, invoke `computeStrokeCountForOptions` method with options from the builder.
|
|
1113
|
-
* @deprecated in 4.
|
|
1113
|
+
* @deprecated in 4.8.0 - will not be removed until after 2026-06-13. This method does nothing and is unneeded.
|
|
1114
1114
|
*/
|
|
1115
1115
|
applyStrokeCountsToCurvePrimitives(data) {
|
|
1116
1116
|
const options = this._options;
|
|
@@ -1216,7 +1216,7 @@ export class PolyfaceBuilder extends NullGeometryHandler {
|
|
|
1216
1216
|
/** Add facets from the linear sweep. */
|
|
1217
1217
|
addLinearSweep(surface) {
|
|
1218
1218
|
const contour = surface.getCurvesRef();
|
|
1219
|
-
const section0 = StrokeCountSection.
|
|
1219
|
+
const section0 = StrokeCountSection.create(contour, this._options);
|
|
1220
1220
|
const stroke0 = section0.getStrokes();
|
|
1221
1221
|
const sweepVector = surface.cloneSweepVector();
|
|
1222
1222
|
const sweepTransform = Transform.createTranslation(sweepVector);
|
|
@@ -1238,7 +1238,7 @@ export class PolyfaceBuilder extends NullGeometryHandler {
|
|
|
1238
1238
|
let stroke1;
|
|
1239
1239
|
const sectionMaps = [];
|
|
1240
1240
|
for (const contour of contours)
|
|
1241
|
-
sectionMaps.push(StrokeCountSection.
|
|
1241
|
+
sectionMaps.push(StrokeCountSection.create(contour.curves, this._options));
|
|
1242
1242
|
if (StrokeCountSection.enforceStrokeCountCompatibility(sectionMaps)) {
|
|
1243
1243
|
StrokeCountSection.enforceCompatibleDistanceSums(sectionMaps);
|
|
1244
1244
|
for (let i = 0; i < contours.length; i++) {
|
|
@@ -1854,9 +1854,9 @@ export class PolyfaceBuilder extends NullGeometryHandler {
|
|
|
1854
1854
|
let indexA = -1;
|
|
1855
1855
|
let indexB = -1;
|
|
1856
1856
|
for (let i = this._polyface.facetIndex0(edge.facetIndex); i < this._polyface.facetIndex1(edge.facetIndex); ++i) {
|
|
1857
|
-
if (edge.
|
|
1857
|
+
if (edge.startVertex === this._polyface.data.pointIndex[i])
|
|
1858
1858
|
indexA = i;
|
|
1859
|
-
else if (edge.
|
|
1859
|
+
else if (edge.endVertex === this._polyface.data.pointIndex[i])
|
|
1860
1860
|
indexB = i;
|
|
1861
1861
|
}
|
|
1862
1862
|
return (indexA < 0 || indexB < 0) ? undefined : { edgeIndexA: indexA, edgeIndexB: indexB };
|