PolyfaceData Class
PolyfaceData carries data arrays for point, normal, param, color and their indices.
- IndexedPolyface carries a PolyfaceData as a member. (NOT as a base class -- it already has GeometryQuery as base)
- IndexedPolyfaceVisitor uses PolyfaceData as a base class. In this use there is only a single facet in the polyfaceData.
- PolyfaceData does not know (!!!) what indices range constitute a facet. That is managed by derived class or carrier class.
Extended by
Methods
| Name | Description | |
|---|---|---|
| constructor(needNormals: boolean = false, needParams: boolean = false, needColors: boolean = false, twoSided: boolean = false): PolyfaceData | Constructor for facets. | |
| clone(): PolyfaceData | Return a depp clone. | |
| compress(): void | * Search for duplicates within points, normals, params, and colors. | |
| 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. | |
| gatherIndexedData(other: PolyfaceData, index0: number, index1: number, numWrap: number): void | * Copy data from other to this. | |
| getColor(i: number): number | return indexed color | |
| getEdgeVisible(i: number): boolean | return indexed visibility | |
| getNormal(i: number): undefined | Vector3d | return indexed normal. | |
| getParam(i: number): undefined | Point2d | return indexed param. | |
| getPoint(i: number, out?: Point3d): undefined | Point3d | return indexed point. | |
| isAlmostEqual(other: PolyfaceData): boolean | Test for equal indices and nearly equal coordinates | |
| isAlmostEqualParamIndexUV(index: number, u: number, v: number): boolean | test if normal at a specified index matches uv | |
| range(result?: Range3d, transform?: Transform): Range3d | Return the range of the point array (optionally transformed) | |
| resizeAllDataArrays(length: number): void | Resize all data arrays to specified length | |
| reverseIndices(facetStartIndex?: number[]): void | reverse indices facet-by-facet, with the given facetStartIndex array delimiting faces. | |
| reverseIndicesSingleFacet(facetId: number, facetStartIndex: number[]): void | reverse indices facet-by-facet, with the given facetStartIndex array delimiting faces. | |
| reverseNormals(): void | Scale all the normals by -1 | |
| setTaggedNumericData(data: undefined | TaggedNumericData): void | set the taggedNumericData member |
|
| trimAllIndexArrays(length: number): void | Trim all index arrays to stated length. | |
| tryTransformInPlace(transform: Transform): boolean | Apply transform to point and normal arrays and to auxData. |
|
| isValidFacetStartIndexArray(facetStartIndex: number[]): boolean Static | Test if facetStartIndex is (minimally!) valid: | |
| reverseIndices<T>(facetStartIndex: number[], indices: undefined | T[], preserveStart: boolean): boolean Static | Reverse data in entire facet indexing arrays. | |
| reverseIndicesSingleFacet<T>(facetId: number, facetStartIndex: number[], indices: undefined | T[], preserveStart: boolean): boolean Static | Reverse data in entire facet indexing arrays. |
Properties
| Name | Type | Description | |
|---|---|---|---|
| auxData | undefined | PolyfaceAuxData | Auxiliary data | |
| color | undefined | number[] | Color values. | |
| colorCount Accessor ReadOnly | number | Get the color count | |
| colorIndex | undefined | number[] | Indices of colors at facet vertices. | |
| edgeVisible | boolean[] | booleans indicating visibility of corresponding edges | |
| expectedClosure Accessor | number | boolean tag indicating if the facets are viewable from the back | |
| face | FacetFaceData[] | Face data will remain empty until a face is specified. | |
| faceCount Accessor ReadOnly | number | Get the number of faces. | |
| indexCount Accessor ReadOnly | number | Get the index count. | |
| normal | undefined | GrowableXYZArray | Coordinates of normal vectors, packed as numbers in a contiguous array | |
| normalCount Accessor ReadOnly | number | Get the normal count | |
| normalIndex | undefined | number[] | indices of normals at facet vertices. | |
| param | undefined | GrowableXYArray | Coordinates of uv parameters, packed as numbers in a contiguous array. | |
| paramCount Accessor ReadOnly | number | Get the param count | |
| paramIndex | undefined | number[] | 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. | |
| requireNormals Accessor ReadOnly | boolean | Ask if normals are required in this mesh. | |
| taggedNumericData | undefined | TaggedNumericData | Tagged geometry data | |
| twoSided Accessor | boolean | boolean tag indicating if the facets are viewable from the back |
Defined in
- polyface/PolyfaceData.ts Line 31
Last Updated: 30 November, 2023