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 | |
addColorIndex(index: number): void | Add a color index | |
addIndexedPolyface(source: IndexedPolyface, reversed: boolean, transform: undefined | Transform): void | * Add facets from source to this polyface. | |
addNormal(normal: Vector3d, priorIndexA?: number, priorIndexB?: number): number | Add a normal vector | |
addNormalIndex(index: number): void | Add a normal index | |
addNormalXYZ(x: number, y: number, z: number): number | Add a normal vector given by direct coordinates | |
addParam(param: Point2d): number | Add a uv param. | |
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. | |
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. | |
cleanupOpenFacet(): void | clean up the open facet. | |
clone(): IndexedPolyface | Return a deep clone. | |
cloneTransformed(transform: Transform): IndexedPolyface | Return a deep clone with transformed points and normals | |
createVisitor(numWrap: number = 0): PolyfaceVisitor | 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. | |
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: number = 0): boolean | All terminated facets since the last face declaration will be mapped to a single new FacetFaceData object | |
terminateFacet(validateAllIndices: boolean = true): any | announce the end of construction of a facet. | |
tryGetFaceData(i: number): undefined | FacetFaceData | return face data using a facet index. | |
tryTransformInPlace(transform: Transform): boolean | * apply the transform to points | |
create(needNormals: boolean = false, needParams: boolean = false, needColors: boolean = false, twoSided: boolean = false): 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: number = 0.0, dz: number = 0.0): boolean | Polyface | Try to move the geometry by dx,dy,dz |
areAlmostEqual(a: undefined | GeometryQuery, b: undefined | GeometryQuery): boolean Static | Polyface | Apply instance method Polyface.isAlmostEqual if both are defined. |
areIndicesValid(indices: undefined | number[], indexPositionA: number, indexPositionB: number, data: any, dataLength: number): boolean Static | Polyface | Check validity of indices into a data array. |
Properties
Name | Type | Description | |
---|---|---|---|
_facetStart Protected | number[] | * index to the index array entries for a specific facet. | |
_facetToFaceData Protected | number[] | * For facet i, _facetToFaceData[i] is the index of the faceData entry for the facet. | |
colorCount Accessor ReadOnly | number | (read-only property) number of colors | |
faceCount Accessor ReadOnly | number | (read-only property) number of faces | |
facetCount Accessor ReadOnly | number | (read-only property) number of facets | |
isEmpty Accessor ReadOnly | boolean | Returns true if either the point array or the point index array is empty. | |
normalCount Accessor ReadOnly | number | (read-only property) number of normals | |
paramCount Accessor ReadOnly | number | (read-only property) number of parameters | |
pointCount Accessor ReadOnly | number | (read-only property) number of points | |
zeroTerminatedIndexCount Accessor ReadOnly | number | Return the total number of param indices in zero-terminated style, which includes |
Inherited properties
Name | Type | Inherited from | Description |
---|---|---|---|
children Accessor ReadOnly | undefined | GeometryQuery[] | Polyface | Return GeometryQuery children for recursive queries. * leaf classes do not need to implement. |
data | PolyfaceData | Polyface | Underlying polyface data. |
expectedClosure Accessor | number | Polyface | Flag indicating if the mesh closure is unknown (0), open sheet (1), closed (2) |
geometryCategory Readonly | "polyface" | Polyface | String name for schema properties |
twoSided Accessor | boolean | Polyface | Flag indicating if the mesh display must assume both sides are visible. |
Defined in
- polyface/Polyface.ts Line 88
Last Updated: 15 March, 2024
Found something wrong, missing, or unclear on this page?
Raise an issue in our repo.