Skip to content

compas_timber.base ¤

Classes¤

TimberElement ¤

TimberElement(frame, length, width, height, features=None, **kwargs)

Base class for all timber elements.

This is an abstract class and should not be instantiated directly.

Parameters:

  • frame (:class:`compas.geometry.Frame`) –

    The frame representing the beam's local coordinate system in its hierarchical context. Defaults to None, in which case the world coordinate system is used.

  • length (float) –

    Length of the timber element.

  • width (float) –

    Width of the timber element.

  • height (float) –

    Height of the timber element.

  • features (list[:class:`~compas_timber.fabrication.Feature`], default: None ) –

    List of features to apply to this element.

  • **kwargs (dict, default: {} ) –

    Additional keyword arguments.

Attributes:

  • frame (:class:`compas.geometry.Frame`) –

    The coordinate system of this element in model space. This property may be different from the constructor parameter if the element belongs to a model hierarchy.

  • is_beam (bool) –

    True if the element is a beam.

  • is_plate (bool) –

    True if the element is a plate.

  • is_group_element (bool) –

    True if the element can be used as container for other elements.

  • features (list[:class:`~compas_timber.parts.Feature`]) –

    A list of features applied to the element.

  • geometry (:class:`compas.geometry.Geometry`) –

    The geometry of the element in the model's global coordinates.

Attributes¤

geometry property ¤
geometry

The geometry of the element in the model's global coordinates.

ref_frame property ¤
ref_frame

Reference frame for machining processings according to BTLx standard. The origin is at the bottom far corner of the element. The ref_frame is always in model coordinates.

Functions¤

add_feature ¤
add_feature(feature)

Adds one or more features to the beam.

Parameters:

  • feature (:class:`~compas_timber.fabrication.BTLxProcessing`)) –

    The feature to be added.

add_features ¤
add_features(features)

Adds one or more features to the beam.

Parameters:

  • features (:class:`~compas_timber.fabrication.BTLxProcessing` | list(:class:`~compas_timber.fabrication.BTLxProcessing`)) –

    The feature or features to be added described as a BTLxProcessing or a list of BTLxProcessings.

back_side ¤
back_side(ref_side_index)

Returns the previous side before the reference side, following the right-hand rule with the thumb along the beam's frame x-axis. This method does not consider the start and end sides of the beam (RS5 & RS6).

Parameters:

  • ref_side_index (int) –

    The index of the reference side to which the back side should be calculated.

Returns:

  • frame ( :class:`~compas.geometry.Frame` ) –

    The frame of the back side of the beam relative to the reference side.

compute_modelgeometry ¤
compute_modelgeometry()

Same as parent but handles standalone elements.

compute_modeltransformation ¤
compute_modeltransformation()

Same as parent but handles standalone elements.

front_side ¤
front_side(ref_side_index)

Returns the next side after the reference side, following the right-hand rule with the thumb along the beam's frame x-axis. This method does not consider the start and end sides of the beam (RS5 & RS6).

Parameters:

  • ref_side_index (int) –

    The index of the reference side to which the front side should be calculated.

Returns:

  • frame ( :class:`~compas.geometry.Frame` ) –

    The frame of the front side of the beam relative to the reference side.

get_dimensions_relative_to_side ¤
get_dimensions_relative_to_side(ref_side_index)

Returns the dimensions of a timber element with respect to the Y- axis and Normal of the given reference side.

Parameters:

  • ref_side_index (int) –

    The index of the reference side to which the dimensions should be calculated.

Returns:

  • tuple(float, float)

    Y-axis dimension, Normal direction dimension. - Y-axis dimension: The element dimension along y-axis of reference side. - Normal dimension: The element dimension normal to the reference side.

opp_side ¤
opp_side(ref_side_index)

Returns the the side that is directly across from the reference side, following the right-hand rule with the thumb along the beam's frame x-axis. This method does not consider the start and end sides of the beam (RS5 & RS6).

Parameters:

  • ref_side_index (int) –

    The index of the reference side to which the opposite side should be calculated.

Returns:

  • frame ( :class:`~compas.geometry.Frame` ) –

    The frame of the opposite side of the beam relative to the reference side.

remove_blank_extension ¤
remove_blank_extension()

Remove blank extension from the element.

This method is intended to be overridden by subclasses.

remove_features ¤
remove_features(features=None)

Removes a feature from the beam.

Parameters:

  • features (:class:`~compas_timber.fabrication.BTLxProcessing` | list(:class:`~compas_timber.fabrication.BTLxProcessing`) | None, default: None ) –

    The feature or features to be removed described as a BTLxProcessing or a list of BTLxProcessings. If None, all features will be removed.

reset ¤
reset()

Resets the element to its initial state by removing all features, extensions, and debug_info.

reset_computed_properties ¤
reset_computed_properties()

Reset all computed/cached properties.

side_as_surface ¤
side_as_surface(side_index)

Returns the requested side of the beam as a parametric planar surface.

Parameters:

  • side_index (int) –

    The index of the reference side to be returned. 0 to 5.

transformation_to_local ¤
transformation_to_local()

Compute the transformation to local coordinates of this element based on its position in the spatial hierarchy of the model.

Returns:

  • class:`compas.geometry.Transformation`

Functions¤

reset_timber_attrs ¤

reset_timber_attrs(f)

Decorator to reset cached timber-specific attributes.