@itwin/core-geometry 5.8.0-dev.9 → 5.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +13 -1
- package/lib/cjs/Constant.js.map +1 -1
- package/lib/cjs/Geometry.d.ts +24 -14
- package/lib/cjs/Geometry.d.ts.map +1 -1
- package/lib/cjs/Geometry.js +34 -14
- 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 +1 -0
- package/lib/cjs/core-geometry.js.map +1 -1
- package/lib/cjs/curve/Arc3d.d.ts +4 -0
- package/lib/cjs/curve/Arc3d.d.ts.map +1 -1
- package/lib/cjs/curve/Arc3d.js +14 -0
- package/lib/cjs/curve/Arc3d.js.map +1 -1
- package/lib/cjs/curve/ConstrainedCurve2d.d.ts +149 -0
- package/lib/cjs/curve/ConstrainedCurve2d.d.ts.map +1 -0
- package/lib/cjs/curve/ConstrainedCurve2d.js +317 -0
- package/lib/cjs/curve/ConstrainedCurve2d.js.map +1 -0
- package/lib/cjs/curve/ConstructCurveBetweenCurves.js.map +1 -1
- package/lib/cjs/curve/CoordinateXYZ.js.map +1 -1
- package/lib/cjs/curve/CurveChainWithDistanceIndex.js.map +1 -1
- package/lib/cjs/curve/CurveCollection.js.map +1 -1
- package/lib/cjs/curve/CurveCurve.js.map +1 -1
- package/lib/cjs/curve/CurveExtendMode.js.map +1 -1
- package/lib/cjs/curve/CurveFactory.d.ts.map +1 -1
- package/lib/cjs/curve/CurveFactory.js.map +1 -1
- package/lib/cjs/curve/CurveLocationDetail.js.map +1 -1
- package/lib/cjs/curve/CurveOps.js.map +1 -1
- package/lib/cjs/curve/CurvePrimitive.d.ts +2 -2
- package/lib/cjs/curve/CurvePrimitive.js +2 -2
- package/lib/cjs/curve/CurvePrimitive.js.map +1 -1
- package/lib/cjs/curve/CurveProcessor.js.map +1 -1
- package/lib/cjs/curve/CurveTypes.js.map +1 -1
- package/lib/cjs/curve/CurveWireMomentsXYZ.js.map +1 -1
- package/lib/cjs/curve/GeometryQuery.js.map +1 -1
- package/lib/cjs/curve/LineSegment3d.js.map +1 -1
- package/lib/cjs/curve/LineString3d.js.map +1 -1
- package/lib/cjs/curve/Loop.js.map +1 -1
- package/lib/cjs/curve/OffsetOptions.js.map +1 -1
- package/lib/cjs/curve/ParityRegion.js.map +1 -1
- package/lib/cjs/curve/Path.js.map +1 -1
- package/lib/cjs/curve/PointString3d.js.map +1 -1
- package/lib/cjs/curve/ProxyCurve.js.map +1 -1
- package/lib/cjs/curve/Query/ConsolidateAdjacentPrimitivesContext.js.map +1 -1
- package/lib/cjs/curve/Query/CurveSplitContext.js.map +1 -1
- package/lib/cjs/curve/Query/CylindricalRange.js.map +1 -1
- package/lib/cjs/curve/Query/InOutTests.js.map +1 -1
- package/lib/cjs/curve/Query/PlanarSubdivision.js.map +1 -1
- package/lib/cjs/curve/Query/StrokeCountChain.js.map +1 -1
- package/lib/cjs/curve/Query/StrokeCountMap.js.map +1 -1
- package/lib/cjs/curve/RegionMomentsXY.js.map +1 -1
- package/lib/cjs/curve/RegionOps.js.map +1 -1
- package/lib/cjs/curve/RegionOpsClassificationSweeps.js.map +1 -1
- package/lib/cjs/curve/StrokeOptions.js.map +1 -1
- package/lib/cjs/curve/UnionRegion.js.map +1 -1
- package/lib/cjs/curve/internalContexts/AnnounceTangentStrokeHandler.js.map +1 -1
- package/lib/cjs/curve/internalContexts/AppendPlaneIntersectionStrokeHandler.js.map +1 -1
- package/lib/cjs/curve/internalContexts/ChainCollectorContext.js.map +1 -1
- package/lib/cjs/curve/internalContexts/CloneCurvesContext.js.map +1 -1
- package/lib/cjs/curve/internalContexts/CloneWithExpandedLineStrings.js.map +1 -1
- package/lib/cjs/curve/internalContexts/ClosestPointStrokeHandler.js.map +1 -1
- package/lib/cjs/curve/internalContexts/CountLinearPartsSearchContext.js.map +1 -1
- package/lib/cjs/curve/internalContexts/CurveCurveCloseApproachXY.js.map +1 -1
- package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.js.map +1 -1
- package/lib/cjs/curve/internalContexts/CurveCurveIntersectXYZ.js.map +1 -1
- package/lib/cjs/curve/internalContexts/CurveLengthContext.js.map +1 -1
- package/lib/cjs/curve/internalContexts/CurveOffsetXYHandler.js.map +1 -1
- package/lib/cjs/curve/internalContexts/EllipticalArcApproximationContext.js.map +1 -1
- package/lib/cjs/curve/internalContexts/GapSearchContext.js.map +1 -1
- package/lib/cjs/curve/internalContexts/MultiChainCollector.js.map +1 -1
- package/lib/cjs/curve/internalContexts/NewtonRtoRStrokeHandler.js.map +1 -1
- package/lib/cjs/curve/internalContexts/PlaneAltitudeRangeContext.js.map +1 -1
- package/lib/cjs/curve/internalContexts/PointToCurveTangentHandler.d.ts +26 -0
- package/lib/cjs/curve/internalContexts/PointToCurveTangentHandler.d.ts.map +1 -0
- package/lib/cjs/curve/internalContexts/PointToCurveTangentHandler.js +78 -0
- package/lib/cjs/curve/internalContexts/PointToCurveTangentHandler.js.map +1 -0
- package/lib/cjs/curve/internalContexts/PolygonOffsetContext.js.map +1 -1
- package/lib/cjs/curve/internalContexts/SumLengthsContext.js.map +1 -1
- package/lib/cjs/curve/internalContexts/TransferWithSplitArcs.js.map +1 -1
- package/lib/cjs/curve/internalContexts/TransformInPlaceContext.js.map +1 -1
- package/lib/cjs/curve/internalContexts/geometry2d/ConstrainedImplicitCurve2d.d.ts +152 -0
- package/lib/cjs/curve/internalContexts/geometry2d/ConstrainedImplicitCurve2d.d.ts.map +1 -0
- package/lib/cjs/curve/internalContexts/geometry2d/ConstrainedImplicitCurve2d.js +843 -0
- package/lib/cjs/curve/internalContexts/geometry2d/ConstrainedImplicitCurve2d.js.map +1 -0
- package/lib/cjs/curve/internalContexts/geometry2d/ConstraintSet.d.ts +97 -0
- package/lib/cjs/curve/internalContexts/geometry2d/ConstraintSet.d.ts.map +1 -0
- package/lib/cjs/curve/internalContexts/geometry2d/ConstraintSet.js +300 -0
- package/lib/cjs/curve/internalContexts/geometry2d/ConstraintSet.js.map +1 -0
- package/lib/cjs/curve/internalContexts/geometry2d/ImplicitCurve2d.d.ts +105 -0
- package/lib/cjs/curve/internalContexts/geometry2d/ImplicitCurve2d.d.ts.map +1 -0
- package/lib/cjs/curve/internalContexts/geometry2d/ImplicitCurve2d.js +141 -0
- package/lib/cjs/curve/internalContexts/geometry2d/ImplicitCurve2d.js.map +1 -0
- package/lib/cjs/curve/internalContexts/geometry2d/ImplicitCurve2dConverter.d.ts +27 -0
- package/lib/cjs/curve/internalContexts/geometry2d/ImplicitCurve2dConverter.d.ts.map +1 -0
- package/lib/cjs/curve/internalContexts/geometry2d/ImplicitCurve2dConverter.js +152 -0
- package/lib/cjs/curve/internalContexts/geometry2d/ImplicitCurve2dConverter.js.map +1 -0
- package/lib/cjs/curve/internalContexts/geometry2d/UnboundedCircle2d.d.ts +81 -0
- package/lib/cjs/curve/internalContexts/geometry2d/UnboundedCircle2d.d.ts.map +1 -0
- package/lib/cjs/curve/internalContexts/geometry2d/UnboundedCircle2d.js +170 -0
- package/lib/cjs/curve/internalContexts/geometry2d/UnboundedCircle2d.js.map +1 -0
- package/lib/cjs/curve/internalContexts/geometry2d/UnboundedEllipse2d.d.ts +96 -0
- package/lib/cjs/curve/internalContexts/geometry2d/UnboundedEllipse2d.d.ts.map +1 -0
- package/lib/cjs/curve/internalContexts/geometry2d/UnboundedEllipse2d.js +187 -0
- package/lib/cjs/curve/internalContexts/geometry2d/UnboundedEllipse2d.js.map +1 -0
- package/lib/cjs/curve/internalContexts/geometry2d/UnboundedHyperbola2d.d.ts +91 -0
- package/lib/cjs/curve/internalContexts/geometry2d/UnboundedHyperbola2d.d.ts.map +1 -0
- package/lib/cjs/curve/internalContexts/geometry2d/UnboundedHyperbola2d.js +197 -0
- package/lib/cjs/curve/internalContexts/geometry2d/UnboundedHyperbola2d.js.map +1 -0
- package/lib/cjs/curve/internalContexts/geometry2d/UnboundedLine2d.d.ts +129 -0
- package/lib/cjs/curve/internalContexts/geometry2d/UnboundedLine2d.d.ts.map +1 -0
- package/lib/cjs/curve/internalContexts/geometry2d/UnboundedLine2d.js +208 -0
- package/lib/cjs/curve/internalContexts/geometry2d/UnboundedLine2d.js.map +1 -0
- package/lib/cjs/curve/internalContexts/geometry2d/UnboundedParabola2d.d.ts +87 -0
- package/lib/cjs/curve/internalContexts/geometry2d/UnboundedParabola2d.d.ts.map +1 -0
- package/lib/cjs/curve/internalContexts/geometry2d/UnboundedParabola2d.js +193 -0
- package/lib/cjs/curve/internalContexts/geometry2d/UnboundedParabola2d.js.map +1 -0
- package/lib/cjs/curve/spiral/AustralianRailCorpXYEvaluator.js.map +1 -1
- package/lib/cjs/curve/spiral/ClothoidSeries.js.map +1 -1
- package/lib/cjs/curve/spiral/CubicEvaluator.js.map +1 -1
- package/lib/cjs/curve/spiral/CzechSpiralEvaluator.js.map +1 -1
- package/lib/cjs/curve/spiral/DirectHalfCosineSpiralEvaluator.js.map +1 -1
- package/lib/cjs/curve/spiral/DirectSpiral3d.js.map +1 -1
- package/lib/cjs/curve/spiral/IntegratedSpiral3d.js.map +1 -1
- package/lib/cjs/curve/spiral/MXCubicAlongArcSpiralEvaluator.js.map +1 -1
- package/lib/cjs/curve/spiral/NormalizedTransition.js.map +1 -1
- package/lib/cjs/curve/spiral/PolishCubicSpiralEvaluator.js.map +1 -1
- package/lib/cjs/curve/spiral/TransitionConditionalProperties.js.map +1 -1
- package/lib/cjs/curve/spiral/TransitionSpiral3d.js.map +1 -1
- package/lib/cjs/curve/spiral/XYCurveEvaluator.js.map +1 -1
- package/lib/cjs/geometry3d/Angle.js.map +1 -1
- package/lib/cjs/geometry3d/AngleSweep.js.map +1 -1
- package/lib/cjs/geometry3d/BarycentricTriangle.js.map +1 -1
- package/lib/cjs/geometry3d/BilinearPatch.js.map +1 -1
- package/lib/cjs/geometry3d/CoincidentGeometryOps.js.map +1 -1
- package/lib/cjs/geometry3d/Ellipsoid.js.map +1 -1
- package/lib/cjs/geometry3d/FrameBuilder.js.map +1 -1
- package/lib/cjs/geometry3d/FrustumAnimation.js.map +1 -1
- package/lib/cjs/geometry3d/GeometryHandler.js.map +1 -1
- package/lib/cjs/geometry3d/GrowableBlockedArray.js.map +1 -1
- package/lib/cjs/geometry3d/GrowableFloat64Array.js.map +1 -1
- package/lib/cjs/geometry3d/GrowableXYArray.js.map +1 -1
- package/lib/cjs/geometry3d/GrowableXYZArray.js.map +1 -1
- package/lib/cjs/geometry3d/IndexedCollectionInterval.js.map +1 -1
- package/lib/cjs/geometry3d/IndexedXYCollection.js.map +1 -1
- package/lib/cjs/geometry3d/IndexedXYZCollection.js.map +1 -1
- package/lib/cjs/geometry3d/LongitudeLatitudeAltitude.js.map +1 -1
- package/lib/cjs/geometry3d/Matrix3d.js.map +1 -1
- package/lib/cjs/geometry3d/OrderedRotationAngles.js.map +1 -1
- package/lib/cjs/geometry3d/Plane3d.js.map +1 -1
- package/lib/cjs/geometry3d/Plane3dByOriginAndUnitNormal.js.map +1 -1
- package/lib/cjs/geometry3d/Plane3dByOriginAndVectors.js.map +1 -1
- package/lib/cjs/geometry3d/Point2dArrayCarrier.js.map +1 -1
- package/lib/cjs/geometry3d/Point2dVector2d.d.ts +7 -0
- package/lib/cjs/geometry3d/Point2dVector2d.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Point2dVector2d.js +9 -0
- package/lib/cjs/geometry3d/Point2dVector2d.js.map +1 -1
- package/lib/cjs/geometry3d/Point3dArrayCarrier.js.map +1 -1
- package/lib/cjs/geometry3d/Point3dVector3d.js.map +1 -1
- package/lib/cjs/geometry3d/PointHelpers.js.map +1 -1
- package/lib/cjs/geometry3d/PointStreaming.js.map +1 -1
- package/lib/cjs/geometry3d/PolygonOps.js.map +1 -1
- package/lib/cjs/geometry3d/PolylineCompressionByEdgeOffset.js.map +1 -1
- package/lib/cjs/geometry3d/PolylineOps.js.map +1 -1
- package/lib/cjs/geometry3d/Range.js.map +1 -1
- package/lib/cjs/geometry3d/Ray2d.js.map +1 -1
- package/lib/cjs/geometry3d/Ray3d.js.map +1 -1
- package/lib/cjs/geometry3d/ReusableObjectCache.js.map +1 -1
- package/lib/cjs/geometry3d/Segment1d.js.map +1 -1
- package/lib/cjs/geometry3d/SortablePolygon.js.map +1 -1
- package/lib/cjs/geometry3d/Transform.js.map +1 -1
- package/lib/cjs/geometry3d/UVSurfaceOps.js.map +1 -1
- package/lib/cjs/geometry3d/XYZProps.js.map +1 -1
- package/lib/cjs/geometry3d/YawPitchRollAngles.js.map +1 -1
- package/lib/cjs/geometry4d/Map4d.js.map +1 -1
- package/lib/cjs/geometry4d/Matrix4d.js.map +1 -1
- package/lib/cjs/geometry4d/MomentData.js.map +1 -1
- package/lib/cjs/geometry4d/PlaneByOriginAndVectors4d.js.map +1 -1
- package/lib/cjs/geometry4d/Point4d.js.map +1 -1
- package/lib/cjs/numerics/BandedSystem.js.map +1 -1
- package/lib/cjs/numerics/BezierPolynomials.js.map +1 -1
- package/lib/cjs/numerics/ClusterableArray.js.map +1 -1
- package/lib/cjs/numerics/Complex.js.map +1 -1
- package/lib/cjs/numerics/ConvexPolygon2d.js.map +1 -1
- package/lib/cjs/numerics/Newton.js.map +1 -1
- package/lib/cjs/numerics/PascalCoefficients.js.map +1 -1
- package/lib/cjs/numerics/PolarData.js.map +1 -1
- package/lib/cjs/numerics/Polynomials.d.ts.map +1 -1
- package/lib/cjs/numerics/Polynomials.js +8 -6
- package/lib/cjs/numerics/Polynomials.js.map +1 -1
- package/lib/cjs/numerics/Quadrature.js.map +1 -1
- package/lib/cjs/numerics/Range1dArray.js.map +1 -1
- package/lib/cjs/numerics/SmallSystem.js.map +1 -1
- package/lib/cjs/numerics/TriDiagonalSystem.js.map +1 -1
- package/lib/cjs/numerics/UnionFind.js.map +1 -1
- package/lib/cjs/numerics/UsageSums.js.map +1 -1
- package/lib/cjs/polyface/AuxData.js.map +1 -1
- package/lib/cjs/polyface/BoxTopology.js.map +1 -1
- package/lib/cjs/polyface/FacetFaceData.js.map +1 -1
- package/lib/cjs/polyface/FacetLocationDetail.js.map +1 -1
- package/lib/cjs/polyface/FacetOrientation.js.map +1 -1
- package/lib/cjs/polyface/GreedyTriangulationBetweenLineStrings.js.map +1 -1
- package/lib/cjs/polyface/IndexedEdgeMatcher.js.map +1 -1
- package/lib/cjs/polyface/IndexedPolyfaceVisitor.js.map +1 -1
- package/lib/cjs/polyface/IndexedPolyfaceWalker.js.map +1 -1
- package/lib/cjs/polyface/Polyface.js.map +1 -1
- package/lib/cjs/polyface/PolyfaceBuilder.js.map +1 -1
- package/lib/cjs/polyface/PolyfaceClip.js.map +1 -1
- package/lib/cjs/polyface/PolyfaceData.js.map +1 -1
- package/lib/cjs/polyface/PolyfaceQuery.js.map +1 -1
- package/lib/cjs/polyface/RangeLengthData.js.map +1 -1
- package/lib/cjs/polyface/RangeTree/LineString3dRangeTreeContext.js.map +1 -1
- package/lib/cjs/polyface/RangeTree/MinimumValueTester.js.map +1 -1
- package/lib/cjs/polyface/RangeTree/Point3dArrayRangeTreeContext.js.map +1 -1
- package/lib/cjs/polyface/RangeTree/PolyfaceRangeTreeContext.js.map +1 -1
- package/lib/cjs/polyface/RangeTree/RangeTreeNode.js.map +1 -1
- package/lib/cjs/polyface/RangeTree/RangeTreeSearchHandlers.js.map +1 -1
- package/lib/cjs/polyface/TaggedNumericData.js.map +1 -1
- package/lib/cjs/polyface/TriangleCandidate.js.map +1 -1
- package/lib/cjs/polyface/multiclip/BuildAverageNormalsContext.js.map +1 -1
- package/lib/cjs/polyface/multiclip/GriddedRaggedRange2dSet.js.map +1 -1
- package/lib/cjs/polyface/multiclip/GriddedRaggedRange2dSetWithOverflow.js.map +1 -1
- package/lib/cjs/polyface/multiclip/LinearSearchRange2dArray.js.map +1 -1
- package/lib/cjs/polyface/multiclip/OffsetMeshContext.js.map +1 -1
- package/lib/cjs/polyface/multiclip/Range2dSearchInterface.js.map +1 -1
- package/lib/cjs/polyface/multiclip/RangeSearch.js.map +1 -1
- package/lib/cjs/polyface/multiclip/SweepLineStringToFacetContext.js.map +1 -1
- package/lib/cjs/polyface/multiclip/XYPointBuckets.js.map +1 -1
- package/lib/cjs/serialization/BGFBAccessors.js.map +1 -1
- package/lib/cjs/serialization/BGFBReader.js.map +1 -1
- package/lib/cjs/serialization/BGFBWriter.js.map +1 -1
- package/lib/cjs/serialization/BentleyGeometryFlatBuffer.js.map +1 -1
- package/lib/cjs/serialization/DeepCompare.js.map +1 -1
- package/lib/cjs/serialization/IModelJsonSchema.js.map +1 -1
- package/lib/cjs/serialization/SerializationHelpers.js.map +1 -1
- package/lib/cjs/solid/Box.js.map +1 -1
- package/lib/cjs/solid/Cone.js.map +1 -1
- package/lib/cjs/solid/LinearSweep.js.map +1 -1
- package/lib/cjs/solid/RotationalSweep.js.map +1 -1
- package/lib/cjs/solid/RuledSweep.js.map +1 -1
- package/lib/cjs/solid/SolidPrimitive.js.map +1 -1
- package/lib/cjs/solid/Sphere.js.map +1 -1
- package/lib/cjs/solid/SweepContour.js.map +1 -1
- package/lib/cjs/solid/TorusPipe.js.map +1 -1
- package/lib/cjs/topology/ChainMerge.js.map +1 -1
- package/lib/cjs/topology/Graph.js.map +1 -1
- package/lib/cjs/topology/HalfEdgeGraphFromIndexedLoopsContext.js.map +1 -1
- package/lib/cjs/topology/HalfEdgeGraphSearch.js.map +1 -1
- package/lib/cjs/topology/HalfEdgeGraphSpineContext.d.ts.map +1 -1
- package/lib/cjs/topology/HalfEdgeGraphSpineContext.js +3 -1
- package/lib/cjs/topology/HalfEdgeGraphSpineContext.js.map +1 -1
- package/lib/cjs/topology/HalfEdgeGraphValidation.js.map +1 -1
- package/lib/cjs/topology/HalfEdgeMarkSet.js.map +1 -1
- package/lib/cjs/topology/HalfEdgeNodeXYZUV.js.map +1 -1
- package/lib/cjs/topology/HalfEdgePointInGraphSearch.js.map +1 -1
- package/lib/cjs/topology/HalfEdgePositionDetail.js.map +1 -1
- package/lib/cjs/topology/HalfEdgePriorityQueue.js.map +1 -1
- package/lib/cjs/topology/InsertAndRetriangulateContext.js.map +1 -1
- package/lib/cjs/topology/MaskManager.js.map +1 -1
- package/lib/cjs/topology/Merging.js.map +1 -1
- package/lib/cjs/topology/RegularizeFace.js.map +1 -1
- package/lib/cjs/topology/SignedDataSummary.js.map +1 -1
- package/lib/cjs/topology/SpaceTriangulation.js.map +1 -1
- package/lib/cjs/topology/Triangulation.js.map +1 -1
- package/lib/cjs/topology/Voronoi.js.map +1 -1
- package/lib/cjs/topology/XYParitySearchContext.js.map +1 -1
- package/lib/esm/Constant.js.map +1 -1
- package/lib/esm/Geometry.d.ts +24 -14
- package/lib/esm/Geometry.d.ts.map +1 -1
- package/lib/esm/Geometry.js +34 -14
- 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 +1 -0
- package/lib/esm/core-geometry.js.map +1 -1
- package/lib/esm/curve/Arc3d.d.ts +4 -0
- package/lib/esm/curve/Arc3d.d.ts.map +1 -1
- package/lib/esm/curve/Arc3d.js +14 -0
- package/lib/esm/curve/Arc3d.js.map +1 -1
- package/lib/esm/curve/ConstrainedCurve2d.d.ts +149 -0
- package/lib/esm/curve/ConstrainedCurve2d.d.ts.map +1 -0
- package/lib/esm/curve/ConstrainedCurve2d.js +313 -0
- package/lib/esm/curve/ConstrainedCurve2d.js.map +1 -0
- package/lib/esm/curve/ConstructCurveBetweenCurves.js.map +1 -1
- package/lib/esm/curve/CoordinateXYZ.js.map +1 -1
- package/lib/esm/curve/CurveChainWithDistanceIndex.js.map +1 -1
- package/lib/esm/curve/CurveCollection.js.map +1 -1
- package/lib/esm/curve/CurveCurve.js.map +1 -1
- package/lib/esm/curve/CurveExtendMode.js.map +1 -1
- package/lib/esm/curve/CurveFactory.d.ts.map +1 -1
- package/lib/esm/curve/CurveFactory.js.map +1 -1
- package/lib/esm/curve/CurveLocationDetail.js.map +1 -1
- package/lib/esm/curve/CurveOps.js.map +1 -1
- package/lib/esm/curve/CurvePrimitive.d.ts +2 -2
- package/lib/esm/curve/CurvePrimitive.js +2 -2
- package/lib/esm/curve/CurvePrimitive.js.map +1 -1
- package/lib/esm/curve/CurveProcessor.js.map +1 -1
- package/lib/esm/curve/CurveTypes.js.map +1 -1
- package/lib/esm/curve/CurveWireMomentsXYZ.js.map +1 -1
- package/lib/esm/curve/GeometryQuery.js.map +1 -1
- package/lib/esm/curve/LineSegment3d.js.map +1 -1
- package/lib/esm/curve/LineString3d.js.map +1 -1
- package/lib/esm/curve/Loop.js.map +1 -1
- package/lib/esm/curve/OffsetOptions.js.map +1 -1
- package/lib/esm/curve/ParityRegion.js.map +1 -1
- package/lib/esm/curve/Path.js.map +1 -1
- package/lib/esm/curve/PointString3d.js.map +1 -1
- package/lib/esm/curve/ProxyCurve.js.map +1 -1
- package/lib/esm/curve/Query/ConsolidateAdjacentPrimitivesContext.js.map +1 -1
- package/lib/esm/curve/Query/CurveSplitContext.js.map +1 -1
- package/lib/esm/curve/Query/CylindricalRange.js.map +1 -1
- package/lib/esm/curve/Query/InOutTests.js.map +1 -1
- package/lib/esm/curve/Query/PlanarSubdivision.js.map +1 -1
- package/lib/esm/curve/Query/StrokeCountChain.js.map +1 -1
- package/lib/esm/curve/Query/StrokeCountMap.js.map +1 -1
- package/lib/esm/curve/RegionMomentsXY.js.map +1 -1
- package/lib/esm/curve/RegionOps.js.map +1 -1
- package/lib/esm/curve/RegionOpsClassificationSweeps.js.map +1 -1
- package/lib/esm/curve/StrokeOptions.js.map +1 -1
- package/lib/esm/curve/UnionRegion.js.map +1 -1
- package/lib/esm/curve/internalContexts/AnnounceTangentStrokeHandler.js.map +1 -1
- package/lib/esm/curve/internalContexts/AppendPlaneIntersectionStrokeHandler.js.map +1 -1
- package/lib/esm/curve/internalContexts/ChainCollectorContext.js.map +1 -1
- package/lib/esm/curve/internalContexts/CloneCurvesContext.js.map +1 -1
- package/lib/esm/curve/internalContexts/CloneWithExpandedLineStrings.js.map +1 -1
- package/lib/esm/curve/internalContexts/ClosestPointStrokeHandler.js.map +1 -1
- package/lib/esm/curve/internalContexts/CountLinearPartsSearchContext.js.map +1 -1
- package/lib/esm/curve/internalContexts/CurveCurveCloseApproachXY.js.map +1 -1
- package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.js.map +1 -1
- package/lib/esm/curve/internalContexts/CurveCurveIntersectXYZ.js.map +1 -1
- package/lib/esm/curve/internalContexts/CurveLengthContext.js.map +1 -1
- package/lib/esm/curve/internalContexts/CurveOffsetXYHandler.js.map +1 -1
- package/lib/esm/curve/internalContexts/EllipticalArcApproximationContext.js.map +1 -1
- package/lib/esm/curve/internalContexts/GapSearchContext.js.map +1 -1
- package/lib/esm/curve/internalContexts/MultiChainCollector.js.map +1 -1
- package/lib/esm/curve/internalContexts/NewtonRtoRStrokeHandler.js.map +1 -1
- package/lib/esm/curve/internalContexts/PlaneAltitudeRangeContext.js.map +1 -1
- package/lib/esm/curve/internalContexts/PointToCurveTangentHandler.d.ts +26 -0
- package/lib/esm/curve/internalContexts/PointToCurveTangentHandler.d.ts.map +1 -0
- package/lib/esm/curve/internalContexts/PointToCurveTangentHandler.js +74 -0
- package/lib/esm/curve/internalContexts/PointToCurveTangentHandler.js.map +1 -0
- package/lib/esm/curve/internalContexts/PolygonOffsetContext.js.map +1 -1
- package/lib/esm/curve/internalContexts/SumLengthsContext.js.map +1 -1
- package/lib/esm/curve/internalContexts/TransferWithSplitArcs.js.map +1 -1
- package/lib/esm/curve/internalContexts/TransformInPlaceContext.js.map +1 -1
- package/lib/esm/curve/internalContexts/geometry2d/ConstrainedImplicitCurve2d.d.ts +152 -0
- package/lib/esm/curve/internalContexts/geometry2d/ConstrainedImplicitCurve2d.d.ts.map +1 -0
- package/lib/esm/curve/internalContexts/geometry2d/ConstrainedImplicitCurve2d.js +839 -0
- package/lib/esm/curve/internalContexts/geometry2d/ConstrainedImplicitCurve2d.js.map +1 -0
- package/lib/esm/curve/internalContexts/geometry2d/ConstraintSet.d.ts +97 -0
- package/lib/esm/curve/internalContexts/geometry2d/ConstraintSet.d.ts.map +1 -0
- package/lib/esm/curve/internalContexts/geometry2d/ConstraintSet.js +295 -0
- package/lib/esm/curve/internalContexts/geometry2d/ConstraintSet.js.map +1 -0
- package/lib/esm/curve/internalContexts/geometry2d/ImplicitCurve2d.d.ts +105 -0
- package/lib/esm/curve/internalContexts/geometry2d/ImplicitCurve2d.d.ts.map +1 -0
- package/lib/esm/curve/internalContexts/geometry2d/ImplicitCurve2d.js +135 -0
- package/lib/esm/curve/internalContexts/geometry2d/ImplicitCurve2d.js.map +1 -0
- package/lib/esm/curve/internalContexts/geometry2d/ImplicitCurve2dConverter.d.ts +27 -0
- package/lib/esm/curve/internalContexts/geometry2d/ImplicitCurve2dConverter.d.ts.map +1 -0
- package/lib/esm/curve/internalContexts/geometry2d/ImplicitCurve2dConverter.js +148 -0
- package/lib/esm/curve/internalContexts/geometry2d/ImplicitCurve2dConverter.js.map +1 -0
- package/lib/esm/curve/internalContexts/geometry2d/UnboundedCircle2d.d.ts +81 -0
- package/lib/esm/curve/internalContexts/geometry2d/UnboundedCircle2d.d.ts.map +1 -0
- package/lib/esm/curve/internalContexts/geometry2d/UnboundedCircle2d.js +166 -0
- package/lib/esm/curve/internalContexts/geometry2d/UnboundedCircle2d.js.map +1 -0
- package/lib/esm/curve/internalContexts/geometry2d/UnboundedEllipse2d.d.ts +96 -0
- package/lib/esm/curve/internalContexts/geometry2d/UnboundedEllipse2d.d.ts.map +1 -0
- package/lib/esm/curve/internalContexts/geometry2d/UnboundedEllipse2d.js +183 -0
- package/lib/esm/curve/internalContexts/geometry2d/UnboundedEllipse2d.js.map +1 -0
- package/lib/esm/curve/internalContexts/geometry2d/UnboundedHyperbola2d.d.ts +91 -0
- package/lib/esm/curve/internalContexts/geometry2d/UnboundedHyperbola2d.d.ts.map +1 -0
- package/lib/esm/curve/internalContexts/geometry2d/UnboundedHyperbola2d.js +193 -0
- package/lib/esm/curve/internalContexts/geometry2d/UnboundedHyperbola2d.js.map +1 -0
- package/lib/esm/curve/internalContexts/geometry2d/UnboundedLine2d.d.ts +129 -0
- package/lib/esm/curve/internalContexts/geometry2d/UnboundedLine2d.d.ts.map +1 -0
- package/lib/esm/curve/internalContexts/geometry2d/UnboundedLine2d.js +204 -0
- package/lib/esm/curve/internalContexts/geometry2d/UnboundedLine2d.js.map +1 -0
- package/lib/esm/curve/internalContexts/geometry2d/UnboundedParabola2d.d.ts +87 -0
- package/lib/esm/curve/internalContexts/geometry2d/UnboundedParabola2d.d.ts.map +1 -0
- package/lib/esm/curve/internalContexts/geometry2d/UnboundedParabola2d.js +189 -0
- package/lib/esm/curve/internalContexts/geometry2d/UnboundedParabola2d.js.map +1 -0
- package/lib/esm/curve/spiral/AustralianRailCorpXYEvaluator.js.map +1 -1
- package/lib/esm/curve/spiral/ClothoidSeries.js.map +1 -1
- package/lib/esm/curve/spiral/CubicEvaluator.js.map +1 -1
- package/lib/esm/curve/spiral/CzechSpiralEvaluator.js.map +1 -1
- package/lib/esm/curve/spiral/DirectHalfCosineSpiralEvaluator.js.map +1 -1
- package/lib/esm/curve/spiral/DirectSpiral3d.js.map +1 -1
- package/lib/esm/curve/spiral/IntegratedSpiral3d.js.map +1 -1
- package/lib/esm/curve/spiral/MXCubicAlongArcSpiralEvaluator.js.map +1 -1
- package/lib/esm/curve/spiral/NormalizedTransition.js.map +1 -1
- package/lib/esm/curve/spiral/PolishCubicSpiralEvaluator.js.map +1 -1
- package/lib/esm/curve/spiral/TransitionConditionalProperties.js.map +1 -1
- package/lib/esm/curve/spiral/TransitionSpiral3d.js.map +1 -1
- package/lib/esm/curve/spiral/XYCurveEvaluator.js.map +1 -1
- package/lib/esm/geometry3d/Angle.js.map +1 -1
- package/lib/esm/geometry3d/AngleSweep.js.map +1 -1
- package/lib/esm/geometry3d/BarycentricTriangle.js.map +1 -1
- package/lib/esm/geometry3d/BilinearPatch.js.map +1 -1
- package/lib/esm/geometry3d/CoincidentGeometryOps.js.map +1 -1
- package/lib/esm/geometry3d/Ellipsoid.js.map +1 -1
- package/lib/esm/geometry3d/FrameBuilder.js.map +1 -1
- package/lib/esm/geometry3d/FrustumAnimation.js.map +1 -1
- package/lib/esm/geometry3d/GeometryHandler.js.map +1 -1
- package/lib/esm/geometry3d/GrowableBlockedArray.js.map +1 -1
- package/lib/esm/geometry3d/GrowableFloat64Array.js.map +1 -1
- package/lib/esm/geometry3d/GrowableXYArray.js.map +1 -1
- package/lib/esm/geometry3d/GrowableXYZArray.js.map +1 -1
- package/lib/esm/geometry3d/IndexedCollectionInterval.js.map +1 -1
- package/lib/esm/geometry3d/IndexedXYCollection.js.map +1 -1
- package/lib/esm/geometry3d/IndexedXYZCollection.js.map +1 -1
- package/lib/esm/geometry3d/LongitudeLatitudeAltitude.js.map +1 -1
- package/lib/esm/geometry3d/Matrix3d.js.map +1 -1
- package/lib/esm/geometry3d/OrderedRotationAngles.js.map +1 -1
- package/lib/esm/geometry3d/Plane3d.js.map +1 -1
- package/lib/esm/geometry3d/Plane3dByOriginAndUnitNormal.js.map +1 -1
- package/lib/esm/geometry3d/Plane3dByOriginAndVectors.js.map +1 -1
- package/lib/esm/geometry3d/Point2dArrayCarrier.js.map +1 -1
- package/lib/esm/geometry3d/Point2dVector2d.d.ts +7 -0
- package/lib/esm/geometry3d/Point2dVector2d.d.ts.map +1 -1
- package/lib/esm/geometry3d/Point2dVector2d.js +9 -0
- package/lib/esm/geometry3d/Point2dVector2d.js.map +1 -1
- package/lib/esm/geometry3d/Point3dArrayCarrier.js.map +1 -1
- package/lib/esm/geometry3d/Point3dVector3d.js.map +1 -1
- package/lib/esm/geometry3d/PointHelpers.js.map +1 -1
- package/lib/esm/geometry3d/PointStreaming.js.map +1 -1
- package/lib/esm/geometry3d/PolygonOps.js.map +1 -1
- package/lib/esm/geometry3d/PolylineCompressionByEdgeOffset.js.map +1 -1
- package/lib/esm/geometry3d/PolylineOps.js.map +1 -1
- package/lib/esm/geometry3d/Range.js.map +1 -1
- package/lib/esm/geometry3d/Ray2d.js.map +1 -1
- package/lib/esm/geometry3d/Ray3d.js.map +1 -1
- package/lib/esm/geometry3d/ReusableObjectCache.js.map +1 -1
- package/lib/esm/geometry3d/Segment1d.js.map +1 -1
- package/lib/esm/geometry3d/SortablePolygon.js.map +1 -1
- package/lib/esm/geometry3d/Transform.js.map +1 -1
- package/lib/esm/geometry3d/UVSurfaceOps.js.map +1 -1
- package/lib/esm/geometry3d/XYZProps.js.map +1 -1
- package/lib/esm/geometry3d/YawPitchRollAngles.js.map +1 -1
- package/lib/esm/geometry4d/Map4d.js.map +1 -1
- package/lib/esm/geometry4d/Matrix4d.js.map +1 -1
- package/lib/esm/geometry4d/MomentData.js.map +1 -1
- package/lib/esm/geometry4d/PlaneByOriginAndVectors4d.js.map +1 -1
- package/lib/esm/geometry4d/Point4d.js.map +1 -1
- package/lib/esm/numerics/BandedSystem.js.map +1 -1
- package/lib/esm/numerics/BezierPolynomials.js.map +1 -1
- package/lib/esm/numerics/ClusterableArray.js.map +1 -1
- package/lib/esm/numerics/Complex.js.map +1 -1
- package/lib/esm/numerics/ConvexPolygon2d.js.map +1 -1
- package/lib/esm/numerics/Newton.js.map +1 -1
- package/lib/esm/numerics/PascalCoefficients.js.map +1 -1
- package/lib/esm/numerics/PolarData.js.map +1 -1
- package/lib/esm/numerics/Polynomials.d.ts.map +1 -1
- package/lib/esm/numerics/Polynomials.js +8 -6
- package/lib/esm/numerics/Polynomials.js.map +1 -1
- package/lib/esm/numerics/Quadrature.js.map +1 -1
- package/lib/esm/numerics/Range1dArray.js.map +1 -1
- package/lib/esm/numerics/SmallSystem.js.map +1 -1
- package/lib/esm/numerics/TriDiagonalSystem.js.map +1 -1
- package/lib/esm/numerics/UnionFind.js.map +1 -1
- package/lib/esm/numerics/UsageSums.js.map +1 -1
- package/lib/esm/polyface/AuxData.js.map +1 -1
- package/lib/esm/polyface/BoxTopology.js.map +1 -1
- package/lib/esm/polyface/FacetFaceData.js.map +1 -1
- package/lib/esm/polyface/FacetLocationDetail.js.map +1 -1
- package/lib/esm/polyface/FacetOrientation.js.map +1 -1
- package/lib/esm/polyface/GreedyTriangulationBetweenLineStrings.js.map +1 -1
- package/lib/esm/polyface/IndexedEdgeMatcher.js.map +1 -1
- package/lib/esm/polyface/IndexedPolyfaceVisitor.js.map +1 -1
- package/lib/esm/polyface/IndexedPolyfaceWalker.js.map +1 -1
- package/lib/esm/polyface/Polyface.js.map +1 -1
- package/lib/esm/polyface/PolyfaceBuilder.js.map +1 -1
- package/lib/esm/polyface/PolyfaceClip.js.map +1 -1
- package/lib/esm/polyface/PolyfaceData.js.map +1 -1
- package/lib/esm/polyface/PolyfaceQuery.js.map +1 -1
- package/lib/esm/polyface/RangeLengthData.js.map +1 -1
- package/lib/esm/polyface/RangeTree/LineString3dRangeTreeContext.js.map +1 -1
- package/lib/esm/polyface/RangeTree/MinimumValueTester.js.map +1 -1
- package/lib/esm/polyface/RangeTree/Point3dArrayRangeTreeContext.js.map +1 -1
- package/lib/esm/polyface/RangeTree/PolyfaceRangeTreeContext.js.map +1 -1
- package/lib/esm/polyface/RangeTree/RangeTreeNode.js.map +1 -1
- package/lib/esm/polyface/RangeTree/RangeTreeSearchHandlers.js.map +1 -1
- package/lib/esm/polyface/TaggedNumericData.js.map +1 -1
- package/lib/esm/polyface/TriangleCandidate.js.map +1 -1
- package/lib/esm/polyface/multiclip/BuildAverageNormalsContext.js.map +1 -1
- package/lib/esm/polyface/multiclip/GriddedRaggedRange2dSet.js.map +1 -1
- package/lib/esm/polyface/multiclip/GriddedRaggedRange2dSetWithOverflow.js.map +1 -1
- package/lib/esm/polyface/multiclip/LinearSearchRange2dArray.js.map +1 -1
- package/lib/esm/polyface/multiclip/OffsetMeshContext.js.map +1 -1
- package/lib/esm/polyface/multiclip/Range2dSearchInterface.js.map +1 -1
- package/lib/esm/polyface/multiclip/RangeSearch.js.map +1 -1
- package/lib/esm/polyface/multiclip/SweepLineStringToFacetContext.js.map +1 -1
- package/lib/esm/polyface/multiclip/XYPointBuckets.js.map +1 -1
- package/lib/esm/serialization/BGFBAccessors.js.map +1 -1
- package/lib/esm/serialization/BGFBReader.js.map +1 -1
- package/lib/esm/serialization/BGFBWriter.js.map +1 -1
- package/lib/esm/serialization/BentleyGeometryFlatBuffer.js.map +1 -1
- package/lib/esm/serialization/DeepCompare.js.map +1 -1
- package/lib/esm/serialization/IModelJsonSchema.js.map +1 -1
- package/lib/esm/serialization/SerializationHelpers.js.map +1 -1
- package/lib/esm/solid/Box.js.map +1 -1
- package/lib/esm/solid/Cone.js.map +1 -1
- package/lib/esm/solid/LinearSweep.js.map +1 -1
- package/lib/esm/solid/RotationalSweep.js.map +1 -1
- package/lib/esm/solid/RuledSweep.js.map +1 -1
- package/lib/esm/solid/SolidPrimitive.js.map +1 -1
- package/lib/esm/solid/Sphere.js.map +1 -1
- package/lib/esm/solid/SweepContour.js.map +1 -1
- package/lib/esm/solid/TorusPipe.js.map +1 -1
- package/lib/esm/topology/ChainMerge.js.map +1 -1
- package/lib/esm/topology/Graph.js.map +1 -1
- package/lib/esm/topology/HalfEdgeGraphFromIndexedLoopsContext.js.map +1 -1
- package/lib/esm/topology/HalfEdgeGraphSearch.js.map +1 -1
- package/lib/esm/topology/HalfEdgeGraphSpineContext.d.ts.map +1 -1
- package/lib/esm/topology/HalfEdgeGraphSpineContext.js +3 -1
- package/lib/esm/topology/HalfEdgeGraphSpineContext.js.map +1 -1
- package/lib/esm/topology/HalfEdgeGraphValidation.js.map +1 -1
- package/lib/esm/topology/HalfEdgeMarkSet.js.map +1 -1
- package/lib/esm/topology/HalfEdgeNodeXYZUV.js.map +1 -1
- package/lib/esm/topology/HalfEdgePointInGraphSearch.js.map +1 -1
- package/lib/esm/topology/HalfEdgePositionDetail.js.map +1 -1
- package/lib/esm/topology/HalfEdgePriorityQueue.js.map +1 -1
- package/lib/esm/topology/InsertAndRetriangulateContext.js.map +1 -1
- package/lib/esm/topology/MaskManager.js.map +1 -1
- package/lib/esm/topology/Merging.js.map +1 -1
- package/lib/esm/topology/RegularizeFace.js.map +1 -1
- package/lib/esm/topology/SignedDataSummary.js.map +1 -1
- package/lib/esm/topology/SpaceTriangulation.js.map +1 -1
- package/lib/esm/topology/Triangulation.js.map +1 -1
- package/lib/esm/topology/Voronoi.js.map +1 -1
- package/lib/esm/topology/XYParitySearchContext.js.map +1 -1
- package/package.json +3 -3
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
/*---------------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
|
+
/** @packageDocumentation
|
|
6
|
+
* @module CartesianGeometry
|
|
7
|
+
*/
|
|
8
|
+
import { SmallSystem } from "../../../numerics/SmallSystem";
|
|
9
|
+
import { Geometry } from "../../../Geometry";
|
|
10
|
+
import { Point2d, Vector2d } from "../../../geometry3d/Point2dVector2d";
|
|
11
|
+
import { TrigPolynomial } from "../../../numerics/Polynomials";
|
|
12
|
+
import { ImplicitCurve2d } from "./ImplicitCurve2d";
|
|
13
|
+
/**
|
|
14
|
+
* Internal class for hyperbola in the xy plane. The hyperbola equation in angular parameterization is
|
|
15
|
+
* * X = A + U * sec(theta) + V * tan(theta)
|
|
16
|
+
* which means that in the (skewed and scaled) coordinate system with origin at A and local u and v as
|
|
17
|
+
* multiples of U and V the implicit equation is u^2 - v^2 = 1
|
|
18
|
+
* which means the hyperbola opens along the positive and negative U axis with asymptotes at 45 degrees,
|
|
19
|
+
* i.e., along the directions (U+V) and (U-V)
|
|
20
|
+
* @internal
|
|
21
|
+
*/
|
|
22
|
+
export class UnboundedHyperbola2d extends ImplicitCurve2d {
|
|
23
|
+
/** The Cartesian coordinates of any center on the line. */
|
|
24
|
+
center;
|
|
25
|
+
/** The local u axis direction. */
|
|
26
|
+
vectorU;
|
|
27
|
+
/** The local v axis direction. */
|
|
28
|
+
vectorV;
|
|
29
|
+
/* Constructor - CAPTURE given center and axis vectors */
|
|
30
|
+
constructor(center, vectorU, vectorV) {
|
|
31
|
+
super();
|
|
32
|
+
this.center = center;
|
|
33
|
+
this.vectorU = vectorU;
|
|
34
|
+
this.vectorV = vectorV;
|
|
35
|
+
}
|
|
36
|
+
/** Return a clone of this hyperbola. */
|
|
37
|
+
clone() {
|
|
38
|
+
// the create method clones the inputs
|
|
39
|
+
return UnboundedHyperbola2d.createCenterAndAxisVectors(this.center, this.vectorU, this.vectorV);
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Create UnboundedHyperbola2d with scale factors.
|
|
43
|
+
* * The implicit equation is (x/a)^2 - (y/b)^2 = 1
|
|
44
|
+
* @param centerX x coordinate of center
|
|
45
|
+
* @param centerY y coordinate of center
|
|
46
|
+
* @param scaleU scale factor along the U axis
|
|
47
|
+
* @param scaleV scale factor along the V axis
|
|
48
|
+
* @returns newly created hyperbola object
|
|
49
|
+
*/
|
|
50
|
+
static createFromCenterAndScales(centerX, centerY, scaleU, scaleV) {
|
|
51
|
+
return new UnboundedHyperbola2d(Point2d.create(centerX, centerY), Vector2d.create(scaleU, 0), Vector2d.create(0, scaleV));
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Create an UnboundedHyperbola2d from an xy object and a radius.
|
|
55
|
+
* @param center xy coordinates of center
|
|
56
|
+
* @param vectorU vector from center to to theta=0 vertex, i.e. along axis on the "inside" of the curve
|
|
57
|
+
* @param vectorV vector from center to the transverse direction
|
|
58
|
+
*/
|
|
59
|
+
static createCenterAndAxisVectors(center, vectorU, vectorV) {
|
|
60
|
+
return new UnboundedHyperbola2d(Point2d.create(center.x, center.y), Vector2d.create(vectorU.x, vectorU.y), Vector2d.create(vectorV.x, vectorV.y));
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Return the local (uv) coordinate of a global point.
|
|
64
|
+
* @param spacePoint point for coordinate conversion
|
|
65
|
+
*/
|
|
66
|
+
globalToLocal(spacePoint) {
|
|
67
|
+
const result = Vector2d.create();
|
|
68
|
+
if (SmallSystem.linearSystem2d(this.vectorU.x, this.vectorV.x, this.vectorU.y, this.vectorV.y, spacePoint.x - this.center.x, spacePoint.y - this.center.y, result))
|
|
69
|
+
return result;
|
|
70
|
+
return undefined;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Returns xy coordinate on the hyperbola.
|
|
74
|
+
* @param radians parametric angle on the hyperbola
|
|
75
|
+
*/
|
|
76
|
+
radiansToPoint2d(radians) {
|
|
77
|
+
const c = Math.cos(radians);
|
|
78
|
+
const s = Math.sin(radians);
|
|
79
|
+
if (Geometry.isSmallMetricDistance(Math.abs(c)))
|
|
80
|
+
return undefined;
|
|
81
|
+
return this.center.plus2Scaled(this.vectorU, 1.0 / c, this.vectorV, s / c);
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Returns the tangent at given radians value.
|
|
85
|
+
* @param radians parametric angle on the hyperbola
|
|
86
|
+
*/
|
|
87
|
+
radiansToTangentVector2d(radians) {
|
|
88
|
+
// The curve is parameterized as X = A + U * sec(theta) + V * tan(theta)
|
|
89
|
+
// Its tangent vector (derivative) is X' = U * sec(theta) * tan(theta + V * tan^2(theta))
|
|
90
|
+
const c = Math.cos(radians);
|
|
91
|
+
const s = Math.sin(radians);
|
|
92
|
+
const cc = c * c;
|
|
93
|
+
const sec2 = Geometry.conditionalDivideCoordinate(1.0, cc);
|
|
94
|
+
const secTan = Geometry.conditionalDivideCoordinate(s, cc);
|
|
95
|
+
if (sec2 === undefined || secTan === undefined)
|
|
96
|
+
return undefined;
|
|
97
|
+
return Vector2d.createAdd2Scaled(this.vectorU, secTan, this.vectorV, sec2);
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Return the implicit function value at xy.
|
|
101
|
+
* @param xy space point
|
|
102
|
+
* @returns squared local (uv) coordinates minus 1.
|
|
103
|
+
*/
|
|
104
|
+
functionValue(xy) {
|
|
105
|
+
const vectorUV = this.globalToLocal(xy);
|
|
106
|
+
if (vectorUV === undefined)
|
|
107
|
+
return 0;
|
|
108
|
+
return vectorUV.x * vectorUV.x - vectorUV.y * vectorUV.y - 1.0;
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Evaluate the gradient (steepest descent) of the implicit function.
|
|
112
|
+
* @param xy space point
|
|
113
|
+
* @returns gradient vector for the implicit function
|
|
114
|
+
*/
|
|
115
|
+
gradient(xy) {
|
|
116
|
+
const vectorUV = this.globalToLocal(xy);
|
|
117
|
+
const result = Vector2d.create();
|
|
118
|
+
// use INVERSE of TRANSPOSE of [UV] matrix to map gradient terms
|
|
119
|
+
if (vectorUV !== undefined && SmallSystem.linearSystem2d(this.vectorU.x, this.vectorU.y, this.vectorV.x, this.vectorV.y, 2 * vectorUV.x, -2 * vectorUV.y, result))
|
|
120
|
+
return result;
|
|
121
|
+
return Vector2d.create(0, 0);
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Solve for parametric radians at hyperbola points which are perpendicular projections of spacePoint.
|
|
125
|
+
* * Up to 4 solutions are possible.
|
|
126
|
+
* @param spacePoint the space point.
|
|
127
|
+
* @handler the handler to receive all the points on the curve and radians where perpendicular happens.
|
|
128
|
+
*/
|
|
129
|
+
emitPerpendiculars(spacePoint, handler) {
|
|
130
|
+
const centerToSpacePoint = Vector2d.createStartEnd(spacePoint, this.center);
|
|
131
|
+
// coefficients of C and S where C and S are the unit circle points parameterized by theta.
|
|
132
|
+
// Hyperbola point at theta is X = A + U sec + V tan
|
|
133
|
+
// tangent is T = U sec tan + V sec^2
|
|
134
|
+
// vector W = spacePOint - this.center
|
|
135
|
+
// perpendicular condition for vector V from space point is
|
|
136
|
+
// 0 = T dot (spacePoint - X) = T dot (W - U sec - V tan)
|
|
137
|
+
// multiply through by cos^4 and there are various appearances of sine and cosine
|
|
138
|
+
// in the numerator. There are constant term, terms with one trig, and terms with product
|
|
139
|
+
// of 2 trigs. This fits the call list for solving "intersection" of a quadric with unit circle.
|
|
140
|
+
//
|
|
141
|
+
const coffSC = centerToSpacePoint.dotProduct(this.vectorU);
|
|
142
|
+
const coffC = centerToSpacePoint.dotProduct(this.vectorV);
|
|
143
|
+
const coffS = this.vectorU.dotProduct(this.vectorU) + this.vectorV.dotProduct(this.vectorV);
|
|
144
|
+
const coff1 = this.vectorU.dotProduct(this.vectorV);
|
|
145
|
+
const coffSS = this.vectorV.dotProduct(this.vectorU);
|
|
146
|
+
const radiansSolutions = [];
|
|
147
|
+
TrigPolynomial.solveUnitCircleImplicitQuadricIntersection(0, coffSC, coffSS, coffC, coffS, coff1, radiansSolutions);
|
|
148
|
+
for (const radians of radiansSolutions) {
|
|
149
|
+
const s = Math.sin(radians);
|
|
150
|
+
const c = Math.cos(radians);
|
|
151
|
+
const curvePoint = this.center.plus2Scaled(this.vectorU, 1.0 / c, this.vectorV, s / c);
|
|
152
|
+
handler(curvePoint, radians);
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
/** Returns true if the circle radius is near zero. */
|
|
156
|
+
// eslint-disable-next-line @itwin/prefer-get
|
|
157
|
+
isDegenerate() {
|
|
158
|
+
return undefined === this.globalToLocal(Point2d.create(0, 0));
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* Test if the centers and axes of the vectors are close
|
|
162
|
+
* @param other second hyperbola
|
|
163
|
+
* @param negatedAndExchangedAxesAreEqual
|
|
164
|
+
* * if false, a strong equality test requiring both U and V vectors to match
|
|
165
|
+
* * This strong test is a test for identical parameterization
|
|
166
|
+
* * if true, a weak equality test that allows U and V to be negated and or exchanged.
|
|
167
|
+
* * The weak test is a test for the same implicit set
|
|
168
|
+
* @returns true if identical to tolerance.
|
|
169
|
+
*/
|
|
170
|
+
isSameHyperbola(other, negatedAndExchangedAxesAreEqual = false) {
|
|
171
|
+
const almostEqualOrNegated = (vectorU, vectorV) => {
|
|
172
|
+
if (Geometry.isSameCoordinate(vectorU.x, vectorV.x) && Geometry.isSameCoordinate(vectorU.y, vectorV.y))
|
|
173
|
+
return 1;
|
|
174
|
+
if (Geometry.isSameCoordinate(vectorU.x, -vectorV.x) && Geometry.isSameCoordinate(vectorU.y, -vectorV.y))
|
|
175
|
+
return -1;
|
|
176
|
+
return 0;
|
|
177
|
+
};
|
|
178
|
+
if (Geometry.isSamePoint2d(this.center, other.center)) {
|
|
179
|
+
if (!negatedAndExchangedAxesAreEqual)
|
|
180
|
+
return this.vectorU.isAlmostEqualMetric(other.vectorU) && this.vectorV.isAlmostEqualMetric(other.vectorV);
|
|
181
|
+
const uuCode = almostEqualOrNegated(this.vectorU, other.vectorU);
|
|
182
|
+
const vvCode = almostEqualOrNegated(this.vectorV, other.vectorV);
|
|
183
|
+
if (uuCode !== 0 && vvCode !== 0)
|
|
184
|
+
return true;
|
|
185
|
+
const uvCode = almostEqualOrNegated(this.vectorU, other.vectorV);
|
|
186
|
+
const vuCode = almostEqualOrNegated(this.vectorV, other.vectorU);
|
|
187
|
+
if (uvCode !== 0 && vuCode !== 0)
|
|
188
|
+
return true;
|
|
189
|
+
}
|
|
190
|
+
return false;
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
//# sourceMappingURL=UnboundedHyperbola2d.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UnboundedHyperbola2d.js","sourceRoot":"","sources":["../../../../../src/curve/internalContexts/geometry2d/UnboundedHyperbola2d.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAC5D,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,qCAAqC,CAAC;AAExE,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD;;;;;;;;GAQG;AACH,MAAM,OAAO,oBAAqB,SAAQ,eAAe;IACvD,2DAA2D;IACpD,MAAM,CAAU;IACvB,kCAAkC;IAC3B,OAAO,CAAW;IACzB,kCAAkC;IAC3B,OAAO,CAAW;IACzB,yDAAyD;IACzD,YAAoB,MAAe,EAAE,OAAiB,EAAE,OAAiB;QACvE,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;IACD,wCAAwC;IACjC,KAAK;QACV,sCAAsC;QACtC,OAAO,oBAAoB,CAAC,0BAA0B,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;IAClG,CAAC;IACD;;;;;;;;OAQG;IACI,MAAM,CAAC,yBAAyB,CAAC,OAAe,EAAE,OAAe,EAAE,M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O,CAAC,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,QAAQ,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC;gBACtG,OAAO,CAAC,CAAC,CAAC;YACZ,OAAO,CAAC,CAAC;QACX,CAAC,CAAA;QACD,IAAI,QAAQ,CAAC,aAAa,CAAC,IAAI,CAAC,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC;YACtD,IAAI,CAAC,+BAA+B;gBAClC,OAAO,IAAI,CAAC,OAAO,CAAC,mBAAmB,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,IAAI,CAAC,OAAO,CAAC,mBAAmB,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;YAC5G,MAAM,MAAM,GAAG,oBAAoB,CAAC,IAAI,CAAC,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;YACjE,MAAM,MAAM,GAAG,oBAAoB,CAAC,IAAI,CAAC,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;YACjE,IAAI,MAAM,KAAK,CAAC,IAAI,MAAM,KAAK,CAAC;gBAC9B,OAAO,IAAI,CAAA;YACb,MAAM,MAAM,GAAG,oBAAoB,CAAC,IAAI,CAAC,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;YACjE,MAAM,MAAM,GAAG,oBAAoB,CAAC,IAAI,CAAC,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;YACjE,IAAI,MAAM,KAAK,CAAC,IAAI,MAAM,KAAK,CAAC;gBAC9B,OAAO,IAAI,CAAC;QAChB,CAAC;QACD,OAAO,KAAK,CAAC;IACf,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/** @packageDocumentation\n * @module CartesianGeometry\n */\n\nimport { SmallSystem } from \"../../../numerics/SmallSystem\";\nimport { Geometry } from \"../../../Geometry\";\nimport { Point2d, Vector2d } from \"../../../geometry3d/Point2dVector2d\";\nimport { XAndY } from \"../../../geometry3d/XYZProps\";\nimport { TrigPolynomial } from \"../../../numerics/Polynomials\";\nimport { ImplicitCurve2d } from \"./ImplicitCurve2d\";\n\n/**\n * Internal class for hyperbola in the xy plane. The hyperbola equation in angular parameterization is\n * * X = A + U * sec(theta) + V * tan(theta)\n * which means that in the (skewed and scaled) coordinate system with origin at A and local u and v as\n * multiples of U and V the implicit equation is u^2 - v^2 = 1\n * which means the hyperbola opens along the positive and negative U axis with asymptotes at 45 degrees,\n * i.e., along the directions (U+V) and (U-V)\n * @internal\n */\nexport class UnboundedHyperbola2d extends ImplicitCurve2d {\n /** The Cartesian coordinates of any center on the line. */\n public center: Point2d;\n /** The local u axis direction. */\n public vectorU: Vector2d;\n /** The local v axis direction. */\n public vectorV: Vector2d;\n /* Constructor - CAPTURE given center and axis vectors */\n private constructor(center: Point2d, vectorU: Vector2d, vectorV: Vector2d) {\n super();\n this.center = center;\n this.vectorU = vectorU;\n this.vectorV = vectorV;\n }\n /** Return a clone of this hyperbola. */\n public clone(): UnboundedHyperbola2d {\n // the create method clones the inputs\n return UnboundedHyperbola2d.createCenterAndAxisVectors(this.center, this.vectorU, this.vectorV);\n }\n /**\n * Create UnboundedHyperbola2d with scale factors.\n * * The implicit equation is (x/a)^2 - (y/b)^2 = 1\n * @param centerX x coordinate of center\n * @param centerY y coordinate of center\n * @param scaleU scale factor along the U axis\n * @param scaleV scale factor along the V axis\n * @returns newly created hyperbola object\n */\n public static createFromCenterAndScales(centerX: number, centerY: number, scaleU: number, scaleV: number): UnboundedHyperbola2d {\n return new UnboundedHyperbola2d(\n Point2d.create(centerX, centerY), Vector2d.create(scaleU, 0), Vector2d.create(0, scaleV),\n );\n }\n /**\n * Create an UnboundedHyperbola2d from an xy object and a radius.\n * @param center xy coordinates of center\n * @param vectorU vector from center to to theta=0 vertex, i.e. along axis on the \"inside\" of the curve\n * @param vectorV vector from center to the transverse direction\n */\n public static createCenterAndAxisVectors(center: XAndY, vectorU: XAndY, vectorV: XAndY): UnboundedHyperbola2d {\n return new UnboundedHyperbola2d(Point2d.create(center.x, center.y),\n Vector2d.create(vectorU.x, vectorU.y),\n Vector2d.create(vectorV.x, vectorV.y),\n );\n }\n /**\n * Return the local (uv) coordinate of a global point.\n * @param spacePoint point for coordinate conversion\n */\n public globalToLocal(spacePoint: XAndY): Vector2d | undefined {\n const result = Vector2d.create();\n if (SmallSystem.linearSystem2d(\n this.vectorU.x, this.vectorV.x,\n this.vectorU.y, this.vectorV.y,\n spacePoint.x - this.center.x, spacePoint.y - this.center.y,\n result))\n return result;\n return undefined;\n }\n /**\n * Returns xy coordinate on the hyperbola.\n * @param radians parametric angle on the hyperbola\n */\n public override radiansToPoint2d(radians: number): Point2d | undefined {\n const c = Math.cos(radians);\n const s = Math.sin(radians);\n if (Geometry.isSmallMetricDistance(Math.abs(c)))\n return undefined;\n return this.center.plus2Scaled(this.vectorU, 1.0 / c, this.vectorV, s / c);\n }\n /**\n * Returns the tangent at given radians value.\n * @param radians parametric angle on the hyperbola\n */\n public override radiansToTangentVector2d(radians: number): Vector2d | undefined {\n // The curve is parameterized as X = A + U * sec(theta) + V * tan(theta)\n // Its tangent vector (derivative) is X' = U * sec(theta) * tan(theta + V * tan^2(theta))\n const c = Math.cos(radians);\n const s = Math.sin(radians);\n const cc = c * c;\n const sec2 = Geometry.conditionalDivideCoordinate(1.0, cc);\n const secTan = Geometry.conditionalDivideCoordinate(s, cc);\n if (sec2 === undefined || secTan === undefined)\n return undefined;\n return Vector2d.createAdd2Scaled(this.vectorU, secTan, this.vectorV, sec2);\n }\n /**\n * Return the implicit function value at xy.\n * @param xy space point\n * @returns squared local (uv) coordinates minus 1.\n */\n public override functionValue(xy: XAndY): number {\n const vectorUV = this.globalToLocal(xy);\n if (vectorUV === undefined)\n return 0;\n return vectorUV.x * vectorUV.x - vectorUV.y * vectorUV.y - 1.0;\n }\n /**\n * Evaluate the gradient (steepest descent) of the implicit function.\n * @param xy space point\n * @returns gradient vector for the implicit function\n */\n public override gradient(xy: XAndY): Vector2d {\n const vectorUV = this.globalToLocal(xy);\n const result = Vector2d.create();\n // use INVERSE of TRANSPOSE of [UV] matrix to map gradient terms\n if (vectorUV !== undefined && SmallSystem.linearSystem2d(\n this.vectorU.x, this.vectorU.y,\n this.vectorV.x, this.vectorV.y,\n 2 * vectorUV.x, -2 * vectorUV.y,\n result))\n return result;\n return Vector2d.create(0, 0);\n }\n /**\n * Solve for parametric radians at hyperbola points which are perpendicular projections of spacePoint.\n * * Up to 4 solutions are possible.\n * @param spacePoint the space point.\n * @handler the handler to receive all the points on the curve and radians where perpendicular happens.\n */\n public override emitPerpendiculars(\n spacePoint: Point2d, handler: (curvePoint: Point2d, radians: number | undefined) => any,\n ): any {\n const centerToSpacePoint = Vector2d.createStartEnd(spacePoint, this.center);\n // coefficients of C and S where C and S are the unit circle points parameterized by theta.\n // Hyperbola point at theta is X = A + U sec + V tan\n // tangent is T = U sec tan + V sec^2\n // vector W = spacePOint - this.center\n // perpendicular condition for vector V from space point is\n // 0 = T dot (spacePoint - X) = T dot (W - U sec - V tan)\n // multiply through by cos^4 and there are various appearances of sine and cosine\n // in the numerator. There are constant term, terms with one trig, and terms with product\n // of 2 trigs. This fits the call list for solving \"intersection\" of a quadric with unit circle.\n //\n const coffSC = centerToSpacePoint.dotProduct(this.vectorU);\n const coffC = centerToSpacePoint.dotProduct(this.vectorV);\n const coffS = this.vectorU.dotProduct(this.vectorU) + this.vectorV.dotProduct(this.vectorV);\n const coff1 = this.vectorU.dotProduct(this.vectorV);\n const coffSS = this.vectorV.dotProduct(this.vectorU);\n const radiansSolutions: number[] = [];\n TrigPolynomial.solveUnitCircleImplicitQuadricIntersection(0, coffSC, coffSS, coffC, coffS, coff1, radiansSolutions);\n for (const radians of radiansSolutions) {\n const s = Math.sin(radians);\n const c = Math.cos(radians);\n const curvePoint = this.center.plus2Scaled(this.vectorU, 1.0 / c, this.vectorV, s / c);\n handler(curvePoint, radians);\n }\n }\n /** Returns true if the circle radius is near zero. */\n // eslint-disable-next-line @itwin/prefer-get\n public override isDegenerate(): boolean {\n return undefined === this.globalToLocal(Point2d.create(0, 0));\n }\n /**\n * Test if the centers and axes of the vectors are close\n * @param other second hyperbola\n * @param negatedAndExchangedAxesAreEqual\n * * if false, a strong equality test requiring both U and V vectors to match\n * * This strong test is a test for identical parameterization\n * * if true, a weak equality test that allows U and V to be negated and or exchanged.\n * * The weak test is a test for the same implicit set\n * @returns true if identical to tolerance.\n */\n public isSameHyperbola(other: UnboundedHyperbola2d, negatedAndExchangedAxesAreEqual: boolean = false): boolean {\n const almostEqualOrNegated = (vectorU: Vector2d, vectorV: Vector2d): -1 | 0 | 1 => {\n if (Geometry.isSameCoordinate(vectorU.x, vectorV.x) && Geometry.isSameCoordinate(vectorU.y, vectorV.y))\n return 1;\n if (Geometry.isSameCoordinate(vectorU.x, -vectorV.x) && Geometry.isSameCoordinate(vectorU.y, -vectorV.y))\n return -1;\n return 0;\n }\n if (Geometry.isSamePoint2d(this.center, other.center)) {\n if (!negatedAndExchangedAxesAreEqual)\n return this.vectorU.isAlmostEqualMetric(other.vectorU) && this.vectorV.isAlmostEqualMetric(other.vectorV);\n const uuCode = almostEqualOrNegated(this.vectorU, other.vectorU);\n const vvCode = almostEqualOrNegated(this.vectorV, other.vectorV);\n if (uuCode !== 0 && vvCode !== 0)\n return true\n const uvCode = almostEqualOrNegated(this.vectorU, other.vectorV);\n const vuCode = almostEqualOrNegated(this.vectorV, other.vectorU);\n if (uvCode !== 0 && vuCode !== 0)\n return true;\n }\n return false;\n }\n}\n"]}
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
/** @packageDocumentation
|
|
2
|
+
* @module CartesianGeometry
|
|
3
|
+
*/
|
|
4
|
+
import { Point2d, Vector2d } from "../../../geometry3d/Point2dVector2d";
|
|
5
|
+
import { ImplicitCurve2d } from "./ImplicitCurve2d";
|
|
6
|
+
import { XAndY } from "../../../geometry3d/XYZProps";
|
|
7
|
+
/**
|
|
8
|
+
* An UnboundedLine2dByPointAndNormal represents an infinite line by a single point on the line and a normal vector.
|
|
9
|
+
* * The normal vector is NOT required to be a unit (normalized) vector.
|
|
10
|
+
* * Use method `cloneNormalizedFromOrigin` to create a line with unit normal.
|
|
11
|
+
* @internal
|
|
12
|
+
*/
|
|
13
|
+
export declare class UnboundedLine2dByPointAndNormal extends ImplicitCurve2d {
|
|
14
|
+
/** The Cartesian coordinates of any point on the line. */
|
|
15
|
+
point: Point2d;
|
|
16
|
+
/** The vector perpendicular to the line */
|
|
17
|
+
normal: Vector2d;
|
|
18
|
+
private constructor();
|
|
19
|
+
/** Return a clone of this line. */
|
|
20
|
+
clone(): UnboundedLine2dByPointAndNormal;
|
|
21
|
+
/**
|
|
22
|
+
* Create an UnboundedLine2dByPointAndNormal from XY parts of a point on the line and the normal vector.
|
|
23
|
+
* @param pointX x coordinate of a reference point on the line
|
|
24
|
+
* @param pointY y coordinate of the reference point
|
|
25
|
+
* @param normalX x component of normal vector
|
|
26
|
+
* @param normalY y component of normal vector
|
|
27
|
+
* @returns new line object.
|
|
28
|
+
*/
|
|
29
|
+
static createPointXYNormalXY(pointX: number, pointY: number, normalX: number, normalY: number): UnboundedLine2dByPointAndNormal | undefined;
|
|
30
|
+
/**
|
|
31
|
+
* Create an UnboundedLine2dByPointAndNormal from a point on the line and a normal vector.
|
|
32
|
+
* * The xy data from the inputs is copied to the line.
|
|
33
|
+
* * i.e. the inputs are NOT captured.
|
|
34
|
+
* @param point any point on the line
|
|
35
|
+
* @param normal the normal vector
|
|
36
|
+
* @returns new line object.
|
|
37
|
+
*/
|
|
38
|
+
static createPointNormal(point: Point2d, normal: Vector2d): UnboundedLine2dByPointAndNormal;
|
|
39
|
+
/**
|
|
40
|
+
* Create an UnboundedLine2dByPointAndNormal from XY parts of a point on the line and a vector along the line
|
|
41
|
+
* @param pointX x coordinate of a reference point on the line
|
|
42
|
+
* @param pointY y coordinate of the reference point
|
|
43
|
+
* @param directionX x component of the vector along the line
|
|
44
|
+
* @param directionY y component of the vector along the line
|
|
45
|
+
* @returns new line object or undefined.
|
|
46
|
+
*/
|
|
47
|
+
static createPointXYDirectionXY(pointX: number, pointY: number, directionX: number, directionY: number): UnboundedLine2dByPointAndNormal | undefined;
|
|
48
|
+
/**
|
|
49
|
+
* Create an UnboundedLine2dByPointAndNormal from XY parts of two points on the line.
|
|
50
|
+
* * The nominal origin is at pointA.
|
|
51
|
+
* * The line direction is from pointA to pointB, converted to a normal by createPointXYDirectionXY.
|
|
52
|
+
* @param pointAX x coordinate of first point on the line
|
|
53
|
+
* @param pointAY y coordinate of first point on the line
|
|
54
|
+
* @param pointBX x coordinate of second point on the line
|
|
55
|
+
* @param pointBY y component of second point on the line
|
|
56
|
+
* @returns new line object or undefined.
|
|
57
|
+
*/
|
|
58
|
+
static createPointXYPointXY(pointAX: number, pointAY: number, pointBX: number, pointBY: number): UnboundedLine2dByPointAndNormal | undefined;
|
|
59
|
+
/**
|
|
60
|
+
* Create an UnboundedLine2dByPointAndNormal from two points on the line.
|
|
61
|
+
* @param pointA first point on the line
|
|
62
|
+
* @param pointB second point on the line
|
|
63
|
+
* @returns new line object or undefined.
|
|
64
|
+
*/
|
|
65
|
+
static createPointPoint(pointA: XAndY, pointB: XAndY): UnboundedLine2dByPointAndNormal | undefined;
|
|
66
|
+
/** Return true if the normal vector has zero length. */
|
|
67
|
+
isDegenerate(): boolean;
|
|
68
|
+
/**
|
|
69
|
+
* Return the implicit function value at xy.
|
|
70
|
+
* @param xy space point for evaluation
|
|
71
|
+
* @returns dot product of the line normal with the vector from the line's point to the space point.
|
|
72
|
+
*/
|
|
73
|
+
functionValue(xy: XAndY): number;
|
|
74
|
+
/**
|
|
75
|
+
* Returns gradient of the implicit function.
|
|
76
|
+
* @param xy space point
|
|
77
|
+
* @returns unit normal of the line.
|
|
78
|
+
*/
|
|
79
|
+
gradient(_xy: XAndY): Vector2d;
|
|
80
|
+
/** Returns a vector along the line, i.e., rotated 90 degrees from the normal vector, with normal to the left. */
|
|
81
|
+
vectorAlongLine(): Vector2d;
|
|
82
|
+
/**
|
|
83
|
+
* Rotate the line normal by 90 degrees counterclockwise and normalize it
|
|
84
|
+
* @returns the unit vector, or undefined if the normal is zero length.
|
|
85
|
+
*/
|
|
86
|
+
unitVectorAlongLine(): Vector2d | undefined;
|
|
87
|
+
/**
|
|
88
|
+
* Return unit vector for the line normal.
|
|
89
|
+
* @returns the unit vector, or undefined if the normal is zero length.
|
|
90
|
+
*/
|
|
91
|
+
unitNormal(): Vector2d | undefined;
|
|
92
|
+
/**
|
|
93
|
+
* Drop a perpendicular from spacePoint to the line. Emit that point to the handler.
|
|
94
|
+
* @param spacePoint the space point to be projected.
|
|
95
|
+
* @handler the handler to receive the projection point.
|
|
96
|
+
*/
|
|
97
|
+
emitPerpendiculars(spacePoint: Point2d, handler: (curvePoint: Point2d, radians: number | undefined) => any): any;
|
|
98
|
+
/**
|
|
99
|
+
* Return a new implicit line with its reference point given relative to newOrigin, and its perpendicular vector normalized.
|
|
100
|
+
* @return undefined if perpendicular vector has zero length.
|
|
101
|
+
* @param newOrigin origin coordinates to subtract from existing origin.
|
|
102
|
+
*/
|
|
103
|
+
cloneNormalizedFromOrigin(newOrigin?: Point2d): UnboundedLine2dByPointAndNormal | undefined;
|
|
104
|
+
/**
|
|
105
|
+
* Return a new implicit line with given origin and unit normal based on this.
|
|
106
|
+
* * WARNING: Beware of confusing related function cloneNormalizedFromOrigin, which has different origin logic.
|
|
107
|
+
* @return undefined if perpendicular vector has zero length.
|
|
108
|
+
*/
|
|
109
|
+
cloneNormalizedWithOrigin(newOrigin?: Point2d): UnboundedLine2dByPointAndNormal | undefined;
|
|
110
|
+
/**
|
|
111
|
+
* Return a new implicit line with its reference point shifted by given multiple of its normal vector.
|
|
112
|
+
* * The shift is applied to the point, and the normal copied unchanged-- no normalization or test for zero.
|
|
113
|
+
* @param shiftFactor multiplier for normal.
|
|
114
|
+
* @return shifted line
|
|
115
|
+
*/
|
|
116
|
+
cloneShifted(shiftFactor: number): UnboundedLine2dByPointAndNormal | undefined;
|
|
117
|
+
/**
|
|
118
|
+
* Compute the intersection of two lines.
|
|
119
|
+
* * Each can be offset.
|
|
120
|
+
* * Offsets are in units of the dot products with normal vectors.
|
|
121
|
+
* * If normal vectors are unit vectors, the offsets are simple distance.
|
|
122
|
+
* * Otherwise the offset scaling is scaled --- use carefully.
|
|
123
|
+
* @param other the other line.
|
|
124
|
+
* @param thisOffset target function value for dot products with this line
|
|
125
|
+
* @param otherOffset target function value for dot products with other line
|
|
126
|
+
*/
|
|
127
|
+
intersectUnboundedLine2dByPointAndNormalWithOffsets(other: UnboundedLine2dByPointAndNormal, thisOffset?: number, otherOffset?: number): Point2d | undefined;
|
|
128
|
+
}
|
|
129
|
+
//# sourceMappingURL=UnboundedLine2d.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UnboundedLine2d.d.ts","sourceRoot":"","sources":["../../../../../src/curve/internalContexts/geometry2d/UnboundedLine2d.ts"],"names":[],"mappings":"AAIA;;GAEG;AAGH,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,qCAAqC,CAAC;AACxE,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,KAAK,EAAE,MAAM,8BAA8B,CAAC;AAGrD;;;;;GAKG;AACH,qBAAa,+BAAgC,SAAQ,eAAe;IAClE,0DAA0D;IACnD,KAAK,EAAE,OAAO,CAAC;IACtB,2CAA2C;IACpC,MAAM,EAAE,QAAQ,CAAC;IAExB,OAAO;IAKP,mCAAmC;IAC5B,KAAK,IAAI,+BAA+B;IAI/C;;;;;;;OAOG;WACW,qBAAqB,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,OAA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Y,CAAC,WAAW,EAAE,MAAM,GAAG,+BAA+B,GAAG,SAAS;IAKrF;;;;;;;;;OASG;IACI,mDAAmD,CACxD,KAAK,EAAE,+BAA+B,EAAE,UAAU,GAAE,MAAU,EAAE,WAAW,GAAE,MAAU,GACtF,OAAO,GAAG,SAAS;CAgBvB"}
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
/*---------------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
|
+
/** @packageDocumentation
|
|
6
|
+
* @module CartesianGeometry
|
|
7
|
+
*/
|
|
8
|
+
import { Geometry } from "../../../Geometry";
|
|
9
|
+
import { Point2d, Vector2d } from "../../../geometry3d/Point2dVector2d";
|
|
10
|
+
import { ImplicitCurve2d } from "./ImplicitCurve2d";
|
|
11
|
+
import { SmallSystem } from "../../../numerics/SmallSystem";
|
|
12
|
+
/**
|
|
13
|
+
* An UnboundedLine2dByPointAndNormal represents an infinite line by a single point on the line and a normal vector.
|
|
14
|
+
* * The normal vector is NOT required to be a unit (normalized) vector.
|
|
15
|
+
* * Use method `cloneNormalizedFromOrigin` to create a line with unit normal.
|
|
16
|
+
* @internal
|
|
17
|
+
*/
|
|
18
|
+
export class UnboundedLine2dByPointAndNormal extends ImplicitCurve2d {
|
|
19
|
+
/** The Cartesian coordinates of any point on the line. */
|
|
20
|
+
point;
|
|
21
|
+
/** The vector perpendicular to the line */
|
|
22
|
+
normal;
|
|
23
|
+
/* Constructor - CAPTURE given point and normal */
|
|
24
|
+
constructor(point, normal) {
|
|
25
|
+
super();
|
|
26
|
+
this.point = point;
|
|
27
|
+
this.normal = normal;
|
|
28
|
+
}
|
|
29
|
+
/** Return a clone of this line. */
|
|
30
|
+
clone() {
|
|
31
|
+
// the create method clones the inputs
|
|
32
|
+
return UnboundedLine2dByPointAndNormal.createPointNormal(this.point, this.normal);
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Create an UnboundedLine2dByPointAndNormal from XY parts of a point on the line and the normal vector.
|
|
36
|
+
* @param pointX x coordinate of a reference point on the line
|
|
37
|
+
* @param pointY y coordinate of the reference point
|
|
38
|
+
* @param normalX x component of normal vector
|
|
39
|
+
* @param normalY y component of normal vector
|
|
40
|
+
* @returns new line object.
|
|
41
|
+
*/
|
|
42
|
+
static createPointXYNormalXY(pointX, pointY, normalX, normalY) {
|
|
43
|
+
const unitVector = Vector2d.create(normalX, normalY).normalize();
|
|
44
|
+
if (unitVector === undefined)
|
|
45
|
+
return undefined;
|
|
46
|
+
return new UnboundedLine2dByPointAndNormal(Point2d.create(pointX, pointY), unitVector);
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Create an UnboundedLine2dByPointAndNormal from a point on the line and a normal vector.
|
|
50
|
+
* * The xy data from the inputs is copied to the line.
|
|
51
|
+
* * i.e. the inputs are NOT captured.
|
|
52
|
+
* @param point any point on the line
|
|
53
|
+
* @param normal the normal vector
|
|
54
|
+
* @returns new line object.
|
|
55
|
+
*/
|
|
56
|
+
static createPointNormal(point, normal) {
|
|
57
|
+
return new UnboundedLine2dByPointAndNormal(Point2d.create(point.x, point.y), Vector2d.create(normal.x, normal.y));
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Create an UnboundedLine2dByPointAndNormal from XY parts of a point on the line and a vector along the line
|
|
61
|
+
* @param pointX x coordinate of a reference point on the line
|
|
62
|
+
* @param pointY y coordinate of the reference point
|
|
63
|
+
* @param directionX x component of the vector along the line
|
|
64
|
+
* @param directionY y component of the vector along the line
|
|
65
|
+
* @returns new line object or undefined.
|
|
66
|
+
*/
|
|
67
|
+
static createPointXYDirectionXY(pointX, pointY, directionX, directionY) {
|
|
68
|
+
const unitVector = Vector2d.create(directionY, -directionX).normalize();
|
|
69
|
+
if (unitVector === undefined)
|
|
70
|
+
return undefined;
|
|
71
|
+
return new UnboundedLine2dByPointAndNormal(Point2d.create(pointX, pointY), unitVector);
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Create an UnboundedLine2dByPointAndNormal from XY parts of two points on the line.
|
|
75
|
+
* * The nominal origin is at pointA.
|
|
76
|
+
* * The line direction is from pointA to pointB, converted to a normal by createPointXYDirectionXY.
|
|
77
|
+
* @param pointAX x coordinate of first point on the line
|
|
78
|
+
* @param pointAY y coordinate of first point on the line
|
|
79
|
+
* @param pointBX x coordinate of second point on the line
|
|
80
|
+
* @param pointBY y component of second point on the line
|
|
81
|
+
* @returns new line object or undefined.
|
|
82
|
+
*/
|
|
83
|
+
static createPointXYPointXY(pointAX, pointAY, pointBX, pointBY) {
|
|
84
|
+
return this.createPointXYDirectionXY(pointAX, pointAY, pointBX - pointAX, pointBY - pointAY);
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Create an UnboundedLine2dByPointAndNormal from two points on the line.
|
|
88
|
+
* @param pointA first point on the line
|
|
89
|
+
* @param pointB second point on the line
|
|
90
|
+
* @returns new line object or undefined.
|
|
91
|
+
*/
|
|
92
|
+
static createPointPoint(pointA, pointB) {
|
|
93
|
+
return this.createPointXYDirectionXY(pointA.x, pointA.y, pointB.x - pointA.x, pointB.y - pointA.y);
|
|
94
|
+
}
|
|
95
|
+
/** Return true if the normal vector has zero length. */
|
|
96
|
+
// eslint-disable-next-line @itwin/prefer-get
|
|
97
|
+
isDegenerate() {
|
|
98
|
+
return this.normal.isAlmostZero;
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Return the implicit function value at xy.
|
|
102
|
+
* @param xy space point for evaluation
|
|
103
|
+
* @returns dot product of the line normal with the vector from the line's point to the space point.
|
|
104
|
+
*/
|
|
105
|
+
functionValue(xy) {
|
|
106
|
+
return this.normal.dotProductStartEnd(this.point, xy);
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Returns gradient of the implicit function.
|
|
110
|
+
* @param xy space point
|
|
111
|
+
* @returns unit normal of the line.
|
|
112
|
+
*/
|
|
113
|
+
gradient(_xy) {
|
|
114
|
+
const unit = this.normal.normalize();
|
|
115
|
+
if (unit !== undefined)
|
|
116
|
+
return unit;
|
|
117
|
+
return Vector2d.create(0, 0);
|
|
118
|
+
}
|
|
119
|
+
/** Returns a vector along the line, i.e., rotated 90 degrees from the normal vector, with normal to the left. */
|
|
120
|
+
vectorAlongLine() {
|
|
121
|
+
return this.normal.rotate90CWXY();
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Rotate the line normal by 90 degrees counterclockwise and normalize it
|
|
125
|
+
* @returns the unit vector, or undefined if the normal is zero length.
|
|
126
|
+
*/
|
|
127
|
+
unitVectorAlongLine() {
|
|
128
|
+
return this.normal.rotate90CCWXY().normalize();
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Return unit vector for the line normal.
|
|
132
|
+
* @returns the unit vector, or undefined if the normal is zero length.
|
|
133
|
+
*/
|
|
134
|
+
unitNormal() {
|
|
135
|
+
return this.normal.normalize();
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* Drop a perpendicular from spacePoint to the line. Emit that point to the handler.
|
|
139
|
+
* @param spacePoint the space point to be projected.
|
|
140
|
+
* @handler the handler to receive the projection point.
|
|
141
|
+
*/
|
|
142
|
+
emitPerpendiculars(spacePoint, handler) {
|
|
143
|
+
const fraction = Geometry.fractionOfProjectionToVectorXYXY(spacePoint.x - this.point.x, spacePoint.y - this.point.y, this.normal.x, this.normal.y);
|
|
144
|
+
handler(spacePoint.plusScaled(this.normal, -fraction), undefined);
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* Return a new implicit line with its reference point given relative to newOrigin, and its perpendicular vector normalized.
|
|
148
|
+
* @return undefined if perpendicular vector has zero length.
|
|
149
|
+
* @param newOrigin origin coordinates to subtract from existing origin.
|
|
150
|
+
*/
|
|
151
|
+
cloneNormalizedFromOrigin(newOrigin) {
|
|
152
|
+
const unitNormal = this.normal.normalize();
|
|
153
|
+
if (unitNormal === undefined)
|
|
154
|
+
return undefined;
|
|
155
|
+
if (newOrigin === undefined)
|
|
156
|
+
return new UnboundedLine2dByPointAndNormal(this.point.clone(), Vector2d.create(unitNormal.x, unitNormal.y));
|
|
157
|
+
return new UnboundedLine2dByPointAndNormal(Point2d.create(this.point.x - newOrigin.x, this.point.y - newOrigin.y), Vector2d.create(unitNormal.x, unitNormal.y));
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* Return a new implicit line with given origin and unit normal based on this.
|
|
161
|
+
* * WARNING: Beware of confusing related function cloneNormalizedFromOrigin, which has different origin logic.
|
|
162
|
+
* @return undefined if perpendicular vector has zero length.
|
|
163
|
+
*/
|
|
164
|
+
cloneNormalizedWithOrigin(newOrigin) {
|
|
165
|
+
const unitNormal = this.normal.normalize();
|
|
166
|
+
if (unitNormal === undefined)
|
|
167
|
+
return undefined;
|
|
168
|
+
if (newOrigin === undefined)
|
|
169
|
+
return new UnboundedLine2dByPointAndNormal(this.point, unitNormal);
|
|
170
|
+
return new UnboundedLine2dByPointAndNormal(Point2d.create(newOrigin.x, newOrigin.y), Vector2d.create(unitNormal.x, unitNormal.y));
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* Return a new implicit line with its reference point shifted by given multiple of its normal vector.
|
|
174
|
+
* * The shift is applied to the point, and the normal copied unchanged-- no normalization or test for zero.
|
|
175
|
+
* @param shiftFactor multiplier for normal.
|
|
176
|
+
* @return shifted line
|
|
177
|
+
*/
|
|
178
|
+
cloneShifted(shiftFactor) {
|
|
179
|
+
return UnboundedLine2dByPointAndNormal.createPointNormal(this.point.plusScaled(this.normal, shiftFactor), this.normal);
|
|
180
|
+
}
|
|
181
|
+
/**
|
|
182
|
+
* Compute the intersection of two lines.
|
|
183
|
+
* * Each can be offset.
|
|
184
|
+
* * Offsets are in units of the dot products with normal vectors.
|
|
185
|
+
* * If normal vectors are unit vectors, the offsets are simple distance.
|
|
186
|
+
* * Otherwise the offset scaling is scaled --- use carefully.
|
|
187
|
+
* @param other the other line.
|
|
188
|
+
* @param thisOffset target function value for dot products with this line
|
|
189
|
+
* @param otherOffset target function value for dot products with other line
|
|
190
|
+
*/
|
|
191
|
+
intersectUnboundedLine2dByPointAndNormalWithOffsets(other, thisOffset = 0, otherOffset = 0) {
|
|
192
|
+
// points p = (x,y) on the line satisfies equation "normal dot (p−point) = 0" and
|
|
193
|
+
// points p = (x,y) on the offset line satisfies equation "normal dot (p−point) = offset"
|
|
194
|
+
// therefore:
|
|
195
|
+
// normal.x (x−point.x) + normal.y (y−point.y) = thisOffset
|
|
196
|
+
// normal.x x + normal.y y = thisOffset + normal dot point.x
|
|
197
|
+
const xy = Vector2d.create();
|
|
198
|
+
if (SmallSystem.linearSystem2d(this.normal.x, this.normal.y, other.normal.x, other.normal.y, thisOffset + this.normal.dotProduct(this.point), otherOffset + other.normal.dotProduct(other.point), xy)) {
|
|
199
|
+
return Point2d.create(xy.x, xy.y);
|
|
200
|
+
}
|
|
201
|
+
return undefined;
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
//# sourceMappingURL=UnboundedLine2d.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UnboundedLine2d.js","sourceRoot":"","sources":["../../../../../src/curve/internalContexts/geometry2d/UnboundedLine2d.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,qCAAqC,CAAC;AACxE,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAE5D;;;;;GAKG;AACH,MAAM,OAAO,+BAAgC,SAAQ,eAAe;IAClE,0DAA0D;IACnD,KAAK,CAAU;IACtB,2CAA2C;IACpC,MAA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,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC;QACpC,CAAC;QACD,OAAO,SAAS,CAAC;IACnB,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module CartesianGeometry\n */\n\nimport { Geometry } from \"../../../Geometry\";\nimport { Point2d, Vector2d } from \"../../../geometry3d/Point2dVector2d\";\nimport { ImplicitCurve2d } from \"./ImplicitCurve2d\";\nimport { XAndY } from \"../../../geometry3d/XYZProps\";\nimport { SmallSystem } from \"../../../numerics/SmallSystem\";\n\n/**\n * An UnboundedLine2dByPointAndNormal represents an infinite line by a single point on the line and a normal vector.\n * * The normal vector is NOT required to be a unit (normalized) vector.\n * * Use method `cloneNormalizedFromOrigin` to create a line with unit normal.\n * @internal\n */\nexport class UnboundedLine2dByPointAndNormal extends ImplicitCurve2d {\n /** The Cartesian coordinates of any point on the line. */\n public point: Point2d;\n /** The vector perpendicular to the line */\n public normal: Vector2d;\n /* Constructor - CAPTURE given point and normal */\n private constructor(point: Point2d, normal: Vector2d) {\n super();\n this.point = point;\n this.normal = normal;\n }\n /** Return a clone of this line. */\n public clone(): UnboundedLine2dByPointAndNormal {\n // the create method clones the inputs\n return UnboundedLine2dByPointAndNormal.createPointNormal(this.point, this.normal);\n }\n /**\n * Create an UnboundedLine2dByPointAndNormal from XY parts of a point on the line and the normal vector.\n * @param pointX x coordinate of a reference point on the line\n * @param pointY y coordinate of the reference point\n * @param normalX x component of normal vector\n * @param normalY y component of normal vector\n * @returns new line object.\n */\n public static createPointXYNormalXY(pointX: number, pointY: number, normalX: number, normalY: number): UnboundedLine2dByPointAndNormal | undefined {\n const unitVector = Vector2d.create(normalX, normalY).normalize();\n if (unitVector === undefined)\n return undefined;\n return new UnboundedLine2dByPointAndNormal(Point2d.create(pointX, pointY), unitVector);\n }\n /**\n * Create an UnboundedLine2dByPointAndNormal from a point on the line and a normal vector.\n * * The xy data from the inputs is copied to the line.\n * * i.e. the inputs are NOT captured.\n * @param point any point on the line\n * @param normal the normal vector\n * @returns new line object.\n */\n public static createPointNormal(point: Point2d, normal: Vector2d): UnboundedLine2dByPointAndNormal {\n return new UnboundedLine2dByPointAndNormal(Point2d.create(point.x, point.y), Vector2d.create(normal.x, normal.y));\n }\n /**\n * Create an UnboundedLine2dByPointAndNormal from XY parts of a point on the line and a vector along the line\n * @param pointX x coordinate of a reference point on the line\n * @param pointY y coordinate of the reference point\n * @param directionX x component of the vector along the line\n * @param directionY y component of the vector along the line\n * @returns new line object or undefined.\n */\n public static createPointXYDirectionXY(\n pointX: number, pointY: number, directionX: number, directionY: number\n ): UnboundedLine2dByPointAndNormal | undefined {\n const unitVector = Vector2d.create(directionY, -directionX).normalize();\n if (unitVector === undefined)\n return undefined;\n return new UnboundedLine2dByPointAndNormal(Point2d.create(pointX, pointY), unitVector);\n }\n /**\n * Create an UnboundedLine2dByPointAndNormal from XY parts of two points on the line.\n * * The nominal origin is at pointA.\n * * The line direction is from pointA to pointB, converted to a normal by createPointXYDirectionXY.\n * @param pointAX x coordinate of first point on the line\n * @param pointAY y coordinate of first point on the line\n * @param pointBX x coordinate of second point on the line\n * @param pointBY y component of second point on the line\n * @returns new line object or undefined.\n */\n public static createPointXYPointXY(\n pointAX: number, pointAY: number, pointBX: number, pointBY: number\n ): UnboundedLine2dByPointAndNormal | undefined {\n return this.createPointXYDirectionXY(pointAX, pointAY, pointBX - pointAX, pointBY - pointAY);\n }\n /**\n * Create an UnboundedLine2dByPointAndNormal from two points on the line.\n * @param pointA first point on the line\n * @param pointB second point on the line\n * @returns new line object or undefined.\n */\n public static createPointPoint(pointA: XAndY, pointB: XAndY): UnboundedLine2dByPointAndNormal | undefined {\n return this.createPointXYDirectionXY(pointA.x, pointA.y, pointB.x - pointA.x, pointB.y - pointA.y);\n }\n /** Return true if the normal vector has zero length. */\n // eslint-disable-next-line @itwin/prefer-get\n public override isDegenerate(): boolean {\n return this.normal.isAlmostZero;\n }\n /**\n * Return the implicit function value at xy.\n * @param xy space point for evaluation\n * @returns dot product of the line normal with the vector from the line's point to the space point.\n */\n public override functionValue(xy: XAndY): number {\n return this.normal.dotProductStartEnd(this.point, xy);\n }\n /**\n * Returns gradient of the implicit function.\n * @param xy space point\n * @returns unit normal of the line.\n */\n public override gradient(_xy: XAndY): Vector2d {\n const unit = this.normal.normalize();\n if (unit !== undefined)\n return unit;\n return Vector2d.create(0, 0);\n }\n /** Returns a vector along the line, i.e., rotated 90 degrees from the normal vector, with normal to the left. */\n public vectorAlongLine(): Vector2d {\n return this.normal.rotate90CWXY();\n }\n /**\n * Rotate the line normal by 90 degrees counterclockwise and normalize it\n * @returns the unit vector, or undefined if the normal is zero length.\n */\n public unitVectorAlongLine(): Vector2d | undefined {\n return this.normal.rotate90CCWXY().normalize();\n }\n /**\n * Return unit vector for the line normal.\n * @returns the unit vector, or undefined if the normal is zero length.\n */\n public unitNormal(): Vector2d | undefined {\n return this.normal.normalize();\n }\n /**\n * Drop a perpendicular from spacePoint to the line. Emit that point to the handler.\n * @param spacePoint the space point to be projected.\n * @handler the handler to receive the projection point.\n */\n public override emitPerpendiculars(\n spacePoint: Point2d,\n handler: (curvePoint: Point2d, radians: number | undefined) => any,\n ): any {\n const fraction = Geometry.fractionOfProjectionToVectorXYXY(\n spacePoint.x - this.point.x, spacePoint.y - this.point.y, this.normal.x, this.normal.y,\n );\n handler(spacePoint.plusScaled(this.normal, -fraction), undefined);\n }\n /**\n * Return a new implicit line with its reference point given relative to newOrigin, and its perpendicular vector normalized.\n * @return undefined if perpendicular vector has zero length.\n * @param newOrigin origin coordinates to subtract from existing origin.\n */\n public cloneNormalizedFromOrigin(newOrigin?: Point2d): UnboundedLine2dByPointAndNormal | undefined {\n const unitNormal = this.normal.normalize();\n if (unitNormal === undefined)\n return undefined;\n if (newOrigin === undefined)\n return new UnboundedLine2dByPointAndNormal(this.point.clone(), Vector2d.create(unitNormal.x, unitNormal.y));\n return new UnboundedLine2dByPointAndNormal(\n Point2d.create(this.point.x - newOrigin.x, this.point.y - newOrigin.y),\n Vector2d.create(unitNormal.x, unitNormal.y));\n }\n /**\n * Return a new implicit line with given origin and unit normal based on this.\n * * WARNING: Beware of confusing related function cloneNormalizedFromOrigin, which has different origin logic.\n * @return undefined if perpendicular vector has zero length.\n */\n public cloneNormalizedWithOrigin(newOrigin?: Point2d): UnboundedLine2dByPointAndNormal | undefined {\n const unitNormal = this.normal.normalize();\n if (unitNormal === undefined)\n return undefined;\n if (newOrigin === undefined)\n return new UnboundedLine2dByPointAndNormal(this.point, unitNormal);\n return new UnboundedLine2dByPointAndNormal(\n Point2d.create(newOrigin.x, newOrigin.y), Vector2d.create(unitNormal.x, unitNormal.y),\n );\n }\n /**\n * Return a new implicit line with its reference point shifted by given multiple of its normal vector.\n * * The shift is applied to the point, and the normal copied unchanged-- no normalization or test for zero.\n * @param shiftFactor multiplier for normal.\n * @return shifted line\n */\n public cloneShifted(shiftFactor: number): UnboundedLine2dByPointAndNormal | undefined {\n return UnboundedLine2dByPointAndNormal.createPointNormal(\n this.point.plusScaled(this.normal, shiftFactor),\n this.normal);\n }\n /**\n * Compute the intersection of two lines.\n * * Each can be offset.\n * * Offsets are in units of the dot products with normal vectors.\n * * If normal vectors are unit vectors, the offsets are simple distance.\n * * Otherwise the offset scaling is scaled --- use carefully.\n * @param other the other line.\n * @param thisOffset target function value for dot products with this line\n * @param otherOffset target function value for dot products with other line\n */\n public intersectUnboundedLine2dByPointAndNormalWithOffsets(\n other: UnboundedLine2dByPointAndNormal, thisOffset: number = 0, otherOffset: number = 0,\n ): Point2d | undefined {\n // points p = (x,y) on the line satisfies equation \"normal dot (p−point) = 0\" and\n // points p = (x,y) on the offset line satisfies equation \"normal dot (p−point) = offset\"\n // therefore:\n // normal.x (x−point.x) + normal.y (y−point.y) = thisOffset\n // normal.x x + normal.y y = thisOffset + normal dot point.x\n const xy = Vector2d.create();\n if (SmallSystem.linearSystem2d(\n this.normal.x, this.normal.y,\n other.normal.x, other.normal.y,\n thisOffset + this.normal.dotProduct(this.point), otherOffset + other.normal.dotProduct(other.point),\n xy)) {\n return Point2d.create(xy.x, xy.y);\n }\n return undefined;\n }\n}\n"]}
|