@itwin/core-geometry 5.2.4 → 5.2.6
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 +11 -1
- package/lib/cjs/Constant.js.map +1 -1
- package/lib/cjs/Geometry.js.map +1 -1
- package/lib/cjs/bspline/AkimaCurve3d.js.map +1 -1
- package/lib/cjs/bspline/BSpline1dNd.js.map +1 -1
- package/lib/cjs/bspline/BSplineCurve.js.map +1 -1
- package/lib/cjs/bspline/BSplineCurve3dH.js.map +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.js.map +1 -1
- 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.js.map +1 -1
- package/lib/cjs/clipping/ClipPrimitive.js.map +1 -1
- package/lib/cjs/clipping/ClipUtils.js.map +1 -1
- package/lib/cjs/clipping/ClipVector.js.map +1 -1
- package/lib/cjs/clipping/ConvexClipPlaneSet.js.map +1 -1
- 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.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.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.js.map +1 -1
- 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.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.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.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.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.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.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.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.js.map +1 -1
- 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.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.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.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.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.js.map +1 -1
- package/lib/cjs/geometry3d/Point3dArrayCarrier.js.map +1 -1
- package/lib/cjs/geometry3d/Point3dVector3d.js.map +1 -1
- package/lib/cjs/geometry3d/PointHelpers.js.map +1 -1
- package/lib/cjs/geometry3d/PointStreaming.js.map +1 -1
- package/lib/cjs/geometry3d/PolygonOps.js.map +1 -1
- package/lib/cjs/geometry3d/PolylineCompressionByEdgeOffset.js.map +1 -1
- package/lib/cjs/geometry3d/PolylineOps.js.map +1 -1
- package/lib/cjs/geometry3d/Range.js.map +1 -1
- package/lib/cjs/geometry3d/Ray2d.js.map +1 -1
- 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.js.map +1 -1
- package/lib/cjs/geometry3d/UVSurfaceOps.js.map +1 -1
- package/lib/cjs/geometry3d/XYZProps.js.map +1 -1
- package/lib/cjs/geometry3d/YawPitchRollAngles.js.map +1 -1
- package/lib/cjs/geometry4d/Map4d.js.map +1 -1
- 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.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.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.js.map +1 -1
- package/lib/cjs/polyface/PolyfaceBuilder.js.map +1 -1
- package/lib/cjs/polyface/PolyfaceClip.js.map +1 -1
- package/lib/cjs/polyface/PolyfaceData.js.map +1 -1
- 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.js.map +1 -1
- package/lib/cjs/polyface/RangeTree/PolyfaceRangeTreeContext.js.map +1 -1
- package/lib/cjs/polyface/RangeTree/RangeTreeNode.js.map +1 -1
- 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.map +1 -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.js.map +1 -1
- package/lib/cjs/topology/HalfEdgeGraphFromIndexedLoopsContext.js.map +1 -1
- 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.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.js.map +1 -1
- package/lib/cjs/topology/Voronoi.js.map +1 -1
- package/lib/cjs/topology/XYParitySearchContext.js.map +1 -1
- package/lib/esm/Constant.js.map +1 -1
- package/lib/esm/Geometry.js.map +1 -1
- package/lib/esm/bspline/AkimaCurve3d.js.map +1 -1
- package/lib/esm/bspline/BSpline1dNd.js.map +1 -1
- package/lib/esm/bspline/BSplineCurve.js.map +1 -1
- package/lib/esm/bspline/BSplineCurve3dH.js.map +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.js.map +1 -1
- 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.js.map +1 -1
- package/lib/esm/clipping/ClipPrimitive.js.map +1 -1
- package/lib/esm/clipping/ClipUtils.js.map +1 -1
- package/lib/esm/clipping/ClipVector.js.map +1 -1
- package/lib/esm/clipping/ConvexClipPlaneSet.js.map +1 -1
- 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.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.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.js.map +1 -1
- 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.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.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.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.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.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.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.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.js.map +1 -1
- 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.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.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.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.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.js.map +1 -1
- package/lib/esm/geometry3d/Point3dArrayCarrier.js.map +1 -1
- package/lib/esm/geometry3d/Point3dVector3d.js.map +1 -1
- package/lib/esm/geometry3d/PointHelpers.js.map +1 -1
- package/lib/esm/geometry3d/PointStreaming.js.map +1 -1
- package/lib/esm/geometry3d/PolygonOps.js.map +1 -1
- package/lib/esm/geometry3d/PolylineCompressionByEdgeOffset.js.map +1 -1
- package/lib/esm/geometry3d/PolylineOps.js.map +1 -1
- package/lib/esm/geometry3d/Range.js.map +1 -1
- package/lib/esm/geometry3d/Ray2d.js.map +1 -1
- 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.js.map +1 -1
- package/lib/esm/geometry3d/UVSurfaceOps.js.map +1 -1
- package/lib/esm/geometry3d/XYZProps.js.map +1 -1
- package/lib/esm/geometry3d/YawPitchRollAngles.js.map +1 -1
- package/lib/esm/geometry4d/Map4d.js.map +1 -1
- 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.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.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.js.map +1 -1
- package/lib/esm/polyface/PolyfaceBuilder.js.map +1 -1
- package/lib/esm/polyface/PolyfaceClip.js.map +1 -1
- package/lib/esm/polyface/PolyfaceData.js.map +1 -1
- 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.js.map +1 -1
- package/lib/esm/polyface/RangeTree/PolyfaceRangeTreeContext.js.map +1 -1
- package/lib/esm/polyface/RangeTree/RangeTreeNode.js.map +1 -1
- 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.map +1 -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.js.map +1 -1
- package/lib/esm/topology/HalfEdgeGraphFromIndexedLoopsContext.js.map +1 -1
- 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.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.js.map +1 -1
- package/lib/esm/topology/Voronoi.js.map +1 -1
- package/lib/esm/topology/XYParitySearchContext.js.map +1 -1
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CurveFactory.js","sourceRoot":"","sources":["../../../src/curve/CurveFactory.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F;;GAEG;AAEH,0CAAqF;AACrF,+CAA4C;AAC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AAE,CAAC;QAClC,MAAM,QAAQ,GAAG,MAAM,CAAC,OAAO,EAAE,CAAC;QAClC,MAAM,QAAQ,GAAG,MAAM,CAAC,OAAO,EAAE,CAAC;QAClC,MAAM,QAAQ,GAAG,MAAM,CAAC,OAAO,EAAE,CAAC;QAClC,MAAM,QAAQ,GAAG,MAAM,CAAC,OAAO,EAAE,CAAC;QAClC,MAAM,QAAQ,GAAG,mBAAQ,CAAC,gBAAgB,CAAC,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC;QACnF,MAAM,QAAQ,GAAG,mBAAQ,CAAC,gBAAgB,CAAC,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC;QACnF,MAAM,QAAQ,GAAG,mBAAQ,CAAC,gBAAgB,CAAC,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC;QACnF,MAAM,SAAS,GAAG,yBAAW,CAAC,cAAc,CAC1C,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAC5B,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAC5B,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAC5B,CAAC,SAAS,EAAE,CAAC,SAAS,EAAE,GAAG,CAAC,CAAC;QAC/B,IAAI,SAAS,KAAK,SAAS,EAAE,CAAC;YAC5B,OAAO,aAAK,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC;QACjG,CAAC;QACD,OAAO,SAAS,CAAC;IACnB,CAAC;CACF;AAjrBD,oCAirBC","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 Curve\r\n */\r\n\r\nimport { AxisIndex, AxisOrder, Geometry, PlaneAltitudeEvaluator } from \"../Geometry\";\r\nimport { Angle } from \"../geometry3d/Angle\";\r\nimport { AngleSweep } from \"../geometry3d/AngleSweep\";\r\nimport { Ellipsoid, GeodesicPathPoint } from \"../geometry3d/Ellipsoid\";\r\nimport { IndexedXYZCollection } from \"../geometry3d/IndexedXYZCollection\";\r\nimport { Matrix3d } from \"../geometry3d/Matrix3d\";\r\nimport { Plane3dByOriginAndUnitNormal } from \"../geometry3d/Plane3dByOriginAndUnitNormal\";\r\nimport { Vector2d } from \"../geometry3d/Point2dVector2d\";\r\nimport { Point3dArrayCarrier } from \"../geometry3d/Point3dArrayCarrier\";\r\nimport { Point3d, Vector3d } from \"../geometry3d/Point3dVector3d\";\r\nimport { PolylineOps } from \"../geometry3d/PolylineOps\";\r\nimport { Ray3d } from \"../geometry3d/Ray3d\";\r\nimport { Segment1d } from \"../geometry3d/Segment1d\";\r\nimport { Transform } from \"../geometry3d/Transform\";\r\nimport { XAndY } from \"../geometry3d/XYZProps\";\r\nimport { SmallSystem } from \"../numerics/SmallSystem\";\r\nimport { IndexedPolyface } from \"../polyface/Polyface\";\r\nimport { PolyfaceBuilder } from \"../polyface/PolyfaceBuilder\";\r\nimport { Cone } from \"../solid/Cone\";\r\nimport { RuledSweep } from \"../solid/RuledSweep\";\r\nimport { TorusPipe } from \"../solid/TorusPipe\";\r\nimport { Arc3d, ArcBlendData } from \"./Arc3d\";\r\nimport { CurveChain } from \"./CurveCollection\";\r\nimport { CurvePrimitive } from \"./CurvePrimitive\";\r\nimport { AnyCurve, AnyRegion } from \"./CurveTypes\";\r\nimport { GeometryQuery } from \"./GeometryQuery\";\r\nimport { LineSegment3d } from \"./LineSegment3d\";\r\nimport { LineString3d } from \"./LineString3d\";\r\nimport { Loop } from \"./Loop\";\r\nimport { Path } from \"./Path\";\r\nimport { RegionOps } from \"./RegionOps\";\r\nimport { IntegratedSpiral3d } from \"./spiral/IntegratedSpiral3d\";\r\nimport { IntegratedSpiralTypeName } from \"./spiral/TransitionSpiral3d\";\r\nimport { StrokeOptions } from \"./StrokeOptions\";\r\n\r\n/**\r\n * Interface to carry parallel arrays of planes and sections, and optional geometry assembled from them,\r\n * as returned by [CurveFactory.createMiteredSweepSections].\r\n * @public\r\n */\r\nexport interface SectionSequenceWithPlanes {\r\n /** The plane of each section. */\r\n planes: Plane3dByOriginAndUnitNormal[];\r\n /** Section curve projected onto the corresponding plane. */\r\n sections: AnyCurve[];\r\n /**\r\n * Optional `RuledSweep` generated from the sections.\r\n * * The `RuledSweep` and sections array refer to the same section objects.\r\n */\r\n ruledSweep?: RuledSweep;\r\n /** Optional mesh generated from the `RuledSweep` generated from the sections. */\r\n mesh?: IndexedPolyface;\r\n}\r\n\r\n/**\r\n * Enumeration of geometric output for [CurveFactory.createMiteredSweepSections].\r\n * @public\r\n */\r\nexport enum MiteredSweepOutputSelect {\r\n /** Output only the parallel arrays of planes and sections. */\r\n Sections = 0,\r\n /** Output planes and sections, as well as the assembled ruled sweep. */\r\n AlsoRuledSweep = 1,\r\n /** Output planes and sections, as well as the assembled ruled sweep and its stroked mesh. */\r\n AlsoMesh = 2,\r\n}\r\n\r\n/**\r\n * Interface bundling options for [CurveFactory.createMiteredSweepSections].\r\n * @public\r\n */\r\nexport interface MiteredSweepOptions {\r\n /** Whether first and last planes are averaged and equated when the centerline is physically closed. Default value is `false`. */\r\n wrapIfPhysicallyClosed?: boolean;\r\n /** Whether to output sections only, or sections plus optional geometry constructed from them. Default value is `MiteredSweepOutputSelect.Sections`. */\r\n outputSelect?: MiteredSweepOutputSelect;\r\n /** How to stroke smooth input curves. If undefined, default stroke options are used. */\r\n strokeOptions?: StrokeOptions;\r\n /** Whether to cap the ruled sweep if outputting a ruled sweep or mesh. Default value is `false`. */\r\n capped?: boolean;\r\n /** The first section's normal is aligned to this vector, typically the start tangent of the smooth curve stroked for the centerline. */\r\n startTangent?: Vector3d;\r\n /** The last section's normal is aligned to this vector, typically the end tangent of the smooth curve stroked for the centerline. */\r\n endTangent?: Vector3d;\r\n}\r\n\r\n/**\r\n * Curve strokes plus start/end tangents.\r\n * @internal\r\n*/\r\ninterface SmoothCurveData {\r\n /** Samples along a curve. */\r\n strokes: IndexedXYZCollection;\r\n /** Start tangent (unnormalized). May be undefined if the curve is linear. */\r\n startTangent?: Vector3d;\r\n /** End tangent (unnormalized). May be undefined if the curve is linear. */\r\n endTangent?: Vector3d;\r\n};\r\n\r\n/**\r\n * The `CurveFactory` class contains methods for specialized curve constructions.\r\n * @public\r\n */\r\nexport class CurveFactory {\r\n /** (Cautiously) construct and save a line segment between fractional positions. */\r\n private static addPartialSegment(\r\n path: Path, allowBackup: boolean,\r\n pointA: Point3d | undefined, pointB: Point3d | undefined,\r\n fraction0: number, fraction1: number,\r\n ) {\r\n if (allowBackup || (fraction1 > fraction0)) {\r\n if (pointA !== undefined && pointB !== undefined && !Geometry.isAlmostEqualNumber(fraction0, fraction1))\r\n path.tryAddChild(LineSegment3d.create(pointA.interpolate(fraction0, pointB), pointA.interpolate(fraction1, pointB)));\r\n }\r\n }\r\n /**\r\n * Create a circular arc defined by start point, tangent at start point, and end point.\r\n * * The circular arc is swept from start to end toward direction of the `tangentAtStart`.\r\n * * If tangent is parallel to line segment from start to end, return `undefined`.\r\n */\r\n public static createArcPointTangentPoint(start: Point3d, tangentAtStart: Vector3d, end: Point3d): Arc3d | undefined {\r\n const ret = Arc3d.createCircularStartTangentEnd(start, tangentAtStart, end);\r\n if (ret instanceof Arc3d)\r\n return ret;\r\n else\r\n return undefined;\r\n }\r\n /**\r\n * Construct a sequence of alternating lines and arcs with the arcs creating tangent transition between consecutive edges.\r\n * * If the radius parameter is a number, that radius is used throughout.\r\n * * If the radius parameter is an array of numbers, `radius[i]` is applied at `point[i]`.\r\n * * Note that since no fillet is constructed at the initial or final point, those entries in `radius[]` are never referenced.\r\n * * A zero radius for any point indicates to leave the as a simple corner.\r\n * @param points point source\r\n * @param radius fillet radius or array of radii indexed to correspond to the points.\r\n * @param allowBackupAlongEdge true to allow edges to be created going \"backwards\" along edges if needed to create the blend.\r\n */\r\n public static createFilletsInLineString(\r\n points: LineString3d | IndexedXYZCollection | Point3d[],\r\n radius: number | number[],\r\n allowBackupAlongEdge: boolean = true,\r\n ): Path | undefined {\r\n if (Array.isArray(points))\r\n return this.createFilletsInLineString(new Point3dArrayCarrier(points), radius, allowBackupAlongEdge);\r\n if (points instanceof LineString3d)\r\n return this.createFilletsInLineString(points.packedPoints, radius, allowBackupAlongEdge);\r\n const n = points.length;\r\n if (n <= 1)\r\n return undefined;\r\n const pointA = points.getPoint3dAtCheckedPointIndex(0)!;\r\n const pointB = points.getPoint3dAtCheckedPointIndex(1)!;\r\n // remark: n=2 and n=3 cases should fall out from loop logic\r\n const blendArray: ArcBlendData[] = [];\r\n // build one-sided blends at each end . .\r\n blendArray.push({ fraction10: 0.0, fraction12: 0.0, point: pointA.clone() });\r\n for (let i = 1; i + 1 < n; i++) {\r\n const pointC = points.getPoint3dAtCheckedPointIndex(i + 1)!;\r\n let thisRadius = 0;\r\n if (Array.isArray(radius)) {\r\n if (i < radius.length)\r\n thisRadius = radius[i];\r\n } else if (Number.isFinite(radius))\r\n thisRadius = radius;\r\n if (thisRadius !== 0.0)\r\n blendArray.push(Arc3d.createFilletArc(pointA, pointB, pointC, thisRadius));\r\n else\r\n blendArray.push({ fraction10: 0.0, fraction12: 0.0, point: pointB.clone() });\r\n pointA.setFromPoint3d(pointB);\r\n pointB.setFromPoint3d(pointC);\r\n }\r\n blendArray.push({ fraction10: 0.0, fraction12: 0.0, point: pointB.clone() });\r\n if (!allowBackupAlongEdge) {\r\n // suppress arcs that have overlap with both neighbors or flood either neighbor ..\r\n for (let i = 1; i + 1 < n; i++) {\r\n const b = blendArray[i];\r\n if (b.fraction10 > 1.0\r\n || b.fraction12 > 1.0\r\n || 1.0 - b.fraction10 < blendArray[i - 1].fraction12\r\n || b.fraction12 > 1.0 - blendArray[i + 1].fraction10) {\r\n b.fraction10 = 0.0;\r\n b.fraction12 = 0.0;\r\n blendArray[i].arc = undefined;\r\n }\r\n }\r\n /* The \"1-b\" logic above prevents this loop from ever doing anything.\r\n // on edge with conflict, suppress the arc with larger fraction\r\n for (let i = 1; i < n; i++) {\r\n const b0 = blendArray[i - 1];\r\n const b1 = blendArray[i];\r\n if (b0.fraction12 > 1 - b1.fraction10) {\r\n const b = b0.fraction12 > b1.fraction12 ? b1 : b0;\r\n b.fraction10 = 0.0;\r\n b.fraction12 = 0.0;\r\n blendArray[i].arc = undefined;\r\n }\r\n } */\r\n }\r\n const path = Path.create();\r\n this.addPartialSegment(\r\n path, allowBackupAlongEdge,\r\n blendArray[0].point, blendArray[1].point,\r\n blendArray[0].fraction12, 1.0 - blendArray[1].fraction10,\r\n );\r\n // add each path and successor edge ...\r\n for (let i = 1; i + 1 < points.length; i++) {\r\n const b0 = blendArray[i];\r\n const b1 = blendArray[i + 1];\r\n path.tryAddChild(b0.arc);\r\n this.addPartialSegment(path, allowBackupAlongEdge, b0.point, b1.point, b0.fraction12, 1.0 - b1.fraction10);\r\n }\r\n return path;\r\n }\r\n /**\r\n * Create a `Loop` with given xy corners and fixed z.\r\n * * The corners always proceed counter clockwise from lower left.\r\n * * If the radius is too large for the outer rectangle size, it is reduced to half of the the smaller x or y size.\r\n */\r\n public static createRectangleXY(\r\n x0: number, y0: number, x1: number, y1: number, z: number = 0, filletRadius?: number,\r\n ): Loop {\r\n let radius = Geometry.correctSmallMetricDistance(filletRadius);\r\n const xMin = Math.min(x0, x1);\r\n const xMax = Math.max(x0, x1);\r\n const yMin = Math.min(y0, y1);\r\n const yMax = Math.max(y0, y1);\r\n radius = Math.min(Math.abs(radius), 0.5 * (xMax - xMin), 0.5 * (yMax - yMin));\r\n if (radius === 0.0)\r\n return Loop.createPolygon([\r\n Point3d.create(xMin, yMin, z),\r\n Point3d.create(xMax, yMin, z),\r\n Point3d.create(xMax, yMax, z),\r\n Point3d.create(xMin, yMax, z),\r\n Point3d.create(xMin, yMin, z),\r\n ]);\r\n else {\r\n const vectorU = Vector3d.create(radius, 0, 0);\r\n const vectorV = Vector3d.create(0, radius, 0);\r\n const x0A = xMin + radius;\r\n const y0A = yMin + radius;\r\n const x1A = xMax - radius;\r\n const y1A = yMax - radius;\r\n const centers = [\r\n Point3d.create(x1A, y1A, z),\r\n Point3d.create(x0A, y1A, z),\r\n Point3d.create(x0A, y0A, z),\r\n Point3d.create(x1A, y0A, z),\r\n ];\r\n const loop = Loop.create();\r\n for (let i = 0; i < 4; i++) {\r\n const center = centers[i];\r\n const nextCenter = centers[(i + 1) % 4];\r\n const edgeVector = Vector3d.createStartEnd(center, nextCenter);\r\n const arc = Arc3d.create(center, vectorU, vectorV, AngleSweep.createStartEndDegrees(0, 90));\r\n loop.tryAddChild(arc);\r\n const arcEnd = arc.endPoint();\r\n if (!edgeVector.isAlmostZero)\r\n loop.tryAddChild(LineSegment3d.create(arcEnd, arcEnd.plus(edgeVector)));\r\n vectorU.rotate90CCWXY(vectorU);\r\n vectorV.rotate90CCWXY(vectorV);\r\n }\r\n return loop;\r\n }\r\n }\r\n /**\r\n * If `arcB` is a continuation of `arcA`, extend `arcA` (in place) to include the range of `arcB`\r\n * * This only succeeds if the two arcs are part of identical complete arcs and end of `arcA` matches the beginning of `arcB`.\r\n * @param arcA first arc, modified in place.\r\n * @param arcB second arc, unmodified.\r\n * @param allowReversed whether to consolidate even when second arc is reversed (default is `false`).\r\n * @param tolerance optional coordinate tolerance for point equality (default is `Geometry.smallMetricDistance`).\r\n * @returns whether `arcA` was modified.\r\n */\r\n public static appendToArcInPlace(arcA: Arc3d, arcB: Arc3d, allowReverse: boolean = false, tolerance: number = Geometry.smallMetricDistance): boolean {\r\n if (arcA.center.isAlmostEqual(arcB.center, tolerance)) {\r\n const sweepSign = Geometry.split3WaySign(arcA.sweep.sweepRadians * arcB.sweep.sweepRadians, -1, 0, 1);\r\n // evaluate derivatives wrt radians (not fraction!), but adjust direction for sweep signs\r\n const endA = arcA.angleToPointAndDerivative(arcA.sweep.fractionToAngle(1.0));\r\n if (arcA.sweep.sweepRadians < 0)\r\n endA.direction.scaleInPlace(-1.0);\r\n const startB = arcB.angleToPointAndDerivative(arcB.sweep.fractionToAngle(0.0));\r\n if (arcB.sweep.sweepRadians < 0)\r\n startB.direction.scaleInPlace(-1.0);\r\n if (endA.isAlmostEqual(startB, tolerance)) {\r\n arcA.sweep.setStartEndRadians(\r\n arcA.sweep.startRadians, arcA.sweep.startRadians + arcA.sweep.sweepRadians + sweepSign * arcB.sweep.sweepRadians,\r\n );\r\n return true;\r\n }\r\n // Also ok if negated tangent\r\n if (allowReverse) {\r\n startB.direction.scaleInPlace(-1.0);\r\n if (endA.isAlmostEqual(startB, tolerance)) {\r\n arcA.sweep.setStartEndRadians(\r\n arcA.sweep.startRadians, arcA.sweep.startRadians + arcA.sweep.sweepRadians - sweepSign * arcB.sweep.sweepRadians,\r\n );\r\n return true;\r\n }\r\n }\r\n }\r\n return false;\r\n }\r\n /**\r\n * Return a `Path` containing arcs are on the surface of an ellipsoid and pass through a sequence of points.\r\n * * Each arc passes through the two given endpoints and in the plane containing the true surface normal at\r\n * given `fractionForIntermediateNormal`\r\n * @param ellipsoid\r\n * @param pathPoints\r\n * @param fractionForIntermediateNormal fractional position for surface normal used to create the section plane.\r\n */\r\n public static assembleArcChainOnEllipsoid(\r\n ellipsoid: Ellipsoid, pathPoints: GeodesicPathPoint[], fractionForIntermediateNormal: number = 0.5,\r\n ): Path {\r\n const arcPath = Path.create();\r\n for (let i = 0; i + 1 < pathPoints.length; i++) {\r\n const arc = ellipsoid.sectionArcWithIntermediateNormal(\r\n pathPoints[i].toAngles(),\r\n fractionForIntermediateNormal,\r\n pathPoints[i + 1].toAngles());\r\n arcPath.tryAddChild(arc);\r\n }\r\n return arcPath;\r\n }\r\n private static appendGeometryQueryArray(candidate: GeometryQuery | GeometryQuery[] | undefined, result: GeometryQuery[]) {\r\n if (candidate instanceof GeometryQuery)\r\n result.push(candidate);\r\n else if (Array.isArray(candidate)) {\r\n for (const p of candidate)\r\n this.appendGeometryQueryArray(p, result);\r\n }\r\n }\r\n /**\r\n * Create solid primitives for pipe segments (e.g. Cone or TorusPipe) around line and arc primitives.\r\n * @param centerline centerline geometry.\r\n * @param pipeRadius radius of pipe.\r\n */\r\n public static createPipeSegments(\r\n centerline: CurvePrimitive | CurveChain, pipeRadius: number,\r\n ): GeometryQuery | GeometryQuery[] | undefined {\r\n if (centerline instanceof LineSegment3d) {\r\n return Cone.createAxisPoints(centerline.startPoint(), centerline.endPoint(), pipeRadius, pipeRadius, false);\r\n } else if (centerline instanceof Arc3d) {\r\n return TorusPipe.createAlongArc(centerline, pipeRadius, false);\r\n } else if (centerline instanceof CurvePrimitive) {\r\n const builder = PolyfaceBuilder.create();\r\n builder.addMiteredPipes(centerline, pipeRadius);\r\n return builder.claimPolyface();\r\n } else if (centerline instanceof CurveChain) {\r\n const result: GeometryQuery[] = [];\r\n for (const p of centerline.children) {\r\n const pipe = this.createPipeSegments(p, pipeRadius);\r\n this.appendGeometryQueryArray(pipe, result);\r\n }\r\n return result;\r\n }\r\n return undefined;\r\n }\r\n /** Get start point and tangent for variant curve data. */\r\n private static startPointAndTangent(curve: IndexedXYZCollection | Point3d[] | CurvePrimitive): Ray3d | undefined {\r\n if (curve instanceof CurvePrimitive)\r\n return curve.fractionToPointAndDerivative(0.0);\r\n if (curve.length < 2)\r\n return undefined;\r\n if (Array.isArray(curve))\r\n curve = new Point3dArrayCarrier(curve);\r\n const ray = Ray3d.createZero();\r\n curve.getPoint3dAtUncheckedPointIndex(0, ray.origin);\r\n curve.vectorIndexIndex(0, 1, ray.direction);\r\n return ray;\r\n };\r\n /** Create an [[Arc3d]] from `sectionData` that has its center at the start point of the centerline. */\r\n public static createArcFromSectionData(\r\n centerline: IndexedXYZCollection | Point3d[] | CurvePrimitive, sectionData: number | XAndY | Arc3d,\r\n ): Arc3d | undefined {\r\n const ray = CurveFactory.startPointAndTangent(centerline);\r\n if (!ray)\r\n return undefined;\r\n let arc: Arc3d;\r\n if (sectionData instanceof Arc3d) {\r\n arc = sectionData.clone();\r\n arc.center = ray.origin;\r\n } else {\r\n const vector0 = Vector3d.create();\r\n const vector90 = Vector3d.create();\r\n const length0 = (typeof sectionData === \"number\") ? sectionData : sectionData.x;\r\n const length90 = (typeof sectionData === \"number\") ? sectionData : sectionData.y;\r\n const baseFrame = Matrix3d.createRigidHeadsUp(ray.direction, AxisOrder.ZXY);\r\n baseFrame.columnX(vector0).scaleInPlace(length0);\r\n baseFrame.columnY(vector90).scaleInPlace(length90);\r\n arc = Arc3d.create(ray.origin, vector0, vector90);\r\n }\r\n if (arc.binormalVector().dotProduct(ray.direction) < 0.0)\r\n arc.reverseInPlace();\r\n return arc;\r\n }\r\n /**\r\n * Create section arcs for mitered pipe.\r\n * * At the end of each pipe segment, the pipe is mitered by the plane that bisects the angle between successive\r\n * centerline segments.\r\n * * The section arcs are constructed so that lines between corresponding fractional positions on the arcs are\r\n * axial lines on the pipes.\r\n * * This means that the initial arc's vector0 and vector90 lengths and angular separation are _not_ preserved in\r\n * the section arcs.\r\n * * Circular or elliptical pipe cross sections can be specified by supplying either a radius, a pair of semi-axis\r\n * lengths, or an Arc3d:\r\n * * For semi-axis length input, x and y correspond to ellipse local axes perpendicular to each other and to the\r\n * start tangent.\r\n * * For Arc3d input, the center is translated to the centerline start point. For best results, ensure this arc\r\n * is perpendicular to the centerline start tangent.\r\n * * This function internally calls [[createMiteredSweepSections]] with default options.\r\n * @param centerline centerline of pipe. For best results, ensure no successive duplicate points with e.g.,\r\n * [[GrowableXYZArray.createCompressed]].\r\n * @param sectionData circle radius, ellipse semi-axis lengths, or full Arc3d (if not full, function makes it full).\r\n * @returns array of sections or empty array if section creation failed.\r\n */\r\n public static createMiteredPipeSections(centerline: IndexedXYZCollection, sectionData: number | XAndY | Arc3d): Arc3d[] {\r\n const arc = CurveFactory.createArcFromSectionData(centerline, sectionData);\r\n if (!arc)\r\n return [];\r\n const miteredSweeps = CurveFactory.createMiteredSweepSections(centerline, arc);\r\n if (miteredSweeps)\r\n return miteredSweeps.sections as Arc3d[];\r\n return [];\r\n }\r\n\r\n /** For a smooth curve, stroke and return unnormalized start/end tangents. */\r\n private static strokeSmoothCurve(\r\n curve: IndexedXYZCollection | Point3d[] | CurvePrimitive | CurveChain,\r\n options?: StrokeOptions,\r\n ): SmoothCurveData | undefined {\r\n let startTangent, endTangent: Vector3d | undefined;\r\n if (curve instanceof CurvePrimitive) {\r\n startTangent = curve.fractionToPointAndDerivative(0.0).direction;\r\n endTangent = curve.fractionToPointAndDerivative(1.0).direction;\r\n const strokes = LineString3d.create();\r\n curve.emitStrokes(strokes, options);\r\n curve = strokes.packedPoints;\r\n } else if (curve instanceof CurveChain) {\r\n startTangent = curve.startPointAndDerivative()?.direction;\r\n endTangent = curve.endPointAndDerivative()?.direction;\r\n const strokes = curve.getPackedStrokes(options);\r\n if (!strokes)\r\n return undefined;\r\n curve = strokes;\r\n } else if (Array.isArray(curve))\r\n curve = new Point3dArrayCarrier(curve);\r\n return { strokes: curve, startTangent, endTangent };\r\n }\r\n\r\n /**\r\n * Align two bisector plane normals to given smooth rail tangents or optional overrides.\r\n * * Optionally average the normals for physically closed rail.\r\n */\r\n private static alignFirstAndLastBisectorPlanes(\r\n firstPlane: Plane3dByOriginAndUnitNormal,\r\n lastPlane: Plane3dByOriginAndUnitNormal,\r\n smoothRailData?: SmoothCurveData,\r\n options?: MiteredSweepOptions,\r\n ) {\r\n const normal0 = options?.startTangent ?? (smoothRailData?.startTangent ?? firstPlane.getNormalRef());\r\n const normal1 = options?.endTangent ?? (smoothRailData?.endTangent ?? lastPlane.getNormalRef());\r\n if (options?.wrapIfPhysicallyClosed && firstPlane.getOriginRef().isAlmostEqual(lastPlane.getOriginRef())) {\r\n const avgNormal = normal0.plus(normal1);\r\n if (avgNormal.tryNormalizeInPlace()) { // ignore cusp at seam\r\n firstPlane.getNormalRef().setFrom(avgNormal);\r\n lastPlane.getNormalRef().setFrom(avgNormal);\r\n return;\r\n }\r\n }\r\n if (normal0.tryNormalizeInPlace())\r\n firstPlane.getNormalRef().setFrom(normal0);\r\n if (normal1.tryNormalizeInPlace())\r\n lastPlane.getNormalRef().setFrom(normal1);\r\n }\r\n\r\n /** Reverse a closed curve or region if necessary so that its orientation is CCW with respect to the plane normal. */\r\n private static alignClosedCurveToPlane(curve: AnyCurve, planeNormal: Vector3d) {\r\n let closedCurve: AnyRegion | undefined;\r\n if (curve instanceof CurvePrimitive) {\r\n if (curve.startPoint().isAlmostEqual(curve.endPoint()))\r\n closedCurve = Loop.create(curve);\r\n } else if (curve.isAnyRegion())\r\n closedCurve = curve;\r\n if (closedCurve) {\r\n // The alignment condition is equivalent to positive projected curve area computed wrt to the plane normal.\r\n const toLocal = Matrix3d.createRigidHeadsUp(planeNormal).transpose();\r\n const projection = closedCurve.cloneTransformed(Transform.createOriginAndMatrix(undefined, toLocal));\r\n if (projection) { // now we can ignore z-coords\r\n const areaXY = RegionOps.computeXYArea(projection as AnyRegion);\r\n if (areaXY && areaXY < 0)\r\n curve.reverseInPlace();\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Projection to target plane, constructing sweep direction from two given planes.\r\n * * If successful, push the target plane and swept section to the output arrays and return the swept section.\r\n * * If unsuccessful, leave the output arrays alone and return the input section.\r\n */\r\n private static doSweepToPlane(\r\n output: SectionSequenceWithPlanes,\r\n edgePlane0: Plane3dByOriginAndUnitNormal,\r\n edgePlane1: Plane3dByOriginAndUnitNormal,\r\n targetPlane: Plane3dByOriginAndUnitNormal,\r\n section: AnyCurve,\r\n ): AnyCurve {\r\n const sweepVector = Vector3d.createStartEnd(edgePlane0.getOriginRef(), edgePlane1.getOriginRef());\r\n const transform = Transform.createFlattenAlongVectorToPlane(\r\n sweepVector, targetPlane.getOriginRef(), targetPlane.getNormalRef(),\r\n );\r\n if (transform === undefined)\r\n return section;\r\n const transformedSection = section.cloneTransformed(transform);\r\n if (transformedSection === undefined)\r\n return section;\r\n output.planes.push(targetPlane);\r\n output.sections.push(transformedSection);\r\n return transformedSection;\r\n }\r\n\r\n /**\r\n * Sweep the `initialSection` along each segment of the (stroked) `centerline` until it hits the bisector plane at\r\n * the next vertex.\r\n * * For best results, the caller should place `initialSection` in a plane perpendicular to the `centerline`\r\n * start tangent.\r\n * * This plane is commonly (but not necessarily) through the centerline start point itself.\r\n * * To compute the sections, `initialSection` is projected in the direction of the centerline start tangent onto\r\n * the first bisector plane at the centerline start. The result of this projection will be likewise projected onto\r\n * the second plane, and so on in sequence.\r\n * * By default, the first/last bisector plane normals are set to the centerline start/end tangents. The caller can\r\n * override these with tangents supplied in `options`. If the centerline is physically closed and\r\n * `options.wrapIfPhysicallyClosed` is true, the first and last plane normals are averaged and equated.\r\n * * The centerline path does NOT have to be planar, however non-planarity will result in twisting of the sections\r\n * in the bisector planes.\r\n * @param centerline sweep path. Will be stroked if smooth.\r\n * @param initialSection profile curve to be swept. As noted above, this should be on a plane perpendicular to the\r\n * centerline start tangent.\r\n * @param options options for computation and output.\r\n * @return array of sections, formed from projecting `initialSection` successively onto the bisector planes.\r\n */\r\n public static createMiteredSweepSections(\r\n centerline: IndexedXYZCollection | Point3d[] | CurvePrimitive | CurveChain,\r\n initialSection: AnyCurve,\r\n options?: MiteredSweepOptions,\r\n ): SectionSequenceWithPlanes | undefined {\r\n if (!options)\r\n options = {};\r\n const rail = this.strokeSmoothCurve(centerline, options.strokeOptions);\r\n if (!rail)\r\n return undefined;\r\n const planes = PolylineOps.createBisectorPlanesForDistinctPoints(rail.strokes);\r\n if (!planes || planes.length < 2)\r\n return undefined;\r\n this.alignFirstAndLastBisectorPlanes(planes[0], planes[planes.length - 1], rail, options);\r\n\r\n // RuledSweep facet construction assumes the contours are oriented CCW with respect to the sweep direction so that\r\n // facet normals point outward. We only have to align the first contour; the rest will inherit its orientation.\r\n this.alignClosedCurveToPlane(initialSection, planes[0].getNormalRef());\r\n\r\n const sectionData: SectionSequenceWithPlanes = { sections: [], planes: [] };\r\n let currentSection = this.doSweepToPlane(sectionData, planes[0], planes[1], planes[0], initialSection);\r\n for (let i = 1; i < planes.length; i++)\r\n currentSection = this.doSweepToPlane(sectionData, planes[i - 1], planes[i], planes[i], currentSection);\r\n\r\n if (options.outputSelect) {\r\n const ruledSweep = RuledSweep.create(sectionData.sections, options.capped ?? false);\r\n if (ruledSweep) {\r\n sectionData.ruledSweep = ruledSweep;\r\n if (MiteredSweepOutputSelect.AlsoMesh === options.outputSelect) {\r\n const builder = PolyfaceBuilder.create(options.strokeOptions);\r\n builder.addRuledSweep(ruledSweep);\r\n sectionData.mesh = builder.claimPolyface();\r\n }\r\n }\r\n }\r\n return sectionData;\r\n }\r\n /**\r\n * Create a circular arc from start point, tangent at start, radius, optional plane normal, arc sweep.\r\n * * The vector from start point to center is in the direction of upVector crossed with tangentA.\r\n * @param start start point.\r\n * @param tangentAtStart vector in tangent direction at the start.\r\n * @param radius signed radius.\r\n * @param upVector optional out-of-plane vector. Defaults to positive Z.\r\n * @param sweep angular range. If single `Angle` is given, start angle is at 0 degrees (the start point).\r\n */\r\n public static createArcPointTangentRadius(\r\n start: Point3d, tangentAtStart: Vector3d, radius: number, upVector?: Vector3d, sweep?: Angle | AngleSweep,\r\n ): Arc3d | undefined {\r\n return Arc3d.createCircularStartTangentRadius(start, tangentAtStart, radius, upVector, sweep);\r\n }\r\n /**\r\n * Compute 2 spirals (all in XY) for a symmetric line-to-line transition.\r\n * * First spiral begins at given start point.\r\n * * first tangent aims at shoulder.\r\n * * outbound spiral joins line from shoulder to target.\r\n * @param spiralType name of spiral type. THIS MUST BE AN \"Integrated\" SPIRAL TYPE.\r\n * @param startPoint inbound start point.\r\n * @param shoulder point target point for (both) spiral-to-line tangencies.\r\n * @return array with the computed spirals, or undefined if failure.\r\n */\r\n public static createLineSpiralSpiralLine(\r\n spiralType: IntegratedSpiralTypeName,\r\n startPoint: Point3d,\r\n shoulderPoint: Point3d,\r\n targetPoint: Point3d,\r\n ): GeometryQuery[] | undefined {\r\n const vectorAB = Vector3d.createStartEnd(startPoint, shoulderPoint);\r\n const vectorBC0 = Vector3d.createStartEnd(shoulderPoint, targetPoint);\r\n const referenceLength = vectorAB.magnitude();\r\n const radiansAB = Math.atan2(vectorAB.y, vectorAB.x);\r\n const lineTurnRadians = vectorAB.angleToXY(vectorBC0);\r\n const spiralTurnRadians = 0.5 * lineTurnRadians.radians;\r\n const radiansBC = radiansAB + lineTurnRadians.radians;\r\n const axesA = Matrix3d.createRotationAroundAxisIndex(AxisIndex.Z, Angle.createRadians(radiansAB));\r\n const frameA = Transform.createRefs(startPoint.clone(), axesA);\r\n // We know how much it has to turn, and but not the length or end radius.\r\n // make a spiral of referenceLength and scale it back to the junction line\r\n const spiralARefLength = IntegratedSpiral3d.createFrom4OutOf5(spiralType, 0.0, undefined,\r\n Angle.createRadians(0), Angle.createRadians(spiralTurnRadians), referenceLength, undefined, frameA);\r\n if (spiralARefLength) {\r\n const midPlanePerpendicularRadians = radiansAB + spiralTurnRadians;\r\n const midPlanePerpendicularVector = Vector3d.createPolar(1.0, Angle.createRadians(midPlanePerpendicularRadians));\r\n const altitudeB = midPlanePerpendicularVector.dotProductStartEnd(startPoint, shoulderPoint);\r\n const altitudeSpiralEnd = midPlanePerpendicularVector.dotProductStartEnd(startPoint, spiralARefLength.endPoint());\r\n const scaleFactor = altitudeB / altitudeSpiralEnd;\r\n const spiralA = IntegratedSpiral3d.createFrom4OutOf5(spiralType, 0.0, undefined,\r\n Angle.createRadians(0), Angle.createRadians(spiralTurnRadians), referenceLength * scaleFactor, undefined, frameA)!;\r\n const distanceAB = vectorAB.magnitude();\r\n const vectorBC = Vector3d.createStartEnd(shoulderPoint, targetPoint);\r\n vectorBC.scaleToLength(distanceAB, vectorBC);\r\n const pointC = shoulderPoint.plus(vectorBC);\r\n const axesC = Matrix3d.createRotationAroundAxisIndex(AxisIndex.Z, Angle.createRadians(radiansBC + Math.PI));\r\n const frameC = Transform.createRefs(pointC, axesC);\r\n const spiralC = IntegratedSpiral3d.createFrom4OutOf5(spiralType,\r\n 0, -spiralA.radius01.x1, Angle.zero(), undefined, spiralA.curveLength(), Segment1d.create(1, 0), frameC)!;\r\n return [spiralA, spiralC];\r\n }\r\n return undefined;\r\n }\r\n /**\r\n * Compute 2 spirals (all in XY) for a symmetric line-to-line transition.\r\n * * Spiral length is given.\r\n * * tangency points float on both lines.\r\n * @param spiralType name of spiral type. THIS MUST BE AN \"Integrated\" SPIRAL TYPE.\r\n * @param pointA inbound start point.\r\n * @param shoulder point target point for (both) spiral-to-line tangencies.\r\n * @param spiralLength for each part of the spiral pair.\r\n * @return array with the computed spirals, or undefined if failure.\r\n */\r\n public static createLineSpiralSpiralLineWithSpiralLength(\r\n spiralType: IntegratedSpiralTypeName,\r\n pointA: Point3d,\r\n pointB: Point3d,\r\n pointC: Point3d,\r\n spiralLength: number,\r\n ): GeometryQuery[] | undefined {\r\n const vectorAB = Vector3d.createStartEnd(pointA, pointB);\r\n const vectorBC = Vector3d.createStartEnd(pointB, pointC);\r\n const radiansAB = Math.atan2(vectorAB.y, vectorAB.x);\r\n const lineTurnAngle = vectorAB.angleToXY(vectorBC);\r\n const spiralTurnRadians = 0.5 * lineTurnAngle.radians;\r\n const bisectorRadians = 0.5 * (Math.PI - lineTurnAngle.radians);\r\n const radiansCB = Math.atan2(-vectorBC.y, -vectorBC.x);\r\n const spiralAB0 = IntegratedSpiral3d.createFrom4OutOf5(\r\n spiralType, 0, undefined,\r\n Angle.zero(), Angle.createRadians(spiralTurnRadians),\r\n spiralLength, undefined, Transform.createIdentity(),\r\n );\r\n if (spiralAB0) {\r\n const localEndPoint = spiralAB0.fractionToPoint(1);\r\n const distanceAB = pointA.distance(pointB);\r\n const distanceCB = pointC.distance(pointB);\r\n // The spiral eventually has to end on the bisector, at localEndPoint.y height from the inbound line\r\n // distance from shoulder to projection of that point to point E on the inbound line is\r\n const distanceBE = localEndPoint.y / Math.tan(bisectorRadians);\r\n const xFractionAB = Geometry.conditionalDivideFraction(distanceAB - distanceBE - localEndPoint.x, distanceAB);\r\n const xFractionCB = Geometry.conditionalDivideFraction(distanceCB - distanceBE - localEndPoint.x, distanceCB);\r\n if (xFractionAB !== undefined && xFractionCB !== undefined) {\r\n const axesA = Matrix3d.createRotationAroundAxisIndex(AxisIndex.Z, Angle.createRadians(radiansAB));\r\n const frameAOrigin = pointA.interpolate(xFractionAB, pointB);\r\n const frameA = Transform.createRefs(frameAOrigin, axesA);\r\n const spiralAB = IntegratedSpiral3d.createFrom4OutOf5(\r\n spiralType, 0, undefined,\r\n Angle.zero(), Angle.createRadians(spiralTurnRadians),\r\n spiralLength, undefined, frameA,\r\n )!;\r\n const axesB = Matrix3d.createRotationAroundAxisIndex(AxisIndex.Z, Angle.createRadians(radiansCB));\r\n const frameBOrigin = pointC.interpolate(xFractionCB, pointB);\r\n const frameB = Transform.createRefs(frameBOrigin, axesB);\r\n const spiralBC = IntegratedSpiral3d.createFrom4OutOf5(\r\n spiralType, 0, undefined,\r\n Angle.zero(), Angle.createRadians(-spiralTurnRadians),\r\n spiralLength, undefined, frameB,\r\n )!;\r\n return [spiralAB, spiralBC];\r\n }\r\n }\r\n return undefined;\r\n }\r\n /**\r\n * Compute 2 spirals and an arc (all in XY) for a symmetric line-to-line transition.\r\n * Spiral lengths and arc radius are given (e.g., from design speed standards).\r\n * @param spiralType name of spiral type. THIS MUST BE AN \"Integrated\" SPIRAL TYPE.\r\n * @param pointA inbound start point.\r\n * @param pointB shoulder (target) point for (both) spiral-to-line tangencies.\r\n * @param lengthA inbound spiral length.\r\n * @param lengthB outbound spiral length.\r\n * @return array with the computed spirals, or undefined if failure.\r\n */\r\n public static createLineSpiralArcSpiralLine(\r\n spiralType: IntegratedSpiralTypeName,\r\n pointA: Point3d,\r\n pointB: Point3d,\r\n pointC: Point3d,\r\n lengthA: number,\r\n lengthB: number,\r\n arcRadius: number,\r\n ): GeometryQuery[] | undefined {\r\n const vectorAB = Vector3d.createStartEnd(pointA, pointB); vectorAB.z = 0;\r\n const vectorCB = Vector3d.createStartEnd(pointC, pointB); vectorCB.z = 0;\r\n const unitAB = vectorAB.normalize();\r\n const unitCB = vectorCB.normalize();\r\n if (unitAB === undefined || unitCB === undefined)\r\n return undefined;\r\n const unitPerpAB = unitAB.unitPerpendicularXY();\r\n const unitPerpCB = unitCB.unitPerpendicularXY();\r\n const thetaABC = vectorAB.angleToXY(vectorCB);\r\n const sideA = Geometry.split3WaySign(thetaABC.radians, 1, -1, -1);\r\n const sideB = - sideA;\r\n const radiusA = sideA * Math.abs(arcRadius);\r\n const radiusB = sideB * Math.abs(arcRadius);\r\n const spiralA = IntegratedSpiral3d.createFrom4OutOf5(spiralType,\r\n 0, radiusA, Angle.zero(), undefined, lengthA, undefined, Transform.createIdentity())!;\r\n const spiralB = IntegratedSpiral3d.createFrom4OutOf5(spiralType,\r\n 0, radiusB, Angle.zero(), undefined, lengthB, undefined, Transform.createIdentity())!;\r\n const spiralEndA = spiralA.fractionToPointAndUnitTangent(1.0);\r\n const spiralEndB = spiralB.fractionToPointAndUnitTangent(1.0);\r\n // From the end of spiral, step away to arc center (and this is in local coordinates of each spiral)\r\n const sA = spiralEndA.origin.x - radiusA * spiralEndA.direction.y;\r\n const tA = spiralEndA.origin.y + radiusA * spiralEndA.direction.x;\r\n const sB = spiralEndB.origin.x - radiusB * spiralEndB.direction.y;\r\n const tB = spiralEndB.origin.y + radiusB * spiralEndB.direction.x;\r\n // Those local coordinates are rotated to unitAB and unitBC ...\r\n const vectorA = Vector3d.createAdd2Scaled(unitAB, sA, unitPerpAB, tA);\r\n const vectorB = Vector3d.createAdd2Scaled(unitCB, sB, unitPerpCB, tB);\r\n const uv = Vector2d.create();\r\n if (SmallSystem.linearSystem2d(\r\n unitAB.x, -unitCB.x,\r\n unitAB.y, -unitCB.y,\r\n vectorB.x - vectorA.x, vectorB.y - vectorA.y, uv)) {\r\n const tangencyAB = pointB.plusScaled(unitAB, uv.x);\r\n const tangencyCB = pointB.plusScaled(unitCB, uv.y);\r\n const frameA = Transform.createOriginAndMatrixColumns(tangencyAB, unitAB, unitPerpAB, Vector3d.unitZ());\r\n const frameB = Transform.createOriginAndMatrixColumns(tangencyCB, unitCB, unitPerpCB, Vector3d.unitZ());\r\n spiralA.tryTransformInPlace(frameA);\r\n spiralB.tryTransformInPlace(frameB);\r\n const rayA1 = spiralA.fractionToPointAndUnitTangent(1.0);\r\n const rayB0 = spiralB.fractionToPointAndUnitTangent(1.0);\r\n rayB0.direction.scaleInPlace(-1.0);\r\n const sweep = rayA1.direction.angleToXY(rayB0.direction);\r\n if (radiusA < 0)\r\n sweep.setRadians(- sweep.radians);\r\n const arc = CurveFactory.createArcPointTangentRadius(rayA1.origin, rayA1.direction, radiusA, undefined, sweep)!;\r\n return [spiralA, arc, spiralB];\r\n }\r\n return undefined;\r\n }\r\n /** Return the intersection point of 3 planes. */\r\n public static planePlaneIntersectionRay(\r\n planeA: PlaneAltitudeEvaluator, planeB: PlaneAltitudeEvaluator): Ray3d | undefined {\r\n const altitudeA = planeA.altitudeXYZ(0, 0, 0);\r\n const altitudeB = planeB.altitudeXYZ(0, 0, 0);\r\n const normalAx = planeA.normalX();\r\n const normalAy = planeA.normalY();\r\n const normalAz = planeA.normalZ();\r\n const normalBx = planeB.normalX();\r\n const normalBy = planeB.normalY();\r\n const normalBz = planeB.normalZ();\r\n const normalCx = Geometry.crossProductXYXY(normalAy, normalAz, normalBy, normalBz);\r\n const normalCy = Geometry.crossProductXYXY(normalAz, normalAx, normalBz, normalBx);\r\n const normalCz = Geometry.crossProductXYXY(normalAx, normalAy, normalBx, normalBy);\r\n const rayOrigin = SmallSystem.linearSystem3d(\r\n normalAx, normalAy, normalAz,\r\n normalBx, normalBy, normalBz,\r\n normalCx, normalCy, normalCz,\r\n -altitudeA, -altitudeB, 0.0);\r\n if (rayOrigin !== undefined) {\r\n return Ray3d.createXYZUVW(rayOrigin.x, rayOrigin.y, rayOrigin.z, normalCx, normalCy, normalCz);\r\n }\r\n return undefined;\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CAirBC","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 Curve\n */\n\nimport { AxisIndex, AxisOrder, Geometry, PlaneAltitudeEvaluator } from \"../Geometry\";\nimport { Angle } from \"../geometry3d/Angle\";\nimport { AngleSweep } from \"../geometry3d/AngleSweep\";\nimport { Ellipsoid, GeodesicPathPoint } from \"../geometry3d/Ellipsoid\";\nimport { IndexedXYZCollection } from \"../geometry3d/IndexedXYZCollection\";\nimport { Matrix3d } from \"../geometry3d/Matrix3d\";\nimport { Plane3dByOriginAndUnitNormal } from \"../geometry3d/Plane3dByOriginAndUnitNormal\";\nimport { Vector2d } from \"../geometry3d/Point2dVector2d\";\nimport { Point3dArrayCarrier } from \"../geometry3d/Point3dArrayCarrier\";\nimport { Point3d, Vector3d } from \"../geometry3d/Point3dVector3d\";\nimport { PolylineOps } from \"../geometry3d/PolylineOps\";\nimport { Ray3d } from \"../geometry3d/Ray3d\";\nimport { Segment1d } from \"../geometry3d/Segment1d\";\nimport { Transform } from \"../geometry3d/Transform\";\nimport { XAndY } from \"../geometry3d/XYZProps\";\nimport { SmallSystem } from \"../numerics/SmallSystem\";\nimport { IndexedPolyface } from \"../polyface/Polyface\";\nimport { PolyfaceBuilder } from \"../polyface/PolyfaceBuilder\";\nimport { Cone } from \"../solid/Cone\";\nimport { RuledSweep } from \"../solid/RuledSweep\";\nimport { TorusPipe } from \"../solid/TorusPipe\";\nimport { Arc3d, ArcBlendData } from \"./Arc3d\";\nimport { CurveChain } from \"./CurveCollection\";\nimport { CurvePrimitive } from \"./CurvePrimitive\";\nimport { AnyCurve, AnyRegion } from \"./CurveTypes\";\nimport { GeometryQuery } from \"./GeometryQuery\";\nimport { LineSegment3d } from \"./LineSegment3d\";\nimport { LineString3d } from \"./LineString3d\";\nimport { Loop } from \"./Loop\";\nimport { Path } from \"./Path\";\nimport { RegionOps } from \"./RegionOps\";\nimport { IntegratedSpiral3d } from \"./spiral/IntegratedSpiral3d\";\nimport { IntegratedSpiralTypeName } from \"./spiral/TransitionSpiral3d\";\nimport { StrokeOptions } from \"./StrokeOptions\";\n\n/**\n * Interface to carry parallel arrays of planes and sections, and optional geometry assembled from them,\n * as returned by [CurveFactory.createMiteredSweepSections].\n * @public\n */\nexport interface SectionSequenceWithPlanes {\n /** The plane of each section. */\n planes: Plane3dByOriginAndUnitNormal[];\n /** Section curve projected onto the corresponding plane. */\n sections: AnyCurve[];\n /**\n * Optional `RuledSweep` generated from the sections.\n * * The `RuledSweep` and sections array refer to the same section objects.\n */\n ruledSweep?: RuledSweep;\n /** Optional mesh generated from the `RuledSweep` generated from the sections. */\n mesh?: IndexedPolyface;\n}\n\n/**\n * Enumeration of geometric output for [CurveFactory.createMiteredSweepSections].\n * @public\n */\nexport enum MiteredSweepOutputSelect {\n /** Output only the parallel arrays of planes and sections. */\n Sections = 0,\n /** Output planes and sections, as well as the assembled ruled sweep. */\n AlsoRuledSweep = 1,\n /** Output planes and sections, as well as the assembled ruled sweep and its stroked mesh. */\n AlsoMesh = 2,\n}\n\n/**\n * Interface bundling options for [CurveFactory.createMiteredSweepSections].\n * @public\n */\nexport interface MiteredSweepOptions {\n /** Whether first and last planes are averaged and equated when the centerline is physically closed. Default value is `false`. */\n wrapIfPhysicallyClosed?: boolean;\n /** Whether to output sections only, or sections plus optional geometry constructed from them. Default value is `MiteredSweepOutputSelect.Sections`. */\n outputSelect?: MiteredSweepOutputSelect;\n /** How to stroke smooth input curves. If undefined, default stroke options are used. */\n strokeOptions?: StrokeOptions;\n /** Whether to cap the ruled sweep if outputting a ruled sweep or mesh. Default value is `false`. */\n capped?: boolean;\n /** The first section's normal is aligned to this vector, typically the start tangent of the smooth curve stroked for the centerline. */\n startTangent?: Vector3d;\n /** The last section's normal is aligned to this vector, typically the end tangent of the smooth curve stroked for the centerline. */\n endTangent?: Vector3d;\n}\n\n/**\n * Curve strokes plus start/end tangents.\n * @internal\n*/\ninterface SmoothCurveData {\n /** Samples along a curve. */\n strokes: IndexedXYZCollection;\n /** Start tangent (unnormalized). May be undefined if the curve is linear. */\n startTangent?: Vector3d;\n /** End tangent (unnormalized). May be undefined if the curve is linear. */\n endTangent?: Vector3d;\n};\n\n/**\n * The `CurveFactory` class contains methods for specialized curve constructions.\n * @public\n */\nexport class CurveFactory {\n /** (Cautiously) construct and save a line segment between fractional positions. */\n private static addPartialSegment(\n path: Path, allowBackup: boolean,\n pointA: Point3d | undefined, pointB: Point3d | undefined,\n fraction0: number, fraction1: number,\n ) {\n if (allowBackup || (fraction1 > fraction0)) {\n if (pointA !== undefined && pointB !== undefined && !Geometry.isAlmostEqualNumber(fraction0, fraction1))\n path.tryAddChild(LineSegment3d.create(pointA.interpolate(fraction0, pointB), pointA.interpolate(fraction1, pointB)));\n }\n }\n /**\n * Create a circular arc defined by start point, tangent at start point, and end point.\n * * The circular arc is swept from start to end toward direction of the `tangentAtStart`.\n * * If tangent is parallel to line segment from start to end, return `undefined`.\n */\n public static createArcPointTangentPoint(start: Point3d, tangentAtStart: Vector3d, end: Point3d): Arc3d | undefined {\n const ret = Arc3d.createCircularStartTangentEnd(start, tangentAtStart, end);\n if (ret instanceof Arc3d)\n return ret;\n else\n return undefined;\n }\n /**\n * Construct a sequence of alternating lines and arcs with the arcs creating tangent transition between consecutive edges.\n * * If the radius parameter is a number, that radius is used throughout.\n * * If the radius parameter is an array of numbers, `radius[i]` is applied at `point[i]`.\n * * Note that since no fillet is constructed at the initial or final point, those entries in `radius[]` are never referenced.\n * * A zero radius for any point indicates to leave the as a simple corner.\n * @param points point source\n * @param radius fillet radius or array of radii indexed to correspond to the points.\n * @param allowBackupAlongEdge true to allow edges to be created going \"backwards\" along edges if needed to create the blend.\n */\n public static createFilletsInLineString(\n points: LineString3d | IndexedXYZCollection | Point3d[],\n radius: number | number[],\n allowBackupAlongEdge: boolean = true,\n ): Path | undefined {\n if (Array.isArray(points))\n return this.createFilletsInLineString(new Point3dArrayCarrier(points), radius, allowBackupAlongEdge);\n if (points instanceof LineString3d)\n return this.createFilletsInLineString(points.packedPoints, radius, allowBackupAlongEdge);\n const n = points.length;\n if (n <= 1)\n return undefined;\n const pointA = points.getPoint3dAtCheckedPointIndex(0)!;\n const pointB = points.getPoint3dAtCheckedPointIndex(1)!;\n // remark: n=2 and n=3 cases should fall out from loop logic\n const blendArray: ArcBlendData[] = [];\n // build one-sided blends at each end . .\n blendArray.push({ fraction10: 0.0, fraction12: 0.0, point: pointA.clone() });\n for (let i = 1; i + 1 < n; i++) {\n const pointC = points.getPoint3dAtCheckedPointIndex(i + 1)!;\n let thisRadius = 0;\n if (Array.isArray(radius)) {\n if (i < radius.length)\n thisRadius = radius[i];\n } else if (Number.isFinite(radius))\n thisRadius = radius;\n if (thisRadius !== 0.0)\n blendArray.push(Arc3d.createFilletArc(pointA, pointB, pointC, thisRadius));\n else\n blendArray.push({ fraction10: 0.0, fraction12: 0.0, point: pointB.clone() });\n pointA.setFromPoint3d(pointB);\n pointB.setFromPoint3d(pointC);\n }\n blendArray.push({ fraction10: 0.0, fraction12: 0.0, point: pointB.clone() });\n if (!allowBackupAlongEdge) {\n // suppress arcs that have overlap with both neighbors or flood either neighbor ..\n for (let i = 1; i + 1 < n; i++) {\n const b = blendArray[i];\n if (b.fraction10 > 1.0\n || b.fraction12 > 1.0\n || 1.0 - b.fraction10 < blendArray[i - 1].fraction12\n || b.fraction12 > 1.0 - blendArray[i + 1].fraction10) {\n b.fraction10 = 0.0;\n b.fraction12 = 0.0;\n blendArray[i].arc = undefined;\n }\n }\n /* The \"1-b\" logic above prevents this loop from ever doing anything.\n // on edge with conflict, suppress the arc with larger fraction\n for (let i = 1; i < n; i++) {\n const b0 = blendArray[i - 1];\n const b1 = blendArray[i];\n if (b0.fraction12 > 1 - b1.fraction10) {\n const b = b0.fraction12 > b1.fraction12 ? b1 : b0;\n b.fraction10 = 0.0;\n b.fraction12 = 0.0;\n blendArray[i].arc = undefined;\n }\n } */\n }\n const path = Path.create();\n this.addPartialSegment(\n path, allowBackupAlongEdge,\n blendArray[0].point, blendArray[1].point,\n blendArray[0].fraction12, 1.0 - blendArray[1].fraction10,\n );\n // add each path and successor edge ...\n for (let i = 1; i + 1 < points.length; i++) {\n const b0 = blendArray[i];\n const b1 = blendArray[i + 1];\n path.tryAddChild(b0.arc);\n this.addPartialSegment(path, allowBackupAlongEdge, b0.point, b1.point, b0.fraction12, 1.0 - b1.fraction10);\n }\n return path;\n }\n /**\n * Create a `Loop` with given xy corners and fixed z.\n * * The corners always proceed counter clockwise from lower left.\n * * If the radius is too large for the outer rectangle size, it is reduced to half of the the smaller x or y size.\n */\n public static createRectangleXY(\n x0: number, y0: number, x1: number, y1: number, z: number = 0, filletRadius?: number,\n ): Loop {\n let radius = Geometry.correctSmallMetricDistance(filletRadius);\n const xMin = Math.min(x0, x1);\n const xMax = Math.max(x0, x1);\n const yMin = Math.min(y0, y1);\n const yMax = Math.max(y0, y1);\n radius = Math.min(Math.abs(radius), 0.5 * (xMax - xMin), 0.5 * (yMax - yMin));\n if (radius === 0.0)\n return Loop.createPolygon([\n Point3d.create(xMin, yMin, z),\n Point3d.create(xMax, yMin, z),\n Point3d.create(xMax, yMax, z),\n Point3d.create(xMin, yMax, z),\n Point3d.create(xMin, yMin, z),\n ]);\n else {\n const vectorU = Vector3d.create(radius, 0, 0);\n const vectorV = Vector3d.create(0, radius, 0);\n const x0A = xMin + radius;\n const y0A = yMin + radius;\n const x1A = xMax - radius;\n const y1A = yMax - radius;\n const centers = [\n Point3d.create(x1A, y1A, z),\n Point3d.create(x0A, y1A, z),\n Point3d.create(x0A, y0A, z),\n Point3d.create(x1A, y0A, z),\n ];\n const loop = Loop.create();\n for (let i = 0; i < 4; i++) {\n const center = centers[i];\n const nextCenter = centers[(i + 1) % 4];\n const edgeVector = Vector3d.createStartEnd(center, nextCenter);\n const arc = Arc3d.create(center, vectorU, vectorV, AngleSweep.createStartEndDegrees(0, 90));\n loop.tryAddChild(arc);\n const arcEnd = arc.endPoint();\n if (!edgeVector.isAlmostZero)\n loop.tryAddChild(LineSegment3d.create(arcEnd, arcEnd.plus(edgeVector)));\n vectorU.rotate90CCWXY(vectorU);\n vectorV.rotate90CCWXY(vectorV);\n }\n return loop;\n }\n }\n /**\n * If `arcB` is a continuation of `arcA`, extend `arcA` (in place) to include the range of `arcB`\n * * This only succeeds if the two arcs are part of identical complete arcs and end of `arcA` matches the beginning of `arcB`.\n * @param arcA first arc, modified in place.\n * @param arcB second arc, unmodified.\n * @param allowReversed whether to consolidate even when second arc is reversed (default is `false`).\n * @param tolerance optional coordinate tolerance for point equality (default is `Geometry.smallMetricDistance`).\n * @returns whether `arcA` was modified.\n */\n public static appendToArcInPlace(arcA: Arc3d, arcB: Arc3d, allowReverse: boolean = false, tolerance: number = Geometry.smallMetricDistance): boolean {\n if (arcA.center.isAlmostEqual(arcB.center, tolerance)) {\n const sweepSign = Geometry.split3WaySign(arcA.sweep.sweepRadians * arcB.sweep.sweepRadians, -1, 0, 1);\n // evaluate derivatives wrt radians (not fraction!), but adjust direction for sweep signs\n const endA = arcA.angleToPointAndDerivative(arcA.sweep.fractionToAngle(1.0));\n if (arcA.sweep.sweepRadians < 0)\n endA.direction.scaleInPlace(-1.0);\n const startB = arcB.angleToPointAndDerivative(arcB.sweep.fractionToAngle(0.0));\n if (arcB.sweep.sweepRadians < 0)\n startB.direction.scaleInPlace(-1.0);\n if (endA.isAlmostEqual(startB, tolerance)) {\n arcA.sweep.setStartEndRadians(\n arcA.sweep.startRadians, arcA.sweep.startRadians + arcA.sweep.sweepRadians + sweepSign * arcB.sweep.sweepRadians,\n );\n return true;\n }\n // Also ok if negated tangent\n if (allowReverse) {\n startB.direction.scaleInPlace(-1.0);\n if (endA.isAlmostEqual(startB, tolerance)) {\n arcA.sweep.setStartEndRadians(\n arcA.sweep.startRadians, arcA.sweep.startRadians + arcA.sweep.sweepRadians - sweepSign * arcB.sweep.sweepRadians,\n );\n return true;\n }\n }\n }\n return false;\n }\n /**\n * Return a `Path` containing arcs are on the surface of an ellipsoid and pass through a sequence of points.\n * * Each arc passes through the two given endpoints and in the plane containing the true surface normal at\n * given `fractionForIntermediateNormal`\n * @param ellipsoid\n * @param pathPoints\n * @param fractionForIntermediateNormal fractional position for surface normal used to create the section plane.\n */\n public static assembleArcChainOnEllipsoid(\n ellipsoid: Ellipsoid, pathPoints: GeodesicPathPoint[], fractionForIntermediateNormal: number = 0.5,\n ): Path {\n const arcPath = Path.create();\n for (let i = 0; i + 1 < pathPoints.length; i++) {\n const arc = ellipsoid.sectionArcWithIntermediateNormal(\n pathPoints[i].toAngles(),\n fractionForIntermediateNormal,\n pathPoints[i + 1].toAngles());\n arcPath.tryAddChild(arc);\n }\n return arcPath;\n }\n private static appendGeometryQueryArray(candidate: GeometryQuery | GeometryQuery[] | undefined, result: GeometryQuery[]) {\n if (candidate instanceof GeometryQuery)\n result.push(candidate);\n else if (Array.isArray(candidate)) {\n for (const p of candidate)\n this.appendGeometryQueryArray(p, result);\n }\n }\n /**\n * Create solid primitives for pipe segments (e.g. Cone or TorusPipe) around line and arc primitives.\n * @param centerline centerline geometry.\n * @param pipeRadius radius of pipe.\n */\n public static createPipeSegments(\n centerline: CurvePrimitive | CurveChain, pipeRadius: number,\n ): GeometryQuery | GeometryQuery[] | undefined {\n if (centerline instanceof LineSegment3d) {\n return Cone.createAxisPoints(centerline.startPoint(), centerline.endPoint(), pipeRadius, pipeRadius, false);\n } else if (centerline instanceof Arc3d) {\n return TorusPipe.createAlongArc(centerline, pipeRadius, false);\n } else if (centerline instanceof CurvePrimitive) {\n const builder = PolyfaceBuilder.create();\n builder.addMiteredPipes(centerline, pipeRadius);\n return builder.claimPolyface();\n } else if (centerline instanceof CurveChain) {\n const result: GeometryQuery[] = [];\n for (const p of centerline.children) {\n const pipe = this.createPipeSegments(p, pipeRadius);\n this.appendGeometryQueryArray(pipe, result);\n }\n return result;\n }\n return undefined;\n }\n /** Get start point and tangent for variant curve data. */\n private static startPointAndTangent(curve: IndexedXYZCollection | Point3d[] | CurvePrimitive): Ray3d | undefined {\n if (curve instanceof CurvePrimitive)\n return curve.fractionToPointAndDerivative(0.0);\n if (curve.length < 2)\n return undefined;\n if (Array.isArray(curve))\n curve = new Point3dArrayCarrier(curve);\n const ray = Ray3d.createZero();\n curve.getPoint3dAtUncheckedPointIndex(0, ray.origin);\n curve.vectorIndexIndex(0, 1, ray.direction);\n return ray;\n };\n /** Create an [[Arc3d]] from `sectionData` that has its center at the start point of the centerline. */\n public static createArcFromSectionData(\n centerline: IndexedXYZCollection | Point3d[] | CurvePrimitive, sectionData: number | XAndY | Arc3d,\n ): Arc3d | undefined {\n const ray = CurveFactory.startPointAndTangent(centerline);\n if (!ray)\n return undefined;\n let arc: Arc3d;\n if (sectionData instanceof Arc3d) {\n arc = sectionData.clone();\n arc.center = ray.origin;\n } else {\n const vector0 = Vector3d.create();\n const vector90 = Vector3d.create();\n const length0 = (typeof sectionData === \"number\") ? sectionData : sectionData.x;\n const length90 = (typeof sectionData === \"number\") ? sectionData : sectionData.y;\n const baseFrame = Matrix3d.createRigidHeadsUp(ray.direction, AxisOrder.ZXY);\n baseFrame.columnX(vector0).scaleInPlace(length0);\n baseFrame.columnY(vector90).scaleInPlace(length90);\n arc = Arc3d.create(ray.origin, vector0, vector90);\n }\n if (arc.binormalVector().dotProduct(ray.direction) < 0.0)\n arc.reverseInPlace();\n return arc;\n }\n /**\n * Create section arcs for mitered pipe.\n * * At the end of each pipe segment, the pipe is mitered by the plane that bisects the angle between successive\n * centerline segments.\n * * The section arcs are constructed so that lines between corresponding fractional positions on the arcs are\n * axial lines on the pipes.\n * * This means that the initial arc's vector0 and vector90 lengths and angular separation are _not_ preserved in\n * the section arcs.\n * * Circular or elliptical pipe cross sections can be specified by supplying either a radius, a pair of semi-axis\n * lengths, or an Arc3d:\n * * For semi-axis length input, x and y correspond to ellipse local axes perpendicular to each other and to the\n * start tangent.\n * * For Arc3d input, the center is translated to the centerline start point. For best results, ensure this arc\n * is perpendicular to the centerline start tangent.\n * * This function internally calls [[createMiteredSweepSections]] with default options.\n * @param centerline centerline of pipe. For best results, ensure no successive duplicate points with e.g.,\n * [[GrowableXYZArray.createCompressed]].\n * @param sectionData circle radius, ellipse semi-axis lengths, or full Arc3d (if not full, function makes it full).\n * @returns array of sections or empty array if section creation failed.\n */\n public static createMiteredPipeSections(centerline: IndexedXYZCollection, sectionData: number | XAndY | Arc3d): Arc3d[] {\n const arc = CurveFactory.createArcFromSectionData(centerline, sectionData);\n if (!arc)\n return [];\n const miteredSweeps = CurveFactory.createMiteredSweepSections(centerline, arc);\n if (miteredSweeps)\n return miteredSweeps.sections as Arc3d[];\n return [];\n }\n\n /** For a smooth curve, stroke and return unnormalized start/end tangents. */\n private static strokeSmoothCurve(\n curve: IndexedXYZCollection | Point3d[] | CurvePrimitive | CurveChain,\n options?: StrokeOptions,\n ): SmoothCurveData | undefined {\n let startTangent, endTangent: Vector3d | undefined;\n if (curve instanceof CurvePrimitive) {\n startTangent = curve.fractionToPointAndDerivative(0.0).direction;\n endTangent = curve.fractionToPointAndDerivative(1.0).direction;\n const strokes = LineString3d.create();\n curve.emitStrokes(strokes, options);\n curve = strokes.packedPoints;\n } else if (curve instanceof CurveChain) {\n startTangent = curve.startPointAndDerivative()?.direction;\n endTangent = curve.endPointAndDerivative()?.direction;\n const strokes = curve.getPackedStrokes(options);\n if (!strokes)\n return undefined;\n curve = strokes;\n } else if (Array.isArray(curve))\n curve = new Point3dArrayCarrier(curve);\n return { strokes: curve, startTangent, endTangent };\n }\n\n /**\n * Align two bisector plane normals to given smooth rail tangents or optional overrides.\n * * Optionally average the normals for physically closed rail.\n */\n private static alignFirstAndLastBisectorPlanes(\n firstPlane: Plane3dByOriginAndUnitNormal,\n lastPlane: Plane3dByOriginAndUnitNormal,\n smoothRailData?: SmoothCurveData,\n options?: MiteredSweepOptions,\n ) {\n const normal0 = options?.startTangent ?? (smoothRailData?.startTangent ?? firstPlane.getNormalRef());\n const normal1 = options?.endTangent ?? (smoothRailData?.endTangent ?? lastPlane.getNormalRef());\n if (options?.wrapIfPhysicallyClosed && firstPlane.getOriginRef().isAlmostEqual(lastPlane.getOriginRef())) {\n const avgNormal = normal0.plus(normal1);\n if (avgNormal.tryNormalizeInPlace()) { // ignore cusp at seam\n firstPlane.getNormalRef().setFrom(avgNormal);\n lastPlane.getNormalRef().setFrom(avgNormal);\n return;\n }\n }\n if (normal0.tryNormalizeInPlace())\n firstPlane.getNormalRef().setFrom(normal0);\n if (normal1.tryNormalizeInPlace())\n lastPlane.getNormalRef().setFrom(normal1);\n }\n\n /** Reverse a closed curve or region if necessary so that its orientation is CCW with respect to the plane normal. */\n private static alignClosedCurveToPlane(curve: AnyCurve, planeNormal: Vector3d) {\n let closedCurve: AnyRegion | undefined;\n if (curve instanceof CurvePrimitive) {\n if (curve.startPoint().isAlmostEqual(curve.endPoint()))\n closedCurve = Loop.create(curve);\n } else if (curve.isAnyRegion())\n closedCurve = curve;\n if (closedCurve) {\n // The alignment condition is equivalent to positive projected curve area computed wrt to the plane normal.\n const toLocal = Matrix3d.createRigidHeadsUp(planeNormal).transpose();\n const projection = closedCurve.cloneTransformed(Transform.createOriginAndMatrix(undefined, toLocal));\n if (projection) { // now we can ignore z-coords\n const areaXY = RegionOps.computeXYArea(projection as AnyRegion);\n if (areaXY && areaXY < 0)\n curve.reverseInPlace();\n }\n }\n }\n\n /**\n * Projection to target plane, constructing sweep direction from two given planes.\n * * If successful, push the target plane and swept section to the output arrays and return the swept section.\n * * If unsuccessful, leave the output arrays alone and return the input section.\n */\n private static doSweepToPlane(\n output: SectionSequenceWithPlanes,\n edgePlane0: Plane3dByOriginAndUnitNormal,\n edgePlane1: Plane3dByOriginAndUnitNormal,\n targetPlane: Plane3dByOriginAndUnitNormal,\n section: AnyCurve,\n ): AnyCurve {\n const sweepVector = Vector3d.createStartEnd(edgePlane0.getOriginRef(), edgePlane1.getOriginRef());\n const transform = Transform.createFlattenAlongVectorToPlane(\n sweepVector, targetPlane.getOriginRef(), targetPlane.getNormalRef(),\n );\n if (transform === undefined)\n return section;\n const transformedSection = section.cloneTransformed(transform);\n if (transformedSection === undefined)\n return section;\n output.planes.push(targetPlane);\n output.sections.push(transformedSection);\n return transformedSection;\n }\n\n /**\n * Sweep the `initialSection` along each segment of the (stroked) `centerline` until it hits the bisector plane at\n * the next vertex.\n * * For best results, the caller should place `initialSection` in a plane perpendicular to the `centerline`\n * start tangent.\n * * This plane is commonly (but not necessarily) through the centerline start point itself.\n * * To compute the sections, `initialSection` is projected in the direction of the centerline start tangent onto\n * the first bisector plane at the centerline start. The result of this projection will be likewise projected onto\n * the second plane, and so on in sequence.\n * * By default, the first/last bisector plane normals are set to the centerline start/end tangents. The caller can\n * override these with tangents supplied in `options`. If the centerline is physically closed and\n * `options.wrapIfPhysicallyClosed` is true, the first and last plane normals are averaged and equated.\n * * The centerline path does NOT have to be planar, however non-planarity will result in twisting of the sections\n * in the bisector planes.\n * @param centerline sweep path. Will be stroked if smooth.\n * @param initialSection profile curve to be swept. As noted above, this should be on a plane perpendicular to the\n * centerline start tangent.\n * @param options options for computation and output.\n * @return array of sections, formed from projecting `initialSection` successively onto the bisector planes.\n */\n public static createMiteredSweepSections(\n centerline: IndexedXYZCollection | Point3d[] | CurvePrimitive | CurveChain,\n initialSection: AnyCurve,\n options?: MiteredSweepOptions,\n ): SectionSequenceWithPlanes | undefined {\n if (!options)\n options = {};\n const rail = this.strokeSmoothCurve(centerline, options.strokeOptions);\n if (!rail)\n return undefined;\n const planes = PolylineOps.createBisectorPlanesForDistinctPoints(rail.strokes);\n if (!planes || planes.length < 2)\n return undefined;\n this.alignFirstAndLastBisectorPlanes(planes[0], planes[planes.length - 1], rail, options);\n\n // RuledSweep facet construction assumes the contours are oriented CCW with respect to the sweep direction so that\n // facet normals point outward. We only have to align the first contour; the rest will inherit its orientation.\n this.alignClosedCurveToPlane(initialSection, planes[0].getNormalRef());\n\n const sectionData: SectionSequenceWithPlanes = { sections: [], planes: [] };\n let currentSection = this.doSweepToPlane(sectionData, planes[0], planes[1], planes[0], initialSection);\n for (let i = 1; i < planes.length; i++)\n currentSection = this.doSweepToPlane(sectionData, planes[i - 1], planes[i], planes[i], currentSection);\n\n if (options.outputSelect) {\n const ruledSweep = RuledSweep.create(sectionData.sections, options.capped ?? false);\n if (ruledSweep) {\n sectionData.ruledSweep = ruledSweep;\n if (MiteredSweepOutputSelect.AlsoMesh === options.outputSelect) {\n const builder = PolyfaceBuilder.create(options.strokeOptions);\n builder.addRuledSweep(ruledSweep);\n sectionData.mesh = builder.claimPolyface();\n }\n }\n }\n return sectionData;\n }\n /**\n * Create a circular arc from start point, tangent at start, radius, optional plane normal, arc sweep.\n * * The vector from start point to center is in the direction of upVector crossed with tangentA.\n * @param start start point.\n * @param tangentAtStart vector in tangent direction at the start.\n * @param radius signed radius.\n * @param upVector optional out-of-plane vector. Defaults to positive Z.\n * @param sweep angular range. If single `Angle` is given, start angle is at 0 degrees (the start point).\n */\n public static createArcPointTangentRadius(\n start: Point3d, tangentAtStart: Vector3d, radius: number, upVector?: Vector3d, sweep?: Angle | AngleSweep,\n ): Arc3d | undefined {\n return Arc3d.createCircularStartTangentRadius(start, tangentAtStart, radius, upVector, sweep);\n }\n /**\n * Compute 2 spirals (all in XY) for a symmetric line-to-line transition.\n * * First spiral begins at given start point.\n * * first tangent aims at shoulder.\n * * outbound spiral joins line from shoulder to target.\n * @param spiralType name of spiral type. THIS MUST BE AN \"Integrated\" SPIRAL TYPE.\n * @param startPoint inbound start point.\n * @param shoulder point target point for (both) spiral-to-line tangencies.\n * @return array with the computed spirals, or undefined if failure.\n */\n public static createLineSpiralSpiralLine(\n spiralType: IntegratedSpiralTypeName,\n startPoint: Point3d,\n shoulderPoint: Point3d,\n targetPoint: Point3d,\n ): GeometryQuery[] | undefined {\n const vectorAB = Vector3d.createStartEnd(startPoint, shoulderPoint);\n const vectorBC0 = Vector3d.createStartEnd(shoulderPoint, targetPoint);\n const referenceLength = vectorAB.magnitude();\n const radiansAB = Math.atan2(vectorAB.y, vectorAB.x);\n const lineTurnRadians = vectorAB.angleToXY(vectorBC0);\n const spiralTurnRadians = 0.5 * lineTurnRadians.radians;\n const radiansBC = radiansAB + lineTurnRadians.radians;\n const axesA = Matrix3d.createRotationAroundAxisIndex(AxisIndex.Z, Angle.createRadians(radiansAB));\n const frameA = Transform.createRefs(startPoint.clone(), axesA);\n // We know how much it has to turn, and but not the length or end radius.\n // make a spiral of referenceLength and scale it back to the junction line\n const spiralARefLength = IntegratedSpiral3d.createFrom4OutOf5(spiralType, 0.0, undefined,\n Angle.createRadians(0), Angle.createRadians(spiralTurnRadians), referenceLength, undefined, frameA);\n if (spiralARefLength) {\n const midPlanePerpendicularRadians = radiansAB + spiralTurnRadians;\n const midPlanePerpendicularVector = Vector3d.createPolar(1.0, Angle.createRadians(midPlanePerpendicularRadians));\n const altitudeB = midPlanePerpendicularVector.dotProductStartEnd(startPoint, shoulderPoint);\n const altitudeSpiralEnd = midPlanePerpendicularVector.dotProductStartEnd(startPoint, spiralARefLength.endPoint());\n const scaleFactor = altitudeB / altitudeSpiralEnd;\n const spiralA = IntegratedSpiral3d.createFrom4OutOf5(spiralType, 0.0, undefined,\n Angle.createRadians(0), Angle.createRadians(spiralTurnRadians), referenceLength * scaleFactor, undefined, frameA)!;\n const distanceAB = vectorAB.magnitude();\n const vectorBC = Vector3d.createStartEnd(shoulderPoint, targetPoint);\n vectorBC.scaleToLength(distanceAB, vectorBC);\n const pointC = shoulderPoint.plus(vectorBC);\n const axesC = Matrix3d.createRotationAroundAxisIndex(AxisIndex.Z, Angle.createRadians(radiansBC + Math.PI));\n const frameC = Transform.createRefs(pointC, axesC);\n const spiralC = IntegratedSpiral3d.createFrom4OutOf5(spiralType,\n 0, -spiralA.radius01.x1, Angle.zero(), undefined, spiralA.curveLength(), Segment1d.create(1, 0), frameC)!;\n return [spiralA, spiralC];\n }\n return undefined;\n }\n /**\n * Compute 2 spirals (all in XY) for a symmetric line-to-line transition.\n * * Spiral length is given.\n * * tangency points float on both lines.\n * @param spiralType name of spiral type. THIS MUST BE AN \"Integrated\" SPIRAL TYPE.\n * @param pointA inbound start point.\n * @param shoulder point target point for (both) spiral-to-line tangencies.\n * @param spiralLength for each part of the spiral pair.\n * @return array with the computed spirals, or undefined if failure.\n */\n public static createLineSpiralSpiralLineWithSpiralLength(\n spiralType: IntegratedSpiralTypeName,\n pointA: Point3d,\n pointB: Point3d,\n pointC: Point3d,\n spiralLength: number,\n ): GeometryQuery[] | undefined {\n const vectorAB = Vector3d.createStartEnd(pointA, pointB);\n const vectorBC = Vector3d.createStartEnd(pointB, pointC);\n const radiansAB = Math.atan2(vectorAB.y, vectorAB.x);\n const lineTurnAngle = vectorAB.angleToXY(vectorBC);\n const spiralTurnRadians = 0.5 * lineTurnAngle.radians;\n const bisectorRadians = 0.5 * (Math.PI - lineTurnAngle.radians);\n const radiansCB = Math.atan2(-vectorBC.y, -vectorBC.x);\n const spiralAB0 = IntegratedSpiral3d.createFrom4OutOf5(\n spiralType, 0, undefined,\n Angle.zero(), Angle.createRadians(spiralTurnRadians),\n spiralLength, undefined, Transform.createIdentity(),\n );\n if (spiralAB0) {\n const localEndPoint = spiralAB0.fractionToPoint(1);\n const distanceAB = pointA.distance(pointB);\n const distanceCB = pointC.distance(pointB);\n // The spiral eventually has to end on the bisector, at localEndPoint.y height from the inbound line\n // distance from shoulder to projection of that point to point E on the inbound line is\n const distanceBE = localEndPoint.y / Math.tan(bisectorRadians);\n const xFractionAB = Geometry.conditionalDivideFraction(distanceAB - distanceBE - localEndPoint.x, distanceAB);\n const xFractionCB = Geometry.conditionalDivideFraction(distanceCB - distanceBE - localEndPoint.x, distanceCB);\n if (xFractionAB !== undefined && xFractionCB !== undefined) {\n const axesA = Matrix3d.createRotationAroundAxisIndex(AxisIndex.Z, Angle.createRadians(radiansAB));\n const frameAOrigin = pointA.interpolate(xFractionAB, pointB);\n const frameA = Transform.createRefs(frameAOrigin, axesA);\n const spiralAB = IntegratedSpiral3d.createFrom4OutOf5(\n spiralType, 0, undefined,\n Angle.zero(), Angle.createRadians(spiralTurnRadians),\n spiralLength, undefined, frameA,\n )!;\n const axesB = Matrix3d.createRotationAroundAxisIndex(AxisIndex.Z, Angle.createRadians(radiansCB));\n const frameBOrigin = pointC.interpolate(xFractionCB, pointB);\n const frameB = Transform.createRefs(frameBOrigin, axesB);\n const spiralBC = IntegratedSpiral3d.createFrom4OutOf5(\n spiralType, 0, undefined,\n Angle.zero(), Angle.createRadians(-spiralTurnRadians),\n spiralLength, undefined, frameB,\n )!;\n return [spiralAB, spiralBC];\n }\n }\n return undefined;\n }\n /**\n * Compute 2 spirals and an arc (all in XY) for a symmetric line-to-line transition.\n * Spiral lengths and arc radius are given (e.g., from design speed standards).\n * @param spiralType name of spiral type. THIS MUST BE AN \"Integrated\" SPIRAL TYPE.\n * @param pointA inbound start point.\n * @param pointB shoulder (target) point for (both) spiral-to-line tangencies.\n * @param lengthA inbound spiral length.\n * @param lengthB outbound spiral length.\n * @return array with the computed spirals, or undefined if failure.\n */\n public static createLineSpiralArcSpiralLine(\n spiralType: IntegratedSpiralTypeName,\n pointA: Point3d,\n pointB: Point3d,\n pointC: Point3d,\n lengthA: number,\n lengthB: number,\n arcRadius: number,\n ): GeometryQuery[] | undefined {\n const vectorAB = Vector3d.createStartEnd(pointA, pointB); vectorAB.z = 0;\n const vectorCB = Vector3d.createStartEnd(pointC, pointB); vectorCB.z = 0;\n const unitAB = vectorAB.normalize();\n const unitCB = vectorCB.normalize();\n if (unitAB === undefined || unitCB === undefined)\n return undefined;\n const unitPerpAB = unitAB.unitPerpendicularXY();\n const unitPerpCB = unitCB.unitPerpendicularXY();\n const thetaABC = vectorAB.angleToXY(vectorCB);\n const sideA = Geometry.split3WaySign(thetaABC.radians, 1, -1, -1);\n const sideB = - sideA;\n const radiusA = sideA * Math.abs(arcRadius);\n const radiusB = sideB * Math.abs(arcRadius);\n const spiralA = IntegratedSpiral3d.createFrom4OutOf5(spiralType,\n 0, radiusA, Angle.zero(), undefined, lengthA, undefined, Transform.createIdentity())!;\n const spiralB = IntegratedSpiral3d.createFrom4OutOf5(spiralType,\n 0, radiusB, Angle.zero(), undefined, lengthB, undefined, Transform.createIdentity())!;\n const spiralEndA = spiralA.fractionToPointAndUnitTangent(1.0);\n const spiralEndB = spiralB.fractionToPointAndUnitTangent(1.0);\n // From the end of spiral, step away to arc center (and this is in local coordinates of each spiral)\n const sA = spiralEndA.origin.x - radiusA * spiralEndA.direction.y;\n const tA = spiralEndA.origin.y + radiusA * spiralEndA.direction.x;\n const sB = spiralEndB.origin.x - radiusB * spiralEndB.direction.y;\n const tB = spiralEndB.origin.y + radiusB * spiralEndB.direction.x;\n // Those local coordinates are rotated to unitAB and unitBC ...\n const vectorA = Vector3d.createAdd2Scaled(unitAB, sA, unitPerpAB, tA);\n const vectorB = Vector3d.createAdd2Scaled(unitCB, sB, unitPerpCB, tB);\n const uv = Vector2d.create();\n if (SmallSystem.linearSystem2d(\n unitAB.x, -unitCB.x,\n unitAB.y, -unitCB.y,\n vectorB.x - vectorA.x, vectorB.y - vectorA.y, uv)) {\n const tangencyAB = pointB.plusScaled(unitAB, uv.x);\n const tangencyCB = pointB.plusScaled(unitCB, uv.y);\n const frameA = Transform.createOriginAndMatrixColumns(tangencyAB, unitAB, unitPerpAB, Vector3d.unitZ());\n const frameB = Transform.createOriginAndMatrixColumns(tangencyCB, unitCB, unitPerpCB, Vector3d.unitZ());\n spiralA.tryTransformInPlace(frameA);\n spiralB.tryTransformInPlace(frameB);\n const rayA1 = spiralA.fractionToPointAndUnitTangent(1.0);\n const rayB0 = spiralB.fractionToPointAndUnitTangent(1.0);\n rayB0.direction.scaleInPlace(-1.0);\n const sweep = rayA1.direction.angleToXY(rayB0.direction);\n if (radiusA < 0)\n sweep.setRadians(- sweep.radians);\n const arc = CurveFactory.createArcPointTangentRadius(rayA1.origin, rayA1.direction, radiusA, undefined, sweep)!;\n return [spiralA, arc, spiralB];\n }\n return undefined;\n }\n /** Return the intersection point of 3 planes. */\n public static planePlaneIntersectionRay(\n planeA: PlaneAltitudeEvaluator, planeB: PlaneAltitudeEvaluator): Ray3d | undefined {\n const altitudeA = planeA.altitudeXYZ(0, 0, 0);\n const altitudeB = planeB.altitudeXYZ(0, 0, 0);\n const normalAx = planeA.normalX();\n const normalAy = planeA.normalY();\n const normalAz = planeA.normalZ();\n const normalBx = planeB.normalX();\n const normalBy = planeB.normalY();\n const normalBz = planeB.normalZ();\n const normalCx = Geometry.crossProductXYXY(normalAy, normalAz, normalBy, normalBz);\n const normalCy = Geometry.crossProductXYXY(normalAz, normalAx, normalBz, normalBx);\n const normalCz = Geometry.crossProductXYXY(normalAx, normalAy, normalBx, normalBy);\n const rayOrigin = SmallSystem.linearSystem3d(\n normalAx, normalAy, normalAz,\n normalBx, normalBy, normalBz,\n normalCx, normalCy, normalCz,\n -altitudeA, -altitudeB, 0.0);\n if (rayOrigin !== undefined) {\n return Ray3d.createXYZUVW(rayOrigin.x, rayOrigin.y, rayOrigin.z, normalCx, normalCy, normalCz);\n }\n return undefined;\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CurveLocationDetail.js","sourceRoot":"","sources":["../../../src/curve/CurveLocationDetail.ts"],"names":[],"mappings":";;;AAAA;;;+FAG+F;AAC/F;;GAEG;AACH,0CAAmD;AACnD,mEAAkE;AAMlE;;;GAGG;AACH,IAAY,iBAWX;AAXD,WAAY,iBAAiB;IAC3B,+DAA+D;IAC/D,iEAAY,CAAA;IACZ,2CAA2C;IAC3C,iFAAoB,CAAA;IACpB,2CAA2C;IAC3C,4EAAkB,CAAA;IAClB,gDAAgD;IAChD,kFAAqB,CAAA;IACrB,qCAAqC;IACrC,wEAAgB,CAAA;AAClB,CAAC,EAXW,iBAAiB,iCAAjB,iBAAiB,QAW5B;AAED;;;GAGG;AACH,IAAY,iBAOX;AAPD,WAAY,i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;QACE,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC;QAChB,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC;IAClB,CAAC;CACF;AATD,oEASC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Curve\r\n */\r\nimport { Geometry, ICloneable } from \"../Geometry\";\r\nimport { Point3d, Vector3d } from \"../geometry3d/Point3dVector3d\";\r\nimport { Ray3d } from \"../geometry3d/Ray3d\";\r\nimport { Transform } from \"../geometry3d/Transform\";\r\nimport { XYAndZ } from \"../geometry3d/XYZProps\";\r\nimport { CurvePrimitive } from \"./CurvePrimitive\";\r\n\r\n/**\r\n * An enumeration of special conditions being described by a CurveLocationDetail.\r\n * @public\r\n */\r\nexport enum CurveIntervalRole {\r\n /** This point is an isolated point NOT at a primary vertex. */\r\n isolated = 0,\r\n /** This point is an isolated vertex hit */\r\n isolatedAtVertex = 1,\r\n /** This is the beginning of an interval */\r\n intervalStart = 10,\r\n /** This is an interior point of an interval. */\r\n intervalInterior = 11,\r\n /** This is the end of an interval */\r\n intervalEnd = 12,\r\n}\r\n\r\n/**\r\n * Return code for CurvePrimitive method `moveSignedDistanceFromFraction`\r\n * @public\r\n */\r\nexport enum CurveSearchStatus {\r\n /** Unimplemented or zero length curve */\r\n error,\r\n /** Complete success of search */\r\n success = 1,\r\n /** Search ended prematurely (e.g. at incomplete distance moved) at start or end of curve */\r\n stoppedAtBoundary = 2,\r\n}\r\n\r\n/**\r\n * Use to update a cloneable object when source and/or prior result are possibly undefined.\r\n * * Any undefined source returns undefined.\r\n * * For defined source, reuse optional result if available.\r\n * @param source optional source\r\n * @param result optional result\r\n */\r\nfunction optionalUpdate<T extends ICloneable<T>>(source: T | undefined, result: T | undefined): T | undefined {\r\n return source ? source.clone(result) : undefined;\r\n}\r\n\r\n/**\r\n * CurveLocationDetail carries point and parameter data about a point evaluated on a curve.\r\n * * These are returned by a variety of queries.\r\n * * Particular contents can vary among the queries.\r\n * @public\r\n */\r\nexport class CurveLocationDetail {\r\n /** The curve being evaluated. */\r\n public curve?: CurvePrimitive;\r\n /** Optional ray. */\r\n public ray?: Ray3d;\r\n /** The fractional position along the curve. */\r\n public fraction: number;\r\n /** Detail condition of the role this point has in some context. */\r\n public intervalRole?: CurveIntervalRole;\r\n /** The point on the curve. */\r\n public point: Point3d;\r\n /** A vector (e.g. tangent vector) in context. */\r\n public vectorInCurveLocationDetail?: Vector3d;\r\n /** A context-specific numeric value (e.g., a distance). */\r\n public a: number;\r\n /**\r\n * Optional CurveLocationDetail with more detail of location. For instance, a detail for fractional position\r\n * within a CurveChainWithDistanceIndex returns fraction and distance along the chain as its primary data and\r\n * further detail of the particular curve within the chain in the childDetail.\r\n */\r\n public childDetail?: CurveLocationDetail;\r\n /**\r\n * A status indicator for certain searches.\r\n * * e.g., CurvePrimitive.moveSignedDistanceFromFraction.\r\n */\r\n public curveSearchStatus?: CurveSearchStatus;\r\n /** (Optional) second fraction, e.g. end of interval of coincident curves. */\r\n public fraction1?: number;\r\n /** (Optional) second point, e.g. end of interval of coincident curves. */\r\n public point1?: Point3d;\r\n /** A context-specific temporary point, e.g. for intermediate calculations. */\r\n public pointQ: Point3d;\r\n /** Constructor */\r\n public constructor() {\r\n this.pointQ = Point3d.createZero();\r\n this.fraction = 0;\r\n this.point = Point3d.createZero();\r\n this.a = 0.0;\r\n }\r\n /** Set the (optional) intervalRole field. */\r\n public setIntervalRole(value: CurveIntervalRole): void {\r\n this.intervalRole = value;\r\n }\r\n /** Set the `fraction` and `point`, using direct assignment (capture!) to `point`. */\r\n public captureFractionPoint(fraction: number, point: Point3d): void {\r\n this.fraction = fraction;\r\n this.point = point;\r\n }\r\n /** Set the (optional) `fraction1` and `point1`, using direct assignment (capture!) to `point1`. */\r\n public captureFraction1Point1(fraction1: number, point1: Point3d): void {\r\n this.fraction1 = fraction1;\r\n this.point1 = point1;\r\n }\r\n /** Test if this pair has fraction1 defined. */\r\n public get hasFraction1(): boolean {\r\n return this.fraction1 !== undefined;\r\n }\r\n /** Test if this is an isolated point. This is true if intervalRole is any of (undefined, isolated, isolatedAtVertex). */\r\n public get isIsolated(): boolean {\r\n return this.intervalRole === undefined\r\n || this.intervalRole === CurveIntervalRole.isolated\r\n || this.intervalRole === CurveIntervalRole.isolatedAtVertex;\r\n }\r\n /** Return the fraction delta. (0 if no fraction1). */\r\n public get fractionDelta(): number {\r\n return this.fraction1 !== undefined ? this.fraction1 - this.fraction : 0.0;\r\n }\r\n /**\r\n * If (fraction1, point1) are defined, make them the primary (and only) data.\r\n * * No action if undefined.\r\n */\r\n public collapseToEnd() {\r\n if (this.fraction1 !== undefined)\r\n this.fraction = this.fraction1;\r\n if (this.point1)\r\n this.point = this.point1;\r\n this.collapseToStart();\r\n }\r\n /** Make (fraction, point) the primary (and only) data. */\r\n public collapseToStart() {\r\n this.fraction1 = undefined;\r\n this.point1 = undefined;\r\n }\r\n /**\r\n * Return a complete copy, WITH CAVEATS.\r\n * * curve member is copied as a reference.\r\n * * point and vector members are cloned.\r\n */\r\n public clone(result?: CurveLocationDetail): CurveLocationDetail {\r\n if (result === this)\r\n return result;\r\n result = result ? result : new CurveLocationDetail();\r\n result.curve = this.curve;\r\n result.fraction = this.fraction;\r\n result.fraction1 = this.fraction1;\r\n result.point1 = optionalUpdate<Point3d>(this.point1, result.point1);\r\n result.point.setFromPoint3d(this.point);\r\n result.vectorInCurveLocationDetail = optionalUpdate<Vector3d>(this.vectorInCurveLocationDetail, result.vectorInCurveLocationDetail);\r\n result.a = this.a;\r\n result.childDetail = optionalUpdate<CurveLocationDetail>(this.childDetail, result.childDetail);\r\n result.curveSearchStatus = this.curveSearchStatus;\r\n return result;\r\n }\r\n /**\r\n * Updated in this instance.\r\n * * Note that if caller omits `vector` and `a`, those fields are updated to the call-list defaults (NOT left as-is)\r\n * * point and vector updates are by data copy (not capture of pointers).\r\n * @param fraction (required) fraction to install.\r\n * @param point (required) point to install.\r\n * @param vector (optional) vector to install.\r\n * @param a (optional) numeric value to install.\r\n */\r\n public setFP(fraction: number, point: XYAndZ, vector?: Vector3d, a: number = 0.0): void {\r\n this.fraction = fraction;\r\n this.point.setFromPoint3d(point);\r\n this.vectorInCurveLocationDetail = optionalUpdate<Vector3d>(vector, this.vectorInCurveLocationDetail);\r\n this.a = a;\r\n }\r\n /**\r\n * Updated in this instance.\r\n * * Note that if caller omits a`, that field is updated to the call-list default (NOT left as-is)\r\n * * point and vector updates are by data copy (not capture of the ray members).\r\n * @param fraction (required) fraction to install.\r\n * @param ray (required) point and vector to install.\r\n * @param a (optional) numeric value to install.\r\n */\r\n public setFR(fraction: number, ray: Ray3d, a: number = 0): void {\r\n return this.setFP(fraction, ray.origin, ray.direction, a);\r\n }\r\n /** Set the CurvePrimitive pointer, leaving all other properties untouched. */\r\n public setCurve(curve: CurvePrimitive) {\r\n this.curve = curve;\r\n }\r\n /** Record the distance from the CurveLocationDetail's point to the parameter point. */\r\n public setDistanceTo(point: XYAndZ) {\r\n this.a = this.point.distance(point);\r\n }\r\n /** Create with a CurvePrimitive pointer but no coordinate data. */\r\n public static create(curve?: CurvePrimitive, result?: CurveLocationDetail): CurveLocationDetail {\r\n result = result ? result : new CurveLocationDetail();\r\n result.curve = curve;\r\n return result;\r\n }\r\n /** Create a new detail using CurvePrimitive pointer, fraction, and point coordinates. */\r\n public static createCurveFractionPoint(\r\n curve: CurvePrimitive | undefined, fraction: number, point: XYAndZ, result?: CurveLocationDetail,\r\n ): CurveLocationDetail {\r\n result = result ? result : new CurveLocationDetail();\r\n result.curve = curve;\r\n result.fraction = fraction;\r\n result.point.setFromPoint3d(point);\r\n result.vectorInCurveLocationDetail = undefined;\r\n result.a = 0.0;\r\n result.childDetail = undefined;\r\n result.curveSearchStatus = undefined;\r\n return result;\r\n }\r\n /** Create a new detail with only ray, fraction, and point. */\r\n public static createRayFractionPoint(\r\n ray: Ray3d, fraction: number, point: XYAndZ, result?: CurveLocationDetail,\r\n ): CurveLocationDetail {\r\n result = result ? result : new CurveLocationDetail();\r\n result.fraction = fraction;\r\n result.ray = ray;\r\n result.point.setFromPoint3d(point);\r\n return result;\r\n }\r\n /** Create with CurvePrimitive pointer, fraction, and point coordinates. */\r\n public static createCurveFractionPointDistanceCurveSearchStatus(\r\n curve: CurvePrimitive | undefined,\r\n fraction: number,\r\n point: XYAndZ,\r\n distance: number,\r\n status: CurveSearchStatus,\r\n result?: CurveLocationDetail,\r\n ): CurveLocationDetail {\r\n result = result ? result : new CurveLocationDetail();\r\n result.curve = curve;\r\n result.fraction = fraction;\r\n result.point.setFromPoint3d(point);\r\n result.vectorInCurveLocationDetail = undefined;\r\n result.a = distance;\r\n result.childDetail = undefined;\r\n result.curveSearchStatus = status;\r\n return result;\r\n }\r\n /** Create with curveSearchStatus affected by allowExtension. */\r\n public static createConditionalMoveSignedDistance(\r\n allowExtension: boolean,\r\n curve: CurvePrimitive,\r\n startFraction: number,\r\n endFraction: number,\r\n requestedSignedDistance: number,\r\n result?: CurveLocationDetail,\r\n ): CurveLocationDetail {\r\n let a = requestedSignedDistance;\r\n let status = CurveSearchStatus.success;\r\n if (!allowExtension && !Geometry.isIn01(endFraction)) {\r\n // cap the movement at the endpoint\r\n if (endFraction < 0.0) {\r\n a = - curve.curveLengthBetweenFractions(startFraction, 0.0);\r\n endFraction = 0.0;\r\n status = CurveSearchStatus.stoppedAtBoundary;\r\n } else if (endFraction > 1.0) {\r\n endFraction = 1.0;\r\n a = curve.curveLengthBetweenFractions(startFraction, 1.0);\r\n status = CurveSearchStatus.stoppedAtBoundary;\r\n }\r\n }\r\n result = result ? result : new CurveLocationDetail();\r\n result.curve = curve;\r\n result.fraction = endFraction;\r\n curve.fractionToPoint(endFraction, result.point);\r\n result.vectorInCurveLocationDetail = undefined;\r\n result.a = a;\r\n result.childDetail = undefined;\r\n result.curveSearchStatus = status;\r\n return result;\r\n }\r\n /** Create with CurvePrimitive pointer and fraction for evaluation. */\r\n public static createCurveEvaluatedFraction(\r\n curve: CurvePrimitive, fraction: number, result?: CurveLocationDetail,\r\n ): CurveLocationDetail {\r\n result = result ? result : new CurveLocationDetail();\r\n result.curve = curve;\r\n result.fraction = fraction;\r\n curve.fractionToPoint(fraction, result.point);\r\n result.vectorInCurveLocationDetail = undefined;\r\n result.a = 0.0;\r\n result.childDetail = undefined;\r\n result.curveSearchStatus = undefined;\r\n return result;\r\n }\r\n /** Create with CurvePrimitive pointer and fraction for evaluation. */\r\n public static createCurveEvaluatedFractionPointAndDerivative(\r\n curve: CurvePrimitive, fraction: number, result?: CurveLocationDetail,\r\n ): CurveLocationDetail {\r\n result = result ? result : new CurveLocationDetail();\r\n result.curve = curve;\r\n result.fraction = fraction;\r\n const ray = curve.fractionToPointAndDerivative(fraction);\r\n result.point.setFromPoint3d(ray.origin);\r\n result.vectorInCurveLocationDetail = ray.direction;\r\n result.a = 0.0;\r\n result.childDetail = undefined;\r\n result.curveSearchStatus = undefined;\r\n return result;\r\n }\r\n /** Create with CurvePrimitive pointer and 2 fractions for evaluation. */\r\n public static createCurveEvaluatedFractionFraction(\r\n curve: CurvePrimitive, fraction0: number, fraction1: number, result?: CurveLocationDetail,\r\n ): CurveLocationDetail {\r\n result = result ? result : new CurveLocationDetail();\r\n result.curve = curve;\r\n result.fraction = fraction0;\r\n curve.fractionToPoint(fraction0, result.point);\r\n result.fraction1 = fraction1;\r\n result.point1 = curve.fractionToPoint(fraction1, result.point1);\r\n result.vectorInCurveLocationDetail = undefined;\r\n result.a = 0.0;\r\n result.childDetail = undefined;\r\n result.curveSearchStatus = undefined;\r\n return result;\r\n }\r\n /** Create with CurvePrimitive pointer, fraction, and point coordinates. */\r\n public static createCurveFractionPointDistance(\r\n curve: CurvePrimitive,\r\n fraction: number,\r\n point: XYAndZ,\r\n a: number,\r\n result?: CurveLocationDetail,\r\n ): CurveLocationDetail {\r\n result = result ? result : new CurveLocationDetail();\r\n result.curve = curve;\r\n result.fraction = fraction;\r\n result.point.setFromPoint3d(point);\r\n result.vectorInCurveLocationDetail = undefined;\r\n result.a = a;\r\n result.childDetail = undefined;\r\n result.curveSearchStatus = undefined;\r\n return result;\r\n }\r\n /**\r\n * Update or create if closer than current contents.\r\n * @param curve candidate curve\r\n * @param fraction candidate fraction\r\n * @param point candidate point\r\n * @param a candidate distance\r\n * @returns true if the given distance is smaller (and hence this detail was updated)\r\n */\r\n public updateIfCloserCurveFractionPointDistance(\r\n curve: CurvePrimitive, fraction: number, point: XYAndZ, a: number,\r\n ): boolean {\r\n if (this.a < a)\r\n return false;\r\n CurveLocationDetail.createCurveFractionPointDistance(curve, fraction, point, a, this);\r\n return true;\r\n }\r\n /**\r\n * Exchange the (fraction,fraction1) and (point, point1) pairs.\r\n * * (Skip each swap if its \"1\" value is undefined)\r\n */\r\n public swapFractionsAndPoints(): void {\r\n if (this.fraction1 !== undefined) {\r\n const f = this.fraction;\r\n this.fraction = this.fraction1;\r\n this.fraction1 = f;\r\n }\r\n if (this.point1 !== undefined) {\r\n const p = this.point;\r\n this.point = this.point1;\r\n this.point1 = p;\r\n }\r\n }\r\n /**\r\n * Return the fraction where f falls between fraction and fraction1.\r\n * * ASSUME fraction1 defined\r\n */\r\n public inverseInterpolateFraction(f: number, defaultFraction: number = 0): number {\r\n const a = Geometry.inverseInterpolate01(this.fraction, this.fraction1!, f);\r\n if (a === undefined)\r\n return defaultFraction;\r\n return a;\r\n }\r\n /**\r\n * Return the detail with smaller `a` value -- detailA returned if equal.\r\n * @param detailA first candidate\r\n * @param detailB second candidate\r\n */\r\n public static chooseSmallerA(\r\n detailA: CurveLocationDetail | undefined, detailB: CurveLocationDetail | undefined,\r\n ): CurveLocationDetail | undefined {\r\n if (detailA) {\r\n if (!detailB)\r\n return detailA;\r\n return detailA.a <= detailB.a ? detailA : detailB;\r\n }\r\n return detailB;\r\n }\r\n /** Compare only the curve and fraction of this detail with `other`. */\r\n public isSameCurveAndFraction(other: CurveLocationDetail | { curve: CurvePrimitive, fraction: number }): boolean {\r\n return this.curve === other.curve && Geometry.isAlmostEqualNumber(this.fraction, other.fraction);\r\n }\r\n /**\r\n * Transform the detail in place.\r\n * * All numerical properties are transformed directly, except:\r\n * * when `curve` is defined, `point` and `point1` are reset by evaluating the transformed curve at `fraction` and `fraction1`\r\n * * these properties are untouched: `a`, `fraction`, `fraction1`, `pointQ`\r\n * @param transform the transform to apply\r\n * @return true if and only if the transformation was successful. If false, the instance is in an indeterminate\r\n * state and should not be used.\r\n */\r\n public tryTransformInPlace(transform: Transform): boolean {\r\n if (this.curve && !this.curve.tryTransformInPlace(transform))\r\n return false;\r\n if (this.ray)\r\n this.ray.transformInPlace(transform);\r\n if (this.curve)\r\n this.curve.fractionToPoint(this.fraction, this.point);\r\n else\r\n transform.multiplyXYAndZInPlace(this.point);\r\n if (this.vectorInCurveLocationDetail)\r\n transform.multiplyVectorInPlace(this.vectorInCurveLocationDetail);\r\n if (this.childDetail && this.childDetail !== this && !this.childDetail.tryTransformInPlace(transform))\r\n return false;\r\n if (this.point1) {\r\n if (this.curve && this.fraction1)\r\n this.curve.fractionToPoint(this.fraction1, this.point1);\r\n else\r\n transform.multiplyXYAndZInPlace(this.point1);\r\n }\r\n return true;\r\n }\r\n}\r\n\r\n/**\r\n * Enumeration of configurations for intersections and min/max distance-between-curve\r\n * @public\r\n */\r\nexport enum CurveCurveApproachType {\r\n /** Intersection at a single point */\r\n Intersection = 0,\r\n /** Distinct points on the two curves, with each curve's tangent perpendicular to the chord between the points */\r\n PerpendicularChord = 1,\r\n /** Completely coincident geometry */\r\n CoincidentGeometry = 2,\r\n /** Completely parallel geometry. */\r\n ParallelGeometry = 3,\r\n}\r\n\r\n/**\r\n * A pair of CurveLocationDetail.\r\n * @public\r\n */\r\nexport class CurveLocationDetailPair {\r\n /** The first of the two details. */\r\n public detailA: CurveLocationDetail;\r\n /** The second of the two details. */\r\n public detailB: CurveLocationDetail;\r\n /**\r\n * Enumeration of how the detail pairs relate.\r\n * * This is set only by certain closeApproach calculations.\r\n */\r\n public approachType?: CurveCurveApproachType;\r\n\r\n public constructor(detailA?: CurveLocationDetail, detailB?: CurveLocationDetail) {\r\n this.detailA = detailA ? detailA : new CurveLocationDetail();\r\n this.detailB = detailB ? detailB : new CurveLocationDetail();\r\n }\r\n /** Create a curve detail pair using references to two CurveLocationDetails */\r\n public static createCapture(\r\n detailA: CurveLocationDetail, detailB: CurveLocationDetail, result?: CurveLocationDetailPair,\r\n ): CurveLocationDetailPair {\r\n result = result ? result : new CurveLocationDetailPair();\r\n result.detailA = detailA;\r\n result.detailB = detailB;\r\n return result;\r\n }\r\n /**\r\n * Create a curve detail pair using references to two CurveLocationDetails.\r\n * * optionally install in reversed positions\r\n */\r\n public static createCaptureOptionalReverse(\r\n detailA: CurveLocationDetail, detailB: CurveLocationDetail, reversed: boolean, result?: CurveLocationDetailPair,\r\n ): CurveLocationDetailPair {\r\n result = result ? result : new CurveLocationDetailPair();\r\n if (reversed) {\r\n result.detailA = detailA;\r\n result.detailB = detailB;\r\n\r\n } else {\r\n result.detailA = detailA;\r\n result.detailB = detailB;\r\n }\r\n return result;\r\n }\r\n /** Make a deep copy of this CurveLocationDetailPair */\r\n public clone(result?: CurveLocationDetailPair): CurveLocationDetailPair {\r\n result = result ? result : new CurveLocationDetailPair();\r\n result.detailA = this.detailA.clone();\r\n result.detailB = this.detailB.clone();\r\n result.approachType = this.approachType;\r\n return result;\r\n }\r\n /** Swap the details of A, B */\r\n public swapDetails() {\r\n const q = this.detailA;\r\n this.detailA = this.detailB;\r\n this.detailB = q;\r\n }\r\n /**\r\n * Mutate the input array by removing the second of two adjacent duplicate pairs.\r\n * * Ignores details representing coincident intervals (e.g., for which `fraction1` is defined).\r\n * * Comparison is performed by [[CurveLocationDetail.isSameCurveAndFraction]].\r\n * * No sorting is performed.\r\n * @param pairs array to de-duplicate in place\r\n * @param index0 look for duplicates in the tail of the array starting at index0\r\n * @return reference to input array\r\n * @internal\r\n */\r\n public static removeAdjacentDuplicates(pairs: CurveLocationDetailPair[], index0: number = 0): CurveLocationDetailPair[] {\r\n return pairs.flatMap(\r\n (pair: CurveLocationDetailPair, i: number, arr: CurveLocationDetailPair[]) => {\r\n if (i >= index0 && i > 0) {\r\n if (!pair.detailA.hasFraction1 && !pair.detailB.hasFraction1) {\r\n if (pair.detailA.isSameCurveAndFraction(arr[i - 1].detailA)) {\r\n if (pair.detailB.isSameCurveAndFraction(arr[i - 1].detailB)) {\r\n return []; // remove the i_th pair\r\n }\r\n }\r\n }\r\n }\r\n return [pair]; // preserve the i_th pair\r\n },\r\n );\r\n }\r\n /**\r\n * Transform the details in place.\r\n * @param transform the transform to apply\r\n * @return true if and only if the transformation was successful on both details.\r\n * If false, the instance is in an indeterminate state and should not be used.\r\n */\r\n public tryTransformInPlace(transform: Transform): boolean {\r\n return this.detailA.tryTransformInPlace(transform) && this.detailB.tryTransformInPlace(transform);\r\n }\r\n}\r\n\r\n/**\r\n * Data bundle for a pair of arrays of CurveLocationDetail structures.\r\n * @deprecated in 4.2.0 - will not be removed until after 2026-06-13. Use CurveLocationDetailPair[] instead.\r\n * @public\r\n */\r\nexport class CurveLocationDetailArrayPair {\r\n /** First array of details. */\r\n public dataA: CurveLocationDetail[];\r\n /** Second array of details. */\r\n public dataB: CurveLocationDetail[];\r\n public constructor() {\r\n this.dataA = [];\r\n this.dataB = [];\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"CurveLocationDetail.js","sourceRoot":"","sources":["../../../src/curve/CurveLocationDetail.ts"],"names":[],"mappings":";;;AAAA;;;+FAG+F;AAC/F;;GAEG;AACH,0CAAmD;AACnD,mEAAkE;AAMlE;;;GAGG;AACH,IAAY,iBAWX;AAXD,WAAY,iBAAiB;IAC3B,+DAA+D;IAC/D,iEAAY,CAAA;IACZ,2CAA2C;IAC3C,iFAAoB,CAAA;IACpB,2CAA2C;IAC3C,4EAAkB,CAAA;IAClB,gDAAgD;IAChD,kF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AC;IACpG,CAAC;CACF;AA3FD,0DA2FC;AAED;;;;GAIG;AACH,MAAa,4BAA4B;IACvC,8BAA8B;IACvB,KAAK,CAAwB;IACpC,+BAA+B;IACxB,KAAK,CAAwB;IACpC;QACE,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC;QAChB,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC;IAClB,CAAC;CACF;AATD,oEASC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Curve\n */\nimport { Geometry, ICloneable } from \"../Geometry\";\nimport { Point3d, Vector3d } from \"../geometry3d/Point3dVector3d\";\nimport { Ray3d } from \"../geometry3d/Ray3d\";\nimport { Transform } from \"../geometry3d/Transform\";\nimport { XYAndZ } from \"../geometry3d/XYZProps\";\nimport { CurvePrimitive } from \"./CurvePrimitive\";\n\n/**\n * An enumeration of special conditions being described by a CurveLocationDetail.\n * @public\n */\nexport enum CurveIntervalRole {\n /** This point is an isolated point NOT at a primary vertex. */\n isolated = 0,\n /** This point is an isolated vertex hit */\n isolatedAtVertex = 1,\n /** This is the beginning of an interval */\n intervalStart = 10,\n /** This is an interior point of an interval. */\n intervalInterior = 11,\n /** This is the end of an interval */\n intervalEnd = 12,\n}\n\n/**\n * Return code for CurvePrimitive method `moveSignedDistanceFromFraction`\n * @public\n */\nexport enum CurveSearchStatus {\n /** Unimplemented or zero length curve */\n error,\n /** Complete success of search */\n success = 1,\n /** Search ended prematurely (e.g. at incomplete distance moved) at start or end of curve */\n stoppedAtBoundary = 2,\n}\n\n/**\n * Use to update a cloneable object when source and/or prior result are possibly undefined.\n * * Any undefined source returns undefined.\n * * For defined source, reuse optional result if available.\n * @param source optional source\n * @param result optional result\n */\nfunction optionalUpdate<T extends ICloneable<T>>(source: T | undefined, result: T | undefined): T | undefined {\n return source ? source.clone(result) : undefined;\n}\n\n/**\n * CurveLocationDetail carries point and parameter data about a point evaluated on a curve.\n * * These are returned by a variety of queries.\n * * Particular contents can vary among the queries.\n * @public\n */\nexport class CurveLocationDetail {\n /** The curve being evaluated. */\n public curve?: CurvePrimitive;\n /** Optional ray. */\n public ray?: Ray3d;\n /** The fractional position along the curve. */\n public fraction: number;\n /** Detail condition of the role this point has in some context. */\n public intervalRole?: CurveIntervalRole;\n /** The point on the curve. */\n public point: Point3d;\n /** A vector (e.g. tangent vector) in context. */\n public vectorInCurveLocationDetail?: Vector3d;\n /** A context-specific numeric value (e.g., a distance). */\n public a: number;\n /**\n * Optional CurveLocationDetail with more detail of location. For instance, a detail for fractional position\n * within a CurveChainWithDistanceIndex returns fraction and distance along the chain as its primary data and\n * further detail of the particular curve within the chain in the childDetail.\n */\n public childDetail?: CurveLocationDetail;\n /**\n * A status indicator for certain searches.\n * * e.g., CurvePrimitive.moveSignedDistanceFromFraction.\n */\n public curveSearchStatus?: CurveSearchStatus;\n /** (Optional) second fraction, e.g. end of interval of coincident curves. */\n public fraction1?: number;\n /** (Optional) second point, e.g. end of interval of coincident curves. */\n public point1?: Point3d;\n /** A context-specific temporary point, e.g. for intermediate calculations. */\n public pointQ: Point3d;\n /** Constructor */\n public constructor() {\n this.pointQ = Point3d.createZero();\n this.fraction = 0;\n this.point = Point3d.createZero();\n this.a = 0.0;\n }\n /** Set the (optional) intervalRole field. */\n public setIntervalRole(value: CurveIntervalRole): void {\n this.intervalRole = value;\n }\n /** Set the `fraction` and `point`, using direct assignment (capture!) to `point`. */\n public captureFractionPoint(fraction: number, point: Point3d): void {\n this.fraction = fraction;\n this.point = point;\n }\n /** Set the (optional) `fraction1` and `point1`, using direct assignment (capture!) to `point1`. */\n public captureFraction1Point1(fraction1: number, point1: Point3d): void {\n this.fraction1 = fraction1;\n this.point1 = point1;\n }\n /** Test if this pair has fraction1 defined. */\n public get hasFraction1(): boolean {\n return this.fraction1 !== undefined;\n }\n /** Test if this is an isolated point. This is true if intervalRole is any of (undefined, isolated, isolatedAtVertex). */\n public get isIsolated(): boolean {\n return this.intervalRole === undefined\n || this.intervalRole === CurveIntervalRole.isolated\n || this.intervalRole === CurveIntervalRole.isolatedAtVertex;\n }\n /** Return the fraction delta. (0 if no fraction1). */\n public get fractionDelta(): number {\n return this.fraction1 !== undefined ? this.fraction1 - this.fraction : 0.0;\n }\n /**\n * If (fraction1, point1) are defined, make them the primary (and only) data.\n * * No action if undefined.\n */\n public collapseToEnd() {\n if (this.fraction1 !== undefined)\n this.fraction = this.fraction1;\n if (this.point1)\n this.point = this.point1;\n this.collapseToStart();\n }\n /** Make (fraction, point) the primary (and only) data. */\n public collapseToStart() {\n this.fraction1 = undefined;\n this.point1 = undefined;\n }\n /**\n * Return a complete copy, WITH CAVEATS.\n * * curve member is copied as a reference.\n * * point and vector members are cloned.\n */\n public clone(result?: CurveLocationDetail): CurveLocationDetail {\n if (result === this)\n return result;\n result = result ? result : new CurveLocationDetail();\n result.curve = this.curve;\n result.fraction = this.fraction;\n result.fraction1 = this.fraction1;\n result.point1 = optionalUpdate<Point3d>(this.point1, result.point1);\n result.point.setFromPoint3d(this.point);\n result.vectorInCurveLocationDetail = optionalUpdate<Vector3d>(this.vectorInCurveLocationDetail, result.vectorInCurveLocationDetail);\n result.a = this.a;\n result.childDetail = optionalUpdate<CurveLocationDetail>(this.childDetail, result.childDetail);\n result.curveSearchStatus = this.curveSearchStatus;\n return result;\n }\n /**\n * Updated in this instance.\n * * Note that if caller omits `vector` and `a`, those fields are updated to the call-list defaults (NOT left as-is)\n * * point and vector updates are by data copy (not capture of pointers).\n * @param fraction (required) fraction to install.\n * @param point (required) point to install.\n * @param vector (optional) vector to install.\n * @param a (optional) numeric value to install.\n */\n public setFP(fraction: number, point: XYAndZ, vector?: Vector3d, a: number = 0.0): void {\n this.fraction = fraction;\n this.point.setFromPoint3d(point);\n this.vectorInCurveLocationDetail = optionalUpdate<Vector3d>(vector, this.vectorInCurveLocationDetail);\n this.a = a;\n }\n /**\n * Updated in this instance.\n * * Note that if caller omits a`, that field is updated to the call-list default (NOT left as-is)\n * * point and vector updates are by data copy (not capture of the ray members).\n * @param fraction (required) fraction to install.\n * @param ray (required) point and vector to install.\n * @param a (optional) numeric value to install.\n */\n public setFR(fraction: number, ray: Ray3d, a: number = 0): void {\n return this.setFP(fraction, ray.origin, ray.direction, a);\n }\n /** Set the CurvePrimitive pointer, leaving all other properties untouched. */\n public setCurve(curve: CurvePrimitive) {\n this.curve = curve;\n }\n /** Record the distance from the CurveLocationDetail's point to the parameter point. */\n public setDistanceTo(point: XYAndZ) {\n this.a = this.point.distance(point);\n }\n /** Create with a CurvePrimitive pointer but no coordinate data. */\n public static create(curve?: CurvePrimitive, result?: CurveLocationDetail): CurveLocationDetail {\n result = result ? result : new CurveLocationDetail();\n result.curve = curve;\n return result;\n }\n /** Create a new detail using CurvePrimitive pointer, fraction, and point coordinates. */\n public static createCurveFractionPoint(\n curve: CurvePrimitive | undefined, fraction: number, point: XYAndZ, result?: CurveLocationDetail,\n ): CurveLocationDetail {\n result = result ? result : new CurveLocationDetail();\n result.curve = curve;\n result.fraction = fraction;\n result.point.setFromPoint3d(point);\n result.vectorInCurveLocationDetail = undefined;\n result.a = 0.0;\n result.childDetail = undefined;\n result.curveSearchStatus = undefined;\n return result;\n }\n /** Create a new detail with only ray, fraction, and point. */\n public static createRayFractionPoint(\n ray: Ray3d, fraction: number, point: XYAndZ, result?: CurveLocationDetail,\n ): CurveLocationDetail {\n result = result ? result : new CurveLocationDetail();\n result.fraction = fraction;\n result.ray = ray;\n result.point.setFromPoint3d(point);\n return result;\n }\n /** Create with CurvePrimitive pointer, fraction, and point coordinates. */\n public static createCurveFractionPointDistanceCurveSearchStatus(\n curve: CurvePrimitive | undefined,\n fraction: number,\n point: XYAndZ,\n distance: number,\n status: CurveSearchStatus,\n result?: CurveLocationDetail,\n ): CurveLocationDetail {\n result = result ? result : new CurveLocationDetail();\n result.curve = curve;\n result.fraction = fraction;\n result.point.setFromPoint3d(point);\n result.vectorInCurveLocationDetail = undefined;\n result.a = distance;\n result.childDetail = undefined;\n result.curveSearchStatus = status;\n return result;\n }\n /** Create with curveSearchStatus affected by allowExtension. */\n public static createConditionalMoveSignedDistance(\n allowExtension: boolean,\n curve: CurvePrimitive,\n startFraction: number,\n endFraction: number,\n requestedSignedDistance: number,\n result?: CurveLocationDetail,\n ): CurveLocationDetail {\n let a = requestedSignedDistance;\n let status = CurveSearchStatus.success;\n if (!allowExtension && !Geometry.isIn01(endFraction)) {\n // cap the movement at the endpoint\n if (endFraction < 0.0) {\n a = - curve.curveLengthBetweenFractions(startFraction, 0.0);\n endFraction = 0.0;\n status = CurveSearchStatus.stoppedAtBoundary;\n } else if (endFraction > 1.0) {\n endFraction = 1.0;\n a = curve.curveLengthBetweenFractions(startFraction, 1.0);\n status = CurveSearchStatus.stoppedAtBoundary;\n }\n }\n result = result ? result : new CurveLocationDetail();\n result.curve = curve;\n result.fraction = endFraction;\n curve.fractionToPoint(endFraction, result.point);\n result.vectorInCurveLocationDetail = undefined;\n result.a = a;\n result.childDetail = undefined;\n result.curveSearchStatus = status;\n return result;\n }\n /** Create with CurvePrimitive pointer and fraction for evaluation. */\n public static createCurveEvaluatedFraction(\n curve: CurvePrimitive, fraction: number, result?: CurveLocationDetail,\n ): CurveLocationDetail {\n result = result ? result : new CurveLocationDetail();\n result.curve = curve;\n result.fraction = fraction;\n curve.fractionToPoint(fraction, result.point);\n result.vectorInCurveLocationDetail = undefined;\n result.a = 0.0;\n result.childDetail = undefined;\n result.curveSearchStatus = undefined;\n return result;\n }\n /** Create with CurvePrimitive pointer and fraction for evaluation. */\n public static createCurveEvaluatedFractionPointAndDerivative(\n curve: CurvePrimitive, fraction: number, result?: CurveLocationDetail,\n ): CurveLocationDetail {\n result = result ? result : new CurveLocationDetail();\n result.curve = curve;\n result.fraction = fraction;\n const ray = curve.fractionToPointAndDerivative(fraction);\n result.point.setFromPoint3d(ray.origin);\n result.vectorInCurveLocationDetail = ray.direction;\n result.a = 0.0;\n result.childDetail = undefined;\n result.curveSearchStatus = undefined;\n return result;\n }\n /** Create with CurvePrimitive pointer and 2 fractions for evaluation. */\n public static createCurveEvaluatedFractionFraction(\n curve: CurvePrimitive, fraction0: number, fraction1: number, result?: CurveLocationDetail,\n ): CurveLocationDetail {\n result = result ? result : new CurveLocationDetail();\n result.curve = curve;\n result.fraction = fraction0;\n curve.fractionToPoint(fraction0, result.point);\n result.fraction1 = fraction1;\n result.point1 = curve.fractionToPoint(fraction1, result.point1);\n result.vectorInCurveLocationDetail = undefined;\n result.a = 0.0;\n result.childDetail = undefined;\n result.curveSearchStatus = undefined;\n return result;\n }\n /** Create with CurvePrimitive pointer, fraction, and point coordinates. */\n public static createCurveFractionPointDistance(\n curve: CurvePrimitive,\n fraction: number,\n point: XYAndZ,\n a: number,\n result?: CurveLocationDetail,\n ): CurveLocationDetail {\n result = result ? result : new CurveLocationDetail();\n result.curve = curve;\n result.fraction = fraction;\n result.point.setFromPoint3d(point);\n result.vectorInCurveLocationDetail = undefined;\n result.a = a;\n result.childDetail = undefined;\n result.curveSearchStatus = undefined;\n return result;\n }\n /**\n * Update or create if closer than current contents.\n * @param curve candidate curve\n * @param fraction candidate fraction\n * @param point candidate point\n * @param a candidate distance\n * @returns true if the given distance is smaller (and hence this detail was updated)\n */\n public updateIfCloserCurveFractionPointDistance(\n curve: CurvePrimitive, fraction: number, point: XYAndZ, a: number,\n ): boolean {\n if (this.a < a)\n return false;\n CurveLocationDetail.createCurveFractionPointDistance(curve, fraction, point, a, this);\n return true;\n }\n /**\n * Exchange the (fraction,fraction1) and (point, point1) pairs.\n * * (Skip each swap if its \"1\" value is undefined)\n */\n public swapFractionsAndPoints(): void {\n if (this.fraction1 !== undefined) {\n const f = this.fraction;\n this.fraction = this.fraction1;\n this.fraction1 = f;\n }\n if (this.point1 !== undefined) {\n const p = this.point;\n this.point = this.point1;\n this.point1 = p;\n }\n }\n /**\n * Return the fraction where f falls between fraction and fraction1.\n * * ASSUME fraction1 defined\n */\n public inverseInterpolateFraction(f: number, defaultFraction: number = 0): number {\n const a = Geometry.inverseInterpolate01(this.fraction, this.fraction1!, f);\n if (a === undefined)\n return defaultFraction;\n return a;\n }\n /**\n * Return the detail with smaller `a` value -- detailA returned if equal.\n * @param detailA first candidate\n * @param detailB second candidate\n */\n public static chooseSmallerA(\n detailA: CurveLocationDetail | undefined, detailB: CurveLocationDetail | undefined,\n ): CurveLocationDetail | undefined {\n if (detailA) {\n if (!detailB)\n return detailA;\n return detailA.a <= detailB.a ? detailA : detailB;\n }\n return detailB;\n }\n /** Compare only the curve and fraction of this detail with `other`. */\n public isSameCurveAndFraction(other: CurveLocationDetail | { curve: CurvePrimitive, fraction: number }): boolean {\n return this.curve === other.curve && Geometry.isAlmostEqualNumber(this.fraction, other.fraction);\n }\n /**\n * Transform the detail in place.\n * * All numerical properties are transformed directly, except:\n * * when `curve` is defined, `point` and `point1` are reset by evaluating the transformed curve at `fraction` and `fraction1`\n * * these properties are untouched: `a`, `fraction`, `fraction1`, `pointQ`\n * @param transform the transform to apply\n * @return true if and only if the transformation was successful. If false, the instance is in an indeterminate\n * state and should not be used.\n */\n public tryTransformInPlace(transform: Transform): boolean {\n if (this.curve && !this.curve.tryTransformInPlace(transform))\n return false;\n if (this.ray)\n this.ray.transformInPlace(transform);\n if (this.curve)\n this.curve.fractionToPoint(this.fraction, this.point);\n else\n transform.multiplyXYAndZInPlace(this.point);\n if (this.vectorInCurveLocationDetail)\n transform.multiplyVectorInPlace(this.vectorInCurveLocationDetail);\n if (this.childDetail && this.childDetail !== this && !this.childDetail.tryTransformInPlace(transform))\n return false;\n if (this.point1) {\n if (this.curve && this.fraction1)\n this.curve.fractionToPoint(this.fraction1, this.point1);\n else\n transform.multiplyXYAndZInPlace(this.point1);\n }\n return true;\n }\n}\n\n/**\n * Enumeration of configurations for intersections and min/max distance-between-curve\n * @public\n */\nexport enum CurveCurveApproachType {\n /** Intersection at a single point */\n Intersection = 0,\n /** Distinct points on the two curves, with each curve's tangent perpendicular to the chord between the points */\n PerpendicularChord = 1,\n /** Completely coincident geometry */\n CoincidentGeometry = 2,\n /** Completely parallel geometry. */\n ParallelGeometry = 3,\n}\n\n/**\n * A pair of CurveLocationDetail.\n * @public\n */\nexport class CurveLocationDetailPair {\n /** The first of the two details. */\n public detailA: CurveLocationDetail;\n /** The second of the two details. */\n public detailB: CurveLocationDetail;\n /**\n * Enumeration of how the detail pairs relate.\n * * This is set only by certain closeApproach calculations.\n */\n public approachType?: CurveCurveApproachType;\n\n public constructor(detailA?: CurveLocationDetail, detailB?: CurveLocationDetail) {\n this.detailA = detailA ? detailA : new CurveLocationDetail();\n this.detailB = detailB ? detailB : new CurveLocationDetail();\n }\n /** Create a curve detail pair using references to two CurveLocationDetails */\n public static createCapture(\n detailA: CurveLocationDetail, detailB: CurveLocationDetail, result?: CurveLocationDetailPair,\n ): CurveLocationDetailPair {\n result = result ? result : new CurveLocationDetailPair();\n result.detailA = detailA;\n result.detailB = detailB;\n return result;\n }\n /**\n * Create a curve detail pair using references to two CurveLocationDetails.\n * * optionally install in reversed positions\n */\n public static createCaptureOptionalReverse(\n detailA: CurveLocationDetail, detailB: CurveLocationDetail, reversed: boolean, result?: CurveLocationDetailPair,\n ): CurveLocationDetailPair {\n result = result ? result : new CurveLocationDetailPair();\n if (reversed) {\n result.detailA = detailA;\n result.detailB = detailB;\n\n } else {\n result.detailA = detailA;\n result.detailB = detailB;\n }\n return result;\n }\n /** Make a deep copy of this CurveLocationDetailPair */\n public clone(result?: CurveLocationDetailPair): CurveLocationDetailPair {\n result = result ? result : new CurveLocationDetailPair();\n result.detailA = this.detailA.clone();\n result.detailB = this.detailB.clone();\n result.approachType = this.approachType;\n return result;\n }\n /** Swap the details of A, B */\n public swapDetails() {\n const q = this.detailA;\n this.detailA = this.detailB;\n this.detailB = q;\n }\n /**\n * Mutate the input array by removing the second of two adjacent duplicate pairs.\n * * Ignores details representing coincident intervals (e.g., for which `fraction1` is defined).\n * * Comparison is performed by [[CurveLocationDetail.isSameCurveAndFraction]].\n * * No sorting is performed.\n * @param pairs array to de-duplicate in place\n * @param index0 look for duplicates in the tail of the array starting at index0\n * @return reference to input array\n * @internal\n */\n public static removeAdjacentDuplicates(pairs: CurveLocationDetailPair[], index0: number = 0): CurveLocationDetailPair[] {\n return pairs.flatMap(\n (pair: CurveLocationDetailPair, i: number, arr: CurveLocationDetailPair[]) => {\n if (i >= index0 && i > 0) {\n if (!pair.detailA.hasFraction1 && !pair.detailB.hasFraction1) {\n if (pair.detailA.isSameCurveAndFraction(arr[i - 1].detailA)) {\n if (pair.detailB.isSameCurveAndFraction(arr[i - 1].detailB)) {\n return []; // remove the i_th pair\n }\n }\n }\n }\n return [pair]; // preserve the i_th pair\n },\n );\n }\n /**\n * Transform the details in place.\n * @param transform the transform to apply\n * @return true if and only if the transformation was successful on both details.\n * If false, the instance is in an indeterminate state and should not be used.\n */\n public tryTransformInPlace(transform: Transform): boolean {\n return this.detailA.tryTransformInPlace(transform) && this.detailB.tryTransformInPlace(transform);\n }\n}\n\n/**\n * Data bundle for a pair of arrays of CurveLocationDetail structures.\n * @deprecated in 4.2.0 - will not be removed until after 2026-06-13. Use CurveLocationDetailPair[] instead.\n * @public\n */\nexport class CurveLocationDetailArrayPair {\n /** First array of details. */\n public dataA: CurveLocationDetail[];\n /** Second array of details. */\n public dataB: CurveLocationDetail[];\n public constructor() {\n this.dataA = [];\n this.dataB = [];\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CurveOps.js","sourceRoot":"","sources":["../../../src/curve/CurveOps.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F;;GAEG;AAEH,0CAAkD;AAClD,6DAA0D;AAE1D,mEAAyD;AACzD,+CAA8C;AAC9C,+CAA4C;AAC5C,uDAAoD;AACpD,uDAAiE;AACjE,qDAAkD;AAElD,mDAAgD;AAChD,gFAA6E;AAC7E,kFAAsF;AAEtF,iCAA8B;AA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G,CAAC,CAAC,mCAAmC;QACjD,CAAC;QACD,IAAI,OAAO,IAAI,WAAW,EAAE,CAAC;YAC3B,YAAY,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;YAC3C,OAAO,GAAG,CAAC,CAAC,oCAAoC;QAClD,CAAC;QACD,IAAI,OAAO,IAAI,WAAW,EAAE,CAAC;YAC3B,YAAY,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;YAC3C,OAAO,GAAG,CAAC,CAAC,oCAAoC;QAClD,CAAC;QACD,IAAI,CAAC,OAAO,EAAE,UAAU;YACtB,OAAO,SAAS,CAAC,CAAC,eAAe;QAEnC,MAAM,cAAc,GAAG,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE,eAAe,IAAI,mBAAQ,CAAC,iBAAiB,CAAC,CAAC;QACxF,MAAM,sBAAsB,GAAG,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,MAAM,CAAC,YAAY,CAAC,oBAAS,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QAChG,IAAI,sBAAsB,GAAG,cAAc,EAAE,2CAA2C;YACtF,OAAO,SAAS,CAAC,CAAC,kBAAkB;QAEtC,IAAI,OAAO,GAAG,OAAO;YACnB,YAAY,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;;YAE3C,YAAY,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;QAC7C,GAAG,CAAC,SAAS,CAAC,CAAC,GAAG,GAAG,CAAC;QACtB,OAAO,GAAG,CAAC,CAAC,kCAAkC;IAChD,CAAC;CACF;AA1ND,4BA0NC","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 Curve\r\n */\r\n\r\nimport { AxisIndex, Geometry } from \"../Geometry\";\r\nimport { FrameBuilder } from \"../geometry3d/FrameBuilder\";\r\nimport { MultiLineStringDataVariant } from \"../geometry3d/IndexedXYZCollection\";\r\nimport { Vector3d } from \"../geometry3d/Point3dVector3d\";\r\nimport { Range3d } from \"../geometry3d/Range\";\r\nimport { Ray3d } from \"../geometry3d/Ray3d\";\r\nimport { Transform } from \"../geometry3d/Transform\";\r\nimport { BagOfCurves, CurveCollection } from \"./CurveCollection\";\r\nimport { CurvePrimitive } from \"./CurvePrimitive\";\r\nimport { AnyChain, AnyCurve } from \"./CurveTypes\";\r\nimport { GeometryQuery } from \"./GeometryQuery\";\r\nimport { MultiChainCollector } from \"./internalContexts/MultiChainCollector\";\r\nimport { CurveChainWireOffsetContext } from \"./internalContexts/PolygonOffsetContext\";\r\nimport { LineString3d } from \"./LineString3d\";\r\nimport { Loop } from \"./Loop\";\r\nimport { OffsetOptions } from \"./OffsetOptions\";\r\nimport { Path } from \"./Path\";\r\nimport { StrokeOptions } from \"./StrokeOptions\";\r\n\r\n /**\r\n * Options bundle for use in [[CurveOps.isPlanar]] and [[CurveOps.isColinear]].\r\n * @public\r\n */\r\n export interface PlanarColinearOptions {\r\n /** Maximum allowable distance that geometry can deviate from planarity/colinearity. Default is [[Geometry.smallMetricDistance]]. */\r\n maxDeviation?: number;\r\n /** Whether colinearity test ignores z-coordinates. Default is `false`. */\r\n xyColinear?: boolean;\r\n /** Radian tolerance for xy-colinearity, measuring maximum angular deviation from a vertical plane. Default is [[Geometry.smallAngleRadians]]. */\r\n radianTolerance?: number;\r\n /** Pre-allocated object to populate with the computed plane-to-world transformation and return when planarity test succeeds. */\r\n localToWorld?: Transform;\r\n /** Pre-allocated object to populate with the computed line and return when colinear test succeeds. */\r\n colinearRay?: Ray3d;\r\n }\r\n\r\n/**\r\n * Static methods for miscellaneous curve operations.\r\n * @public\r\n */\r\nexport class CurveOps {\r\n /** Recursively sum curve lengths, allowing CurvePrimitive, CurveCollection, or array of such at any level. */\r\n public static sumLengths(curves: AnyCurve | AnyCurve[]): number {\r\n let mySum = 0;\r\n if (curves instanceof CurvePrimitive) {\r\n mySum += curves.curveLength();\r\n } else if (curves instanceof CurveCollection) {\r\n mySum += curves.sumLengths();\r\n } else if (Array.isArray(curves)) {\r\n for (const data1 of curves)\r\n mySum += this.sumLengths(data1);\r\n }\r\n return mySum;\r\n }\r\n /** Recursively extend the range by each curve's range, allowing CurvePrimitive, CurveCollection, or array of such at any level. */\r\n public static extendRange(range: Range3d, curves: AnyCurve | AnyCurve[], transform?: Transform): Range3d {\r\n if (Array.isArray(curves)) {\r\n for (const data1 of curves)\r\n this.extendRange(range, data1, transform);\r\n } else {\r\n curves.extendRange(range, transform);\r\n }\r\n return range;\r\n }\r\n /**\r\n * Construct a separate xy-offset for each input curve.\r\n * * For best offset results, the inputs should be parallel to the xy-plane.\r\n * @param curves input curve(s), z-coordinates ignored. Only curves of type [[AnyChain]] are handled.\r\n * @param offset offset distance (positive to left of curve, negative to right)\r\n * @param result array to collect offset curves\r\n * @returns summed length of offset curves\r\n */\r\n public static appendXYOffsets(curves: AnyCurve | AnyCurve[] | undefined, offset: number, result: AnyCurve[]): number {\r\n let summedLengths = 0;\r\n if (curves instanceof CurvePrimitive) {\r\n const resultA = CurveChainWireOffsetContext.constructCurveXYOffset(Path.create(curves), offset);\r\n if (resultA) {\r\n summedLengths += this.sumLengths(resultA);\r\n result.push(resultA);\r\n }\r\n } else if (curves instanceof Loop || curves instanceof Path) {\r\n const resultA = CurveChainWireOffsetContext.constructCurveXYOffset(curves, offset);\r\n if (resultA) {\r\n summedLengths += this.sumLengths(resultA);\r\n result.push(resultA);\r\n }\r\n } else if (curves instanceof BagOfCurves) {\r\n for (const q of curves.children)\r\n summedLengths += this.appendXYOffsets(q, offset, result);\r\n } else if (Array.isArray(curves)) {\r\n for (const q of curves)\r\n summedLengths += this.appendXYOffsets(q, offset, result);\r\n }\r\n return summedLengths;\r\n }\r\n /**\r\n * Restructure curve fragments as Paths and Loops, and construct xy-offsets of the chains.\r\n * * If the inputs do not form Loop(s), the classification of offsets is suspect.\r\n * * For best offset results, the inputs should be parallel to the xy-plane.\r\n * * Chain formation is dependent upon input fragment order, as a greedy algorithm is employed.\r\n * @param fragments fragments to be chained and offset\r\n * @param offsetDistance offset distance, applied to both sides of each fragment to produce inside and outside xy-offset curves.\r\n * @param gapTolerance distance to be treated as \"effectively zero\" when joining head-to-tail\r\n * @returns object with named chains, insideOffsets, outsideOffsets\r\n */\r\n public static collectInsideAndOutsideXYOffsets(fragments: AnyCurve[], offsetDistance: number, gapTolerance: number): { insideOffsets: AnyCurve[], outsideOffsets: AnyCurve[], chains?: AnyChain } {\r\n const collector = new MultiChainCollector(gapTolerance, gapTolerance);\r\n for (const s of fragments) {\r\n collector.captureCurve(s);\r\n }\r\n const chains = collector.grabResult(true);\r\n const myOffsetA: CurveCollection[] = [];\r\n const myOffsetB: CurveCollection[] = [];\r\n const offsetLengthA = CurveOps.appendXYOffsets(chains, offsetDistance, myOffsetA);\r\n const offsetLengthB = CurveOps.appendXYOffsets(chains, -offsetDistance, myOffsetB);\r\n if (offsetLengthA > offsetLengthB) {\r\n return { outsideOffsets: myOffsetA, insideOffsets: myOffsetB, chains };\r\n } else {\r\n return { insideOffsets: myOffsetA, outsideOffsets: myOffsetB, chains };\r\n }\r\n }\r\n /**\r\n * Construct curves that are offset from a Path or Loop as viewed in xy-plane (ignoring z).\r\n * * The construction will remove \"some\" local effects of features smaller than the offset distance, but will not detect self intersection among widely separated edges.\r\n * @param curves base curves.\r\n * @param offsetDistanceOrOptions offset distance (positive to left of curve, negative to right) or options object.\r\n */\r\n public static constructCurveXYOffset(curves: Path | Loop, offsetDistanceOrOptions: number | OffsetOptions): CurveCollection | undefined {\r\n return CurveChainWireOffsetContext.constructCurveXYOffset(curves, offsetDistanceOrOptions);\r\n }\r\n /**\r\n * Create the offset of a single curve primitive as viewed in the xy-plane (ignoring z).\r\n * @param curve primitive to offset\r\n * @param offsetDistanceOrOptions offset distance (positive to left of curve, negative to right) or options object\r\n */\r\n public static createSingleOffsetPrimitiveXY(curve: CurvePrimitive, offsetDistanceOrOptions: number | OffsetOptions): CurvePrimitive | CurvePrimitive[] | undefined {\r\n return CurveChainWireOffsetContext.createSingleOffsetPrimitiveXY(curve, offsetDistanceOrOptions);\r\n }\r\n /**\r\n * Restructure curve fragments as Paths and Loops.\r\n * * Chain formation is dependent upon input fragment order, as a greedy algorithm is employed.\r\n * @param fragments fragments to be chained\r\n * @param gapTolerance distance to be treated as \"effectively zero\" when assembling fragments head-to-tail\r\n * @param planeTolerance tolerance for considering a closed chain to be planar. If undefined, only create Path. If defined, create Loops for closed chains within tolerance of a plane.\r\n * @returns chains, possibly wrapped in a [[BagOfCurves]].\r\n */\r\n public static collectChains(fragments: AnyCurve[], gapTolerance: number = Geometry.smallMetricDistance, planeTolerance?: number): AnyChain | undefined {\r\n const collector = new MultiChainCollector(gapTolerance, planeTolerance);\r\n for (const s of fragments) {\r\n collector.captureCurve(s);\r\n }\r\n return collector.grabResult(true);\r\n }\r\n /**\r\n * Restructure curve fragments, to be stroked and passed into the callback.\r\n * * Chain formation is dependent upon input fragment order, as a greedy algorithm is employed.\r\n * @param fragments fragments to be chained and stroked\r\n * @param announceChain callback to process each stroked Path and Loop\r\n * @param strokeOptions options for stroking the chains\r\n * @param gapTolerance distance to be treated as \"effectively zero\" when assembling fragments head-to-tail. Also used for removing duplicate points in the stroked chains.\r\n * @param _planeTolerance unused, pass undefined\r\n */\r\n public static collectChainsAsLineString3d(fragments: AnyCurve[], announceChain: (chainPoints: LineString3d) => void, strokeOptions?: StrokeOptions, gapTolerance: number = Geometry.smallMetricDistance, _planeTolerance?: number) {\r\n const collector = new MultiChainCollector(gapTolerance); // no planarity tolerance needed\r\n for (const s of fragments) {\r\n collector.captureCurve(s);\r\n }\r\n collector.announceChainsAsLineString3d(announceChain, strokeOptions);\r\n }\r\n /**\r\n * Compute the range of the curves in the local coordinates of a constructed localToWorld frame.\r\n * @param curves input geometry: curves or points.\r\n * @param localRange pre-allocated object to populate with the computed local range.\r\n * @param localToWorld optional pre-allocated object to populate with the computed frame.\r\n * @returns whether the frame was successfully computed.\r\n */\r\n public static computeLocalRange(curves: AnyCurve | MultiLineStringDataVariant, localRange: Range3d, localToWorld?: Transform): boolean {\r\n const builderData: any[] = [curves];\r\n if (localToWorld)\r\n builderData.push(localToWorld);\r\n localToWorld = FrameBuilder.createRightHandedFrame(Vector3d.unitZ(), ...builderData);\r\n if (!localToWorld)\r\n return false;\r\n const worldToLocal = localToWorld.inverse();\r\n localRange.setNull();\r\n if (Array.isArray(curves) || !(curves instanceof GeometryQuery))\r\n Range3d.createFromVariantData(curves, worldToLocal, localRange);\r\n else\r\n this.extendRange(localRange, curves, worldToLocal);\r\n return true;\r\n }\r\n /**\r\n * Check whether or not the curves are planar, and if so, return a localToWorld frame.\r\n * @param curves input geometry: curves or points.\r\n * @param options bundle of options.\r\n * @returns localToWorld frame `T` for coplanar curves, or undefined if they are not coplanar.\r\n * `T` satisfies:\r\n * * `T.origin` is in the plane.\r\n * * `T.matrix.columnZ()` is the plane unit normal (or its negative).\r\n * * `T.matrix.isRigid()` returns true.\r\n * * `T.inverse()` is worldToLocal; apply to input geometry to rotate it into the xy-plane.\r\n */\r\n public static isPlanar(curves: AnyCurve | MultiLineStringDataVariant, options?: PlanarColinearOptions): Transform | undefined {\r\n const localRange = Range3d.create();\r\n const localToWorld = options?.localToWorld ?? Transform.createIdentity();\r\n if (!this.computeLocalRange(curves, localRange, localToWorld))\r\n return undefined;\r\n const maxAltitude = options?.maxDeviation ?? Geometry.smallMetricDistance;\r\n return (localRange.zLength() <= Math.abs(maxAltitude)) ? localToWorld : undefined;\r\n }\r\n /**\r\n * Check whether or not the curves lie in a straight line, and if so, return a colinear ray.\r\n * * This test does not take curve traversal or point order into account.\r\n * @param curves input geometry: curves or points.\r\n * @param options bundle of options.\r\n * @returns ray colinear with input, or undefined if input is not colinear.\r\n */\r\n public static isColinear(curves: AnyCurve | MultiLineStringDataVariant, options?: PlanarColinearOptions): Ray3d | undefined {\r\n const localRange = Range3d.create();\r\n const localToWorld = options?.localToWorld ?? Transform.createIdentity();\r\n if (!this.computeLocalRange(curves, localRange, localToWorld))\r\n return undefined;\r\n const maxAltitude = Math.abs(options?.maxDeviation ?? Geometry.smallMetricDistance);\r\n if (localRange.zLength() > maxAltitude)\r\n return undefined; // non-planar\r\n\r\n const ray = options?.colinearRay ?? Ray3d.createZero();\r\n ray.origin.setFrom(localToWorld.origin);\r\n\r\n const xLength = localRange.xLength();\r\n const yLength = localRange.yLength();\r\n if (xLength <= maxAltitude && yLength <= maxAltitude) {\r\n ray.direction.setZero();\r\n return ray; // the input is essentially a point\r\n }\r\n if (yLength <= maxAltitude) {\r\n localToWorld.matrix.columnX(ray.direction);\r\n return ray; // the input lies along local x-axis\r\n }\r\n if (xLength <= maxAltitude) {\r\n localToWorld.matrix.columnY(ray.direction);\r\n return ray; // the input lies along local y-axis\r\n }\r\n if (!options?.xyColinear)\r\n return undefined; // non-colinear\r\n\r\n const angleTolerance = Math.abs(options?.radianTolerance ?? Geometry.smallAngleRadians);\r\n const verticalPlaneDeviation = Math.abs(localToWorld.matrix.columnDotXYZ(AxisIndex.Z, 0, 0, 1));\r\n if (verticalPlaneDeviation > angleTolerance) // cos(t + pi/2) = -sin(t) ~ -t for small t\r\n return undefined; // non-xy-colinear\r\n\r\n if (xLength > yLength)\r\n localToWorld.matrix.columnX(ray.direction);\r\n else\r\n localToWorld.matrix.columnY(ray.direction);\r\n ray.direction.z = 0.0;\r\n return ray; // xy-colinear (plane is vertical)\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"CurveOps.js","sourceRoot":"","sources":["../../../src/curve/CurveOps.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F;;GAEG;AAEH,0CAAkD;AAClD,6DAA0D;AAE1D,mEAAyD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C","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 Curve\n */\n\nimport { AxisIndex, Geometry } from \"../Geometry\";\nimport { FrameBuilder } from \"../geometry3d/FrameBuilder\";\nimport { MultiLineStringDataVariant } from \"../geometry3d/IndexedXYZCollection\";\nimport { Vector3d } from \"../geometry3d/Point3dVector3d\";\nimport { Range3d } from \"../geometry3d/Range\";\nimport { Ray3d } from \"../geometry3d/Ray3d\";\nimport { Transform } from \"../geometry3d/Transform\";\nimport { BagOfCurves, CurveCollection } from \"./CurveCollection\";\nimport { CurvePrimitive } from \"./CurvePrimitive\";\nimport { AnyChain, AnyCurve } from \"./CurveTypes\";\nimport { GeometryQuery } from \"./GeometryQuery\";\nimport { MultiChainCollector } from \"./internalContexts/MultiChainCollector\";\nimport { CurveChainWireOffsetContext } from \"./internalContexts/PolygonOffsetContext\";\nimport { LineString3d } from \"./LineString3d\";\nimport { Loop } from \"./Loop\";\nimport { OffsetOptions } from \"./OffsetOptions\";\nimport { Path } from \"./Path\";\nimport { StrokeOptions } from \"./StrokeOptions\";\n\n /**\n * Options bundle for use in [[CurveOps.isPlanar]] and [[CurveOps.isColinear]].\n * @public\n */\n export interface PlanarColinearOptions {\n /** Maximum allowable distance that geometry can deviate from planarity/colinearity. Default is [[Geometry.smallMetricDistance]]. */\n maxDeviation?: number;\n /** Whether colinearity test ignores z-coordinates. Default is `false`. */\n xyColinear?: boolean;\n /** Radian tolerance for xy-colinearity, measuring maximum angular deviation from a vertical plane. Default is [[Geometry.smallAngleRadians]]. */\n radianTolerance?: number;\n /** Pre-allocated object to populate with the computed plane-to-world transformation and return when planarity test succeeds. */\n localToWorld?: Transform;\n /** Pre-allocated object to populate with the computed line and return when colinear test succeeds. */\n colinearRay?: Ray3d;\n }\n\n/**\n * Static methods for miscellaneous curve operations.\n * @public\n */\nexport class CurveOps {\n /** Recursively sum curve lengths, allowing CurvePrimitive, CurveCollection, or array of such at any level. */\n public static sumLengths(curves: AnyCurve | AnyCurve[]): number {\n let mySum = 0;\n if (curves instanceof CurvePrimitive) {\n mySum += curves.curveLength();\n } else if (curves instanceof CurveCollection) {\n mySum += curves.sumLengths();\n } else if (Array.isArray(curves)) {\n for (const data1 of curves)\n mySum += this.sumLengths(data1);\n }\n return mySum;\n }\n /** Recursively extend the range by each curve's range, allowing CurvePrimitive, CurveCollection, or array of such at any level. */\n public static extendRange(range: Range3d, curves: AnyCurve | AnyCurve[], transform?: Transform): Range3d {\n if (Array.isArray(curves)) {\n for (const data1 of curves)\n this.extendRange(range, data1, transform);\n } else {\n curves.extendRange(range, transform);\n }\n return range;\n }\n /**\n * Construct a separate xy-offset for each input curve.\n * * For best offset results, the inputs should be parallel to the xy-plane.\n * @param curves input curve(s), z-coordinates ignored. Only curves of type [[AnyChain]] are handled.\n * @param offset offset distance (positive to left of curve, negative to right)\n * @param result array to collect offset curves\n * @returns summed length of offset curves\n */\n public static appendXYOffsets(curves: AnyCurve | AnyCurve[] | undefined, offset: number, result: AnyCurve[]): number {\n let summedLengths = 0;\n if (curves instanceof CurvePrimitive) {\n const resultA = CurveChainWireOffsetContext.constructCurveXYOffset(Path.create(curves), offset);\n if (resultA) {\n summedLengths += this.sumLengths(resultA);\n result.push(resultA);\n }\n } else if (curves instanceof Loop || curves instanceof Path) {\n const resultA = CurveChainWireOffsetContext.constructCurveXYOffset(curves, offset);\n if (resultA) {\n summedLengths += this.sumLengths(resultA);\n result.push(resultA);\n }\n } else if (curves instanceof BagOfCurves) {\n for (const q of curves.children)\n summedLengths += this.appendXYOffsets(q, offset, result);\n } else if (Array.isArray(curves)) {\n for (const q of curves)\n summedLengths += this.appendXYOffsets(q, offset, result);\n }\n return summedLengths;\n }\n /**\n * Restructure curve fragments as Paths and Loops, and construct xy-offsets of the chains.\n * * If the inputs do not form Loop(s), the classification of offsets is suspect.\n * * For best offset results, the inputs should be parallel to the xy-plane.\n * * Chain formation is dependent upon input fragment order, as a greedy algorithm is employed.\n * @param fragments fragments to be chained and offset\n * @param offsetDistance offset distance, applied to both sides of each fragment to produce inside and outside xy-offset curves.\n * @param gapTolerance distance to be treated as \"effectively zero\" when joining head-to-tail\n * @returns object with named chains, insideOffsets, outsideOffsets\n */\n public static collectInsideAndOutsideXYOffsets(fragments: AnyCurve[], offsetDistance: number, gapTolerance: number): { insideOffsets: AnyCurve[], outsideOffsets: AnyCurve[], chains?: AnyChain } {\n const collector = new MultiChainCollector(gapTolerance, gapTolerance);\n for (const s of fragments) {\n collector.captureCurve(s);\n }\n const chains = collector.grabResult(true);\n const myOffsetA: CurveCollection[] = [];\n const myOffsetB: CurveCollection[] = [];\n const offsetLengthA = CurveOps.appendXYOffsets(chains, offsetDistance, myOffsetA);\n const offsetLengthB = CurveOps.appendXYOffsets(chains, -offsetDistance, myOffsetB);\n if (offsetLengthA > offsetLengthB) {\n return { outsideOffsets: myOffsetA, insideOffsets: myOffsetB, chains };\n } else {\n return { insideOffsets: myOffsetA, outsideOffsets: myOffsetB, chains };\n }\n }\n /**\n * Construct curves that are offset from a Path or Loop as viewed in xy-plane (ignoring z).\n * * The construction will remove \"some\" local effects of features smaller than the offset distance, but will not detect self intersection among widely separated edges.\n * @param curves base curves.\n * @param offsetDistanceOrOptions offset distance (positive to left of curve, negative to right) or options object.\n */\n public static constructCurveXYOffset(curves: Path | Loop, offsetDistanceOrOptions: number | OffsetOptions): CurveCollection | undefined {\n return CurveChainWireOffsetContext.constructCurveXYOffset(curves, offsetDistanceOrOptions);\n }\n /**\n * Create the offset of a single curve primitive as viewed in the xy-plane (ignoring z).\n * @param curve primitive to offset\n * @param offsetDistanceOrOptions offset distance (positive to left of curve, negative to right) or options object\n */\n public static createSingleOffsetPrimitiveXY(curve: CurvePrimitive, offsetDistanceOrOptions: number | OffsetOptions): CurvePrimitive | CurvePrimitive[] | undefined {\n return CurveChainWireOffsetContext.createSingleOffsetPrimitiveXY(curve, offsetDistanceOrOptions);\n }\n /**\n * Restructure curve fragments as Paths and Loops.\n * * Chain formation is dependent upon input fragment order, as a greedy algorithm is employed.\n * @param fragments fragments to be chained\n * @param gapTolerance distance to be treated as \"effectively zero\" when assembling fragments head-to-tail\n * @param planeTolerance tolerance for considering a closed chain to be planar. If undefined, only create Path. If defined, create Loops for closed chains within tolerance of a plane.\n * @returns chains, possibly wrapped in a [[BagOfCurves]].\n */\n public static collectChains(fragments: AnyCurve[], gapTolerance: number = Geometry.smallMetricDistance, planeTolerance?: number): AnyChain | undefined {\n const collector = new MultiChainCollector(gapTolerance, planeTolerance);\n for (const s of fragments) {\n collector.captureCurve(s);\n }\n return collector.grabResult(true);\n }\n /**\n * Restructure curve fragments, to be stroked and passed into the callback.\n * * Chain formation is dependent upon input fragment order, as a greedy algorithm is employed.\n * @param fragments fragments to be chained and stroked\n * @param announceChain callback to process each stroked Path and Loop\n * @param strokeOptions options for stroking the chains\n * @param gapTolerance distance to be treated as \"effectively zero\" when assembling fragments head-to-tail. Also used for removing duplicate points in the stroked chains.\n * @param _planeTolerance unused, pass undefined\n */\n public static collectChainsAsLineString3d(fragments: AnyCurve[], announceChain: (chainPoints: LineString3d) => void, strokeOptions?: StrokeOptions, gapTolerance: number = Geometry.smallMetricDistance, _planeTolerance?: number) {\n const collector = new MultiChainCollector(gapTolerance); // no planarity tolerance needed\n for (const s of fragments) {\n collector.captureCurve(s);\n }\n collector.announceChainsAsLineString3d(announceChain, strokeOptions);\n }\n /**\n * Compute the range of the curves in the local coordinates of a constructed localToWorld frame.\n * @param curves input geometry: curves or points.\n * @param localRange pre-allocated object to populate with the computed local range.\n * @param localToWorld optional pre-allocated object to populate with the computed frame.\n * @returns whether the frame was successfully computed.\n */\n public static computeLocalRange(curves: AnyCurve | MultiLineStringDataVariant, localRange: Range3d, localToWorld?: Transform): boolean {\n const builderData: any[] = [curves];\n if (localToWorld)\n builderData.push(localToWorld);\n localToWorld = FrameBuilder.createRightHandedFrame(Vector3d.unitZ(), ...builderData);\n if (!localToWorld)\n return false;\n const worldToLocal = localToWorld.inverse();\n localRange.setNull();\n if (Array.isArray(curves) || !(curves instanceof GeometryQuery))\n Range3d.createFromVariantData(curves, worldToLocal, localRange);\n else\n this.extendRange(localRange, curves, worldToLocal);\n return true;\n }\n /**\n * Check whether or not the curves are planar, and if so, return a localToWorld frame.\n * @param curves input geometry: curves or points.\n * @param options bundle of options.\n * @returns localToWorld frame `T` for coplanar curves, or undefined if they are not coplanar.\n * `T` satisfies:\n * * `T.origin` is in the plane.\n * * `T.matrix.columnZ()` is the plane unit normal (or its negative).\n * * `T.matrix.isRigid()` returns true.\n * * `T.inverse()` is worldToLocal; apply to input geometry to rotate it into the xy-plane.\n */\n public static isPlanar(curves: AnyCurve | MultiLineStringDataVariant, options?: PlanarColinearOptions): Transform | undefined {\n const localRange = Range3d.create();\n const localToWorld = options?.localToWorld ?? Transform.createIdentity();\n if (!this.computeLocalRange(curves, localRange, localToWorld))\n return undefined;\n const maxAltitude = options?.maxDeviation ?? Geometry.smallMetricDistance;\n return (localRange.zLength() <= Math.abs(maxAltitude)) ? localToWorld : undefined;\n }\n /**\n * Check whether or not the curves lie in a straight line, and if so, return a colinear ray.\n * * This test does not take curve traversal or point order into account.\n * @param curves input geometry: curves or points.\n * @param options bundle of options.\n * @returns ray colinear with input, or undefined if input is not colinear.\n */\n public static isColinear(curves: AnyCurve | MultiLineStringDataVariant, options?: PlanarColinearOptions): Ray3d | undefined {\n const localRange = Range3d.create();\n const localToWorld = options?.localToWorld ?? Transform.createIdentity();\n if (!this.computeLocalRange(curves, localRange, localToWorld))\n return undefined;\n const maxAltitude = Math.abs(options?.maxDeviation ?? Geometry.smallMetricDistance);\n if (localRange.zLength() > maxAltitude)\n return undefined; // non-planar\n\n const ray = options?.colinearRay ?? Ray3d.createZero();\n ray.origin.setFrom(localToWorld.origin);\n\n const xLength = localRange.xLength();\n const yLength = localRange.yLength();\n if (xLength <= maxAltitude && yLength <= maxAltitude) {\n ray.direction.setZero();\n return ray; // the input is essentially a point\n }\n if (yLength <= maxAltitude) {\n localToWorld.matrix.columnX(ray.direction);\n return ray; // the input lies along local x-axis\n }\n if (xLength <= maxAltitude) {\n localToWorld.matrix.columnY(ray.direction);\n return ray; // the input lies along local y-axis\n }\n if (!options?.xyColinear)\n return undefined; // non-colinear\n\n const angleTolerance = Math.abs(options?.radianTolerance ?? Geometry.smallAngleRadians);\n const verticalPlaneDeviation = Math.abs(localToWorld.matrix.columnDotXYZ(AxisIndex.Z, 0, 0, 1));\n if (verticalPlaneDeviation > angleTolerance) // cos(t + pi/2) = -sin(t) ~ -t for small t\n return undefined; // non-xy-colinear\n\n if (xLength > yLength)\n localToWorld.matrix.columnX(ray.direction);\n else\n localToWorld.matrix.columnY(ray.direction);\n ray.direction.z = 0.0;\n return ray; // xy-colinear (plane is vertical)\n }\n}\n"]}
|