@itwin/core-geometry 4.0.0-dev.70 → 4.0.0-dev.73
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 +36 -3
- package/lib/cjs/curve/Query/PlanarSubdivision.d.ts +7 -1
- package/lib/cjs/curve/Query/PlanarSubdivision.d.ts.map +1 -1
- package/lib/cjs/curve/Query/PlanarSubdivision.js +14 -12
- package/lib/cjs/curve/Query/PlanarSubdivision.js.map +1 -1
- package/lib/cjs/curve/RegionOps.d.ts +2 -2
- package/lib/cjs/curve/RegionOps.js +2 -2
- package/lib/cjs/curve/RegionOps.js.map +1 -1
- package/lib/cjs/geometry3d/BarycentricTriangle.d.ts +134 -90
- package/lib/cjs/geometry3d/BarycentricTriangle.d.ts.map +1 -1
- package/lib/cjs/geometry3d/BarycentricTriangle.js +192 -129
- package/lib/cjs/geometry3d/BarycentricTriangle.js.map +1 -1
- package/lib/cjs/geometry3d/Ray3d.d.ts +38 -34
- package/lib/cjs/geometry3d/Ray3d.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Ray3d.js +48 -45
- package/lib/cjs/geometry3d/Ray3d.js.map +1 -1
- package/lib/esm/curve/Query/PlanarSubdivision.d.ts +7 -1
- package/lib/esm/curve/Query/PlanarSubdivision.d.ts.map +1 -1
- package/lib/esm/curve/Query/PlanarSubdivision.js +14 -12
- package/lib/esm/curve/Query/PlanarSubdivision.js.map +1 -1
- package/lib/esm/curve/RegionOps.d.ts +2 -2
- package/lib/esm/curve/RegionOps.js +2 -2
- package/lib/esm/curve/RegionOps.js.map +1 -1
- package/lib/esm/geometry3d/BarycentricTriangle.d.ts +134 -90
- package/lib/esm/geometry3d/BarycentricTriangle.d.ts.map +1 -1
- package/lib/esm/geometry3d/BarycentricTriangle.js +192 -129
- package/lib/esm/geometry3d/BarycentricTriangle.js.map +1 -1
- package/lib/esm/geometry3d/Ray3d.d.ts +38 -34
- package/lib/esm/geometry3d/Ray3d.d.ts.map +1 -1
- package/lib/esm/geometry3d/Ray3d.js +48 -45
- package/lib/esm/geometry3d/Ray3d.js.map +1 -1
- package/package.json +5 -5
|
@@ -6,17 +6,23 @@ import { Point3d, Vector3d } from "./Point3dVector3d";
|
|
|
6
6
|
import { Ray3d } from "./Ray3d";
|
|
7
7
|
/**
|
|
8
8
|
* Carries data about a location in the plane of a triangle.
|
|
9
|
-
* * Each instance carries both world and barycentric coordinates for the point, and provides query
|
|
10
|
-
*
|
|
11
|
-
*
|
|
9
|
+
* * Each instance carries both world and barycentric coordinates for the point, and provides query
|
|
10
|
+
* services on the latter.
|
|
11
|
+
* * No tolerance is used when querying barycentric coordinates (e.g., `isInsideOrOn`, `classify`). Use
|
|
12
|
+
* [[BarycentricTriangle.snapLocationToEdge]] to adjust the barycentric coordinates to a triangle edge
|
|
13
|
+
* if they lie within a distance or parametric tolerance.
|
|
12
14
|
*
|
|
13
|
-
* Properties of the barycentric coordinates (b0, b1, b2) of a point p in the plane of a triangle
|
|
14
|
-
*
|
|
15
|
-
* *
|
|
16
|
-
* *
|
|
17
|
-
* *
|
|
18
|
-
*
|
|
19
|
-
* *
|
|
15
|
+
* Properties of the barycentric coordinates `(b0, b1, b2)` of a point `p` in the plane of a triangle
|
|
16
|
+
* `T` with vertices `v0, v1, v2`:
|
|
17
|
+
* * `1 = b0 + b1 + b2`
|
|
18
|
+
* * `p = b0 * v0 + b1 * v1 + b2 * v2`
|
|
19
|
+
* * If T is spanned by the vectors `U = v1 - v0` and `V = v2 - v0`, then the vector `P = p - v0` can
|
|
20
|
+
* be written `P = b1 * U + b2 * V`.
|
|
21
|
+
* * The coordinates are all nonnegative if and only if `p` is inside or on `T`.
|
|
22
|
+
* * Exactly one coordinate is zero if and only if `p` lies on an (infinitely extended) edge of `T`.
|
|
23
|
+
* * Exactly two coordinates are zero if and only if `p` coincides with a vertex of `T`.
|
|
24
|
+
* * Note that if `p` can be written as a linear combination of the vertices of `T` using scales that do
|
|
25
|
+
* NOT sum to 1, then `p` is not coplanar with `T`
|
|
20
26
|
* @public
|
|
21
27
|
*/
|
|
22
28
|
export declare class TriangleLocationDetail {
|
|
@@ -26,28 +32,38 @@ export declare class TriangleLocationDetail {
|
|
|
26
32
|
local: Point3d;
|
|
27
33
|
/** Application-specific number */
|
|
28
34
|
a: number;
|
|
29
|
-
/** Index of the triangle vertex at the
|
|
35
|
+
/** Index of the triangle vertex at the start of the closest edge to p. */
|
|
30
36
|
closestEdgeIndex: number;
|
|
31
|
-
/**
|
|
37
|
+
/**
|
|
38
|
+
* The parameter f along the closest edge to p of its projection q.
|
|
39
|
+
* * We have q = v_i + f * (v_j - v_i) where i = closestEdgeIndex and j = (i + 1) % 3 are the indices
|
|
40
|
+
* of the start vertex v_i and end vertex v_j of the closest edge to p.
|
|
41
|
+
* * Note that 0 <= f <= 1.
|
|
42
|
+
*/
|
|
32
43
|
closestEdgeParam: number;
|
|
33
44
|
private constructor();
|
|
34
|
-
/** Invalidate this detail. */
|
|
45
|
+
/** Invalidate this detail (set all attributes to zero) . */
|
|
35
46
|
invalidate(): void;
|
|
36
|
-
/**
|
|
47
|
+
/**
|
|
48
|
+
* Create an invalid detail.
|
|
37
49
|
* @param result optional pre-allocated object to fill and return
|
|
38
50
|
*/
|
|
39
51
|
static create(result?: TriangleLocationDetail): TriangleLocationDetail;
|
|
40
|
-
/**
|
|
52
|
+
/**
|
|
53
|
+
* Set the instance contents from the `other` detail.
|
|
41
54
|
* @param other detail to clone
|
|
42
55
|
*/
|
|
43
56
|
copyContentsFrom(other: TriangleLocationDetail): void;
|
|
44
57
|
/** Whether this detail is invalid. */
|
|
45
58
|
get isValid(): boolean;
|
|
46
|
-
/**
|
|
59
|
+
/**
|
|
60
|
+
* Queries the barycentric coordinates to determine whether this instance specifies a location inside or
|
|
61
|
+
* on the triangle.
|
|
47
62
|
* @see classify
|
|
48
63
|
*/
|
|
49
64
|
get isInsideOrOn(): boolean;
|
|
50
|
-
/**
|
|
65
|
+
/**
|
|
66
|
+
* Queries this detail to classify the location of this instance with respect to the triangle.
|
|
51
67
|
* @returns location code
|
|
52
68
|
* @see isInsideOrOn
|
|
53
69
|
*/
|
|
@@ -62,149 +78,196 @@ export declare class BarycentricTriangle {
|
|
|
62
78
|
points: Point3d[];
|
|
63
79
|
/** Edge length squared cache, indexed by opposite vertex index */
|
|
64
80
|
protected edgeLength2: number[];
|
|
65
|
-
|
|
81
|
+
private static _workPoint?;
|
|
82
|
+
private static _workVector0?;
|
|
83
|
+
private static _workVector1?;
|
|
84
|
+
private static _workRay?;
|
|
85
|
+
private static _workMatrix?;
|
|
86
|
+
/**
|
|
87
|
+
* Constructor.
|
|
66
88
|
* * Point references are CAPTURED
|
|
67
89
|
*/
|
|
68
90
|
protected constructor(point0: Point3d, point1: Point3d, point2: Point3d);
|
|
69
91
|
/**
|
|
70
|
-
*
|
|
92
|
+
* Copy contents of (not pointers to) the given points. A vertex is zeroed if its corresponding input point
|
|
93
|
+
* is undefined.
|
|
94
|
+
*/
|
|
95
|
+
set(point0: Point3d | undefined, point1: Point3d | undefined, point2: Point3d | undefined): void;
|
|
96
|
+
/** Copy all values from `other` */
|
|
97
|
+
setFrom(other: BarycentricTriangle): void;
|
|
98
|
+
/**
|
|
99
|
+
* Create a `BarycentricTriangle` with coordinates given by enumerated x,y,z of the 3 points.
|
|
71
100
|
* @param result optional pre-allocated triangle.
|
|
72
101
|
*/
|
|
73
102
|
static createXYZXYZXYZ(x0: number, y0: number, z0: number, x1: number, y1: number, z1: number, x2: number, y2: number, z2: number, result?: BarycentricTriangle): BarycentricTriangle;
|
|
74
|
-
/**
|
|
103
|
+
/** Create a triangle with coordinates cloned from given points. */
|
|
75
104
|
static create(point0: Point3d, point1: Point3d, point2: Point3d, result?: BarycentricTriangle): BarycentricTriangle;
|
|
76
105
|
/** Return a new `BarycentricTriangle` with the same coordinates. */
|
|
77
106
|
clone(result?: BarycentricTriangle): BarycentricTriangle;
|
|
78
|
-
/** Return area divided by sum of squared lengths. */
|
|
79
|
-
get aspectRatio(): number;
|
|
80
107
|
/** Return the area of the triangle. */
|
|
81
108
|
get area(): number;
|
|
82
|
-
/**
|
|
109
|
+
/**
|
|
110
|
+
* Compute squared length of the triangle edge opposite the vertex with the given index.
|
|
111
|
+
* @see [[edgeStartVertexIndexToOppositeVertexIndex]]
|
|
112
|
+
*/
|
|
113
|
+
edgeLengthSquared(oppositeVertexIndex: number): number;
|
|
114
|
+
/**
|
|
115
|
+
* Compute length of the triangle edge opposite the vertex with the given index.
|
|
116
|
+
* @see [[edgeStartVertexIndexToOppositeVertexIndex]]
|
|
117
|
+
*/
|
|
118
|
+
edgeLength(oppositeVertexIndex: number): number;
|
|
119
|
+
/** Return area divided by sum of squared lengths. */
|
|
120
|
+
get aspectRatio(): number;
|
|
121
|
+
/** Return the perimeter of the triangle. */
|
|
83
122
|
get perimeter(): number;
|
|
84
|
-
/**
|
|
85
|
-
*
|
|
86
|
-
*
|
|
123
|
+
/**
|
|
124
|
+
* Return the unit normal of the triangle.
|
|
125
|
+
* @param result optional pre-allocated vector to fill and return.
|
|
126
|
+
* @returns unit normal, or undefined if cross product length is too small.
|
|
127
|
+
*/
|
|
128
|
+
normal(result?: Vector3d): Vector3d | undefined;
|
|
129
|
+
/**
|
|
130
|
+
* Sum the triangle points with given scales.
|
|
131
|
+
* * If the scales sum to 1, they are barycentric coordinates, and hence the result point is in the plane of
|
|
132
|
+
* the triangle. If all coordinates are non-negative then the result point is inside the triangle.
|
|
133
|
+
* * If the scales do not sum to 1, the point is inside the triangle scaled (by the scale sum) from the origin.
|
|
87
134
|
* @param b0 scale to apply to vertex 0
|
|
88
135
|
* @param b1 scale to apply to vertex 1
|
|
89
136
|
* @param b2 scale to apply to vertex 2
|
|
90
137
|
* @param result optional pre-allocated point to fill and return
|
|
91
138
|
* @return linear combination of the vertices of this triangle
|
|
92
|
-
* @see pointToFraction
|
|
139
|
+
* @see [[pointToFraction]]
|
|
93
140
|
*/
|
|
94
141
|
fractionToPoint(b0: number, b1: number, b2: number, result?: Point3d): Point3d;
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
private static _workVector1?;
|
|
98
|
-
private static _workRay?;
|
|
99
|
-
private static _workMatrix?;
|
|
100
|
-
/** Compute the projection of the given point onto the plane of this triangle.
|
|
142
|
+
/**
|
|
143
|
+
* Compute the projection of the given `point` onto the plane of this triangle.
|
|
101
144
|
* @param point point p to project
|
|
102
145
|
* @param result optional pre-allocated object to fill and return
|
|
103
|
-
* @returns details d of the projection point P =
|
|
146
|
+
* @returns details d of the projection point `P = d.world`:
|
|
104
147
|
* * `d.isValid` returns true if and only if `this.normal()` is defined.
|
|
105
148
|
* * `d.classify` can be used to determine where P lies with respect to the triangle.
|
|
106
|
-
* * `d.a` is the signed projection distance: P = p + a *
|
|
107
|
-
* @see fractionToPoint
|
|
149
|
+
* * `d.a` is the signed projection distance: `P = p + a * this.normal()`.
|
|
150
|
+
* @see [[fractionToPoint]]
|
|
108
151
|
*/
|
|
109
152
|
pointToFraction(point: Point3d, result?: TriangleLocationDetail): TriangleLocationDetail;
|
|
110
153
|
/** Convert from opposite-vertex to start-vertex edge indexing. */
|
|
111
154
|
static edgeOppositeVertexIndexToStartVertexIndex(edgeIndex: number): number;
|
|
112
155
|
/** Convert from start-vertex to opposite-vertex edge indexing. */
|
|
113
156
|
static edgeStartVertexIndexToOppositeVertexIndex(startVertexIndex: number): number;
|
|
114
|
-
/**
|
|
157
|
+
/**
|
|
158
|
+
* Examine a point's barycentric coordinates to determine if it lies inside the triangle but not on an edge/vertex.
|
|
115
159
|
* * No parametric tolerance is used.
|
|
116
160
|
* * It is assumed b0 + b1 + b2 = 1.
|
|
117
161
|
* @returns whether the point with barycentric coordinates is strictly inside the triangle.
|
|
118
162
|
*/
|
|
119
163
|
static isInsideTriangle(b0: number, b1: number, b2: number): boolean;
|
|
120
|
-
/**
|
|
164
|
+
/**
|
|
165
|
+
* Examine a point's barycentric coordinates to determine if it lies inside the triangle or on an edge/vertex.
|
|
121
166
|
* * No parametric tolerance is used.
|
|
122
167
|
* * It is assumed b0 + b1 + b2 = 1.
|
|
123
168
|
* @returns whether the point with barycentric coordinates is inside or on the triangle.
|
|
124
169
|
*/
|
|
125
170
|
static isInsideOrOnTriangle(b0: number, b1: number, b2: number): boolean;
|
|
126
|
-
/**
|
|
171
|
+
/**
|
|
172
|
+
* Examine a point's barycentric coordinates to determine if it lies outside an edge of the triangle.
|
|
127
173
|
* * No parametric tolerance is used.
|
|
128
174
|
* * It is assumed b0 + b1 + b2 = 1.
|
|
129
|
-
* @returns index
|
|
175
|
+
* @returns edge index i (opposite vertex i) for which b_i < 0 and b_j >= 0, and b_k >= 0. Otherwise, returns -1.
|
|
130
176
|
*/
|
|
131
177
|
private static isInRegionBeyondEdge;
|
|
132
|
-
/**
|
|
178
|
+
/**
|
|
179
|
+
* Examine a point's barycentric coordinates to determine if it lies outside a vertex of the triangle.
|
|
133
180
|
* * No parametric tolerance is used.
|
|
134
181
|
* * It is assumed b0 + b1 + b2 = 1.
|
|
135
|
-
* @returns index of vertex i for which
|
|
182
|
+
* @returns index of vertex i for which b_j < 0 and b_k < 0. Otherwise, returns -1.
|
|
136
183
|
*/
|
|
137
184
|
private static isInRegionBeyondVertex;
|
|
138
|
-
/**
|
|
185
|
+
/**
|
|
186
|
+
* Examine a point's barycentric coordinates to determine if it lies on a vertex of the triangle.
|
|
139
187
|
* * No parametric tolerance is used.
|
|
140
188
|
* * It is assumed b0 + b1 + b2 = 1.
|
|
141
|
-
* @returns index of vertex i for which b_i = 1 and b_j = b_k = 0,
|
|
189
|
+
* @returns index of vertex i for which b_i = 1 and b_j = b_k = 0. Otherwise, returns -1.
|
|
142
190
|
*/
|
|
143
191
|
private static isOnVertex;
|
|
144
|
-
/**
|
|
192
|
+
/**
|
|
193
|
+
* Examine a point's barycentric coordinates to determine if it lies on a bounded edge of the triangle.
|
|
145
194
|
* * No parametric tolerance is used.
|
|
146
195
|
* * It is assumed b0 + b1 + b2 = 1.
|
|
147
|
-
* @returns index
|
|
196
|
+
* @returns edge index i (opposite vertex i) for which b_i = 0, b_j > 0, and b_k > 0. Otherwise, returns -1.
|
|
148
197
|
*/
|
|
149
198
|
private static isOnBoundedEdge;
|
|
150
199
|
/** @returns edge/vertex index (0,1,2) for which the function has a minimum value */
|
|
151
200
|
private static indexOfMinimum;
|
|
201
|
+
/**
|
|
202
|
+
* Compute the squared distance between two points given by their barycentric coordinates.
|
|
203
|
+
* * It is assumed that a0 + a1 + a2 = b0 + b1 + b2 = 1.
|
|
204
|
+
*/
|
|
205
|
+
distanceSquared(a0: number, a1: number, a2: number, b0: number, b1: number, b2: number): number;
|
|
152
206
|
/** Return the index of the closest triangle vertex to the point given by its barycentric coordinates. */
|
|
153
207
|
closestVertexIndex(b0: number, b1: number, b2: number): number;
|
|
154
|
-
/** Compute
|
|
208
|
+
/** Compute dot product of the edge vectors based at the vertex with the given index. */
|
|
209
|
+
dotProductOfEdgeVectorsAtVertex(baseVertexIndex: number): number;
|
|
210
|
+
/**
|
|
211
|
+
* Compute the projection of barycentric point p onto the (unbounded) edge e_k(v_i,v_j) of the triangle T(v_i,v_j,v_k).
|
|
155
212
|
* @param k vertex v_k is opposite the edge e_k
|
|
156
213
|
* @param b barycentric coordinates of point to project
|
|
157
|
-
* @returns parameter
|
|
158
|
-
* * the projection point is q = v_i +
|
|
159
|
-
* * the barycentric coords of the projection are q_ijk = (1 -
|
|
214
|
+
* @returns parameter f along e_k, such that:
|
|
215
|
+
* * the projection point is q = v_i + f * (v_j - v_i)
|
|
216
|
+
* * the barycentric coords of the projection are q_ijk = (1 - f, f, 0)
|
|
160
217
|
*/
|
|
161
218
|
private computeProjectionToEdge;
|
|
162
|
-
/**
|
|
219
|
+
/**
|
|
220
|
+
* Compute the projection of a barycentric point p to the triangle T(v_0,v_1,v_2).
|
|
163
221
|
* @param b0 barycentric coordinate of p corresponding to v_0
|
|
164
222
|
* @param b1 barycentric coordinate of p corresponding to v_1
|
|
165
223
|
* @param b2 barycentric coordinate of p corresponding to v_2
|
|
166
|
-
* @returns closest edge start vertex index i and projection parameter
|
|
224
|
+
* @returns closest edge start vertex index i and projection parameter f such that the projection
|
|
225
|
+
* q = v_i + f * (v_j - v_i).
|
|
167
226
|
*/
|
|
168
227
|
closestPoint(b0: number, b1: number, b2: number): {
|
|
169
228
|
closestEdgeIndex: number;
|
|
170
229
|
closestEdgeParam: number;
|
|
171
230
|
};
|
|
172
|
-
/**
|
|
231
|
+
/**
|
|
232
|
+
* Compute the intersection of a line (parameterized as a ray) with the plane of this triangle.
|
|
173
233
|
* @param ray infinite line to intersect, as a ray
|
|
174
234
|
* @param result optional pre-allocated object to fill and return
|
|
175
|
-
* @returns details d of the line-plane intersection `d.
|
|
176
|
-
* * `d.
|
|
235
|
+
* @returns details d of the line-plane intersection point `d.world`:
|
|
236
|
+
* * `d.a` is the intersection parameter along the ray.
|
|
237
|
+
* * The line intersects the plane of the triangle if and only if `d.isValid` returns true.
|
|
238
|
+
* * The ray intersects the plane of the triangle if and only if `d.isValid` returns true and `d.a` >= 0.
|
|
239
|
+
* * The ray intersects the triangle if and only if `d.isValid` returns true, `d.a` >= 0, and `d.isInsideOrOn`
|
|
240
|
+
* returns true.
|
|
177
241
|
* * `d.classify` can be used to determine where the intersection lies with respect to the triangle.
|
|
178
|
-
*
|
|
179
|
-
* @see pointToFraction
|
|
242
|
+
* @see [[pointToFraction]]
|
|
180
243
|
*/
|
|
181
244
|
intersectRay3d(ray: Ray3d, result?: TriangleLocationDetail): TriangleLocationDetail;
|
|
182
|
-
/**
|
|
245
|
+
/**
|
|
246
|
+
* Compute the intersection of a line (parameterized as a line segment) with the plane of this triangle.
|
|
183
247
|
* @param point0 start point of segment on line to intersect
|
|
184
248
|
* @param point1 end point of segment on line to intersect
|
|
185
249
|
* @param result optional pre-allocated object to fill and return
|
|
186
|
-
* @returns details d of the line-plane intersection `d.
|
|
250
|
+
* @returns details d of the line-plane intersection point `d.world`:
|
|
187
251
|
* * `d.isValid` returns true if and only if the line intersects the plane.
|
|
188
252
|
* * `d.classify` can be used to determine where the intersection lies with respect to the triangle.
|
|
189
253
|
* * `d.a` is the intersection parameter. If `d.a` is in [0,1], the segment intersects the plane of the triangle.
|
|
190
|
-
* @see intersectRay3d
|
|
254
|
+
* @see [[intersectRay3d]]
|
|
191
255
|
*/
|
|
192
256
|
intersectSegment(point0: Point3d, point1: Point3d, result?: TriangleLocationDetail): TriangleLocationDetail;
|
|
193
|
-
/**
|
|
194
|
-
*
|
|
257
|
+
/**
|
|
258
|
+
* Adjust the location to the closest edge of the triangle if within either given tolerance.
|
|
259
|
+
* @param location details of a point in the plane of the triangle (note that `location.local` and
|
|
260
|
+
* `location.world` possibly updated to lie on the triangle closest edge)
|
|
195
261
|
* @param distanceTolerance absolute distance tolerance (or zero to ignore)
|
|
196
262
|
* @param parameterTolerance barycentric coordinate fractional tolerance (or zero to ignore)
|
|
197
263
|
* @return whether the location was adjusted
|
|
198
264
|
*/
|
|
199
265
|
snapLocationToEdge(location: TriangleLocationDetail, distanceTolerance?: number, parameterTolerance?: number): boolean;
|
|
200
|
-
/** Copy all values from `other`
|
|
201
|
-
*/
|
|
202
|
-
setFrom(other: BarycentricTriangle): void;
|
|
203
|
-
/** Copy contents of (not pointers to) the given points. A vertex is zeroed if its corresponding input point is undefined. */
|
|
204
|
-
set(point0: Point3d | undefined, point1: Point3d | undefined, point2: Point3d | undefined): void;
|
|
205
266
|
/**
|
|
206
|
-
*
|
|
207
|
-
* *
|
|
267
|
+
* Return the dot product of the scaled normals of the two triangles.
|
|
268
|
+
* * The sign of the return value is useful for determining the triangles' relative orientation:
|
|
269
|
+
* positive (negative) means the normals point into the same (opposite) half-space determined by
|
|
270
|
+
* one of the triangles' planes; zero means the triangles are perpendicular.
|
|
208
271
|
*/
|
|
209
272
|
dotProductOfCrossProductsFromOrigin(other: BarycentricTriangle): number;
|
|
210
273
|
/** Return the centroid of the 3 points. */
|
|
@@ -213,26 +276,7 @@ export declare class BarycentricTriangle {
|
|
|
213
276
|
incenter(result?: Point3d): Point3d;
|
|
214
277
|
/** Return the circumcenter of the triangle. */
|
|
215
278
|
circumcenter(result?: Point3d): Point3d;
|
|
216
|
-
/**
|
|
217
|
-
|
|
218
|
-
* @returns unit normal, or undefined if cross product length is too small.
|
|
219
|
-
*/
|
|
220
|
-
normal(result?: Vector3d): Vector3d | undefined;
|
|
221
|
-
/** test for point-by-point `isAlmostEqual` relationship. */
|
|
222
|
-
isAlmostEqual(other: BarycentricTriangle): boolean;
|
|
223
|
-
/** Compute length of the triangle edge opposite the vertex with the given index.
|
|
224
|
-
* @see edgeStartVertexIndexToOppositeVertexIndex
|
|
225
|
-
*/
|
|
226
|
-
edgeLength(oppositeVertexIndex: number): number;
|
|
227
|
-
/** Compute squared length of the triangle edge opposite the vertex with the given index.
|
|
228
|
-
* @see edgeStartVertexIndexToOppositeVertexIndex
|
|
229
|
-
*/
|
|
230
|
-
edgeLengthSquared(oppositeVertexIndex: number): number;
|
|
231
|
-
/** Compute dot product of the edge vectors based at the vertex with the given index. */
|
|
232
|
-
dotProductOfEdgeVectorsAtVertex(baseVertexIndex: number): number;
|
|
233
|
-
/** Compute the squared distance between two points given by their barycentric coordinates.
|
|
234
|
-
* * It is assumed that a0 + a1 + a2 = b0 + b1 + b2 = 1.
|
|
235
|
-
*/
|
|
236
|
-
distanceSquared(a0: number, a1: number, a2: number, b0: number, b1: number, b2: number): number;
|
|
279
|
+
/** Test for point-by-point `isAlmostEqual` relationship. */
|
|
280
|
+
isAlmostEqual(other: BarycentricTriangle, tol?: number): boolean;
|
|
237
281
|
}
|
|
238
282
|
//# sourceMappingURL=BarycentricTriangle.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BarycentricTriangle.d.ts","sourceRoot":"","sources":["../../../src/geometry3d/BarycentricTriangle.ts"],"names":[],"mappings":"AAIA;;GAEG;
|
|
1
|
+
{"version":3,"file":"BarycentricTriangle.d.ts","sourceRoot":"","sources":["../../../src/geometry3d/BarycentricTriang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