Skip to main content

EdgeFilter

Creates a new edge filter builder for selecting edges by geometric properties.

import { edge } from 'fluidcad/filters';

Methods​

.onPlane()​

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

Selects edges that lie on the given plane. Besides a standard plane or a plane feature, any scene object whose first shape is a face works as the reference — a bucket accessor like e.endFaces(), or a select(). The face is only read to derive its plane (no plane feature is created, and the referenced geometry is not consumed), so the reference stays valid even when a later feature reshaped or consumed the face.

ParameterTypeDescription
planeSceneObject | PlaneLikeThe reference plane, plane feature, or face selection.
offsetOrOptionsnumber | { offset?: number; bothDirections?: boolean; partial?: boolean; }Offset distance, or an options object with offset, bothDirections, and partial (offsets apply to standard planes only). (optional)

.notOnPlane()​

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

Excludes edges that lie on the given plane.

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

.parallelTo()​

.parallelTo(plane: PlaneLike): this

Selects edges that are parallel to the given plane.

ParameterTypeDescription
planePlaneLikeThe reference plane.

.notParallelTo()​

.notParallelTo(plane: PlaneLike): this

Excludes edges that are parallel to the given plane.

ParameterTypeDescription
planePlaneLikeThe reference plane.

.verticalTo()​

.verticalTo(plane: PlaneLike): this

Selects edges that are perpendicular (vertical) to the given plane.

ParameterTypeDescription
planePlaneLikeThe reference plane.

.notVerticalTo()​

.notVerticalTo(plane: PlaneLike): this

Excludes edges that are perpendicular (vertical) to the given plane.

ParameterTypeDescription
planePlaneLikeThe reference plane.

.circle()​

.circle(diameter?: number): this

Selects full circular edges (a hole rim, a boss rim), optionally matching a specific diameter. Geometry decides, not the kernel's storage: a B-spline edge that traces a circle — a lofted or swept section, an imported STEP edge — counts as one.

ParameterTypeDescription
diameternumberOptional diameter to match. (optional)

.notCircle()​

.notCircle(diameter?: number): this

Excludes circular edges, optionally matching a specific diameter.

ParameterTypeDescription
diameternumberOptional diameter to exclude. (optional)

.arc()​

.arc(radius?: number): this

