@itwin/core-geometry 4.0.0-dev.7 → 4.0.0-dev.8
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/Geometry.d.ts +3 -3
- package/lib/cjs/Geometry.d.ts.map +1 -1
- package/lib/cjs/Geometry.js +27 -11
- package/lib/cjs/Geometry.js.map +1 -1
- package/lib/cjs/curve/CurveCurve.d.ts +11 -8
- package/lib/cjs/curve/CurveCurve.d.ts.map +1 -1
- package/lib/cjs/curve/CurveCurve.js +16 -12
- package/lib/cjs/curve/CurveCurve.js.map +1 -1
- package/lib/cjs/curve/CurveCurveIntersectXY.d.ts +5 -1
- package/lib/cjs/curve/CurveCurveIntersectXY.d.ts.map +1 -1
- package/lib/cjs/curve/CurveCurveIntersectXY.js +11 -10
- package/lib/cjs/curve/CurveCurveIntersectXY.js.map +1 -1
- package/lib/cjs/geometry3d/CoincidentGeometryOps.d.ts +1 -0
- package/lib/cjs/geometry3d/CoincidentGeometryOps.d.ts.map +1 -1
- package/lib/cjs/geometry3d/CoincidentGeometryOps.js +3 -0
- package/lib/cjs/geometry3d/CoincidentGeometryOps.js.map +1 -1
- package/lib/cjs/geometry3d/Matrix3d.d.ts +171 -118
- package/lib/cjs/geometry3d/Matrix3d.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Matrix3d.js +448 -417
- package/lib/cjs/geometry3d/Matrix3d.js.map +1 -1
- package/lib/cjs/geometry3d/Point3dVector3d.d.ts +1 -1
- package/lib/cjs/geometry3d/Point3dVector3d.js +1 -1
- package/lib/cjs/geometry3d/Point3dVector3d.js.map +1 -1
- package/lib/cjs/geometry3d/Segment1d.d.ts +1 -1
- package/lib/cjs/geometry3d/Segment1d.js +1 -1
- package/lib/cjs/geometry3d/Segment1d.js.map +1 -1
- package/lib/esm/Geometry.d.ts +3 -3
- package/lib/esm/Geometry.d.ts.map +1 -1
- package/lib/esm/Geometry.js +27 -11
- package/lib/esm/Geometry.js.map +1 -1
- package/lib/esm/curve/CurveCurve.d.ts +11 -8
- package/lib/esm/curve/CurveCurve.d.ts.map +1 -1
- package/lib/esm/curve/CurveCurve.js +16 -12
- package/lib/esm/curve/CurveCurve.js.map +1 -1
- package/lib/esm/curve/CurveCurveIntersectXY.d.ts +5 -1
- package/lib/esm/curve/CurveCurveIntersectXY.d.ts.map +1 -1
- package/lib/esm/curve/CurveCurveIntersectXY.js +11 -10
- package/lib/esm/curve/CurveCurveIntersectXY.js.map +1 -1
- package/lib/esm/geometry3d/CoincidentGeometryOps.d.ts +1 -0
- package/lib/esm/geometry3d/CoincidentGeometryOps.d.ts.map +1 -1
- package/lib/esm/geometry3d/CoincidentGeometryOps.js +3 -0
- package/lib/esm/geometry3d/CoincidentGeometryOps.js.map +1 -1
- package/lib/esm/geometry3d/Matrix3d.d.ts +171 -118
- package/lib/esm/geometry3d/Matrix3d.d.ts.map +1 -1
- package/lib/esm/geometry3d/Matrix3d.js +448 -417
- package/lib/esm/geometry3d/Matrix3d.js.map +1 -1
- package/lib/esm/geometry3d/Point3dVector3d.d.ts +1 -1
- package/lib/esm/geometry3d/Point3dVector3d.js +1 -1
- package/lib/esm/geometry3d/Point3dVector3d.js.map +1 -1
- package/lib/esm/geometry3d/Segment1d.d.ts +1 -1
- package/lib/esm/geometry3d/Segment1d.js +1 -1
- package/lib/esm/geometry3d/Segment1d.js.map +1 -1
- package/package.json +4 -4
|
@@ -5,11 +5,12 @@
|
|
|
5
5
|
/** @packageDocumentation
|
|
6
6
|
* @module Curve
|
|
7
7
|
*/
|
|
8
|
+
import { Geometry } from "../Geometry";
|
|
8
9
|
import { CurveCollection } from "./CurveCollection";
|
|
10
|
+
import { CurveCurveCloseApproachXY } from "./CurveCurveCloseApproachXY";
|
|
9
11
|
import { CurveCurveIntersectXY } from "./CurveCurveIntersectXY";
|
|
10
12
|
import { CurveCurveIntersectXYZ } from "./CurveCurveIntersectXYZ";
|
|
11
13
|
import { CurvePrimitive } from "./CurvePrimitive";
|
|
12
|
-
import { CurveCurveCloseApproachXY } from "./CurveCurveCloseApproachXY";
|
|
13
14
|
/**
|
|
14
15
|
* `CurveCurve` has static method for various computations that work on a pair of curves or curve collections.
|
|
15
16
|
* @public
|
|
@@ -17,13 +18,14 @@ import { CurveCurveCloseApproachXY } from "./CurveCurveCloseApproachXY";
|
|
|
17
18
|
export class CurveCurve {
|
|
18
19
|
/**
|
|
19
20
|
* Return xy intersections of 2 curves.
|
|
20
|
-
* @param geometryA
|
|
21
|
+
* @param geometryA first geometry
|
|
21
22
|
* @param extendA true to allow geometryA to extend
|
|
22
23
|
* @param geometryB second geometry
|
|
23
24
|
* @param extendB true to allow geometryB to extend
|
|
25
|
+
* @param tolerance optional distance tolerance for coincidence
|
|
24
26
|
*/
|
|
25
|
-
static intersectionXYPairs(geometryA, extendA, geometryB, extendB) {
|
|
26
|
-
const handler = new CurveCurveIntersectXY(undefined, geometryA, extendA, geometryB, extendB);
|
|
27
|
+
static intersectionXYPairs(geometryA, extendA, geometryB, extendB, tolerance = Geometry.smallMetricDistance) {
|
|
28
|
+
const handler = new CurveCurveIntersectXY(undefined, geometryA, extendA, geometryB, extendB, tolerance);
|
|
27
29
|
if (geometryB instanceof CurvePrimitive) {
|
|
28
30
|
geometryA.dispatchToGeometryHandler(handler);
|
|
29
31
|
}
|
|
@@ -38,13 +40,14 @@ export class CurveCurve {
|
|
|
38
40
|
}
|
|
39
41
|
/**
|
|
40
42
|
* Return xy intersections of 2 projected curves
|
|
41
|
-
* @param geometryA
|
|
43
|
+
* @param geometryA first geometry
|
|
42
44
|
* @param extendA true to allow geometryA to extend
|
|
43
45
|
* @param geometryB second geometry
|
|
44
46
|
* @param extendB true to allow geometryB to extend
|
|
47
|
+
* @param tolerance optional distance tolerance for coincidence
|
|
45
48
|
*/
|
|
46
|
-
static intersectionProjectedXYPairs(worldToLocal, geometryA, extendA, geometryB, extendB) {
|
|
47
|
-
const handler = new CurveCurveIntersectXY(worldToLocal, geometryA, extendA, geometryB, extendB);
|
|
49
|
+
static intersectionProjectedXYPairs(worldToLocal, geometryA, extendA, geometryB, extendB, tolerance = Geometry.smallMetricDistance) {
|
|
50
|
+
const handler = new CurveCurveIntersectXY(worldToLocal, geometryA, extendA, geometryB, extendB, tolerance);
|
|
48
51
|
geometryA.dispatchToGeometryHandler(handler);
|
|
49
52
|
return handler.grabPairedResults();
|
|
50
53
|
}
|
|
@@ -53,7 +56,7 @@ export class CurveCurve {
|
|
|
53
56
|
* * Implemented for combinations of LineSegment3d, LineString3d, Arc3d.
|
|
54
57
|
* * Not Implemented for bspline and bezier curves.
|
|
55
58
|
* @beta
|
|
56
|
-
* @param geometryA
|
|
59
|
+
* @param geometryA first geometry
|
|
57
60
|
* @param extendA true to allow geometryA to extend
|
|
58
61
|
* @param geometryB second geometry
|
|
59
62
|
* @param extendB true to allow geometryB to extend
|
|
@@ -65,13 +68,14 @@ export class CurveCurve {
|
|
|
65
68
|
}
|
|
66
69
|
/**
|
|
67
70
|
* Return xy intersections of 2 curves.
|
|
68
|
-
* @param geometryA
|
|
71
|
+
* @param geometryA first geometry
|
|
69
72
|
* @param extendA true to allow geometryA to extend
|
|
70
73
|
* @param geometryB second geometry
|
|
71
74
|
* @param extendB true to allow geometryB to extend
|
|
75
|
+
* @param tolerance optional distance tolerance for coincidence
|
|
72
76
|
*/
|
|
73
|
-
static allIntersectionsAmongPrimitivesXY(primitives) {
|
|
74
|
-
const handler = new CurveCurveIntersectXY(undefined, undefined, false, undefined, false);
|
|
77
|
+
static allIntersectionsAmongPrimitivesXY(primitives, tolerance = Geometry.smallMetricDistance) {
|
|
78
|
+
const handler = new CurveCurveIntersectXY(undefined, undefined, false, undefined, false, tolerance);
|
|
75
79
|
for (let i = 0; i < primitives.length; i++) {
|
|
76
80
|
const geometryA = primitives[i];
|
|
77
81
|
for (let j = i + 1; j < primitives.length; j++) {
|
|
@@ -83,7 +87,7 @@ export class CurveCurve {
|
|
|
83
87
|
}
|
|
84
88
|
/**
|
|
85
89
|
* Return xy close approaches of 2 projected curves
|
|
86
|
-
* @param geometryA
|
|
90
|
+
* @param geometryA first geometry
|
|
87
91
|
* @param geometryB second geometry
|
|
88
92
|
*/
|
|
89
93
|
static closeApproachProjectedXYPairs(geometryA, geometryB, maxDistance) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CurveCurve.js","sourceRoot":"","sources":["../../../src/curve/CurveCurve.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;
|
|
1
|
+
{"version":3,"file":"CurveCurve.js","sourceRoot":"","sources":["../../../src/curve/CurveCurve.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEvC,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AACxE,OAAO,EAAE,qBAAqB,EAAgC,MAAM,yBAAyB,CAAC;AAC9F,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAElE,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAGlD;;;GAGG;AACH,MAAM,OAAO,UAAU;IACrB;;;;;;;OAOG;IACI,MAAM,CAAC,mBAAmB,CAAC,SAAwB,EAAE,OAAgB,EAAE,SAAwB,EAAE,OAAgB,EAAE,YAAoB,QAAQ,CAAC,mBAAmB;QACxK,MAAM,OAAO,GAAG,IAAI,qBAAqB,CAAC,SAAS,EAAE,SAAS,EAAE,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,SAAS,CAAC,CAAC;QACxG,IAAI,SAAS,YAAY,cAAc,EAAE;YACvC,SAAS,CAAC,yBAAyB,CAAC,OAAO,CAAC,CAAC;SAC9C;aAAM,IAAI,SAAS,YAAY,eAAe,EAAE;YAC/C,MAAM,SAAS,GAAG,SAAS,CAAC,sBAAsB,EAAE,CAAC;YACrD,KAAK,MAA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M,SAAS,GAAG,UAAU,CAAC,CAAC,CAAC,CAAC;YAChC,KAAK,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,UAAU,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;gBAC9C,OAAO,CAAC,aAAa,CAAC,SAAS,EAAE,KAAK,EAAE,UAAU,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC;gBAC9D,SAAS,CAAC,yBAAyB,CAAC,OAAO,CAAC,CAAC;aAC9C;SACF;QACD,OAAO,OAAO,CAAC,iBAAiB,EAAE,CAAC;IACrC,CAAC;IACD;;;;OAIG;IACI,MAAM,CAAC,6BAA6B,CACzC,SAAwB,EAAE,SAAwB,EAAE,WAAmB;QACvE,MAAM,OAAO,GAAG,IAAI,yBAAyB,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;QACpE,OAAO,CAAC,mBAAmB,GAAG,WAAW,CAAC;QAC1C,SAAS,CAAC,yBAAyB,CAAC,OAAO,CAAC,CAAC;QAC7C,OAAO,OAAO,CAAC,iBAAiB,EAAE,CAAC;IACrC,CAAC;CAEF","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Curve\r\n */\r\n\r\nimport { Geometry } from \"../Geometry\";\r\nimport { Matrix4d } from \"../geometry4d/Matrix4d\";\r\nimport { CurveCollection } from \"./CurveCollection\";\r\nimport { CurveCurveCloseApproachXY } from \"./CurveCurveCloseApproachXY\";\r\nimport { CurveCurveIntersectXY, CurveLocationDetailArrayPair } from \"./CurveCurveIntersectXY\";\r\nimport { CurveCurveIntersectXYZ } from \"./CurveCurveIntersectXYZ\";\r\nimport { CurveLocationDetailPair } from \"./CurveLocationDetail\";\r\nimport { CurvePrimitive } from \"./CurvePrimitive\";\r\nimport { GeometryQuery } from \"./GeometryQuery\";\r\n\r\n/**\r\n * `CurveCurve` has static method for various computations that work on a pair of curves or curve collections.\r\n * @public\r\n */\r\nexport class CurveCurve {\r\n /**\r\n * Return xy intersections of 2 curves.\r\n * @param geometryA first geometry\r\n * @param extendA true to allow geometryA to extend\r\n * @param geometryB second geometry\r\n * @param extendB true to allow geometryB to extend\r\n * @param tolerance optional distance tolerance for coincidence\r\n */\r\n public static intersectionXYPairs(geometryA: GeometryQuery, extendA: boolean, geometryB: GeometryQuery, extendB: boolean, tolerance: number = Geometry.smallMetricDistance): CurveLocationDetailPair[] {\r\n const handler = new CurveCurveIntersectXY(undefined, geometryA, extendA, geometryB, extendB, tolerance);\r\n if (geometryB instanceof CurvePrimitive) {\r\n geometryA.dispatchToGeometryHandler(handler);\r\n } else if (geometryB instanceof CurveCollection) {\r\n const allCurves = geometryB.collectCurvePrimitives();\r\n for (const child of allCurves) {\r\n handler.resetGeometry(geometryA, false, child, false);\r\n geometryA.dispatchToGeometryHandler(handler);\r\n }\r\n }\r\n return handler.grabPairedResults();\r\n }\r\n /**\r\n * Return xy intersections of 2 projected curves\r\n * @param geometryA first geometry\r\n * @param extendA true to allow geometryA to extend\r\n * @param geometryB second geometry\r\n * @param extendB true to allow geometryB to extend\r\n * @param tolerance optional distance tolerance for coincidence\r\n */\r\n public static intersectionProjectedXYPairs(worldToLocal: Matrix4d, geometryA: GeometryQuery, extendA: boolean, geometryB: GeometryQuery, extendB: boolean, tolerance: number = Geometry.smallMetricDistance): CurveLocationDetailPair[] {\r\n const handler = new CurveCurveIntersectXY(worldToLocal, geometryA, extendA, geometryB, extendB, tolerance);\r\n geometryA.dispatchToGeometryHandler(handler);\r\n return handler.grabPairedResults();\r\n }\r\n /**\r\n * Return full 3d xyz intersections of 2 curves.\r\n * * Implemented for combinations of LineSegment3d, LineString3d, Arc3d.\r\n * * Not Implemented for bspline and bezier curves.\r\n * @beta\r\n * @param geometryA first geometry\r\n * @param extendA true to allow geometryA to extend\r\n * @param geometryB second geometry\r\n * @param extendB true to allow geometryB to extend\r\n */\r\n public static intersectionXYZ(geometryA: GeometryQuery, extendA: boolean, geometryB: GeometryQuery, extendB: boolean): CurveLocationDetailArrayPair {\r\n const handler = new CurveCurveIntersectXYZ(geometryA, extendA, geometryB, extendB);\r\n geometryA.dispatchToGeometryHandler(handler);\r\n return handler.grabResults();\r\n }\r\n /**\r\n * Return xy intersections of 2 curves.\r\n * @param geometryA first geometry\r\n * @param extendA true to allow geometryA to extend\r\n * @param geometryB second geometry\r\n * @param extendB true to allow geometryB to extend\r\n * @param tolerance optional distance tolerance for coincidence\r\n */\r\n public static allIntersectionsAmongPrimitivesXY(primitives: CurvePrimitive[], tolerance: number = Geometry.smallMetricDistance): CurveLocationDetailPair[] {\r\n const handler = new CurveCurveIntersectXY(undefined, undefined, false, undefined, false, tolerance);\r\n for (let i = 0; i < primitives.length; i++) {\r\n const geometryA = primitives[i];\r\n for (let j = i + 1; j < primitives.length; j++) {\r\n handler.resetGeometry(geometryA, false, primitives[j], false);\r\n geometryA.dispatchToGeometryHandler(handler);\r\n }\r\n }\r\n return handler.grabPairedResults();\r\n }\r\n /**\r\n * Return xy close approaches of 2 projected curves\r\n * @param geometryA first geometry\r\n * @param geometryB second geometry\r\n */\r\n public static closeApproachProjectedXYPairs(\r\n geometryA: GeometryQuery, geometryB: GeometryQuery, maxDistance: number): CurveLocationDetailPair[] {\r\n const handler = new CurveCurveCloseApproachXY(geometryA, geometryB);\r\n handler.maxDistanceToAccept = maxDistance;\r\n geometryA.dispatchToGeometryHandler(handler);\r\n return handler.grabPairedResults();\r\n }\r\n\r\n}\r\n"]}
|
|
@@ -58,12 +58,16 @@ export declare class CurveCurveIntersectXY extends NullGeometryHandler {
|
|
|
58
58
|
* @param extendA flag to enable using extension of geometryA.
|
|
59
59
|
* @param geometryB second curve for intersection. Saved for reference by specific handler methods.
|
|
60
60
|
* @param extendB flag for extension of geometryB.
|
|
61
|
+
* @param tolerance optional distance tolerance for coincidence
|
|
61
62
|
*/
|
|
62
|
-
constructor(worldToLocal: Matrix4d | undefined, _geometryA: GeometryQuery | undefined, extendA: boolean, geometryB: GeometryQuery | undefined, extendB: boolean);
|
|
63
|
+
constructor(worldToLocal: Matrix4d | undefined, _geometryA: GeometryQuery | undefined, extendA: boolean, geometryB: GeometryQuery | undefined, extendB: boolean, tolerance?: number);
|
|
63
64
|
/** Reset the geometry and flags, leaving all other parts unchanged (and preserving accumulated intersections) */
|
|
64
65
|
resetGeometry(_geometryA: GeometryQuery, extendA: boolean, geometryB: GeometryQuery, extendB: boolean): void;
|
|
65
66
|
private static _workVector2dA;
|
|
66
67
|
private acceptFraction;
|
|
68
|
+
/** Test the fraction by strict parameter, but allow toleranced distance test at ends.
|
|
69
|
+
* @param tolerance optional distance tolerance to check proximity to start/end point
|
|
70
|
+
*/
|
|
67
71
|
private acceptFractionOnLine;
|
|
68
72
|
/**
|
|
69
73
|
* * Return the results structure for the intersection calculation, structured as an array of CurveLocationDetailPair
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CurveCurveIntersectXY.d.ts","sourceRoot":"","sources":["../../../src/curve/CurveCurveIntersectXY.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,EAAE,cAAc,EAAsB,MAAM,yBAAyB,CAAC;AAC7E,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAG7D,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"CurveCurveIntersectXY.d.ts","sourceRoot":"","sources":["../../../src/curve/CurveCurveIntersectXY.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,EAAE,cAAc,EAAsB,MAAM,yBAAyB,CAAC;AAC7E,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAG7D,OAAO,EAAE,mBAAmB,EAAE,MA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AAC,GAAG,EAAE,YAAY,GAAG,GAAG;IA4C1D,wDAAwD;IACxC,WAAW,CAAC,IAAI,EAAE,KAAK,GAAG,GAAG;IAc7C,kEAAkE;IAClD,oBAAoB,CAAC,KAAK,EAAE,cAAc,GAAG,GAAG;IAchE,8EAA8E;IAC9D,qBAAqB,CAAC,MAAM,EAAE,eAAe,GAAG,GAAG;CAcpE"}
|
|
@@ -8,14 +8,12 @@ import { CoincidentGeometryQuery } from "../geometry3d/CoincidentGeometryOps";
|
|
|
8
8
|
import { NullGeometryHandler } from "../geometry3d/GeometryHandler";
|
|
9
9
|
import { GrowableFloat64Array } from "../geometry3d/GrowableFloat64Array";
|
|
10
10
|
import { Matrix3d } from "../geometry3d/Matrix3d";
|
|
11
|
-
// import { Arc3d } from "./Arc3d";
|
|
12
11
|
import { Vector2d } from "../geometry3d/Point2dVector2d";
|
|
13
12
|
import { Point3d } from "../geometry3d/Point3dVector3d";
|
|
14
13
|
import { Ray3d } from "../geometry3d/Ray3d";
|
|
15
14
|
import { Point4d } from "../geometry4d/Point4d";
|
|
16
15
|
import { UnivariateBezier } from "../numerics/BezierPolynomials";
|
|
17
16
|
import { Newton2dUnboundedWithDerivative, NewtonEvaluatorRRtoRRD } from "../numerics/Newton";
|
|
18
|
-
// import { LineString3d } from "./LineString3d";
|
|
19
17
|
import { AnalyticRoots, SmallSystem, TrigPolynomial } from "../numerics/Polynomials";
|
|
20
18
|
import { Arc3d } from "./Arc3d";
|
|
21
19
|
import { CurveIntervalRole, CurveLocationDetail, CurveLocationDetailPair } from "./CurveLocationDetail";
|
|
@@ -68,8 +66,9 @@ export class CurveCurveIntersectXY extends NullGeometryHandler {
|
|
|
68
66
|
* @param extendA flag to enable using extension of geometryA.
|
|
69
67
|
* @param geometryB second curve for intersection. Saved for reference by specific handler methods.
|
|
70
68
|
* @param extendB flag for extension of geometryB.
|
|
69
|
+
* @param tolerance optional distance tolerance for coincidence
|
|
71
70
|
*/
|
|
72
|
-
constructor(worldToLocal, _geometryA, extendA, geometryB, extendB) {
|
|
71
|
+
constructor(worldToLocal, _geometryA, extendA, geometryB, extendB, tolerance = Geometry.smallMetricDistance) {
|
|
73
72
|
super();
|
|
74
73
|
// this.geometryA = _geometryA;
|
|
75
74
|
this._extendA = extendA;
|
|
@@ -82,7 +81,7 @@ export class CurveCurveIntersectXY extends NullGeometryHandler {
|
|
|
82
81
|
if (!this._worldToLocalAffine)
|
|
83
82
|
this._worldToLocalPerspective = worldToLocal.clone();
|
|
84
83
|
}
|
|
85
|
-
this._coincidentGeometryContext = CoincidentGeometryQuery.create();
|
|
84
|
+
this._coincidentGeometryContext = CoincidentGeometryQuery.create(tolerance);
|
|
86
85
|
this.reinitialize();
|
|
87
86
|
}
|
|
88
87
|
reinitialize() {
|
|
@@ -101,13 +100,15 @@ export class CurveCurveIntersectXY extends NullGeometryHandler {
|
|
|
101
100
|
return false;
|
|
102
101
|
return true;
|
|
103
102
|
}
|
|
104
|
-
|
|
105
|
-
|
|
103
|
+
/** Test the fraction by strict parameter, but allow toleranced distance test at ends.
|
|
104
|
+
* @param tolerance optional distance tolerance to check proximity to start/end point
|
|
105
|
+
*/
|
|
106
|
+
acceptFractionOnLine(extend0, fraction, extend1, pointA, pointB, tolerance = Geometry.smallMetricDistance) {
|
|
106
107
|
if (!extend0 && fraction < 0) {
|
|
107
|
-
return Geometry.
|
|
108
|
+
return Geometry.isDistanceWithinTol(fraction * pointA.distanceXY(pointB), tolerance);
|
|
108
109
|
}
|
|
109
110
|
else if (!extend1 && fraction > 1.0)
|
|
110
|
-
return Geometry.
|
|
111
|
+
return Geometry.isDistanceWithinTol((fraction - 1.0) * pointA.distanceXY(pointB), tolerance);
|
|
111
112
|
return true;
|
|
112
113
|
}
|
|
113
114
|
/**
|
|
@@ -203,8 +204,8 @@ export class CurveCurveIntersectXY extends NullGeometryHandler {
|
|
|
203
204
|
this.recordPointWithLocalFractions(overlap.detailA.fraction, cpA, fractionA0, fractionA1, overlap.detailB.fraction, cpB, fractionB0, fractionB1, reversed, overlap);
|
|
204
205
|
}
|
|
205
206
|
else if (SmallSystem.lineSegment3dXYTransverseIntersectionUnbounded(pointA0, pointA1, pointB0, pointB1, uv)) {
|
|
206
|
-
if (this.acceptFractionOnLine(extendA0, uv.x, extendA1, pointA0, pointA1)
|
|
207
|
-
&& this.acceptFractionOnLine(extendB0, uv.y, extendB1, pointB0, pointB1)) {
|
|
207
|
+
if (this.acceptFractionOnLine(extendA0, uv.x, extendA1, pointA0, pointA1, this._coincidentGeometryContext.tolerance)
|
|
208
|
+
&& this.acceptFractionOnLine(extendB0, uv.y, extendB1, pointB0, pointB1, this._coincidentGeometryContext.tolerance)) {
|
|
208
209
|
this.recordPointWithLocalFractions(uv.x, cpA, fractionA0, fractionA1, uv.y, cpB, fractionB0, fractionB1, reversed);
|
|
209
210
|
}
|
|
210
211
|
}
|