Skip to content

Face

A planar face bounded by one outer loop and any number of hole loops.

readonly area: number

Area in the face’s own context, in square meters.


readonly backMaterial: Material | null

The back material, or null.


readonly entityId: number

Identifier that stays the same for the entity’s lifetime, including across undo and redo.

DrawingElement.entityId


hidden: boolean

The element’s own hidden flag; assign inside Model.operation. Hidden ancestors are not taken into account; use Model.isDrawingElementVisible for that.

DrawingElement.hidden


readonly isDeleted: boolean

Whether the entity was deleted, for example by an edit or by undo.

DrawingElement.isDeleted


readonly isValid: boolean

Whether the entity still exists in the model.

DrawingElement.isValid


readonly loops: readonly Loop[]

All boundary loops: the outer loop and every hole.


readonly material: Material | null

The front material, or null.


readonly normal: Vector3d | null

Unit front normal in the face’s own context, or null for a degenerate face.


readonly outerLoop: Loop

The outer boundary loop.


readonly type: "Face"

The concrete class name, for narrowing unions such as AnyElement.

DrawingElement.type


visible: boolean

The inverse of hidden; assign inside Model.operation.

DrawingElement.visible

extrude(distance): Face | null

Extrudes the face by a signed distance in meters, like the Extrude tool. Positive distances follow normal. Call it inside Model.operation.

Returns the cap face, the same face when distance is zero, or null when the extrusion cuts through an opposite face. Other faces may be replaced, so keep the returned cap for further edits. Throws ModelError when the distance goes beyond the first parallel opposite face or the geometry isn’t supported.

number

Face | null