@itwin/core-geometry 5.0.0-dev.9 → 5.0.0-dev.92
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 +51 -1
- package/lib/cjs/Constant.js +17 -17
- package/lib/cjs/Constant.js.map +1 -1
- package/lib/cjs/Geometry.d.ts +2 -4
- package/lib/cjs/Geometry.d.ts.map +1 -1
- package/lib/cjs/Geometry.js +37 -39
- package/lib/cjs/Geometry.js.map +1 -1
- package/lib/cjs/bspline/AkimaCurve3d.js +3 -1
- package/lib/cjs/bspline/AkimaCurve3d.js.map +1 -1
- package/lib/cjs/bspline/BSpline1dNd.d.ts +90 -54
- package/lib/cjs/bspline/BSpline1dNd.d.ts.map +1 -1
- package/lib/cjs/bspline/BSpline1dNd.js +137 -84
- package/lib/cjs/bspline/BSpline1dNd.js.map +1 -1
- package/lib/cjs/bspline/BSplineCurve.d.ts +193 -155
- package/lib/cjs/bspline/BSplineCurve.d.ts.map +1 -1
- package/lib/cjs/bspline/BSplineCurve.js +249 -181
- package/lib/cjs/bspline/BSplineCurve.js.map +1 -1
- package/lib/cjs/bspline/BSplineCurve3dH.js +1 -0
- package/lib/cjs/bspline/BSplineCurve3dH.js.map +1 -1
- package/lib/cjs/bspline/BSplineCurveOps.d.ts.map +1 -1
- package/lib/cjs/bspline/BSplineCurveOps.js +18 -21
- package/lib/cjs/bspline/BSplineCurveOps.js.map +1 -1
- package/lib/cjs/bspline/BSplineSurface.js +22 -2
- package/lib/cjs/bspline/BSplineSurface.js.map +1 -1
- package/lib/cjs/bspline/Bezier1dNd.js +6 -0
- package/lib/cjs/bspline/Bezier1dNd.js.map +1 -1
- package/lib/cjs/bspline/BezierCurve3d.d.ts +3 -1
- package/lib/cjs/bspline/BezierCurve3d.d.ts.map +1 -1
- package/lib/cjs/bspline/BezierCurve3d.js +5 -5
- package/lib/cjs/bspline/BezierCurve3d.js.map +1 -1
- package/lib/cjs/bspline/BezierCurve3dH.js +2 -0
- package/lib/cjs/bspline/BezierCurve3dH.js.map +1 -1
- package/lib/cjs/bspline/BezierCurveBase.d.ts.map +1 -1
- package/lib/cjs/bspline/BezierCurveBase.js +21 -2
- package/lib/cjs/bspline/BezierCurveBase.js.map +1 -1
- package/lib/cjs/bspline/InterpolationCurve3d.js +12 -1
- package/lib/cjs/bspline/InterpolationCurve3d.js.map +1 -1
- package/lib/cjs/bspline/KnotVector.d.ts +82 -60
- package/lib/cjs/bspline/KnotVector.d.ts.map +1 -1
- package/lib/cjs/bspline/KnotVector.js +144 -84
- package/lib/cjs/bspline/KnotVector.js.map +1 -1
- package/lib/cjs/bspline/SurfaceLocationDetail.js +12 -0
- package/lib/cjs/bspline/SurfaceLocationDetail.js.map +1 -1
- package/lib/cjs/clipping/AlternatingConvexClipTree.js +14 -13
- package/lib/cjs/clipping/AlternatingConvexClipTree.js.map +1 -1
- package/lib/cjs/clipping/BooleanClipFactory.js.map +1 -1
- package/lib/cjs/clipping/BooleanClipNode.js +4 -0
- package/lib/cjs/clipping/BooleanClipNode.js.map +1 -1
- package/lib/cjs/clipping/ClipPlane.js +10 -1
- package/lib/cjs/clipping/ClipPlane.js.map +1 -1
- package/lib/cjs/clipping/ClipPrimitive.js +19 -0
- package/lib/cjs/clipping/ClipPrimitive.js.map +1 -1
- package/lib/cjs/clipping/ClipUtils.js +5 -1
- package/lib/cjs/clipping/ClipUtils.js.map +1 -1
- package/lib/cjs/clipping/ClipVector.js +11 -8
- package/lib/cjs/clipping/ClipVector.js.map +1 -1
- package/lib/cjs/clipping/ConvexClipPlaneSet.js +5 -3
- package/lib/cjs/clipping/ConvexClipPlaneSet.js.map +1 -1
- package/lib/cjs/clipping/UnionOfConvexClipPlaneSets.js +2 -1
- package/lib/cjs/clipping/UnionOfConvexClipPlaneSets.js.map +1 -1
- package/lib/cjs/clipping/internalContexts/LineStringOffsetClipperContext.js +3 -0
- package/lib/cjs/clipping/internalContexts/LineStringOffsetClipperContext.js.map +1 -1
- package/lib/cjs/core-geometry.d.ts +1 -0
- package/lib/cjs/core-geometry.d.ts.map +1 -1
- package/lib/cjs/core-geometry.js +1 -0
- package/lib/cjs/core-geometry.js.map +1 -1
- package/lib/cjs/curve/Arc3d.d.ts +17 -3
- package/lib/cjs/curve/Arc3d.d.ts.map +1 -1
- package/lib/cjs/curve/Arc3d.js +50 -21
- package/lib/cjs/curve/Arc3d.js.map +1 -1
- package/lib/cjs/curve/ConstructCurveBetweenCurves.js +3 -0
- package/lib/cjs/curve/ConstructCurveBetweenCurves.js.map +1 -1
- package/lib/cjs/curve/CoordinateXYZ.js +3 -2
- package/lib/cjs/curve/CoordinateXYZ.js.map +1 -1
- package/lib/cjs/curve/CurveChainWithDistanceIndex.d.ts +0 -2
- package/lib/cjs/curve/CurveChainWithDistanceIndex.d.ts.map +1 -1
- package/lib/cjs/curve/CurveChainWithDistanceIndex.js +25 -10
- package/lib/cjs/curve/CurveChainWithDistanceIndex.js.map +1 -1
- package/lib/cjs/curve/CurveCollection.d.ts +10 -0
- package/lib/cjs/curve/CurveCollection.d.ts.map +1 -1
- package/lib/cjs/curve/CurveCollection.js +35 -9
- package/lib/cjs/curve/CurveCollection.js.map +1 -1
- package/lib/cjs/curve/CurveCurve.js.map +1 -1
- package/lib/cjs/curve/CurveExtendMode.js.map +1 -1
- package/lib/cjs/curve/CurveFactory.d.ts +87 -53
- package/lib/cjs/curve/CurveFactory.d.ts.map +1 -1
- package/lib/cjs/curve/CurveFactory.js +213 -135
- package/lib/cjs/curve/CurveFactory.js.map +1 -1
- package/lib/cjs/curve/CurveLocationDetail.js +44 -0
- package/lib/cjs/curve/CurveLocationDetail.js.map +1 -1
- package/lib/cjs/curve/CurveOps.js.map +1 -1
- package/lib/cjs/curve/CurvePrimitive.d.ts +7 -10
- package/lib/cjs/curve/CurvePrimitive.d.ts.map +1 -1
- package/lib/cjs/curve/CurvePrimitive.js +27 -12
- package/lib/cjs/curve/CurvePrimitive.js.map +1 -1
- package/lib/cjs/curve/CurveProcessor.js +2 -0
- package/lib/cjs/curve/CurveProcessor.js.map +1 -1
- package/lib/cjs/curve/CurveTypes.js.map +1 -1
- package/lib/cjs/curve/CurveWireMomentsXYZ.js +2 -0
- package/lib/cjs/curve/CurveWireMomentsXYZ.js.map +1 -1
- package/lib/cjs/curve/GeometryQuery.js.map +1 -1
- package/lib/cjs/curve/LineSegment3d.js +6 -2
- package/lib/cjs/curve/LineSegment3d.js.map +1 -1
- package/lib/cjs/curve/LineString3d.js +27 -7
- package/lib/cjs/curve/LineString3d.js.map +1 -1
- package/lib/cjs/curve/Loop.js +12 -4
- package/lib/cjs/curve/Loop.js.map +1 -1
- package/lib/cjs/curve/OffsetOptions.js +25 -21
- package/lib/cjs/curve/OffsetOptions.js.map +1 -1
- package/lib/cjs/curve/ParityRegion.js +4 -2
- package/lib/cjs/curve/ParityRegion.js.map +1 -1
- package/lib/cjs/curve/Path.js +2 -2
- package/lib/cjs/curve/Path.js.map +1 -1
- package/lib/cjs/curve/PointString3d.js +3 -2
- package/lib/cjs/curve/PointString3d.js.map +1 -1
- package/lib/cjs/curve/ProxyCurve.js +1 -0
- package/lib/cjs/curve/ProxyCurve.js.map +1 -1
- package/lib/cjs/curve/Query/ConsolidateAdjacentPrimitivesContext.js +1 -0
- package/lib/cjs/curve/Query/ConsolidateAdjacentPrimitivesContext.js.map +1 -1
- package/lib/cjs/curve/Query/CurveSplitContext.js +3 -0
- package/lib/cjs/curve/Query/CurveSplitContext.js.map +1 -1
- package/lib/cjs/curve/Query/CylindricalRange.js +6 -2
- package/lib/cjs/curve/Query/CylindricalRange.js.map +1 -1
- package/lib/cjs/curve/Query/InOutTests.js.map +1 -1
- package/lib/cjs/curve/Query/PlanarSubdivision.js +4 -6
- package/lib/cjs/curve/Query/PlanarSubdivision.js.map +1 -1
- package/lib/cjs/curve/Query/StrokeCountChain.js +12 -0
- package/lib/cjs/curve/Query/StrokeCountChain.js.map +1 -1
- package/lib/cjs/curve/Query/StrokeCountMap.js +14 -0
- package/lib/cjs/curve/Query/StrokeCountMap.js.map +1 -1
- package/lib/cjs/curve/RegionMomentsXY.js +4 -5
- package/lib/cjs/curve/RegionMomentsXY.js.map +1 -1
- package/lib/cjs/curve/RegionOps.js +9 -10
- package/lib/cjs/curve/RegionOps.js.map +1 -1
- package/lib/cjs/curve/RegionOpsClassificationSweeps.js +24 -1
- package/lib/cjs/curve/RegionOpsClassificationSweeps.js.map +1 -1
- package/lib/cjs/curve/StrokeOptions.d.ts +4 -4
- package/lib/cjs/curve/StrokeOptions.d.ts.map +1 -1
- package/lib/cjs/curve/StrokeOptions.js +23 -6
- package/lib/cjs/curve/StrokeOptions.js.map +1 -1
- package/lib/cjs/curve/UnionRegion.js +4 -2
- package/lib/cjs/curve/UnionRegion.js.map +1 -1
- package/lib/cjs/curve/internalContexts/AppendPlaneIntersectionStrokeHandler.js +13 -7
- package/lib/cjs/curve/internalContexts/AppendPlaneIntersectionStrokeHandler.js.map +1 -1
- package/lib/cjs/curve/internalContexts/ChainCollectorContext.js +6 -0
- package/lib/cjs/curve/internalContexts/ChainCollectorContext.js.map +1 -1
- package/lib/cjs/curve/internalContexts/CloneCurvesContext.js +2 -0
- package/lib/cjs/curve/internalContexts/CloneCurvesContext.js.map +1 -1
- package/lib/cjs/curve/internalContexts/CloneWithExpandedLineStrings.js.map +1 -1
- package/lib/cjs/curve/internalContexts/ClosestPointStrokeHandler.js +13 -5
- package/lib/cjs/curve/internalContexts/ClosestPointStrokeHandler.js.map +1 -1
- package/lib/cjs/curve/internalContexts/CountLinearPartsSearchContext.js +3 -0
- package/lib/cjs/curve/internalContexts/CountLinearPartsSearchContext.js.map +1 -1
- package/lib/cjs/curve/internalContexts/CurveCurveCloseApproachXY.js +18 -5
- package/lib/cjs/curve/internalContexts/CurveCurveCloseApproachXY.js.map +1 -1
- package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.js +26 -13
- package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.js.map +1 -1
- package/lib/cjs/curve/internalContexts/CurveCurveIntersectXYZ.js +11 -5
- package/lib/cjs/curve/internalContexts/CurveCurveIntersectXYZ.js.map +1 -1
- package/lib/cjs/curve/internalContexts/CurveLengthContext.js +6 -0
- package/lib/cjs/curve/internalContexts/CurveLengthContext.js.map +1 -1
- package/lib/cjs/curve/internalContexts/CurveOffsetXYHandler.js +8 -6
- package/lib/cjs/curve/internalContexts/CurveOffsetXYHandler.js.map +1 -1
- package/lib/cjs/curve/internalContexts/EllipticalArcApproximationContext.js +38 -5
- package/lib/cjs/curve/internalContexts/EllipticalArcApproximationContext.js.map +1 -1
- package/lib/cjs/curve/internalContexts/GapSearchContext.js +1 -0
- package/lib/cjs/curve/internalContexts/GapSearchContext.js.map +1 -1
- package/lib/cjs/curve/internalContexts/MultiChainCollector.js +12 -0
- package/lib/cjs/curve/internalContexts/MultiChainCollector.js.map +1 -1
- package/lib/cjs/curve/internalContexts/NewtonRtoRStrokeHandler.js +1 -0
- package/lib/cjs/curve/internalContexts/NewtonRtoRStrokeHandler.js.map +1 -1
- package/lib/cjs/curve/internalContexts/PlaneAltitudeRangeContext.js +7 -0
- package/lib/cjs/curve/internalContexts/PlaneAltitudeRangeContext.js.map +1 -1
- package/lib/cjs/curve/internalContexts/PolygonOffsetContext.js +22 -4
- package/lib/cjs/curve/internalContexts/PolygonOffsetContext.js.map +1 -1
- package/lib/cjs/curve/internalContexts/SumLengthsContext.js +1 -0
- package/lib/cjs/curve/internalContexts/SumLengthsContext.js.map +1 -1
- package/lib/cjs/curve/internalContexts/TransformInPlaceContext.js +3 -0
- package/lib/cjs/curve/internalContexts/TransformInPlaceContext.js.map +1 -1
- package/lib/cjs/curve/spiral/AustralianRailCorpXYEvaluator.js +2 -0
- package/lib/cjs/curve/spiral/AustralianRailCorpXYEvaluator.js.map +1 -1
- package/lib/cjs/curve/spiral/ClothoidSeries.js +4 -0
- package/lib/cjs/curve/spiral/ClothoidSeries.js.map +1 -1
- package/lib/cjs/curve/spiral/CubicEvaluator.js +2 -0
- package/lib/cjs/curve/spiral/CubicEvaluator.js.map +1 -1
- package/lib/cjs/curve/spiral/CzechSpiralEvaluator.js +4 -0
- package/lib/cjs/curve/spiral/CzechSpiralEvaluator.js.map +1 -1
- package/lib/cjs/curve/spiral/DirectHalfCosineSpiralEvaluator.js +5 -0
- package/lib/cjs/curve/spiral/DirectHalfCosineSpiralEvaluator.js.map +1 -1
- package/lib/cjs/curve/spiral/DirectSpiral3d.js +12 -2
- package/lib/cjs/curve/spiral/DirectSpiral3d.js.map +1 -1
- package/lib/cjs/curve/spiral/IntegratedSpiral3d.js +24 -4
- package/lib/cjs/curve/spiral/IntegratedSpiral3d.js.map +1 -1
- package/lib/cjs/curve/spiral/MXCubicAlongArcSpiralEvaluator.js +2 -0
- package/lib/cjs/curve/spiral/MXCubicAlongArcSpiralEvaluator.js.map +1 -1
- package/lib/cjs/curve/spiral/NormalizedTransition.js +5 -0
- package/lib/cjs/curve/spiral/NormalizedTransition.js.map +1 -1
- package/lib/cjs/curve/spiral/PolishCubicSpiralEvaluator.js +2 -0
- package/lib/cjs/curve/spiral/PolishCubicSpiralEvaluator.js.map +1 -1
- package/lib/cjs/curve/spiral/TransitionConditionalProperties.js +10 -0
- package/lib/cjs/curve/spiral/TransitionConditionalProperties.js.map +1 -1
- package/lib/cjs/curve/spiral/TransitionSpiral3d.js +10 -0
- package/lib/cjs/curve/spiral/TransitionSpiral3d.js.map +1 -1
- package/lib/cjs/curve/spiral/XYCurveEvaluator.js +6 -0
- package/lib/cjs/curve/spiral/XYCurveEvaluator.js.map +1 -1
- package/lib/cjs/geometry3d/Angle.js +18 -16
- package/lib/cjs/geometry3d/Angle.js.map +1 -1
- package/lib/cjs/geometry3d/AngleSweep.d.ts +7 -2
- package/lib/cjs/geometry3d/AngleSweep.d.ts.map +1 -1
- package/lib/cjs/geometry3d/AngleSweep.js +14 -2
- package/lib/cjs/geometry3d/AngleSweep.js.map +1 -1
- package/lib/cjs/geometry3d/BarycentricTriangle.js +25 -0
- package/lib/cjs/geometry3d/BarycentricTriangle.js.map +1 -1
- package/lib/cjs/geometry3d/BilinearPatch.js +8 -0
- package/lib/cjs/geometry3d/BilinearPatch.js.map +1 -1
- package/lib/cjs/geometry3d/CoincidentGeometryOps.js +5 -0
- package/lib/cjs/geometry3d/CoincidentGeometryOps.js.map +1 -1
- package/lib/cjs/geometry3d/Ellipsoid.js +48 -0
- package/lib/cjs/geometry3d/Ellipsoid.js.map +1 -1
- package/lib/cjs/geometry3d/FrameBuilder.js +12 -4
- package/lib/cjs/geometry3d/FrameBuilder.js.map +1 -1
- package/lib/cjs/geometry3d/FrustumAnimation.js +7 -0
- package/lib/cjs/geometry3d/FrustumAnimation.js.map +1 -1
- package/lib/cjs/geometry3d/GeometryHandler.js.map +1 -1
- package/lib/cjs/geometry3d/GrowableBlockedArray.js +12 -0
- package/lib/cjs/geometry3d/GrowableBlockedArray.js.map +1 -1
- package/lib/cjs/geometry3d/GrowableFloat64Array.js +3 -0
- package/lib/cjs/geometry3d/GrowableFloat64Array.js.map +1 -1
- package/lib/cjs/geometry3d/GrowableXYArray.d.ts +0 -5
- package/lib/cjs/geometry3d/GrowableXYArray.d.ts.map +1 -1
- package/lib/cjs/geometry3d/GrowableXYArray.js +16 -7
- package/lib/cjs/geometry3d/GrowableXYArray.js.map +1 -1
- package/lib/cjs/geometry3d/GrowableXYZArray.d.ts +32 -10
- package/lib/cjs/geometry3d/GrowableXYZArray.d.ts.map +1 -1
- package/lib/cjs/geometry3d/GrowableXYZArray.js +70 -16
- package/lib/cjs/geometry3d/GrowableXYZArray.js.map +1 -1
- package/lib/cjs/geometry3d/IndexedCollectionInterval.js +6 -0
- package/lib/cjs/geometry3d/IndexedCollectionInterval.js.map +1 -1
- package/lib/cjs/geometry3d/IndexedXYCollection.js +1 -0
- package/lib/cjs/geometry3d/IndexedXYCollection.js.map +1 -1
- package/lib/cjs/geometry3d/IndexedXYZCollection.d.ts +13 -2
- package/lib/cjs/geometry3d/IndexedXYZCollection.d.ts.map +1 -1
- package/lib/cjs/geometry3d/IndexedXYZCollection.js +26 -11
- package/lib/cjs/geometry3d/IndexedXYZCollection.js.map +1 -1
- package/lib/cjs/geometry3d/LongitudeLatitudeAltitude.js +3 -0
- package/lib/cjs/geometry3d/LongitudeLatitudeAltitude.js.map +1 -1
- package/lib/cjs/geometry3d/Matrix3d.d.ts +3 -4
- package/lib/cjs/geometry3d/Matrix3d.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Matrix3d.js +36 -14
- package/lib/cjs/geometry3d/Matrix3d.js.map +1 -1
- package/lib/cjs/geometry3d/OrderedRotationAngles.js +10 -2
- package/lib/cjs/geometry3d/OrderedRotationAngles.js.map +1 -1
- package/lib/cjs/geometry3d/Plane3d.js.map +1 -1
- package/lib/cjs/geometry3d/Plane3dByOriginAndUnitNormal.js +2 -0
- package/lib/cjs/geometry3d/Plane3dByOriginAndUnitNormal.js.map +1 -1
- package/lib/cjs/geometry3d/Plane3dByOriginAndVectors.js +7 -0
- package/lib/cjs/geometry3d/Plane3dByOriginAndVectors.js.map +1 -1
- package/lib/cjs/geometry3d/Point2dArrayCarrier.js +2 -0
- package/lib/cjs/geometry3d/Point2dArrayCarrier.js.map +1 -1
- package/lib/cjs/geometry3d/Point2dVector2d.js +4 -0
- package/lib/cjs/geometry3d/Point2dVector2d.js.map +1 -1
- package/lib/cjs/geometry3d/Point3dArrayCarrier.js +3 -1
- package/lib/cjs/geometry3d/Point3dArrayCarrier.js.map +1 -1
- package/lib/cjs/geometry3d/Point3dVector3d.d.ts +7 -10
- package/lib/cjs/geometry3d/Point3dVector3d.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Point3dVector3d.js +16 -10
- package/lib/cjs/geometry3d/Point3dVector3d.js.map +1 -1
- package/lib/cjs/geometry3d/PointHelpers.d.ts +4 -4
- package/lib/cjs/geometry3d/PointHelpers.d.ts.map +1 -1
- package/lib/cjs/geometry3d/PointHelpers.js +8 -8
- package/lib/cjs/geometry3d/PointHelpers.js.map +1 -1
- package/lib/cjs/geometry3d/PointStreaming.js +12 -4
- package/lib/cjs/geometry3d/PointStreaming.js.map +1 -1
- package/lib/cjs/geometry3d/PolygonOps.d.ts +2 -2
- package/lib/cjs/geometry3d/PolygonOps.js +62 -25
- package/lib/cjs/geometry3d/PolygonOps.js.map +1 -1
- package/lib/cjs/geometry3d/PolylineCompressionByEdgeOffset.js +7 -3
- package/lib/cjs/geometry3d/PolylineCompressionByEdgeOffset.js.map +1 -1
- package/lib/cjs/geometry3d/PolylineOps.d.ts +9 -5
- package/lib/cjs/geometry3d/PolylineOps.d.ts.map +1 -1
- package/lib/cjs/geometry3d/PolylineOps.js +12 -5
- package/lib/cjs/geometry3d/PolylineOps.js.map +1 -1
- package/lib/cjs/geometry3d/Range.js +21 -4
- package/lib/cjs/geometry3d/Range.js.map +1 -1
- package/lib/cjs/geometry3d/Ray2d.js +2 -0
- package/lib/cjs/geometry3d/Ray2d.js.map +1 -1
- package/lib/cjs/geometry3d/Ray3d.d.ts +2 -2
- package/lib/cjs/geometry3d/Ray3d.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Ray3d.js +20 -11
- package/lib/cjs/geometry3d/Ray3d.js.map +1 -1
- package/lib/cjs/geometry3d/ReusableObjectCache.js +4 -0
- package/lib/cjs/geometry3d/ReusableObjectCache.js.map +1 -1
- package/lib/cjs/geometry3d/Segment1d.js +4 -0
- package/lib/cjs/geometry3d/Segment1d.js.map +1 -1
- package/lib/cjs/geometry3d/SortablePolygon.js +11 -0
- package/lib/cjs/geometry3d/SortablePolygon.js.map +1 -1
- package/lib/cjs/geometry3d/Transform.d.ts +1 -1
- package/lib/cjs/geometry3d/Transform.js +4 -1
- package/lib/cjs/geometry3d/Transform.js.map +1 -1
- package/lib/cjs/geometry3d/UVSurfaceOps.js.map +1 -1
- package/lib/cjs/geometry3d/XYZProps.js.map +1 -1
- package/lib/cjs/geometry3d/YawPitchRollAngles.js +6 -0
- package/lib/cjs/geometry3d/YawPitchRollAngles.js.map +1 -1
- package/lib/cjs/geometry4d/Map4d.js +2 -0
- package/lib/cjs/geometry4d/Map4d.js.map +1 -1
- package/lib/cjs/geometry4d/Matrix4d.js +1 -0
- package/lib/cjs/geometry4d/Matrix4d.js.map +1 -1
- package/lib/cjs/geometry4d/MomentData.d.ts +72 -73
- package/lib/cjs/geometry4d/MomentData.d.ts.map +1 -1
- package/lib/cjs/geometry4d/MomentData.js +90 -66
- package/lib/cjs/geometry4d/MomentData.js.map +1 -1
- package/lib/cjs/geometry4d/PlaneByOriginAndVectors4d.js +6 -0
- package/lib/cjs/geometry4d/PlaneByOriginAndVectors4d.js.map +1 -1
- package/lib/cjs/geometry4d/Point4d.js +2 -0
- package/lib/cjs/geometry4d/Point4d.js.map +1 -1
- package/lib/cjs/numerics/BandedSystem.js.map +1 -1
- package/lib/cjs/numerics/BezierPolynomials.js +8 -0
- package/lib/cjs/numerics/BezierPolynomials.js.map +1 -1
- package/lib/cjs/numerics/ClusterableArray.js +29 -13
- package/lib/cjs/numerics/ClusterableArray.js.map +1 -1
- package/lib/cjs/numerics/Complex.js +2 -0
- package/lib/cjs/numerics/Complex.js.map +1 -1
- package/lib/cjs/numerics/ConvexPolygon2d.js +3 -0
- package/lib/cjs/numerics/ConvexPolygon2d.js.map +1 -1
- package/lib/cjs/numerics/Newton.js +59 -4
- package/lib/cjs/numerics/Newton.js.map +1 -1
- package/lib/cjs/numerics/PascalCoefficients.js +1 -1
- package/lib/cjs/numerics/PascalCoefficients.js.map +1 -1
- package/lib/cjs/numerics/PolarData.js +13 -1
- package/lib/cjs/numerics/PolarData.js.map +1 -1
- package/lib/cjs/numerics/Polynomials.js +64 -26
- package/lib/cjs/numerics/Polynomials.js.map +1 -1
- package/lib/cjs/numerics/Quadrature.js +26 -20
- package/lib/cjs/numerics/Quadrature.js.map +1 -1
- package/lib/cjs/numerics/Range1dArray.js.map +1 -1
- package/lib/cjs/numerics/SmallSystem.js.map +1 -1
- package/lib/cjs/numerics/TriDiagonalSystem.js +11 -0
- package/lib/cjs/numerics/TriDiagonalSystem.js.map +1 -1
- package/lib/cjs/numerics/UnionFind.js +1 -0
- package/lib/cjs/numerics/UnionFind.js.map +1 -1
- package/lib/cjs/numerics/UsageSums.js +10 -0
- package/lib/cjs/numerics/UsageSums.js.map +1 -1
- package/lib/cjs/polyface/AuxData.js +16 -0
- package/lib/cjs/polyface/AuxData.js.map +1 -1
- package/lib/cjs/polyface/BoxTopology.js +67 -67
- package/lib/cjs/polyface/BoxTopology.js.map +1 -1
- package/lib/cjs/polyface/FacetFaceData.d.ts +1 -1
- package/lib/cjs/polyface/FacetFaceData.js +3 -1
- package/lib/cjs/polyface/FacetFaceData.js.map +1 -1
- package/lib/cjs/polyface/FacetLocationDetail.js +30 -0
- package/lib/cjs/polyface/FacetLocationDetail.js.map +1 -1
- package/lib/cjs/polyface/FacetOrientation.js +12 -1
- package/lib/cjs/polyface/FacetOrientation.js.map +1 -1
- package/lib/cjs/polyface/GreedyTriangulationBetweenLineStrings.js +18 -2
- package/lib/cjs/polyface/GreedyTriangulationBetweenLineStrings.js.map +1 -1
- package/lib/cjs/polyface/IndexedEdgeMatcher.d.ts +33 -23
- package/lib/cjs/polyface/IndexedEdgeMatcher.d.ts.map +1 -1
- package/lib/cjs/polyface/IndexedEdgeMatcher.js +63 -33
- package/lib/cjs/polyface/IndexedEdgeMatcher.js.map +1 -1
- package/lib/cjs/polyface/IndexedPolyfaceVisitor.d.ts +3 -2
- package/lib/cjs/polyface/IndexedPolyfaceVisitor.d.ts.map +1 -1
- package/lib/cjs/polyface/IndexedPolyfaceVisitor.js +11 -2
- package/lib/cjs/polyface/IndexedPolyfaceVisitor.js.map +1 -1
- package/lib/cjs/polyface/IndexedPolyfaceWalker.d.ts +233 -0
- package/lib/cjs/polyface/IndexedPolyfaceWalker.d.ts.map +1 -0
- package/lib/cjs/polyface/IndexedPolyfaceWalker.js +353 -0
- package/lib/cjs/polyface/IndexedPolyfaceWalker.js.map +1 -0
- package/lib/cjs/polyface/Polyface.d.ts +35 -10
- package/lib/cjs/polyface/Polyface.d.ts.map +1 -1
- package/lib/cjs/polyface/Polyface.js +73 -12
- package/lib/cjs/polyface/Polyface.js.map +1 -1
- package/lib/cjs/polyface/PolyfaceBuilder.d.ts +14 -27
- package/lib/cjs/polyface/PolyfaceBuilder.d.ts.map +1 -1
- package/lib/cjs/polyface/PolyfaceBuilder.js +47 -79
- package/lib/cjs/polyface/PolyfaceBuilder.js.map +1 -1
- package/lib/cjs/polyface/PolyfaceClip.js +8 -0
- package/lib/cjs/polyface/PolyfaceClip.js.map +1 -1
- package/lib/cjs/polyface/PolyfaceData.d.ts +28 -0
- package/lib/cjs/polyface/PolyfaceData.d.ts.map +1 -1
- package/lib/cjs/polyface/PolyfaceData.js +87 -5
- package/lib/cjs/polyface/PolyfaceData.js.map +1 -1
- package/lib/cjs/polyface/PolyfaceQuery.js +47 -7
- package/lib/cjs/polyface/PolyfaceQuery.js.map +1 -1
- package/lib/cjs/polyface/RangeLengthData.js +7 -0
- package/lib/cjs/polyface/RangeLengthData.js.map +1 -1
- package/lib/cjs/polyface/RangeTree/LineString3dRangeTreeContext.js +12 -0
- package/lib/cjs/polyface/RangeTree/LineString3dRangeTreeContext.js.map +1 -1
- package/lib/cjs/polyface/RangeTree/MinimumValueTester.js +5 -2
- package/lib/cjs/polyface/RangeTree/MinimumValueTester.js.map +1 -1
- package/lib/cjs/polyface/RangeTree/Point3dArrayRangeTreeContext.js +12 -0
- package/lib/cjs/polyface/RangeTree/Point3dArrayRangeTreeContext.js.map +1 -1
- package/lib/cjs/polyface/RangeTree/PolyfaceRangeTreeContext.js +14 -0
- package/lib/cjs/polyface/RangeTree/PolyfaceRangeTreeContext.js.map +1 -1
- package/lib/cjs/polyface/RangeTree/RangeTreeNode.js +5 -0
- package/lib/cjs/polyface/RangeTree/RangeTreeNode.js.map +1 -1
- package/lib/cjs/polyface/RangeTree/RangeTreeSearchHandlers.js +43 -0
- package/lib/cjs/polyface/RangeTree/RangeTreeSearchHandlers.js.map +1 -1
- package/lib/cjs/polyface/TaggedNumericData.js +8 -0
- package/lib/cjs/polyface/TaggedNumericData.js.map +1 -1
- package/lib/cjs/polyface/TriangleCandidate.js +3 -0
- package/lib/cjs/polyface/TriangleCandidate.js.map +1 -1
- package/lib/cjs/polyface/multiclip/BuildAverageNormalsContext.js +7 -0
- package/lib/cjs/polyface/multiclip/BuildAverageNormalsContext.js.map +1 -1
- package/lib/cjs/polyface/multiclip/GriddedRaggedRange2dSet.js +6 -0
- package/lib/cjs/polyface/multiclip/GriddedRaggedRange2dSet.js.map +1 -1
- package/lib/cjs/polyface/multiclip/GriddedRaggedRange2dSetWithOverflow.js +3 -0
- package/lib/cjs/polyface/multiclip/GriddedRaggedRange2dSetWithOverflow.js.map +1 -1
- package/lib/cjs/polyface/multiclip/LinearSearchRange2dArray.js +3 -0
- package/lib/cjs/polyface/multiclip/LinearSearchRange2dArray.js.map +1 -1
- package/lib/cjs/polyface/multiclip/OffsetMeshContext.js +32 -0
- package/lib/cjs/polyface/multiclip/OffsetMeshContext.js.map +1 -1
- package/lib/cjs/polyface/multiclip/Range2dSearchInterface.js.map +1 -1
- package/lib/cjs/polyface/multiclip/RangeSearch.js +5 -5
- package/lib/cjs/polyface/multiclip/RangeSearch.js.map +1 -1
- package/lib/cjs/polyface/multiclip/SweepLineStringToFacetContext.js +21 -8
- package/lib/cjs/polyface/multiclip/SweepLineStringToFacetContext.js.map +1 -1
- package/lib/cjs/polyface/multiclip/XYPointBuckets.js +6 -0
- package/lib/cjs/polyface/multiclip/XYPointBuckets.js.map +1 -1
- package/lib/cjs/serialization/BGFBAccessors.js +82 -164
- package/lib/cjs/serialization/BGFBAccessors.js.map +1 -1
- package/lib/cjs/serialization/BGFBReader.js +22 -22
- package/lib/cjs/serialization/BGFBReader.js.map +1 -1
- package/lib/cjs/serialization/BGFBWriter.js +1 -0
- package/lib/cjs/serialization/BGFBWriter.js.map +1 -1
- package/lib/cjs/serialization/BentleyGeometryFlatBuffer.js.map +1 -1
- package/lib/cjs/serialization/DeepCompare.js +17 -17
- package/lib/cjs/serialization/DeepCompare.js.map +1 -1
- package/lib/cjs/serialization/GeometrySamples.d.ts +5 -5
- package/lib/cjs/serialization/GeometrySamples.d.ts.map +1 -1
- package/lib/cjs/serialization/GeometrySamples.js +113 -112
- package/lib/cjs/serialization/GeometrySamples.js.map +1 -1
- package/lib/cjs/serialization/IModelJsonSchema.d.ts +70 -63
- package/lib/cjs/serialization/IModelJsonSchema.d.ts.map +1 -1
- package/lib/cjs/serialization/IModelJsonSchema.js +87 -74
- package/lib/cjs/serialization/IModelJsonSchema.js.map +1 -1
- package/lib/cjs/serialization/SerializationHelpers.js.map +1 -1
- package/lib/cjs/solid/Box.js +7 -2
- package/lib/cjs/solid/Box.js.map +1 -1
- package/lib/cjs/solid/Cone.d.ts +39 -14
- package/lib/cjs/solid/Cone.d.ts.map +1 -1
- package/lib/cjs/solid/Cone.js +52 -16
- package/lib/cjs/solid/Cone.js.map +1 -1
- package/lib/cjs/solid/LinearSweep.js +4 -2
- package/lib/cjs/solid/LinearSweep.js.map +1 -1
- package/lib/cjs/solid/RotationalSweep.js +5 -2
- package/lib/cjs/solid/RotationalSweep.js.map +1 -1
- package/lib/cjs/solid/RuledSweep.d.ts +26 -23
- package/lib/cjs/solid/RuledSweep.d.ts.map +1 -1
- package/lib/cjs/solid/RuledSweep.js +32 -24
- package/lib/cjs/solid/RuledSweep.js.map +1 -1
- package/lib/cjs/solid/SolidPrimitive.d.ts +12 -11
- package/lib/cjs/solid/SolidPrimitive.d.ts.map +1 -1
- package/lib/cjs/solid/SolidPrimitive.js +11 -6
- package/lib/cjs/solid/SolidPrimitive.js.map +1 -1
- package/lib/cjs/solid/Sphere.d.ts +34 -17
- package/lib/cjs/solid/Sphere.d.ts.map +1 -1
- package/lib/cjs/solid/Sphere.js +51 -24
- package/lib/cjs/solid/Sphere.js.map +1 -1
- package/lib/cjs/solid/SweepContour.d.ts +24 -15
- package/lib/cjs/solid/SweepContour.d.ts.map +1 -1
- package/lib/cjs/solid/SweepContour.js +33 -15
- package/lib/cjs/solid/SweepContour.js.map +1 -1
- package/lib/cjs/solid/TorusPipe.js +7 -2
- package/lib/cjs/solid/TorusPipe.js.map +1 -1
- package/lib/cjs/topology/ChainMerge.js +16 -4
- package/lib/cjs/topology/ChainMerge.js.map +1 -1
- package/lib/cjs/topology/Graph.js +41 -6
- package/lib/cjs/topology/Graph.js.map +1 -1
- package/lib/cjs/topology/HalfEdgeGraphFromIndexedLoopsContext.d.ts +1 -1
- package/lib/cjs/topology/HalfEdgeGraphFromIndexedLoopsContext.js +5 -1
- package/lib/cjs/topology/HalfEdgeGraphFromIndexedLoopsContext.js.map +1 -1
- package/lib/cjs/topology/HalfEdgeGraphSearch.js +2 -0
- package/lib/cjs/topology/HalfEdgeGraphSearch.js.map +1 -1
- package/lib/cjs/topology/HalfEdgeGraphSpineContext.js +9 -2
- package/lib/cjs/topology/HalfEdgeGraphSpineContext.js.map +1 -1
- package/lib/cjs/topology/HalfEdgeGraphValidation.js +7 -9
- package/lib/cjs/topology/HalfEdgeGraphValidation.js.map +1 -1
- package/lib/cjs/topology/HalfEdgeMarkSet.js +5 -0
- package/lib/cjs/topology/HalfEdgeMarkSet.js.map +1 -1
- package/lib/cjs/topology/HalfEdgeNodeXYZUV.js +6 -0
- package/lib/cjs/topology/HalfEdgeNodeXYZUV.js.map +1 -1
- package/lib/cjs/topology/HalfEdgePointInGraphSearch.js +1 -0
- package/lib/cjs/topology/HalfEdgePointInGraphSearch.js.map +1 -1
- package/lib/cjs/topology/HalfEdgePositionDetail.js +16 -0
- package/lib/cjs/topology/HalfEdgePositionDetail.js.map +1 -1
- package/lib/cjs/topology/HalfEdgePriorityQueue.js +2 -0
- package/lib/cjs/topology/HalfEdgePriorityQueue.js.map +1 -1
- package/lib/cjs/topology/InsertAndRetriangulateContext.js +4 -0
- package/lib/cjs/topology/InsertAndRetriangulateContext.js.map +1 -1
- package/lib/cjs/topology/MaskManager.js +3 -0
- package/lib/cjs/topology/MaskManager.js.map +1 -1
- package/lib/cjs/topology/Merging.js +11 -6
- package/lib/cjs/topology/Merging.js.map +1 -1
- package/lib/cjs/topology/RegularizeFace.js +22 -0
- package/lib/cjs/topology/RegularizeFace.js.map +1 -1
- package/lib/cjs/topology/SignedDataSummary.js +22 -0
- package/lib/cjs/topology/SignedDataSummary.js.map +1 -1
- package/lib/cjs/topology/SpaceTriangulation.js.map +1 -1
- package/lib/cjs/topology/Triangulation.js +21 -11
- package/lib/cjs/topology/Triangulation.js.map +1 -1
- package/lib/cjs/topology/XYParitySearchContext.js +13 -0
- package/lib/cjs/topology/XYParitySearchContext.js.map +1 -1
- package/lib/esm/Constant.js +17 -17
- package/lib/esm/Constant.js.map +1 -1
- package/lib/esm/Geometry.d.ts +2 -4
- package/lib/esm/Geometry.d.ts.map +1 -1
- package/lib/esm/Geometry.js +37 -39
- package/lib/esm/Geometry.js.map +1 -1
- package/lib/esm/bspline/AkimaCurve3d.js +3 -1
- package/lib/esm/bspline/AkimaCurve3d.js.map +1 -1
- package/lib/esm/bspline/BSpline1dNd.d.ts +90 -54
- package/lib/esm/bspline/BSpline1dNd.d.ts.map +1 -1
- package/lib/esm/bspline/BSpline1dNd.js +137 -84
- package/lib/esm/bspline/BSpline1dNd.js.map +1 -1
- package/lib/esm/bspline/BSplineCurve.d.ts +193 -155
- package/lib/esm/bspline/BSplineCurve.d.ts.map +1 -1
- package/lib/esm/bspline/BSplineCurve.js +249 -181
- package/lib/esm/bspline/BSplineCurve.js.map +1 -1
- package/lib/esm/bspline/BSplineCurve3dH.js +1 -0
- package/lib/esm/bspline/BSplineCurve3dH.js.map +1 -1
- package/lib/esm/bspline/BSplineCurveOps.d.ts.map +1 -1
- package/lib/esm/bspline/BSplineCurveOps.js +18 -21
- package/lib/esm/bspline/BSplineCurveOps.js.map +1 -1
- package/lib/esm/bspline/BSplineSurface.js +22 -2
- package/lib/esm/bspline/BSplineSurface.js.map +1 -1
- package/lib/esm/bspline/Bezier1dNd.js +6 -0
- package/lib/esm/bspline/Bezier1dNd.js.map +1 -1
- package/lib/esm/bspline/BezierCurve3d.d.ts +3 -1
- package/lib/esm/bspline/BezierCurve3d.d.ts.map +1 -1
- package/lib/esm/bspline/BezierCurve3d.js +5 -5
- package/lib/esm/bspline/BezierCurve3d.js.map +1 -1
- package/lib/esm/bspline/BezierCurve3dH.js +2 -0
- package/lib/esm/bspline/BezierCurve3dH.js.map +1 -1
- package/lib/esm/bspline/BezierCurveBase.d.ts.map +1 -1
- package/lib/esm/bspline/BezierCurveBase.js +21 -2
- package/lib/esm/bspline/BezierCurveBase.js.map +1 -1
- package/lib/esm/bspline/InterpolationCurve3d.js +12 -1
- package/lib/esm/bspline/InterpolationCurve3d.js.map +1 -1
- package/lib/esm/bspline/KnotVector.d.ts +82 -60
- package/lib/esm/bspline/KnotVector.d.ts.map +1 -1
- package/lib/esm/bspline/KnotVector.js +144 -84
- package/lib/esm/bspline/KnotVector.js.map +1 -1
- package/lib/esm/bspline/SurfaceLocationDetail.js +12 -0
- package/lib/esm/bspline/SurfaceLocationDetail.js.map +1 -1
- package/lib/esm/clipping/AlternatingConvexClipTree.js +14 -13
- package/lib/esm/clipping/AlternatingConvexClipTree.js.map +1 -1
- package/lib/esm/clipping/BooleanClipFactory.js.map +1 -1
- package/lib/esm/clipping/BooleanClipNode.js +4 -0
- package/lib/esm/clipping/BooleanClipNode.js.map +1 -1
- package/lib/esm/clipping/ClipPlane.js +10 -1
- package/lib/esm/clipping/ClipPlane.js.map +1 -1
- package/lib/esm/clipping/ClipPrimitive.js +19 -0
- package/lib/esm/clipping/ClipPrimitive.js.map +1 -1
- package/lib/esm/clipping/ClipUtils.js +5 -1
- package/lib/esm/clipping/ClipUtils.js.map +1 -1
- package/lib/esm/clipping/ClipVector.js +11 -8
- package/lib/esm/clipping/ClipVector.js.map +1 -1
- package/lib/esm/clipping/ConvexClipPlaneSet.js +5 -3
- package/lib/esm/clipping/ConvexClipPlaneSet.js.map +1 -1
- package/lib/esm/clipping/UnionOfConvexClipPlaneSets.js +2 -1
- package/lib/esm/clipping/UnionOfConvexClipPlaneSets.js.map +1 -1
- package/lib/esm/clipping/internalContexts/LineStringOffsetClipperContext.js +3 -0
- package/lib/esm/clipping/internalContexts/LineStringOffsetClipperContext.js.map +1 -1
- package/lib/esm/core-geometry.d.ts +1 -0
- package/lib/esm/core-geometry.d.ts.map +1 -1
- package/lib/esm/core-geometry.js +1 -0
- package/lib/esm/core-geometry.js.map +1 -1
- package/lib/esm/curve/Arc3d.d.ts +17 -3
- package/lib/esm/curve/Arc3d.d.ts.map +1 -1
- package/lib/esm/curve/Arc3d.js +50 -21
- package/lib/esm/curve/Arc3d.js.map +1 -1
- package/lib/esm/curve/ConstructCurveBetweenCurves.js +3 -0
- package/lib/esm/curve/ConstructCurveBetweenCurves.js.map +1 -1
- package/lib/esm/curve/CoordinateXYZ.js +3 -2
- package/lib/esm/curve/CoordinateXYZ.js.map +1 -1
- package/lib/esm/curve/CurveChainWithDistanceIndex.d.ts +0 -2
- package/lib/esm/curve/CurveChainWithDistanceIndex.d.ts.map +1 -1
- package/lib/esm/curve/CurveChainWithDistanceIndex.js +25 -10
- package/lib/esm/curve/CurveChainWithDistanceIndex.js.map +1 -1
- package/lib/esm/curve/CurveCollection.d.ts +10 -0
- package/lib/esm/curve/CurveCollection.d.ts.map +1 -1
- package/lib/esm/curve/CurveCollection.js +35 -9
- package/lib/esm/curve/CurveCollection.js.map +1 -1
- package/lib/esm/curve/CurveCurve.js.map +1 -1
- package/lib/esm/curve/CurveExtendMode.js.map +1 -1
- package/lib/esm/curve/CurveFactory.d.ts +87 -53
- package/lib/esm/curve/CurveFactory.d.ts.map +1 -1
- package/lib/esm/curve/CurveFactory.js +213 -135
- package/lib/esm/curve/CurveFactory.js.map +1 -1
- package/lib/esm/curve/CurveLocationDetail.js +44 -0
- package/lib/esm/curve/CurveLocationDetail.js.map +1 -1
- package/lib/esm/curve/CurveOps.js.map +1 -1
- package/lib/esm/curve/CurvePrimitive.d.ts +7 -10
- package/lib/esm/curve/CurvePrimitive.d.ts.map +1 -1
- package/lib/esm/curve/CurvePrimitive.js +27 -12
- package/lib/esm/curve/CurvePrimitive.js.map +1 -1
- package/lib/esm/curve/CurveProcessor.js +2 -0
- package/lib/esm/curve/CurveProcessor.js.map +1 -1
- package/lib/esm/curve/CurveTypes.js.map +1 -1
- package/lib/esm/curve/CurveWireMomentsXYZ.js +2 -0
- package/lib/esm/curve/CurveWireMomentsXYZ.js.map +1 -1
- package/lib/esm/curve/GeometryQuery.js.map +1 -1
- package/lib/esm/curve/LineSegment3d.js +6 -2
- package/lib/esm/curve/LineSegment3d.js.map +1 -1
- package/lib/esm/curve/LineString3d.js +27 -7
- package/lib/esm/curve/LineString3d.js.map +1 -1
- package/lib/esm/curve/Loop.js +12 -4
- package/lib/esm/curve/Loop.js.map +1 -1
- package/lib/esm/curve/OffsetOptions.js +25 -21
- package/lib/esm/curve/OffsetOptions.js.map +1 -1
- package/lib/esm/curve/ParityRegion.js +4 -2
- package/lib/esm/curve/ParityRegion.js.map +1 -1
- package/lib/esm/curve/Path.js +2 -2
- package/lib/esm/curve/Path.js.map +1 -1
- package/lib/esm/curve/PointString3d.js +3 -2
- package/lib/esm/curve/PointString3d.js.map +1 -1
- package/lib/esm/curve/ProxyCurve.js +1 -0
- package/lib/esm/curve/ProxyCurve.js.map +1 -1
- package/lib/esm/curve/Query/ConsolidateAdjacentPrimitivesContext.js +1 -0
- package/lib/esm/curve/Query/ConsolidateAdjacentPrimitivesContext.js.map +1 -1
- package/lib/esm/curve/Query/CurveSplitContext.js +3 -0
- package/lib/esm/curve/Query/CurveSplitContext.js.map +1 -1
- package/lib/esm/curve/Query/CylindricalRange.js +6 -2
- package/lib/esm/curve/Query/CylindricalRange.js.map +1 -1
- package/lib/esm/curve/Query/InOutTests.js.map +1 -1
- package/lib/esm/curve/Query/PlanarSubdivision.js +4 -6
- package/lib/esm/curve/Query/PlanarSubdivision.js.map +1 -1
- package/lib/esm/curve/Query/StrokeCountChain.js +12 -0
- package/lib/esm/curve/Query/StrokeCountChain.js.map +1 -1
- package/lib/esm/curve/Query/StrokeCountMap.js +14 -0
- package/lib/esm/curve/Query/StrokeCountMap.js.map +1 -1
- package/lib/esm/curve/RegionMomentsXY.js +4 -5
- package/lib/esm/curve/RegionMomentsXY.js.map +1 -1
- package/lib/esm/curve/RegionOps.js +9 -10
- package/lib/esm/curve/RegionOps.js.map +1 -1
- package/lib/esm/curve/RegionOpsClassificationSweeps.js +24 -1
- package/lib/esm/curve/RegionOpsClassificationSweeps.js.map +1 -1
- package/lib/esm/curve/StrokeOptions.d.ts +4 -4
- package/lib/esm/curve/StrokeOptions.d.ts.map +1 -1
- package/lib/esm/curve/StrokeOptions.js +23 -6
- package/lib/esm/curve/StrokeOptions.js.map +1 -1
- package/lib/esm/curve/UnionRegion.js +4 -2
- package/lib/esm/curve/UnionRegion.js.map +1 -1
- package/lib/esm/curve/internalContexts/AppendPlaneIntersectionStrokeHandler.js +13 -7
- package/lib/esm/curve/internalContexts/AppendPlaneIntersectionStrokeHandler.js.map +1 -1
- package/lib/esm/curve/internalContexts/ChainCollectorContext.js +6 -0
- package/lib/esm/curve/internalContexts/ChainCollectorContext.js.map +1 -1
- package/lib/esm/curve/internalContexts/CloneCurvesContext.js +2 -0
- package/lib/esm/curve/internalContexts/CloneCurvesContext.js.map +1 -1
- package/lib/esm/curve/internalContexts/CloneWithExpandedLineStrings.js.map +1 -1
- package/lib/esm/curve/internalContexts/ClosestPointStrokeHandler.js +13 -5
- package/lib/esm/curve/internalContexts/ClosestPointStrokeHandler.js.map +1 -1
- package/lib/esm/curve/internalContexts/CountLinearPartsSearchContext.js +3 -0
- package/lib/esm/curve/internalContexts/CountLinearPartsSearchContext.js.map +1 -1
- package/lib/esm/curve/internalContexts/CurveCurveCloseApproachXY.js +18 -5
- package/lib/esm/curve/internalContexts/CurveCurveCloseApproachXY.js.map +1 -1
- package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.js +26 -13
- package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.js.map +1 -1
- package/lib/esm/curve/internalContexts/CurveCurveIntersectXYZ.js +11 -5
- package/lib/esm/curve/internalContexts/CurveCurveIntersectXYZ.js.map +1 -1
- package/lib/esm/curve/internalContexts/CurveLengthContext.js +6 -0
- package/lib/esm/curve/internalContexts/CurveLengthContext.js.map +1 -1
- package/lib/esm/curve/internalContexts/CurveOffsetXYHandler.js +8 -6
- package/lib/esm/curve/internalContexts/CurveOffsetXYHandler.js.map +1 -1
- package/lib/esm/curve/internalContexts/EllipticalArcApproximationContext.js +38 -5
- package/lib/esm/curve/internalContexts/EllipticalArcApproximationContext.js.map +1 -1
- package/lib/esm/curve/internalContexts/GapSearchContext.js +1 -0
- package/lib/esm/curve/internalContexts/GapSearchContext.js.map +1 -1
- package/lib/esm/curve/internalContexts/MultiChainCollector.js +12 -0
- package/lib/esm/curve/internalContexts/MultiChainCollector.js.map +1 -1
- package/lib/esm/curve/internalContexts/NewtonRtoRStrokeHandler.js +1 -0
- package/lib/esm/curve/internalContexts/NewtonRtoRStrokeHandler.js.map +1 -1
- package/lib/esm/curve/internalContexts/PlaneAltitudeRangeContext.js +7 -0
- package/lib/esm/curve/internalContexts/PlaneAltitudeRangeContext.js.map +1 -1
- package/lib/esm/curve/internalContexts/PolygonOffsetContext.js +22 -4
- package/lib/esm/curve/internalContexts/PolygonOffsetContext.js.map +1 -1
- package/lib/esm/curve/internalContexts/SumLengthsContext.js +1 -0
- package/lib/esm/curve/internalContexts/SumLengthsContext.js.map +1 -1
- package/lib/esm/curve/internalContexts/TransformInPlaceContext.js +3 -0
- package/lib/esm/curve/internalContexts/TransformInPlaceContext.js.map +1 -1
- package/lib/esm/curve/spiral/AustralianRailCorpXYEvaluator.js +2 -0
- package/lib/esm/curve/spiral/AustralianRailCorpXYEvaluator.js.map +1 -1
- package/lib/esm/curve/spiral/ClothoidSeries.js +4 -0
- package/lib/esm/curve/spiral/ClothoidSeries.js.map +1 -1
- package/lib/esm/curve/spiral/CubicEvaluator.js +2 -0
- package/lib/esm/curve/spiral/CubicEvaluator.js.map +1 -1
- package/lib/esm/curve/spiral/CzechSpiralEvaluator.js +4 -0
- package/lib/esm/curve/spiral/CzechSpiralEvaluator.js.map +1 -1
- package/lib/esm/curve/spiral/DirectHalfCosineSpiralEvaluator.js +5 -0
- package/lib/esm/curve/spiral/DirectHalfCosineSpiralEvaluator.js.map +1 -1
- package/lib/esm/curve/spiral/DirectSpiral3d.js +12 -2
- package/lib/esm/curve/spiral/DirectSpiral3d.js.map +1 -1
- package/lib/esm/curve/spiral/IntegratedSpiral3d.js +24 -4
- package/lib/esm/curve/spiral/IntegratedSpiral3d.js.map +1 -1
- package/lib/esm/curve/spiral/MXCubicAlongArcSpiralEvaluator.js +2 -0
- package/lib/esm/curve/spiral/MXCubicAlongArcSpiralEvaluator.js.map +1 -1
- package/lib/esm/curve/spiral/NormalizedTransition.js +5 -0
- package/lib/esm/curve/spiral/NormalizedTransition.js.map +1 -1
- package/lib/esm/curve/spiral/PolishCubicSpiralEvaluator.js +2 -0
- package/lib/esm/curve/spiral/PolishCubicSpiralEvaluator.js.map +1 -1
- package/lib/esm/curve/spiral/TransitionConditionalProperties.js +10 -0
- package/lib/esm/curve/spiral/TransitionConditionalProperties.js.map +1 -1
- package/lib/esm/curve/spiral/TransitionSpiral3d.js +10 -0
- package/lib/esm/curve/spiral/TransitionSpiral3d.js.map +1 -1
- package/lib/esm/curve/spiral/XYCurveEvaluator.js +6 -0
- package/lib/esm/curve/spiral/XYCurveEvaluator.js.map +1 -1
- package/lib/esm/geometry3d/Angle.js +18 -16
- package/lib/esm/geometry3d/Angle.js.map +1 -1
- package/lib/esm/geometry3d/AngleSweep.d.ts +7 -2
- package/lib/esm/geometry3d/AngleSweep.d.ts.map +1 -1
- package/lib/esm/geometry3d/AngleSweep.js +14 -2
- package/lib/esm/geometry3d/AngleSweep.js.map +1 -1
- package/lib/esm/geometry3d/BarycentricTriangle.js +25 -0
- package/lib/esm/geometry3d/BarycentricTriangle.js.map +1 -1
- package/lib/esm/geometry3d/BilinearPatch.js +8 -0
- package/lib/esm/geometry3d/BilinearPatch.js.map +1 -1
- package/lib/esm/geometry3d/CoincidentGeometryOps.js +5 -0
- package/lib/esm/geometry3d/CoincidentGeometryOps.js.map +1 -1
- package/lib/esm/geometry3d/Ellipsoid.js +48 -0
- package/lib/esm/geometry3d/Ellipsoid.js.map +1 -1
- package/lib/esm/geometry3d/FrameBuilder.js +12 -4
- package/lib/esm/geometry3d/FrameBuilder.js.map +1 -1
- package/lib/esm/geometry3d/FrustumAnimation.js +7 -0
- package/lib/esm/geometry3d/FrustumAnimation.js.map +1 -1
- package/lib/esm/geometry3d/GeometryHandler.js.map +1 -1
- package/lib/esm/geometry3d/GrowableBlockedArray.js +12 -0
- package/lib/esm/geometry3d/GrowableBlockedArray.js.map +1 -1
- package/lib/esm/geometry3d/GrowableFloat64Array.js +3 -0
- package/lib/esm/geometry3d/GrowableFloat64Array.js.map +1 -1
- package/lib/esm/geometry3d/GrowableXYArray.d.ts +0 -5
- package/lib/esm/geometry3d/GrowableXYArray.d.ts.map +1 -1
- package/lib/esm/geometry3d/GrowableXYArray.js +16 -7
- package/lib/esm/geometry3d/GrowableXYArray.js.map +1 -1
- package/lib/esm/geometry3d/GrowableXYZArray.d.ts +32 -10
- package/lib/esm/geometry3d/GrowableXYZArray.d.ts.map +1 -1
- package/lib/esm/geometry3d/GrowableXYZArray.js +70 -16
- package/lib/esm/geometry3d/GrowableXYZArray.js.map +1 -1
- package/lib/esm/geometry3d/IndexedCollectionInterval.js +6 -0
- package/lib/esm/geometry3d/IndexedCollectionInterval.js.map +1 -1
- package/lib/esm/geometry3d/IndexedXYCollection.js +1 -0
- package/lib/esm/geometry3d/IndexedXYCollection.js.map +1 -1
- package/lib/esm/geometry3d/IndexedXYZCollection.d.ts +13 -2
- package/lib/esm/geometry3d/IndexedXYZCollection.d.ts.map +1 -1
- package/lib/esm/geometry3d/IndexedXYZCollection.js +26 -11
- package/lib/esm/geometry3d/IndexedXYZCollection.js.map +1 -1
- package/lib/esm/geometry3d/LongitudeLatitudeAltitude.js +3 -0
- package/lib/esm/geometry3d/LongitudeLatitudeAltitude.js.map +1 -1
- package/lib/esm/geometry3d/Matrix3d.d.ts +3 -4
- package/lib/esm/geometry3d/Matrix3d.d.ts.map +1 -1
- package/lib/esm/geometry3d/Matrix3d.js +36 -14
- package/lib/esm/geometry3d/Matrix3d.js.map +1 -1
- package/lib/esm/geometry3d/OrderedRotationAngles.js +10 -2
- package/lib/esm/geometry3d/OrderedRotationAngles.js.map +1 -1
- package/lib/esm/geometry3d/Plane3d.js.map +1 -1
- package/lib/esm/geometry3d/Plane3dByOriginAndUnitNormal.js +2 -0
- package/lib/esm/geometry3d/Plane3dByOriginAndUnitNormal.js.map +1 -1
- package/lib/esm/geometry3d/Plane3dByOriginAndVectors.js +7 -0
- package/lib/esm/geometry3d/Plane3dByOriginAndVectors.js.map +1 -1
- package/lib/esm/geometry3d/Point2dArrayCarrier.js +2 -0
- package/lib/esm/geometry3d/Point2dArrayCarrier.js.map +1 -1
- package/lib/esm/geometry3d/Point2dVector2d.js +4 -0
- package/lib/esm/geometry3d/Point2dVector2d.js.map +1 -1
- package/lib/esm/geometry3d/Point3dArrayCarrier.js +3 -1
- package/lib/esm/geometry3d/Point3dArrayCarrier.js.map +1 -1
- package/lib/esm/geometry3d/Point3dVector3d.d.ts +7 -10
- package/lib/esm/geometry3d/Point3dVector3d.d.ts.map +1 -1
- package/lib/esm/geometry3d/Point3dVector3d.js +16 -10
- package/lib/esm/geometry3d/Point3dVector3d.js.map +1 -1
- package/lib/esm/geometry3d/PointHelpers.d.ts +4 -4
- package/lib/esm/geometry3d/PointHelpers.d.ts.map +1 -1
- package/lib/esm/geometry3d/PointHelpers.js +8 -8
- package/lib/esm/geometry3d/PointHelpers.js.map +1 -1
- package/lib/esm/geometry3d/PointStreaming.js +12 -4
- package/lib/esm/geometry3d/PointStreaming.js.map +1 -1
- package/lib/esm/geometry3d/PolygonOps.d.ts +2 -2
- package/lib/esm/geometry3d/PolygonOps.js +62 -25
- package/lib/esm/geometry3d/PolygonOps.js.map +1 -1
- package/lib/esm/geometry3d/PolylineCompressionByEdgeOffset.js +7 -3
- package/lib/esm/geometry3d/PolylineCompressionByEdgeOffset.js.map +1 -1
- package/lib/esm/geometry3d/PolylineOps.d.ts +9 -5
- package/lib/esm/geometry3d/PolylineOps.d.ts.map +1 -1
- package/lib/esm/geometry3d/PolylineOps.js +12 -5
- package/lib/esm/geometry3d/PolylineOps.js.map +1 -1
- package/lib/esm/geometry3d/Range.js +21 -4
- package/lib/esm/geometry3d/Range.js.map +1 -1
- package/lib/esm/geometry3d/Ray2d.js +2 -0
- package/lib/esm/geometry3d/Ray2d.js.map +1 -1
- package/lib/esm/geometry3d/Ray3d.d.ts +2 -2
- package/lib/esm/geometry3d/Ray3d.d.ts.map +1 -1
- package/lib/esm/geometry3d/Ray3d.js +20 -11
- package/lib/esm/geometry3d/Ray3d.js.map +1 -1
- package/lib/esm/geometry3d/ReusableObjectCache.js +4 -0
- package/lib/esm/geometry3d/ReusableObjectCache.js.map +1 -1
- package/lib/esm/geometry3d/Segment1d.js +4 -0
- package/lib/esm/geometry3d/Segment1d.js.map +1 -1
- package/lib/esm/geometry3d/SortablePolygon.js +11 -0
- package/lib/esm/geometry3d/SortablePolygon.js.map +1 -1
- package/lib/esm/geometry3d/Transform.d.ts +1 -1
- package/lib/esm/geometry3d/Transform.js +4 -1
- package/lib/esm/geometry3d/Transform.js.map +1 -1
- package/lib/esm/geometry3d/UVSurfaceOps.js.map +1 -1
- package/lib/esm/geometry3d/XYZProps.js.map +1 -1
- package/lib/esm/geometry3d/YawPitchRollAngles.js +6 -0
- package/lib/esm/geometry3d/YawPitchRollAngles.js.map +1 -1
- package/lib/esm/geometry4d/Map4d.js +2 -0
- package/lib/esm/geometry4d/Map4d.js.map +1 -1
- package/lib/esm/geometry4d/Matrix4d.js +1 -0
- package/lib/esm/geometry4d/Matrix4d.js.map +1 -1
- package/lib/esm/geometry4d/MomentData.d.ts +72 -73
- package/lib/esm/geometry4d/MomentData.d.ts.map +1 -1
- package/lib/esm/geometry4d/MomentData.js +90 -66
- package/lib/esm/geometry4d/MomentData.js.map +1 -1
- package/lib/esm/geometry4d/PlaneByOriginAndVectors4d.js +6 -0
- package/lib/esm/geometry4d/PlaneByOriginAndVectors4d.js.map +1 -1
- package/lib/esm/geometry4d/Point4d.js +2 -0
- package/lib/esm/geometry4d/Point4d.js.map +1 -1
- package/lib/esm/numerics/BandedSystem.js.map +1 -1
- package/lib/esm/numerics/BezierPolynomials.js +8 -0
- package/lib/esm/numerics/BezierPolynomials.js.map +1 -1
- package/lib/esm/numerics/ClusterableArray.js +29 -13
- package/lib/esm/numerics/ClusterableArray.js.map +1 -1
- package/lib/esm/numerics/Complex.js +2 -0
- package/lib/esm/numerics/Complex.js.map +1 -1
- package/lib/esm/numerics/ConvexPolygon2d.js +3 -0
- package/lib/esm/numerics/ConvexPolygon2d.js.map +1 -1
- package/lib/esm/numerics/Newton.js +59 -4
- package/lib/esm/numerics/Newton.js.map +1 -1
- package/lib/esm/numerics/PascalCoefficients.js +1 -1
- package/lib/esm/numerics/PascalCoefficients.js.map +1 -1
- package/lib/esm/numerics/PolarData.js +13 -1
- package/lib/esm/numerics/PolarData.js.map +1 -1
- package/lib/esm/numerics/Polynomials.js +64 -26
- package/lib/esm/numerics/Polynomials.js.map +1 -1
- package/lib/esm/numerics/Quadrature.js +26 -20
- package/lib/esm/numerics/Quadrature.js.map +1 -1
- package/lib/esm/numerics/Range1dArray.js.map +1 -1
- package/lib/esm/numerics/SmallSystem.js.map +1 -1
- package/lib/esm/numerics/TriDiagonalSystem.js +11 -0
- package/lib/esm/numerics/TriDiagonalSystem.js.map +1 -1
- package/lib/esm/numerics/UnionFind.js +1 -0
- package/lib/esm/numerics/UnionFind.js.map +1 -1
- package/lib/esm/numerics/UsageSums.js +10 -0
- package/lib/esm/numerics/UsageSums.js.map +1 -1
- package/lib/esm/polyface/AuxData.js +16 -0
- package/lib/esm/polyface/AuxData.js.map +1 -1
- package/lib/esm/polyface/BoxTopology.js +67 -67
- package/lib/esm/polyface/BoxTopology.js.map +1 -1
- package/lib/esm/polyface/FacetFaceData.d.ts +1 -1
- package/lib/esm/polyface/FacetFaceData.js +3 -1
- package/lib/esm/polyface/FacetFaceData.js.map +1 -1
- package/lib/esm/polyface/FacetLocationDetail.js +30 -0
- package/lib/esm/polyface/FacetLocationDetail.js.map +1 -1
- package/lib/esm/polyface/FacetOrientation.js +12 -1
- package/lib/esm/polyface/FacetOrientation.js.map +1 -1
- package/lib/esm/polyface/GreedyTriangulationBetweenLineStrings.js +18 -2
- package/lib/esm/polyface/GreedyTriangulationBetweenLineStrings.js.map +1 -1
- package/lib/esm/polyface/IndexedEdgeMatcher.d.ts +33 -23
- package/lib/esm/polyface/IndexedEdgeMatcher.d.ts.map +1 -1
- package/lib/esm/polyface/IndexedEdgeMatcher.js +63 -33
- package/lib/esm/polyface/IndexedEdgeMatcher.js.map +1 -1
- package/lib/esm/polyface/IndexedPolyfaceVisitor.d.ts +3 -2
- package/lib/esm/polyface/IndexedPolyfaceVisitor.d.ts.map +1 -1
- package/lib/esm/polyface/IndexedPolyfaceVisitor.js +11 -2
- package/lib/esm/polyface/IndexedPolyfaceVisitor.js.map +1 -1
- package/lib/esm/polyface/IndexedPolyfaceWalker.d.ts +233 -0
- package/lib/esm/polyface/IndexedPolyfaceWalker.d.ts.map +1 -0
- package/lib/esm/polyface/IndexedPolyfaceWalker.js +349 -0
- package/lib/esm/polyface/IndexedPolyfaceWalker.js.map +1 -0
- package/lib/esm/polyface/Polyface.d.ts +35 -10
- package/lib/esm/polyface/Polyface.d.ts.map +1 -1
- package/lib/esm/polyface/Polyface.js +73 -12
- package/lib/esm/polyface/Polyface.js.map +1 -1
- package/lib/esm/polyface/PolyfaceBuilder.d.ts +14 -27
- package/lib/esm/polyface/PolyfaceBuilder.d.ts.map +1 -1
- package/lib/esm/polyface/PolyfaceBuilder.js +48 -80
- package/lib/esm/polyface/PolyfaceBuilder.js.map +1 -1
- package/lib/esm/polyface/PolyfaceClip.js +8 -0
- package/lib/esm/polyface/PolyfaceClip.js.map +1 -1
- package/lib/esm/polyface/PolyfaceData.d.ts +28 -0
- package/lib/esm/polyface/PolyfaceData.d.ts.map +1 -1
- package/lib/esm/polyface/PolyfaceData.js +87 -5
- package/lib/esm/polyface/PolyfaceData.js.map +1 -1
- package/lib/esm/polyface/PolyfaceQuery.js +47 -7
- package/lib/esm/polyface/PolyfaceQuery.js.map +1 -1
- package/lib/esm/polyface/RangeLengthData.js +7 -0
- package/lib/esm/polyface/RangeLengthData.js.map +1 -1
- package/lib/esm/polyface/RangeTree/LineString3dRangeTreeContext.js +12 -0
- package/lib/esm/polyface/RangeTree/LineString3dRangeTreeContext.js.map +1 -1
- package/lib/esm/polyface/RangeTree/MinimumValueTester.js +5 -2
- package/lib/esm/polyface/RangeTree/MinimumValueTester.js.map +1 -1
- package/lib/esm/polyface/RangeTree/Point3dArrayRangeTreeContext.js +12 -0
- package/lib/esm/polyface/RangeTree/Point3dArrayRangeTreeContext.js.map +1 -1
- package/lib/esm/polyface/RangeTree/PolyfaceRangeTreeContext.js +14 -0
- package/lib/esm/polyface/RangeTree/PolyfaceRangeTreeContext.js.map +1 -1
- package/lib/esm/polyface/RangeTree/RangeTreeNode.js +5 -0
- package/lib/esm/polyface/RangeTree/RangeTreeNode.js.map +1 -1
- package/lib/esm/polyface/RangeTree/RangeTreeSearchHandlers.js +43 -0
- package/lib/esm/polyface/RangeTree/RangeTreeSearchHandlers.js.map +1 -1
- package/lib/esm/polyface/TaggedNumericData.js +8 -0
- package/lib/esm/polyface/TaggedNumericData.js.map +1 -1
- package/lib/esm/polyface/TriangleCandidate.js +3 -0
- package/lib/esm/polyface/TriangleCandidate.js.map +1 -1
- package/lib/esm/polyface/multiclip/BuildAverageNormalsContext.js +7 -0
- package/lib/esm/polyface/multiclip/BuildAverageNormalsContext.js.map +1 -1
- package/lib/esm/polyface/multiclip/GriddedRaggedRange2dSet.js +6 -0
- package/lib/esm/polyface/multiclip/GriddedRaggedRange2dSet.js.map +1 -1
- package/lib/esm/polyface/multiclip/GriddedRaggedRange2dSetWithOverflow.js +3 -0
- package/lib/esm/polyface/multiclip/GriddedRaggedRange2dSetWithOverflow.js.map +1 -1
- package/lib/esm/polyface/multiclip/LinearSearchRange2dArray.js +3 -0
- package/lib/esm/polyface/multiclip/LinearSearchRange2dArray.js.map +1 -1
- package/lib/esm/polyface/multiclip/OffsetMeshContext.js +32 -0
- package/lib/esm/polyface/multiclip/OffsetMeshContext.js.map +1 -1
- package/lib/esm/polyface/multiclip/Range2dSearchInterface.js.map +1 -1
- package/lib/esm/polyface/multiclip/RangeSearch.js +5 -5
- package/lib/esm/polyface/multiclip/RangeSearch.js.map +1 -1
- package/lib/esm/polyface/multiclip/SweepLineStringToFacetContext.js +21 -8
- package/lib/esm/polyface/multiclip/SweepLineStringToFacetContext.js.map +1 -1
- package/lib/esm/polyface/multiclip/XYPointBuckets.js +6 -0
- package/lib/esm/polyface/multiclip/XYPointBuckets.js.map +1 -1
- package/lib/esm/serialization/BGFBAccessors.js +82 -164
- package/lib/esm/serialization/BGFBAccessors.js.map +1 -1
- package/lib/esm/serialization/BGFBReader.js +22 -22
- package/lib/esm/serialization/BGFBReader.js.map +1 -1
- package/lib/esm/serialization/BGFBWriter.js +1 -0
- package/lib/esm/serialization/BGFBWriter.js.map +1 -1
- package/lib/esm/serialization/BentleyGeometryFlatBuffer.js.map +1 -1
- package/lib/esm/serialization/DeepCompare.js +17 -17
- package/lib/esm/serialization/DeepCompare.js.map +1 -1
- package/lib/esm/serialization/GeometrySamples.d.ts +5 -5
- package/lib/esm/serialization/GeometrySamples.d.ts.map +1 -1
- package/lib/esm/serialization/GeometrySamples.js +113 -112
- package/lib/esm/serialization/GeometrySamples.js.map +1 -1
- package/lib/esm/serialization/IModelJsonSchema.d.ts +70 -63
- package/lib/esm/serialization/IModelJsonSchema.d.ts.map +1 -1
- package/lib/esm/serialization/IModelJsonSchema.js +87 -74
- package/lib/esm/serialization/IModelJsonSchema.js.map +1 -1
- package/lib/esm/serialization/SerializationHelpers.js.map +1 -1
- package/lib/esm/solid/Box.js +7 -2
- package/lib/esm/solid/Box.js.map +1 -1
- package/lib/esm/solid/Cone.d.ts +39 -14
- package/lib/esm/solid/Cone.d.ts.map +1 -1
- package/lib/esm/solid/Cone.js +53 -17
- package/lib/esm/solid/Cone.js.map +1 -1
- package/lib/esm/solid/LinearSweep.js +4 -2
- package/lib/esm/solid/LinearSweep.js.map +1 -1
- package/lib/esm/solid/RotationalSweep.js +5 -2
- package/lib/esm/solid/RotationalSweep.js.map +1 -1
- package/lib/esm/solid/RuledSweep.d.ts +26 -23
- package/lib/esm/solid/RuledSweep.d.ts.map +1 -1
- package/lib/esm/solid/RuledSweep.js +32 -24
- package/lib/esm/solid/RuledSweep.js.map +1 -1
- package/lib/esm/solid/SolidPrimitive.d.ts +12 -11
- package/lib/esm/solid/SolidPrimitive.d.ts.map +1 -1
- package/lib/esm/solid/SolidPrimitive.js +11 -6
- package/lib/esm/solid/SolidPrimitive.js.map +1 -1
- package/lib/esm/solid/Sphere.d.ts +34 -17
- package/lib/esm/solid/Sphere.d.ts.map +1 -1
- package/lib/esm/solid/Sphere.js +52 -25
- package/lib/esm/solid/Sphere.js.map +1 -1
- package/lib/esm/solid/SweepContour.d.ts +24 -15
- package/lib/esm/solid/SweepContour.d.ts.map +1 -1
- package/lib/esm/solid/SweepContour.js +33 -15
- package/lib/esm/solid/SweepContour.js.map +1 -1
- package/lib/esm/solid/TorusPipe.js +7 -2
- package/lib/esm/solid/TorusPipe.js.map +1 -1
- package/lib/esm/topology/ChainMerge.js +16 -4
- package/lib/esm/topology/ChainMerge.js.map +1 -1
- package/lib/esm/topology/Graph.js +41 -6
- package/lib/esm/topology/Graph.js.map +1 -1
- package/lib/esm/topology/HalfEdgeGraphFromIndexedLoopsContext.d.ts +1 -1
- package/lib/esm/topology/HalfEdgeGraphFromIndexedLoopsContext.js +5 -1
- package/lib/esm/topology/HalfEdgeGraphFromIndexedLoopsContext.js.map +1 -1
- package/lib/esm/topology/HalfEdgeGraphSearch.js +2 -0
- package/lib/esm/topology/HalfEdgeGraphSearch.js.map +1 -1
- package/lib/esm/topology/HalfEdgeGraphSpineContext.js +9 -2
- package/lib/esm/topology/HalfEdgeGraphSpineContext.js.map +1 -1
- package/lib/esm/topology/HalfEdgeGraphValidation.js +7 -9
- package/lib/esm/topology/HalfEdgeGraphValidation.js.map +1 -1
- package/lib/esm/topology/HalfEdgeMarkSet.js +5 -0
- package/lib/esm/topology/HalfEdgeMarkSet.js.map +1 -1
- package/lib/esm/topology/HalfEdgeNodeXYZUV.js +6 -0
- package/lib/esm/topology/HalfEdgeNodeXYZUV.js.map +1 -1
- package/lib/esm/topology/HalfEdgePointInGraphSearch.js +1 -0
- package/lib/esm/topology/HalfEdgePointInGraphSearch.js.map +1 -1
- package/lib/esm/topology/HalfEdgePositionDetail.js +16 -0
- package/lib/esm/topology/HalfEdgePositionDetail.js.map +1 -1
- package/lib/esm/topology/HalfEdgePriorityQueue.js +2 -0
- package/lib/esm/topology/HalfEdgePriorityQueue.js.map +1 -1
- package/lib/esm/topology/InsertAndRetriangulateContext.js +4 -0
- package/lib/esm/topology/InsertAndRetriangulateContext.js.map +1 -1
- package/lib/esm/topology/MaskManager.js +3 -0
- package/lib/esm/topology/MaskManager.js.map +1 -1
- package/lib/esm/topology/Merging.js +11 -6
- package/lib/esm/topology/Merging.js.map +1 -1
- package/lib/esm/topology/RegularizeFace.js +22 -0
- package/lib/esm/topology/RegularizeFace.js.map +1 -1
- package/lib/esm/topology/SignedDataSummary.js +22 -0
- package/lib/esm/topology/SignedDataSummary.js.map +1 -1
- package/lib/esm/topology/SpaceTriangulation.js.map +1 -1
- package/lib/esm/topology/Triangulation.js +21 -11
- package/lib/esm/topology/Triangulation.js.map +1 -1
- package/lib/esm/topology/XYParitySearchContext.js +13 -0
- package/lib/esm/topology/XYParitySearchContext.js.map +1 -1
- package/package.json +9 -9
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
import { IndexedPolyfaceVisitor } from "./IndexedPolyfaceVisitor";
|
|
2
|
+
import { IndexedPolyface } from "./Polyface";
|
|
3
|
+
/**
|
|
4
|
+
* The `IndexedPolyfaceWalker` class supports navigation around facets, across edges, and around vertices in an
|
|
5
|
+
* [[IndexedPolyface]].
|
|
6
|
+
* * Compare to the [[IndexedPolyfaceVisitor]] class, which supports the iteration of facets in an `IndexedPolyface`.
|
|
7
|
+
* * A one-time call to [[buildEdgeMateIndices]] creates and populates the `data.edgeMateIndex` array on the input.
|
|
8
|
+
* * This array essentially completes the topology of the `IndexedPolyface` by storing facet adjacency.
|
|
9
|
+
* * After this setup, caller code can create `IndexedPolyfaceWalker` objects via:
|
|
10
|
+
* * `walker = IndexedPolyfaceWalker.createAtFacetIndex(polyface, facetIndex, offsetWithinFacet)`
|
|
11
|
+
* * `walker = IndexedPolyfaceWalker.createAtEdgeIndex(polyface, edgeIndex)`
|
|
12
|
+
* * `walker = IndexedPolyfaceWalker.createAtVisitor(visitor, offsetWithinFacet)`
|
|
13
|
+
* * Once you have a walker object, you can traverse the facet, edge, and vertex loops it references. For
|
|
14
|
+
* example, if `walker.edgeIndex === A`, referring to the right edge of the upper left facet pictured below, then
|
|
15
|
+
* the following are true:
|
|
16
|
+
* * `walker.nextAroundFacet().edgeIndex === B`
|
|
17
|
+
* * `walker.previousAroundFacet().edgeIndex === C`
|
|
18
|
+
* * `walker.edgeMate().edgeIndex === F`
|
|
19
|
+
* * `walker.nextAroundVertex().edgeIndex === E`
|
|
20
|
+
* * `walker.previousAroundVertex().edgeIndex === D`
|
|
21
|
+
* ```
|
|
22
|
+
* # --------- # --------- #
|
|
23
|
+
* | < < < B | F |
|
|
24
|
+
* | ^ | v |
|
|
25
|
+
* | ^ | v |
|
|
26
|
+
* | ^ | v |
|
|
27
|
+
* | C > > > A | D > > > |
|
|
28
|
+
* # --------- # --------- #
|
|
29
|
+
* | < < < E | |
|
|
30
|
+
* | | |
|
|
31
|
+
* | | |
|
|
32
|
+
* | | |
|
|
33
|
+
* # --------- # --------- #
|
|
34
|
+
* ```
|
|
35
|
+
* * When facets are viewed so that the face loops stored in the [[PolyfaceData]] `pointIndex` array have
|
|
36
|
+
* counterclockwise ordering, an edge "from A to B" has facet area to the left and the edge to the right. Likewise,
|
|
37
|
+
* the edges "out of" locations B, C, E, F, D are directed as depicted above.
|
|
38
|
+
* * With this conventional counterclockwise ordering of face loops, "next" is counterclockwise, and "previous" is
|
|
39
|
+
* clockwise:
|
|
40
|
+
* * The [[nextAroundFacet]] step is counterclockwise around the facet.
|
|
41
|
+
* * The [[previousAroundFacet]] step is clockwise around the facet.
|
|
42
|
+
* * The [[nextAroundVertex]] step is counterclockwise around the vertex.
|
|
43
|
+
* * The [[previousAroundVertex]] step is clockwise around the vertex.
|
|
44
|
+
* * The `nextAroundFacet` steps for a walker and its [[edgeMate]] are in opposite directions along their shared edge,
|
|
45
|
+
* when that edge is interior. Thus the `edgeMate` step can be seen to iterate an "edge loop" of two locations for an
|
|
46
|
+
* interior edges.
|
|
47
|
+
* * Invalid Walkers:
|
|
48
|
+
* * An invalid walker has undefined [[edgeIndex]]. For these walkers, [[isUndefined]] returns true, and [[isValid]]
|
|
49
|
+
* returns false. Traversal operations on an invalid walker return an invalid walker.
|
|
50
|
+
* * Invalid walkers are expected during traversals of a mesh with boundary edges, so calling code must be prepared.
|
|
51
|
+
* Boundary edges have exactly one adjacent facet, so for these edges the `edgeMate` step returns an invalid walker.
|
|
52
|
+
* In the diagram above, the `edgeMate` of boundary edge B is undefined.
|
|
53
|
+
* * Invalid walkers can occur while traversing boundary vertices as well. If an edge lacks an `edgeMate`, then the
|
|
54
|
+
* `previousAroundVertex` step yields an invalid walker, because `previousAroundVertex` is implemented as `edgeMate`
|
|
55
|
+
* followed by `nextAroundFacet`. In the diagram above, the `previousAroundVertex` step at boundary edge B yields
|
|
56
|
+
* undefined walker. Similarly, the `nextAroundVertex` step at edge F yields undefined walker.
|
|
57
|
+
* * Invalid walkers can also occur while traversing a non-manifold mesh. Such meshes feature edge(s) with more than
|
|
58
|
+
* two adjacent facets, or with two adjacent facets that have opposite orientations. These meshes are uncommon, and
|
|
59
|
+
* usually indicate a construction problem.
|
|
60
|
+
* * See [[buildEdgeMateIndices]] for further description of the topological relations.
|
|
61
|
+
* @public
|
|
62
|
+
*/
|
|
63
|
+
export declare class IndexedPolyfaceWalker {
|
|
64
|
+
/** The polyface being traversed. */
|
|
65
|
+
private _polyface;
|
|
66
|
+
/** The current edgeIndex into the polyface. */
|
|
67
|
+
private _edgeIndex;
|
|
68
|
+
/** Constructor */
|
|
69
|
+
private constructor();
|
|
70
|
+
/**
|
|
71
|
+
* Return the edge index of this walker.
|
|
72
|
+
* * This is an index into the polyface's `data.pointIndex` array.
|
|
73
|
+
* * Can be undefined.
|
|
74
|
+
*/
|
|
75
|
+
get edgeIndex(): number | undefined;
|
|
76
|
+
/** Return the polyface of this walker. */
|
|
77
|
+
get polyface(): IndexedPolyface | undefined;
|
|
78
|
+
/**
|
|
79
|
+
* Return true if the walker's edgeIndex is defined.
|
|
80
|
+
* * This method is the opposite of [[isUndefined]].
|
|
81
|
+
*/
|
|
82
|
+
get isValid(): boolean;
|
|
83
|
+
/**
|
|
84
|
+
* Return true if the walker's edgeIndex is undefined.
|
|
85
|
+
* * This method is the opposite of [[isValid]].
|
|
86
|
+
* * This can happen during a walk when the walker `w` reaches an exterior edge, for then
|
|
87
|
+
* `w.edgeMate(w).isUndefined === true`.
|
|
88
|
+
* * This can also happen when methods that return a walker receive invalid input.
|
|
89
|
+
*/
|
|
90
|
+
get isUndefined(): boolean;
|
|
91
|
+
/**
|
|
92
|
+
* Create a walker for a given polyface at an optional edge.
|
|
93
|
+
* @param polyface reference to the client polyface. This reference is captured (the polyface is not copied).
|
|
94
|
+
* @param edgeIndex optional indication of where to start the walker within the mesh.
|
|
95
|
+
* * If the edgeIndex is valid for the input polyface, the new walker is started there.
|
|
96
|
+
* * If the edgeIndex is undefined or invalid for the input polyface, the walker returns true for [[isUndefined]].
|
|
97
|
+
*/
|
|
98
|
+
static createAtEdgeIndex(polyface: IndexedPolyface, edgeIndex?: number): IndexedPolyfaceWalker;
|
|
99
|
+
/**
|
|
100
|
+
* Create a walker for a given polyface at a specified facet.
|
|
101
|
+
* * If `facetIndex` or `offsetWithinFacet` is invalid for the input polyface, the walker returns true for
|
|
102
|
+
* [[isUndefined]].
|
|
103
|
+
* @param polyface the polyface to reference
|
|
104
|
+
* @param facetIndex index of the facet to reference
|
|
105
|
+
* @param offsetWithinFacet optional 0-based offset within the face loop of the facet (default 0). This allows
|
|
106
|
+
* the caller to start the walker at a particular edge of the facet.
|
|
107
|
+
*/
|
|
108
|
+
static createAtFacetIndex(polyface: IndexedPolyface, facetIndex: number, offsetWithinFacet?: number): IndexedPolyfaceWalker;
|
|
109
|
+
/**
|
|
110
|
+
* Create a walker at the facet specified by a visitor.
|
|
111
|
+
* @param visitor visitor whose currentReadIndex identifies the facet.
|
|
112
|
+
* @param offsetWithinFacet optional 0-based offset within the face loop of the facet (default 0). This allows
|
|
113
|
+
* the caller to start the walker at a particular edge of the facet.
|
|
114
|
+
*/
|
|
115
|
+
static createAtVisitor(visitor: IndexedPolyfaceVisitor, offsetWithinFacet?: number): IndexedPolyfaceWalker;
|
|
116
|
+
/**
|
|
117
|
+
* Create a new IndexedPolyfaceWalker from the instance.
|
|
118
|
+
* * The returned walker refers to the same polyface.
|
|
119
|
+
* * If `edgeIndex` is undefined, the returned walker refers to the same edge as the instance.
|
|
120
|
+
* * If `edgeIndex` is defined and valid, the returned walker refers to this edge.
|
|
121
|
+
* * If `edgeIndex` is defined but invalid, return undefined.
|
|
122
|
+
*/
|
|
123
|
+
clone(edgeIndex?: number): IndexedPolyfaceWalker | undefined;
|
|
124
|
+
/**
|
|
125
|
+
* Load the walker's facet into the given visitor.
|
|
126
|
+
* @returns true if the visitor and walker reference the same polyface and the walker has a valid edge index.
|
|
127
|
+
*/
|
|
128
|
+
loadVisitor(visitor: IndexedPolyfaceVisitor): boolean;
|
|
129
|
+
/**
|
|
130
|
+
* Test if two walkers are at different edges in the same polyface.
|
|
131
|
+
* * If either has undefined edge, return false.
|
|
132
|
+
* * If they are in different polyfaces, return false.
|
|
133
|
+
* * If they are the same edge in the same polyface, return false.
|
|
134
|
+
* * Otherwise return true.
|
|
135
|
+
*/
|
|
136
|
+
isDifferentEdgeInSamePolyface(other: IndexedPolyfaceWalker): boolean;
|
|
137
|
+
/**
|
|
138
|
+
* Test if two walkers are in the same polyface at the same edge.
|
|
139
|
+
* * If either has undefined edge, return false.
|
|
140
|
+
* * If they are in different polyfaces, return false.
|
|
141
|
+
* * If they are the same edge in the same polyface, return true.
|
|
142
|
+
*/
|
|
143
|
+
isSameEdge(other: IndexedPolyfaceWalker): boolean;
|
|
144
|
+
/**
|
|
145
|
+
* Return a walker with given edgeIndex and polyface from the calling instance.
|
|
146
|
+
* * If `result` is supplied, that walker is filled and returned.
|
|
147
|
+
* * If `result` is not supplied, a new walker is created.
|
|
148
|
+
*/
|
|
149
|
+
private createResult;
|
|
150
|
+
/**
|
|
151
|
+
* Return a walker (new or reused) at the next edge around the facet.
|
|
152
|
+
* * "Next" is in the order of indices in the face loop of this facet.
|
|
153
|
+
* * If the instance has undefined edgeIndex, the result also has undefined edgeIndex.
|
|
154
|
+
* @param result optional receiver to modify and return. May be the same as `this` to move the instance walker
|
|
155
|
+
* to the new location and return it.
|
|
156
|
+
*/
|
|
157
|
+
nextAroundFacet(result?: IndexedPolyfaceWalker): IndexedPolyfaceWalker;
|
|
158
|
+
/**
|
|
159
|
+
* Return a walker (new or reused) at the previous edge around the facet.
|
|
160
|
+
* * "Previous" is in the reverse order of indices in the face loop of this facet.
|
|
161
|
+
* * If the instance has undefined edgeIndex, the result also has undefined edgeIndex.
|
|
162
|
+
* @param result optional receiver to modify and return. May be the same as `this` to move the instance walker
|
|
163
|
+
* to the new location and return it.
|
|
164
|
+
*/
|
|
165
|
+
previousAroundFacet(result?: IndexedPolyfaceWalker): IndexedPolyfaceWalker;
|
|
166
|
+
/**
|
|
167
|
+
* Return a walker (new or reused) at the edge mate of this walker's edge.
|
|
168
|
+
* * The returned walker has undefined edgeIndex if:
|
|
169
|
+
* * the instance is at a boundary edge, i.e., there is no facet on the other side, or
|
|
170
|
+
* * the instance has undefined edgeIndex.
|
|
171
|
+
* @param result optional receiver to modify and return. May be the same as `this` to move the instance walker
|
|
172
|
+
* to the new location and return it.
|
|
173
|
+
*/
|
|
174
|
+
edgeMate(result?: IndexedPolyfaceWalker): IndexedPolyfaceWalker;
|
|
175
|
+
/**
|
|
176
|
+
* Return a walker (new or reused) at the next outbound edge around the vertex at the base of this walker's edge.
|
|
177
|
+
* * If the facet is viewed so that its "nextAroundFacet" direction appears counterclockwise, then the "next"
|
|
178
|
+
* outbound edge is counterclockwise around the base vertex.
|
|
179
|
+
* * The returned walker has undefined edgeIndex if:
|
|
180
|
+
* * the previous edge around the facet is a boundary edge, i.e., there is no facet on the other side, or
|
|
181
|
+
* * the instance has undefined edgeIndex.
|
|
182
|
+
* @param result optional receiver to modify and return. May be the same as `this` to move the instance walker
|
|
183
|
+
* to the new location and return it.
|
|
184
|
+
*/
|
|
185
|
+
nextAroundVertex(result?: IndexedPolyfaceWalker): IndexedPolyfaceWalker;
|
|
186
|
+
/**
|
|
187
|
+
* Return a walker (new or reused) at the previous outbound edge around the vertex at the base of this walker's edge.
|
|
188
|
+
* * If the facet is viewed so that its "nextAroundFacet" direction appears counterclockwise, then the "previous"
|
|
189
|
+
* outbound edge is clockwise around the base vertex.
|
|
190
|
+
* * The returned walker has undefined edgeIndex if:
|
|
191
|
+
* * the instance edge is a boundary edge, i.e., there is no facet on the other side, or
|
|
192
|
+
* * the instance has undefined edgeIndex.
|
|
193
|
+
* @param result optional receiver to modify and return. May be the same as `this` to move the instance walker
|
|
194
|
+
* to the new location and return it.
|
|
195
|
+
*/
|
|
196
|
+
previousAroundVertex(result?: IndexedPolyfaceWalker): IndexedPolyfaceWalker;
|
|
197
|
+
/**
|
|
198
|
+
* Build the edgeMate index array into the polyface's [[PolyfaceData]].
|
|
199
|
+
* After this method:
|
|
200
|
+
* * The array `polyface.data.edgeMateIndex` is defined with the same length as the other PolyfaceData index arrays.
|
|
201
|
+
* * For each interior edge, `polyface.data.edgeIndexToEdgeMateIndex` returns the edgeIndex on the other side of the
|
|
202
|
+
* edge in the adjacent facet.
|
|
203
|
+
* * The conditions for edgeMate matching are:
|
|
204
|
+
* * Given facetIndex f, let `k0 = polyface.facetIndex0(f)` and `k1 = polyface.facetIndex1(f)`.
|
|
205
|
+
* * Every edgeIndex k in the face loop of facet f satisfies `k0 <= k < k1`.
|
|
206
|
+
* * The edge with edgeIndex k starts at the point with index `polyface.data.pointIndex[k]`.
|
|
207
|
+
* * Let kA be an edgeIndex in this range [k0,k1), and let kB be its in-range successor with cyclic wrap, i.e.,
|
|
208
|
+
* `kB === (kA + 1 === k1) ? k0 : kA + 1`.
|
|
209
|
+
* * Then `polyface.data.pointIndex[kA]` and `polyface.data.pointIndex[kB]` are the indices of the points at the
|
|
210
|
+
* start and end of an edge of that facet.
|
|
211
|
+
* * We call kA the _edgeIndex_ for that edge, and kB the _edgeIndex_ for the next edge around the facet.
|
|
212
|
+
* * If kA is an interior edge in a 2-manifold mesh with properly oriented facets, then there is an adjacent facet
|
|
213
|
+
* whose face loop contains edgeIndices kC and kD referencing the same edge vertices in reverse order, i.e.,
|
|
214
|
+
* * `polyface.data.pointIndex[kA] === polyface.data.pointIndex[kD]`
|
|
215
|
+
* * `polyface.data.pointIndex[kB] === polyface.data.pointIndex[kC]`
|
|
216
|
+
* * Given this relationship, we say that edgeIndices kA and kC are _edge mates_.
|
|
217
|
+
* * A non-interior edge either lies on the boundary of the mesh or is non-manifold (having more than two adjacent
|
|
218
|
+
* facets, or one with the wrong orientation). These edges have no edge mate.
|
|
219
|
+
* * These conditions define a conventional manifold mesh where each edge of a facet has at most one partner edge with
|
|
220
|
+
* opposite orientation in an adjacent facet.
|
|
221
|
+
* * After calling this method, the caller can construct `IndexedPolyfaceWalker` objects to traverse the mesh by
|
|
222
|
+
* walking across edges, around faces, and around vertices. Let walkerA have edgeIndex value kA. Then with the
|
|
223
|
+
* aforementioned edgeIndices:
|
|
224
|
+
* * `walkerC = walkerA.edgeMate()` moves across the edge to its other end, at kC.
|
|
225
|
+
* * `walkerB = walkerA.nextAroundFacet()` moves around the facet to the next edge, at kB.
|
|
226
|
+
* * `walkerB.previousAroundFacet()` moves from kB back to kA.
|
|
227
|
+
* * `walkerD = walkerA.previousAroundVertex()` moves around the vertex to the next edge kD.
|
|
228
|
+
* * `walkerD1 = walkerC.nextAroundFacet()` also moves to kD.
|
|
229
|
+
* * `walkerD.nextAroundVertex()` moves from kD back to kA.
|
|
230
|
+
*/
|
|
231
|
+
static buildEdgeMateIndices(polyface: IndexedPolyface): void;
|
|
232
|
+
}
|
|
233
|
+
//# sourceMappingURL=IndexedPolyfaceWalker.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IndexedPolyfaceWalker.d.ts","sourceRoot":"","sources":["../../../src/polyface/IndexedPolyfaceWalker.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAE7C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2DG;AACH,qBAAa,qBAAqB;IAChC,oCAAoC;IACpC,OAAO,CAAC,SAAS,CAAkB;IACnC,+CAA+C;IAC/C,OAAO,CAAC,UAAU,CAAqB;IACvC,kBAAkB;IAClB,OAAO;IAIP;;;;OAIG;IACH,IAAW,SAAS,IAAI,MAAM,GAAG,SAAS,CAEzC;IAED,0CAA0C;IAC1C,IAAW,QAAQ,IAAI,eAAe,GAAG,SAAS,CAEjD;IACD;;;OAGG;IACH,IAAW,OAAO,IAAI,OAAO,CAE5B;IACD;;;;;;OAMG;IACH,IAAW,WAAW,IAAI,OAAO,CAEhC;IACD;;;;;;OAMG;WACW,iBAAiB,CAAC,QAAQ,EAAE,eAAe,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,qBAAqB;IAKrG;;;;;;;;OAQG;WACW,kBAAkB,CAAC,QAAQ,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,EAAE,iBAAiB,GAAE,MAAU,GAAG,qBAAqB;IASrI;;;;;OAKG;WACW,eAAe,CAAC,OAAO,EAAE,sBAAsB,EAAE,iBAAiB,GAAE,MAAU,GAAG,qBAAqB;IAIpH;;;;;;OAMG;IACI,KAAK,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,qBAAqB,GAAG,SAAS;IAOnE;;;OAGG;IACI,WAAW,CAAC,OAAO,EAAE,sBAAsB,GAAG,OAAO;IAM5D;;;;;;OAMG;IACI,6BAA6B,CAAC,KAAK,EAAE,qBAAqB,GAAG,OAAO;IAK3E;;;;;OAKG;IACI,UAAU,CAAC,KAAK,EAAE,qBAAqB,GAAG,OAAO;IAIxD;;;;OAIG;IACH,OAAO,CAAC,YAAY;IAOpB;;;;;;OAMG;IACI,eAAe,CAAC,MAAM,CAAC,EAAE,qBAAqB,GAAG,qBAAqB;IAa7E;;;;;;OAMG;IACI,mBAAmB,CAAC,MAAM,CAAC,EAAE,qBAAqB,GAAG,qBAAqB;IAcjF;;;;;;;OAOG;IACI,QAAQ,CAAC,MAAM,CAAC,EAAE,qBAAqB,GAAG,qBAAqB;IAGtE;;;;;;;;;OASG;IACI,gBAAgB,CAAC,MAAM,CAAC,EAAE,qBAAqB,GAAG,qBAAqB;IAI9E;;;;;;;;;OASG;IACI,oBAAoB,CAAC,MAAM,CAAC,EAAE,qBAAqB,GAAG,qBAAqB;IAKlF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAiCG;WACW,oBAAoB,CAAC,QAAQ,EAAE,eAAe;CA8B7D"}
|
|
@@ -0,0 +1,353 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*---------------------------------------------------------------------------------------------
|
|
3
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
4
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
5
|
+
*--------------------------------------------------------------------------------------------*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.IndexedPolyfaceWalker = void 0;
|
|
8
|
+
/** @packageDocumentation
|
|
9
|
+
* @module Polyface
|
|
10
|
+
*/
|
|
11
|
+
const IndexedEdgeMatcher_1 = require("./IndexedEdgeMatcher");
|
|
12
|
+
/**
|
|
13
|
+
* The `IndexedPolyfaceWalker` class supports navigation around facets, across edges, and around vertices in an
|
|
14
|
+
* [[IndexedPolyface]].
|
|
15
|
+
* * Compare to the [[IndexedPolyfaceVisitor]] class, which supports the iteration of facets in an `IndexedPolyface`.
|
|
16
|
+
* * A one-time call to [[buildEdgeMateIndices]] creates and populates the `data.edgeMateIndex` array on the input.
|
|
17
|
+
* * This array essentially completes the topology of the `IndexedPolyface` by storing facet adjacency.
|
|
18
|
+
* * After this setup, caller code can create `IndexedPolyfaceWalker` objects via:
|
|
19
|
+
* * `walker = IndexedPolyfaceWalker.createAtFacetIndex(polyface, facetIndex, offsetWithinFacet)`
|
|
20
|
+
* * `walker = IndexedPolyfaceWalker.createAtEdgeIndex(polyface, edgeIndex)`
|
|
21
|
+
* * `walker = IndexedPolyfaceWalker.createAtVisitor(visitor, offsetWithinFacet)`
|
|
22
|
+
* * Once you have a walker object, you can traverse the facet, edge, and vertex loops it references. For
|
|
23
|
+
* example, if `walker.edgeIndex === A`, referring to the right edge of the upper left facet pictured below, then
|
|
24
|
+
* the following are true:
|
|
25
|
+
* * `walker.nextAroundFacet().edgeIndex === B`
|
|
26
|
+
* * `walker.previousAroundFacet().edgeIndex === C`
|
|
27
|
+
* * `walker.edgeMate().edgeIndex === F`
|
|
28
|
+
* * `walker.nextAroundVertex().edgeIndex === E`
|
|
29
|
+
* * `walker.previousAroundVertex().edgeIndex === D`
|
|
30
|
+
* ```
|
|
31
|
+
* # --------- # --------- #
|
|
32
|
+
* | < < < B | F |
|
|
33
|
+
* | ^ | v |
|
|
34
|
+
* | ^ | v |
|
|
35
|
+
* | ^ | v |
|
|
36
|
+
* | C > > > A | D > > > |
|
|
37
|
+
* # --------- # --------- #
|
|
38
|
+
* | < < < E | |
|
|
39
|
+
* | | |
|
|
40
|
+
* | | |
|
|
41
|
+
* | | |
|
|
42
|
+
* # --------- # --------- #
|
|
43
|
+
* ```
|
|
44
|
+
* * When facets are viewed so that the face loops stored in the [[PolyfaceData]] `pointIndex` array have
|
|
45
|
+
* counterclockwise ordering, an edge "from A to B" has facet area to the left and the edge to the right. Likewise,
|
|
46
|
+
* the edges "out of" locations B, C, E, F, D are directed as depicted above.
|
|
47
|
+
* * With this conventional counterclockwise ordering of face loops, "next" is counterclockwise, and "previous" is
|
|
48
|
+
* clockwise:
|
|
49
|
+
* * The [[nextAroundFacet]] step is counterclockwise around the facet.
|
|
50
|
+
* * The [[previousAroundFacet]] step is clockwise around the facet.
|
|
51
|
+
* * The [[nextAroundVertex]] step is counterclockwise around the vertex.
|
|
52
|
+
* * The [[previousAroundVertex]] step is clockwise around the vertex.
|
|
53
|
+
* * The `nextAroundFacet` steps for a walker and its [[edgeMate]] are in opposite directions along their shared edge,
|
|
54
|
+
* when that edge is interior. Thus the `edgeMate` step can be seen to iterate an "edge loop" of two locations for an
|
|
55
|
+
* interior edges.
|
|
56
|
+
* * Invalid Walkers:
|
|
57
|
+
* * An invalid walker has undefined [[edgeIndex]]. For these walkers, [[isUndefined]] returns true, and [[isValid]]
|
|
58
|
+
* returns false. Traversal operations on an invalid walker return an invalid walker.
|
|
59
|
+
* * Invalid walkers are expected during traversals of a mesh with boundary edges, so calling code must be prepared.
|
|
60
|
+
* Boundary edges have exactly one adjacent facet, so for these edges the `edgeMate` step returns an invalid walker.
|
|
61
|
+
* In the diagram above, the `edgeMate` of boundary edge B is undefined.
|
|
62
|
+
* * Invalid walkers can occur while traversing boundary vertices as well. If an edge lacks an `edgeMate`, then the
|
|
63
|
+
* `previousAroundVertex` step yields an invalid walker, because `previousAroundVertex` is implemented as `edgeMate`
|
|
64
|
+
* followed by `nextAroundFacet`. In the diagram above, the `previousAroundVertex` step at boundary edge B yields
|
|
65
|
+
* undefined walker. Similarly, the `nextAroundVertex` step at edge F yields undefined walker.
|
|
66
|
+
* * Invalid walkers can also occur while traversing a non-manifold mesh. Such meshes feature edge(s) with more than
|
|
67
|
+
* two adjacent facets, or with two adjacent facets that have opposite orientations. These meshes are uncommon, and
|
|
68
|
+
* usually indicate a construction problem.
|
|
69
|
+
* * See [[buildEdgeMateIndices]] for further description of the topological relations.
|
|
70
|
+
* @public
|
|
71
|
+
*/
|
|
72
|
+
class IndexedPolyfaceWalker {
|
|
73
|
+
/** The polyface being traversed. */
|
|
74
|
+
_polyface;
|
|
75
|
+
/** The current edgeIndex into the polyface. */
|
|
76
|
+
_edgeIndex;
|
|
77
|
+
/** Constructor */
|
|
78
|
+
constructor(polyface, edgeIndex) {
|
|
79
|
+
this._polyface = polyface;
|
|
80
|
+
this._edgeIndex = edgeIndex;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Return the edge index of this walker.
|
|
84
|
+
* * This is an index into the polyface's `data.pointIndex` array.
|
|
85
|
+
* * Can be undefined.
|
|
86
|
+
*/
|
|
87
|
+
get edgeIndex() {
|
|
88
|
+
return this._edgeIndex;
|
|
89
|
+
}
|
|
90
|
+
/** Return the polyface of this walker. */
|
|
91
|
+
get polyface() {
|
|
92
|
+
return this._polyface;
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Return true if the walker's edgeIndex is defined.
|
|
96
|
+
* * This method is the opposite of [[isUndefined]].
|
|
97
|
+
*/
|
|
98
|
+
get isValid() {
|
|
99
|
+
return this._edgeIndex !== undefined;
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Return true if the walker's edgeIndex is undefined.
|
|
103
|
+
* * This method is the opposite of [[isValid]].
|
|
104
|
+
* * This can happen during a walk when the walker `w` reaches an exterior edge, for then
|
|
105
|
+
* `w.edgeMate(w).isUndefined === true`.
|
|
106
|
+
* * This can also happen when methods that return a walker receive invalid input.
|
|
107
|
+
*/
|
|
108
|
+
get isUndefined() {
|
|
109
|
+
return this._edgeIndex === undefined;
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Create a walker for a given polyface at an optional edge.
|
|
113
|
+
* @param polyface reference to the client polyface. This reference is captured (the polyface is not copied).
|
|
114
|
+
* @param edgeIndex optional indication of where to start the walker within the mesh.
|
|
115
|
+
* * If the edgeIndex is valid for the input polyface, the new walker is started there.
|
|
116
|
+
* * If the edgeIndex is undefined or invalid for the input polyface, the walker returns true for [[isUndefined]].
|
|
117
|
+
*/
|
|
118
|
+
static createAtEdgeIndex(polyface, edgeIndex) {
|
|
119
|
+
if (!polyface.data.isValidEdgeIndex(edgeIndex))
|
|
120
|
+
edgeIndex = undefined;
|
|
121
|
+
return new IndexedPolyfaceWalker(polyface, edgeIndex);
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Create a walker for a given polyface at a specified facet.
|
|
125
|
+
* * If `facetIndex` or `offsetWithinFacet` is invalid for the input polyface, the walker returns true for
|
|
126
|
+
* [[isUndefined]].
|
|
127
|
+
* @param polyface the polyface to reference
|
|
128
|
+
* @param facetIndex index of the facet to reference
|
|
129
|
+
* @param offsetWithinFacet optional 0-based offset within the face loop of the facet (default 0). This allows
|
|
130
|
+
* the caller to start the walker at a particular edge of the facet.
|
|
131
|
+
*/
|
|
132
|
+
static createAtFacetIndex(polyface, facetIndex, offsetWithinFacet = 0) {
|
|
133
|
+
if (polyface.isValidFacetIndex(facetIndex)) {
|
|
134
|
+
const k0 = polyface.facetIndex0(facetIndex);
|
|
135
|
+
const k1 = polyface.facetIndex1(facetIndex);
|
|
136
|
+
if (0 <= offsetWithinFacet && k0 + offsetWithinFacet < k1)
|
|
137
|
+
return new IndexedPolyfaceWalker(polyface, k0 + offsetWithinFacet);
|
|
138
|
+
}
|
|
139
|
+
return new IndexedPolyfaceWalker(polyface, undefined);
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Create a walker at the facet specified by a visitor.
|
|
143
|
+
* @param visitor visitor whose currentReadIndex identifies the facet.
|
|
144
|
+
* @param offsetWithinFacet optional 0-based offset within the face loop of the facet (default 0). This allows
|
|
145
|
+
* the caller to start the walker at a particular edge of the facet.
|
|
146
|
+
*/
|
|
147
|
+
static createAtVisitor(visitor, offsetWithinFacet = 0) {
|
|
148
|
+
const facetIndex = visitor.currentReadIndex();
|
|
149
|
+
return IndexedPolyfaceWalker.createAtFacetIndex(visitor.clientPolyface(), facetIndex, offsetWithinFacet);
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* Create a new IndexedPolyfaceWalker from the instance.
|
|
153
|
+
* * The returned walker refers to the same polyface.
|
|
154
|
+
* * If `edgeIndex` is undefined, the returned walker refers to the same edge as the instance.
|
|
155
|
+
* * If `edgeIndex` is defined and valid, the returned walker refers to this edge.
|
|
156
|
+
* * If `edgeIndex` is defined but invalid, return undefined.
|
|
157
|
+
*/
|
|
158
|
+
clone(edgeIndex) {
|
|
159
|
+
if (edgeIndex === undefined)
|
|
160
|
+
edgeIndex = this._edgeIndex;
|
|
161
|
+
if (this._polyface.data.isValidEdgeIndex(edgeIndex))
|
|
162
|
+
return new IndexedPolyfaceWalker(this._polyface, edgeIndex);
|
|
163
|
+
return undefined;
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* Load the walker's facet into the given visitor.
|
|
167
|
+
* @returns true if the visitor and walker reference the same polyface and the walker has a valid edge index.
|
|
168
|
+
*/
|
|
169
|
+
loadVisitor(visitor) {
|
|
170
|
+
if (visitor.clientPolyface() !== this._polyface)
|
|
171
|
+
return false;
|
|
172
|
+
const facetIndex = this._polyface.edgeIndexToFacetIndex(this._edgeIndex);
|
|
173
|
+
return (facetIndex !== undefined) ? visitor.moveToReadIndex(facetIndex) : false;
|
|
174
|
+
}
|
|
175
|
+
/**
|
|
176
|
+
* Test if two walkers are at different edges in the same polyface.
|
|
177
|
+
* * If either has undefined edge, return false.
|
|
178
|
+
* * If they are in different polyfaces, return false.
|
|
179
|
+
* * If they are the same edge in the same polyface, return false.
|
|
180
|
+
* * Otherwise return true.
|
|
181
|
+
*/
|
|
182
|
+
isDifferentEdgeInSamePolyface(other) {
|
|
183
|
+
if (this.isUndefined || other.isUndefined)
|
|
184
|
+
return false;
|
|
185
|
+
return this._polyface === other._polyface && this._edgeIndex !== other.edgeIndex;
|
|
186
|
+
}
|
|
187
|
+
/**
|
|
188
|
+
* Test if two walkers are in the same polyface at the same edge.
|
|
189
|
+
* * If either has undefined edge, return false.
|
|
190
|
+
* * If they are in different polyfaces, return false.
|
|
191
|
+
* * If they are the same edge in the same polyface, return true.
|
|
192
|
+
*/
|
|
193
|
+
isSameEdge(other) {
|
|
194
|
+
return this._polyface === other._polyface && this.isValid && this._edgeIndex === other._edgeIndex;
|
|
195
|
+
}
|
|
196
|
+
/**
|
|
197
|
+
* Return a walker with given edgeIndex and polyface from the calling instance.
|
|
198
|
+
* * If `result` is supplied, that walker is filled and returned.
|
|
199
|
+
* * If `result` is not supplied, a new walker is created.
|
|
200
|
+
*/
|
|
201
|
+
createResult(result, edgeIndex) {
|
|
202
|
+
if (result === undefined)
|
|
203
|
+
return new IndexedPolyfaceWalker(this._polyface, edgeIndex);
|
|
204
|
+
result._polyface = this._polyface;
|
|
205
|
+
result._edgeIndex = edgeIndex;
|
|
206
|
+
return result;
|
|
207
|
+
}
|
|
208
|
+
/**
|
|
209
|
+
* Return a walker (new or reused) at the next edge around the facet.
|
|
210
|
+
* * "Next" is in the order of indices in the face loop of this facet.
|
|
211
|
+
* * If the instance has undefined edgeIndex, the result also has undefined edgeIndex.
|
|
212
|
+
* @param result optional receiver to modify and return. May be the same as `this` to move the instance walker
|
|
213
|
+
* to the new location and return it.
|
|
214
|
+
*/
|
|
215
|
+
nextAroundFacet(result) {
|
|
216
|
+
const k = this._edgeIndex;
|
|
217
|
+
if (k === undefined)
|
|
218
|
+
return this.createResult(result, undefined);
|
|
219
|
+
const facetIndex = this._polyface.edgeIndexToFacetIndex(k);
|
|
220
|
+
if (facetIndex === undefined)
|
|
221
|
+
return this.createResult(result, undefined);
|
|
222
|
+
const k2 = this._polyface.facetIndex1(facetIndex);
|
|
223
|
+
const k1 = k + 1;
|
|
224
|
+
if (k1 < k2)
|
|
225
|
+
return this.createResult(result, k1);
|
|
226
|
+
return this.createResult(result, this._polyface.facetIndex0(facetIndex));
|
|
227
|
+
}
|
|
228
|
+
/**
|
|
229
|
+
* Return a walker (new or reused) at the previous edge around the facet.
|
|
230
|
+
* * "Previous" is in the reverse order of indices in the face loop of this facet.
|
|
231
|
+
* * If the instance has undefined edgeIndex, the result also has undefined edgeIndex.
|
|
232
|
+
* @param result optional receiver to modify and return. May be the same as `this` to move the instance walker
|
|
233
|
+
* to the new location and return it.
|
|
234
|
+
*/
|
|
235
|
+
previousAroundFacet(result) {
|
|
236
|
+
let k = this._edgeIndex;
|
|
237
|
+
if (k === undefined)
|
|
238
|
+
return this.createResult(result, undefined);
|
|
239
|
+
const facetIndex = this._polyface.edgeIndexToFacetIndex(k);
|
|
240
|
+
if (facetIndex === undefined)
|
|
241
|
+
return this.createResult(result, undefined);
|
|
242
|
+
const k0 = this._polyface.facetIndex0(facetIndex);
|
|
243
|
+
if (k === k0)
|
|
244
|
+
k = this._polyface.facetIndex1(facetIndex) - 1;
|
|
245
|
+
else
|
|
246
|
+
k--;
|
|
247
|
+
return this.createResult(result, k);
|
|
248
|
+
}
|
|
249
|
+
/**
|
|
250
|
+
* Return a walker (new or reused) at the edge mate of this walker's edge.
|
|
251
|
+
* * The returned walker has undefined edgeIndex if:
|
|
252
|
+
* * the instance is at a boundary edge, i.e., there is no facet on the other side, or
|
|
253
|
+
* * the instance has undefined edgeIndex.
|
|
254
|
+
* @param result optional receiver to modify and return. May be the same as `this` to move the instance walker
|
|
255
|
+
* to the new location and return it.
|
|
256
|
+
*/
|
|
257
|
+
edgeMate(result) {
|
|
258
|
+
return this.createResult(result, this._polyface.data.edgeIndexToEdgeMateIndex(this._edgeIndex));
|
|
259
|
+
}
|
|
260
|
+
/**
|
|
261
|
+
* Return a walker (new or reused) at the next outbound edge around the vertex at the base of this walker's edge.
|
|
262
|
+
* * If the facet is viewed so that its "nextAroundFacet" direction appears counterclockwise, then the "next"
|
|
263
|
+
* outbound edge is counterclockwise around the base vertex.
|
|
264
|
+
* * The returned walker has undefined edgeIndex if:
|
|
265
|
+
* * the previous edge around the facet is a boundary edge, i.e., there is no facet on the other side, or
|
|
266
|
+
* * the instance has undefined edgeIndex.
|
|
267
|
+
* @param result optional receiver to modify and return. May be the same as `this` to move the instance walker
|
|
268
|
+
* to the new location and return it.
|
|
269
|
+
*/
|
|
270
|
+
nextAroundVertex(result) {
|
|
271
|
+
const result1 = this.previousAroundFacet(result);
|
|
272
|
+
return result1.edgeMate(result1);
|
|
273
|
+
}
|
|
274
|
+
/**
|
|
275
|
+
* Return a walker (new or reused) at the previous outbound edge around the vertex at the base of this walker's edge.
|
|
276
|
+
* * If the facet is viewed so that its "nextAroundFacet" direction appears counterclockwise, then the "previous"
|
|
277
|
+
* outbound edge is clockwise around the base vertex.
|
|
278
|
+
* * The returned walker has undefined edgeIndex if:
|
|
279
|
+
* * the instance edge is a boundary edge, i.e., there is no facet on the other side, or
|
|
280
|
+
* * the instance has undefined edgeIndex.
|
|
281
|
+
* @param result optional receiver to modify and return. May be the same as `this` to move the instance walker
|
|
282
|
+
* to the new location and return it.
|
|
283
|
+
*/
|
|
284
|
+
previousAroundVertex(result) {
|
|
285
|
+
const result1 = this.edgeMate(result);
|
|
286
|
+
return result1.nextAroundFacet(result1);
|
|
287
|
+
}
|
|
288
|
+
/**
|
|
289
|
+
* Build the edgeMate index array into the polyface's [[PolyfaceData]].
|
|
290
|
+
* After this method:
|
|
291
|
+
* * The array `polyface.data.edgeMateIndex` is defined with the same length as the other PolyfaceData index arrays.
|
|
292
|
+
* * For each interior edge, `polyface.data.edgeIndexToEdgeMateIndex` returns the edgeIndex on the other side of the
|
|
293
|
+
* edge in the adjacent facet.
|
|
294
|
+
* * The conditions for edgeMate matching are:
|
|
295
|
+
* * Given facetIndex f, let `k0 = polyface.facetIndex0(f)` and `k1 = polyface.facetIndex1(f)`.
|
|
296
|
+
* * Every edgeIndex k in the face loop of facet f satisfies `k0 <= k < k1`.
|
|
297
|
+
* * The edge with edgeIndex k starts at the point with index `polyface.data.pointIndex[k]`.
|
|
298
|
+
* * Let kA be an edgeIndex in this range [k0,k1), and let kB be its in-range successor with cyclic wrap, i.e.,
|
|
299
|
+
* `kB === (kA + 1 === k1) ? k0 : kA + 1`.
|
|
300
|
+
* * Then `polyface.data.pointIndex[kA]` and `polyface.data.pointIndex[kB]` are the indices of the points at the
|
|
301
|
+
* start and end of an edge of that facet.
|
|
302
|
+
* * We call kA the _edgeIndex_ for that edge, and kB the _edgeIndex_ for the next edge around the facet.
|
|
303
|
+
* * If kA is an interior edge in a 2-manifold mesh with properly oriented facets, then there is an adjacent facet
|
|
304
|
+
* whose face loop contains edgeIndices kC and kD referencing the same edge vertices in reverse order, i.e.,
|
|
305
|
+
* * `polyface.data.pointIndex[kA] === polyface.data.pointIndex[kD]`
|
|
306
|
+
* * `polyface.data.pointIndex[kB] === polyface.data.pointIndex[kC]`
|
|
307
|
+
* * Given this relationship, we say that edgeIndices kA and kC are _edge mates_.
|
|
308
|
+
* * A non-interior edge either lies on the boundary of the mesh or is non-manifold (having more than two adjacent
|
|
309
|
+
* facets, or one with the wrong orientation). These edges have no edge mate.
|
|
310
|
+
* * These conditions define a conventional manifold mesh where each edge of a facet has at most one partner edge with
|
|
311
|
+
* opposite orientation in an adjacent facet.
|
|
312
|
+
* * After calling this method, the caller can construct `IndexedPolyfaceWalker` objects to traverse the mesh by
|
|
313
|
+
* walking across edges, around faces, and around vertices. Let walkerA have edgeIndex value kA. Then with the
|
|
314
|
+
* aforementioned edgeIndices:
|
|
315
|
+
* * `walkerC = walkerA.edgeMate()` moves across the edge to its other end, at kC.
|
|
316
|
+
* * `walkerB = walkerA.nextAroundFacet()` moves around the facet to the next edge, at kB.
|
|
317
|
+
* * `walkerB.previousAroundFacet()` moves from kB back to kA.
|
|
318
|
+
* * `walkerD = walkerA.previousAroundVertex()` moves around the vertex to the next edge kD.
|
|
319
|
+
* * `walkerD1 = walkerC.nextAroundFacet()` also moves to kD.
|
|
320
|
+
* * `walkerD.nextAroundVertex()` moves from kD back to kA.
|
|
321
|
+
*/
|
|
322
|
+
static buildEdgeMateIndices(polyface) {
|
|
323
|
+
const matcher = new IndexedEdgeMatcher_1.IndexedEdgeMatcher();
|
|
324
|
+
const numFacet = polyface.facetCount;
|
|
325
|
+
for (let facetIndex = 0; facetIndex < numFacet; facetIndex++) {
|
|
326
|
+
const kStart = polyface.facetIndex0(facetIndex);
|
|
327
|
+
const kEnd = polyface.facetIndex1(facetIndex);
|
|
328
|
+
let k0 = kEnd - 1;
|
|
329
|
+
// sneaky: addEdge 3rd arg is edgeIndex k0 instead of facetIndex; it gets carried around during matching
|
|
330
|
+
for (let k1 = kStart; k1 < kEnd; k0 = k1, k1++)
|
|
331
|
+
matcher.addEdge(polyface.data.pointIndex[k0], polyface.data.pointIndex[k1], k0);
|
|
332
|
+
}
|
|
333
|
+
const matchedPairs = [];
|
|
334
|
+
const singletons = [];
|
|
335
|
+
const nullEdges = [];
|
|
336
|
+
const allOtherClusters = [];
|
|
337
|
+
matcher.sortAndCollectClusters(matchedPairs, singletons, nullEdges, allOtherClusters);
|
|
338
|
+
const numIndex = polyface.data.pointIndex.length;
|
|
339
|
+
polyface.data.edgeMateIndex = new Array(numIndex);
|
|
340
|
+
for (let i = 0; i < numIndex; i++)
|
|
341
|
+
polyface.data.edgeMateIndex[i] = undefined;
|
|
342
|
+
for (const pair of matchedPairs) {
|
|
343
|
+
if (Array.isArray(pair) && pair.length === 2) {
|
|
344
|
+
const k0 = pair[0].facetIndex;
|
|
345
|
+
const k1 = pair[1].facetIndex;
|
|
346
|
+
polyface.data.edgeMateIndex[k0] = k1;
|
|
347
|
+
polyface.data.edgeMateIndex[k1] = k0;
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
exports.IndexedPolyfaceWalker = IndexedPolyfaceWalker;
|
|
353
|
+
//# sourceMappingURL=IndexedPolyfaceWalker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IndexedPolyfaceWalker.js","sourceRoot":"","sources":["../../../src/polyface/IndexedPolyfaceWalker.ts"],"names":[],"mappings":"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","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) {\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"]}
|