Skip to content

compas_tf.column ¤

Classes¤

ColumnAddFeature ¤

ColumnAddFeature(boxes: list = None, name: str | None = None)

Additive feature: boolean-unions a set of capitel boxes onto the column.

This is the additive half of the column feature pair; its subtractive counterpart is :class:ColumnCutFeature. Retrieve either kind by name with :meth:ColumnElement.get_features.

Parameters:

Name Type Description Default
boxes list[:class:`compas.geometry.Box`]

The capitel boxes to union onto the column box.

None
name str

The name of the feature.

None

Methods:¤

apply ¤
apply(shape: Mesh) -> Mesh

Boolean-union the capitel boxes onto the column base mesh.

Parameters:

Name Type Description Default
shape :class:`compas.datastructures.Mesh`

The base geometry (column box mesh) of the host element.

required

Returns:

Type Description
class:`compas.datastructures.Mesh`
brep_meshes ¤
brep_meshes(variant: str | None = None) -> list

The capitel boxes as meshes - what :meth:get_brep converts.

ColumnCutFeature ¤

ColumnCutFeature(meshes: list = None, name: str | None = None)

Feature that boolean-differences cutter solids out of the column geometry.

Stored on the column (in its local frame), so the cut travels with the element through copy/serialization and the cutter solids stay available for fabrication. The capitel (a :class:ColumnAddFeature) is applied first, so the cutters carve the already-formed column head.

Parameters:

Name Type Description Default
meshes list[:class:`compas.datastructures.Mesh`]

The closed cutter solids to subtract, in the column's local frame.

None
name str

The name of the feature.

None

Methods:¤

apply ¤
apply(shape: Mesh) -> Mesh

Boolean-subtract the cutter solids from the column mesh.

The cutters share the wedge-fan planes, so they are unioned into a single solid first and then subtracted in one operation - subtracting them one by one makes the kernel re-process the repeated coplanar faces.

Parameters:

Name Type Description Default
shape :class:`compas.datastructures.Mesh`

The host geometry (column box + capitel) to carve.

required

Returns:

Type Description
class:`compas.datastructures.Mesh`

ColumnElement ¤

ColumnElement(width: float = 0.4, depth: float = 0.4, height: float = 3.0, transformation: Transformation | None = None, features: list[Feature] | None = None, name: str | None = None, capitel_width: float = 40, capitel_height: float = 650)

Class representing a column element with a square section, constructed from the WorldXY Frame.

The column is defined in its local frame, where the height corresponds to the Z-Axis, the depth to the Y-Axis, and the width to the X-Axis. By default, the local frame is set to the WorldXY frame.

Parameters:

Name Type Description Default
width float

The width of the column.

0.4
depth float

The depth of the column.

0.4
height float

The height of the column.

3.0
transformation Optional[:class:`compas.geometry.Transformation`]

Transformation applied to the column.

None
features Optional[list[:class:`ColumnAddFeature` | :class:`ColumnCutFeature`]]

Features of the column.

None
name str | None

If no name is defined, the class name is given.

None
capitel_width float

The width of the capitel (column head) added as a feature.

40
capitel_height float

The height of the capitel (column head) added as a feature.

650

Attributes:

Name Type Description
width float

The width of the column.

depth float

The depth of the column.

height float

The height of the column.

box :class:`compas.geometry.Box`

The base box geometry of the column.

center_line :class:`compas.geometry.Line`

Line axis of the column.

Attributes¤

stock property ¤
stock: Mesh

The UNCUT column: base box + capitel, before any cutter is applied.

The fabrication starting point - the raw glulam blank the cuts are made in. Served from the bake cache once :meth:bake_stock has run.

Methods:¤

add_cutters ¤
add_cutters(meshes: list, name: str = 'column_cutters') -> ColumnCutFeature

Convenience wrapper: store cutter solids as a :class:ColumnCutFeature.

Equivalent to self.add_feature(ColumnCutFeature(meshes, name=name)) - kept so callers need not import the feature class. The cutters must be in the column's local frame; they are serialized in __data__ and copied with the column, so the cut stays available for fabrication.

Parameters:

Name Type Description Default
meshes list[:class:`compas.datastructures.Mesh`]

Closed cutter solids in the column's local frame.

required
name str

Name for the stored feature.

'column_cutters'

Returns:

Type Description
class:`ColumnCutFeature`

The feature that was appended.

add_feature ¤
add_feature(feature: Feature) -> Feature

Append a feature and invalidate cached geometry so it recomputes.

