@itwin/core-geometry 4.1.0-dev.4 → 4.1.0-dev.40
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 +32 -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.d.ts +1 -0
- package/lib/cjs/core-geometry.d.ts.map +1 -1
- package/lib/cjs/core-geometry.js +4 -1
- package/lib/cjs/core-geometry.js.map +1 -1
- package/lib/cjs/curve/Arc3d.d.ts +71 -86
- package/lib/cjs/curve/Arc3d.d.ts.map +1 -1
- package/lib/cjs/curve/Arc3d.js +110 -96
- package/lib/cjs/curve/Arc3d.js.map +1 -1
- package/lib/cjs/curve/ChainCollectorContext.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/CurveChain.js.map +1 -1
- package/lib/cjs/curve/CurveChainWithDistanceIndex.d.ts +61 -41
- package/lib/cjs/curve/CurveChainWithDistanceIndex.d.ts.map +1 -1
- package/lib/cjs/curve/CurveChainWithDistanceIndex.js +69 -46
- package/lib/cjs/curve/CurveChainWithDistanceIndex.js.map +1 -1
- package/lib/cjs/curve/CurveCollection.d.ts +73 -46
- package/lib/cjs/curve/CurveCollection.d.ts.map +1 -1
- package/lib/cjs/curve/CurveCollection.js +100 -64
- package/lib/cjs/curve/CurveCollection.js.map +1 -1
- package/lib/cjs/curve/CurveCurve.d.ts.map +1 -1
- package/lib/cjs/curve/CurveCurve.js.map +1 -1
- package/lib/cjs/curve/CurveCurveCloseApproachXY.js.map +1 -1
- package/lib/cjs/curve/CurveCurveIntersectXY.js.map +1 -1
- package/lib/cjs/curve/CurveCurveIntersectXYZ.js.map +1 -1
- package/lib/cjs/curve/CurveExtendMode.js.map +1 -1
- package/lib/cjs/curve/CurveFactory.js.map +1 -1
- package/lib/cjs/curve/CurveLocationDetail.d.ts +45 -46
- package/lib/cjs/curve/CurveLocationDetail.d.ts.map +1 -1
- package/lib/cjs/curve/CurveLocationDetail.js +39 -41
- package/lib/cjs/curve/CurveLocationDetail.js.map +1 -1
- package/lib/cjs/curve/CurvePrimitive.d.ts +138 -92
- package/lib/cjs/curve/CurvePrimitive.d.ts.map +1 -1
- package/lib/cjs/curve/CurvePrimitive.js +115 -75
- package/lib/cjs/curve/CurvePrimitive.js.map +1 -1
- package/lib/cjs/curve/CurveProcessor.js.map +1 -1
- package/lib/cjs/curve/CurveWireMomentsXYZ.js.map +1 -1
- package/lib/cjs/curve/GeometryQuery.d.ts +26 -20
- package/lib/cjs/curve/GeometryQuery.d.ts.map +1 -1
- package/lib/cjs/curve/GeometryQuery.js +11 -9
- package/lib/cjs/curve/GeometryQuery.js.map +1 -1
- package/lib/cjs/curve/LineSegment3d.d.ts +38 -27
- package/lib/cjs/curve/LineSegment3d.d.ts.map +1 -1
- package/lib/cjs/curve/LineSegment3d.js +77 -39
- package/lib/cjs/curve/LineSegment3d.js.map +1 -1
- package/lib/cjs/curve/LineString3d.d.ts +70 -51
- package/lib/cjs/curve/LineString3d.d.ts.map +1 -1
- package/lib/cjs/curve/LineString3d.js +120 -71
- package/lib/cjs/curve/LineString3d.js.map +1 -1
- package/lib/cjs/curve/Loop.d.ts +7 -5
- package/lib/cjs/curve/Loop.d.ts.map +1 -1
- package/lib/cjs/curve/Loop.js +18 -6
- package/lib/cjs/curve/Loop.js.map +1 -1
- package/lib/cjs/curve/ParityRegion.d.ts +7 -7
- package/lib/cjs/curve/ParityRegion.d.ts.map +1 -1
- package/lib/cjs/curve/ParityRegion.js +19 -11
- package/lib/cjs/curve/ParityRegion.js.map +1 -1
- package/lib/cjs/curve/Path.d.ts +6 -6
- package/lib/cjs/curve/Path.d.ts.map +1 -1
- package/lib/cjs/curve/Path.js +15 -9
- package/lib/cjs/curve/Path.js.map +1 -1
- package/lib/cjs/curve/PointString3d.js.map +1 -1
- package/lib/cjs/curve/ProxyCurve.d.ts +4 -6
- package/lib/cjs/curve/ProxyCurve.d.ts.map +1 -1
- package/lib/cjs/curve/ProxyCurve.js +7 -7
- 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.d.ts +14 -13
- package/lib/cjs/curve/Query/StrokeCountMap.d.ts.map +1 -1
- package/lib/cjs/curve/Query/StrokeCountMap.js +9 -8
- package/lib/cjs/curve/Query/StrokeCountMap.js.map +1 -1
- package/lib/cjs/curve/RegionMomentsXY.js.map +1 -1
- package/lib/cjs/curve/RegionOps.d.ts +69 -47
- package/lib/cjs/curve/RegionOps.d.ts.map +1 -1
- package/lib/cjs/curve/RegionOps.js +70 -47
- package/lib/cjs/curve/RegionOps.js.map +1 -1
- package/lib/cjs/curve/RegionOpsClassificationSweeps.js.map +1 -1
- package/lib/cjs/curve/StrokeOptions.d.ts +29 -21
- package/lib/cjs/curve/StrokeOptions.d.ts.map +1 -1
- package/lib/cjs/curve/StrokeOptions.js +50 -24
- package/lib/cjs/curve/StrokeOptions.js.map +1 -1
- package/lib/cjs/curve/UnionRegion.d.ts +6 -5
- package/lib/cjs/curve/UnionRegion.d.ts.map +1 -1
- package/lib/cjs/curve/UnionRegion.js +17 -8
- package/lib/cjs/curve/UnionRegion.js.map +1 -1
- package/lib/cjs/curve/internalContexts/AppendPlaneIntersectionStrokeHandler.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/CurveLengthContext.js.map +1 -1
- package/lib/cjs/curve/internalContexts/CurveOffsetXYHandler.js.map +1 -1
- package/lib/cjs/curve/internalContexts/GapSearchContext.d.ts +2 -1
- package/lib/cjs/curve/internalContexts/GapSearchContext.d.ts.map +1 -1
- package/lib/cjs/curve/internalContexts/GapSearchContext.js +6 -2
- package/lib/cjs/curve/internalContexts/GapSearchContext.js.map +1 -1
- package/lib/cjs/curve/internalContexts/MultiChainCollector.d.ts +4 -0
- package/lib/cjs/curve/internalContexts/MultiChainCollector.d.ts.map +1 -1
- package/lib/cjs/curve/internalContexts/MultiChainCollector.js +5 -2
- 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.d.ts +14 -8
- package/lib/cjs/curve/internalContexts/PlaneAltitudeRangeContext.d.ts.map +1 -1
- package/lib/cjs/curve/internalContexts/PlaneAltitudeRangeContext.js +14 -8
- package/lib/cjs/curve/internalContexts/PlaneAltitudeRangeContext.js.map +1 -1
- package/lib/cjs/curve/internalContexts/PolygonOffsetContext.d.ts +56 -34
- package/lib/cjs/curve/internalContexts/PolygonOffsetContext.d.ts.map +1 -1
- package/lib/cjs/curve/internalContexts/PolygonOffsetContext.js +152 -87
- package/lib/cjs/curve/internalContexts/PolygonOffsetContext.js.map +1 -1
- package/lib/cjs/curve/internalContexts/SumLengthsContext.d.ts.map +1 -1
- package/lib/cjs/curve/internalContexts/SumLengthsContext.js +4 -1
- package/lib/cjs/curve/internalContexts/SumLengthsContext.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.d.ts +2 -2
- package/lib/cjs/geometry3d/Matrix3d.js +2 -2
- 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.d.ts +36 -32
- package/lib/cjs/geometry3d/Plane3dByOriginAndVectors.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Plane3dByOriginAndVectors.js +35 -32
- 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.d.ts +133 -93
- package/lib/cjs/geometry3d/Range.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Range.js +296 -144
- package/lib/cjs/geometry3d/Range.js.map +1 -1
- package/lib/cjs/geometry3d/Ray3d.d.ts.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/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/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/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/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/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.d.ts +1 -0
- package/lib/esm/core-geometry.d.ts.map +1 -1
- package/lib/esm/core-geometry.js +2 -0
- package/lib/esm/core-geometry.js.map +1 -1
- package/lib/esm/curve/Arc3d.d.ts +71 -86
- package/lib/esm/curve/Arc3d.d.ts.map +1 -1
- package/lib/esm/curve/Arc3d.js +110 -96
- package/lib/esm/curve/Arc3d.js.map +1 -1
- package/lib/esm/curve/ChainCollectorContext.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/CurveChain.js.map +1 -1
- package/lib/esm/curve/CurveChainWithDistanceIndex.d.ts +61 -41
- package/lib/esm/curve/CurveChainWithDistanceIndex.d.ts.map +1 -1
- package/lib/esm/curve/CurveChainWithDistanceIndex.js +69 -46
- package/lib/esm/curve/CurveChainWithDistanceIndex.js.map +1 -1
- package/lib/esm/curve/CurveCollection.d.ts +73 -46
- package/lib/esm/curve/CurveCollection.d.ts.map +1 -1
- package/lib/esm/curve/CurveCollection.js +100 -64
- package/lib/esm/curve/CurveCollection.js.map +1 -1
- package/lib/esm/curve/CurveCurve.d.ts.map +1 -1
- package/lib/esm/curve/CurveCurve.js.map +1 -1
- package/lib/esm/curve/CurveCurveCloseApproachXY.js.map +1 -1
- package/lib/esm/curve/CurveCurveIntersectXY.js.map +1 -1
- package/lib/esm/curve/CurveCurveIntersectXYZ.js.map +1 -1
- package/lib/esm/curve/CurveExtendMode.js.map +1 -1
- package/lib/esm/curve/CurveFactory.js.map +1 -1
- package/lib/esm/curve/CurveLocationDetail.d.ts +45 -46
- package/lib/esm/curve/CurveLocationDetail.d.ts.map +1 -1
- package/lib/esm/curve/CurveLocationDetail.js +39 -41
- package/lib/esm/curve/CurveLocationDetail.js.map +1 -1
- package/lib/esm/curve/CurvePrimitive.d.ts +138 -92
- package/lib/esm/curve/CurvePrimitive.d.ts.map +1 -1
- package/lib/esm/curve/CurvePrimitive.js +115 -75
- package/lib/esm/curve/CurvePrimitive.js.map +1 -1
- package/lib/esm/curve/CurveProcessor.js.map +1 -1
- package/lib/esm/curve/CurveWireMomentsXYZ.js.map +1 -1
- package/lib/esm/curve/GeometryQuery.d.ts +26 -20
- package/lib/esm/curve/GeometryQuery.d.ts.map +1 -1
- package/lib/esm/curve/GeometryQuery.js +11 -9
- package/lib/esm/curve/GeometryQuery.js.map +1 -1
- package/lib/esm/curve/LineSegment3d.d.ts +38 -27
- package/lib/esm/curve/LineSegment3d.d.ts.map +1 -1
- package/lib/esm/curve/LineSegment3d.js +77 -39
- package/lib/esm/curve/LineSegment3d.js.map +1 -1
- package/lib/esm/curve/LineString3d.d.ts +70 -51
- package/lib/esm/curve/LineString3d.d.ts.map +1 -1
- package/lib/esm/curve/LineString3d.js +120 -71
- package/lib/esm/curve/LineString3d.js.map +1 -1
- package/lib/esm/curve/Loop.d.ts +7 -5
- package/lib/esm/curve/Loop.d.ts.map +1 -1
- package/lib/esm/curve/Loop.js +18 -6
- package/lib/esm/curve/Loop.js.map +1 -1
- package/lib/esm/curve/ParityRegion.d.ts +7 -7
- package/lib/esm/curve/ParityRegion.d.ts.map +1 -1
- package/lib/esm/curve/ParityRegion.js +19 -11
- package/lib/esm/curve/ParityRegion.js.map +1 -1
- package/lib/esm/curve/Path.d.ts +6 -6
- package/lib/esm/curve/Path.d.ts.map +1 -1
- package/lib/esm/curve/Path.js +15 -9
- package/lib/esm/curve/Path.js.map +1 -1
- package/lib/esm/curve/PointString3d.js.map +1 -1
- package/lib/esm/curve/ProxyCurve.d.ts +4 -6
- package/lib/esm/curve/ProxyCurve.d.ts.map +1 -1
- package/lib/esm/curve/ProxyCurve.js +7 -7
- 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.d.ts +14 -13
- package/lib/esm/curve/Query/StrokeCountMap.d.ts.map +1 -1
- package/lib/esm/curve/Query/StrokeCountMap.js +9 -8
- package/lib/esm/curve/Query/StrokeCountMap.js.map +1 -1
- package/lib/esm/curve/RegionMomentsXY.js.map +1 -1
- package/lib/esm/curve/RegionOps.d.ts +69 -47
- package/lib/esm/curve/RegionOps.d.ts.map +1 -1
- package/lib/esm/curve/RegionOps.js +70 -47
- package/lib/esm/curve/RegionOps.js.map +1 -1
- package/lib/esm/curve/RegionOpsClassificationSweeps.js.map +1 -1
- package/lib/esm/curve/StrokeOptions.d.ts +29 -21
- package/lib/esm/curve/StrokeOptions.d.ts.map +1 -1
- package/lib/esm/curve/StrokeOptions.js +50 -24
- package/lib/esm/curve/StrokeOptions.js.map +1 -1
- package/lib/esm/curve/UnionRegion.d.ts +6 -5
- package/lib/esm/curve/UnionRegion.d.ts.map +1 -1
- package/lib/esm/curve/UnionRegion.js +17 -8
- package/lib/esm/curve/UnionRegion.js.map +1 -1
- package/lib/esm/curve/internalContexts/AppendPlaneIntersectionStrokeHandler.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/CurveLengthContext.js.map +1 -1
- package/lib/esm/curve/internalContexts/CurveOffsetXYHandler.js.map +1 -1
- package/lib/esm/curve/internalContexts/GapSearchContext.d.ts +2 -1
- package/lib/esm/curve/internalContexts/GapSearchContext.d.ts.map +1 -1
- package/lib/esm/curve/internalContexts/GapSearchContext.js +6 -2
- package/lib/esm/curve/internalContexts/GapSearchContext.js.map +1 -1
- package/lib/esm/curve/internalContexts/MultiChainCollector.d.ts +4 -0
- package/lib/esm/curve/internalContexts/MultiChainCollector.d.ts.map +1 -1
- package/lib/esm/curve/internalContexts/MultiChainCollector.js +5 -2
- 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.d.ts +14 -8
- package/lib/esm/curve/internalContexts/PlaneAltitudeRangeContext.d.ts.map +1 -1
- package/lib/esm/curve/internalContexts/PlaneAltitudeRangeContext.js +14 -8
- package/lib/esm/curve/internalContexts/PlaneAltitudeRangeContext.js.map +1 -1
- package/lib/esm/curve/internalContexts/PolygonOffsetContext.d.ts +56 -34
- package/lib/esm/curve/internalContexts/PolygonOffsetContext.d.ts.map +1 -1
- package/lib/esm/curve/internalContexts/PolygonOffsetContext.js +152 -87
- package/lib/esm/curve/internalContexts/PolygonOffsetContext.js.map +1 -1
- package/lib/esm/curve/internalContexts/SumLengthsContext.d.ts.map +1 -1
- package/lib/esm/curve/internalContexts/SumLengthsContext.js +4 -1
- package/lib/esm/curve/internalContexts/SumLengthsContext.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.d.ts +2 -2
- package/lib/esm/geometry3d/Matrix3d.js +2 -2
- 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.d.ts +36 -32
- package/lib/esm/geometry3d/Plane3dByOriginAndVectors.d.ts.map +1 -1
- package/lib/esm/geometry3d/Plane3dByOriginAndVectors.js +35 -32
- 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.d.ts +133 -93
- package/lib/esm/geometry3d/Range.d.ts.map +1 -1
- package/lib/esm/geometry3d/Range.js +296 -144
- package/lib/esm/geometry3d/Range.js.map +1 -1
- package/lib/esm/geometry3d/Ray3d.d.ts.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/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/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/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/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/XYParitySearchContext.js.map +1 -1
- package/package.json +3 -3
|
@@ -18,36 +18,38 @@ import { LineString3d } from "./LineString3d";
|
|
|
18
18
|
import { StrokeOptions } from "./StrokeOptions";
|
|
19
19
|
/**
|
|
20
20
|
* A LineSegment3d is:
|
|
21
|
-
*
|
|
22
21
|
* * A 3d line segment represented by its start and end coordinates
|
|
23
22
|
* * startPoint
|
|
24
23
|
* * endPoint
|
|
25
|
-
* * The segment is parameterized with fraction 0 at the start and fraction 1 at the end, i.e.
|
|
24
|
+
* * The segment is parameterized with fraction 0 at the start and fraction 1 at the end, i.e. each of these
|
|
25
|
+
* equivalent forms maps fraction `f` to a point `X(f)`:
|
|
26
26
|
* ```
|
|
27
27
|
* equation
|
|
28
|
-
* X(f) = P_0 + f
|
|
29
|
-
* X(f) = (1-f)*P_0
|
|
28
|
+
* X(f) = P_0 + f*(P_1 - P_0)\newline
|
|
29
|
+
* X(f) = (1-f)*P_0 + f*P_1
|
|
30
30
|
* ```
|
|
31
31
|
* @public
|
|
32
32
|
*/
|
|
33
33
|
export declare class LineSegment3d extends CurvePrimitive implements BeJSONFunctions {
|
|
34
34
|
/** String name for schema properties */
|
|
35
35
|
readonly curvePrimitiveType = "lineSegment";
|
|
36
|
-
/**
|
|
36
|
+
/** Test if `other` is of class `LineSegment3d` */
|
|
37
37
|
isSameGeometryClass(other: GeometryQuery): boolean;
|
|
38
|
+
/** Start point of the segment */
|
|
38
39
|
private _point0;
|
|
40
|
+
/** End point of the segment */
|
|
39
41
|
private _point1;
|
|
40
|
-
/**
|
|
41
|
-
*
|
|
42
|
+
/**
|
|
43
|
+
* Return REFERENCE to the start point of this segment.
|
|
44
|
+
* * This is distinct from the `CurvePrimitive` abstract method `startPoint()` which creates a returned point.
|
|
42
45
|
*/
|
|
43
46
|
get point0Ref(): Point3d;
|
|
44
|
-
/** Return REFERENCE to the end point of this segment.
|
|
45
|
-
* * (This is distinct from the `CurvePrimitive` abstract method `endPoint()` which creates a returned point
|
|
46
|
-
*/
|
|
47
|
-
get point1Ref(): Point3d;
|
|
48
47
|
/**
|
|
49
|
-
*
|
|
48
|
+
* Return REFERENCE to the end point of this segment.
|
|
49
|
+
* * This is distinct from the `CurvePrimitive` abstract method `endPoint()` which creates a returned point.
|
|
50
50
|
*/
|
|
51
|
+
get point1Ref(): Point3d;
|
|
52
|
+
/** A LineSegment3d extends along its infinite line. */
|
|
51
53
|
get isExtensibleFractionSpace(): boolean;
|
|
52
54
|
/**
|
|
53
55
|
* CAPTURE point references as a `LineSegment3d`
|
|
@@ -59,15 +61,16 @@ export declare class LineSegment3d extends CurvePrimitive implements BeJSONFunct
|
|
|
59
61
|
setRefs(point0: Point3d, point1: Point3d): void;
|
|
60
62
|
/** Set the start and endpoints by cloning the input parameters. */
|
|
61
63
|
set(point0: Point3d, point1: Point3d): void;
|
|
62
|
-
/**
|
|
64
|
+
/** Copy (clone) data from other */
|
|
63
65
|
setFrom(other: LineSegment3d): void;
|
|
64
|
-
/** Return a (clone of) the start point
|
|
66
|
+
/** Return a (clone of) the start point (This is NOT a reference to the stored start point) */
|
|
65
67
|
startPoint(result?: Point3d): Point3d;
|
|
66
|
-
/** Return a (clone of) the end point
|
|
68
|
+
/** Return a (clone of) the end point (This is NOT a reference to the stored end point) */
|
|
67
69
|
endPoint(result?: Point3d): Point3d;
|
|
68
70
|
/** Return the point and derivative vector at fractional position along the line segment. */
|
|
69
71
|
fractionToPointAndDerivative(fraction: number, result?: Ray3d): Ray3d;
|
|
70
|
-
/**
|
|
72
|
+
/**
|
|
73
|
+
* Construct a plane with
|
|
71
74
|
* * origin at the fractional position along the line segment
|
|
72
75
|
* * x axis is the first derivative, i.e. along the line segment
|
|
73
76
|
* * y axis is the second derivative, i.e. 000
|
|
@@ -81,7 +84,8 @@ export declare class LineSegment3d extends CurvePrimitive implements BeJSONFunct
|
|
|
81
84
|
static create(point0: Point3d, point1: Point3d, result?: LineSegment3d): LineSegment3d;
|
|
82
85
|
/** Create with start and end points. The point contents are CAPTURED into the result */
|
|
83
86
|
static createCapture(point0: Point3d, point1: Point3d): LineSegment3d;
|
|
84
|
-
/**
|
|
87
|
+
/**
|
|
88
|
+
* Create a LineSegment3d from xy coordinates of start and end, with common z.
|
|
85
89
|
* @param x0 start point x coordinate.
|
|
86
90
|
* @param y0 start point y coordinate.
|
|
87
91
|
* @param x1 end point x coordinate.
|
|
@@ -90,7 +94,8 @@ export declare class LineSegment3d extends CurvePrimitive implements BeJSONFunct
|
|
|
90
94
|
* @param result optional existing LineSegment to be reinitialized.
|
|
91
95
|
*/
|
|
92
96
|
static createXYXY(x0: number, y0: number, x1: number, y1: number, z?: number, result?: LineSegment3d): LineSegment3d;
|
|
93
|
-
/**
|
|
97
|
+
/**
|
|
98
|
+
* Create a LineSegment3d from xy coordinates of start and end, with common z.
|
|
94
99
|
* @param x0 start point x coordinate.
|
|
95
100
|
* @param y0 start point y coordinate.
|
|
96
101
|
* @param x1 end point x coordinate.
|
|
@@ -110,16 +115,18 @@ export declare class LineSegment3d extends CurvePrimitive implements BeJSONFunct
|
|
|
110
115
|
/**
|
|
111
116
|
* Returns a curve location detail with both xyz and fractional coordinates of the closest point.
|
|
112
117
|
* @param spacePoint point in space
|
|
113
|
-
* @param extend if false, only return points within the bounded line segment. If true, allow the point to be on
|
|
118
|
+
* @param extend if false, only return points within the bounded line segment. If true, allow the point to be on
|
|
119
|
+
* the unbounded line that contains the bounded segment.
|
|
114
120
|
*/
|
|
115
121
|
closestPoint(spacePoint: Point3d, extend: VariantCurveExtendParameter, result?: CurveLocationDetail): CurveLocationDetail;
|
|
116
|
-
/**
|
|
122
|
+
/** Swap the endpoint references. */
|
|
117
123
|
reverseInPlace(): void;
|
|
118
124
|
/** Transform the two endpoints of this LinSegment. */
|
|
119
125
|
tryTransformInPlace(transform: Transform): boolean;
|
|
120
126
|
/** Test if both endpoints are in a plane (within tolerance) */
|
|
121
127
|
isInPlane(plane: PlaneAltitudeEvaluator): boolean;
|
|
122
|
-
/**
|
|
128
|
+
/**
|
|
129
|
+
* Compute points of simple (transverse) with a plane.
|
|
123
130
|
* * Use isInPlane to test if the line segment is completely in the plane.
|
|
124
131
|
*/
|
|
125
132
|
appendPlaneIntersectionPoints(plane: PlaneAltitudeEvaluator, result: CurveLocationDetail[]): number;
|
|
@@ -156,19 +163,20 @@ export declare class LineSegment3d extends CurvePrimitive implements BeJSONFunct
|
|
|
156
163
|
/** Emit strokes to caller-supplied handler */
|
|
157
164
|
emitStrokableParts(handler: IStrokeHandler, options?: StrokeOptions): void;
|
|
158
165
|
/**
|
|
159
|
-
*
|
|
166
|
+
* Return the stroke count required for given options.
|
|
160
167
|
* @param options StrokeOptions that determine count
|
|
161
168
|
*/
|
|
162
169
|
computeStrokeCountForOptions(options?: StrokeOptions): number;
|
|
163
|
-
/** Second step of double dispatch:
|
|
170
|
+
/** Second step of double dispatch: call `handler.handleLineSegment3d(this)` */
|
|
164
171
|
dispatchToGeometryHandler(handler: GeometryHandler): any;
|
|
165
172
|
/**
|
|
166
173
|
* Find intervals of this curve primitive that are interior to a clipper
|
|
167
174
|
* @param clipper clip structure (e.g. clip planes)
|
|
168
|
-
* @param announce function to be called announcing fractional intervals
|
|
175
|
+
* @param announce function to be called announcing fractional intervals `announce(fraction0, fraction1, curvePrimitive)`
|
|
169
176
|
*/
|
|
170
177
|
announceClipIntervals(clipper: Clipper, announce?: AnnounceNumberNumberCurvePrimitive): boolean;
|
|
171
|
-
/**
|
|
178
|
+
/**
|
|
179
|
+
* Return (if possible) a curve primitive which is a portion of this curve.
|
|
172
180
|
* @param fractionA [in] start fraction
|
|
173
181
|
* @param fractionB [in] end fraction
|
|
174
182
|
*/
|
|
@@ -183,10 +191,13 @@ export declare class LineSegment3d extends CurvePrimitive implements BeJSONFunct
|
|
|
183
191
|
* @param offsetDistanceOrOptions offset distance (positive to left of the instance curve), or options object
|
|
184
192
|
*/
|
|
185
193
|
constructOffsetXY(offsetDistanceOrOptions: number | OffsetOptions): CurvePrimitive | CurvePrimitive[] | undefined;
|
|
186
|
-
/**
|
|
194
|
+
/**
|
|
195
|
+
* Project instance geometry (via dispatch) onto the given ray, and return the extreme fractional parameters of
|
|
196
|
+
* projection.
|
|
187
197
|
* @param ray ray onto which the instance is projected. A `Vector3d` is treated as a `Ray3d` with zero origin.
|
|
188
198
|
* @param lowHigh optional receiver for output
|
|
189
|
-
* @returns range of fractional projection parameters onto the ray, where 0.0 is start of the ray and 1.0 is the
|
|
199
|
+
* @returns range of fractional projection parameters onto the ray, where 0.0 is start of the ray and 1.0 is the
|
|
200
|
+
* end of the ray.
|
|
190
201
|
*/
|
|
191
202
|
projectedParameterRange(ray: Vector3d | Ray3d, lowHigh?: Range1d): Range1d | undefined;
|
|
192
203
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LineSegment3d.d.ts","sourceRoot":"","sources":["../../../src/curve/LineSegment3d.ts"],"names":[],"mappings":"AAKA;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAAE,eAAe,EAAY,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAChF,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAChF,OAAO,EAAE,yBAAyB,EAAE,MAAM,yCAAyC,CAAC;AACpF,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,C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,MAAM,GAAG,aAAa;IAGtF;;;OAGG;IACa,qBAAqB,CAAC,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,SAAS,GAAG,OAAO;IAgB3G;;;OAGG;IACa,iBAAiB,CAC/B,uBAAuB,EAAE,MAAM,GAAG,aAAa,GAC9C,cAAc,GAAG,cAAc,EAAE,GAAG,SAAS;IAWhD;;;;;;;OAOG;IACa,uBAAuB,CAAC,GAAG,EAAE,QAAQ,GAAG,KAAK,EAAE,OAAO,CAAC,EAAE,OAAO,GAAG,OAAO,GAAG,SAAS;CAGvG"}
|
|
@@ -16,33 +16,41 @@ import { OffsetOptions } from "./internalContexts/PolygonOffsetContext";
|
|
|
16
16
|
/* eslint-disable @typescript-eslint/naming-convention, no-empty */
|
|
17
17
|
/**
|
|
18
18
|
* A LineSegment3d is:
|
|
19
|
-
*
|
|
20
19
|
* * A 3d line segment represented by its start and end coordinates
|
|
21
20
|
* * startPoint
|
|
22
21
|
* * endPoint
|
|
23
|
-
* * The segment is parameterized with fraction 0 at the start and fraction 1 at the end, i.e.
|
|
22
|
+
* * The segment is parameterized with fraction 0 at the start and fraction 1 at the end, i.e. each of these
|
|
23
|
+
* equivalent forms maps fraction `f` to a point `X(f)`:
|
|
24
24
|
* ```
|
|
25
25
|
* equation
|
|
26
|
-
* X(f) = P_0 + f
|
|
27
|
-
* X(f) = (1-f)*P_0
|
|
26
|
+
* X(f) = P_0 + f*(P_1 - P_0)\newline
|
|
27
|
+
* X(f) = (1-f)*P_0 + f*P_1
|
|
28
28
|
* ```
|
|
29
29
|
* @public
|
|
30
30
|
*/
|
|
31
31
|
export class LineSegment3d extends CurvePrimitive {
|
|
32
|
-
/**
|
|
33
|
-
isSameGeometryClass(other) {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
* * (This is distinct from the `CurvePrimitive` abstract method `endPoint()` which creates a returned point
|
|
32
|
+
/** Test if `other` is of class `LineSegment3d` */
|
|
33
|
+
isSameGeometryClass(other) {
|
|
34
|
+
return other instanceof LineSegment3d;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Return REFERENCE to the start point of this segment.
|
|
38
|
+
* * This is distinct from the `CurvePrimitive` abstract method `startPoint()` which creates a returned point.
|
|
40
39
|
*/
|
|
41
|
-
get
|
|
40
|
+
get point0Ref() {
|
|
41
|
+
return this._point0;
|
|
42
|
+
}
|
|
42
43
|
/**
|
|
43
|
-
*
|
|
44
|
+
* Return REFERENCE to the end point of this segment.
|
|
45
|
+
* * This is distinct from the `CurvePrimitive` abstract method `endPoint()` which creates a returned point.
|
|
44
46
|
*/
|
|
45
|
-
get
|
|
47
|
+
get point1Ref() {
|
|
48
|
+
return this._point1;
|
|
49
|
+
}
|
|
50
|
+
/** A LineSegment3d extends along its infinite line. */
|
|
51
|
+
get isExtensibleFractionSpace() {
|
|
52
|
+
return true;
|
|
53
|
+
}
|
|
46
54
|
/**
|
|
47
55
|
* CAPTURE point references as a `LineSegment3d`
|
|
48
56
|
* @param point0
|
|
@@ -56,12 +64,21 @@ export class LineSegment3d extends CurvePrimitive {
|
|
|
56
64
|
this._point1 = point1;
|
|
57
65
|
}
|
|
58
66
|
/** Set the start and endpoints by capturing input references. */
|
|
59
|
-
setRefs(point0, point1) {
|
|
67
|
+
setRefs(point0, point1) {
|
|
68
|
+
this._point0 = point0;
|
|
69
|
+
this._point1 = point1;
|
|
70
|
+
}
|
|
60
71
|
/** Set the start and endpoints by cloning the input parameters. */
|
|
61
|
-
set(point0, point1) {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
72
|
+
set(point0, point1) {
|
|
73
|
+
this._point0 = point0.clone();
|
|
74
|
+
this._point1 = point1.clone();
|
|
75
|
+
}
|
|
76
|
+
/** Copy (clone) data from other */
|
|
77
|
+
setFrom(other) {
|
|
78
|
+
this._point0.setFrom(other._point0);
|
|
79
|
+
this._point1.setFrom(other._point1);
|
|
80
|
+
}
|
|
81
|
+
/** Return a (clone of) the start point (This is NOT a reference to the stored start point) */
|
|
65
82
|
startPoint(result) {
|
|
66
83
|
if (result) {
|
|
67
84
|
result.setFrom(this._point0);
|
|
@@ -69,7 +86,7 @@ export class LineSegment3d extends CurvePrimitive {
|
|
|
69
86
|
}
|
|
70
87
|
return this._point0.clone();
|
|
71
88
|
}
|
|
72
|
-
/** Return a (clone of) the end point
|
|
89
|
+
/** Return a (clone of) the end point (This is NOT a reference to the stored end point) */
|
|
73
90
|
endPoint(result) {
|
|
74
91
|
if (result) {
|
|
75
92
|
result.setFrom(this._point1);
|
|
@@ -84,7 +101,8 @@ export class LineSegment3d extends CurvePrimitive {
|
|
|
84
101
|
this._point0.interpolate(fraction, this._point1, result.origin);
|
|
85
102
|
return result;
|
|
86
103
|
}
|
|
87
|
-
/**
|
|
104
|
+
/**
|
|
105
|
+
* Construct a plane with
|
|
88
106
|
* * origin at the fractional position along the line segment
|
|
89
107
|
* * x axis is the first derivative, i.e. along the line segment
|
|
90
108
|
* * y axis is the second derivative, i.e. 000
|
|
@@ -97,7 +115,9 @@ export class LineSegment3d extends CurvePrimitive {
|
|
|
97
115
|
return result;
|
|
98
116
|
}
|
|
99
117
|
/** Clone the LineSegment3d */
|
|
100
|
-
clone() {
|
|
118
|
+
clone() {
|
|
119
|
+
return LineSegment3d.create(this._point0, this._point1);
|
|
120
|
+
}
|
|
101
121
|
/** Clone and apply transform to the clone. */
|
|
102
122
|
cloneTransformed(transform) {
|
|
103
123
|
const c = this.clone();
|
|
@@ -116,7 +136,8 @@ export class LineSegment3d extends CurvePrimitive {
|
|
|
116
136
|
static createCapture(point0, point1) {
|
|
117
137
|
return new LineSegment3d(point0, point1);
|
|
118
138
|
}
|
|
119
|
-
/**
|
|
139
|
+
/**
|
|
140
|
+
* Create a LineSegment3d from xy coordinates of start and end, with common z.
|
|
120
141
|
* @param x0 start point x coordinate.
|
|
121
142
|
* @param y0 start point y coordinate.
|
|
122
143
|
* @param x1 end point x coordinate.
|
|
@@ -132,7 +153,8 @@ export class LineSegment3d extends CurvePrimitive {
|
|
|
132
153
|
}
|
|
133
154
|
return new LineSegment3d(Point3d.create(x0, y0, z), Point3d.create(x1, y1, z));
|
|
134
155
|
}
|
|
135
|
-
/**
|
|
156
|
+
/**
|
|
157
|
+
* Create a LineSegment3d from xy coordinates of start and end, with common z.
|
|
136
158
|
* @param x0 start point x coordinate.
|
|
137
159
|
* @param y0 start point y coordinate.
|
|
138
160
|
* @param x1 end point x coordinate.
|
|
@@ -149,19 +171,26 @@ export class LineSegment3d extends CurvePrimitive {
|
|
|
149
171
|
return new LineSegment3d(Point3d.create(x0, y0, z0), Point3d.create(x1, y1, z1));
|
|
150
172
|
}
|
|
151
173
|
/** Return the point at fractional position along the line segment. */
|
|
152
|
-
fractionToPoint(fraction, result) {
|
|
174
|
+
fractionToPoint(fraction, result) {
|
|
175
|
+
return this._point0.interpolate(fraction, this._point1, result);
|
|
176
|
+
}
|
|
153
177
|
/** Return the length of the segment. */
|
|
154
|
-
curveLength() {
|
|
178
|
+
curveLength() {
|
|
179
|
+
return this._point0.distance(this._point1);
|
|
180
|
+
}
|
|
155
181
|
/** Return the length of the partial segment between fractions. */
|
|
156
182
|
curveLengthBetweenFractions(fraction0, fraction1) {
|
|
157
183
|
return Math.abs(fraction1 - fraction0) * this._point0.distance(this._point1);
|
|
158
184
|
}
|
|
159
185
|
/** Return the length of the segment. */
|
|
160
|
-
quickLength() {
|
|
186
|
+
quickLength() {
|
|
187
|
+
return this.curveLength();
|
|
188
|
+
}
|
|
161
189
|
/**
|
|
162
190
|
* Returns a curve location detail with both xyz and fractional coordinates of the closest point.
|
|
163
191
|
* @param spacePoint point in space
|
|
164
|
-
* @param extend if false, only return points within the bounded line segment. If true, allow the point to be on
|
|
192
|
+
* @param extend if false, only return points within the bounded line segment. If true, allow the point to be on
|
|
193
|
+
* the unbounded line that contains the bounded segment.
|
|
165
194
|
*/
|
|
166
195
|
closestPoint(spacePoint, extend, result) {
|
|
167
196
|
let fraction = spacePoint.fractionOfProjectionToLine(this._point0, this._point1, 0.0);
|
|
@@ -175,7 +204,7 @@ export class LineSegment3d extends CurvePrimitive {
|
|
|
175
204
|
result.a = result.point.distance(spacePoint);
|
|
176
205
|
return result;
|
|
177
206
|
}
|
|
178
|
-
/**
|
|
207
|
+
/** Swap the endpoint references. */
|
|
179
208
|
reverseInPlace() {
|
|
180
209
|
const a = this._point0;
|
|
181
210
|
this._point0 = this._point1;
|
|
@@ -192,7 +221,8 @@ export class LineSegment3d extends CurvePrimitive {
|
|
|
192
221
|
return Geometry.isSmallMetricDistance(plane.altitude(this._point0))
|
|
193
222
|
&& Geometry.isSmallMetricDistance(plane.altitude(this._point1));
|
|
194
223
|
}
|
|
195
|
-
/**
|
|
224
|
+
/**
|
|
225
|
+
* Compute points of simple (transverse) with a plane.
|
|
196
226
|
* * Use isInPlane to test if the line segment is completely in the plane.
|
|
197
227
|
*/
|
|
198
228
|
appendPlaneIntersectionPoints(plane, result) {
|
|
@@ -250,12 +280,16 @@ export class LineSegment3d extends CurvePrimitive {
|
|
|
250
280
|
}
|
|
251
281
|
}
|
|
252
282
|
/** A simple line segment's fraction and distance are proportional. */
|
|
253
|
-
getFractionToDistanceScale() {
|
|
283
|
+
getFractionToDistanceScale() {
|
|
284
|
+
return this.curveLength();
|
|
285
|
+
}
|
|
254
286
|
/**
|
|
255
287
|
* Place the lineSegment3d start and points in a json object
|
|
256
288
|
* @return {*} [[x,y,z],[x,y,z]]
|
|
257
289
|
*/
|
|
258
|
-
toJSON() {
|
|
290
|
+
toJSON() {
|
|
291
|
+
return [this._point0.toJSON(), this._point1.toJSON()];
|
|
292
|
+
}
|
|
259
293
|
/** Create a new `LineSegment3d` with coordinates from json object. See `setFromJSON` for object layout description. */
|
|
260
294
|
static fromJSON(json) {
|
|
261
295
|
const result = new LineSegment3d(Point3d.createZero(), Point3d.create());
|
|
@@ -283,7 +317,7 @@ export class LineSegment3d extends CurvePrimitive {
|
|
|
283
317
|
handler.endCurvePrimitive(this);
|
|
284
318
|
}
|
|
285
319
|
/**
|
|
286
|
-
*
|
|
320
|
+
* Return the stroke count required for given options.
|
|
287
321
|
* @param options StrokeOptions that determine count
|
|
288
322
|
*/
|
|
289
323
|
computeStrokeCountForOptions(options) {
|
|
@@ -295,19 +329,20 @@ export class LineSegment3d extends CurvePrimitive {
|
|
|
295
329
|
}
|
|
296
330
|
return numStroke;
|
|
297
331
|
}
|
|
298
|
-
/** Second step of double dispatch:
|
|
332
|
+
/** Second step of double dispatch: call `handler.handleLineSegment3d(this)` */
|
|
299
333
|
dispatchToGeometryHandler(handler) {
|
|
300
334
|
return handler.handleLineSegment3d(this);
|
|
301
335
|
}
|
|
302
336
|
/**
|
|
303
337
|
* Find intervals of this curve primitive that are interior to a clipper
|
|
304
338
|
* @param clipper clip structure (e.g. clip planes)
|
|
305
|
-
* @param announce function to be called announcing fractional intervals
|
|
339
|
+
* @param announce function to be called announcing fractional intervals `announce(fraction0, fraction1, curvePrimitive)`
|
|
306
340
|
*/
|
|
307
341
|
announceClipIntervals(clipper, announce) {
|
|
308
342
|
return clipper.announceClippedSegmentIntervals(0.0, 1.0, this._point0, this._point1, announce ? (fraction0, fraction1) => announce(fraction0, fraction1, this) : undefined);
|
|
309
343
|
}
|
|
310
|
-
/**
|
|
344
|
+
/**
|
|
345
|
+
* Return (if possible) a curve primitive which is a portion of this curve.
|
|
311
346
|
* @param fractionA [in] start fraction
|
|
312
347
|
* @param fractionB [in] end fraction
|
|
313
348
|
*/
|
|
@@ -347,10 +382,13 @@ export class LineSegment3d extends CurvePrimitive {
|
|
|
347
382
|
}
|
|
348
383
|
return undefined;
|
|
349
384
|
}
|
|
350
|
-
/**
|
|
385
|
+
/**
|
|
386
|
+
* Project instance geometry (via dispatch) onto the given ray, and return the extreme fractional parameters of
|
|
387
|
+
* projection.
|
|
351
388
|
* @param ray ray onto which the instance is projected. A `Vector3d` is treated as a `Ray3d` with zero origin.
|
|
352
389
|
* @param lowHigh optional receiver for output
|
|
353
|
-
* @returns range of fractional projection parameters onto the ray, where 0.0 is start of the ray and 1.0 is the
|
|
390
|
+
* @returns range of fractional projection parameters onto the ray, where 0.0 is start of the ray and 1.0 is the
|
|
391
|
+
* end of the ray.
|
|
354
392
|
*/
|
|
355
393
|
projectedParameterRange(ray, lowHigh) {
|
|
356
394
|
return PlaneAltitudeRangeContext.findExtremeFractionsAlongDirection(this, ray, lowHigh);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LineSegment3d.js","sourceRoot":"","sources":["../../../src/curve/LineSegment3d.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAO/F,OAAO,EAAmB,QAAQ,EAA0B,MAAM,aAAa,CAAC;AAEhF,OAAO,EAAE,yBAAyB,EAAE,MAAM,yCAAyC,CAAC;AACpF,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAW,OAAO,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAE5C,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAC7D,OAAO,EAAE,kBAAkB,EAA+B,MAAM,mBAAmB,CAAC;AACpF,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC/E,OAAO,EAAsC,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAEtF,OAAO,EAAE,yBAAyB,EAAE,MAAM,8CAA8C,CAAC;AACzF,OAAO,EAAE,aAAa,EAAE,MAAM,yCAAyC,CAAC;AAIxE,mEAAmE;AAEnE;;;;;;;;;;;;;GAaG;AACH,MAAM,OAAO,aAAc,SAAQ,cAAc;IAI/C,kDAAkD;IAC3C,mBAAmB,CAAC,KAAoB,IAAa,OAAO,KAAK,YAAY,aAAa,CAAC,CAAC,CAAC;IAGpG;;OAEG;IACH,IAAW,SAAS,KAAc,OAAO,IAA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AS,CAAC,gBAAgB,EAAE,EAAE;YAChC,SAAS,CAAC,aAAa,CAAC,SAAS,CAAC,CAAC;YACnC,MAAM,UAAU,GAAG,aAAa,CAAC,iBAAiB,CAAC,uBAAuB,CAAC,CAAC;YAC5E,OAAO,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,SAAS,EAAE,UAAU,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC,CAAC;SAC7H;QACD,OAAO,SAAS,CAAC;IACnB,CAAC;IAED;;;;OAIG;IACa,uBAAuB,CAAC,GAAqB,EAAE,OAAiB;QAC9E,OAAO,yBAAyB,CAAC,kCAAkC,CAAC,IAAI,EAAE,GAAG,EAAE,OAAO,CAAC,CAAC;IAC1F,CAAC;CACF","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 { Clipper } from \"../clipping/ClipUtils\";\r\nimport { BeJSONFunctions, Geometry, PlaneAltitudeEvaluator } from \"../Geometry\";\r\nimport { GeometryHandler, IStrokeHandler } from \"../geometry3d/GeometryHandler\";\r\nimport { Plane3dByOriginAndVectors } from \"../geometry3d/Plane3dByOriginAndVectors\";\r\nimport { Point3d, Vector3d } from \"../geometry3d/Point3dVector3d\";\r\nimport { Range1d, Range3d } from \"../geometry3d/Range\";\r\nimport { Ray3d } from \"../geometry3d/Ray3d\";\r\nimport { Transform } from \"../geometry3d/Transform\";\r\nimport { Order2Bezier } from \"../numerics/BezierPolynomials\";\r\nimport { CurveExtendOptions, VariantCurveExtendParameter } from \"./CurveExtendMode\";\r\nimport { CurveIntervalRole, CurveLocationDetail } from \"./CurveLocationDetail\";\r\nimport { AnnounceNumberNumberCurvePrimitive, CurvePrimitive } from \"./CurvePrimitive\";\r\nimport { GeometryQuery } from \"./GeometryQuery\";\r\nimport { PlaneAltitudeRangeContext } from \"./internalContexts/PlaneAltitudeRangeContext\";\r\nimport { OffsetOptions } from \"./internalContexts/PolygonOffsetContext\";\r\nimport { LineString3d } from \"./LineString3d\";\r\nimport { StrokeOptions } from \"./StrokeOptions\";\r\n\r\n/* eslint-disable @typescript-eslint/naming-convention, no-empty */\r\n\r\n/**\r\n * A LineSegment3d is:\r\n *\r\n * * A 3d line segment represented by its start and end coordinates\r\n * * startPoint\r\n * * endPoint\r\n * * The segment is parameterized with fraction 0 at the start and fraction 1 at the end, i.e. either of these equivalent forms to map fraction `f` to a point `X(f)`\r\n * ```\r\n * equation\r\n * X(f) = P_0 + f * (P_1 - P_0)\\newline\r\n * X(f) = (1-f)*P_0 + f * P_0\r\n * ```\r\n * @public\r\n */\r\nexport class LineSegment3d extends CurvePrimitive implements BeJSONFunctions {\r\n /** String name for schema properties */\r\n public readonly curvePrimitiveType = \"lineSegment\";\r\n\r\n /** test if `other` is of class `LineSegment3d` */\r\n public isSameGeometryClass(other: GeometryQuery): boolean { return other instanceof LineSegment3d; }\r\n private _point0: Point3d;\r\n private _point1: Point3d;\r\n /** Return REFERENCE to the start point of this segment.\r\n * * (This is distinct from the `CurvePrimitive` abstract method `endPoint()` which creates a returned point\r\n */\r\n public get point0Ref(): Point3d { return this._point0; }\r\n /** Return REFERENCE to the end point of this segment.\r\n * * (This is distinct from the `CurvePrimitive` abstract method `endPoint()` which creates a returned point\r\n */\r\n public get point1Ref(): Point3d { return this._point1; }\r\n /**\r\n * A LineSegment3d extends along its infinite line.\r\n */\r\n public override get isExtensibleFractionSpace(): boolean { return true; }\r\n\r\n /**\r\n * CAPTURE point references as a `LineSegment3d`\r\n * @param point0\r\n * @param point1\r\n */\r\n protected constructor(point0: Point3d, point1: Point3d) { super(); this._point0 = point0; this._point1 = point1; }\r\n /** Set the start and endpoints by capturing input references. */\r\n public setRefs(point0: Point3d, point1: Point3d) { this._point0 = point0; this._point1 = point1; }\r\n /** Set the start and endpoints by cloning the input parameters. */\r\n public set(point0: Point3d, point1: Point3d) { this._point0 = point0.clone(); this._point1 = point1.clone(); }\r\n /** copy (clone) data from other */\r\n public setFrom(other: LineSegment3d) { this._point0.setFrom(other._point0); this._point1.setFrom(other._point1); }\r\n /** Return a (clone of) the start point. (This is NOT a reference to the stored start point) */\r\n public override startPoint(result?: Point3d): Point3d {\r\n if (result) { result.setFrom(this._point0); return result; }\r\n return this._point0.clone();\r\n }\r\n /** Return a (clone of) the end point. (This is NOT a reference to the stored end point) */\r\n public override endPoint(result?: Point3d): Point3d {\r\n if (result) { result.setFrom(this._point1); return result; }\r\n return this._point1.clone();\r\n }\r\n /** Return the point and derivative vector at fractional position along the line segment. */\r\n public fractionToPointAndDerivative(fraction: number, result?: Ray3d): Ray3d {\r\n result = result ? result : Ray3d.createZero();\r\n result.direction.setStartEnd(this._point0, this._point1);\r\n this._point0.interpolate(fraction, this._point1, result.origin);\r\n return result;\r\n }\r\n /** Construct a plane with\r\n * * origin at the fractional position along the line segment\r\n * * x axis is the first derivative, i.e. along the line segment\r\n * * y axis is the second derivative, i.e. 000\r\n */\r\n public fractionToPointAnd2Derivatives(fraction: number, result?: Plane3dByOriginAndVectors): Plane3dByOriginAndVectors {\r\n result = result ? result : Plane3dByOriginAndVectors.createXYPlane();\r\n result.vectorU.setStartEnd(this._point0, this._point1);\r\n result.vectorV.set(0, 0, 0);\r\n this._point0.interpolate(fraction, this._point1, result.origin);\r\n return result;\r\n }\r\n\r\n /** Clone the LineSegment3d */\r\n public clone(): LineSegment3d { return LineSegment3d.create(this._point0, this._point1); }\r\n /** Clone and apply transform to the clone. */\r\n public cloneTransformed(transform: Transform): LineSegment3d { // we know tryTransformInPlace succeeds.\r\n const c = this.clone();\r\n c.tryTransformInPlace(transform);\r\n return c;\r\n }\r\n /** Create with start and end points. The point contents are cloned into the LineSegment3d. */\r\n public static create(point0: Point3d, point1: Point3d, result?: LineSegment3d): LineSegment3d {\r\n if (result) {\r\n result.set(point0, point1); // and this will clone them !!\r\n return result;\r\n }\r\n return new LineSegment3d(point0.clone(), point1.clone());\r\n }\r\n\r\n /** Create with start and end points. The point contents are CAPTURED into the result */\r\n public static createCapture(point0: Point3d, point1: Point3d): LineSegment3d {\r\n return new LineSegment3d(point0, point1);\r\n }\r\n /** create a LineSegment3d from xy coordinates of start and end, with common z.\r\n * @param x0 start point x coordinate.\r\n * @param y0 start point y coordinate.\r\n * @param x1 end point x coordinate.\r\n * @param y1 end point y coordinate.\r\n * @param z z coordinate to use for both points.\r\n * @param result optional existing LineSegment to be reinitialized.\r\n */\r\n public static createXYXY(x0: number, y0: number, x1: number, y1: number, z: number = 0, result?: LineSegment3d) {\r\n if (result) {\r\n result._point0.set(x0, y0, z);\r\n result._point1.set(x1, y1, z);\r\n return result;\r\n }\r\n return new LineSegment3d(Point3d.create(x0, y0, z), Point3d.create(x1, y1, z));\r\n }\r\n\r\n /** create a LineSegment3d from xy coordinates of start and end, with common z.\r\n * @param x0 start point x coordinate.\r\n * @param y0 start point y coordinate.\r\n * @param x1 end point x coordinate.\r\n * @param y1 end point y coordinate.\r\n * @param z z coordinate to use for both points.\r\n * @param result optional existing LineSegment to be reinitialized.\r\n */\r\n public static createXYZXYZ(x0: number, y0: number, z0: number, x1: number, y1: number, z1: number, result?: LineSegment3d) {\r\n if (result) {\r\n result._point0.set(x0, y0, z0);\r\n result._point1.set(x1, y1, z1);\r\n return result;\r\n }\r\n return new LineSegment3d(Point3d.create(x0, y0, z0), Point3d.create(x1, y1, z1));\r\n }\r\n\r\n /** Return the point at fractional position along the line segment. */\r\n public fractionToPoint(fraction: number, result?: Point3d): Point3d { return this._point0.interpolate(fraction, this._point1, result); }\r\n /** Return the length of the segment. */\r\n public override curveLength(): number { return this._point0.distance(this._point1); }\r\n /** Return the length of the partial segment between fractions. */\r\n public override curveLengthBetweenFractions(fraction0: number, fraction1: number): number {\r\n return Math.abs(fraction1 - fraction0) * this._point0.distance(this._point1);\r\n }\r\n /** Return the length of the segment. */\r\n public quickLength(): number { return this.curveLength(); }\r\n\r\n /**\r\n * Returns a curve location detail with both xyz and fractional coordinates of the closest point.\r\n * @param spacePoint point in space\r\n * @param extend if false, only return points within the bounded line segment. If true, allow the point to be on the unbounded line that contains the bounded segment.\r\n */\r\n public override closestPoint(spacePoint: Point3d, extend: VariantCurveExtendParameter, result?: CurveLocationDetail): CurveLocationDetail {\r\n let fraction = spacePoint.fractionOfProjectionToLine(this._point0, this._point1, 0.0);\r\n fraction = CurveExtendOptions.correctFraction(extend, fraction);\r\n result = CurveLocationDetail.create(this, result);\r\n // remark: This can be done by result.setFP (fraction, thePoint, undefined, a)\r\n // but that creates a temporary point.\r\n result.fraction = fraction;\r\n this._point0.interpolate(fraction, this._point1, result.point);\r\n result.vectorInCurveLocationDetail = undefined;\r\n result.a = result.point.distance(spacePoint);\r\n return result;\r\n }\r\n /** swap the endpoint references. */\r\n public reverseInPlace(): void {\r\n const a = this._point0;\r\n this._point0 = this._point1;\r\n this._point1 = a;\r\n }\r\n /** Transform the two endpoints of this LinSegment. */\r\n public tryTransformInPlace(transform: Transform): boolean {\r\n this._point0 = transform.multiplyPoint3d(this._point0, this._point0);\r\n this._point1 = transform.multiplyPoint3d(this._point1, this._point1);\r\n return true;\r\n }\r\n /** Test if both endpoints are in a plane (within tolerance) */\r\n public isInPlane(plane: PlaneAltitudeEvaluator): boolean {\r\n return Geometry.isSmallMetricDistance(plane.altitude(this._point0))\r\n && Geometry.isSmallMetricDistance(plane.altitude(this._point1));\r\n }\r\n /** Compute points of simple (transverse) with a plane.\r\n * * Use isInPlane to test if the line segment is completely in the plane.\r\n */\r\n public override appendPlaneIntersectionPoints(plane: PlaneAltitudeEvaluator, result: CurveLocationDetail[]): number {\r\n const h0 = plane.altitude(this._point0);\r\n const h1 = plane.altitude(this._point1);\r\n const fraction = Order2Bezier.solveCoffs(h0, h1);\r\n let numIntersection = 0;\r\n if (fraction !== undefined) {\r\n numIntersection++;\r\n const detail = CurveLocationDetail.createCurveFractionPoint(this, fraction, this.fractionToPoint(fraction));\r\n detail.intervalRole = CurveIntervalRole.isolated;\r\n result.push(detail);\r\n }\r\n return numIntersection;\r\n }\r\n /**\r\n * Extend a range to include the (optionally transformed) line segment\r\n * @param range range to extend\r\n * @param transform optional transform to apply to the end points\r\n */\r\n public extendRange(range: Range3d, transform?: Transform): void {\r\n if (transform) {\r\n range.extendTransformedPoint(transform, this._point0);\r\n range.extendTransformedPoint(transform, this._point1);\r\n } else {\r\n range.extendPoint(this._point0);\r\n range.extendPoint(this._point1);\r\n }\r\n }\r\n /**\r\n * Construct a line from either of these json forms:\r\n *\r\n * * object with named start and end:\r\n * `{startPoint: pointValue, endPoint: pointValue}`\r\n * * array of two point values:\r\n * `[pointValue, pointValue]`\r\n * The point values are any values accepted by the Point3d method setFromJSON.\r\n * @param json data to parse.\r\n */\r\n public setFromJSON(json?: any) {\r\n if (!json) {\r\n this._point0.set(0, 0, 0);\r\n this._point1.set(1, 0, 0);\r\n return;\r\n } else if (json.startPoint && json.endPoint) { // {startPoint:json point, endPoint:json point}\r\n this._point0.setFromJSON(json.startPoint);\r\n this._point1.setFromJSON(json.endPoint);\r\n } else if (Array.isArray(json)\r\n && json.length > 1) { // [json point, json point]\r\n this._point0.setFromJSON(json[0]);\r\n this._point1.setFromJSON(json[1]);\r\n }\r\n }\r\n /** A simple line segment's fraction and distance are proportional. */\r\n public override getFractionToDistanceScale(): number | undefined { return this.curveLength(); }\r\n /**\r\n * Place the lineSegment3d start and points in a json object\r\n * @return {*} [[x,y,z],[x,y,z]]\r\n */\r\n public toJSON(): any { return [this._point0.toJSON(), this._point1.toJSON()]; }\r\n /** Create a new `LineSegment3d` with coordinates from json object. See `setFromJSON` for object layout description. */\r\n public static fromJSON(json?: any): LineSegment3d {\r\n const result = new LineSegment3d(Point3d.createZero(), Point3d.create());\r\n result.setFromJSON(json);\r\n return result;\r\n }\r\n /** Near equality test with `other`. */\r\n public override isAlmostEqual(other: GeometryQuery): boolean {\r\n if (other instanceof LineSegment3d) {\r\n const ls = other;\r\n return this._point0.isAlmostEqual(ls._point0) && this._point1.isAlmostEqual(ls._point1);\r\n }\r\n return false;\r\n }\r\n\r\n /** Emit strokes to caller-supplied linestring */\r\n public emitStrokes(dest: LineString3d, options?: StrokeOptions): void {\r\n const numStroke = this.computeStrokeCountForOptions(options);\r\n dest.appendFractionalStrokePoints(this, numStroke, 0.0, 1.0);\r\n }\r\n /** Emit strokes to caller-supplied handler */\r\n public emitStrokableParts(handler: IStrokeHandler, options?: StrokeOptions): void {\r\n handler.startCurvePrimitive(this);\r\n const numStroke = this.computeStrokeCountForOptions(options);\r\n handler.announceSegmentInterval(this, this._point0, this._point1, numStroke, 0.0, 1.0);\r\n handler.endCurvePrimitive(this);\r\n }\r\n\r\n /**\r\n * return the stroke count required for given options.\r\n * @param options StrokeOptions that determine count\r\n */\r\n public computeStrokeCountForOptions(options?: StrokeOptions): number {\r\n let numStroke = 1;\r\n if (options) {\r\n if (options.maxEdgeLength)\r\n numStroke = options.applyMaxEdgeLength(numStroke, this.curveLength());\r\n numStroke = options.applyMinStrokesPerPrimitive(numStroke);\r\n }\r\n return numStroke;\r\n }\r\n /** Second step of double dispatch: call `handler.handleLineSegment3d(this)` */\r\n public dispatchToGeometryHandler(handler: GeometryHandler): any {\r\n return handler.handleLineSegment3d(this);\r\n }\r\n\r\n /**\r\n * Find intervals of this curve primitive that are interior to a clipper\r\n * @param clipper clip structure (e.g. clip planes)\r\n * @param announce function to be called announcing fractional intervals\" ` announce(fraction0, fraction1, curvePrimitive)`\r\n */\r\n public override announceClipIntervals(clipper: Clipper, announce?: AnnounceNumberNumberCurvePrimitive): boolean {\r\n return clipper.announceClippedSegmentIntervals(0.0, 1.0, this._point0, this._point1,\r\n announce ? (fraction0: number, fraction1: number) => announce(fraction0, fraction1, this) : undefined);\r\n }\r\n\r\n /** Return (if possible) a curve primitive which is a portion of this curve.\r\n * @param fractionA [in] start fraction\r\n * @param fractionB [in] end fraction\r\n */\r\n public override clonePartialCurve(fractionA: number, fractionB: number): LineSegment3d {\r\n return LineSegment3d.create(this.fractionToPoint(fractionA), this.fractionToPoint(fractionB));\r\n }\r\n /**\r\n * Returns a (high accuracy) range of the curve between fractional positions\r\n * * Default implementation returns teh range of the curve from clonePartialCurve\r\n */\r\n public override rangeBetweenFractions(fraction0: number, fraction1: number, transform?: Transform): Range3d {\r\n // (This is cheap -- don't bother testing for fraction0===fraction1)\r\n if (!transform){\r\n const range = Range3d.create();\r\n range.extendInterpolated (this._point0, fraction0, this._point1);\r\n range.extendInterpolated (this._point0, fraction1, this._point1);\r\n return range;\r\n }\r\n const point0 = this.fractionToPoint (fraction0);\r\n const point1 = this.fractionToPoint (fraction1);\r\n if (transform){\r\n transform.multiplyPoint3d (point0, point0);\r\n transform.multiplyPoint3d (point1, point1);\r\n }\r\n return Range3d.create (point0, point1);\r\n }\r\n\r\n /**\r\n * Construct an offset of the instance curve as viewed in the xy-plane (ignoring z).\r\n * @param offsetDistanceOrOptions offset distance (positive to left of the instance curve), or options object\r\n */\r\n public override constructOffsetXY(offsetDistanceOrOptions: number | OffsetOptions): CurvePrimitive | CurvePrimitive[] | undefined {\r\n const offsetVec = Vector3d.createStartEnd(this._point0, this._point1);\r\n if (offsetVec.normalizeInPlace()) {\r\n offsetVec.rotate90CCWXY(offsetVec);\r\n const offsetDist = OffsetOptions.getOffsetDistance(offsetDistanceOrOptions);\r\n return LineSegment3d.create(this._point0.plusScaled(offsetVec, offsetDist), this._point1.plusScaled(offsetVec, offsetDist));\r\n }\r\n return undefined;\r\n }\r\n\r\n /** Project instance geometry (via dispatch) onto the given ray, and return the extreme fractional parameters of projection.\r\n * @param ray ray onto which the instance is projected. A `Vector3d` is treated as a `Ray3d` with zero origin.\r\n * @param lowHigh optional receiver for output\r\n * @returns range of fractional projection parameters onto the ray, where 0.0 is start of the ray and 1.0 is the end of the ray.\r\n */\r\n public override projectedParameterRange(ray: Vector3d | Ray3d, lowHigh?: Range1d): Range1d | undefined {\r\n return PlaneAltitudeRangeContext.findExtremeFractionsAlongDirection(this, ray, lowHigh);\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"LineSegment3d.js","sourceRoot":"","sources":["../../../src/curve/LineSegment3d.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAO/F,OAAO,EAAmB,QAAQ,EAA0B,MAAM,aAAa,CAAC;AAEhF,OAAO,EAAE,yBAAyB,EAAE,MAAM,yCAAyC,CAAC;AACpF,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAW,OAAO,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAE5C,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAC7D,OAAO,EAAE,kBAAkB,EAA+B,MAAM,mBAAmB,CAAC;AACpF,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC/E,OAAO,EAAsC,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAEtF,OAAO,EAAE,yBAAyB,EAAE,MAAM,8CAA8C,CAAC;AACzF,OAAO,EAAE,aAAa,EAAE,MAAM,yCAAyC,CAAC;AAIxE,mEAAmE;AAEnE;;;;;;;;;;;;;GAaG;AACH,MAAM,OAAO,aAAc,SAAQ,cAAc;IAG/C,kDAAkD;IAC3C,mBAAmB,CAAC,KAAoB;QAC7C,OAAO,KAAK,YAAY,aAAa,CAAC;IACxC,CAAC;IAKD;;;OAGG;IACH,IAAW,SAAS;QAClB,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;IACD;;;OAGG;IACH,IAAW,SAAS;QAClB,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;IACD,uDAAuD;IACvD,IAAoB,yBAAyB;QAC3C,OAAO,IAAI,CAAC;IACd,CAAC;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,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,SAAS,EAAE,UAAU,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,SAAS,EAAE,UAAU,CAAC,CAC/F,CAAC;SACH;QACD,OAAO,SAAS,CAAC;IACnB,CAAC;IACD;;;;;;;OAOG;IACa,uBAAuB,CAAC,GAAqB,EAAE,OAAiB;QAC9E,OAAO,yBAAyB,CAAC,kCAAkC,CAAC,IAAI,EAAE,GAAG,EAAE,OAAO,CAAC,CAAC;IAC1F,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\n/** @packageDocumentation\n * @module Curve\n */\n\nimport { Clipper } from \"../clipping/ClipUtils\";\nimport { BeJSONFunctions, Geometry, PlaneAltitudeEvaluator } from \"../Geometry\";\nimport { GeometryHandler, IStrokeHandler } from \"../geometry3d/GeometryHandler\";\nimport { Plane3dByOriginAndVectors } from \"../geometry3d/Plane3dByOriginAndVectors\";\nimport { Point3d, Vector3d } from \"../geometry3d/Point3dVector3d\";\nimport { Range1d, Range3d } from \"../geometry3d/Range\";\nimport { Ray3d } from \"../geometry3d/Ray3d\";\nimport { Transform } from \"../geometry3d/Transform\";\nimport { Order2Bezier } from \"../numerics/BezierPolynomials\";\nimport { CurveExtendOptions, VariantCurveExtendParameter } from \"./CurveExtendMode\";\nimport { CurveIntervalRole, CurveLocationDetail } from \"./CurveLocationDetail\";\nimport { AnnounceNumberNumberCurvePrimitive, CurvePrimitive } from \"./CurvePrimitive\";\nimport { GeometryQuery } from \"./GeometryQuery\";\nimport { PlaneAltitudeRangeContext } from \"./internalContexts/PlaneAltitudeRangeContext\";\nimport { OffsetOptions } from \"./internalContexts/PolygonOffsetContext\";\nimport { LineString3d } from \"./LineString3d\";\nimport { StrokeOptions } from \"./StrokeOptions\";\n\n/* eslint-disable @typescript-eslint/naming-convention, no-empty */\n\n/**\n * A LineSegment3d is:\n * * A 3d line segment represented by its start and end coordinates\n * * startPoint\n * * endPoint\n * * The segment is parameterized with fraction 0 at the start and fraction 1 at the end, i.e. each of these\n * equivalent forms maps fraction `f` to a point `X(f)`:\n * ```\n * equation\n * X(f) = P_0 + f*(P_1 - P_0)\\newline\n * X(f) = (1-f)*P_0 + f*P_1\n * ```\n * @public\n */\nexport class LineSegment3d extends CurvePrimitive implements BeJSONFunctions {\n /** String name for schema properties */\n public readonly curvePrimitiveType = \"lineSegment\";\n /** Test if `other` is of class `LineSegment3d` */\n public isSameGeometryClass(other: GeometryQuery): boolean {\n return other instanceof LineSegment3d;\n }\n /** Start point of the segment */\n private _point0: Point3d;\n /** End point of the segment */\n private _point1: Point3d;\n /**\n * Return REFERENCE to the start point of this segment.\n * * This is distinct from the `CurvePrimitive` abstract method `startPoint()` which creates a returned point.\n */\n public get point0Ref(): Point3d {\n return this._point0;\n }\n /**\n * Return REFERENCE to the end point of this segment.\n * * This is distinct from the `CurvePrimitive` abstract method `endPoint()` which creates a returned point.\n */\n public get point1Ref(): Point3d {\n return this._point1;\n }\n /** A LineSegment3d extends along its infinite line. */\n public override get isExtensibleFractionSpace(): boolean {\n return true;\n }\n /**\n * CAPTURE point references as a `LineSegment3d`\n * @param point0\n * @param point1\n */\n protected constructor(point0: Point3d, point1: Point3d) {\n super();\n this._point0 = point0;\n this._point1 = point1;\n }\n /** Set the start and endpoints by capturing input references. */\n public setRefs(point0: Point3d, point1: Point3d) {\n this._point0 = point0;\n this._point1 = point1;\n }\n /** Set the start and endpoints by cloning the input parameters. */\n public set(point0: Point3d, point1: Point3d) {\n this._point0 = point0.clone();\n this._point1 = point1.clone();\n }\n /** Copy (clone) data from other */\n public setFrom(other: LineSegment3d) {\n this._point0.setFrom(other._point0);\n this._point1.setFrom(other._point1);\n }\n /** Return a (clone of) the start point (This is NOT a reference to the stored start point) */\n public override startPoint(result?: Point3d): Point3d {\n if (result) { result.setFrom(this._point0); return result; }\n return this._point0.clone();\n }\n /** Return a (clone of) the end point (This is NOT a reference to the stored end point) */\n public override endPoint(result?: Point3d): Point3d {\n if (result) { result.setFrom(this._point1); return result; }\n return this._point1.clone();\n }\n /** Return the point and derivative vector at fractional position along the line segment. */\n public fractionToPointAndDerivative(fraction: number, result?: Ray3d): Ray3d {\n result = result ? result : Ray3d.createZero();\n result.direction.setStartEnd(this._point0, this._point1);\n this._point0.interpolate(fraction, this._point1, result.origin);\n return result;\n }\n /**\n * Construct a plane with\n * * origin at the fractional position along the line segment\n * * x axis is the first derivative, i.e. along the line segment\n * * y axis is the second derivative, i.e. 000\n */\n public fractionToPointAnd2Derivatives(fraction: number, result?: Plane3dByOriginAndVectors): Plane3dByOriginAndVectors {\n result = result ? result : Plane3dByOriginAndVectors.createXYPlane();\n result.vectorU.setStartEnd(this._point0, this._point1);\n result.vectorV.set(0, 0, 0);\n this._point0.interpolate(fraction, this._point1, result.origin);\n return result;\n }\n /** Clone the LineSegment3d */\n public clone(): LineSegment3d {\n return LineSegment3d.create(this._point0, this._point1);\n }\n /** Clone and apply transform to the clone. */\n public cloneTransformed(transform: Transform): LineSegment3d { // we know tryTransformInPlace succeeds.\n const c = this.clone();\n c.tryTransformInPlace(transform);\n return c;\n }\n /** Create with start and end points. The point contents are cloned into the LineSegment3d. */\n public static create(point0: Point3d, point1: Point3d, result?: LineSegment3d): LineSegment3d {\n if (result) {\n result.set(point0, point1); // and this will clone them !!\n return result;\n }\n return new LineSegment3d(point0.clone(), point1.clone());\n }\n /** Create with start and end points. The point contents are CAPTURED into the result */\n public static createCapture(point0: Point3d, point1: Point3d): LineSegment3d {\n return new LineSegment3d(point0, point1);\n }\n /**\n * Create a LineSegment3d from xy coordinates of start and end, with common z.\n * @param x0 start point x coordinate.\n * @param y0 start point y coordinate.\n * @param x1 end point x coordinate.\n * @param y1 end point y coordinate.\n * @param z z coordinate to use for both points.\n * @param result optional existing LineSegment to be reinitialized.\n */\n public static createXYXY(x0: number, y0: number, x1: number, y1: number, z: number = 0, result?: LineSegment3d) {\n if (result) {\n result._point0.set(x0, y0, z);\n result._point1.set(x1, y1, z);\n return result;\n }\n return new LineSegment3d(Point3d.create(x0, y0, z), Point3d.create(x1, y1, z));\n }\n /**\n * Create a LineSegment3d from xy coordinates of start and end, with common z.\n * @param x0 start point x coordinate.\n * @param y0 start point y coordinate.\n * @param x1 end point x coordinate.\n * @param y1 end point y coordinate.\n * @param z z coordinate to use for both points.\n * @param result optional existing LineSegment to be reinitialized.\n */\n public static createXYZXYZ(\n x0: number, y0: number, z0: number, x1: number, y1: number, z1: number, result?: LineSegment3d\n ): LineSegment3d {\n if (result) {\n result._point0.set(x0, y0, z0);\n result._point1.set(x1, y1, z1);\n return result;\n }\n return new LineSegment3d(Point3d.create(x0, y0, z0), Point3d.create(x1, y1, z1));\n }\n /** Return the point at fractional position along the line segment. */\n public fractionToPoint(fraction: number, result?: Point3d): Point3d {\n return this._point0.interpolate(fraction, this._point1, result);\n }\n /** Return the length of the segment. */\n public override curveLength(): number {\n return this._point0.distance(this._point1);\n }\n /** Return the length of the partial segment between fractions. */\n public override curveLengthBetweenFractions(fraction0: number, fraction1: number): number {\n return Math.abs(fraction1 - fraction0) * this._point0.distance(this._point1);\n }\n /** Return the length of the segment. */\n public quickLength(): number {\n return this.curveLength();\n }\n /**\n * Returns a curve location detail with both xyz and fractional coordinates of the closest point.\n * @param spacePoint point in space\n * @param extend if false, only return points within the bounded line segment. If true, allow the point to be on\n * the unbounded line that contains the bounded segment.\n */\n public override closestPoint(\n spacePoint: Point3d, extend: VariantCurveExtendParameter, result?: CurveLocationDetail\n ): CurveLocationDetail {\n let fraction = spacePoint.fractionOfProjectionToLine(this._point0, this._point1, 0.0);\n fraction = CurveExtendOptions.correctFraction(extend, fraction);\n result = CurveLocationDetail.create(this, result);\n // remark: This can be done by result.setFP (fraction, thePoint, undefined, a)\n // but that creates a temporary point.\n result.fraction = fraction;\n this._point0.interpolate(fraction, this._point1, result.point);\n result.vectorInCurveLocationDetail = undefined;\n result.a = result.point.distance(spacePoint);\n return result;\n }\n /** Swap the endpoint references. */\n public reverseInPlace(): void {\n const a = this._point0;\n this._point0 = this._point1;\n this._point1 = a;\n }\n /** Transform the two endpoints of this LinSegment. */\n public tryTransformInPlace(transform: Transform): boolean {\n this._point0 = transform.multiplyPoint3d(this._point0, this._point0);\n this._point1 = transform.multiplyPoint3d(this._point1, this._point1);\n return true;\n }\n /** Test if both endpoints are in a plane (within tolerance) */\n public isInPlane(plane: PlaneAltitudeEvaluator): boolean {\n return Geometry.isSmallMetricDistance(plane.altitude(this._point0))\n && Geometry.isSmallMetricDistance(plane.altitude(this._point1));\n }\n /**\n * Compute points of simple (transverse) with a plane.\n * * Use isInPlane to test if the line segment is completely in the plane.\n */\n public override appendPlaneIntersectionPoints(plane: PlaneAltitudeEvaluator, result: CurveLocationDetail[]): number {\n const h0 = plane.altitude(this._point0);\n const h1 = plane.altitude(this._point1);\n const fraction = Order2Bezier.solveCoffs(h0, h1);\n let numIntersection = 0;\n if (fraction !== undefined) {\n numIntersection++;\n const detail = CurveLocationDetail.createCurveFractionPoint(this, fraction, this.fractionToPoint(fraction));\n detail.intervalRole = CurveIntervalRole.isolated;\n result.push(detail);\n }\n return numIntersection;\n }\n /**\n * Extend a range to include the (optionally transformed) line segment\n * @param range range to extend\n * @param transform optional transform to apply to the end points\n */\n public extendRange(range: Range3d, transform?: Transform): void {\n if (transform) {\n range.extendTransformedPoint(transform, this._point0);\n range.extendTransformedPoint(transform, this._point1);\n } else {\n range.extendPoint(this._point0);\n range.extendPoint(this._point1);\n }\n }\n /**\n * Construct a line from either of these json forms:\n *\n * * object with named start and end:\n * `{startPoint: pointValue, endPoint: pointValue}`\n * * array of two point values:\n * `[pointValue, pointValue]`\n * The point values are any values accepted by the Point3d method setFromJSON.\n * @param json data to parse.\n */\n public setFromJSON(json?: any) {\n if (!json) {\n this._point0.set(0, 0, 0);\n this._point1.set(1, 0, 0);\n return;\n } else if (json.startPoint && json.endPoint) { // {startPoint:json point, endPoint:json point}\n this._point0.setFromJSON(json.startPoint);\n this._point1.setFromJSON(json.endPoint);\n } else if (Array.isArray(json)\n && json.length > 1) { // [json point, json point]\n this._point0.setFromJSON(json[0]);\n this._point1.setFromJSON(json[1]);\n }\n }\n /** A simple line segment's fraction and distance are proportional. */\n public override getFractionToDistanceScale(): number | undefined {\n return this.curveLength();\n }\n /**\n * Place the lineSegment3d start and points in a json object\n * @return {*} [[x,y,z],[x,y,z]]\n */\n public toJSON(): any {\n return [this._point0.toJSON(), this._point1.toJSON()];\n }\n /** Create a new `LineSegment3d` with coordinates from json object. See `setFromJSON` for object layout description. */\n public static fromJSON(json?: any): LineSegment3d {\n const result = new LineSegment3d(Point3d.createZero(), Point3d.create());\n result.setFromJSON(json);\n return result;\n }\n /** Near equality test with `other`. */\n public override isAlmostEqual(other: GeometryQuery): boolean {\n if (other instanceof LineSegment3d) {\n const ls = other;\n return this._point0.isAlmostEqual(ls._point0) && this._point1.isAlmostEqual(ls._point1);\n }\n return false;\n }\n /** Emit strokes to caller-supplied linestring */\n public emitStrokes(dest: LineString3d, options?: StrokeOptions): void {\n const numStroke = this.computeStrokeCountForOptions(options);\n dest.appendFractionalStrokePoints(this, numStroke, 0.0, 1.0);\n }\n /** Emit strokes to caller-supplied handler */\n public emitStrokableParts(handler: IStrokeHandler, options?: StrokeOptions): void {\n handler.startCurvePrimitive(this);\n const numStroke = this.computeStrokeCountForOptions(options);\n handler.announceSegmentInterval(this, this._point0, this._point1, numStroke, 0.0, 1.0);\n handler.endCurvePrimitive(this);\n }\n /**\n * Return the stroke count required for given options.\n * @param options StrokeOptions that determine count\n */\n public computeStrokeCountForOptions(options?: StrokeOptions): number {\n let numStroke = 1;\n if (options) {\n if (options.maxEdgeLength)\n numStroke = options.applyMaxEdgeLength(numStroke, this.curveLength());\n numStroke = options.applyMinStrokesPerPrimitive(numStroke);\n }\n return numStroke;\n }\n /** Second step of double dispatch: call `handler.handleLineSegment3d(this)` */\n public dispatchToGeometryHandler(handler: GeometryHandler): any {\n return handler.handleLineSegment3d(this);\n }\n /**\n * Find intervals of this curve primitive that are interior to a clipper\n * @param clipper clip structure (e.g. clip planes)\n * @param announce function to be called announcing fractional intervals `announce(fraction0, fraction1, curvePrimitive)`\n */\n public override announceClipIntervals(clipper: Clipper, announce?: AnnounceNumberNumberCurvePrimitive): boolean {\n return clipper.announceClippedSegmentIntervals(0.0, 1.0, this._point0, this._point1,\n announce ? (fraction0: number, fraction1: number) => announce(fraction0, fraction1, this) : undefined);\n }\n /**\n * Return (if possible) a curve primitive which is a portion of this curve.\n * @param fractionA [in] start fraction\n * @param fractionB [in] end fraction\n */\n public override clonePartialCurve(fractionA: number, fractionB: number): LineSegment3d {\n return LineSegment3d.create(this.fractionToPoint(fractionA), this.fractionToPoint(fractionB));\n }\n /**\n * Returns a (high accuracy) range of the curve between fractional positions\n * * Default implementation returns teh range of the curve from clonePartialCurve\n */\n public override rangeBetweenFractions(fraction0: number, fraction1: number, transform?: Transform): Range3d {\n // (This is cheap -- don't bother testing for fraction0===fraction1)\n if (!transform) {\n const range = Range3d.create();\n range.extendInterpolated(this._point0, fraction0, this._point1);\n range.extendInterpolated(this._point0, fraction1, this._point1);\n return range;\n }\n const point0 = this.fractionToPoint(fraction0);\n const point1 = this.fractionToPoint(fraction1);\n if (transform) {\n transform.multiplyPoint3d(point0, point0);\n transform.multiplyPoint3d(point1, point1);\n }\n return Range3d.create(point0, point1);\n }\n /**\n * Construct an offset of the instance curve as viewed in the xy-plane (ignoring z).\n * @param offsetDistanceOrOptions offset distance (positive to left of the instance curve), or options object\n */\n public override constructOffsetXY(\n offsetDistanceOrOptions: number | OffsetOptions\n ): CurvePrimitive | CurvePrimitive[] | undefined {\n const offsetVec = Vector3d.createStartEnd(this._point0, this._point1);\n if (offsetVec.normalizeInPlace()) {\n offsetVec.rotate90CCWXY(offsetVec);\n const offsetDist = OffsetOptions.getOffsetDistance(offsetDistanceOrOptions);\n return LineSegment3d.create(\n this._point0.plusScaled(offsetVec, offsetDist), this._point1.plusScaled(offsetVec, offsetDist)\n );\n }\n return undefined;\n }\n /**\n * Project instance geometry (via dispatch) onto the given ray, and return the extreme fractional parameters of\n * projection.\n * @param ray ray onto which the instance is projected. A `Vector3d` is treated as a `Ray3d` with zero origin.\n * @param lowHigh optional receiver for output\n * @returns range of fractional projection parameters onto the ray, where 0.0 is start of the ray and 1.0 is the\n * end of the ray.\n */\n public override projectedParameterRange(ray: Vector3d | Ray3d, lowHigh?: Range1d): Range1d | undefined {\n return PlaneAltitudeRangeContext.findExtremeFractionsAlongDirection(this, ray, lowHigh);\n }\n}\n"]}
|