@itwin/core-geometry 5.9.0-dev.15 → 5.9.0-dev.17
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/lib/cjs/curve/Loop.d.ts.map +1 -1
- package/lib/cjs/curve/Loop.js +3 -1
- package/lib/cjs/curve/Loop.js.map +1 -1
- package/lib/cjs/curve/internalContexts/ClosestPointStrokeHandler.js.map +1 -1
- package/lib/cjs/curve/internalContexts/CurveCurveCloseApproachXY.d.ts +21 -27
- package/lib/cjs/curve/internalContexts/CurveCurveCloseApproachXY.d.ts.map +1 -1
- package/lib/cjs/curve/internalContexts/CurveCurveCloseApproachXY.js +97 -152
- package/lib/cjs/curve/internalContexts/CurveCurveCloseApproachXY.js.map +1 -1
- package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.d.ts +15 -14
- package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.d.ts.map +1 -1
- package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.js +144 -163
- package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.js.map +1 -1
- package/lib/cjs/geometry3d/PointHelpers.d.ts.map +1 -1
- package/lib/cjs/geometry3d/PointHelpers.js +6 -7
- package/lib/cjs/geometry3d/PointHelpers.js.map +1 -1
- package/lib/cjs/numerics/Newton.d.ts +10 -2
- package/lib/cjs/numerics/Newton.d.ts.map +1 -1
- package/lib/cjs/numerics/Newton.js.map +1 -1
- package/lib/esm/curve/Loop.d.ts.map +1 -1
- package/lib/esm/curve/Loop.js +3 -1
- package/lib/esm/curve/Loop.js.map +1 -1
- package/lib/esm/curve/internalContexts/ClosestPointStrokeHandler.js.map +1 -1
- package/lib/esm/curve/internalContexts/CurveCurveCloseApproachXY.d.ts +21 -27
- package/lib/esm/curve/internalContexts/CurveCurveCloseApproachXY.d.ts.map +1 -1
- package/lib/esm/curve/internalContexts/CurveCurveCloseApproachXY.js +98 -153
- package/lib/esm/curve/internalContexts/CurveCurveCloseApproachXY.js.map +1 -1
- package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.d.ts +15 -14
- package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.d.ts.map +1 -1
- package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.js +144 -163
- package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.js.map +1 -1
- package/lib/esm/geometry3d/PointHelpers.d.ts.map +1 -1
- package/lib/esm/geometry3d/PointHelpers.js +6 -7
- package/lib/esm/geometry3d/PointHelpers.js.map +1 -1
- package/lib/esm/numerics/Newton.d.ts +10 -2
- package/lib/esm/numerics/Newton.d.ts.map +1 -1
- package/lib/esm/numerics/Newton.js.map +1 -1
- package/package.json +3 -3
|
@@ -155,7 +155,8 @@ class CurveCurveIntersectXY extends GeometryHandler_1.RecurseToCurvesGeometryHan
|
|
|
155
155
|
* @param fractionB1 end of the subcurve of cpB
|
|
156
156
|
* @param reversed whether to reverse the details in the recorded intersection pair
|
|
157
157
|
* @param intervalDetails optional data for a coincident segment intersection
|
|
158
|
-
* @param fractionTol relative tolerance for comparing fractions to avoid duplicating the last intersection. Defaults
|
|
158
|
+
* @param fractionTol relative tolerance for comparing fractions to avoid duplicating the last intersection. Defaults
|
|
159
|
+
* to [[Geometry.smallAngleRadians]].
|
|
159
160
|
*/
|
|
160
161
|
recordPointWithLocalFractions(localFractionA, cpA, fractionA0, fractionA1, localFractionB, cpB, fractionB0, fractionB1, reversed, intervalDetails, fractionTol) {
|
|
161
162
|
let globalFractionA, globalFractionB;
|
|
@@ -582,9 +583,9 @@ class CurveCurveIntersectXY extends GeometryHandler_1.RecurseToCurvesGeometryHan
|
|
|
582
583
|
bezierA.fractionToPoint4d(f1, this._xyzwA1);
|
|
583
584
|
Point4d_1.Point4d.createPlanePointPointZ(this._xyzwA0, this._xyzwA1, this._xyzwPlane);
|
|
584
585
|
bezierB.poleProductsXYZW(univariateBezierB.coffs, this._xyzwPlane.x, this._xyzwPlane.y, this._xyzwPlane.z, this._xyzwPlane.w);
|
|
585
|
-
let errors = 0;
|
|
586
586
|
const roots = univariateBezierB.roots(0.0, true);
|
|
587
587
|
if (roots) {
|
|
588
|
+
const strictTolerance = this._coincidentGeometryContext.tolerance * 0.0001;
|
|
588
589
|
for (const r of roots) {
|
|
589
590
|
let bezierBFraction = r;
|
|
590
591
|
bezierB.fractionToPoint4d(bezierBFraction, this._xyzwB);
|
|
@@ -596,28 +597,19 @@ class CurveCurveIntersectXY extends GeometryHandler_1.RecurseToCurvesGeometryHan
|
|
|
596
597
|
const xyMatchingFunction = new Newton_1.CurveCurveIntersectionXYRRToRRD(bezierA, bezierB);
|
|
597
598
|
const newtonSearcher = new Newton_1.Newton2dUnboundedWithDerivative(xyMatchingFunction);
|
|
598
599
|
newtonSearcher.setUV(bezierAFraction, bezierBFraction);
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
}
|
|
600
|
+
let converged = newtonSearcher.runIterations();
|
|
601
|
+
bezierAFraction = newtonSearcher.getU();
|
|
602
|
+
bezierBFraction = newtonSearcher.getV();
|
|
603
603
|
const bcurveAFraction = bezierA.fractionToParentFraction(bezierAFraction);
|
|
604
604
|
const bcurveBFraction = bezierB.fractionToParentFraction(bezierBFraction);
|
|
605
|
-
if (false) { // verify results
|
|
606
|
-
const xyzA0 = bezierA.fractionToPoint(bezierAFraction);
|
|
607
|
-
const xyzA1 = bcurveA.fractionToPoint(bcurveAFraction);
|
|
608
|
-
const xyzB0 = bezierB.fractionToPoint(bezierBFraction);
|
|
609
|
-
const xyzB1 = bcurveB.fractionToPoint(bcurveBFraction);
|
|
610
|
-
if (!xyzA0.isAlmostEqualXY(xyzA1))
|
|
611
|
-
errors++;
|
|
612
|
-
if (!xyzB0.isAlmostEqualXY(xyzB1))
|
|
613
|
-
errors++;
|
|
614
|
-
if (errors > 0 && !xyzA0.isAlmostEqual(xyzB0))
|
|
615
|
-
errors++;
|
|
616
|
-
if (errors > 0 && !xyzA1.isAlmostEqual(xyzB1))
|
|
617
|
-
errors++;
|
|
618
|
-
}
|
|
619
605
|
if (this.acceptFraction(false, bcurveAFraction, false) && this.acceptFraction(false, bcurveBFraction, false)) {
|
|
620
|
-
|
|
606
|
+
const pointA = bezierA.fractionToPoint(bezierAFraction, CurveCurveIntersectXY._workPointA0);
|
|
607
|
+
const pointB = bezierB.fractionToPoint(bezierBFraction, CurveCurveIntersectXY._workPointB0);
|
|
608
|
+
if (!converged) { // Newton may have found close points even if it didn't converge parametrically
|
|
609
|
+
converged = pointA.isAlmostEqualXY(pointB, strictTolerance); // we can afford to be choosy
|
|
610
|
+
}
|
|
611
|
+
if (converged)
|
|
612
|
+
this.recordPointWithLocalFractions(bcurveAFraction, bcurveA, 0, 1, bcurveBFraction, bcurveB, 0, 1, reversed);
|
|
621
613
|
}
|
|
622
614
|
}
|
|
623
615
|
}
|
|
@@ -846,137 +838,6 @@ class CurveCurveIntersectXY extends GeometryHandler_1.RecurseToCurvesGeometryHan
|
|
|
846
838
|
this.resetGeometryB(geomB); // restore
|
|
847
839
|
this._results = CurveChainWithDistanceIndex_1.CurveChainWithDistanceIndex.convertChildDetailToChainDetail(this._results, index0, undefined, geomB, true);
|
|
848
840
|
}
|
|
849
|
-
/**
|
|
850
|
-
* Invoke dispatch on each child of `g` as "geometryA".
|
|
851
|
-
* * If `g` is a `Path` or `Loop`, adjust extension flags for geometryA accordingly.
|
|
852
|
-
*/
|
|
853
|
-
handleChildren(g) {
|
|
854
|
-
const children = g.children;
|
|
855
|
-
if (!children)
|
|
856
|
-
return;
|
|
857
|
-
const saveExtendA0 = this._extendA0;
|
|
858
|
-
const saveExtendA1 = this._extendA1;
|
|
859
|
-
for (let i = 0; i < children.length; i++) {
|
|
860
|
-
let extendA0 = saveExtendA0;
|
|
861
|
-
let extendA1 = saveExtendA1;
|
|
862
|
-
if (g instanceof Path_1.Path && children.length > 1) {
|
|
863
|
-
if (i === 0)
|
|
864
|
-
extendA1 = false; // first child can only extend from start
|
|
865
|
-
else if (i === children.length - 1)
|
|
866
|
-
extendA0 = false; // last child can only extend from end
|
|
867
|
-
else
|
|
868
|
-
extendA0 = extendA1 = false; // middle children cannot extend
|
|
869
|
-
}
|
|
870
|
-
else if (g instanceof Loop_1.Loop) {
|
|
871
|
-
extendA0 = extendA1 = false; // Loops cannot extend
|
|
872
|
-
}
|
|
873
|
-
this.resetGeometryA(extendA0, extendA1);
|
|
874
|
-
children[i].dispatchToGeometryHandler(this);
|
|
875
|
-
}
|
|
876
|
-
this.resetGeometryA(saveExtendA0, saveExtendA1);
|
|
877
|
-
}
|
|
878
|
-
/** Double dispatch handler for strongly typed segment. */
|
|
879
|
-
handleLineSegment3d(segmentA) {
|
|
880
|
-
if (this._geometryB instanceof LineSegment3d_1.LineSegment3d) {
|
|
881
|
-
const segmentB = this._geometryB;
|
|
882
|
-
this.dispatchSegmentSegment(segmentA, this._extendA0, segmentA.point0Ref, 0.0, segmentA.point1Ref, 1.0, this._extendA1, segmentB, this._extendB0, segmentB.point0Ref, 0.0, segmentB.point1Ref, 1.0, this._extendB1, false);
|
|
883
|
-
}
|
|
884
|
-
else if (this._geometryB instanceof LineString3d_1.LineString3d) {
|
|
885
|
-
this.computeSegmentLineString(segmentA, this._extendA0, this._extendA1, this._geometryB, this._extendB0, this._extendB1, false);
|
|
886
|
-
}
|
|
887
|
-
else if (this._geometryB instanceof Arc3d_1.Arc3d) {
|
|
888
|
-
this.dispatchSegmentArc(segmentA, this._extendA0, segmentA.point0Ref, 0.0, segmentA.point1Ref, 1.0, this._extendA1, this._geometryB, this._extendB0, this._extendB1, false);
|
|
889
|
-
}
|
|
890
|
-
else if (this._geometryB instanceof BSplineCurve_1.BSplineCurve3d) {
|
|
891
|
-
this.dispatchSegmentBsplineCurve(segmentA, this._extendA0, segmentA.point0Ref, 0.0, segmentA.point1Ref, 1.0, this._extendA1, this._geometryB, this._extendB0, this._extendB1, false);
|
|
892
|
-
}
|
|
893
|
-
else if (this._geometryB instanceof TransitionSpiral3d_1.TransitionSpiral3d) {
|
|
894
|
-
this.dispatchCurveSpiral(segmentA, this._extendA0, this._extendA1, this._geometryB, false);
|
|
895
|
-
}
|
|
896
|
-
else if (this._geometryB instanceof CurveCollection_1.CurveCollection) {
|
|
897
|
-
this.dispatchCurveCollection(segmentA, this.handleLineSegment3d.bind(this));
|
|
898
|
-
}
|
|
899
|
-
else if (this._geometryB instanceof CurveChainWithDistanceIndex_1.CurveChainWithDistanceIndex) {
|
|
900
|
-
this.dispatchCurveChainWithDistanceIndex(segmentA, this.handleLineSegment3d.bind(this));
|
|
901
|
-
}
|
|
902
|
-
return undefined;
|
|
903
|
-
}
|
|
904
|
-
/** Double dispatch handler for strongly typed linestring. */
|
|
905
|
-
handleLineString3d(lsA) {
|
|
906
|
-
if (this._geometryB instanceof LineString3d_1.LineString3d) {
|
|
907
|
-
const lsB = this._geometryB;
|
|
908
|
-
this.computeLineStringLineString(lsA, this._extendA0, this._extendA1, lsB, this._extendB0, this._extendB1, false);
|
|
909
|
-
}
|
|
910
|
-
else if (this._geometryB instanceof LineSegment3d_1.LineSegment3d) {
|
|
911
|
-
this.computeSegmentLineString(this._geometryB, this._extendB0, this._extendB1, lsA, this._extendA0, this._extendA1, true);
|
|
912
|
-
}
|
|
913
|
-
else if (this._geometryB instanceof Arc3d_1.Arc3d) {
|
|
914
|
-
this.computeArcLineString(this._geometryB, this._extendB0, this._extendB1, lsA, this._extendA0, this._extendA1, true);
|
|
915
|
-
}
|
|
916
|
-
else if (this._geometryB instanceof BSplineCurve_1.BSplineCurve3d) {
|
|
917
|
-
this.dispatchLineStringBSplineCurve(lsA, this._extendA0, this._extendA1, this._geometryB, this._extendB0, this._extendB1, false);
|
|
918
|
-
}
|
|
919
|
-
else if (this._geometryB instanceof TransitionSpiral3d_1.TransitionSpiral3d) {
|
|
920
|
-
this.dispatchCurveSpiral(lsA, this._extendA0, this._extendA1, this._geometryB, false);
|
|
921
|
-
}
|
|
922
|
-
else if (this._geometryB instanceof CurveCollection_1.CurveCollection) {
|
|
923
|
-
this.dispatchCurveCollection(lsA, this.handleLineString3d.bind(this));
|
|
924
|
-
}
|
|
925
|
-
else if (this._geometryB instanceof CurveChainWithDistanceIndex_1.CurveChainWithDistanceIndex) {
|
|
926
|
-
this.dispatchCurveChainWithDistanceIndex(lsA, this.handleLineString3d.bind(this));
|
|
927
|
-
}
|
|
928
|
-
return undefined;
|
|
929
|
-
}
|
|
930
|
-
/** Double dispatch handler for strongly typed arc. */
|
|
931
|
-
handleArc3d(arcA) {
|
|
932
|
-
if (this._geometryB instanceof LineSegment3d_1.LineSegment3d) {
|
|
933
|
-
this.dispatchSegmentArc(this._geometryB, this._extendB0, this._geometryB.point0Ref, 0.0, this._geometryB.point1Ref, 1.0, this._extendB1, arcA, this._extendA0, this._extendA1, true);
|
|
934
|
-
}
|
|
935
|
-
else if (this._geometryB instanceof LineString3d_1.LineString3d) {
|
|
936
|
-
this.computeArcLineString(arcA, this._extendA0, this._extendA1, this._geometryB, this._extendB0, this._extendB1, false);
|
|
937
|
-
}
|
|
938
|
-
else if (this._geometryB instanceof Arc3d_1.Arc3d) {
|
|
939
|
-
this.dispatchArcArc(arcA, this._extendA0, this._extendA1, this._geometryB, this._extendB0, this._extendB1, false);
|
|
940
|
-
}
|
|
941
|
-
else if (this._geometryB instanceof BSplineCurve_1.BSplineCurve3d) {
|
|
942
|
-
this.dispatchArcBsplineCurve3d(arcA, this._extendA0, this._extendA1, this._geometryB, this._extendB0, this._extendB1, false);
|
|
943
|
-
}
|
|
944
|
-
else if (this._geometryB instanceof TransitionSpiral3d_1.TransitionSpiral3d) {
|
|
945
|
-
this.dispatchCurveSpiral(arcA, this._extendA0, this._extendA1, this._geometryB, false);
|
|
946
|
-
}
|
|
947
|
-
else if (this._geometryB instanceof CurveCollection_1.CurveCollection) {
|
|
948
|
-
this.dispatchCurveCollection(arcA, this.handleArc3d.bind(this));
|
|
949
|
-
}
|
|
950
|
-
else if (this._geometryB instanceof CurveChainWithDistanceIndex_1.CurveChainWithDistanceIndex) {
|
|
951
|
-
this.dispatchCurveChainWithDistanceIndex(arcA, this.handleArc3d.bind(this));
|
|
952
|
-
}
|
|
953
|
-
return undefined;
|
|
954
|
-
}
|
|
955
|
-
/** Double dispatch handler for strongly typed bspline curve. */
|
|
956
|
-
handleBSplineCurve3d(curveA) {
|
|
957
|
-
if (this._geometryB instanceof LineSegment3d_1.LineSegment3d) {
|
|
958
|
-
this.dispatchSegmentBsplineCurve(this._geometryB, this._extendB0, this._geometryB.point0Ref, 0.0, this._geometryB.point1Ref, 1.0, this._extendB1, curveA, this._extendA0, this._extendA1, true);
|
|
959
|
-
}
|
|
960
|
-
else if (this._geometryB instanceof LineString3d_1.LineString3d) {
|
|
961
|
-
this.dispatchLineStringBSplineCurve(this._geometryB, this._extendB0, this._extendB1, curveA, this._extendA0, this._extendA1, true);
|
|
962
|
-
}
|
|
963
|
-
else if (this._geometryB instanceof Arc3d_1.Arc3d) {
|
|
964
|
-
this.dispatchArcBsplineCurve3d(this._geometryB, this._extendB0, this._extendB1, curveA, this._extendA0, this._extendA1, true);
|
|
965
|
-
}
|
|
966
|
-
else if (this._geometryB instanceof BSplineCurve_1.BSplineCurve3dBase) {
|
|
967
|
-
this.dispatchBSplineCurve3dBSplineCurve3d(curveA, this._geometryB, false);
|
|
968
|
-
}
|
|
969
|
-
else if (this._geometryB instanceof TransitionSpiral3d_1.TransitionSpiral3d) {
|
|
970
|
-
this.dispatchCurveSpiral(curveA, this._extendA0, this._extendA1, this._geometryB, false);
|
|
971
|
-
}
|
|
972
|
-
else if (this._geometryB instanceof CurveCollection_1.CurveCollection) {
|
|
973
|
-
this.dispatchCurveCollection(curveA, this.handleBSplineCurve3d.bind(this));
|
|
974
|
-
}
|
|
975
|
-
else if (this._geometryB instanceof CurveChainWithDistanceIndex_1.CurveChainWithDistanceIndex) {
|
|
976
|
-
this.dispatchCurveChainWithDistanceIndex(curveA, this.handleBSplineCurve3d.bind(this));
|
|
977
|
-
}
|
|
978
|
-
return undefined;
|
|
979
|
-
}
|
|
980
841
|
/**
|
|
981
842
|
* Process tail of `this._results` for xy-intersections between the curve and spiral.
|
|
982
843
|
* * Refine each result via Newton iteration. If it doesn't converge, remove it.
|
|
@@ -1115,6 +976,137 @@ class CurveCurveIntersectXY extends GeometryHandler_1.RecurseToCurvesGeometryHan
|
|
|
1115
976
|
this.appendDiscreteCloseApproachResults(cpA, cpB, maxError, reversed); // seeds for finding tangent intersections
|
|
1116
977
|
this.refineSpiralResultsByNewton(curveA, spiralB, index0, reversed);
|
|
1117
978
|
}
|
|
979
|
+
/**
|
|
980
|
+
* Invoke dispatch on each child of `g` as "geometryA".
|
|
981
|
+
* * If `g` is a `Path` or `Loop`, adjust extension flags for geometryA accordingly.
|
|
982
|
+
*/
|
|
983
|
+
handleChildren(g) {
|
|
984
|
+
const children = g.children;
|
|
985
|
+
if (!children)
|
|
986
|
+
return;
|
|
987
|
+
const saveExtendA0 = this._extendA0;
|
|
988
|
+
const saveExtendA1 = this._extendA1;
|
|
989
|
+
for (let i = 0; i < children.length; i++) {
|
|
990
|
+
let extendA0 = saveExtendA0;
|
|
991
|
+
let extendA1 = saveExtendA1;
|
|
992
|
+
if (g instanceof Path_1.Path && children.length > 1) {
|
|
993
|
+
if (i === 0)
|
|
994
|
+
extendA1 = false; // first child can only extend from start
|
|
995
|
+
else if (i === children.length - 1)
|
|
996
|
+
extendA0 = false; // last child can only extend from end
|
|
997
|
+
else
|
|
998
|
+
extendA0 = extendA1 = false; // middle children cannot extend
|
|
999
|
+
}
|
|
1000
|
+
else if (g instanceof Loop_1.Loop) {
|
|
1001
|
+
extendA0 = extendA1 = false; // Loops cannot extend
|
|
1002
|
+
}
|
|
1003
|
+
this.resetGeometryA(extendA0, extendA1);
|
|
1004
|
+
children[i].dispatchToGeometryHandler(this);
|
|
1005
|
+
}
|
|
1006
|
+
this.resetGeometryA(saveExtendA0, saveExtendA1);
|
|
1007
|
+
}
|
|
1008
|
+
/** Double dispatch handler for strongly typed segment. */
|
|
1009
|
+
handleLineSegment3d(segmentA) {
|
|
1010
|
+
if (this._geometryB instanceof LineSegment3d_1.LineSegment3d) {
|
|
1011
|
+
const segmentB = this._geometryB;
|
|
1012
|
+
this.dispatchSegmentSegment(segmentA, this._extendA0, segmentA.point0Ref, 0.0, segmentA.point1Ref, 1.0, this._extendA1, segmentB, this._extendB0, segmentB.point0Ref, 0.0, segmentB.point1Ref, 1.0, this._extendB1, false);
|
|
1013
|
+
}
|
|
1014
|
+
else if (this._geometryB instanceof LineString3d_1.LineString3d) {
|
|
1015
|
+
this.computeSegmentLineString(segmentA, this._extendA0, this._extendA1, this._geometryB, this._extendB0, this._extendB1, false);
|
|
1016
|
+
}
|
|
1017
|
+
else if (this._geometryB instanceof Arc3d_1.Arc3d) {
|
|
1018
|
+
this.dispatchSegmentArc(segmentA, this._extendA0, segmentA.point0Ref, 0.0, segmentA.point1Ref, 1.0, this._extendA1, this._geometryB, this._extendB0, this._extendB1, false);
|
|
1019
|
+
}
|
|
1020
|
+
else if (this._geometryB instanceof BSplineCurve_1.BSplineCurve3d) {
|
|
1021
|
+
this.dispatchSegmentBsplineCurve(segmentA, this._extendA0, segmentA.point0Ref, 0.0, segmentA.point1Ref, 1.0, this._extendA1, this._geometryB, this._extendB0, this._extendB1, false);
|
|
1022
|
+
}
|
|
1023
|
+
else if (this._geometryB instanceof TransitionSpiral3d_1.TransitionSpiral3d) {
|
|
1024
|
+
this.dispatchCurveSpiral(segmentA, this._extendA0, this._extendA1, this._geometryB, false);
|
|
1025
|
+
}
|
|
1026
|
+
else if (this._geometryB instanceof CurveCollection_1.CurveCollection) {
|
|
1027
|
+
this.dispatchCurveCollection(segmentA, this.handleLineSegment3d.bind(this));
|
|
1028
|
+
}
|
|
1029
|
+
else if (this._geometryB instanceof CurveChainWithDistanceIndex_1.CurveChainWithDistanceIndex) {
|
|
1030
|
+
this.dispatchCurveChainWithDistanceIndex(segmentA, this.handleLineSegment3d.bind(this));
|
|
1031
|
+
}
|
|
1032
|
+
return undefined;
|
|
1033
|
+
}
|
|
1034
|
+
/** Double dispatch handler for strongly typed linestring. */
|
|
1035
|
+
handleLineString3d(lsA) {
|
|
1036
|
+
if (this._geometryB instanceof LineString3d_1.LineString3d) {
|
|
1037
|
+
const lsB = this._geometryB;
|
|
1038
|
+
this.computeLineStringLineString(lsA, this._extendA0, this._extendA1, lsB, this._extendB0, this._extendB1, false);
|
|
1039
|
+
}
|
|
1040
|
+
else if (this._geometryB instanceof LineSegment3d_1.LineSegment3d) {
|
|
1041
|
+
this.computeSegmentLineString(this._geometryB, this._extendB0, this._extendB1, lsA, this._extendA0, this._extendA1, true);
|
|
1042
|
+
}
|
|
1043
|
+
else if (this._geometryB instanceof Arc3d_1.Arc3d) {
|
|
1044
|
+
this.computeArcLineString(this._geometryB, this._extendB0, this._extendB1, lsA, this._extendA0, this._extendA1, true);
|
|
1045
|
+
}
|
|
1046
|
+
else if (this._geometryB instanceof BSplineCurve_1.BSplineCurve3d) {
|
|
1047
|
+
this.dispatchLineStringBSplineCurve(lsA, this._extendA0, this._extendA1, this._geometryB, this._extendB0, this._extendB1, false);
|
|
1048
|
+
}
|
|
1049
|
+
else if (this._geometryB instanceof TransitionSpiral3d_1.TransitionSpiral3d) {
|
|
1050
|
+
this.dispatchCurveSpiral(lsA, this._extendA0, this._extendA1, this._geometryB, false);
|
|
1051
|
+
}
|
|
1052
|
+
else if (this._geometryB instanceof CurveCollection_1.CurveCollection) {
|
|
1053
|
+
this.dispatchCurveCollection(lsA, this.handleLineString3d.bind(this));
|
|
1054
|
+
}
|
|
1055
|
+
else if (this._geometryB instanceof CurveChainWithDistanceIndex_1.CurveChainWithDistanceIndex) {
|
|
1056
|
+
this.dispatchCurveChainWithDistanceIndex(lsA, this.handleLineString3d.bind(this));
|
|
1057
|
+
}
|
|
1058
|
+
return undefined;
|
|
1059
|
+
}
|
|
1060
|
+
/** Double dispatch handler for strongly typed arc. */
|
|
1061
|
+
handleArc3d(arcA) {
|
|
1062
|
+
if (this._geometryB instanceof LineSegment3d_1.LineSegment3d) {
|
|
1063
|
+
this.dispatchSegmentArc(this._geometryB, this._extendB0, this._geometryB.point0Ref, 0.0, this._geometryB.point1Ref, 1.0, this._extendB1, arcA, this._extendA0, this._extendA1, true);
|
|
1064
|
+
}
|
|
1065
|
+
else if (this._geometryB instanceof LineString3d_1.LineString3d) {
|
|
1066
|
+
this.computeArcLineString(arcA, this._extendA0, this._extendA1, this._geometryB, this._extendB0, this._extendB1, false);
|
|
1067
|
+
}
|
|
1068
|
+
else if (this._geometryB instanceof Arc3d_1.Arc3d) {
|
|
1069
|
+
this.dispatchArcArc(arcA, this._extendA0, this._extendA1, this._geometryB, this._extendB0, this._extendB1, false);
|
|
1070
|
+
}
|
|
1071
|
+
else if (this._geometryB instanceof BSplineCurve_1.BSplineCurve3d) {
|
|
1072
|
+
this.dispatchArcBsplineCurve3d(arcA, this._extendA0, this._extendA1, this._geometryB, this._extendB0, this._extendB1, false);
|
|
1073
|
+
}
|
|
1074
|
+
else if (this._geometryB instanceof TransitionSpiral3d_1.TransitionSpiral3d) {
|
|
1075
|
+
this.dispatchCurveSpiral(arcA, this._extendA0, this._extendA1, this._geometryB, false);
|
|
1076
|
+
}
|
|
1077
|
+
else if (this._geometryB instanceof CurveCollection_1.CurveCollection) {
|
|
1078
|
+
this.dispatchCurveCollection(arcA, this.handleArc3d.bind(this));
|
|
1079
|
+
}
|
|
1080
|
+
else if (this._geometryB instanceof CurveChainWithDistanceIndex_1.CurveChainWithDistanceIndex) {
|
|
1081
|
+
this.dispatchCurveChainWithDistanceIndex(arcA, this.handleArc3d.bind(this));
|
|
1082
|
+
}
|
|
1083
|
+
return undefined;
|
|
1084
|
+
}
|
|
1085
|
+
/** Double dispatch handler for strongly typed bspline curve. */
|
|
1086
|
+
handleBSplineCurve3d(curveA) {
|
|
1087
|
+
if (this._geometryB instanceof LineSegment3d_1.LineSegment3d) {
|
|
1088
|
+
this.dispatchSegmentBsplineCurve(this._geometryB, this._extendB0, this._geometryB.point0Ref, 0.0, this._geometryB.point1Ref, 1.0, this._extendB1, curveA, this._extendA0, this._extendA1, true);
|
|
1089
|
+
}
|
|
1090
|
+
else if (this._geometryB instanceof LineString3d_1.LineString3d) {
|
|
1091
|
+
this.dispatchLineStringBSplineCurve(this._geometryB, this._extendB0, this._extendB1, curveA, this._extendA0, this._extendA1, true);
|
|
1092
|
+
}
|
|
1093
|
+
else if (this._geometryB instanceof Arc3d_1.Arc3d) {
|
|
1094
|
+
this.dispatchArcBsplineCurve3d(this._geometryB, this._extendB0, this._extendB1, curveA, this._extendA0, this._extendA1, true);
|
|
1095
|
+
}
|
|
1096
|
+
else if (this._geometryB instanceof BSplineCurve_1.BSplineCurve3dBase) {
|
|
1097
|
+
this.dispatchBSplineCurve3dBSplineCurve3d(curveA, this._geometryB, false);
|
|
1098
|
+
}
|
|
1099
|
+
else if (this._geometryB instanceof TransitionSpiral3d_1.TransitionSpiral3d) {
|
|
1100
|
+
this.dispatchCurveSpiral(curveA, this._extendA0, this._extendA1, this._geometryB, false);
|
|
1101
|
+
}
|
|
1102
|
+
else if (this._geometryB instanceof CurveCollection_1.CurveCollection) {
|
|
1103
|
+
this.dispatchCurveCollection(curveA, this.handleBSplineCurve3d.bind(this));
|
|
1104
|
+
}
|
|
1105
|
+
else if (this._geometryB instanceof CurveChainWithDistanceIndex_1.CurveChainWithDistanceIndex) {
|
|
1106
|
+
this.dispatchCurveChainWithDistanceIndex(curveA, this.handleBSplineCurve3d.bind(this));
|
|
1107
|
+
}
|
|
1108
|
+
return undefined;
|
|
1109
|
+
}
|
|
1118
1110
|
/** Double dispatch handler for strongly typed spiral curve. */
|
|
1119
1111
|
handleTransitionSpiral(spiral) {
|
|
1120
1112
|
if (this._geometryB instanceof CurveChainWithDistanceIndex_1.CurveChainWithDistanceIndex) {
|
|
@@ -1136,19 +1128,8 @@ class CurveCurveIntersectXY extends GeometryHandler_1.RecurseToCurvesGeometryHan
|
|
|
1136
1128
|
}
|
|
1137
1129
|
/** Double dispatch handler for strongly typed homogeneous bspline curve. */
|
|
1138
1130
|
handleBSplineCurve3dH(_curve) {
|
|
1139
|
-
/*
|
|
1140
1131
|
// NEEDS WORK -- make "dispatch" methods tolerant of both 3d and 3dH .
|
|
1141
1132
|
// "easy" if both present BezierCurve3dH span loaders
|
|
1142
|
-
if (this._geometryB instanceof LineSegment3d) {
|
|
1143
|
-
this.dispatchSegmentBsplineCurve(
|
|
1144
|
-
this._geometryB, this._extendB, this._geometryB.point0Ref, 0.0, this._geometryB.point1Ref, 1.0, this._extendB,
|
|
1145
|
-
curve, this._extendA, true);
|
|
1146
|
-
} else if (this._geometryB instanceof LineString3d) {
|
|
1147
|
-
this.dispatchLineStringBSplineCurve(this._geometryB, this._extendB, curve, this._extendA, true);
|
|
1148
|
-
} else if (this._geometryB instanceof Arc3d) {
|
|
1149
|
-
this.dispatchArcBsplineCurve3d(this._geometryB, this._extendB, curve, this._extendA, true);
|
|
1150
|
-
}
|
|
1151
|
-
*/
|
|
1152
1133
|
return undefined;
|
|
1153
1134
|
}
|
|
1154
1135
|
}
|