Skip to main content

Rect

Extends ExtrudableGeometry

Inherited from Geometry

start()

start(): Vertex

Returns a lazy-evaluated vertex at the start point of this geometry element.

Returns: Vertex


end()

end(): Vertex

Returns a lazy-evaluated vertex at the end point of this geometry element.

Returns: Vertex


tangent()

tangent(): Vertex

Returns a lazy-evaluated vertex representing the tangent direction at the end of this geometry. Used to determine the direction of subsequent geometry elements.

Returns: Vertex

Inherited from SceneObject

name()

name(value: string): this

Sets a custom display name for this object, overriding the default type-based name.

ParameterTypeDescription
valuestringThe display name to assign.

guide()

guide(): this

Marks this object as construction geometry. Guide objects are excluded from final geometry output unless explicitly included.


reusable()

reusable(): this

Marks this object as reusable. Reusable objects retain their shapes when consumed by features (e.g., extrude, revolve), allowing multiple features to reference the same source geometry. Use remove(obj) to force-remove shapes from a reusable object.

Methods

radius()

radius(...r: number[]): this

Sets corner radii for a rounded rectangle. Accepts 1–4 values in order: [bottomLeft, bottomRight, topRight, topLeft]. A single value applies to all corners.

ParameterTypeDescription
...rnumber[]One or more radius values. (optional)

centered()

centered(value?: boolean | "horizontal" | "vertical"): this

Controls how the rectangle is positioned relative to the current point.

ParameterTypeDescription
valueboolean | "horizontal" | "vertical"true centers on both axes, 'horizontal' or 'vertical' centers on one axis, false (default) keeps the current point as the origin corner. (optional)

topEdge()

topEdge(): SceneObject

Returns the top straight edge of the rectangle.

Returns: SceneObject


bottomEdge()

bottomEdge(): SceneObject

Returns the bottom straight edge of the rectangle.

Returns: SceneObject


leftEdge()

leftEdge(): SceneObject

Returns the left straight edge of the rectangle.

Returns: SceneObject


rightEdge()

rightEdge(): SceneObject

Returns the right straight edge of the rectangle.

Returns: SceneObject


topLeftArcEdge()

topLeftArcEdge(): SceneObject

Returns the arc edge at the top-left corner. Only present when a radius is applied.

Returns: SceneObject


topRightArcEdge()

topRightArcEdge(): SceneObject

Returns the arc edge at the top-right corner. Only present when a radius is applied.

Returns: SceneObject


bottomLeftArcEdge()

bottomLeftArcEdge(): SceneObject

Returns the arc edge at the bottom-left corner. Only present when a radius is applied.

Returns: SceneObject


bottomRightArcEdge()

bottomRightArcEdge(): SceneObject

Returns the arc edge at the bottom-right corner. Only present when a radius is applied.

Returns: SceneObject


topLeft()

topLeft(): Vertex

Returns a lazy-evaluated vertex at the top-left corner.

Returns: Vertex


topRight()

topRight(): Vertex

Returns a lazy-evaluated vertex at the top-right corner.

Returns: Vertex


bottomLeft()

bottomLeft(): Vertex

Returns a lazy-evaluated vertex at the bottom-left corner.

Returns: Vertex


bottomRight()

bottomRight(): Vertex

Returns a lazy-evaluated vertex at the bottom-right corner.

Returns: Vertex