@itwin/core-geometry 4.0.0-dev.23 → 4.0.0-dev.28
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 +7 -2
- package/lib/cjs/Geometry.d.ts +23 -0
- package/lib/cjs/Geometry.d.ts.map +1 -1
- package/lib/cjs/Geometry.js +25 -1
- package/lib/cjs/Geometry.js.map +1 -1
- package/lib/cjs/bspline/BSplineCurveOps.js +4 -5
- package/lib/cjs/bspline/BSplineCurveOps.js.map +1 -1
- package/lib/cjs/bspline/InterpolationCurve3d.js +7 -10
- package/lib/cjs/bspline/InterpolationCurve3d.js.map +1 -1
- package/lib/cjs/clipping/ClipPrimitive.js +2 -2
- package/lib/cjs/clipping/ClipPrimitive.js.map +1 -1
- package/lib/cjs/clipping/ClipUtils.js +4 -4
- package/lib/cjs/clipping/ClipUtils.js.map +1 -1
- package/lib/cjs/clipping/internalContexts/LineStringOffsetClipperContext.js +2 -2
- package/lib/cjs/clipping/internalContexts/LineStringOffsetClipperContext.js.map +1 -1
- package/lib/cjs/curve/CurveChainWithDistanceIndex.js +1 -1
- package/lib/cjs/curve/CurveChainWithDistanceIndex.js.map +1 -1
- package/lib/cjs/curve/CurveCollection.js +1 -1
- package/lib/cjs/curve/CurveCollection.js.map +1 -1
- package/lib/cjs/curve/StrokeOptions.js +1 -2
- package/lib/cjs/curve/StrokeOptions.js.map +1 -1
- package/lib/cjs/curve/spiral/DirectSpiral3d.js +1 -2
- package/lib/cjs/curve/spiral/DirectSpiral3d.js.map +1 -1
- package/lib/cjs/curve/spiral/IntegratedSpiral3d.js +1 -2
- package/lib/cjs/curve/spiral/IntegratedSpiral3d.js.map +1 -1
- package/lib/cjs/geometry3d/BarycentricTriangle.d.ts +195 -8
- package/lib/cjs/geometry3d/BarycentricTriangle.d.ts.map +1 -1
- package/lib/cjs/geometry3d/BarycentricTriangle.js +459 -11
- package/lib/cjs/geometry3d/BarycentricTriangle.js.map +1 -1
- package/lib/cjs/geometry3d/GrowableFloat64Array.js +2 -2
- package/lib/cjs/geometry3d/GrowableFloat64Array.js.map +1 -1
- package/lib/cjs/geometry3d/GrowableXYArray.d.ts +1 -1
- package/lib/cjs/geometry3d/GrowableXYArray.d.ts.map +1 -1
- package/lib/cjs/geometry3d/GrowableXYArray.js +2 -2
- package/lib/cjs/geometry3d/GrowableXYArray.js.map +1 -1
- package/lib/cjs/geometry3d/GrowableXYZArray.js +1 -1
- package/lib/cjs/geometry3d/GrowableXYZArray.js.map +1 -1
- package/lib/cjs/geometry3d/IndexedXYCollection.d.ts +22 -7
- package/lib/cjs/geometry3d/IndexedXYCollection.d.ts.map +1 -1
- package/lib/cjs/geometry3d/IndexedXYCollection.js +41 -5
- package/lib/cjs/geometry3d/IndexedXYCollection.js.map +1 -1
- package/lib/cjs/geometry3d/IndexedXYZCollection.d.ts +58 -4
- package/lib/cjs/geometry3d/IndexedXYZCollection.d.ts.map +1 -1
- package/lib/cjs/geometry3d/IndexedXYZCollection.js +102 -4
- package/lib/cjs/geometry3d/IndexedXYZCollection.js.map +1 -1
- package/lib/cjs/geometry3d/Point2dArrayCarrier.d.ts +10 -0
- package/lib/cjs/geometry3d/Point2dArrayCarrier.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Point2dArrayCarrier.js +14 -0
- package/lib/cjs/geometry3d/Point2dArrayCarrier.js.map +1 -1
- package/lib/cjs/geometry3d/Point2dVector2d.js +4 -6
- package/lib/cjs/geometry3d/Point2dVector2d.js.map +1 -1
- package/lib/cjs/geometry3d/Point3dArrayCarrier.d.ts +0 -6
- package/lib/cjs/geometry3d/Point3dArrayCarrier.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Point3dArrayCarrier.js +0 -6
- package/lib/cjs/geometry3d/Point3dArrayCarrier.js.map +1 -1
- package/lib/cjs/geometry3d/Point3dVector3d.d.ts +1 -1
- package/lib/cjs/geometry3d/Point3dVector3d.js +6 -8
- package/lib/cjs/geometry3d/Point3dVector3d.js.map +1 -1
- package/lib/cjs/geometry3d/PointHelpers.d.ts +14 -1
- package/lib/cjs/geometry3d/PointHelpers.d.ts.map +1 -1
- package/lib/cjs/geometry3d/PointHelpers.js +33 -1
- package/lib/cjs/geometry3d/PointHelpers.js.map +1 -1
- package/lib/cjs/geometry3d/PolygonOps.d.ts +120 -10
- package/lib/cjs/geometry3d/PolygonOps.d.ts.map +1 -1
- package/lib/cjs/geometry3d/PolygonOps.js +413 -13
- package/lib/cjs/geometry3d/PolygonOps.js.map +1 -1
- package/lib/cjs/geometry3d/Ray3d.js +1 -1
- package/lib/cjs/geometry3d/Ray3d.js.map +1 -1
- package/lib/cjs/polyface/AuxData.js +1 -1
- package/lib/cjs/polyface/AuxData.js.map +1 -1
- package/lib/cjs/polyface/FacetLocationDetail.d.ts +264 -0
- package/lib/cjs/polyface/FacetLocationDetail.d.ts.map +1 -0
- package/lib/cjs/polyface/FacetLocationDetail.js +376 -0
- package/lib/cjs/polyface/FacetLocationDetail.js.map +1 -0
- package/lib/cjs/polyface/IndexedPolyfaceVisitor.d.ts +2 -5
- package/lib/cjs/polyface/IndexedPolyfaceVisitor.d.ts.map +1 -1
- package/lib/cjs/polyface/IndexedPolyfaceVisitor.js +5 -2
- package/lib/cjs/polyface/IndexedPolyfaceVisitor.js.map +1 -1
- package/lib/cjs/polyface/PolyfaceBuilder.d.ts +20 -14
- package/lib/cjs/polyface/PolyfaceBuilder.d.ts.map +1 -1
- package/lib/cjs/polyface/PolyfaceBuilder.js +21 -17
- package/lib/cjs/polyface/PolyfaceBuilder.js.map +1 -1
- package/lib/cjs/polyface/PolyfaceClip.js +6 -7
- package/lib/cjs/polyface/PolyfaceClip.js.map +1 -1
- package/lib/cjs/polyface/PolyfaceData.d.ts +1 -1
- package/lib/cjs/polyface/PolyfaceData.d.ts.map +1 -1
- package/lib/cjs/polyface/PolyfaceData.js.map +1 -1
- package/lib/cjs/polyface/PolyfaceQuery.d.ts +22 -1
- package/lib/cjs/polyface/PolyfaceQuery.d.ts.map +1 -1
- package/lib/cjs/polyface/PolyfaceQuery.js +52 -2
- package/lib/cjs/polyface/PolyfaceQuery.js.map +1 -1
- package/lib/cjs/serialization/BGFBReader.js +4 -4
- package/lib/cjs/serialization/BGFBReader.js.map +1 -1
- package/lib/cjs/serialization/IModelJsonSchema.js +1 -2
- package/lib/cjs/serialization/IModelJsonSchema.js.map +1 -1
- package/lib/cjs/solid/Sphere.d.ts +5 -5
- package/lib/cjs/solid/Sphere.js +5 -5
- package/lib/cjs/solid/Sphere.js.map +1 -1
- package/lib/cjs/solid/SweepContour.js +1 -1
- package/lib/cjs/solid/SweepContour.js.map +1 -1
- package/lib/cjs/topology/Triangulation.js +1 -1
- package/lib/cjs/topology/Triangulation.js.map +1 -1
- package/lib/esm/Geometry.d.ts +23 -0
- package/lib/esm/Geometry.d.ts.map +1 -1
- package/lib/esm/Geometry.js +24 -0
- package/lib/esm/Geometry.js.map +1 -1
- package/lib/esm/bspline/BSplineCurveOps.js +4 -5
- package/lib/esm/bspline/BSplineCurveOps.js.map +1 -1
- package/lib/esm/bspline/InterpolationCurve3d.js +7 -10
- package/lib/esm/bspline/InterpolationCurve3d.js.map +1 -1
- package/lib/esm/clipping/ClipPrimitive.js +2 -2
- package/lib/esm/clipping/ClipPrimitive.js.map +1 -1
- package/lib/esm/clipping/ClipUtils.js +4 -4
- package/lib/esm/clipping/ClipUtils.js.map +1 -1
- package/lib/esm/clipping/internalContexts/LineStringOffsetClipperContext.js +2 -2
- package/lib/esm/clipping/internalContexts/LineStringOffsetClipperContext.js.map +1 -1
- package/lib/esm/curve/CurveChainWithDistanceIndex.js +1 -1
- package/lib/esm/curve/CurveChainWithDistanceIndex.js.map +1 -1
- package/lib/esm/curve/CurveCollection.js +1 -1
- package/lib/esm/curve/CurveCollection.js.map +1 -1
- package/lib/esm/curve/StrokeOptions.js +1 -2
- package/lib/esm/curve/StrokeOptions.js.map +1 -1
- package/lib/esm/curve/spiral/DirectSpiral3d.js +1 -2
- package/lib/esm/curve/spiral/DirectSpiral3d.js.map +1 -1
- package/lib/esm/curve/spiral/IntegratedSpiral3d.js +1 -2
- package/lib/esm/curve/spiral/IntegratedSpiral3d.js.map +1 -1
- package/lib/esm/geometry3d/BarycentricTriangle.d.ts +195 -8
- package/lib/esm/geometry3d/BarycentricTriangle.d.ts.map +1 -1
- package/lib/esm/geometry3d/BarycentricTriangle.js +459 -12
- package/lib/esm/geometry3d/BarycentricTriangle.js.map +1 -1
- package/lib/esm/geometry3d/GrowableFloat64Array.js +2 -2
- package/lib/esm/geometry3d/GrowableFloat64Array.js.map +1 -1
- package/lib/esm/geometry3d/GrowableXYArray.d.ts +1 -1
- package/lib/esm/geometry3d/GrowableXYArray.d.ts.map +1 -1
- package/lib/esm/geometry3d/GrowableXYArray.js +2 -2
- package/lib/esm/geometry3d/GrowableXYArray.js.map +1 -1
- package/lib/esm/geometry3d/GrowableXYZArray.js +1 -1
- package/lib/esm/geometry3d/GrowableXYZArray.js.map +1 -1
- package/lib/esm/geometry3d/IndexedXYCollection.d.ts +22 -7
- package/lib/esm/geometry3d/IndexedXYCollection.d.ts.map +1 -1
- package/lib/esm/geometry3d/IndexedXYCollection.js +41 -5
- package/lib/esm/geometry3d/IndexedXYCollection.js.map +1 -1
- package/lib/esm/geometry3d/IndexedXYZCollection.d.ts +58 -4
- package/lib/esm/geometry3d/IndexedXYZCollection.d.ts.map +1 -1
- package/lib/esm/geometry3d/IndexedXYZCollection.js +103 -5
- package/lib/esm/geometry3d/IndexedXYZCollection.js.map +1 -1
- package/lib/esm/geometry3d/Point2dArrayCarrier.d.ts +10 -0
- package/lib/esm/geometry3d/Point2dArrayCarrier.d.ts.map +1 -1
- package/lib/esm/geometry3d/Point2dArrayCarrier.js +14 -0
- package/lib/esm/geometry3d/Point2dArrayCarrier.js.map +1 -1
- package/lib/esm/geometry3d/Point2dVector2d.js +4 -6
- package/lib/esm/geometry3d/Point2dVector2d.js.map +1 -1
- package/lib/esm/geometry3d/Point3dArrayCarrier.d.ts +0 -6
- package/lib/esm/geometry3d/Point3dArrayCarrier.d.ts.map +1 -1
- package/lib/esm/geometry3d/Point3dArrayCarrier.js +0 -6
- package/lib/esm/geometry3d/Point3dArrayCarrier.js.map +1 -1
- package/lib/esm/geometry3d/Point3dVector3d.d.ts +1 -1
- package/lib/esm/geometry3d/Point3dVector3d.js +6 -8
- package/lib/esm/geometry3d/Point3dVector3d.js.map +1 -1
- package/lib/esm/geometry3d/PointHelpers.d.ts +14 -1
- package/lib/esm/geometry3d/PointHelpers.d.ts.map +1 -1
- package/lib/esm/geometry3d/PointHelpers.js +33 -1
- package/lib/esm/geometry3d/PointHelpers.js.map +1 -1
- package/lib/esm/geometry3d/PolygonOps.d.ts +120 -10
- package/lib/esm/geometry3d/PolygonOps.d.ts.map +1 -1
- package/lib/esm/geometry3d/PolygonOps.js +412 -13
- package/lib/esm/geometry3d/PolygonOps.js.map +1 -1
- package/lib/esm/geometry3d/Ray3d.js +1 -1
- package/lib/esm/geometry3d/Ray3d.js.map +1 -1
- package/lib/esm/polyface/AuxData.js +1 -1
- package/lib/esm/polyface/AuxData.js.map +1 -1
- package/lib/esm/polyface/FacetLocationDetail.d.ts +264 -0
- package/lib/esm/polyface/FacetLocationDetail.d.ts.map +1 -0
- package/lib/esm/polyface/FacetLocationDetail.js +369 -0
- package/lib/esm/polyface/FacetLocationDetail.js.map +1 -0
- package/lib/esm/polyface/IndexedPolyfaceVisitor.d.ts +2 -5
- package/lib/esm/polyface/IndexedPolyfaceVisitor.d.ts.map +1 -1
- package/lib/esm/polyface/IndexedPolyfaceVisitor.js +5 -2
- package/lib/esm/polyface/IndexedPolyfaceVisitor.js.map +1 -1
- package/lib/esm/polyface/PolyfaceBuilder.d.ts +20 -14
- package/lib/esm/polyface/PolyfaceBuilder.d.ts.map +1 -1
- package/lib/esm/polyface/PolyfaceBuilder.js +21 -17
- package/lib/esm/polyface/PolyfaceBuilder.js.map +1 -1
- package/lib/esm/polyface/PolyfaceClip.js +6 -7
- package/lib/esm/polyface/PolyfaceClip.js.map +1 -1
- package/lib/esm/polyface/PolyfaceData.d.ts +1 -1
- package/lib/esm/polyface/PolyfaceData.d.ts.map +1 -1
- package/lib/esm/polyface/PolyfaceData.js.map +1 -1
- package/lib/esm/polyface/PolyfaceQuery.d.ts +22 -1
- package/lib/esm/polyface/PolyfaceQuery.d.ts.map +1 -1
- package/lib/esm/polyface/PolyfaceQuery.js +52 -2
- package/lib/esm/polyface/PolyfaceQuery.js.map +1 -1
- package/lib/esm/serialization/BGFBReader.js +4 -4
- package/lib/esm/serialization/BGFBReader.js.map +1 -1
- package/lib/esm/serialization/IModelJsonSchema.js +1 -2
- package/lib/esm/serialization/IModelJsonSchema.js.map +1 -1
- package/lib/esm/solid/Sphere.d.ts +5 -5
- package/lib/esm/solid/Sphere.js +5 -5
- package/lib/esm/solid/Sphere.js.map +1 -1
- package/lib/esm/solid/SweepContour.js +1 -1
- package/lib/esm/solid/SweepContour.js.map +1 -1
- package/lib/esm/topology/Triangulation.js +1 -1
- package/lib/esm/topology/Triangulation.js.map +1 -1
- package/package.json +4 -4
|
@@ -1,14 +1,67 @@
|
|
|
1
1
|
/** @packageDocumentation
|
|
2
2
|
* @module CartesianGeometry
|
|
3
3
|
*/
|
|
4
|
-
import {
|
|
4
|
+
import { PolygonLocation } from "../Geometry";
|
|
5
|
+
import { Point3d, Vector3d } from "./Point3dVector3d";
|
|
6
|
+
import { Ray3d } from "./Ray3d";
|
|
5
7
|
/**
|
|
6
|
-
*
|
|
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 services on the latter.
|
|
10
|
+
* * No tolerance is used when querying barycentric coordinates (e.g., `isInsideOrOn`, `classify`). Use `snapLocalToEdge`
|
|
11
|
+
* to adjust the barycentric coordinates to a triangle edge if they lie within a parametric tolerance.
|
|
12
|
+
*
|
|
13
|
+
* Properties of the barycentric coordinates (b0, b1, b2) of a point p in the plane of a triangle T with vertices p0, p1, p2:
|
|
14
|
+
* * 1 = b0 + b1 + b2
|
|
15
|
+
* * p = b0 * p0 + b1 * p1 + b2 * p2
|
|
16
|
+
* * If T is spanned by the vectors U=p1-p0 and V=p2-p0, then the vector P=p-p0 can be written P = b1 * U + b2 * V.
|
|
17
|
+
* * The coordinates are all nonnegative if and only if p is inside or on T.
|
|
18
|
+
* * Exactly one coordinate is zero if and only if p lies on an (infinitely extended) edge of T.
|
|
19
|
+
* * Exactly two coordinates are zero if and only if p coincides with a vertex of T.
|
|
20
|
+
* @public
|
|
21
|
+
*/
|
|
22
|
+
export declare class TriangleLocationDetail {
|
|
23
|
+
/** The Cartesian coordinates of the point p. */
|
|
24
|
+
world: Point3d;
|
|
25
|
+
/** The barycentric coordinates of p with respect to the triangle. Assumed to sum to one. */
|
|
26
|
+
local: Point3d;
|
|
27
|
+
/** Application-specific number */
|
|
28
|
+
a: number;
|
|
29
|
+
/** Index of the triangle vertex at the base of the edge closest to p. */
|
|
30
|
+
closestEdgeIndex: number;
|
|
31
|
+
/** The parameter along the closest edge of the projection of p. */
|
|
32
|
+
closestEdgeParam: number;
|
|
33
|
+
private constructor();
|
|
34
|
+
/** Invalidate this detail. */
|
|
35
|
+
invalidate(): void;
|
|
36
|
+
/** Create an invalid detail.
|
|
37
|
+
* @param result optional pre-allocated object to fill and return
|
|
38
|
+
*/
|
|
39
|
+
static create(result?: TriangleLocationDetail): TriangleLocationDetail;
|
|
40
|
+
/** Set the instance contents from the other detail.
|
|
41
|
+
* @param other detail to clone
|
|
42
|
+
*/
|
|
43
|
+
copyContentsFrom(other: TriangleLocationDetail): void;
|
|
44
|
+
/** Whether this detail is invalid. */
|
|
45
|
+
get isValid(): boolean;
|
|
46
|
+
/** Queries the barycentric coordinates to determine whether this instance specifies a location inside or on the triangle.
|
|
47
|
+
* @see classify
|
|
48
|
+
*/
|
|
49
|
+
get isInsideOrOn(): boolean;
|
|
50
|
+
/** Queries this detail to classify the location of this instance with respect to the triangle.
|
|
51
|
+
* @returns location code
|
|
52
|
+
* @see isInsideOrOn
|
|
53
|
+
*/
|
|
54
|
+
get classify(): PolygonLocation;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* 3 points defining a triangle to be evaluated with barycentric coordinates.
|
|
7
58
|
* @public
|
|
8
59
|
*/
|
|
9
60
|
export declare class BarycentricTriangle {
|
|
10
61
|
/** Array of 3 point coordinates for the triangle. */
|
|
11
62
|
points: Point3d[];
|
|
63
|
+
/** Edge length squared cache, indexed by opposite vertex index */
|
|
64
|
+
protected edgeLength2: number[];
|
|
12
65
|
/** Constructor.
|
|
13
66
|
* * Point references are CAPTURED
|
|
14
67
|
*/
|
|
@@ -26,18 +79,129 @@ export declare class BarycentricTriangle {
|
|
|
26
79
|
get aspectRatio(): number;
|
|
27
80
|
/** Return the area of the triangle. */
|
|
28
81
|
get area(): number;
|
|
82
|
+
/** Return the perimeter of the triangle */
|
|
83
|
+
get perimeter(): number;
|
|
29
84
|
/** Sum the points with given scales.
|
|
30
|
-
* *
|
|
31
|
-
* * If scales do not
|
|
85
|
+
* * If the scales sum to 1, they are barycentric coordinates, and hence the result point is in the plane of the triangle.
|
|
86
|
+
* * If the scales do not sum to 1, the point is in the triangle scaled (by the scale sum) from the origin.
|
|
87
|
+
* @param b0 scale to apply to vertex 0
|
|
88
|
+
* @param b1 scale to apply to vertex 1
|
|
89
|
+
* @param b2 scale to apply to vertex 2
|
|
90
|
+
* @param result optional pre-allocated point to fill and return
|
|
91
|
+
* @return linear combination of the vertices of this triangle
|
|
92
|
+
* @see pointToFraction
|
|
93
|
+
*/
|
|
94
|
+
fractionToPoint(b0: number, b1: number, b2: number, result?: Point3d): Point3d;
|
|
95
|
+
private static _workPoint?;
|
|
96
|
+
private static _workVector0?;
|
|
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.
|
|
101
|
+
* @param point point p to project
|
|
102
|
+
* @param result optional pre-allocated object to fill and return
|
|
103
|
+
* @returns details d of the projection point P = `d.point`:
|
|
104
|
+
* * `d.isValid` returns true if and only if `this.normal()` is defined.
|
|
105
|
+
* * `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 * `this.normal()`.
|
|
107
|
+
* @see fractionToPoint
|
|
108
|
+
*/
|
|
109
|
+
pointToFraction(point: Point3d, result?: TriangleLocationDetail): TriangleLocationDetail;
|
|
110
|
+
/** Convert from opposite-vertex to start-vertex edge indexing. */
|
|
111
|
+
static edgeOppositeVertexIndexToStartVertexIndex(edgeIndex: number): number;
|
|
112
|
+
/** Convert from start-vertex to opposite-vertex edge indexing. */
|
|
113
|
+
static edgeStartVertexIndexToOppositeVertexIndex(startVertexIndex: number): number;
|
|
114
|
+
/** Examine a point's barycentric coordinates to determine if it lies inside the triangle but not on an edge/vertex.
|
|
115
|
+
* * No parametric tolerance is used.
|
|
116
|
+
* * It is assumed b0 + b1 + b2 = 1.
|
|
117
|
+
* @returns whether the point with barycentric coordinates is strictly inside the triangle.
|
|
118
|
+
*/
|
|
119
|
+
static isInsideTriangle(b0: number, b1: number, b2: number): boolean;
|
|
120
|
+
/** Examine a point's barycentric coordinates to determine if it lies inside the triangle or on an edge/vertex.
|
|
121
|
+
* * No parametric tolerance is used.
|
|
122
|
+
* * It is assumed b0 + b1 + b2 = 1.
|
|
123
|
+
* @returns whether the point with barycentric coordinates is inside or on the triangle.
|
|
32
124
|
*/
|
|
33
|
-
|
|
125
|
+
static isInsideOrOnTriangle(b0: number, b1: number, b2: number): boolean;
|
|
126
|
+
/** Examine a point's barycentric coordinates to determine if it lies "outside" an edge of the triangle.
|
|
127
|
+
* * No parametric tolerance is used.
|
|
128
|
+
* * It is assumed b0 + b1 + b2 = 1.
|
|
129
|
+
* @returns index of vertex/edge i for which b_i < 0 and b_j >= 0 and b_k >= 0, or -1
|
|
130
|
+
*/
|
|
131
|
+
private static isInRegionBeyondEdge;
|
|
132
|
+
/** Examine a point's barycentric coordinates to determine if it lies "outside" a vertex of the triangle.
|
|
133
|
+
* * No parametric tolerance is used.
|
|
134
|
+
* * It is assumed b0 + b1 + b2 = 1.
|
|
135
|
+
* @returns index of vertex i for which and b_j < 0 and b_k < 0, or -1
|
|
136
|
+
*/
|
|
137
|
+
private static isInRegionBeyondVertex;
|
|
138
|
+
/** Examine a point's barycentric coordinates to determine if it lies on a vertex of the triangle.
|
|
139
|
+
* * No parametric tolerance is used.
|
|
140
|
+
* * It is assumed b0 + b1 + b2 = 1.
|
|
141
|
+
* @returns index of vertex i for which b_i = 1 and b_j = b_k = 0, or -1
|
|
142
|
+
*/
|
|
143
|
+
private static isOnVertex;
|
|
144
|
+
/** Examine a point's barycentric coordinates to determine if it lies on a bounded edge of the triangle.
|
|
145
|
+
* * No parametric tolerance is used.
|
|
146
|
+
* * It is assumed b0 + b1 + b2 = 1.
|
|
147
|
+
* @returns index of vertex/edge i for which b_i = 0 and b_j > 0 and b_k > 0, or -1
|
|
148
|
+
*/
|
|
149
|
+
private static isOnBoundedEdge;
|
|
150
|
+
/** @returns edge/vertex index (0,1,2) for which the function has a minimum value */
|
|
151
|
+
private static indexOfMinimum;
|
|
152
|
+
/** Return the index of the closest triangle vertex to the point given by its barycentric coordinates. */
|
|
153
|
+
closestVertexIndex(b0: number, b1: number, b2: number): number;
|
|
154
|
+
/** 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
|
+
* @param k vertex v_k is opposite the edge e_k
|
|
156
|
+
* @param b barycentric coordinates of point to project
|
|
157
|
+
* @returns parameter s along e_k, such that:
|
|
158
|
+
* * the projection point is q = v_i + s * (v_j - v_i)
|
|
159
|
+
* * the barycentric coords of the projection are q_ijk = (1 - s, s, 0)
|
|
160
|
+
*/
|
|
161
|
+
private computeProjectionToEdge;
|
|
162
|
+
/** Compute the projection of a barycentric point p to the triangle T(v_0,v_1,v_2).
|
|
163
|
+
* @param b0 barycentric coordinate of p corresponding to v_0
|
|
164
|
+
* @param b1 barycentric coordinate of p corresponding to v_1
|
|
165
|
+
* @param b2 barycentric coordinate of p corresponding to v_2
|
|
166
|
+
* @returns closest edge start vertex index i and projection parameter u such that the projection q = v_i + u * (v_j - v_i).
|
|
167
|
+
*/
|
|
168
|
+
closestPoint(b0: number, b1: number, b2: number): {
|
|
169
|
+
closestEdgeIndex: number;
|
|
170
|
+
closestEdgeParam: number;
|
|
171
|
+
};
|
|
172
|
+
/** Compute the intersection of a line (parameterized as a ray) with the plane of this triangle.
|
|
173
|
+
* @param ray infinite line to intersect, as a ray
|
|
174
|
+
* @param result optional pre-allocated object to fill and return
|
|
175
|
+
* @returns details d of the line-plane intersection `d.point`:
|
|
176
|
+
* * `d.isValid` returns true if and only if the line intersects the plane.
|
|
177
|
+
* * `d.classify` can be used to determine where the intersection lies with respect to the triangle.
|
|
178
|
+
* * `d.a` is the intersection parameter. If `d.a` >= 0, the ray intersects the plane of the triangle.
|
|
179
|
+
* @see pointToFraction
|
|
180
|
+
*/
|
|
181
|
+
intersectRay3d(ray: Ray3d, result?: TriangleLocationDetail): TriangleLocationDetail;
|
|
182
|
+
/** Compute the intersection of a line (parameterized as a line segment) with the plane of this triangle.
|
|
183
|
+
* @param point0 start point of segment on line to intersect
|
|
184
|
+
* @param point1 end point of segment on line to intersect
|
|
185
|
+
* @param result optional pre-allocated object to fill and return
|
|
186
|
+
* @returns details d of the line-plane intersection `d.point`:
|
|
187
|
+
* * `d.isValid` returns true if and only if the line intersects the plane.
|
|
188
|
+
* * `d.classify` can be used to determine where the intersection lies with respect to the triangle.
|
|
189
|
+
* * `d.a` is the intersection parameter. If `d.a` is in [0,1], the segment intersects the plane of the triangle.
|
|
190
|
+
* @see intersectRay3d
|
|
191
|
+
*/
|
|
192
|
+
intersectSegment(point0: Point3d, point1: Point3d, result?: TriangleLocationDetail): TriangleLocationDetail;
|
|
193
|
+
/** Adjust the location to an edge of the triangle if within either given tolerance.
|
|
194
|
+
* @param location details of a point in the plane of the triangle, `location.local` and `location.world` possibly updated to lie on a triangle edge
|
|
195
|
+
* @param distanceTolerance absolute distance tolerance (or zero to ignore)
|
|
196
|
+
* @param parameterTolerance barycentric coordinate fractional tolerance (or zero to ignore)
|
|
197
|
+
* @return whether the location was adjusted
|
|
198
|
+
*/
|
|
199
|
+
snapLocationToEdge(location: TriangleLocationDetail, distanceTolerance?: number, parameterTolerance?: number): boolean;
|
|
34
200
|
/** Copy all values from `other`
|
|
35
201
|
*/
|
|
36
202
|
setFrom(other: BarycentricTriangle): void;
|
|
37
|
-
/**
|
|
203
|
+
/** Copy contents of (not pointers to) the given points. A vertex is zeroed if its corresponding input point is undefined. */
|
|
38
204
|
set(point0: Point3d | undefined, point1: Point3d | undefined, point2: Point3d | undefined): void;
|
|
39
|
-
private static _workVector0?;
|
|
40
|
-
private static _workVector1?;
|
|
41
205
|
/**
|
|
42
206
|
* * For `this` and `other` BarycentricTriangles, compute cross products of vectors from point0 to point1 and from point0 to point2.
|
|
43
207
|
* * return the dot product of those two
|
|
@@ -45,7 +209,30 @@ export declare class BarycentricTriangle {
|
|
|
45
209
|
dotProductOfCrossProductsFromOrigin(other: BarycentricTriangle): number;
|
|
46
210
|
/** Return the centroid of the 3 points. */
|
|
47
211
|
centroid(result?: Point3d): Point3d;
|
|
212
|
+
/** Return the incenter of the triangle. */
|
|
213
|
+
incenter(result?: Point3d): Point3d;
|
|
214
|
+
/** Return the circumcenter of the triangle. */
|
|
215
|
+
circumcenter(result?: Point3d): Point3d;
|
|
216
|
+
/** Return the unit normal of the triangle.
|
|
217
|
+
* @param result optional pre-allocated vector to fill and return.
|
|
218
|
+
* @returns unit normal, or undefined if cross product length is too small.
|
|
219
|
+
*/
|
|
220
|
+
normal(result?: Vector3d): Vector3d | undefined;
|
|
48
221
|
/** test for point-by-point `isAlmostEqual` relationship. */
|
|
49
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;
|
|
50
237
|
}
|
|
51
238
|
//# sourceMappingURL=BarycentricTriangle.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BarycentricTriangle.d.ts","sourceRoot":"","sources":["../../../src/geometry3d/BarycentricTriangle.ts"],"names":[],"mappings":"AAIA;;GAEG;AAGH,OAAO,EAAE,OAAO,
|
|
1
|
+
{"version":3,"file":"BarycentricTriangle.d.ts","sourceRoot":"","sources":["../../../src/geometry3d/BarycentricTriangle.ts"],"names":[],"mappings":"AAIA;;GAEG;AAGH,OAAO,EAAY,eAAe,EAAE,MAAM,aAAa,CAAC;AAExD,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAEhC;;;;;;;;;;;;;;GAcG;AACH,qBAAa,sBAAsB;IACjC,gDAAgD;IACzC,KAAK,EAAE,OAAO,CAAC;IACtB,4FAA4F;IACrF,KAAK,EAAE,OAAO,CAAC;IACtB,kCAAkC;IAC3B,CAAC,EAAE,MAAM,CAAC;IACjB,yEAAy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