PolyfaceQuery Class
PolyfaceQuery is a static class whose methods implement queries on a Polyface or PolyfaceVisitor provided as a
parameter to each method.
Methods
| Name | Description | |
|---|---|---|
| constructor(): PolyfaceQuery | ||
| announceBoundaryChainsAsLineString3d(source: PolyfaceVisitor | Polyface, announceChain: (points: LineString3d) => void): void Static | Announce boundary edges of the facet set as linestrings. | |
| announceBoundaryEdges(source: PolyfaceVisitor | Polyface, announceEdge: (pointA: Point3d, pointB: Point3d, indexA: number, indexB: number, facetIndex: number) => void, includeTypical: boolean = true, includeMismatch: boolean = true, includeNull: boolean = true): void Static | Announce boundary edges of the facet set as line segments. | |
| announceDuplicateFacetIndices(polyface: Polyface, announceCluster: (clusterFacetIndices: number[]) => void): void Static | Announce facet duplicates. | |
| announceSilhouetteEdges(source: PolyfaceVisitor | Polyface, announce: (pointA: Point3d, pointB: Point3d, vertexIndexA: number, vertexIndexB: number, facetIndex: number) => void, vectorToEye: Vector3d, sideAngle: Angle = ...): void Static | Invoke the callback on each manifold edge whose adjacent facet normals form vectorToEye dot products | |
| announceSweepLinestringToConvexPolyfaceXY(linestringPoints: IndexedXYZCollection, polyface: Polyface, announce: AnnounceDrapePanel): void Static | Find segments (within the linestring) which project to facets. | |
| areFacetsConvex(source: PolyfaceVisitor | Polyface): boolean Static | Determine whether all facets are convex. | |
| asyncSweepLinestringToFacetsXYReturnChains(linestringPoints: IndexedXYZCollection, polyface: Polyface): Promise<LineString3d[]> Static | Find segments (within the linestring) which project to facets. | |
| boundaryEdges(source: PolyfaceVisitor | Polyface, includeTypical: boolean = true, includeMismatch: boolean = true, includeNull: boolean = true): undefined | CurveCollection Static | Collect boundary edges of the facet set as an unordered collection of line segments. | |
| boundaryOfVisibleSubset(source: PolyfaceVisitor | Polyface, visibilitySelect: "0" | "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 from the source facets, specifying how to copy duplicate facets. | |
| cloneFiltered(source: PolyfaceVisitor | Polyface, filter: (visitor: PolyfaceVisitor) => boolean): IndexedPolyface Static | Clone facets that pass a filter function. | |
| cloneOffset(source: IndexedPolyface, signedOffsetDistance: number, offsetOptions: OffsetMeshOptions = ...): IndexedPolyface Static | Offset the faces of the mesh. | |
| clonePartitions(polyface: PolyfaceVisitor | Polyface, partitions: number[][]): IndexedPolyface[] Static | Clone the facets in each partition to a separate polyface. | |
| cloneWithColinearEdgeFixup(polyface: Polyface): Polyface Static | Clone the facets, removing points that are simply within colinear edges. | |
| cloneWithDanglingEdgesRemoved(source: PolyfaceVisitor | Polyface): IndexedPolyface Static | Clone the facets with in-facet dangling edges removed. | |
| cloneWithMaximalPlanarFacets(mesh: PolyfaceVisitor | Polyface, maxSmoothEdgeAngle?: Angle): 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 | |
| collectBoundaryEdges(source: PolyfaceVisitor | Polyface, includeTypical: boolean = true, includeMismatch: boolean = true, includeNull: boolean = true): undefined | AnyChain Static | Collect boundary edges of the facet set as the simplest collection of chains of line segments. | |
| collectDuplicateFacetIndices(polyface: Polyface, includeSingletons: boolean = false): number[][] Static | Collect facet duplicates. | |
| collectEdgesByDihedralAngle(mesh: PolyfaceVisitor | Polyface, maxSmoothEdgeAngle?: Angle, sharpEdges: boolean = false): SortableEdgeCluster[] Static | Return manifold edge pairs whose dihedral angle is bounded by the given angle. | |
| collectRangeLengthData(polyface: PolyfaceVisitor | Polyface): RangeLengthData Static | Examine ranges of facets. | |
| collectSilhouetteEdges(source: PolyfaceVisitor | Polyface, vectorToEye: Vector3d, sideAngle: Angle = ...): undefined | AnyChain Static | Collect manifold edges whose adjacent facet normals form vectorToEye dot products with opposite sign. | |
| 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: PolyfaceVisitor | Polyface): IndexedEdgeMatcher Static | Load an IndexedEdgeMatcher from the edges of a mesh. | |
| dihedralAngleSummary(source: PolyfaceVisitor | Polyface, ignoreBoundaries: boolean = false): number Static | Compute a number summarizing the dihedral angles in the mesh. | |
| fillSimpleHoles(mesh: PolyfaceVisitor | Polyface, options: HoleFillOptions, unfilledChains?: LineString3d[]): undefined | IndexedPolyface Static | Return a mesh with "some" holes filled in with new facets. | |
| getSingleEdgeVisibility(polyface: IndexedPolyface, facetIndex: number, vertexIndex: number): undefined | boolean Static | Get the visibility of a particular edge of a particular facet. | |
| indexedPolyfaceToLoops(polyface: Polyface): BagOfCurves Static | Create a linestring loop for each facet of the polyface. | |
| intersectRay3d(visitor: PolyfaceVisitor | Polyface, ray: Ray3d, options?: FacetIntersectOptions): undefined | FacetLocationDetail Static | Search facets for the first one that intersects the infinite line. | |
| isConvexByDihedralAngleCount(source: PolyfaceVisitor | Polyface, ignoreBoundaries: boolean = false): boolean Static | Test for convex volume by dihedral angle tests on all edges. | |
| isPolyfaceClosedByEdgePairing(source: PolyfaceVisitor | Polyface): boolean Static | Test if the facets in source occur in perfectly mated pairs, as is required for a closed manifold volume. |
|
| isPolyfaceManifold(source: PolyfaceVisitor | Polyface, allowSimpleBoundaries: boolean = false): boolean Static | Test edge pairing in source mesh. |
|
| isSubsetVisitor(visitor: PolyfaceVisitor | Polyface): boolean Static | Helper function to detect a subset visitor. | |
| markAllEdgeVisibility(mesh: IndexedPolyface, value: boolean): void Static | * Mark all edge visibilities in the IndexedPolyface. | |
| markPairedEdgesInvisible(mesh: IndexedPolyface, sharpEdgeAngle?: Angle): void Static | Make paired edges invisible. | |
| partitionFacetIndicesByEdgeConnectedComponent(polyface: PolyfaceVisitor | Polyface, stopAtVisibleEdges: boolean = false): number[][] Static | Partition the facet set into connected components. | |
| partitionFacetIndicesByVertexConnectedComponent(polyface: PolyfaceVisitor | Polyface): number[][] Static | Search the facets for facet subsets that are connected with at least vertex contact. | |
| partitionFacetIndicesByVisibilityVector(polyface: PolyfaceVisitor | Polyface, 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: PolyfaceVisitor | Polyface, vectorToEye?: Vector3d): number Static | Sum all facet areas. | |
| sumFacetSecondAreaMomentProducts(source: PolyfaceVisitor | Polyface, 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: PolyfaceVisitor | Polyface, origin: Point3d): Matrix4d Static | Return the inertia products [xx,xy,xz,xw,yw, etc] integrated over all tetrahedral volumes from origin. | |
| sumTetrahedralVolumes(source: PolyfaceVisitor | Polyface, origin?: Point3d): number Static | Sum volumes of tetrahedra from origin to all facets. | |
| sumVolumeBetweenFacetsAndPlane(source: PolyfaceVisitor | Polyface, plane: Plane3d, skipMoments?: boolean): FacetProjectedVolumeSums Static | Sum (signed) volumes between facets and a plane. | |
| sweepLineStringToFacets(points: IndexedXYZCollection, source: PolyfaceVisitor | Polyface, options?: SweepLineStringToFacetsOptions): LinearCurvePrimitive[] Static | Sweep the line string to intersections with a mesh and return collected line segments. | |
| sweepLineStringToFacetsXY(points: IndexedXYZCollection | Point3d[], source: PolyfaceVisitor | Polyface, searcher: Range2dSearchInterface<number>): LineString3d[] Static | Sweep the line string in the z-direction to intersections with a mesh, using a search object for speedup. | |
| sweepLinestringToFacetsXYReturnChains(linestringPoints: GrowableXYZArray, polyface: Polyface): LineString3d[] Static | Find segments (within the linestring) which project to facets. | Deprecated |
| sweepLinestringToFacetsXYReturnLines(linestringPoints: GrowableXYZArray, polyface: Polyface): LineSegment3d[] Static | Find segments (within the linestring) which project to facets. | Deprecated |
| sweepLinestringToFacetsXYreturnSweptFacets(linestringPoints: GrowableXYZArray, polyface: Polyface): Polyface Static | Deprecated | |
| sweepLineStringToFacetsXYReturnSweptFacets(lineStringPoints: IndexedXYZCollection, polyface: Polyface): Polyface Static | Find segments (within the line string) which project to facets. | |
| visitorClientFacetCount(source: PolyfaceVisitor | Polyface): number Static | Return the facet count of the source. |
|
| visitorClientPointCount(source: PolyfaceVisitor | Polyface): number Static | Return the point count of the source. |
|
| visitorToLoop(visitor: PolyfaceVisitor): Loop Static | Copy the points from a visitor into a linestring loop. |
Defined in
- polyface/PolyfaceQuery.ts Line 307
Last Updated: 28 October, 2025
Found something wrong, missing, or unclear on this page? Raise an issue in our repo.