API Reference > geometry-core > Polyface > IndexedPolyfaceSubsetVisitor IndexedPolyfaceSubsetVisitor Class An IndexedPolyfaceSubsetVisitor is an IndexedPolyfaceVisitor which only visits a subset of facets in the polyface. The subset is defined by an array of facet indices provided when this visitor is created. Within the subset visitor, "facetIndex" is understood as index within the subset array: moveToNextFacet moves only within the subset moveToReadIndex(i) moves underlying visitor's parentFacetIndex(i) Extends IndexedPolyfaceVisitor Methods Name Description moveToNextFacet(): boolean Advance the iterator to a the 'next' facet in the client polyface moveToReadIndex(activeIndex: number): boolean Advance the iterator to a particular facet in the client polyface parentFacetIndex(activeIndex: number): undefined | number return the parent facet index of the indicated index within the active facets reset(): void Reset the iterator to start at the first facet of the polyface. createSubsetVisitor(polyface: IndexedPolyface, activeFacetIndices: number[], numWrap: number): IndexedPolyfaceSubsetVisitor Static Create a visitor for iterating a subset of the facets of polyface, with indicated number of points to be added to each facet to produce closed point arrays Inherited methods Name Inherited from Description clearArrays(): void IndexedPolyfaceVisitor clear the contents of all arrays. clientAuxIndex(i: number): number IndexedPolyfaceVisitor Return the aux data index of vertex i within the currently loaded facet clientColorIndex(i: number): number IndexedPolyfaceVisitor Return the color index of vertex i within the currently loaded facet clientNormalIndex(i: number): number IndexedPolyfaceVisitor Return the normal index of vertex i within the currently loaded facet clientParamIndex(i: number): number IndexedPolyfaceVisitor Return the param index of vertex i within the currently loaded facet clientPointIndex(i: number): number IndexedPolyfaceVisitor Return the point index of vertex i within the currently loaded facet clientPolyface(): Polyface IndexedPolyfaceVisitor Return the client polyface object. clone(): PolyfaceData IndexedPolyfaceVisitor Return a depp clone. compress(): void IndexedPolyfaceVisitor * Search for duplication of coordinates within points, normals, and params. copyNormalTo(i: number, dest: Vector3d): void IndexedPolyfaceVisitor Copy the contents (not pointer) of normal[i] into dest. copyParamTo(i: number, dest: Point2d): void IndexedPolyfaceVisitor Copy the contents (not pointer) of param[i] into dest. copyPointTo(i: number, dest: Point3d): void IndexedPolyfaceVisitor Copy the contents (not pointer) of point[i] into dest. currentReadIndex(): number IndexedPolyfaceVisitor Return the index (in the client polyface) of the current facet gatherIndexedData(other: PolyfaceData, index0: number, index1: number, numWrap: number): void IndexedPolyfaceVisitor * Copy data from other to this. getColor(i: number): number IndexedPolyfaceVisitor return indexed color getEdgeVisible(i: number): boolean IndexedPolyfaceVisitor return indexed visibility getNormal(i: number): undefined | Vector3d IndexedPolyfaceVisitor return indexed normal. getParam(i: number): undefined | Point2d IndexedPolyfaceVisitor return indexed param. getPoint(i: number, out?: Point3d): undefined | Point3d IndexedPolyfaceVisitor return indexed point. isAlmostEqual(other: PolyfaceData): boolean IndexedPolyfaceVisitor Test for equal indices and nearly equal coordinates isAlmostEqualParamIndexUV(index: number, u: number, v: number): boolean IndexedPolyfaceVisitor test if normal at a specified index matches uv pushDataFrom(other: PolyfaceVisitor, index: number): void IndexedPolyfaceVisitor transfer data from a specified index of the other visitor as new data in this visitor. pushInterpolatedDataFrom(other: PolyfaceVisitor, index0: number, fraction: number, index1: number): void IndexedPolyfaceVisitor transfer interpolated data from the other visitor. range(result?: Range3d, transform?: Transform): Range3d IndexedPolyfaceVisitor Return the range of the point array (optionally transformed) resizeAllDataArrays(length: number): void IndexedPolyfaceVisitor Resize all data arrays to specified length reverseIndices(facetStartIndex?: number[]): void IndexedPolyfaceVisitor reverse indices facet-by-facet, with the given facetStartIndex array delimiting faces. reverseIndicesSingleFacet(facetId: number, facetStartIndex: number[]): void IndexedPolyfaceVisitor reverse indices facet-by-facet, with the given facetStartIndex array delimiting faces. reverseNormals(): void IndexedPolyfaceVisitor Scale all the normals by -1 setNumWrap(numWrap: number): void IndexedPolyfaceVisitor Set the number of vertices duplicated (e.g. setTaggedNumericData(data: undefined | TaggedNumericData): void IndexedPolyfaceVisitor set the taggedNumericData member trimAllIndexArrays(length: number): void IndexedPolyfaceVisitor Trim all index arrays to stated length. tryGetDistanceParameter(index: number, result?: Point2d): undefined | Point2d IndexedPolyfaceVisitor Attempts to extract the distance parameter for the given vertex index on the current facet tryGetNormalizedParameter(index: number, result?: Point2d): undefined | Point2d IndexedPolyfaceVisitor Attempts to extract the normalized parameter (0,1) for the given vertex index on the current facet. tryTransformInPlace(transform: Transform): boolean IndexedPolyfaceVisitor Apply transform to point and normal arrays and to auxData. create(polyface: IndexedPolyface, numWrap: number): IndexedPolyfaceVisitor Static IndexedPolyfaceVisitor Create a visitor for iterating the facets of polyface, with indicated number of points to be added to each facet to produce closed point arrays isValidFacetStartIndexArray(facetStartIndex: number[]): boolean Static IndexedPolyfaceVisitor Test if facetStartIndex is (minimally!) valid: reverseIndices<T>(facetStartIndex: number[], indices: undefined | T[], preserveStart: boolean): boolean Static IndexedPolyfaceVisitor Reverse data in entire facet indexing arrays. reverseIndicesSingleFacet<T>(facetId: number, facetStartIndex: number[], indices: undefined | T[], preserveStart: boolean): boolean Static IndexedPolyfaceVisitor Reverse data in entire facet indexing arrays. Inherited properties Name Type Inherited from Description auxData undefined | PolyfaceAuxData IndexedPolyfaceVisitor Auxiliary data color undefined | number[] IndexedPolyfaceVisitor Color values. colorCount Accessor ReadOnly number IndexedPolyfaceVisitor Get the color count colorIndex undefined | number[] IndexedPolyfaceVisitor Indices of colors at facet vertices. edgeVisible boolean[] IndexedPolyfaceVisitor booleans indicating visibility of corresponding edges expectedClosure Accessor number IndexedPolyfaceVisitor boolean tag indicating if the facets are viewable from the back face FacetFaceData[] IndexedPolyfaceVisitor Face data will remain empty until a face is specified. faceCount Accessor ReadOnly number IndexedPolyfaceVisitor Get the number of faces.* Note that a "face" is not a facet.* A "face" is a subset of facets grouped for application purposes. indexCount Accessor ReadOnly number IndexedPolyfaceVisitor Get the index count. Note that there is one count, and all index arrays (point, normal, param, color) must match normal undefined | GrowableXYZArray IndexedPolyfaceVisitor Coordinates of normal vectors, packed as numbers in a contiguous array normalCount Accessor ReadOnly number IndexedPolyfaceVisitor Get the normal count normalIndex undefined | number[] IndexedPolyfaceVisitor indices of normals at facet vertices. numEdgesThisFacet Accessor ReadOnly number IndexedPolyfaceVisitor Return the number of edges in the current facet.* Not that if this visitor has numWrap greater than zero, the number of edges is smaller than the number of points. param undefined | GrowableXYArray IndexedPolyfaceVisitor Coordinates of uv parameters, packed as numbers in a contiguous array. paramCount Accessor ReadOnly number IndexedPolyfaceVisitor Get the param count paramIndex undefined | number[] IndexedPolyfaceVisitor Indics of params at facet vertices. point GrowableXYZArray IndexedPolyfaceVisitor Coordinate data for points in the facets, packed as numbers in a contiguous array. pointCount Accessor ReadOnly number IndexedPolyfaceVisitor Get the point count pointIndex number[] IndexedPolyfaceVisitor Indices of points at facet vertices. requireNormals Accessor ReadOnly boolean IndexedPolyfaceVisitor Ask if normals are required in this mesh. taggedNumericData undefined | TaggedNumericData IndexedPolyfaceVisitor Tagged geometry data twoSided Accessor boolean IndexedPolyfaceVisitor boolean tag indicating if the facets are viewable from the back Defined in polyface/IndexedPolyfaceVisitor.ts Line 216 Last Updated: 12 June, 2024