@itwin/core-geometry 5.7.2 → 5.8.0-dev.10
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 +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/BSplineCurve.d.ts +1 -1
- package/lib/cjs/bspline/BSplineCurve.d.ts.map +1 -1
- package/lib/cjs/bspline/BSplineCurve.js +1 -1
- package/lib/cjs/bspline/BSplineCurve.js.map +1 -1
- package/lib/cjs/clipping/ClipPrimitive.d.ts +2 -1
- package/lib/cjs/clipping/ClipPrimitive.d.ts.map +1 -1
- package/lib/cjs/clipping/ClipPrimitive.js +2 -1
- package/lib/cjs/clipping/ClipPrimitive.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 +19 -3
- package/lib/cjs/curve/Arc3d.d.ts.map +1 -1
- package/lib/cjs/curve/Arc3d.js +50 -23
- 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/CurveChainWithDistanceIndex.d.ts +18 -5
- package/lib/cjs/curve/CurveChainWithDistanceIndex.d.ts.map +1 -1
- package/lib/cjs/curve/CurveChainWithDistanceIndex.js +34 -14
- package/lib/cjs/curve/CurveChainWithDistanceIndex.js.map +1 -1
- package/lib/cjs/curve/CurveCollection.d.ts +12 -11
- package/lib/cjs/curve/CurveCollection.d.ts.map +1 -1
- package/lib/cjs/curve/CurveCollection.js +36 -36
- package/lib/cjs/curve/CurveCollection.js.map +1 -1
- package/lib/cjs/curve/CurveExtendMode.d.ts +5 -5
- package/lib/cjs/curve/CurveExtendMode.d.ts.map +1 -1
- package/lib/cjs/curve/CurveExtendMode.js +4 -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/CurvePrimitive.d.ts +14 -2
- package/lib/cjs/curve/CurvePrimitive.d.ts.map +1 -1
- package/lib/cjs/curve/CurvePrimitive.js +19 -3
- package/lib/cjs/curve/CurvePrimitive.js.map +1 -1
- package/lib/cjs/curve/LineSegment3d.d.ts +2 -2
- package/lib/cjs/curve/LineSegment3d.d.ts.map +1 -1
- package/lib/cjs/curve/LineSegment3d.js +2 -2
- package/lib/cjs/curve/LineSegment3d.js.map +1 -1
- package/lib/cjs/curve/LineString3d.d.ts +1 -1
- package/lib/cjs/curve/LineString3d.d.ts.map +1 -1
- package/lib/cjs/curve/LineString3d.js +1 -1
- package/lib/cjs/curve/LineString3d.js.map +1 -1
- package/lib/cjs/curve/Path.d.ts +4 -15
- package/lib/cjs/curve/Path.d.ts.map +1 -1
- package/lib/cjs/curve/Path.js +1 -35
- package/lib/cjs/curve/Path.js.map +1 -1
- package/lib/cjs/curve/internalContexts/ClosestPointStrokeHandler.d.ts +2 -1
- package/lib/cjs/curve/internalContexts/ClosestPointStrokeHandler.d.ts.map +1 -1
- package/lib/cjs/curve/internalContexts/ClosestPointStrokeHandler.js +18 -13
- package/lib/cjs/curve/internalContexts/ClosestPointStrokeHandler.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/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/geometry3d/Ellipsoid.d.ts +2 -1
- package/lib/cjs/geometry3d/Ellipsoid.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Ellipsoid.js +2 -1
- package/lib/cjs/geometry3d/Ellipsoid.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/Point3dVector3d.js.map +1 -1
- package/lib/cjs/geometry3d/Ray3d.d.ts +5 -0
- package/lib/cjs/geometry3d/Ray3d.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Ray3d.js +7 -0
- package/lib/cjs/geometry3d/Ray3d.js.map +1 -1
- package/lib/cjs/numerics/Newton.d.ts.map +1 -1
- package/lib/cjs/numerics/Newton.js +2 -1
- package/lib/cjs/numerics/Newton.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/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/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/BSplineCurve.d.ts +1 -1
- package/lib/esm/bspline/BSplineCurve.d.ts.map +1 -1
- package/lib/esm/bspline/BSplineCurve.js +1 -1
- package/lib/esm/bspline/BSplineCurve.js.map +1 -1
- package/lib/esm/clipping/ClipPrimitive.d.ts +2 -1
- package/lib/esm/clipping/ClipPrimitive.d.ts.map +1 -1
- package/lib/esm/clipping/ClipPrimitive.js +2 -1
- package/lib/esm/clipping/ClipPrimitive.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 +19 -3
- package/lib/esm/curve/Arc3d.d.ts.map +1 -1
- package/lib/esm/curve/Arc3d.js +50 -23
- 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/CurveChainWithDistanceIndex.d.ts +18 -5
- package/lib/esm/curve/CurveChainWithDistanceIndex.d.ts.map +1 -1
- package/lib/esm/curve/CurveChainWithDistanceIndex.js +34 -14
- package/lib/esm/curve/CurveChainWithDistanceIndex.js.map +1 -1
- package/lib/esm/curve/CurveCollection.d.ts +12 -11
- package/lib/esm/curve/CurveCollection.d.ts.map +1 -1
- package/lib/esm/curve/CurveCollection.js +36 -36
- package/lib/esm/curve/CurveCollection.js.map +1 -1
- package/lib/esm/curve/CurveExtendMode.d.ts +5 -5
- package/lib/esm/curve/CurveExtendMode.d.ts.map +1 -1
- package/lib/esm/curve/CurveExtendMode.js +4 -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/CurvePrimitive.d.ts +14 -2
- package/lib/esm/curve/CurvePrimitive.d.ts.map +1 -1
- package/lib/esm/curve/CurvePrimitive.js +19 -3
- package/lib/esm/curve/CurvePrimitive.js.map +1 -1
- package/lib/esm/curve/LineSegment3d.d.ts +2 -2
- package/lib/esm/curve/LineSegment3d.d.ts.map +1 -1
- package/lib/esm/curve/LineSegment3d.js +2 -2
- package/lib/esm/curve/LineSegment3d.js.map +1 -1
- package/lib/esm/curve/LineString3d.d.ts +1 -1
- package/lib/esm/curve/LineString3d.d.ts.map +1 -1
- package/lib/esm/curve/LineString3d.js +1 -1
- package/lib/esm/curve/LineString3d.js.map +1 -1
- package/lib/esm/curve/Path.d.ts +4 -15
- package/lib/esm/curve/Path.d.ts.map +1 -1
- package/lib/esm/curve/Path.js +1 -35
- package/lib/esm/curve/Path.js.map +1 -1
- package/lib/esm/curve/internalContexts/ClosestPointStrokeHandler.d.ts +2 -1
- package/lib/esm/curve/internalContexts/ClosestPointStrokeHandler.d.ts.map +1 -1
- package/lib/esm/curve/internalContexts/ClosestPointStrokeHandler.js +19 -14
- package/lib/esm/curve/internalContexts/ClosestPointStrokeHandler.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/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/geometry3d/Ellipsoid.d.ts +2 -1
- package/lib/esm/geometry3d/Ellipsoid.d.ts.map +1 -1
- package/lib/esm/geometry3d/Ellipsoid.js +2 -1
- package/lib/esm/geometry3d/Ellipsoid.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/Point3dVector3d.js.map +1 -1
- package/lib/esm/geometry3d/Ray3d.d.ts +5 -0
- package/lib/esm/geometry3d/Ray3d.d.ts.map +1 -1
- package/lib/esm/geometry3d/Ray3d.js +7 -0
- package/lib/esm/geometry3d/Ray3d.js.map +1 -1
- package/lib/esm/numerics/Newton.d.ts.map +1 -1
- package/lib/esm/numerics/Newton.js +2 -1
- package/lib/esm/numerics/Newton.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/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/package.json +3 -3
package/lib/cjs/curve/Arc3d.js
CHANGED
|
@@ -771,48 +771,61 @@ class Arc3d extends CurvePrimitive_1.CurvePrimitive {
|
|
|
771
771
|
/**
|
|
772
772
|
* Return details of the closest point on the arc, optionally extending to full ellipse.
|
|
773
773
|
* @param spacePoint search for point closest to this point.
|
|
774
|
-
* @param extend if true, consider projections to the complete ellipse. If false, consider only endpoints
|
|
775
|
-
* projections within the arc sweep.
|
|
774
|
+
* @param extend if true, consider projections to the complete ellipse. If false (default), consider only endpoints
|
|
775
|
+
* and projections within the arc sweep. Note that for an open arc, extending one end is the same as extending both ends.
|
|
776
776
|
* @param result optional preallocated result.
|
|
777
777
|
*/
|
|
778
|
-
closestPoint(spacePoint, extend, result) {
|
|
778
|
+
closestPoint(spacePoint, extend = false, result) {
|
|
779
779
|
result = CurveLocationDetail_1.CurveLocationDetail.create(this, result);
|
|
780
|
-
const allRadians = this.allPerpendicularAngles(spacePoint, true,
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
extend0
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
allRadians.push(this._sweep.startRadians);
|
|
790
|
-
allRadians.push(this._sweep.endRadians);
|
|
780
|
+
const allRadians = this.allPerpendicularAngles(spacePoint, true, false);
|
|
781
|
+
// test endpoints if and only if arc is open and unextended
|
|
782
|
+
if (!this._sweep.isFullCircle) {
|
|
783
|
+
const extend0 = CurveExtendMode_1.CurveExtendOptions.resolveVariantCurveExtendParameterToCurveExtendMode(extend, 0);
|
|
784
|
+
const extend1 = CurveExtendMode_1.CurveExtendOptions.resolveVariantCurveExtendParameterToCurveExtendMode(extend, 1);
|
|
785
|
+
if (extend0 === CurveExtendMode_1.CurveExtendMode.None && extend1 === CurveExtendMode_1.CurveExtendMode.None) {
|
|
786
|
+
allRadians.push(this._sweep.startRadians);
|
|
787
|
+
allRadians.push(this._sweep.endRadians);
|
|
788
|
+
}
|
|
791
789
|
}
|
|
792
|
-
// hm... logically there must at least two angles there ... but if it happens return the start point ...
|
|
793
790
|
const workRay = Ray3d_1.Ray3d.createZero();
|
|
794
|
-
if (allRadians.length === 0) {
|
|
795
|
-
result.setFR(0.0, this.radiansToPointAndDerivative(this._sweep.startRadians, workRay));
|
|
796
|
-
result.a = spacePoint.distance(result.point);
|
|
791
|
+
if (allRadians.length === 0) { // shouldn't happen; there should always be at least 2 angles
|
|
792
|
+
result.setFR(0.0, this.radiansToPointAndDerivative(this._sweep.startRadians, workRay), spacePoint.distance(result.point));
|
|
797
793
|
}
|
|
798
794
|
else {
|
|
799
795
|
let dMin = Number.MAX_VALUE;
|
|
800
796
|
let d = 0;
|
|
801
797
|
for (const radians of allRadians) {
|
|
802
|
-
const
|
|
803
|
-
if (
|
|
804
|
-
this.fractionToPointAndDerivative(fraction, workRay);
|
|
798
|
+
const validatedFraction = CurveExtendMode_1.CurveExtendOptions.resolveRadiansToValidSweepFraction(extend, radians, this.sweep);
|
|
799
|
+
if (validatedFraction.isValid) {
|
|
800
|
+
this.fractionToPointAndDerivative(validatedFraction.fraction, workRay);
|
|
805
801
|
d = spacePoint.distance(workRay.origin);
|
|
806
802
|
if (d < dMin) {
|
|
807
803
|
dMin = d;
|
|
808
|
-
result.setFR(fraction, workRay);
|
|
809
|
-
result.a = d;
|
|
804
|
+
result.setFR(validatedFraction.fraction, workRay, d);
|
|
810
805
|
}
|
|
811
806
|
}
|
|
812
807
|
}
|
|
813
808
|
}
|
|
814
809
|
return result;
|
|
815
810
|
}
|
|
811
|
+
/**
|
|
812
|
+
* Search for a point on the Arc3d that is closest to the spacePoint as viewed in the xy-plane (ignoring z).
|
|
813
|
+
* * If the space point is exactly on the curve, this is the reverse of fractionToPoint.
|
|
814
|
+
* * Since CurvePrimitive should always have start and end available as candidate points, this method should always
|
|
815
|
+
* succeed.
|
|
816
|
+
* @param spacePoint point in space.
|
|
817
|
+
* @param extend if true, consider projections to the complete ellipse. If false (default), consider only endpoints
|
|
818
|
+
* and projections within the arc sweep. Note that for an open arc, extending one end is the same as extending both ends.
|
|
819
|
+
* @param result (optional) pre-allocated detail to populate and return.
|
|
820
|
+
* @returns details of the closest point.
|
|
821
|
+
*/
|
|
822
|
+
closestPointXY(spacePoint, extend = false, result) {
|
|
823
|
+
// prevent `ClosestPointStroker.claimResult` from clamping an exterior fraction when arc is half-extended
|
|
824
|
+
const extend0 = CurveExtendMode_1.CurveExtendOptions.resolveVariantCurveExtendParameterToCurveExtendMode(extend, 0);
|
|
825
|
+
const extend1 = CurveExtendMode_1.CurveExtendOptions.resolveVariantCurveExtendParameterToCurveExtendMode(extend, 1);
|
|
826
|
+
extend = extend0 !== CurveExtendMode_1.CurveExtendMode.None || extend1 !== CurveExtendMode_1.CurveExtendMode.None;
|
|
827
|
+
return super.closestPointXY(spacePoint, extend, result); // TODO: implement exact solution instead of deferring to superclass
|
|
828
|
+
}
|
|
816
829
|
/** Override of [[CurvePrimitive.emitTangents]] for Arc3d. */
|
|
817
830
|
emitTangents(spacePoint, announceTangent, options) {
|
|
818
831
|
const centerToPoint = Point3dVector3d_1.Vector3d.createStartEnd(this.centerRef, spacePoint);
|
|
@@ -880,6 +893,20 @@ class Arc3d extends CurvePrimitive_1.CurvePrimitive {
|
|
|
880
893
|
const axy = this._matrix.columnXDotColumnY();
|
|
881
894
|
return Angle_1.Angle.isPerpendicularDotSet(axx, ayy, axy) && Geometry_1.Geometry.isSameCoordinateSquared(axx, ayy);
|
|
882
895
|
}
|
|
896
|
+
/** Return true if the vector0 and vector90 xy parts are of equal length and perpendicular. */
|
|
897
|
+
get isCircularXY() {
|
|
898
|
+
const columnX = this._matrix.columnX();
|
|
899
|
+
const columnY = this._matrix.columnY();
|
|
900
|
+
const axx = columnX.magnitudeSquaredXY();
|
|
901
|
+
const ayy = columnY.magnitudeSquaredXY();
|
|
902
|
+
const axy = columnX.dotProductXY(columnY);
|
|
903
|
+
return Angle_1.Angle.isPerpendicularDotSet(axx, ayy, axy) && Geometry_1.Geometry.isSameCoordinateSquared(axx, ayy);
|
|
904
|
+
}
|
|
905
|
+
/** Return true if the arc has zero radius (is a point). */
|
|
906
|
+
get isDegenerateCircle() {
|
|
907
|
+
return Geometry_1.Geometry.isSmallMetricDistanceSquared(this._matrix.columnXMagnitudeSquared()) &&
|
|
908
|
+
Geometry_1.Geometry.isSmallMetricDistanceSquared(this._matrix.columnYMagnitudeSquared());
|
|
909
|
+
}
|
|
883
910
|
/** Return radius if the vector0 and vector90 are of equal length and perpendicular. Ignores z. */
|
|
884
911
|
circularRadiusXY() {
|
|
885
912
|
const ux = this._matrix.at(0, 0);
|