Skip to main content

FaceFilter

Creates a new face filter builder for selecting faces by geometric properties.

import { face } from 'fluidcad/filters';

Methods

.onPlane()

.onPlane(plane: PlaneLike, offset?: number): this

Selects faces that lie on the given plane.

ParameterTypeDescription
planePlaneLikeThe reference plane.
offsetnumberOptional distance to offset the plane before matching. (optional)

.notOnPlane()

.notOnPlane(plane: PlaneLike, offset?: number): this

Excludes faces that lie on the given plane.

ParameterTypeDescription
planePlaneLikeThe reference plane.
offsetnumberOptional distance to offset the plane before matching. (optional)

.circle()

.circle(diameter?: number): this

Selects circular (flat, disc-shaped) faces, optionally matching a specific diameter.

ParameterTypeDescription
diameternumberOptional diameter to match. (optional)

.notCircle()

.notCircle(diameter?: number): this

Excludes circular (flat, disc-shaped) faces, optionally matching a specific diameter.

ParameterTypeDescription
diameternumberOptional diameter to exclude. (optional)

.cylinder()

.cylinder(diameter?: number): this

Selects cylindrical faces, optionally matching a specific diameter.

ParameterTypeDescription
diameternumberOptional diameter to match. (optional)

.notCylinder()

.notCylinder(diameter?: number): this

Excludes cylindrical faces, optionally matching a specific diameter.

ParameterTypeDescription
diameternumberOptional diameter to exclude. (optional)

.cylinderCurve()

.cylinderCurve(diameter?: number): this

Selects faces bounded by cylindrical curves, optionally matching a specific diameter.

ParameterTypeDescription
diameternumberOptional diameter to match. (optional)

.notCylinderCurve()

.notCylinderCurve(diameter?: number): this

Excludes faces bounded by cylindrical curves, optionally matching a specific diameter.

ParameterTypeDescription
diameternumberOptional diameter to exclude. (optional)

.parallelTo()

.parallelTo(plane: PlaneLike): this

Selects faces whose normal is parallel to the given plane.

ParameterTypeDescription
planePlaneLikeThe reference plane.

.notParallelTo()

.notParallelTo(plane: PlaneLike): this

Excludes faces whose normal is parallel to the given plane.

ParameterTypeDescription
planePlaneLikeThe reference plane.

.torus()

.torus(majorRadius?: number, minorRadius?: number): this

Selects toroidal faces, optionally matching major and/or minor radius.

ParameterTypeDescription
majorRadiusnumberOptional radius from the torus axis to the tube center. (optional)
minorRadiusnumberOptional radius of the tube itself. (optional)

.notTorus()

.notTorus(majorRadius?: number, minorRadius?: number): this

Excludes toroidal faces, optionally matching major and/or minor radius.

ParameterTypeDescription
majorRadiusnumberOptional radius from the torus axis to the tube center. (optional)
minorRadiusnumberOptional radius of the tube itself. (optional)

.planar()

.planar(): this

Selects planar (flat) faces.

.notPlanar()

.notPlanar(): this

Excludes planar (flat) faces.


.cone()

.cone(): this

Selects conical faces.

.notCone()

.notCone(): this

Excludes conical faces.


.intersectsWith()

.intersectsWith(plane: PlaneLike): this

Selects faces that intersect with the given plane.

ParameterTypeDescription
planePlaneLikeThe reference plane to test intersection against.

.notIntersectsWith()

.notIntersectsWith(plane: PlaneLike): this

Excludes faces that intersect with the given plane.

ParameterTypeDescription
planePlaneLikeThe reference plane to test intersection against.

.hasEdge()

.hasEdge(...args: any[][]): this
ParameterTypeDescription
...argsany[](optional)

.notHasEdge()

.notHasEdge(...args: any[][]): this
ParameterTypeDescription
...argsany[](optional)

.edgeCount()

.edgeCount(count: number): this

Selects faces with exactly the given number of edges.

ParameterTypeDescription
countnumberThe exact number of edges to match.

.notEdgeCount()

.notEdgeCount(count: number): this

Excludes faces with the given number of edges.

ParameterTypeDescription
countnumberThe number of edges to exclude.

.above()

.above(plane: PlaneLike, offsetOrOptions?: number | { offset?: number; partial?: boolean; }): this

Selects faces that are entirely above the given plane (in the direction of its normal).

ParameterTypeDescription
planePlaneLikeThe reference plane.
offsetOrOptionsnumber | { offset?: number; partial?: boolean; }Offset distance, or an options object with offset and partial. (optional)

.below()

.below(plane: PlaneLike, offsetOrOptions?: number | { offset?: number; partial?: boolean; }): this

Selects faces that are entirely below the given plane (opposite to its normal direction).

ParameterTypeDescription
planePlaneLikeThe reference plane.
offsetOrOptionsnumber | { offset?: number; partial?: boolean; }Offset distance, or an options object with offset and partial. (optional)

.from()

.from(...sceneObjects: SceneObject[][]): this

Restricts the selection to faces originating from the given scene objects. Recursive: passing a container picks up faces from its descendants.

ParameterTypeDescription
...sceneObjectsSceneObject[]Scene objects whose faces (and faces of their sub-shapes) are matched against. (optional)