The capitel is forced to index 0 by :meth:compute_features, so additive and subtractive features can be appended in any order and the union still precedes the cuts. Overrides the base add_feature only to drop the cached element/model geometry.

Parameters:

Name Type Description Default
feature :class:`Feature`

Any column feature (:class:ColumnAddFeature, :class:ColumnCutFeature, ...).

required

Returns:

Type Description
class:`Feature`

The feature that was appended.

bake_stock ¤
bake_stock() -> Mesh

Compute the uncut :attr:stock once and store it for serialization.

Sugar for bake(types=ColumnElement.STOCK_TYPES). Bake this next to the plain :meth:compas_tf.element.TFElement.bake to carry both the blank and the carved part in the JSON.

Returns:

Type Description
class:`compas.datastructures.Mesh`
compute_aabb ¤
compute_aabb(inflate: float = 1.0) -> Box

Compute the axis-aligned bounding box of the element.

Parameters:

Name Type Description Default
inflate float

The inflation factor of the bounding box.

1.0

Returns:

Type Description
class:`compas.geometry.Box`

The axis-aligned bounding box.

compute_collision_mesh ¤
compute_collision_mesh(inflate: float = 1.0) -> Mesh

Compute the collision mesh of the element.

Returns:

Type Description
class:`compas.datastructures.Mesh`

The collision mesh.

compute_elementgeometry ¤
compute_elementgeometry(include_features: bool = True, types: list | None = None) -> Mesh

Compute the mesh shape from the box, applying the column features.

The capitel union and the cutter difference are boolean ops that emit triangle soup; their coplanar faces are merged back into single polygons so face-face contact detection does not fragment on the triangulation.

Parameters:

Name Type Description Default
include_features bool

If True, apply the column features to the base box geometry.

True
types list[str | type]

Restrict which feature types are applied (see :meth:compute_features). None (default) applies every feature; ["ColumnAddFeature"] yields the uncut head. Ignored when include_features is False.

None

Returns:

Type Description
class:`compas.datastructures.Mesh`
Notes

Decorated with :func:compas_tf.element.baked: if this exact variant has been baked (see :meth:compas_tf.element.TFElement.bake / :meth:bake_stock), the stored mesh is returned and no boolean runs.

compute_features ¤
compute_features(types: list | None = None) -> list[Feature]

Ensure the capitel feature exists, then return the features to apply.

The capitel is two boxes forming an L-shaped head at the top of the column, applied as a union (a :class:ColumnAddFeature). It is created once and kept first in the list, so any later :class:ColumnCutFeature carving the head is applied on top of the formed capitel.

Unlike :meth:get_features, this ensures the lazy capitel exists. The types filter selects which feature types are applied to the main geometry by :meth:compute_elementgeometry: e.g. types=["ColumnAddFeature"] yields the uncut head (capitel only), types=["ColumnCutFeature"] only the cuts.

Parameters:

Name Type Description Default
types list[str | type]

Feature types to apply (see :meth:get_features). None (default) applies every feature.

None

Returns:

Type Description
list[:class:`Feature`]
compute_obb ¤
compute_obb(inflate: float = 1.0) -> Box

Compute the oriented bounding box of the element.

Parameters:

Name Type Description Default
inflate float

The inflation factor of the bounding box.

1.0

Returns:

Type Description
class:`compas.geometry.Box`

The oriented bounding box.

compute_point ¤
compute_point() -> Point

Compute the reference point of the column from the centroid of its geometry.

Returns:

Type Description
class:`compas.geometry.Point`
extend ¤
extend(distance: float) -> None

Extend the column.

Parameters:

Name Type Description Default
distance float

The distance to extend the column at each end.

required
get_features ¤
get_features(types: list | None = None, placed: bool = False) -> list[Feature]

Return the column's features, optionally filtered by feature type.

This is pure retrieval - no geometry is built and the lazy capitel is NOT created (use :meth:compute_features for that). Filter by type to pull out a specific kind of feature for modelling, fabrication or inspection, e.g. get_features(["ColumnCutFeature"]) to recover just the cutter solids.

Parameters:

Name Type Description Default
types list[str | type]

Feature types to keep, given as class names (e.g. "ColumnCutFeature") or the classes themselves. None (default) returns every feature, in application order.

None
placed bool

If True, return independent copies whose geometry has been moved into model coordinates by the column's modeltransformation - the same transform that builds modelgeometry, so the returned cutters line up with the column wherever it sits. The stored features are left untouched. Default is False: the features as stored, in the column's local frame.

False

Returns:

Type Description
list[:class:`Feature`]