@itwin/core-geometry 4.5.0-dev.9 → 4.5.0
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 +56 -1
- package/LICENSE.md +1 -1
- package/lib/cjs/Geometry.d.ts +15 -0
- package/lib/cjs/Geometry.d.ts.map +1 -1
- package/lib/cjs/Geometry.js +27 -0
- package/lib/cjs/Geometry.js.map +1 -1
- package/lib/cjs/curve/spiral/MXCubicAlongArcSpiralEvaluator.js +1 -1
- package/lib/cjs/curve/spiral/MXCubicAlongArcSpiralEvaluator.js.map +1 -1
- package/lib/cjs/curve/spiral/PolishCubicSpiralEvaluator.js +1 -1
- package/lib/cjs/curve/spiral/PolishCubicSpiralEvaluator.js.map +1 -1
- package/lib/cjs/geometry3d/FrameBuilder.d.ts.map +1 -1
- package/lib/cjs/geometry3d/FrameBuilder.js +3 -0
- package/lib/cjs/geometry3d/FrameBuilder.js.map +1 -1
- package/lib/cjs/geometry3d/GrowableXYZArray.d.ts +8 -2
- package/lib/cjs/geometry3d/GrowableXYZArray.d.ts.map +1 -1
- package/lib/cjs/geometry3d/GrowableXYZArray.js +11 -2
- package/lib/cjs/geometry3d/GrowableXYZArray.js.map +1 -1
- package/lib/cjs/geometry3d/XYZProps.d.ts +16 -8
- package/lib/cjs/geometry3d/XYZProps.d.ts.map +1 -1
- package/lib/cjs/geometry3d/XYZProps.js.map +1 -1
- package/lib/cjs/polyface/IndexedPolyfaceVisitor.d.ts +42 -50
- package/lib/cjs/polyface/IndexedPolyfaceVisitor.d.ts.map +1 -1
- package/lib/cjs/polyface/IndexedPolyfaceVisitor.js +81 -105
- package/lib/cjs/polyface/IndexedPolyfaceVisitor.js.map +1 -1
- package/lib/cjs/polyface/Polyface.d.ts +19 -10
- package/lib/cjs/polyface/Polyface.d.ts.map +1 -1
- package/lib/cjs/polyface/Polyface.js +17 -10
- package/lib/cjs/polyface/Polyface.js.map +1 -1
- package/lib/cjs/polyface/PolyfaceBuilder.d.ts +18 -10
- package/lib/cjs/polyface/PolyfaceBuilder.d.ts.map +1 -1
- package/lib/cjs/polyface/PolyfaceBuilder.js +27 -21
- package/lib/cjs/polyface/PolyfaceBuilder.js.map +1 -1
- package/lib/cjs/polyface/PolyfaceData.d.ts +137 -86
- package/lib/cjs/polyface/PolyfaceData.d.ts.map +1 -1
- package/lib/cjs/polyface/PolyfaceData.js +300 -166
- package/lib/cjs/polyface/PolyfaceData.js.map +1 -1
- package/lib/cjs/serialization/GeometrySamples.js.map +1 -1
- package/lib/cjs/topology/Graph.d.ts +2 -8
- package/lib/cjs/topology/Graph.d.ts.map +1 -1
- package/lib/cjs/topology/Graph.js +0 -3
- package/lib/cjs/topology/Graph.js.map +1 -1
- package/lib/cjs/topology/Triangulation.d.ts +18 -7
- package/lib/cjs/topology/Triangulation.d.ts.map +1 -1
- package/lib/cjs/topology/Triangulation.js +50 -9
- package/lib/cjs/topology/Triangulation.js.map +1 -1
- package/lib/esm/Geometry.d.ts +15 -0
- package/lib/esm/Geometry.d.ts.map +1 -1
- package/lib/esm/Geometry.js +27 -0
- package/lib/esm/Geometry.js.map +1 -1
- package/lib/esm/curve/spiral/MXCubicAlongArcSpiralEvaluator.js +1 -1
- package/lib/esm/curve/spiral/MXCubicAlongArcSpiralEvaluator.js.map +1 -1
- package/lib/esm/curve/spiral/PolishCubicSpiralEvaluator.js +1 -1
- package/lib/esm/curve/spiral/PolishCubicSpiralEvaluator.js.map +1 -1
- package/lib/esm/geometry3d/FrameBuilder.d.ts.map +1 -1
- package/lib/esm/geometry3d/FrameBuilder.js +3 -0
- package/lib/esm/geometry3d/FrameBuilder.js.map +1 -1
- package/lib/esm/geometry3d/GrowableXYZArray.d.ts +8 -2
- package/lib/esm/geometry3d/GrowableXYZArray.d.ts.map +1 -1
- package/lib/esm/geometry3d/GrowableXYZArray.js +11 -2
- package/lib/esm/geometry3d/GrowableXYZArray.js.map +1 -1
- package/lib/esm/geometry3d/XYZProps.d.ts +16 -8
- package/lib/esm/geometry3d/XYZProps.d.ts.map +1 -1
- package/lib/esm/geometry3d/XYZProps.js.map +1 -1
- package/lib/esm/polyface/IndexedPolyfaceVisitor.d.ts +42 -50
- package/lib/esm/polyface/IndexedPolyfaceVisitor.d.ts.map +1 -1
- package/lib/esm/polyface/IndexedPolyfaceVisitor.js +80 -103
- package/lib/esm/polyface/IndexedPolyfaceVisitor.js.map +1 -1
- package/lib/esm/polyface/Polyface.d.ts +19 -10
- package/lib/esm/polyface/Polyface.d.ts.map +1 -1
- package/lib/esm/polyface/Polyface.js +17 -10
- package/lib/esm/polyface/Polyface.js.map +1 -1
- package/lib/esm/polyface/PolyfaceBuilder.d.ts +18 -10
- package/lib/esm/polyface/PolyfaceBuilder.d.ts.map +1 -1
- package/lib/esm/polyface/PolyfaceBuilder.js +27 -21
- package/lib/esm/polyface/PolyfaceBuilder.js.map +1 -1
- package/lib/esm/polyface/PolyfaceData.d.ts +137 -86
- package/lib/esm/polyface/PolyfaceData.d.ts.map +1 -1
- package/lib/esm/polyface/PolyfaceData.js +300 -166
- package/lib/esm/polyface/PolyfaceData.js.map +1 -1
- package/lib/esm/serialization/GeometrySamples.js.map +1 -1
- package/lib/esm/topology/Graph.d.ts +2 -8
- package/lib/esm/topology/Graph.d.ts.map +1 -1
- package/lib/esm/topology/Graph.js +0 -3
- package/lib/esm/topology/Graph.js.map +1 -1
- package/lib/esm/topology/Triangulation.d.ts +18 -7
- package/lib/esm/topology/Triangulation.d.ts.map +1 -1
- package/lib/esm/topology/Triangulation.js +50 -9
- package/lib/esm/topology/Triangulation.js.map +1 -1
- package/package.json +6 -4
|
@@ -8,70 +8,85 @@ import { PolyfaceAuxData } from "./AuxData";
|
|
|
8
8
|
import { FacetFaceData } from "./FacetFaceData";
|
|
9
9
|
import { TaggedNumericData } from "./TaggedNumericData";
|
|
10
10
|
/**
|
|
11
|
-
* PolyfaceData carries data arrays for point, normal,
|
|
12
|
-
*
|
|
13
|
-
* *
|
|
14
|
-
* *
|
|
15
|
-
* *
|
|
11
|
+
* `PolyfaceData` carries data arrays for point, normal, uv-parameters, and color, and index arrays for each.
|
|
12
|
+
* * Normal, uv-parameter, and color data are optional.
|
|
13
|
+
* * A given data array is defined if and only if its corresponding index array is defined.
|
|
14
|
+
* * All defined index arrays have parallel face loop order and structure, and thus the same length.
|
|
15
|
+
* * `IndexedPolyface` carries a PolyfaceData as a member (NOT as a base class; it already has `GeometryQuery` as base).
|
|
16
|
+
* * `IndexedPolyfaceVisitor` uses PolyfaceData as a base class. In this use, there is only a single facet in `PolyfaceData`.
|
|
17
|
+
* * `PolyfaceData` does not know what index range constitutes a given facet. This is managed by a derived/carrier class.
|
|
16
18
|
* @public
|
|
17
19
|
*/
|
|
18
20
|
export declare class PolyfaceData {
|
|
19
|
-
/**
|
|
21
|
+
/**
|
|
22
|
+
* Relative tolerance used in tests for planar facets.
|
|
20
23
|
* @internal
|
|
21
|
-
|
|
24
|
+
*/
|
|
22
25
|
static readonly planarityLocalRelTol = 1e-13;
|
|
23
|
-
/** Coordinate data for points in the facets
|
|
26
|
+
/** Coordinate data for points in the facets (packed as numbers in a contiguous array). */
|
|
24
27
|
point: GrowableXYZArray;
|
|
25
28
|
/** Indices of points at facet vertices. */
|
|
26
29
|
pointIndex: number[];
|
|
27
|
-
/**
|
|
28
|
-
edgeVisible: boolean[];
|
|
29
|
-
/** Coordinates of normal vectors, packed as numbers in a contiguous array. */
|
|
30
|
+
/** Coordinates of normal vectors (packed as numbers in a contiguous array). */
|
|
30
31
|
normal: GrowableXYZArray | undefined;
|
|
31
32
|
/** Indices of normals at facet vertices. */
|
|
32
33
|
normalIndex: number[] | undefined;
|
|
33
|
-
/** Coordinates of uv parameters
|
|
34
|
+
/** Coordinates of uv parameters (packed as numbers in a contiguous array). */
|
|
34
35
|
param?: GrowableXYArray;
|
|
35
36
|
/** Indices of params at facet vertices. */
|
|
36
37
|
paramIndex: number[] | undefined;
|
|
37
|
-
/**
|
|
38
|
-
* required (by display systems)
|
|
38
|
+
/**
|
|
39
|
+
* Color values. These are carried around as simple numbers, but are probably required (by display systems) to map
|
|
40
|
+
* exactly to 32-bit integers.
|
|
39
41
|
*/
|
|
40
42
|
color: number[] | undefined;
|
|
41
43
|
/** Indices of colors at facet vertices. */
|
|
42
44
|
colorIndex: number[] | undefined;
|
|
43
|
-
/**
|
|
45
|
+
/**
|
|
46
|
+
* Map from facet index to face data.
|
|
47
|
+
* * A "face" is a logical grouping of connected facets in the mesh, e.g., the facets that resulted from faceting
|
|
48
|
+
* a given face of a solid.
|
|
49
|
+
* * Face data remains empty until a face is specified.
|
|
50
|
+
*/
|
|
44
51
|
face: FacetFaceData[];
|
|
45
|
-
/** Auxiliary data */
|
|
52
|
+
/** Auxiliary data. */
|
|
46
53
|
auxData: PolyfaceAuxData | undefined;
|
|
47
|
-
/** Tagged geometry data */
|
|
54
|
+
/** Tagged geometry data. */
|
|
48
55
|
taggedNumericData: TaggedNumericData | undefined;
|
|
56
|
+
/**
|
|
57
|
+
* Booleans indicating visibility of corresponding edges.
|
|
58
|
+
* * The `edgeVisible` array is parallel to the `pointIndex` array.
|
|
59
|
+
* * The visibility flag applies to the edge whose start vertex index appears in the same place in the `pointIndex` array.
|
|
60
|
+
* * For example, consider the mesh with 2 triangular facets given by `pointIndex = [1,0,2, 1,2,3]`. If the triangles'
|
|
61
|
+
* shared edge is hidden, then the mesh has `edgeVisible = [true,true,false, false,true,true]`.
|
|
62
|
+
*/
|
|
63
|
+
edgeVisible: boolean[];
|
|
64
|
+
/** Boolean tag indicating if the facets are viewable from the back. */
|
|
49
65
|
private _twoSided;
|
|
50
|
-
/** boolean tag indicating if the facets are to be considered viewable from the back */
|
|
51
|
-
get twoSided(): boolean;
|
|
52
|
-
set twoSided(value: boolean);
|
|
53
|
-
/** set the `taggedNumericData` member */
|
|
54
|
-
setTaggedNumericData(data: TaggedNumericData | undefined): void;
|
|
55
|
-
private _expectedClosure;
|
|
56
66
|
/**
|
|
57
67
|
* Flag indicating if the mesh closure is unknown (0), open sheet (1), closed solid (2).
|
|
58
68
|
* * A boundary edge of a mesh is defined as an edge with only one connected facet.
|
|
59
69
|
* * Closed solid is a mesh with no boundary edge. Open sheet is a mesh that has boundary edge(s).
|
|
60
70
|
*/
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
*
|
|
65
|
-
*
|
|
66
|
-
*
|
|
71
|
+
private _expectedClosure;
|
|
72
|
+
/**
|
|
73
|
+
* Constructor for facets.
|
|
74
|
+
* @param needNormals `true` to allocate empty normal data and index arrays; `false` (default) to leave undefined.
|
|
75
|
+
* @param needParams `true` to allocate empty uv parameter data and index arrays; `false` (default) to leave undefined.
|
|
76
|
+
* @param needColors `true` to allocate empty color data and index arrays; `false` (default) to leave undefined.
|
|
77
|
+
* @param twoSided `true` if the facets are to be considered viewable from the back; `false` (default) if not.
|
|
67
78
|
*/
|
|
68
79
|
constructor(needNormals?: boolean, needParams?: boolean, needColors?: boolean, twoSided?: boolean);
|
|
69
80
|
/** Return a deep clone. */
|
|
70
81
|
clone(): PolyfaceData;
|
|
71
|
-
/** Test for equal indices and nearly equal coordinates */
|
|
82
|
+
/** Test for equal indices and nearly equal coordinates. */
|
|
72
83
|
isAlmostEqual(other: PolyfaceData): boolean;
|
|
73
84
|
/** Ask if normals are required in this mesh. */
|
|
74
85
|
get requireNormals(): boolean;
|
|
86
|
+
/** Ask if params are required in this mesh. */
|
|
87
|
+
get requireParams(): boolean;
|
|
88
|
+
/** Ask if colors are required in this mesh. */
|
|
89
|
+
get requireColors(): boolean;
|
|
75
90
|
/** Get the point count */
|
|
76
91
|
get pointCount(): number;
|
|
77
92
|
/** Get the normal count */
|
|
@@ -80,74 +95,74 @@ export declare class PolyfaceData {
|
|
|
80
95
|
get paramCount(): number;
|
|
81
96
|
/** Get the color count */
|
|
82
97
|
get colorCount(): number;
|
|
83
|
-
/** Get the index count.
|
|
98
|
+
/** Get the index count. Note that the point array is always indexed, and index arrays all have the same length. */
|
|
84
99
|
get indexCount(): number;
|
|
85
|
-
/**
|
|
100
|
+
/**
|
|
101
|
+
* Get the number of faces.
|
|
86
102
|
* * Note that a "face" is not a facet.
|
|
87
|
-
* * A
|
|
103
|
+
* * A face is a subset of the Polyface's facets grouped for application purposes.
|
|
88
104
|
*/
|
|
89
105
|
get faceCount(): number;
|
|
90
|
-
/**
|
|
91
|
-
getPoint(i: number,
|
|
92
|
-
/**
|
|
93
|
-
getNormal(i: number): Vector3d | undefined;
|
|
94
|
-
/**
|
|
95
|
-
getParam(i: number): Point2d | undefined;
|
|
96
|
-
/**
|
|
106
|
+
/** Return indexed point at index `i`. This is a COPY of the coordinates, not a reference. */
|
|
107
|
+
getPoint(i: number, result?: Point3d): Point3d | undefined;
|
|
108
|
+
/** Return indexed normal at index `i`. This is a COPY of the normal, not a reference. */
|
|
109
|
+
getNormal(i: number, result?: Vector3d): Vector3d | undefined;
|
|
110
|
+
/** Return indexed param at index `i`. This is a COPY of the coordinates, not a reference. */
|
|
111
|
+
getParam(i: number, result?: Point2d): Point2d | undefined;
|
|
112
|
+
/** Return indexed color at index `i`. Index `i` is not checked for validity. */
|
|
97
113
|
getColor(i: number): number;
|
|
98
|
-
/**
|
|
114
|
+
/** Return indexed visibility. at index `i`. Index `i` is not checked for validity. */
|
|
99
115
|
getEdgeVisible(i: number): boolean;
|
|
100
|
-
/**
|
|
116
|
+
/** Get boolean tag indicating if the facets are to be considered viewable from the back. */
|
|
117
|
+
get twoSided(): boolean;
|
|
118
|
+
set twoSided(value: boolean);
|
|
119
|
+
/** Get flag indicating if the mesh closure is unknown (0), open sheet (1), closed solid (2). */
|
|
120
|
+
get expectedClosure(): number;
|
|
121
|
+
set expectedClosure(value: number);
|
|
122
|
+
/** Set the tagged geometry data. */
|
|
123
|
+
setTaggedNumericData(data: TaggedNumericData | undefined): void;
|
|
124
|
+
/** Copy the contents (not pointer) of `point[i]` into `dest`. Index `i` is not checked for validity. */
|
|
101
125
|
copyPointTo(i: number, dest: Point3d): void;
|
|
102
|
-
/** Copy the contents (not pointer) of normal[i] into dest. */
|
|
126
|
+
/** Copy the contents (not pointer) of `normal[i]` into `dest`. Index `i` is not checked for validity. */
|
|
103
127
|
copyNormalTo(i: number, dest: Vector3d): void;
|
|
104
|
-
/** Copy the contents (not pointer) of param[i] into dest. */
|
|
128
|
+
/** Copy the contents (not pointer) of `param[i]` into `dest`. Index `i` is not checked for validity. */
|
|
105
129
|
copyParamTo(i: number, dest: Point2d): void;
|
|
106
|
-
/**
|
|
107
|
-
isAlmostEqualParamIndexUV(
|
|
130
|
+
/** Test if param at a index `i` matches the given uv */
|
|
131
|
+
isAlmostEqualParamIndexUV(i: number, u: number, v: number): boolean;
|
|
108
132
|
/**
|
|
109
|
-
*
|
|
133
|
+
* Copy data from `other` to `this`.
|
|
110
134
|
* * This is the essence of transferring coordinates spread throughout a large polyface into a visitor's single facet.
|
|
111
|
-
* * "other" is the
|
|
112
|
-
* *
|
|
113
|
-
* * does NOT copy face data - visitors reference the FacetFaceData array for the whole polyface!!
|
|
135
|
+
* * Common usage: "other" is a Polyface, "this" is a PolyfaceVisitor to receive data from a single facet of the Polyface.
|
|
136
|
+
* * Does NOT copy face data - visitors reference the FacetFaceData array for the whole polyface.
|
|
114
137
|
* @param other polyface data being mined.
|
|
115
|
-
* @param index0 start index in other's index arrays
|
|
116
|
-
* @param index1 end index (one beyond last data
|
|
138
|
+
* @param index0 start index in other's index arrays.
|
|
139
|
+
* @param index1 end index (one beyond last data accessed) in other's index arrays.
|
|
117
140
|
* @param numWrap number of points to replicate as wraparound.
|
|
118
141
|
*/
|
|
119
142
|
gatherIndexedData(other: PolyfaceData, index0: number, index1: number, numWrap: number): void;
|
|
143
|
+
/** Trim the `data` arrays to the stated `length`. */
|
|
120
144
|
private static trimArray;
|
|
121
145
|
/**
|
|
122
|
-
* Trim all index arrays to the stated length
|
|
123
|
-
* This is called by PolyfaceBuilder to clean up after an aborted construction sequence.
|
|
146
|
+
* Trim all index arrays to the stated `length`.
|
|
147
|
+
* * This is called by PolyfaceBuilder to clean up after an aborted construction sequence.
|
|
124
148
|
*/
|
|
125
149
|
trimAllIndexArrays(length: number): void;
|
|
126
|
-
/**
|
|
150
|
+
/**
|
|
151
|
+
* Resize all data and index arrays to the specified `length`.
|
|
152
|
+
* * This is used by visitors, whose data and index arrays are all parallel.
|
|
153
|
+
*/
|
|
154
|
+
resizeAllArrays(length: number): void;
|
|
155
|
+
/**
|
|
156
|
+
* Resize all data arrays to the specified `length`.
|
|
157
|
+
* @deprecated in 4.x because name is misleading. Call [[PolyfaceData.resizeAllArrays]] instead.
|
|
158
|
+
*/
|
|
127
159
|
resizeAllDataArrays(length: number): void;
|
|
128
|
-
/** Return the range of the point array (optionally transformed) */
|
|
160
|
+
/** Return the range of the point array (optionally transformed). */
|
|
129
161
|
range(result?: Range3d, transform?: Transform): Range3d;
|
|
130
|
-
/**
|
|
131
|
-
*
|
|
132
|
-
* *
|
|
133
|
-
*
|
|
134
|
-
* * hence for "internal" k, facetStartIndex[k] is both the upper limit of facet k-1 and the start of facet k.
|
|
135
|
-
* *
|
|
136
|
-
*/
|
|
137
|
-
reverseIndices(facetStartIndex?: number[]): void;
|
|
138
|
-
/** reverse indices facet-by-facet, with the given facetStartIndex array delimiting faces.
|
|
139
|
-
*
|
|
140
|
-
* * facetStartIndex[0] == 0 always -- start of facet zero.
|
|
141
|
-
* * facet k has indices from facetStartIndex[k] <= i < facetStartIndex[k+1]
|
|
142
|
-
* * hence for "internal" k, facetStartIndex[k] is both the upper limit of facet k-1 and the start of facet k.
|
|
143
|
-
* *
|
|
144
|
-
*/
|
|
145
|
-
reverseIndicesSingleFacet(facetId: number, facetStartIndex: number[]): void;
|
|
146
|
-
/** Scale all the normals by -1 */
|
|
147
|
-
reverseNormals(): void;
|
|
148
|
-
/** Apply `transform` to point and normal arrays and to auxData.
|
|
149
|
-
* * IMPORTANT This base class is just a data carrier. It does not know if the index order and normal directions have special meaning.
|
|
150
|
-
* * i.e. caller must separately reverse index order and normal direction if needed.
|
|
162
|
+
/**
|
|
163
|
+
* Apply `transform` to point and normal arrays and to auxData.
|
|
164
|
+
* * IMPORTANT This base class is just a data carrier. It does not know if the index order and normal directions
|
|
165
|
+
* have special meaning, i.e., caller must separately reverse index order and normal direction if needed.
|
|
151
166
|
*/
|
|
152
167
|
tryTransformInPlace(transform: Transform): boolean;
|
|
153
168
|
/**
|
|
@@ -155,23 +170,59 @@ export declare class PolyfaceData {
|
|
|
155
170
|
* * Search for duplicates within points, normals, params, and colors.
|
|
156
171
|
* * Compress each data array.
|
|
157
172
|
* * Revise all indexing for the relocated data.
|
|
158
|
-
* @param tolerance optional tolerance for clustering mesh vertices. Default is [[Geometry.smallMetricDistance]].
|
|
173
|
+
* @param tolerance (optional) tolerance for clustering mesh vertices. Default is [[Geometry.smallMetricDistance]].
|
|
159
174
|
*/
|
|
160
175
|
compress(tolerance?: number): void;
|
|
161
176
|
/**
|
|
162
|
-
* Test if facetStartIndex is (minimally
|
|
163
|
-
* *
|
|
177
|
+
* Test if `facetStartIndex` is (minimally) valid.
|
|
178
|
+
* * Length must be nonzero (recall that for "no facets", the `facetStartIndex` array still must contain a 0).
|
|
164
179
|
* * Each entry must be strictly smaller than the one that follows.
|
|
165
|
-
* @param facetStartIndex
|
|
180
|
+
* @param facetStartIndex start indices of all facets. Facet k starts at facetStartIndex[k] up to (but not including)
|
|
181
|
+
* `facetStartIndex[k + 1]`
|
|
166
182
|
*/
|
|
167
183
|
static isValidFacetStartIndexArray(facetStartIndex: number[]): boolean;
|
|
168
|
-
/**
|
|
169
|
-
*
|
|
184
|
+
/**
|
|
185
|
+
* Reverse the indices for the specified facets in the given index array.
|
|
186
|
+
* * Parameterized over type T so non-number data (e.g., boolean visibility flags) can be reversed.
|
|
187
|
+
* @param facetStartIndex start indices of *consecutive* facets to be reversed, e.g., an IndexedPolyface's _facetStart
|
|
188
|
+
* array. See the non-static [[reverseIndices]].
|
|
189
|
+
* @param indices the index array, e.g., pointIndex, normalIndex, etc.
|
|
190
|
+
* @param preserveStart `true` to preserve the start index of each facet (e.g., facet [1,2,3,4] becomes [1,4,3,2]);
|
|
191
|
+
* `false` to reverse all indices (e.g., facet [1,2,3,4] becomes [4,3,2,1]).
|
|
170
192
|
*/
|
|
171
193
|
static reverseIndices<T>(facetStartIndex: number[], indices: T[] | undefined, preserveStart: boolean): boolean;
|
|
172
|
-
/**
|
|
173
|
-
*
|
|
194
|
+
/**
|
|
195
|
+
* Reverse the indices for the specified facet in the specified index array.
|
|
196
|
+
* * Parameterized over type T so non-number data (e.g., boolean visibility flags) can be reversed.
|
|
197
|
+
* @param facetIndex index of the facet to reverse. The entries of `indices` to be reversed are found at
|
|
198
|
+
* `facetStartIndex[facetIndex] <= i < facetStartIndex[facetIndex + 1]`.
|
|
199
|
+
* @param facetStartIndex start indices of *consecutive* facets, e.g., an IndexedPolyface's _facetStart array.
|
|
200
|
+
* See [[reverseIndices]].
|
|
201
|
+
* @param indices the index array, e.g., pointIndex, normalIndex, etc.
|
|
202
|
+
* @param preserveStart `true` to preserve the start index of each facet (e.g., facet [1,2,3,4] becomes [1,4,3,2]);
|
|
203
|
+
* `false` to reverse all indices (e.g., facet [1,2,3,4] becomes [4,3,2,1]).
|
|
174
204
|
*/
|
|
175
|
-
static reverseIndicesSingleFacet<T>(
|
|
205
|
+
static reverseIndicesSingleFacet<T>(facetIndex: number, facetStartIndex: number[], indices: T[] | undefined, preserveStart: boolean): boolean;
|
|
206
|
+
/**
|
|
207
|
+
* Reverse the indices for the specified facets in the index arrays (pointIndex, normalIndex, paramIndex, colorIndex,
|
|
208
|
+
* and edgeVisible).
|
|
209
|
+
* @param facetStartIndex start indices of *consecutive* facets to be reversed.
|
|
210
|
+
* * Consecutive indices in this array define where a given facet is represented in each of the parallel index arrays.
|
|
211
|
+
* * The indices for facet k are `facetStartIndex[k]` up to (but not including) `facetStartIndex[k + 1]`.
|
|
212
|
+
* * This implies `facetStartIndex[k + 1]` is both the upper limit of facet k's indices, and the start index of facet k+1.
|
|
213
|
+
* * For example, passing an IndexedPolyface's _facetStart array into this method reverses every facet.
|
|
214
|
+
*/
|
|
215
|
+
reverseIndices(facetStartIndex?: number[]): void;
|
|
216
|
+
/**
|
|
217
|
+
* Reverse the indices for the specified facet in the index arrays (pointIndex, normalIndex, paramIndex, colorIndex,
|
|
218
|
+
* and edgeVisible).
|
|
219
|
+
* @param facetIndex index of the facet to reverse. The entries of each index array to be reversed are found at
|
|
220
|
+
* `facetStartIndex[facetIndex] <= i < facetStartIndex[facetIndex + 1]`.
|
|
221
|
+
* @param facetStartIndex start indices of *consecutive* facets, e.g., an IndexedPolyface's _facetStart array.
|
|
222
|
+
* See [[reverseIndices]].
|
|
223
|
+
*/
|
|
224
|
+
reverseIndicesSingleFacet(facetIndex: number, facetStartIndex: number[]): void;
|
|
225
|
+
/** Scale all the normals by -1. */
|
|
226
|
+
reverseNormals(): void;
|
|
176
227
|
}
|
|
177
228
|
//# sourceMappingURL=PolyfaceData.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PolyfaceData.d.ts","sourceRoot":"","sources":["../../../src/polyface/PolyfaceData.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAClE,OAAO,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AACxD,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AAElE,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAEpD,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"PolyfaceData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