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.

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 duplication of coordinates within points, normals, and params.  
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): Vector3d | undefined return indexed normal.  
getParam(i: number): Point2d | undefined return indexed param.  
getPoint(i: number): Point3d | undefined 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  
trimAllIndexArrays(length: number): void Trim all index arrays to stated length.  
tryTransformInPlace(transform: Transform): boolean Apply transform to point and normal arrays.  
isValidFacetStartIndexArray(facetStartIndex: number[]): boolean Static Test if facetStartIndex is (minimally!) valid:
length must be nonzero (recall that for "no facets" the facetStartIndexArray still must contain a 0)
Each entry must be strictly smaller than the one that follows.
 
reverseIndices<T>(facetStartIndex: number[], indices: T[] | undefined, preserveStart: boolean): boolean Static Reverse data in entire facet indexing arrays.  
reverseIndicesSingleFacet<T>(facetId: number, facetStartIndex: number[], indices: T[] | undefined, preserveStart: boolean): boolean Static Reverse data in entire facet indexing arrays.  

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.  
edgeVisible boolean[] booleans indicating visibility of corresponding edges  
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 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 undefined | GrowableXYArray Coordinates of uv parameters, packed as numbers in a contiguous array.  
paramCount Accessor ReadOnly number Get the param count  
paramIndex number[] | undefined Indics 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.  
twoSided Accessor boolean boolean tag indicating if the facets are viewable from the back  

Defined in

Last Updated: 08 January, 2020