@itwin/core-geometry 5.2.0-dev.7 → 5.2.0
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 +46 -1
- package/lib/cjs/Constant.js.map +1 -1
- package/lib/cjs/Geometry.d.ts +30 -10
- package/lib/cjs/Geometry.d.ts.map +1 -1
- package/lib/cjs/Geometry.js +74 -10
- package/lib/cjs/Geometry.js.map +1 -1
- package/lib/cjs/bspline/AkimaCurve3d.d.ts +19 -6
- package/lib/cjs/bspline/AkimaCurve3d.d.ts.map +1 -1
- package/lib/cjs/bspline/AkimaCurve3d.js +21 -5
- package/lib/cjs/bspline/AkimaCurve3d.js.map +1 -1
- package/lib/cjs/bspline/BSpline1dNd.js.map +1 -1
- package/lib/cjs/bspline/BSplineCurve.d.ts +3 -3
- package/lib/cjs/bspline/BSplineCurve.d.ts.map +1 -1
- package/lib/cjs/bspline/BSplineCurve.js +6 -6
- package/lib/cjs/bspline/BSplineCurve.js.map +1 -1
- 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 +1 -1
- package/lib/cjs/bspline/BSplineCurveOps.js.map +1 -1
- package/lib/cjs/bspline/BSplineSurface.js.map +1 -1
- package/lib/cjs/bspline/Bezier1dNd.js.map +1 -1
- package/lib/cjs/bspline/BezierCurve3d.js.map +1 -1
- package/lib/cjs/bspline/BezierCurve3dH.js.map +1 -1
- package/lib/cjs/bspline/BezierCurveBase.d.ts +2 -2
- package/lib/cjs/bspline/BezierCurveBase.d.ts.map +1 -1
- package/lib/cjs/bspline/BezierCurveBase.js +4 -6
- package/lib/cjs/bspline/BezierCurveBase.js.map +1 -1
- package/lib/cjs/bspline/InterpolationCurve3d.d.ts +27 -17
- package/lib/cjs/bspline/InterpolationCurve3d.d.ts.map +1 -1
- package/lib/cjs/bspline/InterpolationCurve3d.js +17 -7
- package/lib/cjs/bspline/InterpolationCurve3d.js.map +1 -1
- package/lib/cjs/bspline/KnotVector.js.map +1 -1
- package/lib/cjs/bspline/SurfaceLocationDetail.js.map +1 -1
- package/lib/cjs/clipping/AlternatingConvexClipTree.js.map +1 -1
- package/lib/cjs/clipping/BooleanClipFactory.js.map +1 -1
- package/lib/cjs/clipping/BooleanClipNode.js.map +1 -1
- package/lib/cjs/clipping/ClipPlane.d.ts +19 -6
- package/lib/cjs/clipping/ClipPlane.d.ts.map +1 -1
- package/lib/cjs/clipping/ClipPlane.js +17 -2
- package/lib/cjs/clipping/ClipPlane.js.map +1 -1
- package/lib/cjs/clipping/ClipPrimitive.js.map +1 -1
- package/lib/cjs/clipping/ClipUtils.d.ts +14 -1
- package/lib/cjs/clipping/ClipUtils.d.ts.map +1 -1
- package/lib/cjs/clipping/ClipUtils.js +21 -3
- package/lib/cjs/clipping/ClipUtils.js.map +1 -1
- package/lib/cjs/clipping/ClipVector.js.map +1 -1
- package/lib/cjs/clipping/ConvexClipPlaneSet.d.ts +14 -11
- package/lib/cjs/clipping/ConvexClipPlaneSet.d.ts.map +1 -1
- package/lib/cjs/clipping/ConvexClipPlaneSet.js +23 -16
- package/lib/cjs/clipping/ConvexClipPlaneSet.js.map +1 -1
- package/lib/cjs/clipping/UnionOfConvexClipPlaneSets.d.ts +20 -3
- package/lib/cjs/clipping/UnionOfConvexClipPlaneSets.d.ts.map +1 -1
- package/lib/cjs/clipping/UnionOfConvexClipPlaneSets.js +22 -5
- package/lib/cjs/clipping/UnionOfConvexClipPlaneSets.js.map +1 -1
- package/lib/cjs/clipping/internalContexts/LineStringOffsetClipperContext.js.map +1 -1
- package/lib/cjs/core-geometry.js.map +1 -1
- package/lib/cjs/curve/Arc3d.d.ts +27 -17
- package/lib/cjs/curve/Arc3d.d.ts.map +1 -1
- package/lib/cjs/curve/Arc3d.js +61 -35
- package/lib/cjs/curve/Arc3d.js.map +1 -1
- package/lib/cjs/curve/ConstructCurveBetweenCurves.js.map +1 -1
- package/lib/cjs/curve/CoordinateXYZ.js.map +1 -1
- package/lib/cjs/curve/CurveChainWithDistanceIndex.js.map +1 -1
- package/lib/cjs/curve/CurveCollection.d.ts +1 -0
- package/lib/cjs/curve/CurveCollection.d.ts.map +1 -1
- package/lib/cjs/curve/CurveCollection.js +1 -0
- 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.js.map +1 -1
- package/lib/cjs/curve/CurveLocationDetail.d.ts +8 -7
- package/lib/cjs/curve/CurveLocationDetail.d.ts.map +1 -1
- package/lib/cjs/curve/CurveLocationDetail.js.map +1 -1
- package/lib/cjs/curve/CurveOps.d.ts +51 -1
- package/lib/cjs/curve/CurveOps.d.ts.map +1 -1
- package/lib/cjs/curve/CurveOps.js +97 -3
- package/lib/cjs/curve/CurveOps.js.map +1 -1
- package/lib/cjs/curve/CurvePrimitive.js.map +1 -1
- package/lib/cjs/curve/CurveProcessor.js.map +1 -1
- package/lib/cjs/curve/CurveTypes.js.map +1 -1
- package/lib/cjs/curve/CurveWireMomentsXYZ.js.map +1 -1
- package/lib/cjs/curve/GeometryQuery.js.map +1 -1
- package/lib/cjs/curve/LineSegment3d.js.map +1 -1
- package/lib/cjs/curve/LineString3d.d.ts +4 -4
- package/lib/cjs/curve/LineString3d.d.ts.map +1 -1
- package/lib/cjs/curve/LineString3d.js +8 -8
- package/lib/cjs/curve/LineString3d.js.map +1 -1
- package/lib/cjs/curve/Loop.js.map +1 -1
- package/lib/cjs/curve/OffsetOptions.js.map +1 -1
- package/lib/cjs/curve/ParityRegion.js.map +1 -1
- package/lib/cjs/curve/Path.js.map +1 -1
- package/lib/cjs/curve/PointString3d.js.map +1 -1
- package/lib/cjs/curve/ProxyCurve.js.map +1 -1
- package/lib/cjs/curve/Query/ConsolidateAdjacentPrimitivesContext.js +3 -3
- package/lib/cjs/curve/Query/ConsolidateAdjacentPrimitivesContext.js.map +1 -1
- package/lib/cjs/curve/Query/CurveSplitContext.js.map +1 -1
- 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.d.ts +6 -2
- package/lib/cjs/curve/Query/PlanarSubdivision.d.ts.map +1 -1
- package/lib/cjs/curve/Query/PlanarSubdivision.js +12 -7
- package/lib/cjs/curve/Query/PlanarSubdivision.js.map +1 -1
- package/lib/cjs/curve/Query/StrokeCountChain.js.map +1 -1
- package/lib/cjs/curve/Query/StrokeCountMap.js.map +1 -1
- package/lib/cjs/curve/RegionMomentsXY.js.map +1 -1
- package/lib/cjs/curve/RegionOps.d.ts +9 -4
- package/lib/cjs/curve/RegionOps.d.ts.map +1 -1
- package/lib/cjs/curve/RegionOps.js +10 -5
- package/lib/cjs/curve/RegionOps.js.map +1 -1
- package/lib/cjs/curve/RegionOpsClassificationSweeps.js.map +1 -1
- package/lib/cjs/curve/StrokeOptions.js.map +1 -1
- package/lib/cjs/curve/UnionRegion.js.map +1 -1
- package/lib/cjs/curve/internalContexts/AnnounceTangentStrokeHandler.js.map +1 -1
- package/lib/cjs/curve/internalContexts/AppendPlaneIntersectionStrokeHandler.js.map +1 -1
- package/lib/cjs/curve/internalContexts/ChainCollectorContext.js.map +1 -1
- 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.map +1 -1
- package/lib/cjs/curve/internalContexts/CountLinearPartsSearchContext.js.map +1 -1
- package/lib/cjs/curve/internalContexts/CurveCurveCloseApproachXY.js.map +1 -1
- package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.d.ts.map +1 -1
- package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.js +2 -1
- package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.js.map +1 -1
- package/lib/cjs/curve/internalContexts/CurveCurveIntersectXYZ.js.map +1 -1
- package/lib/cjs/curve/internalContexts/CurveLengthContext.js.map +1 -1
- package/lib/cjs/curve/internalContexts/CurveOffsetXYHandler.js.map +1 -1
- package/lib/cjs/curve/internalContexts/EllipticalArcApproximationContext.js.map +1 -1
- package/lib/cjs/curve/internalContexts/GapSearchContext.js.map +1 -1
- package/lib/cjs/curve/internalContexts/MultiChainCollector.d.ts +4 -4
- package/lib/cjs/curve/internalContexts/MultiChainCollector.d.ts.map +1 -1
- package/lib/cjs/curve/internalContexts/MultiChainCollector.js +21 -18
- package/lib/cjs/curve/internalContexts/MultiChainCollector.js.map +1 -1
- package/lib/cjs/curve/internalContexts/NewtonRtoRStrokeHandler.js.map +1 -1
- package/lib/cjs/curve/internalContexts/PlaneAltitudeRangeContext.js.map +1 -1
- package/lib/cjs/curve/internalContexts/PolygonOffsetContext.d.ts.map +1 -1
- package/lib/cjs/curve/internalContexts/PolygonOffsetContext.js +30 -50
- package/lib/cjs/curve/internalContexts/PolygonOffsetContext.js.map +1 -1
- package/lib/cjs/curve/internalContexts/SumLengthsContext.js.map +1 -1
- package/lib/cjs/curve/internalContexts/TransferWithSplitArcs.js.map +1 -1
- package/lib/cjs/curve/internalContexts/TransformInPlaceContext.js.map +1 -1
- package/lib/cjs/curve/spiral/AustralianRailCorpXYEvaluator.js.map +1 -1
- package/lib/cjs/curve/spiral/ClothoidSeries.js.map +1 -1
- package/lib/cjs/curve/spiral/CubicEvaluator.js.map +1 -1
- package/lib/cjs/curve/spiral/CzechSpiralEvaluator.js.map +1 -1
- package/lib/cjs/curve/spiral/DirectHalfCosineSpiralEvaluator.js.map +1 -1
- package/lib/cjs/curve/spiral/DirectSpiral3d.d.ts +2 -2
- package/lib/cjs/curve/spiral/DirectSpiral3d.d.ts.map +1 -1
- package/lib/cjs/curve/spiral/DirectSpiral3d.js +6 -2
- package/lib/cjs/curve/spiral/DirectSpiral3d.js.map +1 -1
- package/lib/cjs/curve/spiral/IntegratedSpiral3d.d.ts +2 -2
- package/lib/cjs/curve/spiral/IntegratedSpiral3d.d.ts.map +1 -1
- package/lib/cjs/curve/spiral/IntegratedSpiral3d.js +6 -2
- package/lib/cjs/curve/spiral/IntegratedSpiral3d.js.map +1 -1
- package/lib/cjs/curve/spiral/MXCubicAlongArcSpiralEvaluator.js.map +1 -1
- package/lib/cjs/curve/spiral/NormalizedTransition.js.map +1 -1
- package/lib/cjs/curve/spiral/PolishCubicSpiralEvaluator.js.map +1 -1
- package/lib/cjs/curve/spiral/TransitionConditionalProperties.js.map +1 -1
- package/lib/cjs/curve/spiral/TransitionSpiral3d.d.ts +5 -1
- package/lib/cjs/curve/spiral/TransitionSpiral3d.d.ts.map +1 -1
- package/lib/cjs/curve/spiral/TransitionSpiral3d.js +0 -3
- package/lib/cjs/curve/spiral/TransitionSpiral3d.js.map +1 -1
- package/lib/cjs/curve/spiral/XYCurveEvaluator.js.map +1 -1
- package/lib/cjs/geometry3d/Angle.js.map +1 -1
- package/lib/cjs/geometry3d/AngleSweep.d.ts +6 -2
- package/lib/cjs/geometry3d/AngleSweep.d.ts.map +1 -1
- package/lib/cjs/geometry3d/AngleSweep.js +12 -3
- package/lib/cjs/geometry3d/AngleSweep.js.map +1 -1
- package/lib/cjs/geometry3d/BarycentricTriangle.js.map +1 -1
- package/lib/cjs/geometry3d/BilinearPatch.js.map +1 -1
- package/lib/cjs/geometry3d/CoincidentGeometryOps.js.map +1 -1
- package/lib/cjs/geometry3d/Ellipsoid.js.map +1 -1
- package/lib/cjs/geometry3d/FrameBuilder.d.ts +2 -1
- package/lib/cjs/geometry3d/FrameBuilder.d.ts.map +1 -1
- package/lib/cjs/geometry3d/FrameBuilder.js +14 -18
- package/lib/cjs/geometry3d/FrameBuilder.js.map +1 -1
- package/lib/cjs/geometry3d/FrustumAnimation.js.map +1 -1
- package/lib/cjs/geometry3d/GeometryHandler.js.map +1 -1
- package/lib/cjs/geometry3d/GrowableBlockedArray.js.map +1 -1
- package/lib/cjs/geometry3d/GrowableFloat64Array.js.map +1 -1
- package/lib/cjs/geometry3d/GrowableXYArray.js.map +1 -1
- package/lib/cjs/geometry3d/GrowableXYZArray.js.map +1 -1
- package/lib/cjs/geometry3d/IndexedCollectionInterval.js.map +1 -1
- package/lib/cjs/geometry3d/IndexedXYCollection.js.map +1 -1
- package/lib/cjs/geometry3d/IndexedXYZCollection.js.map +1 -1
- package/lib/cjs/geometry3d/LongitudeLatitudeAltitude.js.map +1 -1
- package/lib/cjs/geometry3d/Matrix3d.d.ts +1 -1
- package/lib/cjs/geometry3d/Matrix3d.js +1 -1
- package/lib/cjs/geometry3d/Matrix3d.js.map +1 -1
- package/lib/cjs/geometry3d/OrderedRotationAngles.js.map +1 -1
- package/lib/cjs/geometry3d/Plane3d.js.map +1 -1
- package/lib/cjs/geometry3d/Plane3dByOriginAndUnitNormal.js.map +1 -1
- package/lib/cjs/geometry3d/Plane3dByOriginAndVectors.js.map +1 -1
- package/lib/cjs/geometry3d/Point2dArrayCarrier.js.map +1 -1
- package/lib/cjs/geometry3d/Point2dVector2d.d.ts +18 -2
- package/lib/cjs/geometry3d/Point2dVector2d.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Point2dVector2d.js +37 -4
- package/lib/cjs/geometry3d/Point2dVector2d.js.map +1 -1
- package/lib/cjs/geometry3d/Point3dArrayCarrier.js.map +1 -1
- package/lib/cjs/geometry3d/Point3dVector3d.d.ts +1 -1
- package/lib/cjs/geometry3d/Point3dVector3d.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Point3dVector3d.js +1 -0
- package/lib/cjs/geometry3d/Point3dVector3d.js.map +1 -1
- package/lib/cjs/geometry3d/PointHelpers.js.map +1 -1
- package/lib/cjs/geometry3d/PointStreaming.d.ts +8 -0
- package/lib/cjs/geometry3d/PointStreaming.d.ts.map +1 -1
- package/lib/cjs/geometry3d/PointStreaming.js +18 -2
- package/lib/cjs/geometry3d/PointStreaming.js.map +1 -1
- package/lib/cjs/geometry3d/PolygonOps.d.ts +18 -9
- package/lib/cjs/geometry3d/PolygonOps.d.ts.map +1 -1
- package/lib/cjs/geometry3d/PolygonOps.js +53 -26
- package/lib/cjs/geometry3d/PolygonOps.js.map +1 -1
- package/lib/cjs/geometry3d/PolylineCompressionByEdgeOffset.d.ts +8 -2
- package/lib/cjs/geometry3d/PolylineCompressionByEdgeOffset.d.ts.map +1 -1
- package/lib/cjs/geometry3d/PolylineCompressionByEdgeOffset.js +10 -4
- package/lib/cjs/geometry3d/PolylineCompressionByEdgeOffset.js.map +1 -1
- package/lib/cjs/geometry3d/PolylineOps.d.ts +14 -3
- package/lib/cjs/geometry3d/PolylineOps.d.ts.map +1 -1
- package/lib/cjs/geometry3d/PolylineOps.js +20 -4
- package/lib/cjs/geometry3d/PolylineOps.js.map +1 -1
- package/lib/cjs/geometry3d/Range.d.ts +34 -32
- package/lib/cjs/geometry3d/Range.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Range.js +28 -21
- package/lib/cjs/geometry3d/Range.js.map +1 -1
- package/lib/cjs/geometry3d/Ray2d.d.ts +16 -6
- package/lib/cjs/geometry3d/Ray2d.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Ray2d.js +28 -4
- package/lib/cjs/geometry3d/Ray2d.js.map +1 -1
- package/lib/cjs/geometry3d/Ray3d.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Ray3d.js +3 -4
- package/lib/cjs/geometry3d/Ray3d.js.map +1 -1
- package/lib/cjs/geometry3d/ReusableObjectCache.js.map +1 -1
- package/lib/cjs/geometry3d/Segment1d.js.map +1 -1
- package/lib/cjs/geometry3d/SortablePolygon.js.map +1 -1
- package/lib/cjs/geometry3d/Transform.d.ts +1 -1
- package/lib/cjs/geometry3d/Transform.js +1 -1
- package/lib/cjs/geometry3d/Transform.js.map +1 -1
- package/lib/cjs/geometry3d/UVSurfaceOps.js.map +1 -1
- package/lib/cjs/geometry3d/XYZProps.d.ts +12 -1
- package/lib/cjs/geometry3d/XYZProps.d.ts.map +1 -1
- package/lib/cjs/geometry3d/XYZProps.js +17 -2
- package/lib/cjs/geometry3d/XYZProps.js.map +1 -1
- package/lib/cjs/geometry3d/YawPitchRollAngles.js.map +1 -1
- package/lib/cjs/geometry4d/Map4d.js.map +1 -1
- package/lib/cjs/geometry4d/Matrix4d.d.ts +16 -0
- package/lib/cjs/geometry4d/Matrix4d.d.ts.map +1 -1
- package/lib/cjs/geometry4d/Matrix4d.js +26 -0
- package/lib/cjs/geometry4d/Matrix4d.js.map +1 -1
- package/lib/cjs/geometry4d/MomentData.js.map +1 -1
- package/lib/cjs/geometry4d/PlaneByOriginAndVectors4d.js.map +1 -1
- package/lib/cjs/geometry4d/Point4d.js.map +1 -1
- package/lib/cjs/numerics/BandedSystem.js.map +1 -1
- package/lib/cjs/numerics/BezierPolynomials.d.ts.map +1 -1
- package/lib/cjs/numerics/BezierPolynomials.js +5 -9
- package/lib/cjs/numerics/BezierPolynomials.js.map +1 -1
- package/lib/cjs/numerics/ClusterableArray.js.map +1 -1
- package/lib/cjs/numerics/Complex.js.map +1 -1
- package/lib/cjs/numerics/ConvexPolygon2d.js.map +1 -1
- package/lib/cjs/numerics/Newton.js.map +1 -1
- package/lib/cjs/numerics/PascalCoefficients.js.map +1 -1
- package/lib/cjs/numerics/PolarData.js.map +1 -1
- package/lib/cjs/numerics/Polynomials.js.map +1 -1
- package/lib/cjs/numerics/Quadrature.js.map +1 -1
- package/lib/cjs/numerics/Range1dArray.js.map +1 -1
- package/lib/cjs/numerics/SmallSystem.d.ts +13 -7
- package/lib/cjs/numerics/SmallSystem.d.ts.map +1 -1
- package/lib/cjs/numerics/SmallSystem.js +13 -7
- package/lib/cjs/numerics/SmallSystem.js.map +1 -1
- package/lib/cjs/numerics/TriDiagonalSystem.js.map +1 -1
- package/lib/cjs/numerics/UnionFind.js.map +1 -1
- package/lib/cjs/numerics/UsageSums.js.map +1 -1
- package/lib/cjs/polyface/AuxData.js.map +1 -1
- package/lib/cjs/polyface/BoxTopology.js.map +1 -1
- package/lib/cjs/polyface/FacetFaceData.js.map +1 -1
- package/lib/cjs/polyface/FacetLocationDetail.js.map +1 -1
- package/lib/cjs/polyface/FacetOrientation.js.map +1 -1
- package/lib/cjs/polyface/GreedyTriangulationBetweenLineStrings.js.map +1 -1
- package/lib/cjs/polyface/IndexedEdgeMatcher.js.map +1 -1
- package/lib/cjs/polyface/IndexedPolyfaceVisitor.js.map +1 -1
- package/lib/cjs/polyface/IndexedPolyfaceWalker.js.map +1 -1
- package/lib/cjs/polyface/Polyface.d.ts +1 -3
- package/lib/cjs/polyface/Polyface.d.ts.map +1 -1
- package/lib/cjs/polyface/Polyface.js +2 -6
- package/lib/cjs/polyface/Polyface.js.map +1 -1
- package/lib/cjs/polyface/PolyfaceBuilder.d.ts +25 -6
- package/lib/cjs/polyface/PolyfaceBuilder.d.ts.map +1 -1
- package/lib/cjs/polyface/PolyfaceBuilder.js +59 -8
- package/lib/cjs/polyface/PolyfaceBuilder.js.map +1 -1
- package/lib/cjs/polyface/PolyfaceClip.js.map +1 -1
- package/lib/cjs/polyface/PolyfaceData.d.ts +2 -0
- package/lib/cjs/polyface/PolyfaceData.d.ts.map +1 -1
- package/lib/cjs/polyface/PolyfaceData.js +7 -3
- package/lib/cjs/polyface/PolyfaceData.js.map +1 -1
- package/lib/cjs/polyface/PolyfaceQuery.d.ts.map +1 -1
- package/lib/cjs/polyface/PolyfaceQuery.js +8 -10
- package/lib/cjs/polyface/PolyfaceQuery.js.map +1 -1
- package/lib/cjs/polyface/RangeLengthData.js.map +1 -1
- package/lib/cjs/polyface/RangeTree/LineString3dRangeTreeContext.js.map +1 -1
- package/lib/cjs/polyface/RangeTree/MinimumValueTester.js.map +1 -1
- package/lib/cjs/polyface/RangeTree/Point3dArrayRangeTreeContext.d.ts +8 -5
- package/lib/cjs/polyface/RangeTree/Point3dArrayRangeTreeContext.d.ts.map +1 -1
- package/lib/cjs/polyface/RangeTree/Point3dArrayRangeTreeContext.js +8 -4
- package/lib/cjs/polyface/RangeTree/Point3dArrayRangeTreeContext.js.map +1 -1
- package/lib/cjs/polyface/RangeTree/PolyfaceRangeTreeContext.d.ts +3 -3
- package/lib/cjs/polyface/RangeTree/PolyfaceRangeTreeContext.d.ts.map +1 -1
- package/lib/cjs/polyface/RangeTree/PolyfaceRangeTreeContext.js +1 -1
- package/lib/cjs/polyface/RangeTree/PolyfaceRangeTreeContext.js.map +1 -1
- package/lib/cjs/polyface/RangeTree/RangeTreeNode.d.ts +4 -2
- package/lib/cjs/polyface/RangeTree/RangeTreeNode.d.ts.map +1 -1
- package/lib/cjs/polyface/RangeTree/RangeTreeNode.js +9 -12
- package/lib/cjs/polyface/RangeTree/RangeTreeNode.js.map +1 -1
- package/lib/cjs/polyface/RangeTree/RangeTreeSearchHandlers.d.ts +8 -3
- package/lib/cjs/polyface/RangeTree/RangeTreeSearchHandlers.d.ts.map +1 -1
- package/lib/cjs/polyface/RangeTree/RangeTreeSearchHandlers.js +13 -6
- package/lib/cjs/polyface/RangeTree/RangeTreeSearchHandlers.js.map +1 -1
- package/lib/cjs/polyface/TaggedNumericData.js.map +1 -1
- package/lib/cjs/polyface/TriangleCandidate.js.map +1 -1
- package/lib/cjs/polyface/multiclip/BuildAverageNormalsContext.js.map +1 -1
- package/lib/cjs/polyface/multiclip/GriddedRaggedRange2dSet.js.map +1 -1
- package/lib/cjs/polyface/multiclip/GriddedRaggedRange2dSetWithOverflow.js.map +1 -1
- package/lib/cjs/polyface/multiclip/LinearSearchRange2dArray.js.map +1 -1
- 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.map +1 -1
- package/lib/cjs/polyface/multiclip/SweepLineStringToFacetContext.js.map +1 -1
- package/lib/cjs/polyface/multiclip/XYPointBuckets.js.map +1 -1
- package/lib/cjs/serialization/BGFBAccessors.js.map +1 -1
- package/lib/cjs/serialization/BGFBReader.js.map +1 -1
- package/lib/cjs/serialization/BGFBWriter.js.map +1 -1
- package/lib/cjs/serialization/BentleyGeometryFlatBuffer.js.map +1 -1
- package/lib/cjs/serialization/DeepCompare.js +1 -1
- package/lib/cjs/serialization/DeepCompare.js.map +1 -1
- package/lib/cjs/serialization/GeometrySamples.d.ts +2 -1
- package/lib/cjs/serialization/GeometrySamples.d.ts.map +1 -1
- package/lib/cjs/serialization/GeometrySamples.js +2 -1
- package/lib/cjs/serialization/GeometrySamples.js.map +1 -1
- package/lib/cjs/serialization/IModelJsonSchema.js.map +1 -1
- package/lib/cjs/serialization/SerializationHelpers.js.map +1 -1
- package/lib/cjs/solid/Box.js.map +1 -1
- package/lib/cjs/solid/Cone.js.map +1 -1
- package/lib/cjs/solid/LinearSweep.js.map +1 -1
- package/lib/cjs/solid/RotationalSweep.js.map +1 -1
- package/lib/cjs/solid/RuledSweep.js.map +1 -1
- package/lib/cjs/solid/SolidPrimitive.js.map +1 -1
- package/lib/cjs/solid/Sphere.js.map +1 -1
- package/lib/cjs/solid/SweepContour.js.map +1 -1
- package/lib/cjs/solid/TorusPipe.js.map +1 -1
- package/lib/cjs/topology/ChainMerge.js.map +1 -1
- package/lib/cjs/topology/Graph.d.ts +38 -12
- package/lib/cjs/topology/Graph.d.ts.map +1 -1
- package/lib/cjs/topology/Graph.js +91 -23
- package/lib/cjs/topology/Graph.js.map +1 -1
- package/lib/cjs/topology/HalfEdgeGraphFromIndexedLoopsContext.d.ts +5 -4
- package/lib/cjs/topology/HalfEdgeGraphFromIndexedLoopsContext.d.ts.map +1 -1
- package/lib/cjs/topology/HalfEdgeGraphFromIndexedLoopsContext.js +6 -5
- package/lib/cjs/topology/HalfEdgeGraphFromIndexedLoopsContext.js.map +1 -1
- package/lib/cjs/topology/HalfEdgeGraphSearch.d.ts +20 -11
- package/lib/cjs/topology/HalfEdgeGraphSearch.d.ts.map +1 -1
- package/lib/cjs/topology/HalfEdgeGraphSearch.js +43 -39
- package/lib/cjs/topology/HalfEdgeGraphSearch.js.map +1 -1
- package/lib/cjs/topology/HalfEdgeGraphSpineContext.js.map +1 -1
- package/lib/cjs/topology/HalfEdgeGraphValidation.js.map +1 -1
- package/lib/cjs/topology/HalfEdgeMarkSet.js.map +1 -1
- package/lib/cjs/topology/HalfEdgeNodeXYZUV.js.map +1 -1
- package/lib/cjs/topology/HalfEdgePointInGraphSearch.js.map +1 -1
- package/lib/cjs/topology/HalfEdgePositionDetail.js.map +1 -1
- package/lib/cjs/topology/HalfEdgePriorityQueue.js.map +1 -1
- package/lib/cjs/topology/InsertAndRetriangulateContext.js.map +1 -1
- package/lib/cjs/topology/MaskManager.js.map +1 -1
- package/lib/cjs/topology/Merging.d.ts +7 -4
- package/lib/cjs/topology/Merging.d.ts.map +1 -1
- package/lib/cjs/topology/Merging.js +16 -11
- package/lib/cjs/topology/Merging.js.map +1 -1
- package/lib/cjs/topology/RegularizeFace.js.map +1 -1
- package/lib/cjs/topology/SignedDataSummary.js.map +1 -1
- package/lib/cjs/topology/SpaceTriangulation.js.map +1 -1
- package/lib/cjs/topology/Triangulation.d.ts +13 -11
- package/lib/cjs/topology/Triangulation.d.ts.map +1 -1
- package/lib/cjs/topology/Triangulation.js +40 -36
- package/lib/cjs/topology/Triangulation.js.map +1 -1
- package/lib/cjs/topology/Voronoi.d.ts +195 -0
- package/lib/cjs/topology/Voronoi.d.ts.map +1 -0
- package/lib/cjs/topology/Voronoi.js +700 -0
- package/lib/cjs/topology/Voronoi.js.map +1 -0
- package/lib/cjs/topology/XYParitySearchContext.d.ts +1 -1
- package/lib/cjs/topology/XYParitySearchContext.d.ts.map +1 -1
- package/lib/cjs/topology/XYParitySearchContext.js.map +1 -1
- package/lib/esm/Constant.js.map +1 -1
- package/lib/esm/Geometry.d.ts +30 -10
- package/lib/esm/Geometry.d.ts.map +1 -1
- package/lib/esm/Geometry.js +74 -10
- package/lib/esm/Geometry.js.map +1 -1
- package/lib/esm/bspline/AkimaCurve3d.d.ts +19 -6
- package/lib/esm/bspline/AkimaCurve3d.d.ts.map +1 -1
- package/lib/esm/bspline/AkimaCurve3d.js +21 -5
- package/lib/esm/bspline/AkimaCurve3d.js.map +1 -1
- package/lib/esm/bspline/BSpline1dNd.js.map +1 -1
- package/lib/esm/bspline/BSplineCurve.d.ts +3 -3
- package/lib/esm/bspline/BSplineCurve.d.ts.map +1 -1
- package/lib/esm/bspline/BSplineCurve.js +6 -6
- package/lib/esm/bspline/BSplineCurve.js.map +1 -1
- 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 +1 -1
- package/lib/esm/bspline/BSplineCurveOps.js.map +1 -1
- package/lib/esm/bspline/BSplineSurface.js.map +1 -1
- package/lib/esm/bspline/Bezier1dNd.js.map +1 -1
- package/lib/esm/bspline/BezierCurve3d.js.map +1 -1
- package/lib/esm/bspline/BezierCurve3dH.js.map +1 -1
- package/lib/esm/bspline/BezierCurveBase.d.ts +2 -2
- package/lib/esm/bspline/BezierCurveBase.d.ts.map +1 -1
- package/lib/esm/bspline/BezierCurveBase.js +4 -6
- package/lib/esm/bspline/BezierCurveBase.js.map +1 -1
- package/lib/esm/bspline/InterpolationCurve3d.d.ts +27 -17
- package/lib/esm/bspline/InterpolationCurve3d.d.ts.map +1 -1
- package/lib/esm/bspline/InterpolationCurve3d.js +17 -7
- package/lib/esm/bspline/InterpolationCurve3d.js.map +1 -1
- package/lib/esm/bspline/KnotVector.js.map +1 -1
- package/lib/esm/bspline/SurfaceLocationDetail.js.map +1 -1
- package/lib/esm/clipping/AlternatingConvexClipTree.js.map +1 -1
- package/lib/esm/clipping/BooleanClipFactory.js.map +1 -1
- package/lib/esm/clipping/BooleanClipNode.js.map +1 -1
- package/lib/esm/clipping/ClipPlane.d.ts +19 -6
- package/lib/esm/clipping/ClipPlane.d.ts.map +1 -1
- package/lib/esm/clipping/ClipPlane.js +17 -2
- package/lib/esm/clipping/ClipPlane.js.map +1 -1
- package/lib/esm/clipping/ClipPrimitive.js.map +1 -1
- package/lib/esm/clipping/ClipUtils.d.ts +14 -1
- package/lib/esm/clipping/ClipUtils.d.ts.map +1 -1
- package/lib/esm/clipping/ClipUtils.js +21 -3
- package/lib/esm/clipping/ClipUtils.js.map +1 -1
- package/lib/esm/clipping/ClipVector.js.map +1 -1
- package/lib/esm/clipping/ConvexClipPlaneSet.d.ts +14 -11
- package/lib/esm/clipping/ConvexClipPlaneSet.d.ts.map +1 -1
- package/lib/esm/clipping/ConvexClipPlaneSet.js +23 -16
- package/lib/esm/clipping/ConvexClipPlaneSet.js.map +1 -1
- package/lib/esm/clipping/UnionOfConvexClipPlaneSets.d.ts +20 -3
- package/lib/esm/clipping/UnionOfConvexClipPlaneSets.d.ts.map +1 -1
- package/lib/esm/clipping/UnionOfConvexClipPlaneSets.js +22 -5
- package/lib/esm/clipping/UnionOfConvexClipPlaneSets.js.map +1 -1
- package/lib/esm/clipping/internalContexts/LineStringOffsetClipperContext.js.map +1 -1
- package/lib/esm/core-geometry.js.map +1 -1
- package/lib/esm/curve/Arc3d.d.ts +27 -17
- package/lib/esm/curve/Arc3d.d.ts.map +1 -1
- package/lib/esm/curve/Arc3d.js +61 -35
- package/lib/esm/curve/Arc3d.js.map +1 -1
- package/lib/esm/curve/ConstructCurveBetweenCurves.js.map +1 -1
- package/lib/esm/curve/CoordinateXYZ.js.map +1 -1
- package/lib/esm/curve/CurveChainWithDistanceIndex.js.map +1 -1
- package/lib/esm/curve/CurveCollection.d.ts +1 -0
- package/lib/esm/curve/CurveCollection.d.ts.map +1 -1
- package/lib/esm/curve/CurveCollection.js +1 -0
- 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.js.map +1 -1
- package/lib/esm/curve/CurveLocationDetail.d.ts +8 -7
- package/lib/esm/curve/CurveLocationDetail.d.ts.map +1 -1
- package/lib/esm/curve/CurveLocationDetail.js.map +1 -1
- package/lib/esm/curve/CurveOps.d.ts +51 -1
- package/lib/esm/curve/CurveOps.d.ts.map +1 -1
- package/lib/esm/curve/CurveOps.js +98 -4
- package/lib/esm/curve/CurveOps.js.map +1 -1
- package/lib/esm/curve/CurvePrimitive.js.map +1 -1
- package/lib/esm/curve/CurveProcessor.js.map +1 -1
- package/lib/esm/curve/CurveTypes.js.map +1 -1
- package/lib/esm/curve/CurveWireMomentsXYZ.js.map +1 -1
- package/lib/esm/curve/GeometryQuery.js.map +1 -1
- package/lib/esm/curve/LineSegment3d.js.map +1 -1
- package/lib/esm/curve/LineString3d.d.ts +4 -4
- package/lib/esm/curve/LineString3d.d.ts.map +1 -1
- package/lib/esm/curve/LineString3d.js +8 -8
- package/lib/esm/curve/LineString3d.js.map +1 -1
- package/lib/esm/curve/Loop.js.map +1 -1
- package/lib/esm/curve/OffsetOptions.js.map +1 -1
- package/lib/esm/curve/ParityRegion.js.map +1 -1
- package/lib/esm/curve/Path.js.map +1 -1
- package/lib/esm/curve/PointString3d.js.map +1 -1
- package/lib/esm/curve/ProxyCurve.js.map +1 -1
- package/lib/esm/curve/Query/ConsolidateAdjacentPrimitivesContext.js +3 -3
- package/lib/esm/curve/Query/ConsolidateAdjacentPrimitivesContext.js.map +1 -1
- package/lib/esm/curve/Query/CurveSplitContext.js.map +1 -1
- 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.d.ts +6 -2
- package/lib/esm/curve/Query/PlanarSubdivision.d.ts.map +1 -1
- package/lib/esm/curve/Query/PlanarSubdivision.js +12 -7
- package/lib/esm/curve/Query/PlanarSubdivision.js.map +1 -1
- package/lib/esm/curve/Query/StrokeCountChain.js.map +1 -1
- package/lib/esm/curve/Query/StrokeCountMap.js.map +1 -1
- package/lib/esm/curve/RegionMomentsXY.js.map +1 -1
- package/lib/esm/curve/RegionOps.d.ts +9 -4
- package/lib/esm/curve/RegionOps.d.ts.map +1 -1
- package/lib/esm/curve/RegionOps.js +10 -5
- package/lib/esm/curve/RegionOps.js.map +1 -1
- package/lib/esm/curve/RegionOpsClassificationSweeps.js.map +1 -1
- package/lib/esm/curve/StrokeOptions.js.map +1 -1
- package/lib/esm/curve/UnionRegion.js.map +1 -1
- package/lib/esm/curve/internalContexts/AnnounceTangentStrokeHandler.js.map +1 -1
- package/lib/esm/curve/internalContexts/AppendPlaneIntersectionStrokeHandler.js.map +1 -1
- package/lib/esm/curve/internalContexts/ChainCollectorContext.js.map +1 -1
- 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.map +1 -1
- package/lib/esm/curve/internalContexts/CountLinearPartsSearchContext.js.map +1 -1
- package/lib/esm/curve/internalContexts/CurveCurveCloseApproachXY.js.map +1 -1
- package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.d.ts.map +1 -1
- package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.js +2 -1
- package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.js.map +1 -1
- package/lib/esm/curve/internalContexts/CurveCurveIntersectXYZ.js.map +1 -1
- package/lib/esm/curve/internalContexts/CurveLengthContext.js.map +1 -1
- package/lib/esm/curve/internalContexts/CurveOffsetXYHandler.js.map +1 -1
- package/lib/esm/curve/internalContexts/EllipticalArcApproximationContext.js.map +1 -1
- package/lib/esm/curve/internalContexts/GapSearchContext.js.map +1 -1
- package/lib/esm/curve/internalContexts/MultiChainCollector.d.ts +4 -4
- package/lib/esm/curve/internalContexts/MultiChainCollector.d.ts.map +1 -1
- package/lib/esm/curve/internalContexts/MultiChainCollector.js +21 -18
- package/lib/esm/curve/internalContexts/MultiChainCollector.js.map +1 -1
- package/lib/esm/curve/internalContexts/NewtonRtoRStrokeHandler.js.map +1 -1
- package/lib/esm/curve/internalContexts/PlaneAltitudeRangeContext.js.map +1 -1
- package/lib/esm/curve/internalContexts/PolygonOffsetContext.d.ts.map +1 -1
- package/lib/esm/curve/internalContexts/PolygonOffsetContext.js +30 -50
- package/lib/esm/curve/internalContexts/PolygonOffsetContext.js.map +1 -1
- package/lib/esm/curve/internalContexts/SumLengthsContext.js.map +1 -1
- package/lib/esm/curve/internalContexts/TransferWithSplitArcs.js.map +1 -1
- package/lib/esm/curve/internalContexts/TransformInPlaceContext.js.map +1 -1
- package/lib/esm/curve/spiral/AustralianRailCorpXYEvaluator.js.map +1 -1
- package/lib/esm/curve/spiral/ClothoidSeries.js.map +1 -1
- package/lib/esm/curve/spiral/CubicEvaluator.js.map +1 -1
- package/lib/esm/curve/spiral/CzechSpiralEvaluator.js.map +1 -1
- package/lib/esm/curve/spiral/DirectHalfCosineSpiralEvaluator.js.map +1 -1
- package/lib/esm/curve/spiral/DirectSpiral3d.d.ts +2 -2
- package/lib/esm/curve/spiral/DirectSpiral3d.d.ts.map +1 -1
- package/lib/esm/curve/spiral/DirectSpiral3d.js +6 -2
- package/lib/esm/curve/spiral/DirectSpiral3d.js.map +1 -1
- package/lib/esm/curve/spiral/IntegratedSpiral3d.d.ts +2 -2
- package/lib/esm/curve/spiral/IntegratedSpiral3d.d.ts.map +1 -1
- package/lib/esm/curve/spiral/IntegratedSpiral3d.js +6 -2
- package/lib/esm/curve/spiral/IntegratedSpiral3d.js.map +1 -1
- package/lib/esm/curve/spiral/MXCubicAlongArcSpiralEvaluator.js.map +1 -1
- package/lib/esm/curve/spiral/NormalizedTransition.js.map +1 -1
- package/lib/esm/curve/spiral/PolishCubicSpiralEvaluator.js.map +1 -1
- package/lib/esm/curve/spiral/TransitionConditionalProperties.js.map +1 -1
- package/lib/esm/curve/spiral/TransitionSpiral3d.d.ts +5 -1
- package/lib/esm/curve/spiral/TransitionSpiral3d.d.ts.map +1 -1
- package/lib/esm/curve/spiral/TransitionSpiral3d.js +0 -3
- package/lib/esm/curve/spiral/TransitionSpiral3d.js.map +1 -1
- package/lib/esm/curve/spiral/XYCurveEvaluator.js.map +1 -1
- package/lib/esm/geometry3d/Angle.js.map +1 -1
- package/lib/esm/geometry3d/AngleSweep.d.ts +6 -2
- package/lib/esm/geometry3d/AngleSweep.d.ts.map +1 -1
- package/lib/esm/geometry3d/AngleSweep.js +12 -3
- package/lib/esm/geometry3d/AngleSweep.js.map +1 -1
- package/lib/esm/geometry3d/BarycentricTriangle.js.map +1 -1
- package/lib/esm/geometry3d/BilinearPatch.js.map +1 -1
- package/lib/esm/geometry3d/CoincidentGeometryOps.js.map +1 -1
- package/lib/esm/geometry3d/Ellipsoid.js.map +1 -1
- package/lib/esm/geometry3d/FrameBuilder.d.ts +2 -1
- package/lib/esm/geometry3d/FrameBuilder.d.ts.map +1 -1
- package/lib/esm/geometry3d/FrameBuilder.js +14 -18
- package/lib/esm/geometry3d/FrameBuilder.js.map +1 -1
- package/lib/esm/geometry3d/FrustumAnimation.js.map +1 -1
- package/lib/esm/geometry3d/GeometryHandler.js.map +1 -1
- package/lib/esm/geometry3d/GrowableBlockedArray.js.map +1 -1
- package/lib/esm/geometry3d/GrowableFloat64Array.js.map +1 -1
- package/lib/esm/geometry3d/GrowableXYArray.js.map +1 -1
- package/lib/esm/geometry3d/GrowableXYZArray.js.map +1 -1
- package/lib/esm/geometry3d/IndexedCollectionInterval.js.map +1 -1
- package/lib/esm/geometry3d/IndexedXYCollection.js.map +1 -1
- package/lib/esm/geometry3d/IndexedXYZCollection.js.map +1 -1
- package/lib/esm/geometry3d/LongitudeLatitudeAltitude.js.map +1 -1
- package/lib/esm/geometry3d/Matrix3d.d.ts +1 -1
- package/lib/esm/geometry3d/Matrix3d.js +1 -1
- package/lib/esm/geometry3d/Matrix3d.js.map +1 -1
- package/lib/esm/geometry3d/OrderedRotationAngles.js.map +1 -1
- package/lib/esm/geometry3d/Plane3d.js.map +1 -1
- package/lib/esm/geometry3d/Plane3dByOriginAndUnitNormal.js.map +1 -1
- package/lib/esm/geometry3d/Plane3dByOriginAndVectors.js.map +1 -1
- package/lib/esm/geometry3d/Point2dArrayCarrier.js.map +1 -1
- package/lib/esm/geometry3d/Point2dVector2d.d.ts +18 -2
- package/lib/esm/geometry3d/Point2dVector2d.d.ts.map +1 -1
- package/lib/esm/geometry3d/Point2dVector2d.js +37 -4
- package/lib/esm/geometry3d/Point2dVector2d.js.map +1 -1
- package/lib/esm/geometry3d/Point3dArrayCarrier.js.map +1 -1
- package/lib/esm/geometry3d/Point3dVector3d.d.ts +1 -1
- package/lib/esm/geometry3d/Point3dVector3d.d.ts.map +1 -1
- package/lib/esm/geometry3d/Point3dVector3d.js +1 -0
- package/lib/esm/geometry3d/Point3dVector3d.js.map +1 -1
- package/lib/esm/geometry3d/PointHelpers.js.map +1 -1
- package/lib/esm/geometry3d/PointStreaming.d.ts +8 -0
- package/lib/esm/geometry3d/PointStreaming.d.ts.map +1 -1
- package/lib/esm/geometry3d/PointStreaming.js +18 -2
- package/lib/esm/geometry3d/PointStreaming.js.map +1 -1
- package/lib/esm/geometry3d/PolygonOps.d.ts +18 -9
- package/lib/esm/geometry3d/PolygonOps.d.ts.map +1 -1
- package/lib/esm/geometry3d/PolygonOps.js +53 -26
- package/lib/esm/geometry3d/PolygonOps.js.map +1 -1
- package/lib/esm/geometry3d/PolylineCompressionByEdgeOffset.d.ts +8 -2
- package/lib/esm/geometry3d/PolylineCompressionByEdgeOffset.d.ts.map +1 -1
- package/lib/esm/geometry3d/PolylineCompressionByEdgeOffset.js +10 -4
- package/lib/esm/geometry3d/PolylineCompressionByEdgeOffset.js.map +1 -1
- package/lib/esm/geometry3d/PolylineOps.d.ts +14 -3
- package/lib/esm/geometry3d/PolylineOps.d.ts.map +1 -1
- package/lib/esm/geometry3d/PolylineOps.js +20 -4
- package/lib/esm/geometry3d/PolylineOps.js.map +1 -1
- package/lib/esm/geometry3d/Range.d.ts +34 -32
- package/lib/esm/geometry3d/Range.d.ts.map +1 -1
- package/lib/esm/geometry3d/Range.js +28 -21
- package/lib/esm/geometry3d/Range.js.map +1 -1
- package/lib/esm/geometry3d/Ray2d.d.ts +16 -6
- package/lib/esm/geometry3d/Ray2d.d.ts.map +1 -1
- package/lib/esm/geometry3d/Ray2d.js +28 -4
- package/lib/esm/geometry3d/Ray2d.js.map +1 -1
- package/lib/esm/geometry3d/Ray3d.d.ts.map +1 -1
- package/lib/esm/geometry3d/Ray3d.js +3 -4
- package/lib/esm/geometry3d/Ray3d.js.map +1 -1
- package/lib/esm/geometry3d/ReusableObjectCache.js.map +1 -1
- package/lib/esm/geometry3d/Segment1d.js.map +1 -1
- package/lib/esm/geometry3d/SortablePolygon.js.map +1 -1
- package/lib/esm/geometry3d/Transform.d.ts +1 -1
- package/lib/esm/geometry3d/Transform.js +1 -1
- package/lib/esm/geometry3d/Transform.js.map +1 -1
- package/lib/esm/geometry3d/UVSurfaceOps.js.map +1 -1
- package/lib/esm/geometry3d/XYZProps.d.ts +12 -1
- package/lib/esm/geometry3d/XYZProps.d.ts.map +1 -1
- package/lib/esm/geometry3d/XYZProps.js +16 -1
- package/lib/esm/geometry3d/XYZProps.js.map +1 -1
- package/lib/esm/geometry3d/YawPitchRollAngles.js.map +1 -1
- package/lib/esm/geometry4d/Map4d.js.map +1 -1
- package/lib/esm/geometry4d/Matrix4d.d.ts +16 -0
- package/lib/esm/geometry4d/Matrix4d.d.ts.map +1 -1
- package/lib/esm/geometry4d/Matrix4d.js +26 -0
- package/lib/esm/geometry4d/Matrix4d.js.map +1 -1
- package/lib/esm/geometry4d/MomentData.js.map +1 -1
- package/lib/esm/geometry4d/PlaneByOriginAndVectors4d.js.map +1 -1
- package/lib/esm/geometry4d/Point4d.js.map +1 -1
- package/lib/esm/numerics/BandedSystem.js.map +1 -1
- package/lib/esm/numerics/BezierPolynomials.d.ts.map +1 -1
- package/lib/esm/numerics/BezierPolynomials.js +5 -9
- package/lib/esm/numerics/BezierPolynomials.js.map +1 -1
- package/lib/esm/numerics/ClusterableArray.js.map +1 -1
- package/lib/esm/numerics/Complex.js.map +1 -1
- package/lib/esm/numerics/ConvexPolygon2d.js.map +1 -1
- package/lib/esm/numerics/Newton.js.map +1 -1
- package/lib/esm/numerics/PascalCoefficients.js.map +1 -1
- package/lib/esm/numerics/PolarData.js.map +1 -1
- package/lib/esm/numerics/Polynomials.js.map +1 -1
- package/lib/esm/numerics/Quadrature.js.map +1 -1
- package/lib/esm/numerics/Range1dArray.js.map +1 -1
- package/lib/esm/numerics/SmallSystem.d.ts +13 -7
- package/lib/esm/numerics/SmallSystem.d.ts.map +1 -1
- package/lib/esm/numerics/SmallSystem.js +13 -7
- package/lib/esm/numerics/SmallSystem.js.map +1 -1
- package/lib/esm/numerics/TriDiagonalSystem.js.map +1 -1
- package/lib/esm/numerics/UnionFind.js.map +1 -1
- package/lib/esm/numerics/UsageSums.js.map +1 -1
- package/lib/esm/polyface/AuxData.js.map +1 -1
- package/lib/esm/polyface/BoxTopology.js.map +1 -1
- package/lib/esm/polyface/FacetFaceData.js.map +1 -1
- package/lib/esm/polyface/FacetLocationDetail.js.map +1 -1
- package/lib/esm/polyface/FacetOrientation.js.map +1 -1
- package/lib/esm/polyface/GreedyTriangulationBetweenLineStrings.js.map +1 -1
- package/lib/esm/polyface/IndexedEdgeMatcher.js.map +1 -1
- package/lib/esm/polyface/IndexedPolyfaceVisitor.js.map +1 -1
- package/lib/esm/polyface/IndexedPolyfaceWalker.js.map +1 -1
- package/lib/esm/polyface/Polyface.d.ts +1 -3
- package/lib/esm/polyface/Polyface.d.ts.map +1 -1
- package/lib/esm/polyface/Polyface.js +2 -6
- package/lib/esm/polyface/Polyface.js.map +1 -1
- package/lib/esm/polyface/PolyfaceBuilder.d.ts +25 -6
- package/lib/esm/polyface/PolyfaceBuilder.d.ts.map +1 -1
- package/lib/esm/polyface/PolyfaceBuilder.js +59 -8
- package/lib/esm/polyface/PolyfaceBuilder.js.map +1 -1
- package/lib/esm/polyface/PolyfaceClip.js.map +1 -1
- package/lib/esm/polyface/PolyfaceData.d.ts +2 -0
- package/lib/esm/polyface/PolyfaceData.d.ts.map +1 -1
- package/lib/esm/polyface/PolyfaceData.js +7 -3
- package/lib/esm/polyface/PolyfaceData.js.map +1 -1
- package/lib/esm/polyface/PolyfaceQuery.d.ts.map +1 -1
- package/lib/esm/polyface/PolyfaceQuery.js +8 -10
- package/lib/esm/polyface/PolyfaceQuery.js.map +1 -1
- package/lib/esm/polyface/RangeLengthData.js.map +1 -1
- package/lib/esm/polyface/RangeTree/LineString3dRangeTreeContext.js.map +1 -1
- package/lib/esm/polyface/RangeTree/MinimumValueTester.js.map +1 -1
- package/lib/esm/polyface/RangeTree/Point3dArrayRangeTreeContext.d.ts +8 -5
- package/lib/esm/polyface/RangeTree/Point3dArrayRangeTreeContext.d.ts.map +1 -1
- package/lib/esm/polyface/RangeTree/Point3dArrayRangeTreeContext.js +8 -4
- package/lib/esm/polyface/RangeTree/Point3dArrayRangeTreeContext.js.map +1 -1
- package/lib/esm/polyface/RangeTree/PolyfaceRangeTreeContext.d.ts +3 -3
- package/lib/esm/polyface/RangeTree/PolyfaceRangeTreeContext.d.ts.map +1 -1
- package/lib/esm/polyface/RangeTree/PolyfaceRangeTreeContext.js +1 -1
- package/lib/esm/polyface/RangeTree/PolyfaceRangeTreeContext.js.map +1 -1
- package/lib/esm/polyface/RangeTree/RangeTreeNode.d.ts +4 -2
- package/lib/esm/polyface/RangeTree/RangeTreeNode.d.ts.map +1 -1
- package/lib/esm/polyface/RangeTree/RangeTreeNode.js +9 -12
- package/lib/esm/polyface/RangeTree/RangeTreeNode.js.map +1 -1
- package/lib/esm/polyface/RangeTree/RangeTreeSearchHandlers.d.ts +8 -3
- package/lib/esm/polyface/RangeTree/RangeTreeSearchHandlers.d.ts.map +1 -1
- package/lib/esm/polyface/RangeTree/RangeTreeSearchHandlers.js +13 -6
- package/lib/esm/polyface/RangeTree/RangeTreeSearchHandlers.js.map +1 -1
- package/lib/esm/polyface/TaggedNumericData.js.map +1 -1
- package/lib/esm/polyface/TriangleCandidate.js.map +1 -1
- package/lib/esm/polyface/multiclip/BuildAverageNormalsContext.js.map +1 -1
- package/lib/esm/polyface/multiclip/GriddedRaggedRange2dSet.js.map +1 -1
- package/lib/esm/polyface/multiclip/GriddedRaggedRange2dSetWithOverflow.js.map +1 -1
- package/lib/esm/polyface/multiclip/LinearSearchRange2dArray.js.map +1 -1
- 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.map +1 -1
- package/lib/esm/polyface/multiclip/SweepLineStringToFacetContext.js.map +1 -1
- package/lib/esm/polyface/multiclip/XYPointBuckets.js.map +1 -1
- package/lib/esm/serialization/BGFBAccessors.js.map +1 -1
- package/lib/esm/serialization/BGFBReader.js.map +1 -1
- package/lib/esm/serialization/BGFBWriter.js.map +1 -1
- package/lib/esm/serialization/BentleyGeometryFlatBuffer.js.map +1 -1
- package/lib/esm/serialization/DeepCompare.js +1 -1
- package/lib/esm/serialization/DeepCompare.js.map +1 -1
- package/lib/esm/serialization/GeometrySamples.d.ts +2 -1
- package/lib/esm/serialization/GeometrySamples.d.ts.map +1 -1
- package/lib/esm/serialization/GeometrySamples.js +2 -1
- package/lib/esm/serialization/GeometrySamples.js.map +1 -1
- package/lib/esm/serialization/IModelJsonSchema.js.map +1 -1
- package/lib/esm/serialization/SerializationHelpers.js.map +1 -1
- package/lib/esm/solid/Box.js.map +1 -1
- package/lib/esm/solid/Cone.js.map +1 -1
- package/lib/esm/solid/LinearSweep.js.map +1 -1
- package/lib/esm/solid/RotationalSweep.js.map +1 -1
- package/lib/esm/solid/RuledSweep.js.map +1 -1
- package/lib/esm/solid/SolidPrimitive.js.map +1 -1
- package/lib/esm/solid/Sphere.js.map +1 -1
- package/lib/esm/solid/SweepContour.js.map +1 -1
- package/lib/esm/solid/TorusPipe.js.map +1 -1
- package/lib/esm/topology/ChainMerge.js.map +1 -1
- package/lib/esm/topology/Graph.d.ts +38 -12
- package/lib/esm/topology/Graph.d.ts.map +1 -1
- package/lib/esm/topology/Graph.js +92 -24
- package/lib/esm/topology/Graph.js.map +1 -1
- package/lib/esm/topology/HalfEdgeGraphFromIndexedLoopsContext.d.ts +5 -4
- package/lib/esm/topology/HalfEdgeGraphFromIndexedLoopsContext.d.ts.map +1 -1
- package/lib/esm/topology/HalfEdgeGraphFromIndexedLoopsContext.js +6 -5
- package/lib/esm/topology/HalfEdgeGraphFromIndexedLoopsContext.js.map +1 -1
- package/lib/esm/topology/HalfEdgeGraphSearch.d.ts +20 -11
- package/lib/esm/topology/HalfEdgeGraphSearch.d.ts.map +1 -1
- package/lib/esm/topology/HalfEdgeGraphSearch.js +43 -39
- package/lib/esm/topology/HalfEdgeGraphSearch.js.map +1 -1
- package/lib/esm/topology/HalfEdgeGraphSpineContext.js.map +1 -1
- package/lib/esm/topology/HalfEdgeGraphValidation.js.map +1 -1
- package/lib/esm/topology/HalfEdgeMarkSet.js.map +1 -1
- package/lib/esm/topology/HalfEdgeNodeXYZUV.js.map +1 -1
- package/lib/esm/topology/HalfEdgePointInGraphSearch.js.map +1 -1
- package/lib/esm/topology/HalfEdgePositionDetail.js.map +1 -1
- package/lib/esm/topology/HalfEdgePriorityQueue.js.map +1 -1
- package/lib/esm/topology/InsertAndRetriangulateContext.js.map +1 -1
- package/lib/esm/topology/MaskManager.js.map +1 -1
- package/lib/esm/topology/Merging.d.ts +7 -4
- package/lib/esm/topology/Merging.d.ts.map +1 -1
- package/lib/esm/topology/Merging.js +17 -12
- package/lib/esm/topology/Merging.js.map +1 -1
- package/lib/esm/topology/RegularizeFace.js.map +1 -1
- package/lib/esm/topology/SignedDataSummary.js.map +1 -1
- package/lib/esm/topology/SpaceTriangulation.js.map +1 -1
- package/lib/esm/topology/Triangulation.d.ts +13 -11
- package/lib/esm/topology/Triangulation.d.ts.map +1 -1
- package/lib/esm/topology/Triangulation.js +40 -36
- package/lib/esm/topology/Triangulation.js.map +1 -1
- package/lib/esm/topology/Voronoi.d.ts +195 -0
- package/lib/esm/topology/Voronoi.d.ts.map +1 -0
- package/lib/esm/topology/Voronoi.js +696 -0
- package/lib/esm/topology/Voronoi.js.map +1 -0
- package/lib/esm/topology/XYParitySearchContext.d.ts +1 -1
- package/lib/esm/topology/XYParitySearchContext.d.ts.map +1 -1
- package/lib/esm/topology/XYParitySearchContext.js.map +1 -1
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Graph.js","sourceRoot":"","sources":["../../../src/topology/Graph.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F;;GAEG;AAEH,sDAAiD;AACjD,0DAAuD;AACvD,0CAAuC;AACvC,+CAA4C;AAC5C,mEAAkE;AAClE,mEAAkE;AAGlE,yDAAsD;AACtD,+CAA4C;AAE5C,oFAAoF;AAEpF,qDAAqD;AAErD;;;;;;;;;;;GAWG;AACH,IAAY,YAuCX;AAvCD,WAAY,YAAY;IACtB;;;;;MAKE;IACF,+DAA+D;IAC/D,uDAAqB,CAAA;IACrB;;;;OAIG;IACH,+DAA+D;IAC/D,iEAA0B,CAAA;IAC1B;;;;;OAKG;IACH,+DAAyB,CAAA;IACzB,iFAAiF;IACjF,6DAAwB,CAAA;IACxB,2EAA2E;IAC3E,wEAA6B,CAAA;IAC7B,wDAAwD;IACxD,2EAA8B,CAAA;IAC9B,2CAA2C;IAC3C,2DAAsB,CAAA;IACtB,uFAAuF;IACvF,yDAAoB,CAAA;IACpB,oBAAoB;IACpB,yDAAsB,CAAA;IACtB,oEAAoE;IACpE,sFAAgC,CAAA;IAChC,oBAAoB;IACpB,gEAAqB,CAAA;AACvB,CAAC,EAvCW,YAAY,4BAAZ,YAAY,QAuCvB;AAiDD;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAa,QAAQ;IACnB,sDAAsD;IAC/C,CAAC,CAAS;IACjB;;;;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,CAAC;QAC1C,IAAI,WAAW,GAAG,CAAC,CAAC;QACpB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,QAAQ,EAAE,CAAC,EAAE,EAAE,CAAC;YAClC,MAAM,SAAS,GAAG,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;YACvC,IAAI,CAAC,SAAS,CAAC,cAAc,EAAE,CAAC;gBAC9B,IAAI,CAAC,YAAY,CAAC,WAAW,EAAE,CAAC,GAAG,SAAS,CAAC;YAC/C,CAAC;QACH,CAAC;QACD,MAAM,UAAU,GAAG,QAAQ,GAAG,WAAW,CAAC;QAC1C,IAAI,CAAC,YAAY,CAAC,MAAM,GAAG,WAAW,CAAC;QACvC,OAAO,UAAU,CAAC;IACpB,CAAC;CACF;AAnXD,sCAmXC","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 Topology\n */\n\nimport { OrderedSet } from \"@itwin/core-bentley\";\nimport { LineSegment3d } from \"../curve/LineSegment3d\";\nimport { Geometry } from \"../Geometry\";\nimport { Angle } from \"../geometry3d/Angle\";\nimport { Point2d, Vector2d } from \"../geometry3d/Point2dVector2d\";\nimport { Point3d, Vector3d } from \"../geometry3d/Point3dVector3d\";\nimport { Transform } from \"../geometry3d/Transform\";\nimport { WritableXYAndZ, XAndY, XYAndZ } from \"../geometry3d/XYZProps\";\nimport { SmallSystem } from \"../numerics/SmallSystem\";\nimport { MaskManager } from \"./MaskManager\";\n\n// import { GraphChecker } from \"../test/topology/Graph.test\"; // used for debugging\n\n/* eslint-disable @typescript-eslint/no-this-alias */\n\n/**\n * * Each node of the graph has a mask member.\n * * The mask member is a number which is used as set of single bit boolean values.\n * * Particular meanings of the various bits are HIGHLY application dependent.\n * * The EXTERIOR mask bit is widely used to mark nodes that are \"outside\" the active areas\n * * The PRIMARY_EDGE bit is widely used to indicate linework created directly from input data, hence protected from\n * triangle edge flipping.\n * * The BOUNDARY bit is widely used to indicate that crossing this edge is a transition from outside to inside.\n * * VISITED is used locally in many searches.\n * * Never use VISITED unless the search logic is highly self contained.\n * @internal\n */\nexport enum HalfEdgeMask {\n /**\n * Mask commonly set consistently around exterior faces.\n * * A boundary edge with interior to one side, exterior to the other, will have EXTERIOR only on the outside.\n * * An edge inserted \"within a purely exterior face\" can have EXTERIOR on both sides.\n * * An interior edge (such as added during triangulation) will have no EXTERIOR bits.\n */\n // Visualization can be found at geometry/internaldocs/Graph.md\n EXTERIOR = 0x00000001,\n /**\n * Mask commonly set (on both sides) of original geometry edges that are transition from outside to inside.\n * * At the moment of creating an edge from primary user boundary loop coordinates, the fact that an edge is BOUNDARY\n * is often clear even though there is uncertainty about which side should be EXTERIOR.\n */\n // Visualization can be found at geometry/internaldocs/Graph.md\n BOUNDARY_EDGE = 0x00000002,\n /**\n * Mask commonly set (on both sides) of original geometry edges, but NOT indicating that the edge is certainly a\n * boundary between outside and inside.\n * * For instance, if geometry is provided as stray sticks (not loops), it can be marked PRIMARY_EDGE but neither\n * BOUNDARY_EDGE nor EXTERIOR_EDGE.\n */\n PRIMARY_EDGE = 0x00000004,\n /** Mask set on both sides of a bridge edge added by algorithms to join loops. */\n BRIDGE_EDGE = 0x00000008,\n /** Mask set on both sides of an edge added during graph regularization. */\n REGULARIZED_EDGE = 0x00000010,\n /** Mask applied to triangles by earcut triangulator. */\n TRIANGULATED_FACE = 0x00000100,\n /** Mask applied in a face with 2 edges. */\n NULL_FACE = 0x00000200,\n /** Temporary mask used for low level searches to identify previously-visited nodes. */\n VISITED = 0x00010000,\n /** No mask bits. */\n NULL_MASK = 0x00000000,\n /** The \"upper 12\" bits of 32 bit integer reserved for grab/drop. */\n ALL_GRAB_DROP_MASKS = 0xFFF00000,\n /** All mask bits */\n ALL_MASK = 0xFFFFFFFF,\n}\n\n/**\n * Function signature for function of one node with no return type restrictions.\n * @internal\n */\nexport type NodeFunction = (node: HalfEdge) => any;\n/**\n * Function signature for function of one node, returning a number.\n * @internal\n */\nexport type NodeToNumberFunction = (node: HalfEdge) => number;\n/**\n * Function signature for function of one node, returning a boolean.\n * @internal\n */\nexport type HalfEdgeToBooleanFunction = (node: HalfEdge) => boolean;\n/**\n * Function signature for function of a node and a mask, returning a number.\n * @internal\n */\nexport type HalfEdgeAndMaskToBooleanFunction = (node: HalfEdge, mask: HalfEdgeMask) => boolean;\n/**\n * Function signature for function of a graph and a node, returning a boolean.\n * @internal\n */\nexport type GraphNodeFunction = (graph: HalfEdgeGraph, node: HalfEdge) => boolean;\n/**\n * Non-topological data members in a half edge.\n * These are not part of adjacency and masking logic.\n * Member fields for a half edge (which is also commonly called a node).\n * @internal\n */\nexport interface HalfEdgeUserData extends WritableXYAndZ {\n /** Angle used for sort-around-vertex. */\n sortAngle?: number;\n /** Numeric value for application-specific tagging (e.g. sorting). */\n sortData?: number;\n /**\n * Application-specific data for the edge identifier.\n * * Edge split operations are expected to copy this to new sub-edges.\n */\n edgeTag?: any;\n /**\n * Application-specific data for the face loop.\n * * Face split operations are expected to copy this to new nodes in the face.\n */\n faceTag?: any;\n}\n/**\n * A HalfEdge is \"one side of an edge\" in a structure of faces, edges and vertices. From a node there are\n * navigational links to:\n * * \"faceSuccessor\" -- the next half edge in a loop around a face.\n * * \"facePredecessor\" -- the previous half edge in a loop around a face.\n * * \"edgeMate\" -- the node's partner on the other side of the edge.\n *\n * The next, prev, and mate are the essential connectivity. Additional node content is for application-specific\n * uses. The most useful ones are:\n * * x,y -- coordinates in the xy plane\n * * z -- z coordinate. This is normally ignored during planar setup, but used for output.\n * * maskBits -- an integer value manipulated as individual bits.\n *\n * In properly connected planar graph, interior face loops are counterclockwise. But that property (along with\n * expected masking) is a result of extensive validation of inputs, and is not true in intermediate phases of\n * graph manipulation.\n * @internal\n */\nexport class HalfEdge implements HalfEdgeUserData {\n /** Vertex index in some parent object's numbering. */\n public i: number;\n /**\n * Bitmask bits, used to set multiple flags on a node, indicating e.g., nodes on boundary edges, or in\n * an exterior face, or nodes visited during graph computations.\n * * See [[HalfEdgeMask]] for mask values.\n */\n public maskBits: number;\n /** Vertex x coordinate. */\n public x: number;\n /** Vertex y coordinate. */\n public y: number;\n /** Vertex z coordinate. */\n public z: number;\n /** Angle used for sort-around-vertex */\n public sortAngle?: number;\n /** Numeric value for application-specific tagging (e.g. sorting) */\n public sortData?: number;\n /**\n * Application-specific data for the edge identifier.\n * * edge split operations are expected to copy this to new sub-edges.\n */\n public edgeTag?: any;\n /**\n * Application-specific data for the face loop.\n * * Face split operations are expected to copy this to new nodes in the face.\n */\n public faceTag?: any;\n private _id: number;\n /** Immutable ID assigned sequentially during construction --- useful for debugging. */\n public get id() {\n return this._id;\n }\n private _facePredecessor: HalfEdge;\n private _faceSuccessor: HalfEdge;\n private _edgeMate: HalfEdge;\n /** Previous half edge \"around the face\" */\n public get facePredecessor(): HalfEdge {\n return this._facePredecessor;\n }\n /** Next half edge \"around the face\" */\n public get faceSuccessor(): HalfEdge {\n return this._faceSuccessor;\n }\n /** Half edge on the other side of this edge. */\n public get edgeMate(): HalfEdge {\n return this._edgeMate;\n }\n private static _totalNodesCreated = 0;\n public constructor(x: number = 0, y: number = 0, z: number = 0, i: number = 0) {\n this._id = HalfEdge._totalNodesCreated++;\n this.i = i;\n this.maskBits = 0x00000000;\n this.x = x;\n this.y = y;\n this.z = z;\n // explicit init to undefined is important for performance here\n this.sortAngle = undefined;\n this.sortData = undefined;\n this.edgeTag = undefined;\n this.faceTag = undefined;\n // always created in pairs, init here to make TS compiler and JS runtime happy\n this._facePredecessor = this;\n this._faceSuccessor = this;\n this._edgeMate = this;\n }\n /**\n * Take numStep face steps and return y coordinate.\n * * Positive steps are through faceSuccessor.\n * * Negative steps are through facePredecessor.\n */\n public faceStepY(numStep: number): number {\n let node: HalfEdge = this;\n if (numStep > 0)\n for (let i = 0; i < numStep; i++)\n node = node.faceSuccessor;\n else if (numStep < 0)\n for (let i = 0; i > numStep; i--)\n node = node.facePredecessor;\n return node.y;\n }\n /**\n * Create 2 half edges.\n * * The two edges are joined as edgeMate pair.\n * * The two edges are a 2-half-edge face loop in both the faceSuccessor and facePredecessor directions.\n * @returns the reference to the first half edge created.\n */\n public static createHalfEdgePair(heArray: HalfEdge[] | undefined): HalfEdge {\n // Visualization can be found at geometry/internaldocs/Graph.md\n const a = new HalfEdge();\n const b = new HalfEdge();\n if (heArray) {\n heArray.push(a);\n heArray.push(b);\n }\n HalfEdge.setFaceLinks(a, b);\n HalfEdge.setFaceLinks(b, a);\n HalfEdge.setEdgeMates(a, b);\n return a;\n }\n /**\n * * Create 2 half edges.\n * * The two edges are joined as edgeMate pair.\n * * The two edges are a 2-half-edge face loop in both the faceSuccessor and facePredecessor directions.\n * * Properties x,y,z,i are inserted in each half edge.\n * @returns the reference to the first half edge created, set with \"A\" properties.\n */\n public static createHalfEdgePairWithCoordinates(\n xA: number = 0, yA: number = 0, zA: number = 0, iA: number = 0,\n xB: number = 0, yB: number = 0, zB: number = 0, iB: number = 0,\n heArray: HalfEdge[] | undefined,\n ): HalfEdge {\n const a = HalfEdge.createHalfEdgePair(heArray);\n const b = a._edgeMate;\n a.x = xA;\n a.y = yA;\n a.z = zA;\n a.i = iA;\n b.x = xB;\n b.y = yB;\n b.z = zB;\n b.i = iB;\n return a;\n }\n /**\n * * Set heA <==> heB pointer relation through heA._faceSuccessor and heB._facePredecessor.\n * * This changes heA._faceSuccessor and heB._facePredecessor, but not heA._facePredecessor and heB._faceSuccessor.\n * * This must always be done with another call to setFaceLinks(heB,heA) in order to re-establish the entire\n * double-linked list.\n */\n private static setFaceLinks(heA: HalfEdge, heB: HalfEdge) {\n heA._faceSuccessor = heB;\n heB._facePredecessor = heA;\n }\n /** set heA <==> heB pointer relation edgeMate. */\n private static setEdgeMates(heA: HalfEdge, heB: HalfEdge) {\n heA._edgeMate = heB;\n heB._edgeMate = heA;\n }\n /**\n * Create a new vertex within the edge beginning at `baseA`.\n * * This creates two new nodes in their own vertex loop.\n * * If the base is `undefined`, create a single-edge loop.\n * * Existing nodes stay in their face and vertex loops and retain xyz and i values.\n * * Unlike [[pinch]], this breaks the edgeMate pairing of the input edge:\n * each node of the input edge gets a new node as its edge mate.\n * * On each side of the edge, if edgeTag is present, it is copied to the new node on that side.\n * @returns reference to the half edge created, the new face successor of `baseA`.\n */\n public static splitEdge(\n baseA: undefined | HalfEdge,\n xA: number = 0,\n yA: number = 0,\n zA: number = 0,\n iA: number = 0,\n heArray: HalfEdge[] | undefined,\n ): HalfEdge {\n // Visualization can be found at geometry/internaldocs/Graph.md\n const newA = new HalfEdge(xA, yA, zA, iA);\n const newB = new HalfEdge(xA, yA, zA, iA);\n if (heArray) {\n heArray.push(newA);\n heArray.push(newB);\n }\n if (baseA === undefined) {\n newA._faceSuccessor = newA._facePredecessor = newA;\n newB._faceSuccessor = newB._facePredecessor = newB;\n HalfEdge.setEdgeMates(newA, newB);\n } else {\n const nextA = baseA._faceSuccessor;\n const mateA = baseA._edgeMate;\n const vPredA = mateA._faceSuccessor;\n // insert newA and newB between existing half edges\n HalfEdge.setFaceLinks(newA, nextA);\n HalfEdge.setFaceLinks(baseA, newA);\n HalfEdge.setFaceLinks(mateA, newB);\n HalfEdge.setFaceLinks(newB, vPredA);\n // set correct edge mates\n HalfEdge.setEdgeMates(newA, mateA);\n HalfEdge.setEdgeMates(newB, baseA);\n this.transferEdgeProperties(baseA, newA);\n this.transferEdgeProperties(mateA, newB);\n }\n return newA;\n }\n /**\n * Reverse of [[splitEdge]]: remove the vertex at `doomed` and merge its two incident edges.\n * @param doomed one of two nodes added by [[splitEdge]]. These nodes should form a vertex loop of two nodes.\n * On successful return this node and its mate are isolated.\n * @param checkParallel whether to check that the doomed edge and the preceding edge in its face loop are parallel.\n * When passing `true` the assumption is that edge geometry is linear. If nonlinear edge geometry is attached, the\n * caller should a) verify that the geometry on either side of the doomed vertex can be merged, and if so, they\n * should b) call this method passing `false`, and c) adjust the geometry of the returned edge and its edge mate\n * as appropriate.\n * @returns the former (surviving) face predecessor of `doomed`, or undefined if the edge can't be healed.\n */\n public static healEdge(doomed: HalfEdge, checkParallel: boolean = true): HalfEdge | undefined {\n if (doomed.isIsolatedEdge)\n return undefined;\n const doomed1 = doomed.vertexSuccessor;\n if (doomed1.vertexSuccessor !== doomed)\n return undefined; // v-loop not a 2-cycle\n if (checkParallel && !doomed.vectorToFaceSuccessor().isParallelTo(doomed.facePredecessor.vectorToFaceSuccessor(), false, true))\n return undefined; // removing this vertex does not leave a straight edge behind\n const fPred = doomed.facePredecessor;\n const fSucc = doomed.faceSuccessor;\n const fPred1 = doomed1.facePredecessor;\n const fSucc1 = doomed1.faceSuccessor;\n this.setFaceLinks(fPred, fSucc);\n this.setFaceLinks(fPred1, fSucc1);\n this.setEdgeMates(fPred, fPred1);\n this.setFaceLinks(doomed, doomed1);\n this.setFaceLinks(doomed1, doomed);\n this.setEdgeMates(doomed, doomed1);\n return fPred;\n }\n /**\n * Create a new sliver face \"inside\" an existing edge.\n * * This creates two nodes that are each face predecessor and successor to the other.\n * * Existing nodes stay in their face and vertex loops and retain xyz and i values.\n * * Unlike [[pinch]], this breaks the edgeMate pairing of the input edge:\n * each node of the input edge gets a new node as its edge mate.\n * * New nodes get the xyz and i values shared by the nodes in the vertex loops into which they are placed.\n * * New nodes' faceTag and edgeTag are `undefined`.\n * @returns reference to the half edge created in the vertex loop of baseA.\n */\n public static splitEdgeCreateSliverFace(\n baseA: HalfEdge,\n heArray: HalfEdge[] | undefined,\n ): HalfEdge {\n // Visualization can be found at geometry/internaldocs/Graph.md\n const baseB = baseA.edgeMate;\n const newA = new HalfEdge();\n const newB = new HalfEdge();\n if (heArray) {\n heArray.push(newA);\n heArray.push(newB);\n }\n newA._faceSuccessor = newA._facePredecessor = newB;\n newB._faceSuccessor = newB._facePredecessor = newA;\n HalfEdge.setEdgeMates(newA, baseB);\n HalfEdge.setEdgeMates(newB, baseA);\n newA.copyDataFrom(baseA, true, true, false, false);\n newB.copyDataFrom(baseB, true, true, false, false);\n return newA;\n }\n /** Masks copied when an edge is split. */\n private static _edgePropertyMasks: HalfEdgeMask[] = [\n HalfEdgeMask.EXTERIOR, HalfEdgeMask.BOUNDARY_EDGE, HalfEdgeMask.PRIMARY_EDGE, HalfEdgeMask.BRIDGE_EDGE, HalfEdgeMask.REGULARIZED_EDGE, HalfEdgeMask.NULL_FACE\n ];\n /**\n * Copy \"edge based\" content of `fromNode` to `toNode`:\n * * edgeTag\n * * edge masks\n */\n public static transferEdgeProperties(fromNode: HalfEdge, toNode: HalfEdge): void {\n toNode.edgeTag = fromNode.edgeTag;\n for (const mask of this._edgePropertyMasks) {\n if (fromNode.getMask(mask))\n toNode.setMask(mask);\n else\n toNode.clearMask(mask);\n }\n }\n /** Return the next half edge around this vertex in the CCW direction. */\n public get vertexSuccessor(): HalfEdge {\n return this.facePredecessor.edgeMate;\n }\n /** Return the next half edge around this vertex in the CW direction. */\n public get vertexPredecessor(): HalfEdge {\n return this.edgeMate.faceSuccessor;\n }\n /**\n * Set mask bits on this HalfEdge.\n * @param mask mask bits to apply\n */\n public setMask(mask: HalfEdgeMask): void {\n this.maskBits |= mask;\n }\n /**\n * Get mask bits from this HalfEdge.\n * @param mask mask bits to query\n */\n public getMask(mask: HalfEdgeMask): number {\n return (this.maskBits & mask);\n }\n /**\n * Clear mask bits from this HalfEdge.\n * @param mask mask bits to clear\n */\n public clearMask(mask: HalfEdgeMask): void {\n this.maskBits &= ~mask;\n }\n /**\n * Set a mask at all nodes around a vertex.\n * @param mask mask to apply to the half edges around this HalfEdge's vertex loop.\n */\n public setMaskAroundVertex(mask: HalfEdgeMask): void {\n let node: HalfEdge = this;\n do {\n node.setMask(mask);\n node = node.vertexSuccessor;\n } while (node !== this);\n }\n\n /** Set x,y,z at all nodes around a vertex. */\n public setXYZAroundVertex(x: number, y: number, z: number): void {\n let node: HalfEdge = this;\n do {\n node.x = x;\n node.y = y;\n node.z = z;\n node = node.vertexSuccessor;\n } while (node !== this);\n }\n /**\n * Apply a mask to all edges around a face.\n * @param mask mask to apply to the half edges around this HalfEdge's face loop.\n */\n public setMaskAroundFace(mask: HalfEdgeMask): void {\n let node: HalfEdge = this;\n do {\n node.setMask(mask);\n node = node.faceSuccessor;\n } while (node !== this);\n }\n /**\n * Apply a mask to both sides of an edge.\n * @param mask mask to apply to this edge and its edgeMate.\n */\n public setMaskAroundEdge(mask: HalfEdgeMask): void {\n this.setMask(mask);\n this.edgeMate.setMask(mask);\n }\n /**\n * Clear a mask on both sides of an edge.\n * @param mask mask to clear on this edge and its edgeMate.\n */\n public clearMaskAroundEdge(mask: HalfEdgeMask): void {\n this.clearMask(mask);\n this.edgeMate.clearMask(mask);\n }\n /** Returns the number of edges around this face. */\n public countEdgesAroundFace(): number {\n let count = 0;\n let node: HalfEdge = this;\n do {\n count++;\n node = node.faceSuccessor;\n } while (node !== this);\n return count;\n }\n /** Return true if `other` node is in the vertex loop around `this` node. */\n public findAroundVertex(other: HalfEdge): boolean {\n let node: HalfEdge = this;\n do {\n if (node === other)\n return true;\n node = node.vertexSuccessor;\n } while (node !== this);\n return false;\n }\n /** Return true if `other` node is in the face loop around `this` node. */\n public findAroundFace(other: HalfEdge): boolean {\n let node: HalfEdge = this;\n do {\n if (node === other)\n return true;\n node = node.faceSuccessor;\n } while (node !== this);\n return false;\n }\n /**\n * Returns whether the mask is set or unset on all nodes of the face loop.\n * @param mask the mask to check.\n * @param value true for mask set and false for mask unset.\n */\n public isMaskedAroundFace(mask: HalfEdgeMask, value: boolean = true): boolean {\n let node: HalfEdge = this;\n if (value) {\n do {\n if (!node.isMaskSet(mask))\n return false;\n node = node.faceSuccessor;\n } while (node !== this);\n } else {\n do {\n if (node.isMaskSet(mask))\n return false;\n node = node.faceSuccessor;\n } while (node !== this);\n }\n return true;\n }\n /**\n * Apply a mask and edgeTag to all edges around a face. Optionally apply it to all edge mates.\n * @param mask mask to apply.\n * @param tag edgeTag to apply\n * @param applyToMate If true, also apply the tag to the edge mates around the face.\n */\n public setMaskAndEdgeTagAroundFace(mask: HalfEdgeMask, tag: any, applyToMate: boolean = false): void {\n let node: HalfEdge = this;\n do {\n node.setMask(mask);\n node.edgeTag = tag;\n if (applyToMate) {\n const mate = node.edgeMate;\n mate.setMask(mask);\n mate.edgeTag = tag;\n }\n node = node.faceSuccessor;\n } while (node !== this);\n }\n /** Returns the number of edges around vertex. */\n public countEdgesAroundVertex(): number {\n let count = 0;\n let node: HalfEdge = this;\n do {\n count++;\n node = node.vertexSuccessor;\n } while (node !== this);\n return count;\n }\n /**\n * Returns the number of nodes that match (or do not match) the given mask value around this face loop.\n * @param mask the mask to check.\n * @param value true for mask match and false for mask not match. Default is `true`.\n */\n public countMaskAroundFace(mask: HalfEdgeMask, value: boolean = true): number {\n let count = 0;\n let node: HalfEdge = this;\n if (value) {\n do {\n if (node.isMaskSet(mask))\n count++;\n node = node.faceSuccessor;\n } while (node !== this);\n } else {\n do {\n if (!node.isMaskSet(mask))\n count++;\n node = node.faceSuccessor;\n } while (node !== this);\n }\n return count;\n }\n /**\n * Returns the number of nodes that match (or do not match) the given mask value around this vertex loop.\n * @param mask the mask to check.\n * @param value true for mask match and false for mask not match.\n */\n public countMaskAroundVertex(mask: HalfEdgeMask, value: boolean = true): number {\n let count = 0;\n let node: HalfEdge = this;\n if (value) {\n do {\n if (node.isMaskSet(mask))\n count++;\n node = node.vertexSuccessor;\n } while (node !== this);\n } else {\n do {\n if (!node.isMaskSet(mask))\n count++;\n node = node.vertexSuccessor;\n } while (node !== this);\n }\n return count;\n }\n /**\n * Returns the first node that matches (or does not match) the given mask value around this vertex loop, starting\n * with the instance node and proceeding via `vertexSuccessor`.\n * @param mask the mask to check.\n * @param value true for mask match and false for mask not match. Default is `true`.\n * @param reverse if true, search in reverse order via `vertexPredecessor`. Default is `false`.\n */\n public findMaskAroundVertex(mask: HalfEdgeMask, value: boolean = true, reverse: boolean = false): HalfEdge | undefined {\n let node: HalfEdge = this;\n do {\n if (node.isMaskSet(mask) === value)\n return node;\n node = reverse ? node.vertexPredecessor : node.vertexSuccessor;\n } while (node !== this);\n return undefined;\n }\n /**\n * Returns the first node that matches (or does not match) the given mask value around this face loop, starting\n * with the instance node and proceeding via face successors.\n * @param mask the mask to check.\n * @param value true for mask match and false for mask not match. Default is `true`.\n */\n public findMaskAroundFace(mask: HalfEdgeMask, value: boolean = true): HalfEdge | undefined {\n let node: HalfEdge = this;\n do {\n if (node.isMaskSet(mask) === value)\n return node;\n node = node.faceSuccessor;\n } while (node !== this);\n return undefined;\n }\n /**\n * Returns the first node that matches (or does not match) the given mask value around this edge, starting\n * with the instance node and then checking its edge mate.\n * @param mask the mask to check.\n * @param value true for mask match and false for mask not match.\n */\n public findMaskAroundEdge(mask: HalfEdgeMask, value: boolean = true): HalfEdge | undefined {\n if (this.isMaskSet(mask) === value)\n return this;\n const mate = this.edgeMate;\n if (mate.isMaskSet(mask) === value)\n return mate;\n return undefined;\n }\n /**\n * Set a mask and return prior value.\n * @param mask mask to apply.\n */\n public testAndSetMask(mask: HalfEdgeMask): number {\n const oldMask = this.maskBits & mask;\n this.maskBits |= mask;\n return oldMask;\n }\n /**\n * Set `this.x`, `this.y`, `this.z` from `node.x`, `node.y`, `node.z`.\n * @param node node containing xyz.\n */\n public setXYZFrom(node: HalfEdge) {\n this.x = node.x;\n this.y = node.y;\n this.z = node.z;\n }\n /**\n * Set `this.x`, `this.y`, `this.z` from `xyz.x`, `xyz.y`, `xyz.z`.\n * @param node source with x,y,z properties\n */\n public setXYZ(xyz: XYAndZ) {\n this.x = xyz.x;\n this.y = xyz.y;\n this.z = xyz.z;\n }\n /**\n * Test if any of the `mask` bits are set in the node's bitMask.\n * @return true (as a simple boolean, not a mask) if any bits of the `mask` match bits of the node's bitMask.\n */\n public isMaskSet(mask: HalfEdgeMask): boolean {\n return (this.maskBits & mask) !== 0;\n }\n /**\n * Static method to test if any of the `mask` bits are set in the `node`'s bitMask.\n * * This is used as filter in searches.\n * @returns `node.isMaskSet(mask)`\n */\n public static filterIsMaskOn(node: HalfEdge, mask: HalfEdgeMask): boolean {\n return node.isMaskSet(mask);\n }\n /**\n * Static method to test if any of the `mask` bits are set in the `node`'s bitMask.\n * * This is used as filter in searches.\n * @returns `!node.isMaskSet(mask)`\n */\n public static filterIsMaskOff(node: HalfEdge, mask: HalfEdgeMask): boolean {\n return !node.isMaskSet(mask);\n }\n /**\n * Create an edge with initial id,x,y at each end.\n * @param id0 id for first node.\n * @param x0 x coordinate for first node.\n * @param y0 y coordinate for first node.\n * @param id1 id for second node.\n * @param x1 x coordinate for second node.\n * @param y1 y coordinate for second node.\n * @returns the reference to the new node at (x0,y0).\n */\n public static createEdgeXYXY(id0: number, x0: number, y0: number, id1: number, x1: number, y1: number): HalfEdge {\n const node0 = new HalfEdge(x0, y0);\n const node1 = new HalfEdge(x1, y1);\n node0._faceSuccessor = node0._facePredecessor = node0._edgeMate = node1;\n node1._faceSuccessor = node1._facePredecessor = node1._edgeMate = node0;\n node0._id = id0;\n node1._id = id1;\n return node0;\n }\n /**\n *\"Pinch\" is the universal operator for manipulating a node's next and previous pointers.\n * * It is its own inverse: applying it twice on the same inputs (i.e., `pinch(a,b); pinch(a,b);`) gets back to\n * where you started.\n * * If the inputs are in different face loops, the loops join to one face loop after the pinch.\n * * If the inputs are in the same face loop, the loop splits into two face loops after the pinch.\n */\n public static pinch(nodeA: HalfEdge, nodeB: HalfEdge) {\n // Visualization can be found at geometry/internaldocs/Graph.md\n if (nodeA !== nodeB) {\n const predA = nodeA._facePredecessor;\n const predB = nodeB._facePredecessor;\n nodeB._facePredecessor = predA;\n nodeA._facePredecessor = predB;\n predB._faceSuccessor = nodeA;\n predA._faceSuccessor = nodeB;\n }\n }\n /** Return whether the edge is dangling at its base. */\n public get isDangling(): boolean {\n return this.edgeMate.faceSuccessor === this;\n }\n /**\n * Pinch this half edge out of its base vertex loop.\n * @return the surviving HalfEdge in the vertex loop or `undefined` if the instance HalfEdge is already dangling.\n */\n public yankFromVertexLoop(): HalfEdge | undefined {\n const other = this.edgeMate.faceSuccessor;\n if (other === this)\n return undefined;\n // at this point \"other\" is the vertex predecessor of \"this\"\n HalfEdge.pinch(this, other);\n return other;\n }\n /**\n * Turn all pointers to `undefined` so garbage collector can reuse the object.\n * * This is to be called only by a Graph object that is being decommissioned.\n */\n public decommission() {\n (this._facePredecessor as any) = undefined;\n (this._faceSuccessor as any) = undefined;\n (this._edgeMate as any) = undefined;\n }\n /** Return the node. This identity function is useful as the NodeFunction in collector methods. */\n public static nodeToSelf(node: HalfEdge): any {\n return node;\n }\n /** Return the id of a node. Useful for collector methods. */\n public static nodeToId(node: HalfEdge): number {\n return node.id;\n }\n /** Return the id of a node as string. Useful for collector methods. */\n public static nodeToIdString(node: HalfEdge): string {\n return node.id.toString();\n }\n /** Return the [id, mask, [x,y]] of a node. Useful for collector methods. */\n public static nodeToIdMaskXY(node: HalfEdge): { id: number, mask: string, xy: number[] } {\n return { id: node.id, mask: HalfEdge.nodeToMaskString(node), xy: [node.x, node.y] };\n }\n /** Return the [id, mask, [x,y]] of a node as string. Useful for collector methods. */\n public static nodeToIdXYString(node: HalfEdge): string {\n const s = `${node.id.toString()}+${HalfEdge.nodeToMaskString(node)}[${node.x},${node.y}]`;\n return s;\n }\n /** Return the [id, [x,y,z]] of a node as string. Useful for collector methods. */\n public static nodeToIdXYZString(node: HalfEdge): string {\n return `[${node.id.toString()}: ${node.x},${node.y},${node.z}]`;\n }\n /**\n * Create a string representation of the mask.\n * * Null mask is empty string.\n * * Appended characters B,P,X,N are for BOUNDARY_EDGE, PRIMARY_EDGE, EXTERIOR, and NULL_FACE mask bits.\n */\n public static nodeToMaskString(node: HalfEdge): string {\n let s = \"\";\n if (node.isMaskSet(HalfEdgeMask.BOUNDARY_EDGE))\n s += \"B\";\n if (node.isMaskSet(HalfEdgeMask.PRIMARY_EDGE))\n s += \"P\";\n if (node.isMaskSet(HalfEdgeMask.EXTERIOR))\n s += \"X\";\n if (node.isMaskSet(HalfEdgeMask.NULL_FACE))\n s += \"N\";\n return s;\n }\n /** Return [x,y] with coordinates of node. */\n public static nodeToXY(node: HalfEdge): number[] {\n return [node.x, node.y];\n }\n /** Return Vector2d from `this` to face successor (with only xy coordinates). */\n public vectorToFaceSuccessorXY(result?: Vector2d): Vector2d {\n return Vector2d.create(this.faceSuccessor.x - this.x, this.faceSuccessor.y - this.y, result);\n }\n /** Return Vector3d from `this` to face successor. */\n public vectorToFaceSuccessor(result?: Vector3d): Vector3d {\n const other = this.faceSuccessor;\n return Vector3d.create(\n other.x - this.x,\n other.y - this.y,\n other.z - this.z,\n result,\n );\n }\n /** Return Vector3d from `this` to face successor. */\n public vectorToFacePredecessor(result?: Vector3d): Vector3d {\n const other = this.facePredecessor;\n return Vector3d.create(\n other.x - this.x,\n other.y - this.y,\n other.z - this.z,\n result,\n );\n }\n /**\n * Test if `spaceNode` is in the sector of `sectorNode`.\n * * The sector at `sectorNode` is defined by two rays starting at `sectorNode` and extending along the edges\n * owned by `sectorNode` and its face predecessor.\n * * In general, this method returns `true` if the coordinates of `spaceNode` are _strictly_ inside this sector\n * (not on the rays).\n * * Interpretation is whether a viewer at `sectorNode` can see `spaceNode` between the two rays.\n * * Degenerate sectors of 180 or 360 degrees have special handling.\n */\n public static isNodeVisibleInSector(spaceNode: HalfEdge, sectorNode: HalfEdge): boolean {\n // remark: fussy details ported from native code. The obscure cases seemed \"unlikely\" at first. But pre-existing\n // unit tests for triangulation pinged just about everything. So it really matters to do the \"0\" cases this way\n // (as usual, hard coded zero is suspect, but it seems to work nicely in the discrete decisions).\n if (sectorNode.vertexSuccessor === sectorNode)\n return true;\n const successor = sectorNode.faceSuccessor;\n const predecessor = sectorNode.facePredecessor;\n const successorCross = this.crossProductXYToTargets(sectorNode, successor, spaceNode);\n const predecessorCross = this.crossProductXYToTargets(predecessor, sectorNode, spaceNode);\n // simplest case: two positives\n if (successorCross > 0.0 && predecessorCross > 0.0)\n return true;\n const sectorCross = this.crossProductXYToTargets(predecessor, sectorNode, successor);\n if (predecessorCross <= 0.0 && successorCross <= 0.0) {\n if (predecessorCross === 0.0 && successorCross === 0.0 && sectorCross === 0.0) {\n // Everything is on a line. If the sector is a degenerate face, nodeP\n // can only be in if it is the other node in the degenerate face.\n if (predecessor === successor && sectorNode.vertexSuccessor !== sectorNode)\n return spaceNode === successor;\n // Sector is 360 degrees. Call it in only if vector from predP to sectorP points forward to nodeP.\n return HalfEdge.dotProductNodeToNodeVectorsXY(predecessor, sectorNode, sectorNode, spaceNode) > 0.0;\n } else {\n return false;\n }\n } else {\n if (sectorCross === 0.0 && predecessorCross !== 0.0 && successorCross !== 0.0) {\n // The incoming and outgoing edges at the sector are identical direction. We have to decide if this node is\n // inside the degenerate face (i.e. a geometrically empty sector) or outside (i.e. a nearly complete sector).\n // In the inside case, the face is just two nodes. Exact equality for zero is ok because cross product should\n // be using identical coordinates in subtracted terms (all furrow eyebrows in unison).\n return predecessor !== successor;\n }\n return sectorCross < 0.0;\n }\n }\n /** Returns 2D cross product of vectors from `base` to `targetA` and from `base` to `targetB`. */\n public static crossProductXYToTargets(base: HalfEdge, targetA: HalfEdge, targetB: HalfEdge): number {\n return Geometry.crossProductXYXY(\n targetA.x - base.x, targetA.y - base.y,\n targetB.x - base.x, targetB.y - base.y,\n );\n }\n /** Returns 2D dot product of vectors from `baseA` to `targetA` and from `baseB` to `targetB`. */\n public static dotProductNodeToNodeVectorsXY(baseA: HalfEdge, targetA: HalfEdge, baseB: HalfEdge, targetB: HalfEdge): number {\n return Geometry.dotProductXYXY(\n targetA.x - baseA.x, targetA.y - baseA.y,\n targetB.x - baseB.x, targetB.y - baseB.y,\n );\n }\n /** Return 2D cross product of vectors from `nodeA` to `nodeB` and from `nodeB` to `nodeC`. */\n public static crossProductXYAlongChain(nodeA: HalfEdge, nodeB: HalfEdge, nodeC: HalfEdge): number {\n return Geometry.crossProductXYXY(\n nodeB.x - nodeA.x, nodeB.y - nodeA.y,\n nodeC.x - nodeB.x, nodeC.y - nodeB.y,\n );\n }\n /**\n * Compute whether the sector defined by the chain of nodes is convex.\n * * This function is determining if, in the traversal of the HalfEdges in a face loop, a corner makes a left turn\n * (convex) or a right turn (not-convex). Note that if we have a convex face, then to traverse it in ccw orientation,\n * we always do left turns. However, if the face is not convex, we make both left and right turns.\n * * This computation ignores z-coordinates and connectivity, so the nodes are not required to be in the same face loop.\n * @param nodeA the first node in the chain, nominally the face predecessor of nodeB.\n * @param nodeB the second node in the chain; the node at the sector vertex.\n * @param nodeC the third node in the chain, nominally the face successor of nodeB.\n * @param signedAreaTol optional signed area tolerance to use in test for parallel vectors. Typically this is a\n * fraction of the sector's face's signed area. We can't compute area here, so if `undefined`, zero tolerance is used.\n * @returns true iff the sector is convex. A degenerate sector, where the incident edges overlap, returns false.\n */\n public static isSectorConvex(nodeA: HalfEdge, nodeB: HalfEdge, nodeC: HalfEdge, signedAreaTol: number = 0): boolean {\n const signedSectorArea = 0.5 * HalfEdge.crossProductXYAlongChain(nodeA, nodeB, nodeC);\n signedAreaTol = signedAreaTol ?? 0.0;\n if (Math.abs(signedSectorArea) <= Math.abs(signedAreaTol)) {\n // the sector vectors are nearly parallel or anti-parallel; only the former is deemed convex.\n return HalfEdge.dotProductNodeToNodeVectorsXY(nodeA, nodeB, nodeB, nodeC) > 0.0;\n }\n // // sector is convex if the area is positive. Call it convex even if we are a little bit on the other side of zero.\n return signedSectorArea > -signedAreaTol;\n }\n /**\n * Compute whether the sector at this node is convex.\n * * This function is determining if, in the traversal of the HalfEdges in a face loop, a corner makes a left turn\n * (convex) or a right turn (not-convex). Note that if we have a convex face, then to traverse it in ccw orientation,\n * we always do left turns. However, if the face is not convex, we make both left and right turns.\n * * This computation ignores z-coordinates.\n * @param signedAreaTol optional signed area tolerance to use in test for parallel vectors. If `undefined`, a fraction\n * (`Geometry.smallMetricDistanceSquared`) of the computed signed area is used. Pass 0 to skip toleranced computation.\n * @returns true iff the sector is convex. A degenerate sector, where the incident edges overlap, returns false.\n */\n public isSectorConvex(signedAreaTol?: number): boolean {\n if (signedAreaTol === undefined)\n signedAreaTol = Geometry.smallMetricDistanceSquared * this.signedFaceArea();\n return HalfEdge.isSectorConvex(this.facePredecessor, this, this.faceSuccessor, signedAreaTol);\n }\n /**\n * Compute whether this face is convex.\n * * Note that if we have a convex face, then to traverse it in ccw orientation, we always do left turns.\n * However, if the face is not convex, we make both left and right turns.\n * * This computation ignores z-coordinates.\n * @param tolerance optional relative tolerance to use in test for parallel vectors. Default value is\n * `Geometry.smallMetricDistanceSquared`. Pass 0 to skip toleranced computation.\n * @returns true iff this face is convex.\n */\n public isFaceConvex(tolerance: number = Geometry.smallMetricDistanceSquared): boolean {\n let node: HalfEdge = this;\n const signedAreaTol = tolerance > 0.0 ? tolerance * node.signedFaceArea() : 0.0;\n do {\n if (!node.isSectorConvex(signedAreaTol))\n return false;\n node = node.faceSuccessor;\n } while (node !== this);\n return true;\n }\n /** Isolate the edge from the graph by yanking each end from its vertex loop. */\n public isolateEdge(): void {\n const mate = this.edgeMate;\n this.yankFromVertexLoop();\n mate.yankFromVertexLoop();\n }\n /**\n * Specify whether this edge is isolated from the rest of the graph.\n * * Both edge mates of an isolated edge return true for [[isDangling]].\n */\n public get isIsolatedEdge(): boolean {\n return this === this.vertexSuccessor && this.edgeMate === this.edgeMate.vertexSuccessor;\n }\n /** Return true if `this` is lexically below `other`. We compare y first, then x, and ignore z. */\n public belowYX(other: HalfEdge): boolean {\n if (this.y < other.y)\n return true;\n if (this.y > other.y)\n return false;\n if (this.x < other.x)\n return true;\n return false;\n }\n /** Returns `true` if the node does NOT have `Mask.EXTERIOR_MASK` set. */\n public static testNodeMaskNotExterior(node: HalfEdge): boolean {\n return !node.isMaskSet(HalfEdgeMask.EXTERIOR);\n }\n /** Returns `true` if the edge mate has `Mask.EXTERIOR_MASK` set. */\n public static testMateMaskExterior(node: HalfEdge): boolean {\n return node.edgeMate.isMaskSet(HalfEdgeMask.EXTERIOR);\n }\n /**\n * Returns radians between this edge and its face predecessor edge, using all three coordinates x,y,z and\n * given normal to resolve sweep direction.\n * * The returned angle is non-negative: 0 <= radians < 2*PI.\n */\n public static sectorSweepRadiansXYZ(node: HalfEdge, normal: Vector3d): number {\n const suc = node.faceSuccessor;\n const pred = node.facePredecessor;\n return Angle.orientedRadiansBetweenVectorsXYZ(\n suc.x - node.x, suc.y - node.y, suc.z - node.z,\n pred.x - node.x, pred.y - node.y, pred.z - node.z,\n normal.x, normal.y, normal.z,\n true,\n );\n }\n /** Returns true if the face has positive area in xy parts. */\n public static testFacePositiveAreaXY(node: HalfEdge) {\n return node.countEdgesAroundFace() > 2 && node.signedFaceArea() > 0.0;\n }\n /** Return true if x and y coordinates of `this` and `other` are exactly equal .*/\n public isEqualXY(other: XAndY | HalfEdge): boolean {\n return this.x === other.x && this.y === other.y;\n }\n /** Return distance between xy coordinates of `this` and `other` node. */\n public distanceXY(other: HalfEdge): number {\n return Geometry.distanceXYXY(this.x, this.y, other.x, other.y);\n }\n /** Return distance between xyz coordinates of `this` and `other` node. */\n public distanceXYZ(other: HalfEdge): number {\n return Geometry.distanceXYZXYZ(this.x, this.y, this.z, other.x, other.y, other.z);\n }\n /**\n * Search around the instance's face loop for nodes with the specified mask value.\n * * Returned nodes satisfy `node.isMaskSet(mask) === value`.\n * @param mask target mask.\n * @param value target boolean value for mask on half edges (default `true`).\n * @param result optional array to be cleared, populated with masked nodes, and returned.\n * @return array of masked half edges\n */\n public collectMaskedEdgesAroundFace(mask: HalfEdgeMask, value: boolean = true, result?: HalfEdge[]): HalfEdge[] {\n if (result === undefined)\n result = [];\n else\n result.length = 0;\n let node: HalfEdge = this;\n do {\n if (node.isMaskSet(mask) === value)\n result.push(node);\n node = node.faceSuccessor;\n } while (node !== this);\n return result;\n }\n /**\n * Announce edges in the face loop, starting with the instance and proceeding in a `faceSuccessor` traversal.\n * @param announceEdge function to call at each edge\n */\n public announceEdgesInFace(announceEdge: NodeFunction): void {\n let node: HalfEdge = this;\n do {\n announceEdge(node);\n node = node.faceSuccessor;\n } while (node !== this);\n }\n /**\n * Announce edges in the super face loop, starting with the instance.\n * * A super face admits a `faceSuccessor` traversal, where the next edge at the far vertex is the first one lacking `skipMask` in a `vertexPredecessor` traversal.\n * @param skipMask mask on edges to skip.\n * @param announceEdge function to call at each edge that is not skipped.\n * @param announceSkipped optional function to call at each edge that is skipped.\n * @return whether a super face was found. Specifically, if a vertex loop has all edges with `skipMask` set, the return value is `false`.\n */\n public announceEdgesInSuperFace(skipMask: HalfEdgeMask, announceEdge: NodeFunction, announceSkipped?: NodeFunction): boolean {\n const maxIter = 1000; // safeguard against infinite loops\n let iter = 0;\n const findNextNodeAroundVertex = (he: HalfEdge): HalfEdge | undefined => {\n let vNode = he;\n do {\n if (!vNode.isMaskSet(skipMask))\n return vNode;\n announceSkipped?.(vNode);\n vNode = vNode.vertexPredecessor;\n } while (vNode !== he);\n return undefined;\n };\n const firstNode = findNextNodeAroundVertex(this);\n if (!firstNode)\n return false;\n let node: HalfEdge | undefined = firstNode;\n do {\n announceEdge(node);\n node = findNextNodeAroundVertex(node.faceSuccessor);\n if (!node)\n return false;\n } while (node !== firstNode && iter++ < maxIter);\n return iter < maxIter;\n }\n /**\n * Evaluate `f(node)` at each node around `this` node's face loop. Collect the function values.\n * @param f optional node function. If `undefined`, collect the nodes themselves.\n * @returns the array of function values.\n */\n public collectAroundFace(f?: NodeFunction): any[] {\n const nodes = [];\n let node: HalfEdge = this;\n do {\n nodes.push(f ? f(node) : node); // push the node itself if \"f\" is undefined\n node = node.faceSuccessor;\n } while (node !== this);\n return nodes;\n }\n /**\n * Search around `this` node's vertex loop for nodes with the specified mask value.\n * * Returned nodes satisfy `node.isMaskSet(mask) === value`.\n * @param mask target mask.\n * @param value target boolean value for mask on half edges.\n * @param result optional array to be cleared and receive masked nodes.\n */\n public collectMaskedEdgesAroundVertex(\n mask: HalfEdgeMask, value: boolean = true, result?: HalfEdge[],\n ): HalfEdge[] {\n if (result === undefined)\n result = [];\n else\n result.length = 0;\n let node: HalfEdge = this;\n do {\n if (node.isMaskSet(mask) === value)\n result.push(node);\n node = node.vertexSuccessor;\n } while (node !== this);\n return result;\n }\n /**\n * Evaluate `f(node)` at each node around `this` node's vertex loop. Collect the function values.\n * @param f optional node function. If `undefined`, collect the nodes themselves.\n * @returns the array of function values.\n */\n public collectAroundVertex(f?: NodeFunction): any[] {\n const nodes = [];\n let node: HalfEdge = this;\n do {\n nodes.push(f ? f(node) : node); // push the node itself if \"f\" is undefined\n node = node.vertexSuccessor;\n } while (node !== this);\n return nodes;\n }\n /**\n * Evaluate `f(node)` at each node around `this` node's face loop. Sum the function values.\n * @param f node to number function.\n * @returns the sum of function values.\n */\n public sumAroundFace(f: NodeToNumberFunction): number {\n let node: HalfEdge = this;\n let sum = 0;\n do {\n sum += f(node);\n node = node.faceSuccessor;\n } while (node !== this);\n return sum;\n }\n /**\n * Evaluate `f(node)` at each node around `this` node's vertex loop. Sum the function values.\n * @param f node to number function.\n * @returns the sum of function values.\n */\n public sumAroundVertex(f: NodeToNumberFunction): number {\n let node: HalfEdge = this;\n let sum = 0;\n do {\n sum += f(node);\n node = node.vertexSuccessor;\n } while (node !== this);\n return sum;\n }\n /** Clear the given mask bits for all nodes in `this` node's face loop. */\n public clearMaskAroundFace(mask: HalfEdgeMask) {\n let node: HalfEdge = this;\n do {\n node.clearMask(mask);\n node = node.faceSuccessor;\n } while (node !== this);\n }\n /** Clear out the given mask bits for all nodes in `this` node's vertex loop. */\n public clearMaskAroundVertex(mask: HalfEdgeMask) {\n let node: HalfEdge = this;\n do {\n node.clearMask(mask);\n node = node.vertexSuccessor;\n } while (node !== this);\n }\n /**\n * Compute the signed xy area of `this` node's face.\n * * A positive area is counterclockwise.\n * * A negative area is clockwise.\n * @returns signed area of `this` node's face.\n */\n public signedFaceArea(): number {\n let sum = 0;\n // We start from `this` node and traverse the face, forming trapezoids with vertical bases.\n // Some trapezoids will have a zero-length base, e.g., a triangle.\n // Trapezoid bases are measured from `this.y` to keep area values numerically smaller.\n // Split each trapezoid into two triangles whose y-coordinates are above/below `this.y`.\n // Each trapezoid's signed area is computed by summing the signed areas of these two triangles.\n // Area signs depend on careful assignment of signs to trapezoid height (relative to `this.x`) and trapezoid\n // bases (relative to `this.y`).\n // Some trapezoids have signed areas outside the face that are cancelled out by subsequent trapezoids.\n // The formula in the loop accumulates twice the trapezoid areas, so at the end we halve the sum.\n // Illustration of the algorithm can be found at geometry/internaldocs/Graph.md\n let x0 = this.x;\n let x1 = 0.0;\n const y0 = this.y;\n let dy0 = 0.0;\n let dy1 = 0.0;\n let node1;\n let node0: HalfEdge = this;\n do {\n node1 = node0.faceSuccessor;\n x1 = node1.x;\n dy1 = node1.y - y0;\n // When trapezoid bases dy0 and dy1 have opposite sign, this product is (twice) the difference of the areas\n // of the trapezoid above and below y=y0. This is equal to (twice) the difference of the areas of the congruent\n // triangles formed by the trapezoid diagonals and bases, a consequence of the other two triangles having equal\n // area, and thus cancelling out.\n sum += (x0 - x1) * (dy0 + dy1); // twice trapezoid area = trapezoid height * sum of trapezoid bases\n x0 = x1;\n dy0 = dy1;\n node0 = node1;\n } while (node0 !== this);\n return 0.5 * sum;\n }\n /**\n * Interpolate xy coordinates between `this` node and its face successor.\n * @param fraction fractional position along this edge.\n * @param result optional point to populate and return.\n */\n public fractionToPoint2d(fraction: number, result?: Point2d): Point2d {\n const suc = this.faceSuccessor;\n return Point2d.create(\n this.x + (suc.x - this.x) * fraction,\n this.y + (suc.y - this.y) * fraction,\n result,\n );\n }\n /**\n * Interpolate xyz coordinates between `this` node and its face successor.\n * @param fraction fractional position along this edge.\n * @param result optional point to populate and return.\n */\n public fractionToPoint3d(fraction: number, result?: Point3d): Point3d {\n const suc = this.faceSuccessor;\n return Point3d.create(\n this.x + (suc.x - this.x) * fraction,\n this.y + (suc.y - this.y) * fraction,\n this.z + (suc.z - this.z) * fraction,\n result,\n );\n }\n /**\n * Interpolate xy coordinates at `fractionAlong` between this node and its face successor. Then shift perpendicular\n * to the left of this edge by `fractionPerpendicular`.\n * @param fractionAlong fractional position along this edge.\n * @param fractionPerpendicular fractional position along the left perpendicular with the same length as this edge.\n * @param result optional xy coordinates.\n */\n public fractionAlongAndPerpendicularToPoint2d(\n fractionAlong: number, fractionPerpendicular: number, result?: Point2d,\n ): Point2d {\n const suc = this.faceSuccessor;\n const dx = suc.x - this.x;\n const dy = suc.y - this.y;\n return Point2d.create(\n this.x + dx * fractionAlong - dy * fractionPerpendicular,\n this.y + dy * fractionAlong + dx * fractionPerpendicular,\n result,\n );\n }\n /** Return the 3d coordinates at this half edge. */\n public getPoint3d(result?: Point3d): Point3d {\n return Point3d.create(this.x, this.y, this.z, result);\n }\n /** Return the 2d coordinates at this half edge. */\n public getPoint2d(result?: Point2d): Point2d {\n return Point2d.create(this.x, this.y, result);\n }\n /** Return a 3d vector from start to end of this half edge. */\n public getVector3dAlongEdge(result?: Vector3d): Vector3d {\n const suc = this.faceSuccessor;\n return Vector3d.create(suc.x - this.x, suc.y - this.y, suc.z - this.z, result);\n }\n /** Return a 2d vector from start to end of this half edge. */\n public getVector2dAlongEdge(result?: Vector2d): Vector2d {\n const suc = this.faceSuccessor;\n return Vector2d.create(suc.x - this.x, suc.y - this.y, result);\n }\n /**\n * Return the interpolated x coordinate between `this` node and its face successor.\n * @param fraction fractional position along this edge.\n */\n public fractionToX(fraction: number): number {\n const suc = this.faceSuccessor;\n return this.x + (suc.x - this.x) * fraction;\n }\n /**\n * Return the interpolated y coordinate between `this` node and its face successor.\n * @param fraction fractional position along this edge.\n */\n public fractionToY(fraction: number): number {\n const suc = this.faceSuccessor;\n return this.y + (suc.y - this.y) * fraction;\n }\n /**\n * Return the interpolated z coordinate between `this` node and its face successor.\n * @param fraction fractional position along this edge.\n */\n public fractionToZ(fraction: number): number {\n const suc = this.faceSuccessor;\n return this.z + (suc.z - this.z) * fraction;\n }\n /**\n * Compute fractional coordinates of the intersection of edges from given base nodes.\n * * If parallel or colinear, return `undefined`.\n * * If (possibly extended) lines intersect, return the fractions of intersection as x,y in the result.\n * @param nodeA0 base node of edge A.\n * @param nodeB0 base node of edge B.\n * @param result optional preallocated result.\n */\n public static transverseIntersectionFractions(\n nodeA0: HalfEdge, nodeB0: HalfEdge, result?: Vector2d,\n ): Vector2d | undefined {\n const nodeA1 = nodeA0.faceSuccessor;\n const nodeB1 = nodeB0.faceSuccessor;\n if (!result)\n result = Vector2d.create();\n // To find the fraction of intersection (ta,tb), you need to solve these 2 equations:\n // (nodeA1.x - nodeA0.x)ta + (nodeB0.x - nodeB1.x)tb = nodeB0.x - nodeA0.x\n // (nodeA1.y - nodeA0.y)ta + (nodeB0.y - nodeB1.y)tb = nodeB0.y - nodeA0.y\n // Proof can be found at geometry/internaldocs/Graph.md\n if (SmallSystem.linearSystem2d(\n nodeA1.x - nodeA0.x, nodeB0.x - nodeB1.x,\n nodeA1.y - nodeA0.y, nodeB0.y - nodeB1.y,\n nodeB0.x - nodeA0.x, nodeB0.y - nodeA0.y,\n result,\n ))\n return result;\n return undefined;\n }\n /**\n * Compute fractional position (possibly outside 0..1) of the intersection of a horizontal line with an edge.\n * * If the edge is horizontal with (approximate) identical y, return the base node.\n * * If the edge is horizontal with different y, return `undefined`.\n * @param node0 base node of edge.\n * @param y y coordinate of the horizontal line.\n */\n public static horizontalScanFraction(node0: HalfEdge, y: number): number | undefined | HalfEdge {\n const node1 = node0.faceSuccessor;\n const dy = node1.y - node0.y;\n if (Geometry.isSameCoordinate(y, node0.y) && Geometry.isSameCoordinate(y, node1.y))\n return node0;\n if (Geometry.isSameCoordinate(dy, 0.0))\n return undefined;\n // parametric equation of line is (1-t)y0 + ty1 which is equal to y at the intersection so\n // (1-t)y0 + ty1 = y or t = (y-y0)/(y1-y0)\n return Geometry.conditionalDivideFraction(y - node0.y, dy);\n }\n /**\n * Compute fractional position (inside 0..1) of the intersection of a horizontal line with an edge.\n * * If fractional position is outside 0..1, return `undefined`.\n * * If the edge is horizontal return `undefined` (no test for horizontal at y).\n * @param node0 base node of edge.\n * @param y y coordinate of the horizontal line.\n */\n public static horizontalScanFraction01(node0: HalfEdge, y: number): number | undefined {\n const node1 = node0.faceSuccessor;\n const dy = node1.y - node0.y;\n if (Geometry.isSameCoordinate(y, node0.y) && Geometry.isSameCoordinate(y, node1.y))\n return undefined;\n if (Geometry.isSameCoordinate(dy, 0.0))\n return undefined;\n const fraction = Geometry.conditionalDivideFraction(y - node0.y, dy);\n if (fraction !== undefined && fraction >= 0.0 && fraction <= 1.0)\n return fraction;\n return undefined;\n }\n /**\n * Copy various data from source to `this`.\n * @param source source half edge.\n * @param copyXYZ true to copy xyz coordinates.\n * @param copyVertexData true to copy data belonging to the vertex (i.e. the `i` member).\n * @param copyEdgeData true to copy data belonging to the edge (i.e. edge masks, `edgeTag`).\n * @param copyFaceData true to copy `faceTag`.\n */\n public copyDataFrom(\n source: HalfEdge, copyXYZ: boolean, copyVertexData: boolean, copyEdgeData: boolean, copyFaceData: boolean,\n ): void {\n if (copyXYZ) {\n this.x = source.x;\n this.y = source.y;\n this.z = source.z;\n }\n if (copyVertexData)\n this.i = source.i;\n if (copyEdgeData)\n HalfEdge.transferEdgeProperties(source, this);\n if (copyFaceData)\n this.faceTag = source.faceTag;\n }\n /**\n * Is the instance's face loop a split-washer type face?\n * * A split-washer face contains at least one bridge edge.\n * * A bridge edge and its edge mate have the same `bridgeMask` and live in the same face loop.\n * * By connecting hole/outer loops with bridge edges, a split-washer face can represent a parity region.\n * @param bridgeMask mask preset on bridge edges (default is [[HalfEdgeMask.BRIDGE_EDGE]]).\n */\n public isSplitWasherFace(bridgeMask: HalfEdgeMask = HalfEdgeMask.BRIDGE_EDGE): boolean {\n if (!this.countMaskAroundFace(HalfEdgeMask.BRIDGE_EDGE))\n return false;\n const bridges = new OrderedSet<HalfEdge>((a: HalfEdge, b: HalfEdge) => a.id - b.id);\n let node: HalfEdge = this;\n do {\n if (node.isMaskSet(bridgeMask))\n bridges.add(node);\n node = node.faceSuccessor;\n } while (node !== this);\n if (bridges.size === 0)\n return false;\n for (const bridge of bridges) {\n if (!bridges.has(bridge.edgeMate) || !bridge.edgeMate.isMaskSet(bridgeMask))\n return false;\n }\n return true;\n }\n}\n\n/**\n * A HalfEdgeGraph has:\n * * An array of (pointers to) HalfEdge objects.\n * * A pool of masks for grab/drop used by algorithms.\n * @internal\n */\nexport class HalfEdgeGraph {\n /** Simple array with pointers to all the half edges in the graph. */\n public allHalfEdges: HalfEdge[];\n private _maskManager: MaskManager;\n private _numNodesCreated = 0;\n public constructor() {\n this.allHalfEdges = [];\n this._maskManager = MaskManager.create(HalfEdgeMask.ALL_GRAB_DROP_MASKS)!;\n }\n /**\n * Ask for a mask (from the graph's free pool) for caller's use.\n * @param clearInAllHalfEdges optionally clear the mask throughout the graph (default `true`).\n */\n public grabMask(clearInAllHalfEdges: boolean = true): HalfEdgeMask {\n const mask = this._maskManager.grabMask();\n if (clearInAllHalfEdges) {\n this.clearMask(mask);\n }\n return mask;\n }\n /** Return `mask` to the free pool. */\n public dropMask(mask: HalfEdgeMask) {\n this._maskManager.dropMask(mask);\n }\n /**\n * Create 2 half edges forming 2 vertices, 1 edge, and 1 face.\n * * The two half edges are joined as edgeMate pair.\n * * The two half edges are a 2-half-edge face loop in both the faceSuccessor and facePredecessor directions.\n * * The two half edges are added to the graph's HalfEdge set.\n * @returns pointer to the first half edge created.\n */\n public createEdgeXYZXYZ(\n xA: number = 0, yA: number = 0, zA: number = 0, iA: number = 0,\n xB: number = 0, yB: number = 0, zB: number = 0, iB: number = 0,\n ): HalfEdge {\n return HalfEdge.createHalfEdgePairWithCoordinates(xA, yA, zA, iA, xB, yB, zB, iB, this.allHalfEdges);\n }\n /**\n * Create 2 half edges forming 2 vertices, 1 edge, and 1 face.\n * * The two half edges are joined as edgeMate pair.\n * * The two half edges are a 2-half-edge face loop in both the faceSuccessor and facePredecessor directions.\n * * The two half edges are added to the graph's HalfEdge set.\n * * Coordinates are set to zero.\n * @param iA `i` property of the first created HalfEdge\n * @param iB `i` property of the second created HalfEdge\n * @returns pointer to the first half edge created, with `i` property set to iA.\n */\n public createEdgeIdId(iA: number = 0, iB: number = 0): HalfEdge {\n return HalfEdge.createHalfEdgePairWithCoordinates(0.0, 0.0, 0.0, iA, 0.0, 0.0, 0.0, iB, this.allHalfEdges);\n }\n /**\n * Create an edge from coordinates x,y,z connected to the graph at the vertex of the given `node`.\n * @returns pointer to the dangling node at x,y,z.\n */\n public createEdgeXYZHalfEdge(\n xA: number = 0,\n yA: number = 0,\n zA: number = 0,\n iA: number = 0,\n node: HalfEdge,\n iB: number = 0,\n ): HalfEdge {\n // Visualization can be found at geometry/internaldocs/Graph.md\n const a = HalfEdge.createHalfEdgePairWithCoordinates(xA, yA, zA, iA, node.x, node.y, node.z, iB, this.allHalfEdges);\n const b = a.faceSuccessor;\n HalfEdge.pinch(node, b);\n return a;\n }\n /**\n * Create an edge from the vertex of `nodeA` to the vertex of `nodeB`.\n * @returns pointer to the new half edge at the vertex of `nodeA`.\n */\n public createEdgeHalfEdgeHalfEdge(nodeA: HalfEdge, idA: number, nodeB: HalfEdge, idB: number = 0): HalfEdge {\n // visualization can be found at geometry/internaldocs/Graph.md\n const a = HalfEdge.createHalfEdgePairWithCoordinates(\n nodeA.x, nodeA.y, nodeA.z, idA, nodeB.x, nodeB.y, nodeB.z, idB, this.allHalfEdges,\n );\n const b = a.faceSuccessor;\n HalfEdge.pinch(nodeA, a);\n HalfEdge.pinch(nodeB, b);\n return a;\n }\n /**\n * Create 2 half edges forming 2 vertices, 1 edge, and 1 face\n * * The two half edges are joined as edgeMate pair.\n * * The two half edges are a 2-half-edge face loop in both the faceSuccessor and facePredecessor directions.\n * * The two half edges are added to the graph's HalfEdge set.\n * @returns pointer to the first half edge created, with coordinates `xyz0`.\n */\n public createEdgeXYAndZ(xyz0: XYAndZ, id0: number, xyz1: XYAndZ, id1: number): HalfEdge {\n return HalfEdge.createHalfEdgePairWithCoordinates(\n xyz0.x, xyz0.y, xyz0.z, id0, xyz1.x, xyz1.y, xyz1.z, id1, this.allHalfEdges,\n );\n }\n /**\n * Create a new vertex within the edge beginning at `base`.\n * * This creates two new nodes in their own vertex loop.\n * * If the base is `undefined`, create a single-edge loop.\n * * Existing nodes stay in their face and vertex loops and retain xyz and i values.\n * * Unlike [[pinch]], this breaks the edgeMate pairing of the input edge:\n * each node of the input edge gets a new node as its edge mate.\n * * On each side of the edge, if edgeTag is present, it is copied to the new node on that side.\n * @returns reference to the half edge created, the new face successor of `base`.\n */\n public splitEdge(base: undefined | HalfEdge, xA: number = 0, yA: number = 0, zA: number = 0, iA: number = 0): HalfEdge {\n return HalfEdge.splitEdge(base, xA, yA, zA, iA, this.allHalfEdges);\n }\n /**\n * Create a new sliver face \"inside\" an existing edge.\n * * This creates two nodes that are each face predecessor and successor to the other.\n * * Existing nodes stay in their face and vertex loops and retain xyz and i values.\n * * Unlike [[pinch]], this breaks the edgeMate pairing of the input edge:\n * each node of the input edge gets a new node as its edge mate.\n * * New nodes get the xyz and i values shared by the nodes in the vertex loops into which they are placed.\n * * New nodes' faceTag and edgeTag are `undefined`.\n * @returns reference to the half edge created in the vertex loop of baseA.\n */\n public splitEdgeCreateSliverFace(base: HalfEdge): HalfEdge {\n return HalfEdge.splitEdgeCreateSliverFace(base, this.allHalfEdges);\n }\n /**\n * Create a new vertex within the edge beginning at `base`, with coordinates specified by a fraction along the edge.\n * * This creates two new nodes in their own vertex loop.\n * * Existing nodes stay in their face and vertex loops and retain xyz and i values.\n * * Unlike [[pinch]], this breaks the edgeMate pairing of the input edge:\n * each node of the input edge gets a new node as its edge mate.\n * * On each side of the edge, if edgeTag is present, it is copied to the new node on that side.\n * @returns reference to the half edge created, the new face successor of `base`.\n */\n public splitEdgeAtFraction(base: HalfEdge, fraction: number): HalfEdge {\n return HalfEdge.splitEdge(\n base, base.fractionToX(fraction), base.fractionToY(fraction), base.fractionToZ(fraction), 0, this.allHalfEdges,\n );\n }\n /**\n * This is a destructor-like action that eliminates all inter-connections among the graph's nodes.\n * After this is called, the graph is unusable.\n */\n public decommission() {\n for (const node of this.allHalfEdges) {\n node.decommission();\n }\n this.allHalfEdges.length = 0;\n (this.allHalfEdges as any) = undefined;\n }\n /**\n * Create two nodes of a new edge.\n * @returns the reference to the new node at (x0,y0).\n */\n public addEdgeXY(x0: number, y0: number, x1: number, y1: number): HalfEdge {\n const baseNode = HalfEdge.createEdgeXYXY(this._numNodesCreated, x0, y0, this._numNodesCreated + 1, x1, y1);\n this._numNodesCreated += 2;\n this.allHalfEdges.push(baseNode);\n this.allHalfEdges.push(baseNode.faceSuccessor);\n return baseNode;\n }\n /** Clear selected `mask` bits in all nodes of the graph. */\n public clearMask(mask: HalfEdgeMask) {\n for (const node of this.allHalfEdges)\n node.maskBits &= ~mask;\n }\n /** Set selected `mask` bits in all nodes of the graph. */\n public setMask(mask: HalfEdgeMask) {\n for (const node of this.allHalfEdges)\n node.maskBits |= mask;\n }\n /** Toggle selected `mask` bits in all nodes of the graph. */\n public reverseMask(mask: HalfEdgeMask) {\n for (const node of this.allHalfEdges) {\n node.maskBits ^= mask;\n }\n }\n /**\n * Return the number of nodes that have a specified mask bit set.\n * @param mask mask to count\n */\n public countMask(mask: HalfEdgeMask): number {\n let n = 0;\n for (const node of this.allHalfEdges)\n if (node.isMaskSet(mask))\n n++;\n return n;\n }\n /**\n * Return an array of LineSegment3d.\n * * The array has one segment per edge.\n * * The coordinates are taken from a node and its face successor.\n * * On each edge, the line segment starts at the HalfEdge with lower ID than its edgeMate.\n */\n public collectSegments(): LineSegment3d[] {\n const segments: LineSegment3d[] = [];\n for (const node of this.allHalfEdges) {\n if (node.id < node.edgeMate.id)\n segments.push(\n LineSegment3d.create(\n Point3d.create(node.x, node.y),\n Point3d.create(node.faceSuccessor.x, node.faceSuccessor.y),\n ),\n );\n }\n return segments;\n }\n /** Returns the number of vertex loops in a graph structure. */\n public countVertexLoops(): number {\n let count = 0;\n this.announceVertexLoops(\n (_graph: HalfEdgeGraph, _seed: HalfEdge) => {\n count++;\n return true;\n },\n );\n return count;\n }\n /** Returns the number of face loops in a graph structure. */\n public countFaceLoops(): number {\n let count = 0;\n this.announceFaceLoops(\n (_graph: HalfEdgeGraph, _seed: HalfEdge) => {\n count++;\n return true;\n },\n );\n return count;\n }\n /** Returns the number of face loops satisfying a filter function with mask argument. */\n public countFaceLoopsWithMaskFilter(filter: HalfEdgeAndMaskToBooleanFunction, mask: HalfEdgeMask): number {\n let count = 0;\n this.announceFaceLoops(\n (_graph: HalfEdgeGraph, seed: HalfEdge) => {\n if (filter(seed, mask))\n count++;\n return true;\n },\n );\n return count;\n }\n /** Returns an array of nodes, where each node represents a starting point of a vertex loop. */\n public collectVertexLoops(): HalfEdge[] {\n const returnArray: HalfEdge[] = [];\n this.announceVertexLoops(\n (_graph: HalfEdgeGraph, node: HalfEdge) => {\n returnArray.push(node);\n return true;\n },\n );\n return returnArray;\n }\n /** Returns an array of nodes, where each node represents a starting point of a face loop. */\n public collectFaceLoops(): HalfEdge[] {\n const returnArray: HalfEdge[] = [];\n this.announceFaceLoops(\n (_graph: HalfEdgeGraph, node: HalfEdge) => {\n returnArray.push(node);\n return true;\n },\n );\n return returnArray;\n }\n /**\n * Visit each vertex loop of the graph once.\n * * Call the `announceVertex` function.\n * * Continue search if `announceVertex(graph, node)` returns `true`.\n * * Terminate search if `announceVertex(graph, node)` returns `false`.\n * @param announceVertex function to apply at one node of each vertex.\n */\n public announceVertexLoops(announceVertex: GraphNodeFunction): void {\n this.clearMask(HalfEdgeMask.VISITED);\n for (const node of this.allHalfEdges) {\n if (node.getMask(HalfEdgeMask.VISITED))\n continue;\n node.setMaskAroundVertex(HalfEdgeMask.VISITED);\n if (!announceVertex(this, node))\n break;\n }\n }\n /**\n * Visit each facet of the graph once.\n * * Call the `announceFace` function.\n * * Continue search if `announceFace(graph, node)` returns `true`.\n * * Terminate search if `announceFace(graph, node)` returns `false`.\n * @param announceFace function to apply at one node of each face.\n */\n public announceFaceLoops(announceFace: GraphNodeFunction): void {\n this.clearMask(HalfEdgeMask.VISITED);\n for (const node of this.allHalfEdges) {\n if (node.getMask(HalfEdgeMask.VISITED))\n continue;\n node.setMaskAroundFace(HalfEdgeMask.VISITED);\n if (!announceFace(this, node))\n break;\n }\n }\n /**\n * Visit each edge of the graph once.\n * * Call the `announceEdge` function.\n * * The edge mate will NOT appear in an announceEdge call.\n * * Continue search if `announceEdge(graph, node)` returns `true`.\n * * Terminate search if `announceEdge(graph, node)` returns `false`.\n * @param announceEdge function to apply at one node of each edge.\n */\n public announceEdges(announceEdge: GraphNodeFunction): void {\n this.clearMask(HalfEdgeMask.VISITED);\n for (const node of this.allHalfEdges) {\n if (node.getMask(HalfEdgeMask.VISITED))\n continue;\n const mate = node.edgeMate;\n node.setMask(HalfEdgeMask.VISITED);\n mate.setMask(HalfEdgeMask.VISITED);\n if (!announceEdge(this, node))\n break;\n }\n }\n /**\n * Visit each half edge (node) of the graph once.\n * * Call the `announceNode` function.\n * * Continue search if `announceNode(graph, node)` returns `true`.\n * * Terminate search if `announceNode(graph, node)` returns `false`.\n * @param announceNode function to apply at each node.\n */\n public announceNodes(announceNode: GraphNodeFunction): void {\n for (const node of this.allHalfEdges) {\n if (!announceNode(this, node))\n break;\n }\n }\n /** Return the number of nodes in the graph. */\n public countNodes(): number {\n return this.allHalfEdges.length;\n }\n /** Apply transform to the xyz coordinates in the graph. */\n public transformInPlace(transform: Transform): void {\n for (const node of this.allHalfEdges) {\n transform.multiplyXYAndZInPlace(node);\n }\n }\n /**\n * Disconnect and delete all nodes that satisfy a filter condition.\n * @param deleteThisNode returns true to delete the corresponding node. Should act symmetrically on the edgeMate.\n * @returns the number of nodes deleted (twice the number of deleted edges).\n */\n public yankAndDeleteEdges(deleteThisNode: NodeFunction): number {\n const numTotal = this.allHalfEdges.length;\n let numAccepted = 0;\n for (let i = 0; i < numTotal; i++) {\n const candidate = this.allHalfEdges[i];\n if (!deleteThisNode(candidate))\n this.allHalfEdges[numAccepted++] = candidate; // overwrite a previously \"deleted node\"\n else\n candidate.yankFromVertexLoop(); // assume callback symmetry so we eventually yank the mate\n }\n const numDeleted = numTotal - numAccepted;\n this.allHalfEdges.length = numAccepted;\n return numDeleted;\n }\n /**\n * Delete all isolated edges.\n * @return the number of nodes deleted (twice the number of deleted edges).\n */\n public deleteIsolatedEdges(): number {\n const numTotal = this.allHalfEdges.length;\n let numAccepted = 0;\n for (let i = 0; i < numTotal; i++) {\n const candidate = this.allHalfEdges[i];\n if (!candidate.isIsolatedEdge) {\n this.allHalfEdges[numAccepted++] = candidate;\n }\n }\n const numDeleted = numTotal - numAccepted;\n this.allHalfEdges.length = numAccepted;\n return numDeleted;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"Graph.js","sourceRoot":"","sources":["../../../src/topology/Graph.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F;;GAEG;AAEH,sDAAyD;AACzD,0DAAuD;AACvD,0CAAuC;AACvC,+CAA4C;AAC5C,mEAAkE;AAClE,mEAAkE;AAGlE,yDAAsD;AACtD,+CAA4C;AAE5C,oFAAoF;AAEpF,qDAAqD;AAErD;;;;;;;;;;;GAWG;AACH,IAAY,YAuCX;AAvCD,WAAY,YAAY;IACtB;;;;;MAKE;IACF,+DAA+D;IAC/D,uDAAqB,CAAA;IACrB;;;;OAIG;IACH,+DAA+D;IAC/D,iEAA0B,CAAA;IAC1B;;;;;OAKG;IACH,+DAAyB,CAAA;IACzB,iFAAiF;IACjF,6DAAwB,CAAA;IACxB,2EAA2E;IAC3E,wEAA6B,CAAA;IAC7B,wDAAwD;IACxD,2EAA8B,CAAA;IAC9B,2CAA2C;IAC3C,2DAAsB,CAAA;IACtB,uFAAuF;IACvF,yDAAoB,CAAA;IACpB,oBAAoB;IACpB,yDAAsB,CAAA;IACtB,oEAAoE;IACpE,sFAAgC,CAAA;IAChC,oBAAoB;IACpB,gEAAqB,CAAA;AACvB,CAAC,EAvCW,YAAY,4BAAZ,YAAY,QAuCvB;AAiDD;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAa,QAAQ;IACn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AAE,CAAC,CAAC;gBACrC,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,GAAG,QAAQ;oBACzC,QAAQ,GAAG,KAAK,CAAC;YACrB,CAAC,CACF,CAAC;YACF,IAAI,CAAC,mBAAmB,CAAC,CAAC,CAAW,EAAE,EAAE,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,QAAQ,CAAC,CAAC,CAAC;YAC5E,OAAO,IAAI,CAAC;QACd,CAAC,CACF,CAAC;QACF,OAAO,YAAY,CAAC;IACtB,CAAC;CACF;AApaD,sCAoaC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\n/** @packageDocumentation\r\n * @module Topology\r\n */\r\n\r\nimport { assert, OrderedSet } from \"@itwin/core-bentley\";\r\nimport { LineSegment3d } from \"../curve/LineSegment3d\";\r\nimport { Geometry } from \"../Geometry\";\r\nimport { Angle } from \"../geometry3d/Angle\";\r\nimport { Point2d, Vector2d } from \"../geometry3d/Point2dVector2d\";\r\nimport { Point3d, Vector3d } from \"../geometry3d/Point3dVector3d\";\r\nimport { Transform } from \"../geometry3d/Transform\";\r\nimport { WritableXYAndZ, XAndY, XYAndZ } from \"../geometry3d/XYZProps\";\r\nimport { SmallSystem } from \"../numerics/SmallSystem\";\r\nimport { MaskManager } from \"./MaskManager\";\r\n\r\n// import { GraphChecker } from \"../test/topology/Graph.test\"; // used for debugging\r\n\r\n/* eslint-disable @typescript-eslint/no-this-alias */\r\n\r\n/**\r\n * * Each node of the graph has a mask member.\r\n * * The mask member is a number which is used as set of single bit boolean values.\r\n * * Particular meanings of the various bits are HIGHLY application dependent.\r\n * * The EXTERIOR mask bit is widely used to mark nodes that are \"outside\" the active areas\r\n * * The PRIMARY_EDGE bit is widely used to indicate linework created directly from input data, hence protected from\r\n * triangle edge flipping.\r\n * * The BOUNDARY bit is widely used to indicate that crossing this edge is a transition from outside to inside.\r\n * * VISITED is used locally in many searches.\r\n * * Never use VISITED unless the search logic is highly self contained.\r\n * @internal\r\n */\r\nexport enum HalfEdgeMask {\r\n /**\r\n * Mask commonly set consistently around exterior faces.\r\n * * A boundary edge with interior to one side, exterior to the other, will have EXTERIOR only on the outside.\r\n * * An edge inserted \"within a purely exterior face\" can have EXTERIOR on both sides.\r\n * * An interior edge (such as added during triangulation) will have no EXTERIOR bits.\r\n */\r\n // Visualization can be found at geometry/internaldocs/Graph.md\r\n EXTERIOR = 0x00000001,\r\n /**\r\n * Mask commonly set (on both sides) of original geometry edges that are transition from outside to inside.\r\n * * At the moment of creating an edge from primary user boundary loop coordinates, the fact that an edge is BOUNDARY\r\n * is often clear even though there is uncertainty about which side should be EXTERIOR.\r\n */\r\n // Visualization can be found at geometry/internaldocs/Graph.md\r\n BOUNDARY_EDGE = 0x00000002,\r\n /**\r\n * Mask commonly set (on both sides) of original geometry edges, but NOT indicating that the edge is certainly a\r\n * boundary between outside and inside.\r\n * * For instance, if geometry is provided as stray sticks (not loops), it can be marked PRIMARY_EDGE but neither\r\n * BOUNDARY_EDGE nor EXTERIOR_EDGE.\r\n */\r\n PRIMARY_EDGE = 0x00000004,\r\n /** Mask set on both sides of a bridge edge added by algorithms to join loops. */\r\n BRIDGE_EDGE = 0x00000008,\r\n /** Mask set on both sides of an edge added during graph regularization. */\r\n REGULARIZED_EDGE = 0x00000010,\r\n /** Mask applied to triangles by earcut triangulator. */\r\n TRIANGULATED_FACE = 0x00000100,\r\n /** Mask applied in a face with 2 edges. */\r\n NULL_FACE = 0x00000200,\r\n /** Temporary mask used for low level searches to identify previously-visited nodes. */\r\n VISITED = 0x00010000,\r\n /** No mask bits. */\r\n NULL_MASK = 0x00000000,\r\n /** The \"upper 12\" bits of 32 bit integer reserved for grab/drop. */\r\n ALL_GRAB_DROP_MASKS = 0xFFF00000,\r\n /** All mask bits */\r\n ALL_MASK = 0xFFFFFFFF,\r\n}\r\n\r\n/**\r\n * Function signature for function of one node with no return type restrictions.\r\n * @internal\r\n */\r\nexport type NodeFunction = (node: HalfEdge) => any;\r\n/**\r\n * Function signature for function of one node, returning a number.\r\n * @internal\r\n */\r\nexport type NodeToNumberFunction = (node: HalfEdge) => number;\r\n/**\r\n * Function signature for function of one node, returning a boolean.\r\n * @internal\r\n */\r\nexport type HalfEdgeToBooleanFunction = (node: HalfEdge) => boolean;\r\n/**\r\n * Function signature for function of a node and a mask, returning a boolean.\r\n * @internal\r\n */\r\nexport type HalfEdgeAndMaskToBooleanFunction = (node: HalfEdge, mask: HalfEdgeMask) => boolean;\r\n/**\r\n * Function signature for function of a graph and a node, returning a boolean.\r\n * @internal\r\n */\r\nexport type GraphNodeFunction = (graph: HalfEdgeGraph, node: HalfEdge) => boolean;\r\n/**\r\n * Non-topological data members in a half edge.\r\n * These are not part of adjacency and masking logic.\r\n * Member fields for a half edge (which is also commonly called a node).\r\n * @internal\r\n */\r\nexport interface HalfEdgeUserData extends WritableXYAndZ {\r\n /** Angle used for sort-around-vertex. */\r\n sortAngle?: number;\r\n /** Numeric value for application-specific tagging (e.g. sorting). */\r\n sortData?: number;\r\n /**\r\n * Application-specific data for the edge identifier.\r\n * * Edge split operations are expected to copy this to new sub-edges.\r\n */\r\n edgeTag?: any;\r\n /**\r\n * Application-specific data for the face loop.\r\n * * Face split operations are expected to copy this to new nodes in the face.\r\n */\r\n faceTag?: any;\r\n}\r\n/**\r\n * A HalfEdge is \"one side of an edge\" in a structure of faces, edges and vertices. From a node there are\r\n * navigational links to:\r\n * * \"faceSuccessor\" -- the next half edge in a loop around a face.\r\n * * \"facePredecessor\" -- the previous half edge in a loop around a face.\r\n * * \"edgeMate\" -- the node's partner on the other side of the edge.\r\n *\r\n * The next, prev, and mate are the essential connectivity. Additional node content is for application-specific\r\n * uses. The most useful ones are:\r\n * * x,y -- coordinates in the xy plane\r\n * * z -- z coordinate. This is normally ignored during planar setup, but used for output.\r\n * * maskBits -- an integer value manipulated as individual bits.\r\n *\r\n * In properly connected planar graph, interior face loops are counterclockwise. But that property (along with\r\n * expected masking) is a result of extensive validation of inputs, and is not true in intermediate phases of\r\n * graph manipulation.\r\n * @internal\r\n */\r\nexport class HalfEdge implements HalfEdgeUserData {\r\n /** Vertex index in some parent object's numbering. */\r\n public i: number;\r\n /**\r\n * Bitmask bits, used to set multiple flags on a node, indicating e.g., nodes on boundary edges, or in\r\n * an exterior face, or nodes visited during graph computations.\r\n * * See [[HalfEdgeMask]] for mask values.\r\n */\r\n public maskBits: number;\r\n /** Vertex x coordinate. */\r\n public x: number;\r\n /** Vertex y coordinate. */\r\n public y: number;\r\n /** Vertex z coordinate. */\r\n public z: number;\r\n /** Angle used for sort-around-vertex */\r\n public sortAngle?: number;\r\n /** Numeric value for application-specific tagging (e.g. sorting) */\r\n public sortData?: number;\r\n /**\r\n * Application-specific data for the edge identifier.\r\n * * edge split operations are expected to copy this to new sub-edges.\r\n */\r\n public edgeTag?: any;\r\n /**\r\n * Application-specific data for the face loop.\r\n * * Face split operations are expected to copy this to new nodes in the face.\r\n */\r\n public faceTag?: any;\r\n private _id: number;\r\n /** Immutable ID assigned sequentially during construction --- useful for debugging. */\r\n public get id() {\r\n return this._id;\r\n }\r\n private _facePredecessor: HalfEdge;\r\n private _faceSuccessor: HalfEdge;\r\n private _edgeMate: HalfEdge;\r\n /** Previous half edge \"around the face\" */\r\n public get facePredecessor(): HalfEdge {\r\n return this._facePredecessor;\r\n }\r\n /** Next half edge \"around the face\" */\r\n public get faceSuccessor(): HalfEdge {\r\n return this._faceSuccessor;\r\n }\r\n /** Half edge on the other side of this edge. */\r\n public get edgeMate(): HalfEdge {\r\n return this._edgeMate;\r\n }\r\n /** HalfEdge ids are sequentially assigned per session (not per graph!). */\r\n private static _totalNodesCreated = 0;\r\n private constructor(x: number = 0, y: number = 0, z: number = 0, i: number = 0) {\r\n this._id = HalfEdge._totalNodesCreated++;\r\n if (!Number.isSafeInteger(HalfEdge._totalNodesCreated))\r\n HalfEdge._totalNodesCreated = 0;\r\n this.i = i;\r\n this.maskBits = 0x00000000;\r\n this.x = x;\r\n this.y = y;\r\n this.z = z;\r\n // explicit init to undefined is important for performance here\r\n this.sortAngle = undefined;\r\n this.sortData = undefined;\r\n this.edgeTag = undefined;\r\n this.faceTag = undefined;\r\n // always created in pairs, init here to make TS compiler and JS runtime happy\r\n this._facePredecessor = this;\r\n this._faceSuccessor = this;\r\n this._edgeMate = this;\r\n }\r\n /**\r\n * Take numStep face steps and return y coordinate.\r\n * * Positive steps are through faceSuccessor.\r\n * * Negative steps are through facePredecessor.\r\n */\r\n public faceStepY(numStep: number): number {\r\n let node: HalfEdge = this;\r\n if (numStep > 0)\r\n for (let i = 0; i < numStep; i++)\r\n node = node.faceSuccessor;\r\n else if (numStep < 0)\r\n for (let i = 0; i > numStep; i--)\r\n node = node.facePredecessor;\r\n return node.y;\r\n }\r\n /**\r\n * Create 2 half edges.\r\n * * The two edges are joined as edgeMate pair.\r\n * * The two edges are a 2-half-edge face loop in both the faceSuccessor and facePredecessor directions.\r\n * @returns the reference to the first half edge created.\r\n */\r\n public static createHalfEdgePair(heArray: HalfEdge[] | undefined): HalfEdge {\r\n // Visualization can be found at geometry/internaldocs/Graph.md\r\n const a = new HalfEdge();\r\n const b = new HalfEdge();\r\n if (heArray) {\r\n heArray.push(a);\r\n heArray.push(b);\r\n }\r\n HalfEdge.setFaceLinks(a, b);\r\n HalfEdge.setFaceLinks(b, a);\r\n HalfEdge.setEdgeMates(a, b);\r\n return a;\r\n }\r\n /**\r\n * * Create 2 half edges.\r\n * * The two edges are joined as edgeMate pair.\r\n * * The two edges are a 2-half-edge face loop in both the faceSuccessor and facePredecessor directions.\r\n * * Properties x,y,z,i are inserted in each half edge.\r\n * @returns the reference to the first half edge created, set with \"A\" properties.\r\n */\r\n public static createHalfEdgePairWithCoordinates(\r\n xA: number = 0, yA: number = 0, zA: number = 0, iA: number = 0,\r\n xB: number = 0, yB: number = 0, zB: number = 0, iB: number = 0,\r\n heArray: HalfEdge[] | undefined,\r\n ): HalfEdge {\r\n const a = HalfEdge.createHalfEdgePair(heArray);\r\n const b = a._edgeMate;\r\n a.x = xA;\r\n a.y = yA;\r\n a.z = zA;\r\n a.i = iA;\r\n b.x = xB;\r\n b.y = yB;\r\n b.z = zB;\r\n b.i = iB;\r\n return a;\r\n }\r\n /**\r\n * * Set heA <==> heB pointer relation through heA._faceSuccessor and heB._facePredecessor.\r\n * * This changes heA._faceSuccessor and heB._facePredecessor, but not heA._facePredecessor and heB._faceSuccessor.\r\n * * This must always be done with another call to setFaceLinks(heB,heA) in order to re-establish the entire\r\n * double-linked list.\r\n */\r\n private static setFaceLinks(heA: HalfEdge, heB: HalfEdge) {\r\n heA._faceSuccessor = heB;\r\n heB._facePredecessor = heA;\r\n }\r\n /** set heA <==> heB pointer relation edgeMate. */\r\n private static setEdgeMates(heA: HalfEdge, heB: HalfEdge) {\r\n heA._edgeMate = heB;\r\n heB._edgeMate = heA;\r\n }\r\n /**\r\n * Create a new vertex within the edge beginning at `baseA`.\r\n * * This creates two new nodes in their own vertex loop.\r\n * * If the base is `undefined`, create a single-edge loop.\r\n * * Existing nodes stay in their face and vertex loops and retain xyz and i values.\r\n * * Unlike [[pinch]], this breaks the edgeMate pairing of the input edge:\r\n * each node of the input edge gets a new node as its edge mate.\r\n * * On each side of the edge, if edgeTag is present, it is copied to the new node on that side.\r\n * @returns reference to the half edge created, the new face successor of `baseA`.\r\n */\r\n public static splitEdge(\r\n baseA: undefined | HalfEdge,\r\n xA: number = 0,\r\n yA: number = 0,\r\n zA: number = 0,\r\n iA: number = 0,\r\n heArray: HalfEdge[] | undefined,\r\n ): HalfEdge {\r\n // Visualization can be found at geometry/internaldocs/Graph.md\r\n const newA = new HalfEdge(xA, yA, zA, iA);\r\n const newB = new HalfEdge(xA, yA, zA, iA);\r\n if (heArray) {\r\n heArray.push(newA);\r\n heArray.push(newB);\r\n }\r\n if (baseA === undefined) {\r\n newA._faceSuccessor = newA._facePredecessor = newA;\r\n newB._faceSuccessor = newB._facePredecessor = newB;\r\n HalfEdge.setEdgeMates(newA, newB);\r\n } else {\r\n const nextA = baseA._faceSuccessor;\r\n const mateA = baseA._edgeMate;\r\n const vPredA = mateA._faceSuccessor;\r\n // insert newA and newB between existing half edges\r\n HalfEdge.setFaceLinks(newA, nextA);\r\n HalfEdge.setFaceLinks(baseA, newA);\r\n HalfEdge.setFaceLinks(mateA, newB);\r\n HalfEdge.setFaceLinks(newB, vPredA);\r\n // set correct edge mates\r\n HalfEdge.setEdgeMates(newA, mateA);\r\n HalfEdge.setEdgeMates(newB, baseA);\r\n this.transferEdgeProperties(baseA, newA);\r\n this.transferEdgeProperties(mateA, newB);\r\n }\r\n return newA;\r\n }\r\n /**\r\n * Reverse of [[splitEdge]]: remove the vertex at `doomed` and merge its two incident edges.\r\n * @param doomed one of two nodes added by [[splitEdge]]. These nodes should form a vertex loop of two nodes.\r\n * On successful return this node and its mate are isolated.\r\n * @param checkParallel whether to check that the doomed edge and the preceding edge in its face loop are parallel.\r\n * When passing `true` the assumption is that edge geometry is linear. If nonlinear edge geometry is attached, the\r\n * caller should a) verify that the geometry on either side of the doomed vertex can be merged, and if so, they\r\n * should b) call this method passing `false`, and c) adjust the geometry of the returned edge and its edge mate\r\n * as appropriate.\r\n * @returns the former (surviving) face predecessor of `doomed`, or undefined if the edge can't be healed.\r\n */\r\n public static healEdge(doomed: HalfEdge, checkParallel: boolean = true): HalfEdge | undefined {\r\n if (doomed.isIsolatedEdge)\r\n return undefined;\r\n const doomed1 = doomed.vertexSuccessor;\r\n if (doomed1.vertexSuccessor !== doomed)\r\n return undefined; // v-loop not a 2-cycle\r\n if (checkParallel && !doomed.vectorToFaceSuccessor().isParallelTo(doomed.facePredecessor.vectorToFaceSuccessor(), false, true))\r\n return undefined; // removing this vertex does not leave a straight edge behind\r\n const fPred = doomed.facePredecessor;\r\n const fSucc = doomed.faceSuccessor;\r\n const fPred1 = doomed1.facePredecessor;\r\n const fSucc1 = doomed1.faceSuccessor;\r\n this.setFaceLinks(fPred, fSucc);\r\n this.setFaceLinks(fPred1, fSucc1);\r\n this.setEdgeMates(fPred, fPred1);\r\n this.setFaceLinks(doomed, doomed1);\r\n this.setFaceLinks(doomed1, doomed);\r\n this.setEdgeMates(doomed, doomed1);\r\n return fPred;\r\n }\r\n /**\r\n * Create a new sliver face \"inside\" an existing edge.\r\n * * This creates two nodes that are each face predecessor and successor to the other.\r\n * * Existing nodes stay in their face and vertex loops and retain xyz and i values.\r\n * * Unlike [[pinch]], this breaks the edgeMate pairing of the input edge:\r\n * each node of the input edge gets a new node as its edge mate.\r\n * * New nodes get the xyz and i values shared by the nodes in the vertex loops into which they are placed.\r\n * * New nodes' faceTag and edgeTag are `undefined`.\r\n * @returns reference to the half edge created in the vertex loop of baseA.\r\n */\r\n public static splitEdgeCreateSliverFace(\r\n baseA: HalfEdge,\r\n heArray: HalfEdge[] | undefined,\r\n ): HalfEdge {\r\n // Visualization can be found at geometry/internaldocs/Graph.md\r\n const baseB = baseA.edgeMate;\r\n const newA = new HalfEdge();\r\n const newB = new HalfEdge();\r\n if (heArray) {\r\n heArray.push(newA);\r\n heArray.push(newB);\r\n }\r\n newA._faceSuccessor = newA._facePredecessor = newB;\r\n newB._faceSuccessor = newB._facePredecessor = newA;\r\n HalfEdge.setEdgeMates(newA, baseB);\r\n HalfEdge.setEdgeMates(newB, baseA);\r\n newA.copyDataFrom(baseA, true, true, false, false);\r\n newB.copyDataFrom(baseB, true, true, false, false);\r\n return newA;\r\n }\r\n /** Masks copied when an edge is split. */\r\n private static _edgePropertyMasks: HalfEdgeMask[] = [\r\n HalfEdgeMask.EXTERIOR, HalfEdgeMask.BOUNDARY_EDGE, HalfEdgeMask.PRIMARY_EDGE, HalfEdgeMask.BRIDGE_EDGE, HalfEdgeMask.REGULARIZED_EDGE, HalfEdgeMask.NULL_FACE\r\n ];\r\n /**\r\n * Copy \"edge based\" content of `fromNode` to `toNode`:\r\n * * edgeTag\r\n * * edge masks\r\n */\r\n public static transferEdgeProperties(fromNode: HalfEdge, toNode: HalfEdge): void {\r\n toNode.edgeTag = fromNode.edgeTag;\r\n for (const mask of this._edgePropertyMasks) {\r\n if (fromNode.getMask(mask))\r\n toNode.setMask(mask);\r\n else\r\n toNode.clearMask(mask);\r\n }\r\n }\r\n /** Return the next half edge around this vertex in the CCW direction. */\r\n public get vertexSuccessor(): HalfEdge {\r\n return this.facePredecessor.edgeMate;\r\n }\r\n /** Return the next half edge around this vertex in the CW direction. */\r\n public get vertexPredecessor(): HalfEdge {\r\n return this.edgeMate.faceSuccessor;\r\n }\r\n /**\r\n * Set mask bits on this HalfEdge.\r\n * @param mask mask bits to apply\r\n */\r\n public setMask(mask: HalfEdgeMask): void {\r\n this.maskBits |= mask;\r\n }\r\n /**\r\n * Get mask bits from this HalfEdge.\r\n * @param mask mask bits to query\r\n */\r\n public getMask(mask: HalfEdgeMask): number {\r\n return (this.maskBits & mask);\r\n }\r\n /**\r\n * Clear mask bits from this HalfEdge.\r\n * @param mask mask bits to clear\r\n */\r\n public clearMask(mask: HalfEdgeMask): void {\r\n this.maskBits &= ~mask;\r\n }\r\n /** Set or clear mask bits from this HalfEdge.\r\n * @param mask mask bits\r\n * @param clear whether to clear the mask. Default is false (set the mask).\r\n */\r\n public applyMask(mask: HalfEdgeMask, clear: boolean = false): void {\r\n if (clear)\r\n this.clearMask(mask);\r\n else\r\n this.setMask(mask);\r\n }\r\n /**\r\n * Set a mask at all nodes around a vertex.\r\n * @param mask mask to apply to the half edges around this HalfEdge's vertex loop.\r\n */\r\n public setMaskAroundVertex(mask: HalfEdgeMask): void {\r\n let node: HalfEdge = this;\r\n do {\r\n node.setMask(mask);\r\n node = node.vertexSuccessor;\r\n } while (node !== this);\r\n }\r\n\r\n /** Set x,y,z at all nodes around a vertex. */\r\n public setXYZAroundVertex(x: number, y: number, z: number): void {\r\n let node: HalfEdge = this;\r\n do {\r\n node.x = x;\r\n node.y = y;\r\n node.z = z;\r\n node = node.vertexSuccessor;\r\n } while (node !== this);\r\n }\r\n /**\r\n * Apply a mask to all edges around a face.\r\n * @param mask mask to apply to the half edges around this HalfEdge's face loop.\r\n */\r\n public setMaskAroundFace(mask: HalfEdgeMask): void {\r\n let node: HalfEdge = this;\r\n do {\r\n node.setMask(mask);\r\n node = node.faceSuccessor;\r\n } while (node !== this);\r\n }\r\n /**\r\n * Apply a mask to both sides of an edge.\r\n * @param mask mask to apply to this edge and its edgeMate.\r\n */\r\n public setMaskAroundEdge(mask: HalfEdgeMask): void {\r\n this.setMask(mask);\r\n this.edgeMate.setMask(mask);\r\n }\r\n /**\r\n * Clear a mask on both sides of an edge.\r\n * @param mask mask to clear on this edge and its edgeMate.\r\n */\r\n public clearMaskAroundEdge(mask: HalfEdgeMask): void {\r\n this.clearMask(mask);\r\n this.edgeMate.clearMask(mask);\r\n }\r\n /** Returns the number of edges around this face. */\r\n public countEdgesAroundFace(): number {\r\n let count = 0;\r\n let node: HalfEdge = this;\r\n do {\r\n count++;\r\n node = node.faceSuccessor;\r\n } while (node !== this);\r\n return count;\r\n }\r\n /** Return true if `other` node is in the vertex loop around `this` node. */\r\n public findAroundVertex(other: HalfEdge): boolean {\r\n let node: HalfEdge = this;\r\n do {\r\n if (node === other)\r\n return true;\r\n node = node.vertexSuccessor;\r\n } while (node !== this);\r\n return false;\r\n }\r\n /** Return true if `other` node is in the face loop around `this` node. */\r\n public findAroundFace(other: HalfEdge): boolean {\r\n let node: HalfEdge = this;\r\n do {\r\n if (node === other)\r\n return true;\r\n node = node.faceSuccessor;\r\n } while (node !== this);\r\n return false;\r\n }\r\n /**\r\n * Returns whether the mask is set or unset on all nodes of the face loop.\r\n * @param mask the mask to check.\r\n * @param value true for mask set and false for mask unset.\r\n */\r\n public isMaskedAroundFace(mask: HalfEdgeMask, value: boolean = true): boolean {\r\n let node: HalfEdge = this;\r\n if (value) {\r\n do {\r\n if (!node.isMaskSet(mask))\r\n return false;\r\n node = node.faceSuccessor;\r\n } while (node !== this);\r\n } else {\r\n do {\r\n if (node.isMaskSet(mask))\r\n return false;\r\n node = node.faceSuccessor;\r\n } while (node !== this);\r\n }\r\n return true;\r\n }\r\n /**\r\n * Apply a mask and edgeTag to all edges around a face. Optionally apply it to all edge mates.\r\n * @param mask mask to apply.\r\n * @param tag edgeTag to apply\r\n * @param applyToMate If true, also apply the tag to the edge mates around the face.\r\n */\r\n public setMaskAndEdgeTagAroundFace(mask: HalfEdgeMask, tag: any, applyToMate: boolean = false): void {\r\n let node: HalfEdge = this;\r\n do {\r\n node.setMask(mask);\r\n node.edgeTag = tag;\r\n if (applyToMate) {\r\n const mate = node.edgeMate;\r\n mate.setMask(mask);\r\n mate.edgeTag = tag;\r\n }\r\n node = node.faceSuccessor;\r\n } while (node !== this);\r\n }\r\n /** Returns the number of edges around vertex. */\r\n public countEdgesAroundVertex(): number {\r\n let count = 0;\r\n let node: HalfEdge = this;\r\n do {\r\n count++;\r\n node = node.vertexSuccessor;\r\n } while (node !== this);\r\n return count;\r\n }\r\n /**\r\n * Returns the number of nodes that match (or do not match) the given mask value around this face loop.\r\n * @param mask the mask to check.\r\n * @param value true for mask match and false for mask not match. Default is `true`.\r\n */\r\n public countMaskAroundFace(mask: HalfEdgeMask, value: boolean = true): number {\r\n let count = 0;\r\n let node: HalfEdge = this;\r\n if (value) {\r\n do {\r\n if (node.isMaskSet(mask))\r\n count++;\r\n node = node.faceSuccessor;\r\n } while (node !== this);\r\n } else {\r\n do {\r\n if (!node.isMaskSet(mask))\r\n count++;\r\n node = node.faceSuccessor;\r\n } while (node !== this);\r\n }\r\n return count;\r\n }\r\n /**\r\n * Returns the number of nodes that match (or do not match) the given mask value around this vertex loop.\r\n * @param mask the mask to check.\r\n * @param value true for mask match and false for mask not match.\r\n */\r\n public countMaskAroundVertex(mask: HalfEdgeMask, value: boolean = true): number {\r\n let count = 0;\r\n let node: HalfEdge = this;\r\n if (value) {\r\n do {\r\n if (node.isMaskSet(mask))\r\n count++;\r\n node = node.vertexSuccessor;\r\n } while (node !== this);\r\n } else {\r\n do {\r\n if (!node.isMaskSet(mask))\r\n count++;\r\n node = node.vertexSuccessor;\r\n } while (node !== this);\r\n }\r\n return count;\r\n }\r\n /**\r\n * Returns the first node that matches (or does not match) the given mask value around this vertex loop, starting\r\n * with the instance node and proceeding via `vertexSuccessor`.\r\n * @param mask the mask to check.\r\n * @param value true for mask match and false for mask not match. Default is `true`.\r\n * @param reverse if true, search in reverse order via `vertexPredecessor`. Default is `false`.\r\n */\r\n public findMaskAroundVertex(mask: HalfEdgeMask, value: boolean = true, reverse: boolean = false): HalfEdge | undefined {\r\n let node: HalfEdge = this;\r\n do {\r\n if (node.isMaskSet(mask) === value)\r\n return node;\r\n node = reverse ? node.vertexPredecessor : node.vertexSuccessor;\r\n } while (node !== this);\r\n return undefined;\r\n }\r\n /**\r\n * Returns the first node that matches (or does not match) the given mask value around this face loop, starting\r\n * with the instance node and proceeding via face successors.\r\n * @param mask the mask to check.\r\n * @param value true for mask match and false for mask not match. Default is `true`.\r\n */\r\n public findMaskAroundFace(mask: HalfEdgeMask, value: boolean = true): HalfEdge | undefined {\r\n let node: HalfEdge = this;\r\n do {\r\n if (node.isMaskSet(mask) === value)\r\n return node;\r\n node = node.faceSuccessor;\r\n } while (node !== this);\r\n return undefined;\r\n }\r\n /**\r\n * Returns the first node that matches (or does not match) the given mask value around this edge, starting\r\n * with the instance node and then checking its edge mate.\r\n * @param mask the mask to check.\r\n * @param value true for mask match and false for mask not match.\r\n */\r\n public findMaskAroundEdge(mask: HalfEdgeMask, value: boolean = true): HalfEdge | undefined {\r\n if (this.isMaskSet(mask) === value)\r\n return this;\r\n const mate = this.edgeMate;\r\n if (mate.isMaskSet(mask) === value)\r\n return mate;\r\n return undefined;\r\n }\r\n /**\r\n * Set a mask and return prior value.\r\n * @param mask mask to apply.\r\n */\r\n public testAndSetMask(mask: HalfEdgeMask): number {\r\n const oldMask = this.maskBits & mask;\r\n this.maskBits |= mask;\r\n return oldMask;\r\n }\r\n /**\r\n * Set `this.x`, `this.y`, `this.z` from `node.x`, `node.y`, `node.z`.\r\n * @param node node containing xyz.\r\n */\r\n public setXYZFrom(node: HalfEdge) {\r\n this.x = node.x;\r\n this.y = node.y;\r\n this.z = node.z;\r\n }\r\n /**\r\n * Set `this.x`, `this.y`, `this.z` from `xyz.x`, `xyz.y`, `xyz.z`.\r\n * @param node source with x,y,z properties\r\n */\r\n public setXYZ(xyz: XYAndZ) {\r\n this.x = xyz.x;\r\n this.y = xyz.y;\r\n this.z = xyz.z;\r\n }\r\n /**\r\n * Test if any of the `mask` bits are set in the node's bitMask.\r\n * @return true (as a simple boolean, not a mask) if any bits of the `mask` match bits of the node's bitMask.\r\n */\r\n public isMaskSet(mask: HalfEdgeMask): boolean {\r\n return (this.maskBits & mask) !== 0;\r\n }\r\n /**\r\n * Static method to test if any of the `mask` bits are set in the `node`'s bitMask.\r\n * * This is used as filter in searches.\r\n * @returns `node.isMaskSet(mask)`\r\n */\r\n public static filterIsMaskOn(node: HalfEdge, mask: HalfEdgeMask): boolean {\r\n return node.isMaskSet(mask);\r\n }\r\n /**\r\n * Static method to test if any of the `mask` bits are set in the `node`'s bitMask.\r\n * * This is used as filter in searches.\r\n * @returns `!node.isMaskSet(mask)`\r\n */\r\n public static filterIsMaskOff(node: HalfEdge, mask: HalfEdgeMask): boolean {\r\n return !node.isMaskSet(mask);\r\n }\r\n /**\r\n * Create an edge with initial id,x,y at each end.\r\n * @param x0 x coordinate for first node.\r\n * @param y0 y coordinate for first node.\r\n * @param x1 x coordinate for second node.\r\n * @param y1 y coordinate for second node.\r\n * @returns the reference to the new node at (x0,y0).\r\n */\r\n public static createEdgeXYXY(x0: number, y0: number, x1: number, y1: number): HalfEdge {\r\n const node0 = new HalfEdge(x0, y0);\r\n const node1 = new HalfEdge(x1, y1);\r\n node0._faceSuccessor = node0._facePredecessor = node0._edgeMate = node1;\r\n node1._faceSuccessor = node1._facePredecessor = node1._edgeMate = node0;\r\n return node0;\r\n }\r\n /**\r\n *\"Pinch\" is the universal operator for manipulating a node's next and previous pointers.\r\n * * It is its own inverse: applying it twice on the same inputs (i.e., `pinch(a,b); pinch(a,b);`) gets back to\r\n * where you started.\r\n * * If the inputs are in different face loops, the loops join to one face loop after the pinch.\r\n * * If the inputs are in the same face loop, the loop splits into two face loops after the pinch.\r\n */\r\n public static pinch(nodeA: HalfEdge, nodeB: HalfEdge) {\r\n // Visualization can be found at geometry/internaldocs/Graph.md\r\n if (nodeA !== nodeB) {\r\n const predA = nodeA._facePredecessor;\r\n const predB = nodeB._facePredecessor;\r\n nodeB._facePredecessor = predA;\r\n nodeA._facePredecessor = predB;\r\n predB._faceSuccessor = nodeA;\r\n predA._faceSuccessor = nodeB;\r\n }\r\n }\r\n /** Return whether the edge is dangling at its base. */\r\n public get isDangling(): boolean {\r\n return this.edgeMate.faceSuccessor === this;\r\n }\r\n /**\r\n * Pinch this half edge out of its base vertex loop.\r\n * @return the surviving HalfEdge in the vertex loop or `undefined` if the instance HalfEdge is already dangling.\r\n */\r\n public yankFromVertexLoop(): HalfEdge | undefined {\r\n const other = this.edgeMate.faceSuccessor;\r\n if (other === this)\r\n return undefined;\r\n // at this point \"other\" is the vertex predecessor of \"this\"\r\n HalfEdge.pinch(this, other);\r\n return other;\r\n }\r\n /**\r\n * Turn all pointers to `undefined` so garbage collector can reuse the object.\r\n * * This is to be called only by a Graph object that is being decommissioned.\r\n */\r\n public decommission() {\r\n (this._facePredecessor as any) = undefined;\r\n (this._faceSuccessor as any) = undefined;\r\n (this._edgeMate as any) = undefined;\r\n }\r\n /** Return the node. This identity function is useful as the NodeFunction in collector methods. */\r\n public static nodeToSelf(node: HalfEdge): any {\r\n return node;\r\n }\r\n /** Return the id of a node. Useful for collector methods. */\r\n public static nodeToId(node: HalfEdge): number {\r\n return node.id;\r\n }\r\n /** Return the id of a node as string. Useful for collector methods. */\r\n public static nodeToIdString(node: HalfEdge): string {\r\n return node.id.toString();\r\n }\r\n /** Return the [id, mask, [x,y]] of a node. Useful for collector methods. */\r\n public static nodeToIdMaskXY(node: HalfEdge): { id: number, mask: string, xy: number[] } {\r\n return { id: node.id, mask: HalfEdge.nodeToMaskString(node), xy: [node.x, node.y] };\r\n }\r\n /** Return the [id, mask, [x,y]] of a node as string. Useful for collector methods. */\r\n public static nodeToIdXYString(node: HalfEdge): string {\r\n const s = `${node.id.toString()}+${HalfEdge.nodeToMaskString(node)}[${node.x},${node.y}]`;\r\n return s;\r\n }\r\n /** Return the [id, [x,y,z]] of a node as string. Useful for collector methods. */\r\n public static nodeToIdXYZString(node: HalfEdge): string {\r\n return `[${node.id.toString()}: ${node.x},${node.y},${node.z}]`;\r\n }\r\n /**\r\n * Create a string representation of the mask.\r\n * * Null mask is empty string.\r\n * * Appended characters B,P,X,N are for BOUNDARY_EDGE, PRIMARY_EDGE, EXTERIOR, and NULL_FACE mask bits.\r\n */\r\n public static nodeToMaskString(node: HalfEdge): string {\r\n let s = \"\";\r\n if (node.isMaskSet(HalfEdgeMask.BOUNDARY_EDGE))\r\n s += \"B\";\r\n if (node.isMaskSet(HalfEdgeMask.PRIMARY_EDGE))\r\n s += \"P\";\r\n if (node.isMaskSet(HalfEdgeMask.EXTERIOR))\r\n s += \"X\";\r\n if (node.isMaskSet(HalfEdgeMask.NULL_FACE))\r\n s += \"N\";\r\n return s;\r\n }\r\n /** Return [x,y] with coordinates of node. */\r\n public static nodeToXY(node: HalfEdge): number[] {\r\n return [node.x, node.y];\r\n }\r\n /** Return Vector2d from `this` to face successor (with only xy coordinates). */\r\n public vectorToFaceSuccessorXY(result?: Vector2d): Vector2d {\r\n return Vector2d.create(this.faceSuccessor.x - this.x, this.faceSuccessor.y - this.y, result);\r\n }\r\n /** Return Vector3d from `this` to face successor. */\r\n public vectorToFaceSuccessor(result?: Vector3d): Vector3d {\r\n const other = this.faceSuccessor;\r\n return Vector3d.create(\r\n other.x - this.x,\r\n other.y - this.y,\r\n other.z - this.z,\r\n result,\r\n );\r\n }\r\n /** Return Vector3d from `this` to face successor. */\r\n public vectorToFacePredecessor(result?: Vector3d): Vector3d {\r\n const other = this.facePredecessor;\r\n return Vector3d.create(\r\n other.x - this.x,\r\n other.y - this.y,\r\n other.z - this.z,\r\n result,\r\n );\r\n }\r\n /**\r\n * Test if `spaceNode` is in the sector of `sectorNode`.\r\n * * The sector at `sectorNode` is defined by two rays starting at `sectorNode` and extending along the edges\r\n * owned by `sectorNode` and its face predecessor.\r\n * * In general, this method returns `true` if the coordinates of `spaceNode` are _strictly_ inside this sector\r\n * (not on the rays).\r\n * * Interpretation is whether a viewer at `sectorNode` can see `spaceNode` between the two rays.\r\n * * Degenerate sectors of 180 or 360 degrees have special handling.\r\n */\r\n public static isNodeVisibleInSector(spaceNode: HalfEdge, sectorNode: HalfEdge): boolean {\r\n // remark: fussy details ported from native code. The obscure cases seemed \"unlikely\" at first. But pre-existing\r\n // unit tests for triangulation pinged just about everything. So it really matters to do the \"0\" cases this way\r\n // (as usual, hard coded zero is suspect, but it seems to work nicely in the discrete decisions).\r\n if (sectorNode.vertexSuccessor === sectorNode)\r\n return true;\r\n const successor = sectorNode.faceSuccessor;\r\n const predecessor = sectorNode.facePredecessor;\r\n const successorCross = this.crossProductXYToTargets(sectorNode, successor, spaceNode);\r\n const predecessorCross = this.crossProductXYToTargets(predecessor, sectorNode, spaceNode);\r\n // simplest case: two positives\r\n if (successorCross > 0.0 && predecessorCross > 0.0)\r\n return true;\r\n const sectorCross = this.crossProductXYToTargets(predecessor, sectorNode, successor);\r\n if (predecessorCross <= 0.0 && successorCross <= 0.0) {\r\n if (predecessorCross === 0.0 && successorCross === 0.0 && sectorCross === 0.0) {\r\n // Everything is on a line. If the sector is a degenerate face, nodeP\r\n // can only be in if it is the other node in the degenerate face.\r\n if (predecessor === successor && sectorNode.vertexSuccessor !== sectorNode)\r\n return spaceNode === successor;\r\n // Sector is 360 degrees. Call it in only if vector from predP to sectorP points forward to nodeP.\r\n return HalfEdge.dotProductNodeToNodeVectorsXY(predecessor, sectorNode, sectorNode, spaceNode) > 0.0;\r\n } else {\r\n return false;\r\n }\r\n } else {\r\n if (sectorCross === 0.0 && predecessorCross !== 0.0 && successorCross !== 0.0) {\r\n // The incoming and outgoing edges at the sector are identical direction. We have to decide if this node is\r\n // inside the degenerate face (i.e. a geometrically empty sector) or outside (i.e. a nearly complete sector).\r\n // In the inside case, the face is just two nodes. Exact equality for zero is ok because cross product should\r\n // be using identical coordinates in subtracted terms (all furrow eyebrows in unison).\r\n return predecessor !== successor;\r\n }\r\n return sectorCross < 0.0;\r\n }\r\n }\r\n /** Returns 2D cross product of vectors from `base` to `targetA` and from `base` to `targetB`. */\r\n public static crossProductXYToTargets(base: HalfEdge, targetA: HalfEdge, targetB: HalfEdge): number {\r\n return Geometry.crossProductXYXY(\r\n targetA.x - base.x, targetA.y - base.y,\r\n targetB.x - base.x, targetB.y - base.y,\r\n );\r\n }\r\n /** Returns 2D dot product of vectors from `baseA` to `targetA` and from `baseB` to `targetB`. */\r\n public static dotProductNodeToNodeVectorsXY(baseA: HalfEdge, targetA: HalfEdge, baseB: HalfEdge, targetB: HalfEdge): number {\r\n return Geometry.dotProductXYXY(\r\n targetA.x - baseA.x, targetA.y - baseA.y,\r\n targetB.x - baseB.x, targetB.y - baseB.y,\r\n );\r\n }\r\n /** Return 2D cross product of vectors from `nodeA` to `nodeB` and from `nodeB` to `nodeC`. */\r\n public static crossProductXYAlongChain(nodeA: HalfEdge, nodeB: HalfEdge, nodeC: HalfEdge): number {\r\n return Geometry.crossProductXYXY(\r\n nodeB.x - nodeA.x, nodeB.y - nodeA.y,\r\n nodeC.x - nodeB.x, nodeC.y - nodeB.y,\r\n );\r\n }\r\n /**\r\n * Compute whether the sector defined by the chain of nodes is convex.\r\n * * This function is determining if, in the traversal of the HalfEdges in a face loop, a corner makes a left turn\r\n * (convex) or a right turn (not-convex). Note that if we have a convex face, then to traverse it in ccw orientation,\r\n * we always do left turns. However, if the face is not convex, we make both left and right turns.\r\n * * This computation ignores z-coordinates and connectivity, so the nodes are not required to be in the same face loop.\r\n * @param nodeA the first node in the chain, nominally the face predecessor of nodeB.\r\n * @param nodeB the second node in the chain; the node at the sector vertex.\r\n * @param nodeC the third node in the chain, nominally the face successor of nodeB.\r\n * @param signedAreaTol optional signed area tolerance to use in test for parallel vectors. Typically this is a\r\n * fraction of the sector's face's signed area. We can't compute area here, so if `undefined`, zero tolerance is used.\r\n * @returns true iff the sector is convex. A degenerate sector, where the incident edges overlap, returns false.\r\n */\r\n public static isSectorConvex(nodeA: HalfEdge, nodeB: HalfEdge, nodeC: HalfEdge, signedAreaTol: number = 0): boolean {\r\n const signedSectorArea = 0.5 * HalfEdge.crossProductXYAlongChain(nodeA, nodeB, nodeC);\r\n signedAreaTol = signedAreaTol ?? 0.0;\r\n if (Math.abs(signedSectorArea) <= Math.abs(signedAreaTol)) {\r\n // the sector vectors are nearly parallel or anti-parallel; only the former is deemed convex.\r\n return HalfEdge.dotProductNodeToNodeVectorsXY(nodeA, nodeB, nodeB, nodeC) > 0.0;\r\n }\r\n // // sector is convex if the area is positive. Call it convex even if we are a little bit on the other side of zero.\r\n return signedSectorArea > -signedAreaTol;\r\n }\r\n /**\r\n * Compute whether the sector at this node is convex.\r\n * * This function is determining if, in the traversal of the HalfEdges in a face loop, a corner makes a left turn\r\n * (convex) or a right turn (not-convex). Note that if we have a convex face, then to traverse it in ccw orientation,\r\n * we always do left turns. However, if the face is not convex, we make both left and right turns.\r\n * * This computation ignores z-coordinates.\r\n * @param signedAreaTol optional signed area tolerance to use in test for parallel vectors. If `undefined`, a fraction\r\n * (`Geometry.smallMetricDistanceSquared`) of the computed signed area is used. Pass 0 to skip toleranced computation.\r\n * @returns true iff the sector is convex. A degenerate sector, where the incident edges overlap, returns false.\r\n */\r\n public isSectorConvex(signedAreaTol?: number): boolean {\r\n if (signedAreaTol === undefined)\r\n signedAreaTol = Geometry.smallMetricDistanceSquared * this.signedFaceArea();\r\n return HalfEdge.isSectorConvex(this.facePredecessor, this, this.faceSuccessor, signedAreaTol);\r\n }\r\n /**\r\n * Compute whether this face is convex.\r\n * * Note that if we have a convex face, then to traverse it in ccw orientation, we always do left turns.\r\n * However, if the face is not convex, we make both left and right turns.\r\n * * This computation ignores z-coordinates.\r\n * @param tolerance optional relative tolerance to use in test for parallel vectors. Default value is\r\n * `Geometry.smallMetricDistanceSquared`. Pass 0 to skip toleranced computation.\r\n * @returns true iff this face is convex.\r\n */\r\n public isFaceConvex(tolerance: number = Geometry.smallMetricDistanceSquared): boolean {\r\n let node: HalfEdge = this;\r\n const signedAreaTol = tolerance > 0.0 ? tolerance * node.signedFaceArea() : 0.0;\r\n do {\r\n if (!node.isSectorConvex(signedAreaTol))\r\n return false;\r\n node = node.faceSuccessor;\r\n } while (node !== this);\r\n return true;\r\n }\r\n /** Isolate the edge from the graph by yanking each end from its vertex loop. */\r\n public isolateEdge(): void {\r\n const mate = this.edgeMate;\r\n this.yankFromVertexLoop();\r\n mate.yankFromVertexLoop();\r\n }\r\n /**\r\n * Specify whether this edge is isolated from the rest of the graph.\r\n * * Both edge mates of an isolated edge return true for [[isDangling]].\r\n */\r\n public get isIsolatedEdge(): boolean {\r\n return this === this.vertexSuccessor && this.edgeMate === this.edgeMate.vertexSuccessor;\r\n }\r\n /** Return true if `this` is lexically below `other`. We compare y first, then x, and ignore z. */\r\n public belowYX(other: HalfEdge): boolean {\r\n if (this.y < other.y)\r\n return true;\r\n if (this.y > other.y)\r\n return false;\r\n if (this.x < other.x)\r\n return true;\r\n return false;\r\n }\r\n /** Returns `true` if the node does NOT have `Mask.EXTERIOR_MASK` set. */\r\n public static testNodeMaskNotExterior(node: HalfEdge): boolean {\r\n return !node.isMaskSet(HalfEdgeMask.EXTERIOR);\r\n }\r\n /** Returns `true` if the edge mate has `Mask.EXTERIOR_MASK` set. */\r\n public static testMateMaskExterior(node: HalfEdge): boolean {\r\n return node.edgeMate.isMaskSet(HalfEdgeMask.EXTERIOR);\r\n }\r\n /**\r\n * Returns radians between this edge and its face predecessor edge, using all three coordinates x,y,z and\r\n * given normal to resolve sweep direction.\r\n * * The returned angle is non-negative: 0 <= radians < 2*PI.\r\n */\r\n public static sectorSweepRadiansXYZ(node: HalfEdge, normal: Vector3d): number {\r\n const suc = node.faceSuccessor;\r\n const pred = node.facePredecessor;\r\n return Angle.orientedRadiansBetweenVectorsXYZ(\r\n suc.x - node.x, suc.y - node.y, suc.z - node.z,\r\n pred.x - node.x, pred.y - node.y, pred.z - node.z,\r\n normal.x, normal.y, normal.z,\r\n true,\r\n );\r\n }\r\n /** Returns true if the face has positive area in xy parts. */\r\n public static testFacePositiveAreaXY(node: HalfEdge) {\r\n return node.countEdgesAroundFace() > 2 && node.signedFaceArea() > 0.0;\r\n }\r\n /** Return true if x and y coordinates of `this` and `other` are exactly equal .*/\r\n public isEqualXY(other: XAndY | HalfEdge): boolean {\r\n return this.x === other.x && this.y === other.y;\r\n }\r\n /** Return distance between xy coordinates of `this` and `other` node. */\r\n public distanceXY(other: HalfEdge): number {\r\n return Geometry.distanceXYXY(this.x, this.y, other.x, other.y);\r\n }\r\n /** Return distance between xyz coordinates of `this` and `other` node. */\r\n public distanceXYZ(other: HalfEdge): number {\r\n return Geometry.distanceXYZXYZ(this.x, this.y, this.z, other.x, other.y, other.z);\r\n }\r\n /**\r\n * Search around the instance's face loop for nodes with the specified mask value.\r\n * * Returned nodes satisfy `node.isMaskSet(mask) === value`.\r\n * @param mask target mask.\r\n * @param value target boolean value for mask on half edges (default `true`).\r\n * @param result optional array to be cleared, populated with masked nodes, and returned.\r\n * @return array of masked half edges\r\n */\r\n public collectMaskedEdgesAroundFace(mask: HalfEdgeMask, value: boolean = true, result?: HalfEdge[]): HalfEdge[] {\r\n if (result === undefined)\r\n result = [];\r\n else\r\n result.length = 0;\r\n let node: HalfEdge = this;\r\n do {\r\n if (node.isMaskSet(mask) === value)\r\n result.push(node);\r\n node = node.faceSuccessor;\r\n } while (node !== this);\r\n return result;\r\n }\r\n /**\r\n * Announce edges in the face loop, starting with the instance and proceeding in a `faceSuccessor` traversal.\r\n * @param announceEdge function to call at each edge\r\n */\r\n public announceEdgesInFace(announceEdge: NodeFunction): void {\r\n let node: HalfEdge = this;\r\n do {\r\n announceEdge(node);\r\n node = node.faceSuccessor;\r\n } while (node !== this);\r\n }\r\n /**\r\n * Announce edges in the super face loop, starting with the instance.\r\n * * A super face admits a `faceSuccessor` traversal, where the next edge at the far vertex is the first one lacking `skipMask` in a `vertexPredecessor` traversal.\r\n * @param skipEdge mask preset on edges to skip, or a function that is called to decide whether to skip an edge.\r\n * @param announceEdge function that is called at each edge that is not skipped.\r\n * @param announceSkipped optional function that is called at each edge that is skipped.\r\n * @return whether a super face was found, or `false` if the traversal fails to return to the instance vertex.\r\n */\r\n public announceEdgesInSuperFace(\r\n skipEdge: HalfEdgeMask | HalfEdgeToBooleanFunction, announceEdge: NodeFunction, announceSkipped?: NodeFunction,\r\n ): boolean {\r\n const maxIter = 10000; // safeguard against infinite loops\r\n let iter = 0;\r\n const mySkipEdge: HalfEdgeToBooleanFunction = skipEdge instanceof Function ? skipEdge : (he: HalfEdge) => he.isMaskSet(skipEdge);\r\n const findNextNodeAroundVertex = (he: HalfEdge): HalfEdge | undefined => {\r\n let vNode = he;\r\n do {\r\n if (!mySkipEdge(vNode))\r\n return vNode;\r\n announceSkipped?.(vNode);\r\n vNode = vNode.vertexPredecessor;\r\n } while (vNode !== he);\r\n return undefined;\r\n };\r\n const firstNode = findNextNodeAroundVertex(this);\r\n if (!firstNode)\r\n return false;\r\n let node: HalfEdge | undefined = firstNode;\r\n do {\r\n announceEdge(node);\r\n node = findNextNodeAroundVertex(node.faceSuccessor);\r\n if (!node)\r\n return false;\r\n } while (node !== firstNode && iter++ < maxIter);\r\n assert(iter < maxIter, \"Infinite loop detected in HalfEdge.announceEdgesInSuperFace\");\r\n return iter < maxIter;\r\n }\r\n /**\r\n * Evaluate `f(node)` at each node around `this` node's face loop. Collect the function values.\r\n * @param f optional node function. If `undefined`, collect the nodes themselves.\r\n * @returns the array of function values.\r\n */\r\n public collectAroundFace(f?: NodeFunction): any[] {\r\n const nodes = [];\r\n let node: HalfEdge = this;\r\n do {\r\n nodes.push(f ? f(node) : node); // push the node itself if \"f\" is undefined\r\n node = node.faceSuccessor;\r\n } while (node !== this);\r\n return nodes;\r\n }\r\n /**\r\n * Search around `this` node's vertex loop for nodes with the specified mask value.\r\n * * Returned nodes satisfy `node.isMaskSet(mask) === value`.\r\n * @param mask target mask.\r\n * @param value target boolean value for mask on half edges.\r\n * @param result optional array to be cleared and receive masked nodes.\r\n */\r\n public collectMaskedEdgesAroundVertex(\r\n mask: HalfEdgeMask, value: boolean = true, result?: HalfEdge[],\r\n ): HalfEdge[] {\r\n if (result === undefined)\r\n result = [];\r\n else\r\n result.length = 0;\r\n let node: HalfEdge = this;\r\n do {\r\n if (node.isMaskSet(mask) === value)\r\n result.push(node);\r\n node = node.vertexSuccessor;\r\n } while (node !== this);\r\n return result;\r\n }\r\n /**\r\n * Evaluate `f(node)` at each node around `this` node's vertex loop. Collect the function values.\r\n * @param f optional node function. If `undefined`, collect the nodes themselves.\r\n * @returns the array of function values.\r\n */\r\n public collectAroundVertex(f?: NodeFunction): any[] {\r\n const nodes = [];\r\n let node: HalfEdge = this;\r\n do {\r\n nodes.push(f ? f(node) : node); // push the node itself if \"f\" is undefined\r\n node = node.vertexSuccessor;\r\n } while (node !== this);\r\n return nodes;\r\n }\r\n /**\r\n * Announce edges in the vertex loop, starting with the instance and proceeding in a `vertexSuccessor` traversal.\r\n * @param announceEdge function to call at each edge\r\n */\r\n public announceEdgesAroundVertex(announceEdge: NodeFunction): void {\r\n let node: HalfEdge = this;\r\n do {\r\n announceEdge(node);\r\n node = node.vertexSuccessor;\r\n } while (node !== this);\r\n }\r\n /**\r\n * Evaluate `f(node)` at each node around `this` node's face loop. Sum the function values.\r\n * @param f node to number function.\r\n * @returns the sum of function values.\r\n */\r\n public sumAroundFace(f: NodeToNumberFunction): number {\r\n let node: HalfEdge = this;\r\n let sum = 0;\r\n do {\r\n sum += f(node);\r\n node = node.faceSuccessor;\r\n } while (node !== this);\r\n return sum;\r\n }\r\n /**\r\n * Evaluate `f(node)` at each node around `this` node's vertex loop. Sum the function values.\r\n * @param f node to number function.\r\n * @returns the sum of function values.\r\n */\r\n public sumAroundVertex(f: NodeToNumberFunction): number {\r\n let node: HalfEdge = this;\r\n let sum = 0;\r\n do {\r\n sum += f(node);\r\n node = node.vertexSuccessor;\r\n } while (node !== this);\r\n return sum;\r\n }\r\n /** Clear the given mask bits for all nodes in `this` node's face loop. */\r\n public clearMaskAroundFace(mask: HalfEdgeMask) {\r\n let node: HalfEdge = this;\r\n do {\r\n node.clearMask(mask);\r\n node = node.faceSuccessor;\r\n } while (node !== this);\r\n }\r\n /** Clear out the given mask bits for all nodes in `this` node's vertex loop. */\r\n public clearMaskAroundVertex(mask: HalfEdgeMask) {\r\n let node: HalfEdge = this;\r\n do {\r\n node.clearMask(mask);\r\n node = node.vertexSuccessor;\r\n } while (node !== this);\r\n }\r\n /**\r\n * Compute the signed xy area of `this` node's face.\r\n * * A positive area is counterclockwise.\r\n * * A negative area is clockwise.\r\n * @returns signed area of `this` node's face.\r\n */\r\n public signedFaceArea(): number {\r\n let sum = 0;\r\n // We start from `this` node and traverse the face, forming trapezoids with vertical bases.\r\n // Some trapezoids will have a zero-length base, e.g., a triangle.\r\n // Trapezoid bases are measured from `this.y` to keep area values numerically smaller.\r\n // Split each trapezoid into two triangles whose y-coordinates are above/below `this.y`.\r\n // Each trapezoid's signed area is computed by summing the signed areas of these two triangles.\r\n // Area signs depend on careful assignment of signs to trapezoid height (relative to `this.x`) and trapezoid\r\n // bases (relative to `this.y`).\r\n // Some trapezoids have signed areas outside the face that are cancelled out by subsequent trapezoids.\r\n // The formula in the loop accumulates twice the trapezoid areas, so at the end we halve the sum.\r\n // Illustration of the algorithm can be found at geometry/internaldocs/Graph.md\r\n let x0 = this.x;\r\n let x1 = 0.0;\r\n const y0 = this.y;\r\n let dy0 = 0.0;\r\n let dy1 = 0.0;\r\n let node1;\r\n let node0: HalfEdge = this;\r\n do {\r\n node1 = node0.faceSuccessor;\r\n x1 = node1.x;\r\n dy1 = node1.y - y0;\r\n // When trapezoid bases dy0 and dy1 have opposite sign, this product is (twice) the difference of the areas\r\n // of the trapezoid above and below y=y0. This is equal to (twice) the difference of the areas of the congruent\r\n // triangles formed by the trapezoid diagonals and bases, a consequence of the other two triangles having equal\r\n // area, and thus cancelling out.\r\n sum += (x0 - x1) * (dy0 + dy1); // twice trapezoid area = trapezoid height * sum of trapezoid bases\r\n x0 = x1;\r\n dy0 = dy1;\r\n node0 = node1;\r\n } while (node0 !== this);\r\n return 0.5 * sum;\r\n }\r\n /**\r\n * Interpolate xy coordinates between `this` node and its face successor.\r\n * @param fraction fractional position along this edge.\r\n * @param result optional point to populate and return.\r\n */\r\n public fractionToPoint2d(fraction: number, result?: Point2d): Point2d {\r\n const suc = this.faceSuccessor;\r\n return Point2d.create(\r\n this.x + (suc.x - this.x) * fraction,\r\n this.y + (suc.y - this.y) * fraction,\r\n result,\r\n );\r\n }\r\n /**\r\n * Interpolate xyz coordinates between `this` node and its face successor.\r\n * @param fraction fractional position along this edge.\r\n * @param result optional point to populate and return.\r\n */\r\n public fractionToPoint3d(fraction: number, result?: Point3d): Point3d {\r\n const suc = this.faceSuccessor;\r\n return Point3d.create(\r\n this.x + (suc.x - this.x) * fraction,\r\n this.y + (suc.y - this.y) * fraction,\r\n this.z + (suc.z - this.z) * fraction,\r\n result,\r\n );\r\n }\r\n /**\r\n * Interpolate xy coordinates at `fractionAlong` between this node and its face successor. Then shift perpendicular\r\n * to the left of this edge by `fractionPerpendicular`.\r\n * @param fractionAlong fractional position along this edge.\r\n * @param fractionPerpendicular fractional position along the left perpendicular with the same length as this edge.\r\n * @param result optional xy coordinates.\r\n */\r\n public fractionAlongAndPerpendicularToPoint2d(\r\n fractionAlong: number, fractionPerpendicular: number, result?: Point2d,\r\n ): Point2d {\r\n const suc = this.faceSuccessor;\r\n const dx = suc.x - this.x;\r\n const dy = suc.y - this.y;\r\n return Point2d.create(\r\n this.x + dx * fractionAlong - dy * fractionPerpendicular,\r\n this.y + dy * fractionAlong + dx * fractionPerpendicular,\r\n result,\r\n );\r\n }\r\n /** Return the 3d coordinates at this half edge. */\r\n public getPoint3d(result?: Point3d): Point3d {\r\n return Point3d.create(this.x, this.y, this.z, result);\r\n }\r\n /** Return the 2d coordinates at this half edge. */\r\n public getPoint2d(result?: Point2d): Point2d {\r\n return Point2d.create(this.x, this.y, result);\r\n }\r\n /** Return a 3d vector from start to end of this half edge. */\r\n public getVector3dAlongEdge(result?: Vector3d): Vector3d {\r\n const suc = this.faceSuccessor;\r\n return Vector3d.create(suc.x - this.x, suc.y - this.y, suc.z - this.z, result);\r\n }\r\n /** Return a 2d vector from start to end of this half edge. */\r\n public getVector2dAlongEdge(result?: Vector2d): Vector2d {\r\n const suc = this.faceSuccessor;\r\n return Vector2d.create(suc.x - this.x, suc.y - this.y, result);\r\n }\r\n /**\r\n * Return the interpolated x coordinate between `this` node and its face successor.\r\n * @param fraction fractional position along this edge.\r\n */\r\n public fractionToX(fraction: number): number {\r\n const suc = this.faceSuccessor;\r\n return this.x + (suc.x - this.x) * fraction;\r\n }\r\n /**\r\n * Return the interpolated y coordinate between `this` node and its face successor.\r\n * @param fraction fractional position along this edge.\r\n */\r\n public fractionToY(fraction: number): number {\r\n const suc = this.faceSuccessor;\r\n return this.y + (suc.y - this.y) * fraction;\r\n }\r\n /**\r\n * Return the interpolated z coordinate between `this` node and its face successor.\r\n * @param fraction fractional position along this edge.\r\n */\r\n public fractionToZ(fraction: number): number {\r\n const suc = this.faceSuccessor;\r\n return this.z + (suc.z - this.z) * fraction;\r\n }\r\n /**\r\n * Compute fractional coordinates of the intersection of edges from given base nodes.\r\n * * If parallel or colinear, return `undefined`.\r\n * * If (possibly extended) lines intersect, return the fractions of intersection as x,y in the result.\r\n * @param nodeA0 base node of edge A.\r\n * @param nodeB0 base node of edge B.\r\n * @param result optional preallocated result.\r\n */\r\n public static transverseIntersectionFractions(\r\n nodeA0: HalfEdge, nodeB0: HalfEdge, result?: Vector2d,\r\n ): Vector2d | undefined {\r\n const nodeA1 = nodeA0.faceSuccessor;\r\n const nodeB1 = nodeB0.faceSuccessor;\r\n if (!result)\r\n result = Vector2d.create();\r\n // To find the fraction of intersection (ta,tb), you need to solve these 2 equations:\r\n // (nodeA1.x - nodeA0.x)ta + (nodeB0.x - nodeB1.x)tb = nodeB0.x - nodeA0.x\r\n // (nodeA1.y - nodeA0.y)ta + (nodeB0.y - nodeB1.y)tb = nodeB0.y - nodeA0.y\r\n // Proof can be found at geometry/internaldocs/Graph.md\r\n if (SmallSystem.linearSystem2d(\r\n nodeA1.x - nodeA0.x, nodeB0.x - nodeB1.x,\r\n nodeA1.y - nodeA0.y, nodeB0.y - nodeB1.y,\r\n nodeB0.x - nodeA0.x, nodeB0.y - nodeA0.y,\r\n result,\r\n ))\r\n return result;\r\n return undefined;\r\n }\r\n /**\r\n * Compute fractional position (possibly outside 0..1) of the intersection of a horizontal line with an edge.\r\n * * If the edge is horizontal with (approximate) identical y, return the base node.\r\n * * If the edge is horizontal with different y, return `undefined`.\r\n * @param node0 base node of edge.\r\n * @param y y coordinate of the horizontal line.\r\n */\r\n public static horizontalScanFraction(node0: HalfEdge, y: number): number | undefined | HalfEdge {\r\n const node1 = node0.faceSuccessor;\r\n const dy = node1.y - node0.y;\r\n if (Geometry.isSameCoordinate(y, node0.y) && Geometry.isSameCoordinate(y, node1.y))\r\n return node0;\r\n if (Geometry.isSameCoordinate(dy, 0.0))\r\n return undefined;\r\n // parametric equation of line is (1-t)y0 + ty1 which is equal to y at the intersection so\r\n // (1-t)y0 + ty1 = y or t = (y-y0)/(y1-y0)\r\n return Geometry.conditionalDivideFraction(y - node0.y, dy);\r\n }\r\n /**\r\n * Compute fractional position (inside 0..1) of the intersection of a horizontal line with an edge.\r\n * * If fractional position is outside 0..1, return `undefined`.\r\n * * If the edge is horizontal return `undefined` (no test for horizontal at y).\r\n * @param node0 base node of edge.\r\n * @param y y coordinate of the horizontal line.\r\n */\r\n public static horizontalScanFraction01(node0: HalfEdge, y: number): number | undefined {\r\n const node1 = node0.faceSuccessor;\r\n const dy = node1.y - node0.y;\r\n if (Geometry.isSameCoordinate(y, node0.y) && Geometry.isSameCoordinate(y, node1.y))\r\n return undefined;\r\n if (Geometry.isSameCoordinate(dy, 0.0))\r\n return undefined;\r\n const fraction = Geometry.conditionalDivideFraction(y - node0.y, dy);\r\n if (fraction !== undefined && fraction >= 0.0 && fraction <= 1.0)\r\n return fraction;\r\n return undefined;\r\n }\r\n /**\r\n * Copy various data from source to `this`.\r\n * @param source source half edge.\r\n * @param copyXYZ true to copy xyz coordinates.\r\n * @param copyVertexData true to copy data belonging to the vertex (i.e. the `i` member).\r\n * @param copyEdgeData true to copy data belonging to the edge (i.e. edge masks, `edgeTag`).\r\n * @param copyFaceData true to copy `faceTag`.\r\n */\r\n public copyDataFrom(\r\n source: HalfEdge, copyXYZ: boolean, copyVertexData: boolean, copyEdgeData: boolean, copyFaceData: boolean,\r\n ): void {\r\n if (copyXYZ) {\r\n this.x = source.x;\r\n this.y = source.y;\r\n this.z = source.z;\r\n }\r\n if (copyVertexData)\r\n this.i = source.i;\r\n if (copyEdgeData)\r\n HalfEdge.transferEdgeProperties(source, this);\r\n if (copyFaceData)\r\n this.faceTag = source.faceTag;\r\n }\r\n /**\r\n * Is the instance's face loop a split-washer type face?\r\n * * A split-washer face contains at least one bridge edge.\r\n * * A bridge edge and its edge mate have the same `bridgeMask` and live in the same face loop.\r\n * * By connecting hole/outer loops with bridge edges, a split-washer face can represent a parity region.\r\n * @param bridgeMask mask preset on bridge edges (default is [[HalfEdgeMask.BRIDGE_EDGE]]).\r\n */\r\n public isSplitWasherFace(bridgeMask: HalfEdgeMask = HalfEdgeMask.BRIDGE_EDGE): boolean {\r\n if (!this.countMaskAroundFace(HalfEdgeMask.BRIDGE_EDGE))\r\n return false;\r\n const bridges = new OrderedSet<HalfEdge>((a: HalfEdge, b: HalfEdge) => a.id - b.id);\r\n let node: HalfEdge = this;\r\n do {\r\n if (node.isMaskSet(bridgeMask))\r\n bridges.add(node);\r\n node = node.faceSuccessor;\r\n } while (node !== this);\r\n if (bridges.size === 0)\r\n return false;\r\n for (const bridge of bridges) {\r\n if (!bridges.has(bridge.edgeMate) || !bridge.edgeMate.isMaskSet(bridgeMask))\r\n return false;\r\n }\r\n return true;\r\n }\r\n}\r\n\r\n/**\r\n * A HalfEdgeGraph has:\r\n * * An array of (pointers to) HalfEdge objects.\r\n * * A pool of masks for grab/drop used by algorithms.\r\n * @internal\r\n */\r\nexport class HalfEdgeGraph {\r\n /** Simple array with pointers to all the half edges in the graph. */\r\n public allHalfEdges: HalfEdge[];\r\n private _maskManager: MaskManager;\r\n public constructor() {\r\n this.allHalfEdges = [];\r\n this._maskManager = MaskManager.create(HalfEdgeMask.ALL_GRAB_DROP_MASKS)!;\r\n }\r\n /**\r\n * Ask for a mask (from the graph's free pool) for caller's use.\r\n * @param clearInAllHalfEdges optionally clear the mask throughout the graph (default `true`).\r\n */\r\n public grabMask(clearInAllHalfEdges: boolean = true): HalfEdgeMask {\r\n const mask = this._maskManager.grabMask();\r\n if (clearInAllHalfEdges) {\r\n this.clearMask(mask);\r\n }\r\n return mask;\r\n }\r\n /** Return `mask` to the free pool. */\r\n public dropMask(mask: HalfEdgeMask) {\r\n this._maskManager.dropMask(mask);\r\n }\r\n /**\r\n * Create 2 half edges forming 2 vertices, 1 edge, and 1 face.\r\n * * The two half edges are joined as edgeMate pair.\r\n * * The two half edges are a 2-half-edge face loop in both the faceSuccessor and facePredecessor directions.\r\n * * The two half edges are added to the graph's HalfEdge set.\r\n * @returns pointer to the first half edge created.\r\n */\r\n public createEdgeXYZXYZ(\r\n xA: number = 0, yA: number = 0, zA: number = 0, iA: number = 0,\r\n xB: number = 0, yB: number = 0, zB: number = 0, iB: number = 0,\r\n ): HalfEdge {\r\n return HalfEdge.createHalfEdgePairWithCoordinates(xA, yA, zA, iA, xB, yB, zB, iB, this.allHalfEdges);\r\n }\r\n /**\r\n * Create 2 half edges forming 2 vertices, 1 edge, and 1 face.\r\n * * The two half edges are joined as edgeMate pair.\r\n * * The two half edges are a 2-half-edge face loop in both the faceSuccessor and facePredecessor directions.\r\n * * The two half edges are added to the graph's HalfEdge set.\r\n * * Coordinates are set to zero.\r\n * @param iA `i` property of the first created HalfEdge\r\n * @param iB `i` property of the second created HalfEdge\r\n * @returns pointer to the first half edge created, with `i` property set to iA.\r\n */\r\n public createEdgeIdId(iA: number = 0, iB: number = 0): HalfEdge {\r\n return HalfEdge.createHalfEdgePairWithCoordinates(0.0, 0.0, 0.0, iA, 0.0, 0.0, 0.0, iB, this.allHalfEdges);\r\n }\r\n /**\r\n * Create an edge from coordinates x,y,z connected to the graph at the vertex of the given `node`.\r\n * @returns pointer to the dangling node at x,y,z.\r\n */\r\n public createEdgeXYZHalfEdge(\r\n xA: number = 0,\r\n yA: number = 0,\r\n zA: number = 0,\r\n iA: number = 0,\r\n node: HalfEdge,\r\n iB: number = 0,\r\n ): HalfEdge {\r\n // Visualization can be found at geometry/internaldocs/Graph.md\r\n const a = HalfEdge.createHalfEdgePairWithCoordinates(xA, yA, zA, iA, node.x, node.y, node.z, iB, this.allHalfEdges);\r\n const b = a.faceSuccessor;\r\n HalfEdge.pinch(node, b);\r\n return a;\r\n }\r\n /**\r\n * Create an edge from the vertex of `nodeA` to the vertex of `nodeB`.\r\n * @returns pointer to the new half edge at the vertex of `nodeA`.\r\n */\r\n public createEdgeHalfEdgeHalfEdge(nodeA: HalfEdge, idA: number, nodeB: HalfEdge, idB: number = 0): HalfEdge {\r\n // visualization can be found at geometry/internaldocs/Graph.md\r\n const a = HalfEdge.createHalfEdgePairWithCoordinates(\r\n nodeA.x, nodeA.y, nodeA.z, idA, nodeB.x, nodeB.y, nodeB.z, idB, this.allHalfEdges,\r\n );\r\n const b = a.faceSuccessor;\r\n HalfEdge.pinch(nodeA, a);\r\n HalfEdge.pinch(nodeB, b);\r\n return a;\r\n }\r\n /**\r\n * Create 2 half edges forming 2 vertices, 1 edge, and 1 face\r\n * * The two half edges are joined as edgeMate pair.\r\n * * The two half edges are a 2-half-edge face loop in both the faceSuccessor and facePredecessor directions.\r\n * * The two half edges are added to the graph's HalfEdge set.\r\n * @returns pointer to the first half edge created, with coordinates `xyz0`.\r\n */\r\n public createEdgeXYAndZ(xyz0: XYAndZ, id0: number, xyz1: XYAndZ, id1: number): HalfEdge {\r\n return HalfEdge.createHalfEdgePairWithCoordinates(\r\n xyz0.x, xyz0.y, xyz0.z, id0, xyz1.x, xyz1.y, xyz1.z, id1, this.allHalfEdges,\r\n );\r\n }\r\n /**\r\n * Create a new vertex within the edge beginning at `base`.\r\n * * This creates two new nodes in their own vertex loop.\r\n * * If the base is `undefined`, create a single-edge loop.\r\n * * Existing nodes stay in their face and vertex loops and retain xyz and i values.\r\n * * Unlike [[pinch]], this breaks the edgeMate pairing of the input edge:\r\n * each node of the input edge gets a new node as its edge mate.\r\n * * On each side of the edge, if edgeTag is present, it is copied to the new node on that side.\r\n * @returns reference to the half edge created, the new face successor of `base`.\r\n */\r\n public splitEdge(base: undefined | HalfEdge, xA: number = 0, yA: number = 0, zA: number = 0, iA: number = 0): HalfEdge {\r\n return HalfEdge.splitEdge(base, xA, yA, zA, iA, this.allHalfEdges);\r\n }\r\n /**\r\n * Create a new sliver face \"inside\" an existing edge.\r\n * * This creates two nodes that are each face predecessor and successor to the other.\r\n * * Existing nodes stay in their face and vertex loops and retain xyz and i values.\r\n * * Unlike [[pinch]], this breaks the edgeMate pairing of the input edge:\r\n * each node of the input edge gets a new node as its edge mate.\r\n * * New nodes get the xyz and i values shared by the nodes in the vertex loops into which they are placed.\r\n * * New nodes' faceTag and edgeTag are `undefined`.\r\n * @returns reference to the half edge created in the vertex loop of baseA.\r\n */\r\n public splitEdgeCreateSliverFace(base: HalfEdge): HalfEdge {\r\n return HalfEdge.splitEdgeCreateSliverFace(base, this.allHalfEdges);\r\n }\r\n /**\r\n * Create a new vertex within the edge beginning at `base`, with coordinates specified by a fraction along the edge.\r\n * * This creates two new nodes in their own vertex loop.\r\n * * Existing nodes stay in their face and vertex loops and retain xyz and i values.\r\n * * Unlike [[pinch]], this breaks the edgeMate pairing of the input edge:\r\n * each node of the input edge gets a new node as its edge mate.\r\n * * On each side of the edge, if edgeTag is present, it is copied to the new node on that side.\r\n * @returns reference to the half edge created, the new face successor of `base`.\r\n */\r\n public splitEdgeAtFraction(base: HalfEdge, fraction: number): HalfEdge {\r\n return HalfEdge.splitEdge(\r\n base, base.fractionToX(fraction), base.fractionToY(fraction), base.fractionToZ(fraction), 0, this.allHalfEdges,\r\n );\r\n }\r\n /**\r\n * This is a destructor-like action that eliminates all inter-connections among the graph's nodes.\r\n * After this is called, the graph is unusable.\r\n */\r\n public decommission() {\r\n for (const node of this.allHalfEdges) {\r\n node.decommission();\r\n }\r\n this.allHalfEdges.length = 0;\r\n (this.allHalfEdges as any) = undefined;\r\n }\r\n /**\r\n * Create two nodes of a new edge.\r\n * @param x0 x-coordinate of the start node.\r\n * @param y0 y-coordinate of the start node.\r\n * @param x1 x-coordinate of the end node.\r\n * @param y1 y-coordinate of the end node.\r\n * @param edgeTag0 (optional) edge tag for the start node.\r\n * @param edgeTag1 (optional) edge tag for the end node.\r\n * @param faceTag0 (optional) face tag for the start node.\r\n * @param faceTag1 (optional) face tag for the end node.\r\n * @returns the reference to the new node at (x0,y0).\r\n */\r\n public addEdgeXY(x0: number, y0: number, x1: number, y1: number, edgeTag0?: number, edgeTag1?: number, faceTag0?: number, faceTag1?: number): HalfEdge {\r\n const baseNode = HalfEdge.createEdgeXYXY(x0, y0, x1, y1);\r\n const farNode = baseNode.faceSuccessor;\r\n baseNode.edgeTag = edgeTag0;\r\n baseNode.faceTag = faceTag0;\r\n farNode.edgeTag = edgeTag1;\r\n farNode.faceTag = faceTag1;\r\n this.allHalfEdges.push(baseNode, farNode);\r\n return baseNode;\r\n }\r\n /** Clear selected `mask` bits in all nodes of the graph. */\r\n public clearMask(mask: HalfEdgeMask) {\r\n for (const node of this.allHalfEdges)\r\n node.maskBits &= ~mask;\r\n }\r\n /** Set selected `mask` bits in all nodes of the graph. */\r\n public setMask(mask: HalfEdgeMask) {\r\n for (const node of this.allHalfEdges)\r\n node.maskBits |= mask;\r\n }\r\n /** Toggle selected `mask` bits in all nodes of the graph. */\r\n public reverseMask(mask: HalfEdgeMask) {\r\n for (const node of this.allHalfEdges)\r\n node.maskBits ^= mask;\r\n }\r\n /**\r\n * Return the number of nodes that have a specified mask bit set.\r\n * @param mask mask to count\r\n */\r\n public countMask(mask: HalfEdgeMask): number {\r\n let n = 0;\r\n for (const node of this.allHalfEdges)\r\n if (node.isMaskSet(mask))\r\n n++;\r\n return n;\r\n }\r\n /**\r\n * Return an array of LineSegment3d.\r\n * * The array has one segment per edge.\r\n * * The coordinates are taken from a node and its face successor.\r\n * * On each edge, the line segment starts at the HalfEdge with lower ID than its edgeMate.\r\n */\r\n public collectSegments(): LineSegment3d[] {\r\n const segments: LineSegment3d[] = [];\r\n for (const node of this.allHalfEdges)\r\n if (node.id < node.edgeMate.id)\r\n segments.push(LineSegment3d.createXYXY(node.x, node.y, node.faceSuccessor.x, node.faceSuccessor.y));\r\n return segments;\r\n }\r\n /** Returns the number of vertex loops in a graph structure. */\r\n public countVertexLoops(): number {\r\n let count = 0;\r\n this.announceVertexLoops(\r\n (_graph: HalfEdgeGraph, _seed: HalfEdge) => {\r\n count++;\r\n return true;\r\n },\r\n );\r\n return count;\r\n }\r\n /** Returns the number of face loops in a graph structure. */\r\n public countFaceLoops(): number {\r\n let count = 0;\r\n this.announceFaceLoops(\r\n (_graph: HalfEdgeGraph, _seed: HalfEdge) => {\r\n count++;\r\n return true;\r\n },\r\n );\r\n return count;\r\n }\r\n /** Returns the number of face loops satisfying a filter function with mask argument. */\r\n public countFaceLoopsWithMaskFilter(filter: HalfEdgeAndMaskToBooleanFunction, mask: HalfEdgeMask): number {\r\n let count = 0;\r\n this.announceFaceLoops(\r\n (_graph: HalfEdgeGraph, seed: HalfEdge) => {\r\n if (filter(seed, mask))\r\n count++;\r\n return true;\r\n },\r\n );\r\n return count;\r\n }\r\n /** Returns an array of nodes, where each node represents a starting point of a vertex loop. */\r\n public collectVertexLoops(): HalfEdge[] {\r\n const returnArray: HalfEdge[] = [];\r\n this.announceVertexLoops(\r\n (_graph: HalfEdgeGraph, node: HalfEdge) => {\r\n returnArray.push(node);\r\n return true;\r\n },\r\n );\r\n return returnArray;\r\n }\r\n /** Returns an array of nodes, where each node represents a starting point of a face loop. */\r\n public collectFaceLoops(): HalfEdge[] {\r\n const returnArray: HalfEdge[] = [];\r\n this.announceFaceLoops(\r\n (_graph: HalfEdgeGraph, node: HalfEdge) => {\r\n returnArray.push(node);\r\n return true;\r\n },\r\n );\r\n return returnArray;\r\n }\r\n /**\r\n * Visit each vertex loop of the graph once.\r\n * * Call the `announceVertex` function.\r\n * * Continue search if `announceVertex(graph, node)` returns `true`.\r\n * * Terminate search if `announceVertex(graph, node)` returns `false`.\r\n * @param announceVertex function to apply at one node of each vertex.\r\n */\r\n public announceVertexLoops(announceVertex: GraphNodeFunction): void {\r\n this.clearMask(HalfEdgeMask.VISITED);\r\n for (const node of this.allHalfEdges) {\r\n if (node.getMask(HalfEdgeMask.VISITED))\r\n continue;\r\n node.setMaskAroundVertex(HalfEdgeMask.VISITED);\r\n if (!announceVertex(this, node))\r\n break;\r\n }\r\n }\r\n /**\r\n * Visit each facet of the graph once.\r\n * * Call the `announceFace` function.\r\n * * Continue search if `announceFace(graph, node)` returns `true`.\r\n * * Terminate search if `announceFace(graph, node)` returns `false`.\r\n * @param announceFace function to apply at one node of each face.\r\n */\r\n public announceFaceLoops(announceFace: GraphNodeFunction): void {\r\n this.clearMask(HalfEdgeMask.VISITED);\r\n for (const node of this.allHalfEdges) {\r\n if (node.getMask(HalfEdgeMask.VISITED))\r\n continue;\r\n node.setMaskAroundFace(HalfEdgeMask.VISITED);\r\n if (!announceFace(this, node))\r\n break;\r\n }\r\n }\r\n /**\r\n * Visit each edge of the graph once.\r\n * * Call the `announceEdge` function.\r\n * * The edge mate will NOT appear in an announceEdge call.\r\n * * Continue search if `announceEdge(graph, node)` returns `true`.\r\n * * Terminate search if `announceEdge(graph, node)` returns `false`.\r\n * @param announceEdge function to apply at one node of each edge.\r\n */\r\n public announceEdges(announceEdge: GraphNodeFunction): void {\r\n this.clearMask(HalfEdgeMask.VISITED);\r\n for (const node of this.allHalfEdges) {\r\n if (node.getMask(HalfEdgeMask.VISITED))\r\n continue;\r\n const mate = node.edgeMate;\r\n node.setMask(HalfEdgeMask.VISITED);\r\n mate.setMask(HalfEdgeMask.VISITED);\r\n if (!announceEdge(this, node))\r\n break;\r\n }\r\n }\r\n /**\r\n * Visit each half edge (node) of the graph once.\r\n * * Call the `announceNode` function.\r\n * * Continue search if `announceNode(graph, node)` returns `true`.\r\n * * Terminate search if `announceNode(graph, node)` returns `false`.\r\n * @param announceNode function to apply at each node.\r\n */\r\n public announceNodes(announceNode: GraphNodeFunction): void {\r\n for (const node of this.allHalfEdges) {\r\n if (!announceNode(this, node))\r\n break;\r\n }\r\n }\r\n /** Return the number of nodes in the graph. */\r\n public countNodes(): number {\r\n return this.allHalfEdges.length;\r\n }\r\n /** Apply transform to the xyz coordinates in the graph. */\r\n public transformInPlace(transform: Transform): void {\r\n for (const node of this.allHalfEdges) {\r\n transform.multiplyXYAndZInPlace(node);\r\n }\r\n }\r\n /**\r\n * Disconnect and delete all nodes that satisfy a filter condition.\r\n * @param deleteThisNode returns true to delete the corresponding node. Should act symmetrically on the edgeMate.\r\n * @returns the number of nodes deleted (twice the number of deleted edges).\r\n */\r\n public yankAndDeleteEdges(deleteThisNode: NodeFunction): number {\r\n const numTotal = this.allHalfEdges.length;\r\n let numAccepted = 0;\r\n for (let i = 0; i < numTotal; i++) {\r\n const candidate = this.allHalfEdges[i];\r\n if (!deleteThisNode(candidate))\r\n this.allHalfEdges[numAccepted++] = candidate; // overwrite a previously \"deleted node\"\r\n else\r\n candidate.yankFromVertexLoop(); // assume callback symmetry so we eventually yank the mate\r\n }\r\n const numDeleted = numTotal - numAccepted;\r\n this.allHalfEdges.length = numAccepted;\r\n return numDeleted;\r\n }\r\n /**\r\n * Delete all isolated edges.\r\n * @return the number of nodes deleted (twice the number of deleted edges).\r\n */\r\n public deleteIsolatedEdges(): number {\r\n const numTotal = this.allHalfEdges.length;\r\n let numAccepted = 0;\r\n for (let i = 0; i < numTotal; i++) {\r\n const candidate = this.allHalfEdges[i];\r\n if (!candidate.isIsolatedEdge) {\r\n this.allHalfEdges[numAccepted++] = candidate;\r\n }\r\n }\r\n const numDeleted = numTotal - numAccepted;\r\n this.allHalfEdges.length = numAccepted;\r\n return numDeleted;\r\n }\r\n /**\r\n * Construct a map from id to vertex index.\r\n * * For a given HalfEdge `e`, the key is `e.id` and the value is the minimum index in `graph.allHalfEdges` of all edges in the vertex loop of `e`.\r\n */\r\n public constructIdToVertexIndexMap(): Map<number, number> {\r\n const idToIndexMap = new Map<number, number>();\r\n this.allHalfEdges.forEach((e: HalfEdge, i: number) => idToIndexMap.set(e.id, i));\r\n this.announceVertexLoops(\r\n (_g, vertex: HalfEdge) => {\r\n let minIndex = this.allHalfEdges.length;\r\n vertex.announceEdgesAroundVertex(\r\n (e: HalfEdge) => {\r\n const index = idToIndexMap.get(e.id);\r\n if (index !== undefined && index < minIndex)\r\n minIndex = index;\r\n },\r\n );\r\n vertex.announceEdgesAroundVertex((e: HalfEdge) => idToIndexMap.set(e.id, minIndex));\r\n return true;\r\n },\r\n );\r\n return idToIndexMap;\r\n }\r\n /**\r\n * Construct a map from id to face index.\r\n * * For a given HalfEdge `e`, the key is `e.id` and the value is the minimum index in `graph.allHalfEdges` of all edges in the face loop of `e`.\r\n */\r\n public constructIdToFaceIndexMap(): Map<number, number> {\r\n const idToIndexMap = new Map<number, number>();\r\n this.allHalfEdges.forEach((e: HalfEdge, i: number) => idToIndexMap.set(e.id, i));\r\n this.announceFaceLoops(\r\n (_g, face: HalfEdge) => {\r\n let minIndex = this.allHalfEdges.length;\r\n face.announceEdgesInFace(\r\n (e: HalfEdge) => {\r\n const index = idToIndexMap.get(e.id);\r\n if (index !== undefined && index < minIndex)\r\n minIndex = index;\r\n },\r\n );\r\n face.announceEdgesInFace((e: HalfEdge) => idToIndexMap.set(e.id, minIndex));\r\n return true;\r\n },\r\n );\r\n return idToIndexMap;\r\n }\r\n}\r\n"]}
|
|
@@ -23,15 +23,16 @@ export declare class HalfEdgeGraphFromIndexedLoopsContext {
|
|
|
23
23
|
* * One of that mated pair becomes a HalfEdge in this loop.
|
|
24
24
|
* * The other is "unmatched" and gets the EXTERIOR mask.
|
|
25
25
|
* * When announceMatedHalfEdges(halfEdge) is called:
|
|
26
|
-
* * halfEdge and its mate are "new"
|
|
27
|
-
* * all coordinates are zeros.
|
|
26
|
+
* * halfEdge and its mate are "new".
|
|
28
27
|
* * each contains (as its `i` property) one index of the [indexA,indexB] pair.
|
|
29
|
-
* *
|
|
28
|
+
* * all coordinates are zeros.
|
|
29
|
+
* * these coordinates and indices will never be referenced again by this construction sequence.
|
|
30
|
+
* * typically the caller sets the halfEdge/mate coordinates in this callback.
|
|
30
31
|
* * if [indexB, indexA] appeared previously (and its outer HalfEdge was left "unmatched"),
|
|
31
32
|
* the "unmatched" HalfEdge is used in the loop being constructed, and its EXTERIOR mask is cleared.
|
|
32
33
|
* @param indices Array of indices around the loop. This is accessed cyclically, so first and last indices should be different.
|
|
33
34
|
* @param announceMatedHalfEdges optional function to be called as mated pairs are created. At the call,
|
|
34
|
-
* the given HalfEdge and its mate will have a pair of successive indices from the array.
|
|
35
|
+
* the given HalfEdge and its mate will have a pair of successive indices from the array in their `i` property.
|
|
35
36
|
*/
|
|
36
37
|
insertLoop(indices: number[], announceMatedHalfEdges?: (halfEdge: HalfEdge) => void): HalfEdge | undefined;
|
|
37
38
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HalfEdgeGraphFromIndexedLoopsContext.d.ts","sourceRoot":"","sources":["../../../src/topology/HalfEdgeGraphFromIndexedLoopsContext.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAgB,MAAM,SAAS,CAAC;AAEhE;;GAEG;AAEH;;;;;;;GAOG;AACH,qBAAa,oCAAoC;;IAM/C,OAAO,CAAC,eAAe,CAAwB;IAC/C,OAAO,CAAC,MAAM,CAAgB;IAC9B,IAAW,KAAK,IAAI,aAAa,CAAsB;IAGvD,OAAO,CAAC,2BAA2B,CAAa;IAChD,OAAO,CAAC,iBAAiB;IAGzB
|
|
1
|
+
{"version":3,"file":"HalfEdgeGraphFromIndexedLoopsContext.d.ts","sourceRoot":"","sources":["../../../src/topology/HalfEdgeGraphFromIndexedLoopsContext.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAgB,MAAM,SAAS,CAAC;AAEhE;;GAEG;AAEH;;;;;;;GAOG;AACH,qBAAa,oCAAoC;;IAM/C,OAAO,CAAC,eAAe,CAAwB;IAC/C,OAAO,CAAC,MAAM,CAAgB;IAC9B,IAAW,KAAK,IAAI,aAAa,CAAsB;IAGvD,OAAO,CAAC,2BAA2B,CAAa;IAChD,OAAO,CAAC,iBAAiB;IAGzB;;;;;;;;;;;;;;;;OAgBG;IACI,UAAU,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,sBAAsB,CAAC,EAAE,CAAC,QAAQ,EAAE,QAAQ,KAAK,IAAI,GAAG,QAAQ,GAAG,SAAS;CAiClH"}
|