Selects circular arcs (a fillet's edge, a rounded corner), optionally matching a specific radius. Geometry decides, not the kernel's storage: a B-spline edge that traces an arc — a lofted or swept section, an imported STEP edge — counts as one.

ParameterTypeDescription
radiusnumberOptional radius to match. (optional)

.notArc()​

.notArc(radius?: number): this

Excludes arc edges, optionally matching a specific radius.

ParameterTypeDescription
radiusnumberOptional radius to exclude. (optional)

.line()​

.line(length?: number): this

Selects straight edges, optionally matching a specific length. Geometry decides, not the kernel's storage: a B-spline edge that runs straight — a lofted or swept section, an imported STEP edge — counts as one.

ParameterTypeDescription
lengthnumberOptional length to match. (optional)

.notLine()​

.notLine(length?: number): this

Excludes straight-line edges, optionally matching a specific length.

ParameterTypeDescription
lengthnumberOptional length to exclude. (optional)

.belongsToFace()​

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

.notBelongsToFace()​

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

.outerOf()​

.outerOf(...faces: (ISceneObject | FilterBuilderBase<Face>)[][]): this

Selects edges on the outer loop of a face — the rim of a plate's top face, leaving its bore rims out; the top rim of a thin loft, leaving the wall's inner rim out. The face is given as face filters (face().onPlane('xy', 80)) or as a face reference — a bucket accessor like lf.endFaces(), or a select(). A reference is read for its surface: the face lying on that surface now is the one whose loop is taken, so the selection stays valid when a fillet or a boolean reshaped the rim after the referenced feature built it. Loop membership is pure topology — no tolerance, no radius, no length — so it survives dimension edits.

ParameterTypeDescription
...faces(ISceneObject | FilterBuilderBase<Face>)[]Face filter builders, or a scene object whose faces are the reference. (optional)

.notOuterOf()​

.notOuterOf(...faces: (ISceneObject | FilterBuilderBase<Face>)[][]): this

Excludes edges on the outer loop of a face given as face filters or as a face reference. An edge bounding no such face survives.

ParameterTypeDescription
...faces(ISceneObject | FilterBuilderBase<Face>)[]Face filter builders, or a scene object whose faces are the reference. (optional)

.holeOf()​

.holeOf(...faces: (ISceneObject | FilterBuilderBase<Face>)[][]): this

Selects edges on a hole loop of a face — a bore's rim on the plate's top face, the inner rim of a thin loft's end face. Takes the same face filters or face reference as outerOf(), and reads a reference by its surface the same way, so the loop is the face's current one. An edge belongs to two faces, and a bore rim is a hole of the top face but the outer loop of the bore's wall: the face decides.

ParameterTypeDescription
...faces(ISceneObject | FilterBuilderBase<Face>)[]Face filter builders, or a scene object whose faces are the reference. (optional)

.notHoleOf()​

.notHoleOf(...faces: (ISceneObject | FilterBuilderBase<Face>)[][]): this

Excludes edges on a hole loop of a face given as face filters or as a face reference. An edge bounding no such face survives.

ParameterTypeDescription
...faces(ISceneObject | FilterBuilderBase<Face>)[]Face filter builders, or a scene object whose faces are the reference. (optional)

.intersectsWith()​

.intersectsWith(sceneObject: SceneObject): this

Selects edges that geometrically intersect with edges of the given scene object.

ParameterTypeDescription
sceneObjectSceneObjectA scene object whose edges are tested for intersection.

.notIntersectsWith()​

.notIntersectsWith(sceneObject: SceneObject): this

Excludes edges that geometrically intersect with edges of the given scene object.

ParameterTypeDescription
sceneObjectSceneObjectA scene object whose edges are tested for intersection.

.above()​

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

Selects edges that are entirely above the given plane (in the direction of its normal). Besides a standard plane or a plane feature, any scene object whose first shape is a face works as the reference — a bucket accessor like base.endFaces() — so the half-space follows the referenced feature through edits. The offset runs along the resolved plane's normal.

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

.below()​

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

Selects edges that are entirely below the given plane (opposite to its normal direction). Besides a standard plane or a plane feature, any scene object whose first shape is a face works as the reference — a bucket accessor like base.endFaces() — so the half-space follows the referenced feature through edits. The offset runs along the resolved plane's normal.

ParameterTypeDescription
planeSceneObject | PlaneLikeThe reference plane, plane feature, or face selection.
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 edges originating from the given scene objects. Recursive: passing a container picks up edges from its descendants.

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

.convex()​

.convex(): this

Selects convex edges — outer corners, where the solid's two faces meet at an angle opening outward. The classic fillet target: e.sideEdges(edge().convex()) rounds every outer vertical corner of a profile and leaves its inner corners sharp.

.notConvex()​

.notConvex(): this

Excludes convex edges (outer corners).


.concave()​

.concave(): this

Selects concave edges — inner corners, where a boss meets its base or a pocket wall meets its floor.

.notConcave()​

.notConcave(): this

Excludes concave edges (inner corners).


.smooth()​

.smooth(): this

Selects smooth edges — no corner at all, the two faces being tangent there, as along a fillet's boundary.

.notSmooth()​

.notSmooth(): this

Excludes smooth (tangent-transition) edges.


.farthest()​

.farthest(direction: DirectionLike): this

Keeps the layer of edges farthest along a direction — every edge whose center of mass lies at the maximum (within tolerance) along it. A box's farthest('z') is its four top rim edges; chain order is evaluation order, so edge().line().farthest('z') ranks only the lines.

ParameterTypeDescription
directionDirectionLike'x', 'y', 'z', '-x', '-y', '-z', a vector, or an axis.

.notFarthest()​

.notFarthest(direction: DirectionLike): this

Excludes the layer of edges farthest along a direction.

ParameterTypeDescription
directionDirectionLike'x', 'y', 'z', '-x', '-y', '-z', a vector, or an axis.

.nearest()​

.nearest(direction: DirectionLike): this

Keeps the layer of edges nearest along a direction — the minimum of the center of mass along it (nearest('z') is the same as farthest('-z')).

ParameterTypeDescription
directionDirectionLike'x', 'y', 'z', '-x', '-y', '-z', a vector, or an axis.

.notNearest()​

.notNearest(direction: DirectionLike): this

Excludes the layer of edges nearest along a direction.

ParameterTypeDescription
directionDirectionLike'x', 'y', 'z', '-x', '-y', '-z', a vector, or an axis.

.nth()​

.nth(direction: DirectionLike, index: number): this

Keeps the k-th layer of edges along a direction, counting layers of equal center position from the near end (0-based); a negative index counts from the far end, so nth('z', -1) is farthest('z').

ParameterTypeDescription
directionDirectionLike'x', 'y', 'z', '-x', '-y', '-z', a vector, or an axis.
indexnumberLayer index; out-of-range indices match nothing.

.largest()​

.largest(measure?: SizeMeasure): this

Keeps the largest edges — by length unless a measure is given — including every edge that ties with the largest.

ParameterTypeDescription
measureSizeMeasure'length' (default) or 'radius' for circular edges. (optional)

.notLargest()​

.notLargest(measure?: SizeMeasure): this

Excludes the largest edges (and their ties).

ParameterTypeDescription
measureSizeMeasure'length' (default) or 'radius'. (optional)

.smallest()​

.smallest(measure?: SizeMeasure): this

Keeps the smallest edges — by length unless a measure is given — including every edge that ties with the smallest.

ParameterTypeDescription
measureSizeMeasure'length' (default) or 'radius' for circular edges. (optional)

.notSmallest()​

.notSmallest(measure?: SizeMeasure): this

Excludes the smallest edges (and their ties).

ParameterTypeDescription
measureSizeMeasure'length' (default) or 'radius'. (optional)