modeling# Solid

Represents a solid in 3D space.

Members

centerOfMass

Computes the center of mass of the solid.

edges

Retrieves all edges of the solid.

faces

Retrieves all faces of the solid.

vertices

Retrieves all vertices of the solid.

volume

Computes the volume of the solid.

Methods

chamfer(parameters) → {Solid}

Applies a chamfer (beveled edge) to selected edges of the solid.

Parameters:
NameTypeDescription
parametersObject

Chamfer parameters.

Properties
NameTypeDescription
selectorfunction

A function to select edges for the chamfer.

distancenumber

The distance of the chamfer.

Returns:

A new Solid object with the chamfer applied.

Type: 
Solid

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

Cuts the solid using one or more tools (other solids).

Parameters:
NameTypeAttributesDescription
toolsSolid<repeatable>

One or more Solid objects to use as cutting tools.

Returns:

An array of Solid objects representing the result.

Type: 
Array.<Solid>

fillet(parameters) → {Solid}

Applies a fillet (rounded edge) to selected edges of the solid.

Parameters:
NameTypeDescription
parametersObject

Fillet parameters.

Properties
NameTypeDescription
selectorfunction

A function to select edges for the fillet.

radiusnumber

The radius of the fillet.

Returns:

A new Solid object with the fillet applied.

Type: 
Solid

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

Intersects the solid with one or more tools (other solids).

Parameters:
NameTypeAttributesDescription
toolsSolid<repeatable>

One or more Solid objects to intersect with.

Returns:

An array of Solid objects representing the result.

Type: 
Array.<Solid>

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

Joins the solid with one or more tools (other solids).

Parameters:
NameTypeAttributesDescription
toolsSolid<repeatable>

One or more Solid objects to join with.

Returns:

An array of Solid objects representing the result.

Type: 
Array.<Solid>

mirror(plane) → {Solid}

Mirrors the solid across a specified plane.

Parameters:
NameTypeDescription
planePlane

The plane to mirror across.

Returns:

A new Solid object representing the mirrored solid.

Type: 
Solid

rotate(parameters) → {Solid}

Rotates the solid 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 Solid object representing the rotated solid.

Type: 
Solid

scale(factor) → {Solid}

Scales the solid by a specified factor.

Parameters:
NameTypeDescription
factornumber

The scaling factor.

Returns:

A new Solid object representing the scaled solid.

Type: 
Solid

shell(parameters) → {Solid}

Creates a hollow version of the solid by offsetting its faces by a specified thickness.

Parameters:
NameTypeDescription
parametersObject

Shell parameters.

Properties
NameTypeAttributesDefaultDescription
selectorfunction

A function to select faces for the shell.

thicknessnumber

The thickness of the shell. Positive value shells outwards, negative value shells inwards.

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

The join type for the shell.

Returns:

A new Solid object representing the shelled solid.

Type: 
Solid

split(tool) → {Array.<Solid>}

Splits the solid into multiple parts using a specified tool.

Parameters:
NameTypeDescription
toolPlane

The tool used to split the solid.

Returns:

An array of Solid objects representing the split parts.

Type: 
Array.<Solid>

translate(offset) → {Solid}

Translates the solid by a specified offset.

Parameters:
NameTypeDescription
offsetVector

The translation offset.

Returns:

A new Solid object representing the translated solid.

Type: 
Solid

(static) fromFaces(…faces) → {Solid}

Creates a new solid from a set of faces.

Parameters:
NameTypeAttributesDescription
facesFace<repeatable>

One or more Face objects to create the solid from.

Returns:

A new Solid object representing the created solid.

Type: 
Solid