IndexedPolyface Class
An IndexedPolyface is a set of facets which can have normal, param, and color arrays with independent point,
normal, param, and color indices.
Extends
Methods
| Name | Description | |
|---|---|---|
| constructor(data: PolyfaceData, facetStart?: number[], facetToFaceData?: number[]): IndexedPolyface Protected | Constructor for a new polyface. | |
| addColor(color: number): number | Add a color to the color array | |
| addColorIndex(index: number): void | Add a color index. | |
| addIndexedPolyface(source: IndexedPolyface, reversed: boolean, transform: Transform): void | Add facets from source to this polyface. |
|
| addNormal(normal: Vector3d, priorIndexA?: number, priorIndexB?: number): number | Add (a clone of) a normal vector to the normal array. | |
| addNormalIndex(index: number): void | Add a normal index. | |
| addNormalXYZ(x: number, y: number, z: number): number | Add a normal vector to the normal array. | |
| addParam(param: Point2d): number | Add (a clone of) a uv parameter to the parameter array. | |
| addParamIndex(index: number): void | Add a param index. | |
| addParamUV(u: number, v: number, priorIndexA?: number, priorIndexB?: number): number | Add a uv parameter to the parameter array. | |
| addPoint(point: Point3d, priorIndex?: number): number | Add (a clone of) a point to point array. | |
| addPointIndex(index: number, visible: boolean = true): void | Add a point index with edge visibility flag. | |
| addPointXYZ(x: number, y: number, z: number): number | Add a point to point array. | |
| cleanupOpenFacet(): void | Clean up the open facet. | Deprecated |
| clone(): IndexedPolyface | Return a deep clone. | |
| cloneTransformed(transform: Transform): IndexedPolyface | Return a deep clone with transformed points and normals. | |
| createVisitor(numWrap: number = 0): IndexedPolyfaceVisitor | create a visitor for this polyface | |
| dispatchToGeometryHandler(handler: GeometryHandler): any | Second step of double dispatch: call handler.handleIndexedPolyface(this). |
|
| edgeIndexToFaceLoop(k: number): undefined | Range1d | Given an edgeIndex (index into data.pointIndex), return the range of the edgeIndices of the containing facet. |
|
| edgeIndexToFacetIndex(k: number): undefined | number | Given an edgeIndex (index into data.pointIndex), return the index of the facet containing the edge. |
|
| extendRange(range: Range3d, transform?: Transform): void | Extend range with coordinates from this mesh, optionally transformed. |
|
| facetIndex0(facetIndex: number): number | Given a valid facet index, return the index at which its face loop starts in the index arrays. | |
| facetIndex1(facetIndex: number): number | Given a valid facet index, return one past the index at which its face loop ends in the index arrays. | |
| getFaceDataByFacetIndex(facetIndex: number): FacetFaceData | Given the index of a facet, return the data pertaining to the face it is a part of. | Deprecated |
| isAlmostEqual(other: any): boolean | Tests for equivalence between two IndexedPolyfaces. | |
| isSameGeometryClass(other: any): boolean | Test if other is an instance of IndexedPolyface |
|
| isValidFacetIndex(facetIndex: number): boolean | Test if index is a valid facet index. |
|
| numEdgeInFacet(facetIndex: number): number | Return the number of edges in a particular facet. | |
| reverseIndices(): void | Reverse the order of indices around all facets. | |
| reverseNormals(): void | Reverse the direction of all normal vectors. | |
| reverseSingleFacet(facetId: number): void | Reverse indices for a single facet. | |
| setNewFaceData(endFacetIndex: number = 0): boolean | Set new FacetFaceData. | |
| terminateFacet(validateAllIndices: boolean = true): undefined | string[] | Announce the end of construction of a facet. | |
| tryGetFaceData(i: number): undefined | FacetFaceData | Return face data using a facet index. | |
| tryTransformInPlace(transform: Transform): boolean | Transform the mesh. | |
| validateAllIndices(index0: number = 0, errors?: string[]): boolean | Validate (the tail of) the active index arrays: point, normal, param, color. | |
| create(needNormals: boolean = false, needParams: boolean = false, needColors: boolean = false, twoSided: boolean = true): IndexedPolyface Static | Create an empty facet set with coordinate and index data to be supplied later. | |
| hasEdgeMateIndex(polyface: PolyfaceVisitor | Polyface): undefined | { edgeMateIndex: undefined | number[], parent: IndexedPolyface } Static | If the input accesses an edgeMateIndex array, return it along with the owning IndexedPolyface. |
Inherited methods
| Name | Inherited from | Description |
|---|---|---|
| range(transform?: Transform, result?: Range3d): Range3d Inherited | Polyface | Return the range of the entire GeometryQuery tree. |
| tryTranslateInPlace(dx: number, dy: number = 0.0, dz: number = 0.0): boolean Inherited | Polyface | Try to move the geometry by dx,dy,dz. |
| areAlmostEqual(a: GeometryQuery, b: GeometryQuery): boolean Static Inherited | Polyface | Apply instance method isAlmostEqual if both are defined. |
| areIndicesValid(indices: number[], indexPositionA: number, indexPositionB: number, data: any, dataLength: number): boolean Static Inherited | Polyface | Check validity of indices into a data array. |
Properties
| Name | Type | Description | |
|---|---|---|---|
| _facetStart Protected | number[] | Start indices of all facets of the polyface. | |
| _facetToFaceData Protected | number[] | Index to the this.data.face array entry for a specific facet. |
|
| colorCount Accessor ReadOnly | number | Number of colors (read-only property). | |
| faceCount Accessor ReadOnly | number | Number of faces (read-only property). | |
| facetCount Accessor ReadOnly | number | Number of facets (read-only property). | |
| facetStart Accessor ReadOnly | ReadonlyArray |
Return a readonly reference to the facetStart array accessed by facetIndex0 and facetIndex1. | |
| isEmpty Accessor ReadOnly | boolean | Returns true if either the point array or the point index array is empty. | |
| normalCount Accessor ReadOnly | number | Number of normals (read-only property). | |
| paramCount Accessor ReadOnly | number | Number of parameters (read-only property). | |
| pointCount Accessor ReadOnly | number | Number of points (read-only property). | |
| zeroTerminatedIndexCount Accessor ReadOnly | number | Return the total number of indices in zero-terminated style, which includes |
Inherited properties
| Name | Type | Inherited from | Description |
|---|---|---|---|
| children Accessor Inherited ReadOnly | undefined | GeometryQuery[] | Polyface | Return GeometryQuery children for recursive queries. * leaf classes do not need to implement. |
| data Inherited | PolyfaceData | Polyface | Underlying polyface data. |
| expectedClosure Accessor Inherited | number | Polyface | Flag indicating if the mesh closure is unknown (0), open sheet (1), closed solid (2). * A boundary edge of a mesh is defined as an edge with only one connected facet. * Closed solid is a mesh with no boundary edge. Open sheet is a mesh that has boundary edge(s). |
| geometryCategory Readonly Inherited | "polyface" | Polyface | String name for schema properties |
| twoSided Accessor Inherited | boolean | Polyface | The twoSided flag. |
Defined in
- polyface/Polyface.ts Line 110
Last Updated: 28 October, 2025
Found something wrong, missing, or unclear on this page? Raise an issue in our repo.