PolyfaceData Class
PolyfaceData carries data arrays for point, normal, uv-parameters, and color, and index arrays for each.
- Normal, uv-parameter, and color data are optional.
- A given data array is defined if and only if its corresponding index array is defined.
- All defined index arrays have parallel face loop order and structure, and thus the same length.
IndexedPolyfacecarries a PolyfaceData as a member (NOT as a base class; it already hasGeometryQueryas base).IndexedPolyfaceVisitoruses PolyfaceData as a base class. In this use, there is only a single facet inPolyfaceData.PolyfaceDatadoes not know what index range constitutes a given facet. This is managed by a derived/carrier class.
Extended by
Methods
| Name | Description | |
|---|---|---|
| constructor(needNormals: boolean = false, needParams: boolean = false, needColors: boolean = false, twoSided: boolean = true): PolyfaceData | Constructor for facets. | |
| clone(): PolyfaceData | Return a deep clone. | |
| compress(tolerance: number = Geometry.smallMetricDistance): void | Compress the instance by equating duplicate data. | |
| copyNormalTo(i: number, dest: Vector3d): void | Copy the contents (not pointer) of normal[i] into dest. |
|
| copyParamTo(i: number, dest: Point2d): void | Copy the contents (not pointer) of param[i] into dest. |
|
| copyPointTo(i: number, dest: Point3d): void | Copy the contents (not pointer) of point[i] into dest. |
|
| edgeIndexToEdgeMateIndex(k: number): undefined | number | Dereference the edgeMateIndex array. | |
| extendRange(range: Range3d, transform?: Transform): void | Extend range with coordinates from this mesh, optionally transformed. |
|
| gatherIndexedData(other: PolyfaceData, index0: number, index1: number, numWrap: number): void | Copy data from other to this. |
|
| getColor(i: number): number | Return indexed color at index i. |
|
| getEdgeVisible(i: number): boolean | Return indexed visibility. | |
| getNormal(i: number, result?: Vector3d): undefined | Vector3d | Return indexed normal at index i. |
|
| getParam(i: number, result?: Point2d): undefined | Point2d | Return indexed param at index i. |
|
| getPoint(i: number, result?: Point3d): undefined | Point3d | Return indexed point at index i. |
|
| isAlmostEqual(other: PolyfaceData): boolean | Test for equal indices and nearly equal coordinates. | |
| isAlmostEqualParamIndexUV(i: number, u: number, v: number): boolean | Test if param at a index i matches the given uv |
|
| isValidEdgeIndex(value: number): boolean | Test if value is a valid index into the pointIndex array. |
|
| range(result?: Range3d, transform?: Transform): Range3d | Return the range of the point array (optionally transformed). | |
| resizeAllArrays(length: number): void | Resize all data and index arrays to the specified length. |
|
| resizeAllDataArrays(length: number): void | Resize all data arrays to the specified length. |
Deprecated |
| reverseIndices(facetStartIndex?: number[]): void | Reverse the indices for the specified facets in the index arrays (pointIndex, normalIndex, paramIndex, colorIndex, | |
| reverseIndicesSingleFacet(facetIndex: number, facetStartIndex: number[]): void | Reverse the indices for the specified facet in the index arrays (pointIndex, normalIndex, paramIndex, colorIndex, | |
| reverseNormals(): void | Scale all the normals by -1. | |
| setTaggedNumericData(data: TaggedNumericData): void | Set the tagged geometry data. | |
| trimAllIndexArrays(length: number): void | Trim all index arrays to the stated length. |
|
| tryTransformInPlace(transform: Transform): boolean | Apply a transform to the mesh data. | |
| isValidFacetStartIndexArray(facetStartIndex: number[]): boolean Static | Test if facetStartIndex is (minimally) valid. |
|
| reverseIndices<T>(facetStartIndex: number[], indices: T[], preserveStart: boolean): boolean Static | Reverse the indices for the specified facets in the given index array. | |
| reverseIndicesSingleFacet<T>(facetIndex: number, facetStartIndex: number[], indices: T[], preserveStart: boolean): boolean Static | Reverse the indices for the specified facet in the specified index array. |
Properties
| Name | Type | Description | |
|---|---|---|---|
| auxData | PolyfaceAuxData | undefined | Auxiliary data. | |
| color | number[] | undefined | Color values. | |
| colorCount Accessor ReadOnly | number | Get the color count | |
| colorIndex | number[] | undefined | Indices of colors at facet vertices. | |
| edgeMateIndex | undefined | number[] | undefined | Optional index array for moving "across an edge" to an adjacent facet. | |
| edgeVisible | boolean[] | Booleans indicating visibility of corresponding edges. | |
| expectedClosure Accessor | number | Get flag indicating if the mesh closure is unknown (0), open sheet (1), closed solid (2). | |
| expectedClosure Setter | expectedClosure(value: number): void | ||
| face | FacetFaceData[] | Map from facet index to face data. | |
| faceCount Accessor ReadOnly | number | Get the number of faces. | |
| indexCount Accessor ReadOnly | number | Get the index count. | |
| normal | GrowableXYZArray | undefined | Coordinates of normal vectors (packed as numbers in a contiguous array). | |
| normalCount Accessor ReadOnly | number | Get the normal count | |
| normalIndex | number[] | undefined | Indices of normals at facet vertices. | |
| param | GrowableXYArray | undefined | Coordinates of uv parameters (packed as numbers in a contiguous array). | |
| paramCount Accessor ReadOnly | number | Get the param count | |
| paramIndex | number[] | undefined | Indices of params at facet vertices. | |
| point | GrowableXYZArray | Coordinate data for points in the facets (packed as numbers in a contiguous array). | |
| pointCount Accessor ReadOnly | number | Get the point count | |
| pointIndex | number[] | Indices of points at facet vertices. | |
| requireColors Accessor ReadOnly | boolean | Ask if colors are required in this mesh. | |
| requireNormals Accessor ReadOnly | boolean | Ask if normals are required in this mesh. | |
| requireParams Accessor ReadOnly | boolean | Ask if params are required in this mesh. | |
| taggedNumericData | TaggedNumericData | undefined | Tagged geometry data. | |
| twoSided Accessor | boolean | Boolean flag indicating if the facets are viewable from the back. | |
| twoSided Setter | twoSided(value: boolean): void |
Defined in
- polyface/PolyfaceData.ts Line 35
Last Updated: 28 October, 2025
Found something wrong, missing, or unclear on this page? Raise an issue in our repo.