PolyfaceQuery Class

PolyfaceQuery is a static class whose methods implement queries on a polyface or polyface visitor provided as a parameter to each method.

Methods

Name Description
constructor(): PolyfaceQuery    
announceBoundaryChainsAsLineString3d(mesh: Polyface | PolyfaceVisitor, announceLoop: (points: LineString3d) => void): void Static Search for edges with only 1 incident facet.  
announceBoundaryEdges(source: undefined | Polyface | PolyfaceVisitor, announceEdge: (pointA: Point3d, pointB: Point3d, indexA: number, indexB: number, facetIndex: number) => void, includeDanglers: boolean = true, includeMismatch: boolean = true, includeNull: boolean = true): void Static Test if the facets in source occur in perfectly mated pairs, as is required for a closed manifold volume.  
announceDuplicateFacetIndices(polyface: Polyface, announceCluster: (clusterFacetIndices: number[]) => void): void Static * Return an array of arrays describing facet duplication.  
announceSweepLinestringToConvexPolyfaceXY(linestringPoints: GrowableXYZArray, polyface: Polyface, announce: AnnounceDrapePanel): any Static Find segments (within the linestring) which project to facets.  
asyncSweepLinestringToFacetsXYReturnChains(linestringPoints: GrowableXYZArray, polyface: Polyface): Promise<LineString3d[]> Static Find segments (within the linestring) which project to facets.  
boundaryEdges(source: undefined | Polyface | PolyfaceVisitor, includeDanglers: boolean = true, includeMismatch: boolean = true, includeNull: boolean = true): undefined | CurveCollection Static construct a CurveCollection containing boundary edges.  
boundaryOfVisibleSubset(polyface: IndexedPolyface, visibilitySelect: | "1" | "2", vectorToEye: Vector3d, sideAngleTolerance: Angle = ...): undefined | CurveCollection Static Return the boundary of facets that are facing the eye.  
buildAverageNormals(polyface: IndexedPolyface, toleranceAngle: Angle = ...): void Static * At each vertex of the mesh  
buildPerFaceNormals(polyface: IndexedPolyface): void Static Set up indexed normals with one normal in the plane of each facet of the mesh.  
cloneByFacetDuplication(source: Polyface, includeSingletons: boolean, clusterSelector: DuplicateFacetClusterSelector): Polyface Static Return a new facet set with a subset of facets in source  
cloneFiltered(source: Polyface | PolyfaceVisitor, filter: (visitor: PolyfaceVisitor) => boolean): Polyface Static Clone facets that pass an filter function  
clonePartitions(polyface: Polyface | PolyfaceVisitor, partitions: number[][]): Polyface[] Static Clone the facets in each partition to a separate polyface.  
cloneWithColinearEdgeFixup(polyface: Polyface): Polyface Static Clone the facets, inserting removing points that are simply within colinear edges.  
cloneWithMaximalPlanarFacets(mesh: IndexedPolyface): undefined | IndexedPolyface Static Return a mesh with  
cloneWithTVertexFixup(polyface: Polyface): IndexedPolyface Static Clone the facets, inserting vertices (within edges) where points not part of each facet's vertex indices impinge within edges.  
collectDuplicateFacetIndices(polyface: Polyface, includeSingletons: boolean = false): number[][] Static * Return an array of arrays describing facet duplication.  
collectRangeLengthData(polyface: Polyface | PolyfaceVisitor): RangeLengthData Static * Examine ranges of facets.  
computeFacetUnitNormal(visitor: PolyfaceVisitor, facetIndex: number, result?: Vector3d): undefined | Vector3d Static Try to compute a unit normal for a facet accessible through a visitor.  
computePrincipalAreaMoments(source: Polyface): undefined | MomentData Static Compute area moments for the mesh.  
computePrincipalVolumeMoments(source: Polyface): undefined | MomentData Static Compute area moments for the mesh.  
createIndexedEdges(polyface: Polyface | PolyfaceVisitor): IndexedEdgeMatcher Static Load all half edges from a mesh to an IndexedEdgeMatcher.  
fillSimpleHoles(mesh: PolyfaceVisitor | IndexedPolyface, options: HoleFillOptions, unfilledChains?: LineString3d[]): undefined | IndexedPolyface Static Return a mesh with "some" holes filled in with new facets.  
indexedPolyfaceToLoops(polyface: Polyface): BagOfCurves Static Create a linestring loop for each facet of the polyface.  
isPolyfaceClosedByEdgePairing(source: Polyface): boolean Static Test if the facets in source occur in perfectly mated pairs, as is required for a closed manifold volume.  
isPolyfaceManifold(source: Polyface, allowSimpleBoundaries: boolean = false): boolean Static Test edges pairing in source mesh.  
markAllEdgeVisibility(mesh: IndexedPolyface, value: boolean): void Static * Mark all edge visibilities in the IndexedPolyface  
markPairedEdgesInvisible(mesh: IndexedPolyface, sharpEdgeAngle?: Angle): void Static * Find mated pairs among facet edges.  
partitionFacetIndicesByEdgeConnectedComponent(polyface: Polyface | PolyfaceVisitor, stopAtVisibleEdges: boolean = false): number[][] Static Search the facets for facet subsets that are connected with at least edge contact.  
partitionFacetIndicesByVertexConnectedComponent(polyface: Polyface | PolyfaceVisitor): number[][] Static Search the facets for facet subsets that are connected with at least vertex contact.  
partitionFacetIndicesByVisibilityVector(polyface: Polyface | PolyfaceVisitor, vectorToEye: Vector3d, sideAngleTolerance: Angle): number[][] Static * Examine the normal orientation for each faces.  
reorientVertexOrderAroundFacetsForConsistentOrientation(mesh: IndexedPolyface): boolean Static * Examine adjacent facet orientations throughout the mesh  
setSingleEdgeVisibility(polyface: IndexedPolyface, facetIndex: number, vertexIndex: number, value: boolean): void Static Set the visibility of a particular edge of a particular facet.  
sumFacetAreas(source: undefined | Polyface | PolyfaceVisitor, vectorToEye?: Vector3d): number Static Return the sum of all facet areas.  
sumFacetSecondAreaMomentProducts(source: Polyface | PolyfaceVisitor, origin: Point3d): Matrix4d Static Return the inertia products [xx,xy,xz,xw, yw, etc] integrated over all all facets, as viewed from origin.  
sumFacetSecondVolumeMomentProducts(source: Polyface | PolyfaceVisitor, origin: Point3d): Matrix4d Static Return the inertia products [xx,xy,xz,xw, yw, etc] integrated over all tetrahedral volumes from origin  
sumTetrahedralVolumes(source: Polyface | PolyfaceVisitor, origin?: Point3d): number Static sum volumes of tetrahedra from origin to all facets.  
sumVolumeBetweenFacetsAndPlane(source: Polyface | PolyfaceVisitor, plane: Plane3dByOriginAndUnitNormal): FacetProjectedVolumeSums Static sum (signed) volumes between facets and a plane.  
sweepLinestringToFacetsXYReturnChains(linestringPoints: GrowableXYZArray, polyface: Polyface): LineString3d[] Static Find segments (within the linestring) which project to facets.  
sweepLinestringToFacetsXYReturnLines(linestringPoints: GrowableXYZArray, polyface: Polyface): LineSegment3d[] Static Find segments (within the linestring) which project to facets.  
sweepLinestringToFacetsXYreturnSweptFacets(linestringPoints: GrowableXYZArray, polyface: Polyface): Polyface Static Find segments (within the linestring) which project to facets.  
visitorToLoop(visitor: PolyfaceVisitor): Loop Static copy the points from a visitor into a Linestring3d in a Loop object  

Defined in

Last Updated: 11 November, 2022