modeling# Face

Represents a face in 3D space.

Members

centerOfMass

Computes the center of mass of the face.

edges

Retrieves all edges of the face.

innerWires

Retrieves all inner wires (holes) of the face.

normal

Computes the normal vector of the face.

orientation

Determines the orientation of the face.

outerWire

Retrieves the outer wire (boundry) of the face.

surfaceArea

Computes the surface area of the face.

type

Determines the type of the face's surface.

vertices

Retrieves all vertices of the face.

xDirection

Computes the x-direction vector of the face.

Methods

chamfer(parameters) → {Face}

Applies a chamfer (beveled edge) to selected vertices of the face.

Parameters:
NameTypeDescription
parametersObject

Chamfer parameters.

Properties
NameTypeDescription
selectorfunction

A function to select vertices for the chamfer.

distancenumber

The distance of the chamfer.

Returns:

A new Face object with the chamfer applied.

Type: 
Face

cut(…tools) → {Array.<Face>}

Cuts the face using one or more tools (other faces).

Parameters:
NameTypeAttributesDescription
toolsFace<repeatable>

One or more Face objects to use as cutting tools.

Returns:

An array of Face objects representing the result.

Type: 
Array.<Face>

extrude(distance) → {Solid}

Extrudes the face by a specified distance to create a 3D solid.

Parameters:
NameTypeDescription
distancenumber

The extrusion distance.

Returns:

A new Solid object representing the extruded face.

Type: 
Solid

fillet(parameters) → {Face}

Applies a fillet (rounded edge) to selected vertices of the face.

Parameters:
NameTypeDescription
parametersObject

Fillet parameters.

Properties
NameTypeDescription
selectorfunction

A function to select vertices for the fillet.

radiusnumber

The radius of the fillet.

Returns:

A new Face object with the fillet applied.

Type: 
Face

intersect(…tools) → {Array.<Face>}

Intersects the face with one or more tools (other faces).

Parameters:
NameTypeAttributesDescription
toolsFace<repeatable>

One or more Face objects to intersect with.

Returns:

An array of Face objects representing the result.

Type: 
Array.<Face>

isParallel(direction) → {boolean|undefined}

Checks if the face is parallel to the given direction. Only applicable for planar faces.

Parameters:
NameTypeDescription
directionVector

The direction vector to test.

Returns:

true if the face is parallel to the direction, false otherwise, or undefined if not a planar face.

Type: 
boolean | undefined

isPerpendicular(direction) → {boolean|undefined}

Checks if the face is perpendicular to the given direction. Only applicable for planar faces.

Parameters:
NameTypeDescription
directionVector

The direction vector to test.

Returns:

true if the face is perpendicular to the direction, false otherwise, or undefined if not a planar face.

Type: 
boolean | undefined

join(…tools) → {Array.<Face>}

Joins the face with one or more tools (other faces).

Parameters:
NameTypeAttributesDescription
toolsFace<repeatable>

One or more Face objects to join with.

Returns:

An array of Face objects representing the result.

Type: 
Array.<Face>

mirror(plane) → {Face}

Mirrors the face across a specified plane.

Parameters:
NameTypeDescription
planePlane

The plane to mirror across.

Returns:

A new Face object representing the mirrored face.

Type: 
Face

offset(parameters) → {Face}

Offsets the face's outline by a specified distance. Face holes are also offset by a specified distance.

Parameters:
NameTypeDescription
parametersObject

Offset parameters.

Properties
NameTypeAttributesDefaultDescription
distancenumber

The offset distance for the face outline.

holeDistancenumber<optional>
0

The offset distance for the face holes.

joinType'arc' | 'tangent' | 'intersection'<optional>
"tangent"

The join type for the offset.

Returns:

A new Face object representing the offset face.

Type: 
Face

reverse() → {Face}

Reverses the orientation of the face.

Returns:

A new Face object with the reversed orientation.

Type: 
Face

revolve(parameters) → {Solid}

Revolves the face around a specified axis by a given angle to create a 3D solid.

Parameters:
NameTypeDescription
parametersObject

Revolution parameters.

Properties
NameTypeDescription
axisAxis

The axis to revolve around.

anglenumber

The revolution angle in radians.

Returns:

A new Solid object representing the revolved face.

Type: 
Solid

rotate(parameters) → {Face}

Rotates the face around a specified axis by a given angle.

Parameters:
NameTypeDescription
parametersObject

Rotation parameters.

Properties
NameTypeDescription
axisAxis

The axis to rotate around.

anglenumber

The rotation angle in radians.

Returns:

A new Face object representing the rotated face.

Type: 
Face

scale(factor) → {Face}

Scales the face by a specified factor.

Parameters:
NameTypeDescription
factornumber

The scaling factor.

Returns:

A new Face object representing the scaled face.

Type: 
Face

split(plane) → {Array.<Face>}

Splits the face into multiple parts using a specified plane.

Parameters:
NameTypeDescription
planePlane

The plane to split the face with.

Returns:

An array of Face objects representing the split parts.

Type: 
Array.<Face>

translate(offset) → {Face}

Translates the face by a specified offset.

Parameters:
NameTypeDescription
offsetVector

The translation offset.

Returns:

A new Face object representing the translated face.

Type: 
Face

(static) fromWire(wire) → {Face}

Creates a Face object from a wire. The wire must be closed and form a valid boundary for the face.

Parameters:
NameTypeDescription
wireWire

The wire to create the face from.

Returns:

a new Face object created from the given wire.

Type: 
Face