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: booleantrue): 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: number0): IndexedPolyfaceVisitor | Create a visitor for this polyface | |
dispatchToGeometryHandler(handler: GeometryHandler): any | Second step of double dispatch: call handler.handleIndexedPolyface(this) . |
|
extendRange(range: Range3d, transform?: Transform): void | Extend range with coordinates from this mesh. |
|
facetIndex0(index: number): number | ASSUME valid facet index. | |
facetIndex1(index: number): number | ASSUME valid facet index. | |
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(index: number): boolean | Test if index is a valid facet index. |
|
numEdgeInFacet(facetIndex: number): number | Return the number of edges in a particular facet. | |
range(transform?: Transform, result?: Range3d): Range3d | Return the range of (optionally transformed) points in this mesh. | |
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: number0): boolean | Set new FacetFaceData. | |
terminateFacet(validateAllIndices: booleantrue): 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: number0, errors?: string[]): boolean | Validate (the tail of) the active index arrays: point, normal, param, color. | |
create(needNormals: booleanfalse, needParams: booleanfalse, needColors: booleanfalse, twoSided: booleanfalse): IndexedPolyface Static | Create an empty facet set with coordinate and index data to be supplied later. |
Inherited methods
Name | Inherited from | Description |
---|---|---|
tryTranslateInPlace(dx: number, dy: number0.0, dz: number0.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). | |
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 | Flag indicating if the mesh display must assume both sides are visible. |
Defined in
- polyface/Polyface.ts Line 108
Last Updated: 21 November, 2024
Found something wrong, missing, or unclear on this page?Raise an issue in our repo.