@itwin/core-geometry 5.8.0-dev.1 → 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 +26 -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/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/CurveFactory.d.ts.map +1 -1
- package/lib/cjs/curve/CurveFactory.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/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/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/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/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/CurveFactory.d.ts.map +1 -1
- package/lib/esm/curve/CurveFactory.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/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/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/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
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
/** @packageDocumentation
|
|
2
|
+
* @module CartesianGeometry
|
|
3
|
+
*/
|
|
4
|
+
import { Arc3d } from "./Arc3d";
|
|
5
|
+
import { CurveLocationDetailPair } from "./CurveLocationDetail";
|
|
6
|
+
import { LineSegment3d } from "./LineSegment3d";
|
|
7
|
+
/**
|
|
8
|
+
* The class has static methods to compute circles and lines with specified constrained (tangent to other lines/circles,
|
|
9
|
+
* perpendicular to other lines/circles, or a specified circle radius).
|
|
10
|
+
* * z components of the input curves are completely ignored.
|
|
11
|
+
* * In this API, a `LineSegment3d` input identifies the underlying unbounded line by its endpoints. The segment
|
|
12
|
+
* itself is bounded, but the geometric line constraint is applied as unbounded.
|
|
13
|
+
* * Each API not only returns the circles or lines that satisfy the constraints but also captures the input curve
|
|
14
|
+
* location details where the tangency/perpendicularity happens. Each returned element contains:
|
|
15
|
+
* * the curve (circle or line) that satisfies the constraints.
|
|
16
|
+
* * an array of {@link CurveLocationDetailPair} objects, where each pair holds:
|
|
17
|
+
* * `detailA`: the result curve with the contact point and fraction on the curve.
|
|
18
|
+
* * `detailB`: the input constraint curve with the same contact point and fraction on the constraint curve.
|
|
19
|
+
* @alpha
|
|
20
|
+
*/
|
|
21
|
+
export declare class ConstrainedCurve2d {
|
|
22
|
+
/**
|
|
23
|
+
* Return all (i.e., up to 4) circles that are tangent to 3 given lines plus data about tangent points/fractions.
|
|
24
|
+
* @param lineA first line
|
|
25
|
+
* @param lineB second line
|
|
26
|
+
* @param lineC third line
|
|
27
|
+
*/
|
|
28
|
+
static circlesTangentLineLineLine(lineA: LineSegment3d, lineB: LineSegment3d, lineC: LineSegment3d): {
|
|
29
|
+
curve: Arc3d;
|
|
30
|
+
details: CurveLocationDetailPair[];
|
|
31
|
+
}[] | undefined;
|
|
32
|
+
/**
|
|
33
|
+
* Return all (i.e., up to 2) unbounded lines perpendicular to a line and tangent to a circle plus data about
|
|
34
|
+
* perp/tangent points/fractions.
|
|
35
|
+
* @param line the line
|
|
36
|
+
* @param circle the circle
|
|
37
|
+
*/
|
|
38
|
+
static linesPerpLineTangentCircle(line: LineSegment3d, circle: Arc3d): {
|
|
39
|
+
curve: LineSegment3d;
|
|
40
|
+
details: CurveLocationDetailPair[];
|
|
41
|
+
}[] | undefined;
|
|
42
|
+
/**
|
|
43
|
+
* Return all (i.e., 4) variants of the line perpendicular to 2 circles (line between centers, with ends at
|
|
44
|
+
* crossing points on respective circles) plus data about perp points/fractions.
|
|
45
|
+
* @param circleA first circle
|
|
46
|
+
* @param circleB second circle
|
|
47
|
+
*/
|
|
48
|
+
static linesPerpCirclePerpCircle(circleA: Arc3d, circleB: Arc3d): {
|
|
49
|
+
curve: LineSegment3d;
|
|
50
|
+
details: CurveLocationDetailPair[];
|
|
51
|
+
}[] | undefined;
|
|
52
|
+
/**
|
|
53
|
+
* Return all (i.e., up to 2) unbounded lines perpendicular to a line and a circle plus data about perp points/fractions.
|
|
54
|
+
* @param line the line
|
|
55
|
+
* @param circle the circle
|
|
56
|
+
*/
|
|
57
|
+
static linesPerpLinePerpCircle(line: LineSegment3d, circle: Arc3d): {
|
|
58
|
+
curve: LineSegment3d;
|
|
59
|
+
details: CurveLocationDetailPair[];
|
|
60
|
+
}[] | undefined;
|
|
61
|
+
/**
|
|
62
|
+
* Return all (i.e., up to 4) unbounded lines perpendicular to a circle and tangent to a circle plus data about
|
|
63
|
+
* perp/tangent points/fractions.
|
|
64
|
+
* Note that multiple colinear lines are returned tagged with diametrically opposing points of circleA.
|
|
65
|
+
* @param circleA first circle (for perpendicular constraint)
|
|
66
|
+
* @param circleB second circle (for tangent constraint)
|
|
67
|
+
*/
|
|
68
|
+
static linesPerpCircleTangentCircle(circleA: Arc3d, circleB: Arc3d): {
|
|
69
|
+
curve: LineSegment3d;
|
|
70
|
+
details: CurveLocationDetailPair[];
|
|
71
|
+
}[] | undefined;
|
|
72
|
+
/**
|
|
73
|
+
* Return all (i.e., up to 4) unbounded lines tangent to 2 circles plus data about tangent points/fractions.
|
|
74
|
+
* * There are 4 lines if there is neither intersection nor containment between the circles
|
|
75
|
+
* * There are 2 lines if the circles intersect
|
|
76
|
+
* * There are no lines if one circle is entirely inside the other.
|
|
77
|
+
* @param circleA first circle
|
|
78
|
+
* @param circleB second circle
|
|
79
|
+
*/
|
|
80
|
+
static linesTangentCircleCircle(circleA: Arc3d, circleB: Arc3d): {
|
|
81
|
+
curve: LineSegment3d;
|
|
82
|
+
details: CurveLocationDetailPair[];
|
|
83
|
+
}[] | undefined;
|
|
84
|
+
/**
|
|
85
|
+
* Return all (i.e., up to 8) circles tangent to two lines and a circle plus data about tangent points/fractions.
|
|
86
|
+
* @param lineA first line
|
|
87
|
+
* @param lineB second line
|
|
88
|
+
* @param circle the circle
|
|
89
|
+
*/
|
|
90
|
+
static circlesTangentLineLineCircle(lineA: LineSegment3d, lineB: LineSegment3d, circle: Arc3d): {
|
|
91
|
+
curve: Arc3d;
|
|
92
|
+
details: CurveLocationDetailPair[];
|
|
93
|
+
}[] | undefined;
|
|
94
|
+
/**
|
|
95
|
+
* Return all (i.e., up to 4) circles tangent to 2 circles and a line plus data about tangent points/fractions.
|
|
96
|
+
* @param circleA first circle
|
|
97
|
+
* @param circleB second circle
|
|
98
|
+
* @param line the line
|
|
99
|
+
*/
|
|
100
|
+
static circlesTangentCircleCircleLine(circleA: Arc3d, circleB: Arc3d, line: LineSegment3d): {
|
|
101
|
+
curve: Arc3d;
|
|
102
|
+
details: CurveLocationDetailPair[];
|
|
103
|
+
}[] | undefined;
|
|
104
|
+
/**
|
|
105
|
+
* Return all (i.e., up to 8) circles tangent to 3 circles plus data about tangent points/fractions.
|
|
106
|
+
* @param circleA first circle
|
|
107
|
+
* @param circleB second circle
|
|
108
|
+
* @param circleC third circle
|
|
109
|
+
*/
|
|
110
|
+
static circlesTangentCircleCircleCircle(circleA: Arc3d, circleB: Arc3d, circleC: Arc3d): {
|
|
111
|
+
curve: Arc3d;
|
|
112
|
+
details: CurveLocationDetailPair[];
|
|
113
|
+
}[] | undefined;
|
|
114
|
+
/**
|
|
115
|
+
* Compute circles of specified radius tangent to each of the lines plus data about tangent points/fractions.
|
|
116
|
+
* * There are normally 4 circles.
|
|
117
|
+
* * Returns undefined when the lines are parallel.
|
|
118
|
+
* @param lineA first line
|
|
119
|
+
* @param lineB second line
|
|
120
|
+
* @param radius radius of tangent circles.
|
|
121
|
+
*/
|
|
122
|
+
static circlesTangentLineLineRadius(lineA: LineSegment3d, lineB: LineSegment3d, radius: number): {
|
|
123
|
+
curve: Arc3d;
|
|
124
|
+
details: CurveLocationDetailPair[];
|
|
125
|
+
}[] | undefined;
|
|
126
|
+
/**
|
|
127
|
+
* Compute circles of specified radius tangent to both a circle and a line plus data about tangent points/fractions.
|
|
128
|
+
* * There can be 0 to 8 circles.
|
|
129
|
+
* @param circle the circle
|
|
130
|
+
* @param line the line
|
|
131
|
+
* @param radius radius of tangent circles
|
|
132
|
+
*/
|
|
133
|
+
static circlesTangentCircleLineRadius(circle: Arc3d, line: LineSegment3d, radius: number): {
|
|
134
|
+
curve: Arc3d;
|
|
135
|
+
details: CurveLocationDetailPair[];
|
|
136
|
+
}[] | undefined;
|
|
137
|
+
/**
|
|
138
|
+
* Compute circles of specified radius tangent to both circles plus data about tangent points/fractions.
|
|
139
|
+
* * There can be 0 to 8 circles.
|
|
140
|
+
* @param circleA the first circle
|
|
141
|
+
* @param circleB the second circle
|
|
142
|
+
* @param radius radius of tangent circles
|
|
143
|
+
*/
|
|
144
|
+
static circlesTangentCircleCircleRadius(circleA: Arc3d, circleB: Arc3d, radius: number): {
|
|
145
|
+
curve: Arc3d;
|
|
146
|
+
details: CurveLocationDetailPair[];
|
|
147
|
+
}[] | undefined;
|
|
148
|
+
}
|
|
149
|
+
//# sourceMappingURL=ConstrainedCurve2d.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ConstrainedCurve2d.d.ts","sourceRoot":"","sources":["../../../src/curve/ConstrainedCurve2d.ts"],"names":[],"mappings":"AAIA;;GAEG;AAKH,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAuB,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AAOrF,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD;;;;;;;;;;;;;GAaG;AACH,qBAAa,kBAAkB;IAC7B;;;;;OAKG;WACW,0BAA0B,CACtC,KAAK,EAAE,aAAa,EACpB,KAAK,EAAE,aAAa,EACpB,KAAK,EAAE,aAAa,GACnB;QAAE,KAAK,EAAE,KAAK,CAAC;QAAC,OAAO,EAAE,uBAAuB,EAAE,CAAA;KAAE,EAAE,GAAG,SAAS;IAarE;;;;;OAKG;WACW,0BAA0B,CACtC,IAAI,EAAE,aAAa,EACnB,MAAM,EAAE,KAAK,GACZ;QAAE,KAAK,EAAE,aAAa,CAAC;QAAC,OAAO,EAAE,uBAAuB,EAAE,CAAA;KAAE,EAAE,GAAG,SAAS;IAa7E;;;;;OAKG;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,OAAO,EAAE,uBAAuB,EAAE,CAAA;KAAE,EAAE,GAAG,SAAS;IAerE;;;;;;;OAOG;WACW,4BAA4B,CACxC,KAAK,EAAE,aAAa,EACpB,KAAK,EAAE,aAAa,EACpB,MAAM,EAAE,MAAM,GACb;QAAE,KAAK,EAAE,KAAK,CAAC;QAAC,OAAO,EAAE,uBAAuB,EAAE,CAAA;KAAE,EAAE,GAAG,SAAS;IAWrE;;;;;;OAMG;WACW,8BAA8B,CAC1C,MAAM,EAAE,KAAK,EACb,IAAI,EAAE,aAAa,EACnB,MAAM,EAAE,MAAM,GACb;QAAE,KAAK,EAAE,KAAK,CAAC;QAAC,OAAO,EAAE,uBAAuB,EAAE,CAAA;KAAE,EAAE,GAAG,SAAS;IAarE;;;;;;OAMG;WACW,gCAAgC,CAC5C,OAAO,EAAE,KAAK,EACd,OAAO,EAAE,KAAK,EACd,MAAM,EAAE,MAAM,GACb;QAAE,KAAK,EAAE,KAAK,CAAC;QAAC,OAAO,EAAE,uBAAuB,EAAE,CAAA;KAAE,EAAE,GAAG,SAAS;CAatE"}
|
|
@@ -0,0 +1,317 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*---------------------------------------------------------------------------------------------
|
|
3
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
4
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
5
|
+
*--------------------------------------------------------------------------------------------*/
|
|
6
|
+
/** @packageDocumentation
|
|
7
|
+
* @module CartesianGeometry
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.ConstrainedCurve2d = void 0;
|
|
11
|
+
const Geometry_1 = require("../Geometry");
|
|
12
|
+
const Point3dVector3d_1 = require("../geometry3d/Point3dVector3d");
|
|
13
|
+
const Arc3d_1 = require("./Arc3d");
|
|
14
|
+
const CurveLocationDetail_1 = require("./CurveLocationDetail");
|
|
15
|
+
const ConstrainedImplicitCurve2d_1 = require("./internalContexts/geometry2d/ConstrainedImplicitCurve2d");
|
|
16
|
+
const ImplicitCurve2dConverter_1 = require("./internalContexts/geometry2d/ImplicitCurve2dConverter");
|
|
17
|
+
const UnboundedCircle2d_1 = require("./internalContexts/geometry2d/UnboundedCircle2d");
|
|
18
|
+
const UnboundedLine2d_1 = require("./internalContexts/geometry2d/UnboundedLine2d");
|
|
19
|
+
const LineSegment3d_1 = require("./LineSegment3d");
|
|
20
|
+
/**
|
|
21
|
+
* The class has static methods to compute circles and lines with specified constrained (tangent to other lines/circles,
|
|
22
|
+
* perpendicular to other lines/circles, or a specified circle radius).
|
|
23
|
+
* * z components of the input curves are completely ignored.
|
|
24
|
+
* * In this API, a `LineSegment3d` input identifies the underlying unbounded line by its endpoints. The segment
|
|
25
|
+
* itself is bounded, but the geometric line constraint is applied as unbounded.
|
|
26
|
+
* * Each API not only returns the circles or lines that satisfy the constraints but also captures the input curve
|
|
27
|
+
* location details where the tangency/perpendicularity happens. Each returned element contains:
|
|
28
|
+
* * the curve (circle or line) that satisfies the constraints.
|
|
29
|
+
* * an array of {@link CurveLocationDetailPair} objects, where each pair holds:
|
|
30
|
+
* * `detailA`: the result curve with the contact point and fraction on the curve.
|
|
31
|
+
* * `detailB`: the input constraint curve with the same contact point and fraction on the constraint curve.
|
|
32
|
+
* @alpha
|
|
33
|
+
*/
|
|
34
|
+
class ConstrainedCurve2d {
|
|
35
|
+
/**
|
|
36
|
+
* Return all (i.e., up to 4) circles that are tangent to 3 given lines plus data about tangent points/fractions.
|
|
37
|
+
* @param lineA first line
|
|
38
|
+
* @param lineB second line
|
|
39
|
+
* @param lineC third line
|
|
40
|
+
*/
|
|
41
|
+
static circlesTangentLineLineLine(lineA, lineB, lineC) {
|
|
42
|
+
const implicitLineA = ImplicitCurve2dConverter_1.ImplicitCurve2dConverter.createImplicitCurve2dFromCurvePrimitiveXY(lineA);
|
|
43
|
+
const implicitLineB = ImplicitCurve2dConverter_1.ImplicitCurve2dConverter.createImplicitCurve2dFromCurvePrimitiveXY(lineB);
|
|
44
|
+
const implicitLineC = ImplicitCurve2dConverter_1.ImplicitCurve2dConverter.createImplicitCurve2dFromCurvePrimitiveXY(lineC);
|
|
45
|
+
if (!(implicitLineA instanceof UnboundedLine2d_1.UnboundedLine2dByPointAndNormal)
|
|
46
|
+
|| !(implicitLineB instanceof UnboundedLine2d_1.UnboundedLine2dByPointAndNormal)
|
|
47
|
+
|| !(implicitLineC instanceof UnboundedLine2d_1.UnboundedLine2dByPointAndNormal))
|
|
48
|
+
return undefined;
|
|
49
|
+
const markups = ConstrainedImplicitCurve2d_1.ConstrainedImplicitCurve2d.circlesTangentLLL(implicitLineA, implicitLineB, implicitLineC);
|
|
50
|
+
if (markups === undefined)
|
|
51
|
+
return undefined;
|
|
52
|
+
return getCircleOrLineMarkups(markups, true, [lineA, lineB, lineC]);
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Return all (i.e., up to 2) unbounded lines perpendicular to a line and tangent to a circle plus data about
|
|
56
|
+
* perp/tangent points/fractions.
|
|
57
|
+
* @param line the line
|
|
58
|
+
* @param circle the circle
|
|
59
|
+
*/
|
|
60
|
+
static linesPerpLineTangentCircle(line, circle) {
|
|
61
|
+
if (isNotCircularOrPoint(circle))
|
|
62
|
+
return undefined;
|
|
63
|
+
const implicitLine = ImplicitCurve2dConverter_1.ImplicitCurve2dConverter.createImplicitCurve2dFromCurvePrimitiveXY(line);
|
|
64
|
+
const implicitCircle = ImplicitCurve2dConverter_1.ImplicitCurve2dConverter.createImplicitCurve2dFromCurvePrimitiveXY(circle);
|
|
65
|
+
if (!(implicitLine instanceof UnboundedLine2d_1.UnboundedLine2dByPointAndNormal)
|
|
66
|
+
|| !(implicitCircle instanceof UnboundedCircle2d_1.UnboundedCircle2dByCenterAndRadius))
|
|
67
|
+
return undefined;
|
|
68
|
+
const markups = ConstrainedImplicitCurve2d_1.ConstrainedImplicitCurve2d.linesPerpLTangentC(implicitLine, implicitCircle);
|
|
69
|
+
if (markups === undefined)
|
|
70
|
+
return undefined;
|
|
71
|
+
return getCircleOrLineMarkups(markups, false, [line, circle]);
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Return all (i.e., 4) variants of the line perpendicular to 2 circles (line between centers, with ends at
|
|
75
|
+
* crossing points on respective circles) plus data about perp points/fractions.
|
|
76
|
+
* @param circleA first circle
|
|
77
|
+
* @param circleB second circle
|
|
78
|
+
*/
|
|
79
|
+
static linesPerpCirclePerpCircle(circleA, circleB) {
|
|
80
|
+
if (!circleA.isCircular || !circleB.isCircular)
|
|
81
|
+
return undefined;
|
|
82
|
+
const implicitCircleA = ImplicitCurve2dConverter_1.ImplicitCurve2dConverter.createImplicitCurve2dFromCurvePrimitiveXY(circleA);
|
|
83
|
+
const implicitCircleB = ImplicitCurve2dConverter_1.ImplicitCurve2dConverter.createImplicitCurve2dFromCurvePrimitiveXY(circleB);
|
|
84
|
+
if (!(implicitCircleA instanceof UnboundedCircle2d_1.UnboundedCircle2dByCenterAndRadius)
|
|
85
|
+
|| !(implicitCircleB instanceof UnboundedCircle2d_1.UnboundedCircle2dByCenterAndRadius))
|
|
86
|
+
return undefined;
|
|
87
|
+
const markups = ConstrainedImplicitCurve2d_1.ConstrainedImplicitCurve2d.linesPerpCPerpC(implicitCircleA, implicitCircleB);
|
|
88
|
+
if (markups === undefined)
|
|
89
|
+
return undefined;
|
|
90
|
+
return getCircleOrLineMarkups(markups, false, [circleA, circleB]);
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Return all (i.e., up to 2) unbounded lines perpendicular to a line and a circle plus data about perp points/fractions.
|
|
94
|
+
* @param line the line
|
|
95
|
+
* @param circle the circle
|
|
96
|
+
*/
|
|
97
|
+
static linesPerpLinePerpCircle(line, circle) {
|
|
98
|
+
if (isNotCircularOrPoint(circle))
|
|
99
|
+
return undefined;
|
|
100
|
+
const implicitLine = ImplicitCurve2dConverter_1.ImplicitCurve2dConverter.createImplicitCurve2dFromCurvePrimitiveXY(line);
|
|
101
|
+
const implicitCircle = ImplicitCurve2dConverter_1.ImplicitCurve2dConverter.createImplicitCurve2dFromCurvePrimitiveXY(circle);
|
|
102
|
+
if (!(implicitLine instanceof UnboundedLine2d_1.UnboundedLine2dByPointAndNormal)
|
|
103
|
+
|| !(implicitCircle instanceof UnboundedCircle2d_1.UnboundedCircle2dByCenterAndRadius))
|
|
104
|
+
return undefined;
|
|
105
|
+
const markups = ConstrainedImplicitCurve2d_1.ConstrainedImplicitCurve2d.linesPerpLPerpC(implicitLine, implicitCircle);
|
|
106
|
+
if (markups === undefined)
|
|
107
|
+
return undefined;
|
|
108
|
+
return getCircleOrLineMarkups(markups, false, [line, circle]);
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Return all (i.e., up to 4) unbounded lines perpendicular to a circle and tangent to a circle plus data about
|
|
112
|
+
* perp/tangent points/fractions.
|
|
113
|
+
* Note that multiple colinear lines are returned tagged with diametrically opposing points of circleA.
|
|
114
|
+
* @param circleA first circle (for perpendicular constraint)
|
|
115
|
+
* @param circleB second circle (for tangent constraint)
|
|
116
|
+
*/
|
|
117
|
+
static linesPerpCircleTangentCircle(circleA, circleB) {
|
|
118
|
+
if (isNotCircularOrPoint(circleA) || isNotCircularOrPoint(circleB))
|
|
119
|
+
return undefined;
|
|
120
|
+
const implicitCircleA = ImplicitCurve2dConverter_1.ImplicitCurve2dConverter.createImplicitCurve2dFromCurvePrimitiveXY(circleA);
|
|
121
|
+
const implicitCircleB = ImplicitCurve2dConverter_1.ImplicitCurve2dConverter.createImplicitCurve2dFromCurvePrimitiveXY(circleB);
|
|
122
|
+
if (!(implicitCircleA instanceof UnboundedCircle2d_1.UnboundedCircle2dByCenterAndRadius)
|
|
123
|
+
|| !(implicitCircleB instanceof UnboundedCircle2d_1.UnboundedCircle2dByCenterAndRadius))
|
|
124
|
+
return undefined;
|
|
125
|
+
const markups = ConstrainedImplicitCurve2d_1.ConstrainedImplicitCurve2d.linesPerpCTangentC(implicitCircleA, implicitCircleB);
|
|
126
|
+
if (markups === undefined)
|
|
127
|
+
return undefined;
|
|
128
|
+
return getCircleOrLineMarkups(markups, false, [circleA, circleB]);
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Return all (i.e., up to 4) unbounded lines tangent to 2 circles plus data about tangent points/fractions.
|
|
132
|
+
* * There are 4 lines if there is neither intersection nor containment between the circles
|
|
133
|
+
* * There are 2 lines if the circles intersect
|
|
134
|
+
* * There are no lines if one circle is entirely inside the other.
|
|
135
|
+
* @param circleA first circle
|
|
136
|
+
* @param circleB second circle
|
|
137
|
+
*/
|
|
138
|
+
static linesTangentCircleCircle(circleA, circleB) {
|
|
139
|
+
if (isNotCircularOrPoint(circleA) || isNotCircularOrPoint(circleB))
|
|
140
|
+
return undefined;
|
|
141
|
+
const implicitCircleA = ImplicitCurve2dConverter_1.ImplicitCurve2dConverter.createImplicitCurve2dFromCurvePrimitiveXY(circleA);
|
|
142
|
+
const implicitCircleB = ImplicitCurve2dConverter_1.ImplicitCurve2dConverter.createImplicitCurve2dFromCurvePrimitiveXY(circleB);
|
|
143
|
+
if (!(implicitCircleA instanceof UnboundedCircle2d_1.UnboundedCircle2dByCenterAndRadius)
|
|
144
|
+
|| !(implicitCircleB instanceof UnboundedCircle2d_1.UnboundedCircle2dByCenterAndRadius))
|
|
145
|
+
return undefined;
|
|
146
|
+
const markups = ConstrainedImplicitCurve2d_1.ConstrainedImplicitCurve2d.linesTangentCC(implicitCircleA, implicitCircleB);
|
|
147
|
+
if (markups === undefined)
|
|
148
|
+
return undefined;
|
|
149
|
+
return getCircleOrLineMarkups(markups, false, [circleA, circleB]);
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* Return all (i.e., up to 8) circles tangent to two lines and a circle plus data about tangent points/fractions.
|
|
153
|
+
* @param lineA first line
|
|
154
|
+
* @param lineB second line
|
|
155
|
+
* @param circle the circle
|
|
156
|
+
*/
|
|
157
|
+
static circlesTangentLineLineCircle(lineA, lineB, circle) {
|
|
158
|
+
if (isNotCircularOrPoint(circle))
|
|
159
|
+
return undefined;
|
|
160
|
+
const implicitLineA = ImplicitCurve2dConverter_1.ImplicitCurve2dConverter.createImplicitCurve2dFromCurvePrimitiveXY(lineA);
|
|
161
|
+
const implicitLineB = ImplicitCurve2dConverter_1.ImplicitCurve2dConverter.createImplicitCurve2dFromCurvePrimitiveXY(lineB);
|
|
162
|
+
const implicitCircle = ImplicitCurve2dConverter_1.ImplicitCurve2dConverter.createImplicitCurve2dFromCurvePrimitiveXY(circle);
|
|
163
|
+
if (!(implicitLineA instanceof UnboundedLine2d_1.UnboundedLine2dByPointAndNormal)
|
|
164
|
+
|| !(implicitLineB instanceof UnboundedLine2d_1.UnboundedLine2dByPointAndNormal)
|
|
165
|
+
|| !(implicitCircle instanceof UnboundedCircle2d_1.UnboundedCircle2dByCenterAndRadius))
|
|
166
|
+
return undefined;
|
|
167
|
+
const markups = ConstrainedImplicitCurve2d_1.ConstrainedImplicitCurve2d.circlesTangentLLC(implicitLineA, implicitLineB, implicitCircle);
|
|
168
|
+
if (markups === undefined)
|
|
169
|
+
return undefined;
|
|
170
|
+
return getCircleOrLineMarkups(markups, true, [lineA, lineB, circle]);
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* Return all (i.e., up to 4) circles tangent to 2 circles and a line plus data about tangent points/fractions.
|
|
174
|
+
* @param circleA first circle
|
|
175
|
+
* @param circleB second circle
|
|
176
|
+
* @param line the line
|
|
177
|
+
*/
|
|
178
|
+
static circlesTangentCircleCircleLine(circleA, circleB, line) {
|
|
179
|
+
if (isNotCircularOrPoint(circleA) || isNotCircularOrPoint(circleB))
|
|
180
|
+
return undefined;
|
|
181
|
+
const implicitCircleA = ImplicitCurve2dConverter_1.ImplicitCurve2dConverter.createImplicitCurve2dFromCurvePrimitiveXY(circleA);
|
|
182
|
+
const implicitCircleB = ImplicitCurve2dConverter_1.ImplicitCurve2dConverter.createImplicitCurve2dFromCurvePrimitiveXY(circleB);
|
|
183
|
+
const implicitLine = ImplicitCurve2dConverter_1.ImplicitCurve2dConverter.createImplicitCurve2dFromCurvePrimitiveXY(line);
|
|
184
|
+
if (!(implicitCircleA instanceof UnboundedCircle2d_1.UnboundedCircle2dByCenterAndRadius)
|
|
185
|
+
|| !(implicitCircleB instanceof UnboundedCircle2d_1.UnboundedCircle2dByCenterAndRadius)
|
|
186
|
+
|| !(implicitLine instanceof UnboundedLine2d_1.UnboundedLine2dByPointAndNormal))
|
|
187
|
+
return undefined;
|
|
188
|
+
const markups = ConstrainedImplicitCurve2d_1.ConstrainedImplicitCurve2d.circlesTangentCCL(implicitCircleA, implicitCircleB, implicitLine);
|
|
189
|
+
if (markups === undefined)
|
|
190
|
+
return undefined;
|
|
191
|
+
return getCircleOrLineMarkups(markups, true, [circleA, circleB, line]);
|
|
192
|
+
}
|
|
193
|
+
/**
|
|
194
|
+
* Return all (i.e., up to 8) circles tangent to 3 circles plus data about tangent points/fractions.
|
|
195
|
+
* @param circleA first circle
|
|
196
|
+
* @param circleB second circle
|
|
197
|
+
* @param circleC third circle
|
|
198
|
+
*/
|
|
199
|
+
static circlesTangentCircleCircleCircle(circleA, circleB, circleC) {
|
|
200
|
+
if (isNotCircularOrPoint(circleA) || isNotCircularOrPoint(circleB) || isNotCircularOrPoint(circleC))
|
|
201
|
+
return undefined;
|
|
202
|
+
const implicitCircleA = ImplicitCurve2dConverter_1.ImplicitCurve2dConverter.createImplicitCurve2dFromCurvePrimitiveXY(circleA);
|
|
203
|
+
const implicitCircleB = ImplicitCurve2dConverter_1.ImplicitCurve2dConverter.createImplicitCurve2dFromCurvePrimitiveXY(circleB);
|
|
204
|
+
const implicitCircleC = ImplicitCurve2dConverter_1.ImplicitCurve2dConverter.createImplicitCurve2dFromCurvePrimitiveXY(circleC);
|
|
205
|
+
if (!(implicitCircleA instanceof UnboundedCircle2d_1.UnboundedCircle2dByCenterAndRadius)
|
|
206
|
+
|| !(implicitCircleB instanceof UnboundedCircle2d_1.UnboundedCircle2dByCenterAndRadius)
|
|
207
|
+
|| !(implicitCircleC instanceof UnboundedCircle2d_1.UnboundedCircle2dByCenterAndRadius))
|
|
208
|
+
return undefined;
|
|
209
|
+
const markups = ConstrainedImplicitCurve2d_1.ConstrainedImplicitCurve2d.circlesTangentCCC(implicitCircleA, implicitCircleB, implicitCircleC);
|
|
210
|
+
if (markups === undefined)
|
|
211
|
+
return undefined;
|
|
212
|
+
return getCircleOrLineMarkups(markups, true, [circleA, circleB, circleC]);
|
|
213
|
+
}
|
|
214
|
+
/**
|
|
215
|
+
* Compute circles of specified radius tangent to each of the lines plus data about tangent points/fractions.
|
|
216
|
+
* * There are normally 4 circles.
|
|
217
|
+
* * Returns undefined when the lines are parallel.
|
|
218
|
+
* @param lineA first line
|
|
219
|
+
* @param lineB second line
|
|
220
|
+
* @param radius radius of tangent circles.
|
|
221
|
+
*/
|
|
222
|
+
static circlesTangentLineLineRadius(lineA, lineB, radius) {
|
|
223
|
+
const implicitLineA = ImplicitCurve2dConverter_1.ImplicitCurve2dConverter.createImplicitCurve2dFromCurvePrimitiveXY(lineA);
|
|
224
|
+
const implicitLineB = ImplicitCurve2dConverter_1.ImplicitCurve2dConverter.createImplicitCurve2dFromCurvePrimitiveXY(lineB);
|
|
225
|
+
if (!(implicitLineA instanceof UnboundedLine2d_1.UnboundedLine2dByPointAndNormal)
|
|
226
|
+
|| !(implicitLineB instanceof UnboundedLine2d_1.UnboundedLine2dByPointAndNormal))
|
|
227
|
+
return undefined;
|
|
228
|
+
const markups = ConstrainedImplicitCurve2d_1.ConstrainedImplicitCurve2d.circlesTangentLLR(implicitLineA, implicitLineB, radius);
|
|
229
|
+
if (markups === undefined)
|
|
230
|
+
return undefined;
|
|
231
|
+
return getCircleOrLineMarkups(markups, true, [lineA, lineB]);
|
|
232
|
+
}
|
|
233
|
+
/**
|
|
234
|
+
* Compute circles of specified radius tangent to both a circle and a line plus data about tangent points/fractions.
|
|
235
|
+
* * There can be 0 to 8 circles.
|
|
236
|
+
* @param circle the circle
|
|
237
|
+
* @param line the line
|
|
238
|
+
* @param radius radius of tangent circles
|
|
239
|
+
*/
|
|
240
|
+
static circlesTangentCircleLineRadius(circle, line, radius) {
|
|
241
|
+
if (isNotCircularOrPoint(circle))
|
|
242
|
+
return undefined;
|
|
243
|
+
const implicitCircleA = ImplicitCurve2dConverter_1.ImplicitCurve2dConverter.createImplicitCurve2dFromCurvePrimitiveXY(circle);
|
|
244
|
+
const implicitLineB = ImplicitCurve2dConverter_1.ImplicitCurve2dConverter.createImplicitCurve2dFromCurvePrimitiveXY(line);
|
|
245
|
+
if (!(implicitCircleA instanceof UnboundedCircle2d_1.UnboundedCircle2dByCenterAndRadius)
|
|
246
|
+
|| !(implicitLineB instanceof UnboundedLine2d_1.UnboundedLine2dByPointAndNormal))
|
|
247
|
+
return undefined;
|
|
248
|
+
const markups = ConstrainedImplicitCurve2d_1.ConstrainedImplicitCurve2d.circlesTangentCLR(implicitCircleA, implicitLineB, radius);
|
|
249
|
+
if (markups === undefined)
|
|
250
|
+
return undefined;
|
|
251
|
+
return getCircleOrLineMarkups(markups, true, [circle, line]);
|
|
252
|
+
}
|
|
253
|
+
/**
|
|
254
|
+
* Compute circles of specified radius tangent to both circles plus data about tangent points/fractions.
|
|
255
|
+
* * There can be 0 to 8 circles.
|
|
256
|
+
* @param circleA the first circle
|
|
257
|
+
* @param circleB the second circle
|
|
258
|
+
* @param radius radius of tangent circles
|
|
259
|
+
*/
|
|
260
|
+
static circlesTangentCircleCircleRadius(circleA, circleB, radius) {
|
|
261
|
+
if (isNotCircularOrPoint(circleA) || isNotCircularOrPoint(circleB))
|
|
262
|
+
return undefined;
|
|
263
|
+
const implicitCircleA = ImplicitCurve2dConverter_1.ImplicitCurve2dConverter.createImplicitCurve2dFromCurvePrimitiveXY(circleA);
|
|
264
|
+
const implicitCircleB = ImplicitCurve2dConverter_1.ImplicitCurve2dConverter.createImplicitCurve2dFromCurvePrimitiveXY(circleB);
|
|
265
|
+
if (!(implicitCircleA instanceof UnboundedCircle2d_1.UnboundedCircle2dByCenterAndRadius)
|
|
266
|
+
|| !(implicitCircleB instanceof UnboundedCircle2d_1.UnboundedCircle2dByCenterAndRadius))
|
|
267
|
+
return undefined;
|
|
268
|
+
const markups = ConstrainedImplicitCurve2d_1.ConstrainedImplicitCurve2d.circlesTangentCCR(implicitCircleA, implicitCircleB, radius);
|
|
269
|
+
if (markups === undefined)
|
|
270
|
+
return undefined;
|
|
271
|
+
return getCircleOrLineMarkups(markups, true, [circleA, circleB]);
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
exports.ConstrainedCurve2d = ConstrainedCurve2d;
|
|
275
|
+
// return true if the input is not a circular arc
|
|
276
|
+
function isNotCircularArc(cp) {
|
|
277
|
+
return !(cp instanceof Arc3d_1.Arc3d) || !cp.isCircular;
|
|
278
|
+
}
|
|
279
|
+
// return true if the curve primitive is not a circle or a point
|
|
280
|
+
function isNotCircularOrPoint(arc) {
|
|
281
|
+
return arc.circularRadius() === undefined && !arc.isDegenerateCircle;
|
|
282
|
+
}
|
|
283
|
+
// create a CurveLocationDetail for a point on a curve if point is on the curve
|
|
284
|
+
function makeLocationDetail(curve, contact) {
|
|
285
|
+
const contact3d = Point3dVector3d_1.Point3d.create(contact.x, contact.y, 0);
|
|
286
|
+
const detail = curve.closestPointXY(contact3d, true);
|
|
287
|
+
if (detail === undefined || detail.a > Geometry_1.Geometry.smallMetricDistance)
|
|
288
|
+
return undefined;
|
|
289
|
+
return detail;
|
|
290
|
+
}
|
|
291
|
+
function getCircleOrLineMarkups(markups, expectCircle, originalConstraint) {
|
|
292
|
+
const result = [];
|
|
293
|
+
for (const markup of markups) {
|
|
294
|
+
const cp = ImplicitCurve2dConverter_1.ImplicitCurve2dConverter.createCurvePrimitiveFromImplicitCurve(markup.curve);
|
|
295
|
+
if (cp === undefined)
|
|
296
|
+
return undefined;
|
|
297
|
+
if ((expectCircle && isNotCircularArc(cp)) || (!expectCircle && !(cp instanceof LineSegment3d_1.LineSegment3d)))
|
|
298
|
+
return undefined;
|
|
299
|
+
const curve = expectCircle ? cp : cp;
|
|
300
|
+
const details = [];
|
|
301
|
+
for (const original of originalConstraint) {
|
|
302
|
+
for (const implicitData of markup.data) {
|
|
303
|
+
const returnedDetail = makeLocationDetail(original, implicitData.point);
|
|
304
|
+
if (returnedDetail !== undefined) {
|
|
305
|
+
const detailA = returnedDetail;
|
|
306
|
+
const detailB = makeLocationDetail(curve, implicitData.point);
|
|
307
|
+
details.push(new CurveLocationDetail_1.CurveLocationDetailPair(detailA, detailB));
|
|
308
|
+
markup.data = markup.data.filter(d => d !== implicitData);
|
|
309
|
+
break;
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
result.push({ curve, details });
|
|
314
|
+
}
|
|
315
|
+
return result.length > 0 ? result : undefined;
|
|
316
|
+
}
|
|
317
|
+
//# sourceMappingURL=ConstrainedCurve2d.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ConstrainedCurve2d.js","sourceRoot":"","sources":["../../../src/curve/ConstrainedCurve2d.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,0CAAuC;AAEvC,mEAAwD;AACxD,mCAAgC;AAChC,+DAAqF;AAErF,yGAAsG;AAEtG,qGAAkG;AAClG,uFAAqG;AACrG,mFAAgG;AAChG,mDAAgD;AAEhD;;;;;;;;;;;;;GAaG;AACH,MAAa,kBAAkB;IAC7B;;;;;OAKG;IACI,MAAM,CAAC,0BAA0B,CACtC,KAAoB,EACpB,KAAoB,EACpB,KAAoB;QAEpB,MAAM,aAAa,GAAG,mDAAwB,CAAC,yCAAyC,CAAC,KAAK,CAAC,CAAC;QAChG,MAAM,aAAa,GAAG,mDAAwB,CAAC,yCAAyC,CAAC,KAAK,CAAC,CAAC;QAChG,MAAM,aAAa,GAAG,mDAAwB,CAAC,yCAAyC,CAAC,KAAK,CAAC,CAAC;QAChG,IAAI,CAAC,C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AI,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,YAAY,CAAC,CAAC;oBAC1D,MAAM;gBACR,CAAC;YACH,CAAC;QACH,CAAC;QACD,MAAM,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,CAAC;IAClC,CAAC;IACD,OAAO,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;AAChD,CAAC","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 CartesianGeometry\r\n */\r\n\r\nimport { Geometry } from \"../Geometry\";\r\nimport { Point2d } from \"../geometry3d/Point2dVector2d\";\r\nimport { Point3d } from \"../geometry3d/Point3dVector3d\";\r\nimport { Arc3d } from \"./Arc3d\";\r\nimport { CurveLocationDetail, CurveLocationDetailPair } from \"./CurveLocationDetail\";\r\nimport { CurvePrimitive } from \"./CurvePrimitive\";\r\nimport { ConstrainedImplicitCurve2d } from \"./internalContexts/geometry2d/ConstrainedImplicitCurve2d\";\r\nimport { ImplicitCurve2d, ImplicitGeometryMarkup } from \"./internalContexts/geometry2d/ImplicitCurve2d\";\r\nimport { ImplicitCurve2dConverter } from \"./internalContexts/geometry2d/ImplicitCurve2dConverter\";\r\nimport { UnboundedCircle2dByCenterAndRadius } from \"./internalContexts/geometry2d/UnboundedCircle2d\";\r\nimport { UnboundedLine2dByPointAndNormal } from \"./internalContexts/geometry2d/UnboundedLine2d\";\r\nimport { LineSegment3d } from \"./LineSegment3d\";\r\n\r\n/**\r\n * The class has static methods to compute circles and lines with specified constrained (tangent to other lines/circles,\r\n * perpendicular to other lines/circles, or a specified circle radius).\r\n * * z components of the input curves are completely ignored.\r\n * * In this API, a `LineSegment3d` input identifies the underlying unbounded line by its endpoints. The segment\r\n * itself is bounded, but the geometric line constraint is applied as unbounded.\r\n * * Each API not only returns the circles or lines that satisfy the constraints but also captures the input curve\r\n * location details where the tangency/perpendicularity happens. Each returned element contains:\r\n * * the curve (circle or line) that satisfies the constraints.\r\n * * an array of {@link CurveLocationDetailPair} objects, where each pair holds:\r\n * * `detailA`: the result curve with the contact point and fraction on the curve.\r\n * * `detailB`: the input constraint curve with the same contact point and fraction on the constraint curve.\r\n * @alpha\r\n */\r\nexport class ConstrainedCurve2d {\r\n /**\r\n * Return all (i.e., up to 4) circles that are tangent to 3 given lines plus data about tangent points/fractions.\r\n * @param lineA first line\r\n * @param lineB second line\r\n * @param lineC third line\r\n */\r\n public static circlesTangentLineLineLine(\r\n lineA: LineSegment3d,\r\n lineB: LineSegment3d,\r\n lineC: LineSegment3d,\r\n ): { curve: Arc3d, details: CurveLocationDetailPair[] }[] | undefined {\r\n const implicitLineA = ImplicitCurve2dConverter.createImplicitCurve2dFromCurvePrimitiveXY(lineA);\r\n const implicitLineB = ImplicitCurve2dConverter.createImplicitCurve2dFromCurvePrimitiveXY(lineB);\r\n const implicitLineC = ImplicitCurve2dConverter.createImplicitCurve2dFromCurvePrimitiveXY(lineC);\r\n if (!(implicitLineA instanceof UnboundedLine2dByPointAndNormal)\r\n || !(implicitLineB instanceof UnboundedLine2dByPointAndNormal)\r\n || !(implicitLineC instanceof UnboundedLine2dByPointAndNormal))\r\n return undefined;\r\n const markups = ConstrainedImplicitCurve2d.circlesTangentLLL(implicitLineA, implicitLineB, implicitLineC);\r\n if (markups === undefined)\r\n return undefined;\r\n return getCircleOrLineMarkups(markups, true, [lineA, lineB, lineC]);\r\n }\r\n /**\r\n * Return all (i.e., up to 2) unbounded lines perpendicular to a line and tangent to a circle plus data about\r\n * perp/tangent points/fractions.\r\n * @param line the line\r\n * @param circle the circle\r\n */\r\n public static linesPerpLineTangentCircle(\r\n line: LineSegment3d,\r\n circle: Arc3d,\r\n ): { curve: LineSegment3d, details: CurveLocationDetailPair[] }[] | undefined {\r\n if (isNotCircularOrPoint(circle))\r\n return undefined;\r\n const implicitLine = ImplicitCurve2dConverter.createImplicitCurve2dFromCurvePrimitiveXY(line);\r\n const implicitCircle = ImplicitCurve2dConverter.createImplicitCurve2dFromCurvePrimitiveXY(circle);\r\n if (!(implicitLine instanceof UnboundedLine2dByPointAndNormal)\r\n || !(implicitCircle instanceof UnboundedCircle2dByCenterAndRadius))\r\n return undefined;\r\n const markups = ConstrainedImplicitCurve2d.linesPerpLTangentC(implicitLine, implicitCircle);\r\n if (markups === undefined)\r\n return undefined;\r\n return getCircleOrLineMarkups(markups, false, [line, circle]);\r\n }\r\n /**\r\n * Return all (i.e., 4) variants of the line perpendicular to 2 circles (line between centers, with ends at\r\n * crossing points on respective circles) plus data about perp points/fractions.\r\n * @param circleA first circle\r\n * @param circleB second circle\r\n */\r\n public static linesPerpCirclePerpCircle(\r\n circleA: Arc3d,\r\n circleB: Arc3d,\r\n ): { curve: LineSegment3d, details: CurveLocationDetailPair[] }[] | undefined {\r\n if (!circleA.isCircular || !circleB.isCircular)\r\n return undefined;\r\n const implicitCircleA = ImplicitCurve2dConverter.createImplicitCurve2dFromCurvePrimitiveXY(circleA);\r\n const implicitCircleB = ImplicitCurve2dConverter.createImplicitCurve2dFromCurvePrimitiveXY(circleB);\r\n if (!(implicitCircleA instanceof UnboundedCircle2dByCenterAndRadius)\r\n || !(implicitCircleB instanceof UnboundedCircle2dByCenterAndRadius))\r\n return undefined;\r\n const markups = ConstrainedImplicitCurve2d.linesPerpCPerpC(implicitCircleA, implicitCircleB);\r\n if (markups === undefined)\r\n return undefined;\r\n return getCircleOrLineMarkups(markups, false, [circleA, circleB]);\r\n }\r\n /**\r\n * Return all (i.e., up to 2) unbounded lines perpendicular to a line and a circle plus data about perp points/fractions.\r\n * @param line the line\r\n * @param circle the circle\r\n */\r\n public static linesPerpLinePerpCircle(\r\n line: LineSegment3d,\r\n circle: Arc3d,\r\n ): { curve: LineSegment3d, details: CurveLocationDetailPair[] }[] | undefined {\r\n if (isNotCircularOrPoint(circle))\r\n return undefined;\r\n const implicitLine = ImplicitCurve2dConverter.createImplicitCurve2dFromCurvePrimitiveXY(line);\r\n const implicitCircle = ImplicitCurve2dConverter.createImplicitCurve2dFromCurvePrimitiveXY(circle);\r\n if (!(implicitLine instanceof UnboundedLine2dByPointAndNormal)\r\n || !(implicitCircle instanceof UnboundedCircle2dByCenterAndRadius))\r\n return undefined;\r\n const markups = ConstrainedImplicitCurve2d.linesPerpLPerpC(implicitLine, implicitCircle);\r\n if (markups === undefined)\r\n return undefined;\r\n return getCircleOrLineMarkups(markups, false, [line, circle]);\r\n }\r\n /**\r\n * Return all (i.e., up to 4) unbounded lines perpendicular to a circle and tangent to a circle plus data about\r\n * perp/tangent points/fractions.\r\n * Note that multiple colinear lines are returned tagged with diametrically opposing points of circleA.\r\n * @param circleA first circle (for perpendicular constraint)\r\n * @param circleB second circle (for tangent constraint)\r\n */\r\n public static linesPerpCircleTangentCircle(\r\n circleA: Arc3d,\r\n circleB: Arc3d,\r\n ): { curve: LineSegment3d, details: CurveLocationDetailPair[] }[] | undefined {\r\n if (isNotCircularOrPoint(circleA) || isNotCircularOrPoint(circleB))\r\n return undefined;\r\n const implicitCircleA = ImplicitCurve2dConverter.createImplicitCurve2dFromCurvePrimitiveXY(circleA);\r\n const implicitCircleB = ImplicitCurve2dConverter.createImplicitCurve2dFromCurvePrimitiveXY(circleB);\r\n if (!(implicitCircleA instanceof UnboundedCircle2dByCenterAndRadius)\r\n || !(implicitCircleB instanceof UnboundedCircle2dByCenterAndRadius))\r\n return undefined;\r\n const markups = ConstrainedImplicitCurve2d.linesPerpCTangentC(implicitCircleA, implicitCircleB);\r\n if (markups === undefined)\r\n return undefined;\r\n return getCircleOrLineMarkups(markups, false, [circleA, circleB]);\r\n }\r\n /**\r\n * Return all (i.e., up to 4) unbounded lines tangent to 2 circles plus data about tangent points/fractions.\r\n * * There are 4 lines if there is neither intersection nor containment between the circles\r\n * * There are 2 lines if the circles intersect\r\n * * There are no lines if one circle is entirely inside the other.\r\n * @param circleA first circle\r\n * @param circleB second circle\r\n */\r\n public static linesTangentCircleCircle(\r\n circleA: Arc3d,\r\n circleB: Arc3d,\r\n ): { curve: LineSegment3d, details: CurveLocationDetailPair[] }[] | undefined {\r\n if (isNotCircularOrPoint(circleA) || isNotCircularOrPoint(circleB))\r\n return undefined;\r\n const implicitCircleA = ImplicitCurve2dConverter.createImplicitCurve2dFromCurvePrimitiveXY(circleA);\r\n const implicitCircleB = ImplicitCurve2dConverter.createImplicitCurve2dFromCurvePrimitiveXY(circleB);\r\n if (!(implicitCircleA instanceof UnboundedCircle2dByCenterAndRadius)\r\n || !(implicitCircleB instanceof UnboundedCircle2dByCenterAndRadius))\r\n return undefined;\r\n const markups = ConstrainedImplicitCurve2d.linesTangentCC(implicitCircleA, implicitCircleB);\r\n if (markups === undefined)\r\n return undefined;\r\n return getCircleOrLineMarkups(markups, false, [circleA, circleB]);\r\n }\r\n /**\r\n * Return all (i.e., up to 8) circles tangent to two lines and a circle plus data about tangent points/fractions.\r\n * @param lineA first line\r\n * @param lineB second line\r\n * @param circle the circle\r\n */\r\n public static circlesTangentLineLineCircle(\r\n lineA: LineSegment3d,\r\n lineB: LineSegment3d,\r\n circle: Arc3d,\r\n ): { curve: Arc3d, details: CurveLocationDetailPair[] }[] | undefined {\r\n if (isNotCircularOrPoint(circle))\r\n return undefined;\r\n const implicitLineA = ImplicitCurve2dConverter.createImplicitCurve2dFromCurvePrimitiveXY(lineA);\r\n const implicitLineB = ImplicitCurve2dConverter.createImplicitCurve2dFromCurvePrimitiveXY(lineB);\r\n const implicitCircle = ImplicitCurve2dConverter.createImplicitCurve2dFromCurvePrimitiveXY(circle);\r\n if (!(implicitLineA instanceof UnboundedLine2dByPointAndNormal)\r\n || !(implicitLineB instanceof UnboundedLine2dByPointAndNormal)\r\n || !(implicitCircle instanceof UnboundedCircle2dByCenterAndRadius))\r\n return undefined;\r\n const markups = ConstrainedImplicitCurve2d.circlesTangentLLC(implicitLineA, implicitLineB, implicitCircle);\r\n if (markups === undefined)\r\n return undefined;\r\n return getCircleOrLineMarkups(markups, true, [lineA, lineB, circle]);\r\n }\r\n /**\r\n * Return all (i.e., up to 4) circles tangent to 2 circles and a line plus data about tangent points/fractions.\r\n * @param circleA first circle\r\n * @param circleB second circle\r\n * @param line the line\r\n */\r\n public static circlesTangentCircleCircleLine(\r\n circleA: Arc3d,\r\n circleB: Arc3d,\r\n line: LineSegment3d,\r\n ): { curve: Arc3d, details: CurveLocationDetailPair[] }[] | undefined {\r\n if (isNotCircularOrPoint(circleA) || isNotCircularOrPoint(circleB))\r\n return undefined;\r\n const implicitCircleA = ImplicitCurve2dConverter.createImplicitCurve2dFromCurvePrimitiveXY(circleA);\r\n const implicitCircleB = ImplicitCurve2dConverter.createImplicitCurve2dFromCurvePrimitiveXY(circleB);\r\n const implicitLine = ImplicitCurve2dConverter.createImplicitCurve2dFromCurvePrimitiveXY(line);\r\n if (!(implicitCircleA instanceof UnboundedCircle2dByCenterAndRadius)\r\n || !(implicitCircleB instanceof UnboundedCircle2dByCenterAndRadius)\r\n || !(implicitLine instanceof UnboundedLine2dByPointAndNormal))\r\n return undefined;\r\n const markups = ConstrainedImplicitCurve2d.circlesTangentCCL(implicitCircleA, implicitCircleB, implicitLine);\r\n if (markups === undefined)\r\n return undefined;\r\n return getCircleOrLineMarkups(markups, true, [circleA, circleB, line]);\r\n }\r\n /**\r\n * Return all (i.e., up to 8) circles tangent to 3 circles plus data about tangent points/fractions.\r\n * @param circleA first circle\r\n * @param circleB second circle\r\n * @param circleC third circle\r\n */\r\n public static circlesTangentCircleCircleCircle(\r\n circleA: Arc3d,\r\n circleB: Arc3d,\r\n circleC: Arc3d,\r\n ): { curve: Arc3d, details: CurveLocationDetailPair[] }[] | undefined {\r\n if (isNotCircularOrPoint(circleA) || isNotCircularOrPoint(circleB) || isNotCircularOrPoint(circleC))\r\n return undefined;\r\n const implicitCircleA = ImplicitCurve2dConverter.createImplicitCurve2dFromCurvePrimitiveXY(circleA);\r\n const implicitCircleB = ImplicitCurve2dConverter.createImplicitCurve2dFromCurvePrimitiveXY(circleB);\r\n const implicitCircleC = ImplicitCurve2dConverter.createImplicitCurve2dFromCurvePrimitiveXY(circleC);\r\n if (!(implicitCircleA instanceof UnboundedCircle2dByCenterAndRadius)\r\n || !(implicitCircleB instanceof UnboundedCircle2dByCenterAndRadius)\r\n || !(implicitCircleC instanceof UnboundedCircle2dByCenterAndRadius))\r\n return undefined;\r\n const markups = ConstrainedImplicitCurve2d.circlesTangentCCC(implicitCircleA, implicitCircleB, implicitCircleC);\r\n if (markups === undefined)\r\n return undefined;\r\n return getCircleOrLineMarkups(markups, true, [circleA, circleB, circleC]);\r\n }\r\n /**\r\n * Compute circles of specified radius tangent to each of the lines plus data about tangent points/fractions.\r\n * * There are normally 4 circles.\r\n * * Returns undefined when the lines are parallel.\r\n * @param lineA first line\r\n * @param lineB second line\r\n * @param radius radius of tangent circles.\r\n */\r\n public static circlesTangentLineLineRadius(\r\n lineA: LineSegment3d,\r\n lineB: LineSegment3d,\r\n radius: number,\r\n ): { curve: Arc3d, details: CurveLocationDetailPair[] }[] | undefined {\r\n const implicitLineA = ImplicitCurve2dConverter.createImplicitCurve2dFromCurvePrimitiveXY(lineA);\r\n const implicitLineB = ImplicitCurve2dConverter.createImplicitCurve2dFromCurvePrimitiveXY(lineB);\r\n if (!(implicitLineA instanceof UnboundedLine2dByPointAndNormal)\r\n || !(implicitLineB instanceof UnboundedLine2dByPointAndNormal))\r\n return undefined;\r\n const markups = ConstrainedImplicitCurve2d.circlesTangentLLR(implicitLineA, implicitLineB, radius);\r\n if (markups === undefined)\r\n return undefined;\r\n return getCircleOrLineMarkups(markups, true, [lineA, lineB]);\r\n }\r\n /**\r\n * Compute circles of specified radius tangent to both a circle and a line plus data about tangent points/fractions.\r\n * * There can be 0 to 8 circles.\r\n * @param circle the circle\r\n * @param line the line\r\n * @param radius radius of tangent circles\r\n */\r\n public static circlesTangentCircleLineRadius(\r\n circle: Arc3d,\r\n line: LineSegment3d,\r\n radius: number,\r\n ): { curve: Arc3d, details: CurveLocationDetailPair[] }[] | undefined {\r\n if (isNotCircularOrPoint(circle))\r\n return undefined;\r\n const implicitCircleA = ImplicitCurve2dConverter.createImplicitCurve2dFromCurvePrimitiveXY(circle);\r\n const implicitLineB = ImplicitCurve2dConverter.createImplicitCurve2dFromCurvePrimitiveXY(line);\r\n if (!(implicitCircleA instanceof UnboundedCircle2dByCenterAndRadius)\r\n || !(implicitLineB instanceof UnboundedLine2dByPointAndNormal))\r\n return undefined;\r\n const markups = ConstrainedImplicitCurve2d.circlesTangentCLR(implicitCircleA, implicitLineB, radius);\r\n if (markups === undefined)\r\n return undefined;\r\n return getCircleOrLineMarkups(markups, true, [circle, line]);\r\n }\r\n /**\r\n * Compute circles of specified radius tangent to both circles plus data about tangent points/fractions.\r\n * * There can be 0 to 8 circles.\r\n * @param circleA the first circle\r\n * @param circleB the second circle\r\n * @param radius radius of tangent circles\r\n */\r\n public static circlesTangentCircleCircleRadius(\r\n circleA: Arc3d,\r\n circleB: Arc3d,\r\n radius: number,\r\n ): { curve: Arc3d, details: CurveLocationDetailPair[] }[] | undefined {\r\n if (isNotCircularOrPoint(circleA) || isNotCircularOrPoint(circleB))\r\n return undefined;\r\n const implicitCircleA = ImplicitCurve2dConverter.createImplicitCurve2dFromCurvePrimitiveXY(circleA);\r\n const implicitCircleB = ImplicitCurve2dConverter.createImplicitCurve2dFromCurvePrimitiveXY(circleB);\r\n if (!(implicitCircleA instanceof UnboundedCircle2dByCenterAndRadius)\r\n || !(implicitCircleB instanceof UnboundedCircle2dByCenterAndRadius))\r\n return undefined;\r\n const markups = ConstrainedImplicitCurve2d.circlesTangentCCR(implicitCircleA, implicitCircleB, radius);\r\n if (markups === undefined)\r\n return undefined;\r\n return getCircleOrLineMarkups(markups, true, [circleA, circleB]);\r\n }\r\n}\r\n\r\n// return true if the input is not a circular arc\r\nfunction isNotCircularArc(cp: CurvePrimitive): boolean {\r\n return !(cp instanceof Arc3d) || !cp.isCircular;\r\n}\r\n// return true if the curve primitive is not a circle or a point\r\nfunction isNotCircularOrPoint(arc: Arc3d): boolean {\r\n return arc.circularRadius() === undefined && !arc.isDegenerateCircle;\r\n}\r\n// create a CurveLocationDetail for a point on a curve if point is on the curve\r\nfunction makeLocationDetail(curve: CurvePrimitive, contact: Point2d): CurveLocationDetail | undefined {\r\n const contact3d = Point3d.create(contact.x, contact.y, 0);\r\n const detail = curve.closestPointXY(contact3d, true);\r\n if (detail === undefined || detail.a > Geometry.smallMetricDistance)\r\n return undefined;\r\n return detail;\r\n}\r\n// return markups with captured circles or lines and their data\r\nfunction getCircleOrLineMarkups(\r\n markups: ImplicitGeometryMarkup<ImplicitCurve2d>[], expectCircle: true, originalConstraint: (Arc3d | LineSegment3d)[],\r\n): { curve: Arc3d, details: CurveLocationDetailPair[] }[] | undefined;\r\nfunction getCircleOrLineMarkups(\r\n markups: ImplicitGeometryMarkup<ImplicitCurve2d>[], expectCircle: false, originalConstraint: (Arc3d | LineSegment3d)[],\r\n): { curve: LineSegment3d, details: CurveLocationDetailPair[] }[] | undefined;\r\nfunction getCircleOrLineMarkups(\r\n markups: ImplicitGeometryMarkup<ImplicitCurve2d>[], expectCircle: boolean, originalConstraint: (Arc3d | LineSegment3d)[],\r\n): { curve: Arc3d | LineSegment3d, details: CurveLocationDetailPair[] }[] | undefined {\r\n const result: { curve: Arc3d | LineSegment3d, details: CurveLocationDetailPair[] }[] = [];\r\n for (const markup of markups) {\r\n const cp = ImplicitCurve2dConverter.createCurvePrimitiveFromImplicitCurve(markup.curve) as CurvePrimitive | undefined;\r\n if (cp === undefined)\r\n return undefined;\r\n if ((expectCircle && isNotCircularArc(cp)) || (!expectCircle && !(cp instanceof LineSegment3d)))\r\n return undefined;\r\n const curve = expectCircle ? cp as Arc3d : cp as LineSegment3d;\r\n const details: CurveLocationDetailPair[] = [];\r\n for (const original of originalConstraint) {\r\n for (const implicitData of markup.data) {\r\n const returnedDetail = makeLocationDetail(original, implicitData.point);\r\n if (returnedDetail !== undefined) {\r\n const detailA = returnedDetail;\r\n const detailB = makeLocationDetail(curve, implicitData.point);\r\n details.push(new CurveLocationDetailPair(detailA, detailB));\r\n markup.data = markup.data.filter(d => d !== implicitData);\r\n break;\r\n }\r\n }\r\n }\r\n result.push({ curve, details });\r\n }\r\n return result.length > 0 ? result : undefined;\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CurveFactory.d.ts","sourceRoot":"","sources":["../../../src/curve/CurveFactory.ts"],"names":[],"mappings":"AAUA,OAAO,EAAkC,sBAAsB,EAAE,MAAM,aAAa,CAAC;AACrF,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AACvE,OAAO,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAE1E,OAAO,EAAE,4BAA4B,EAAE,MAAM,4CAA4C,CAAC;AAG1F,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AAElE,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAG5C,OAAO,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAE/C,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAGvD,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjD,OAAO,EAAE,KAAK,EAAgB,MAAM,SAAS,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,QAAQ,EAAa,MAAM,cAAc,CAAC;AACnD,OAAO,EAAE,aAAa,EAA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