TimberElement

class compas_timber.elements.TimberElement[source]

Bases: Element, ABC

Base class for all timber elements.

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

Parameters:
framecompas.geometry.Frame, optional

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.

lengthfloat

Length of the timber element.

widthfloat

Width of the timber element.

heightfloat

Height of the timber element.

featureslist[Feature], optional

List of features to apply to this element.

**kwargsdict, optional

Additional keyword arguments.

Attributes:
framecompas.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_beambool

True if the element is a beam.

is_platebool

True if the element is a plate.

is_wallbool

True if the element is a wall.

is_group_elementbool

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

featureslist[Feature]

A list of features applied to the element.

geometrycompas.geometry.Geometry

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

Methods

add_feature

Adds one or more features to the beam.

add_features

Adds one or more features to the beam.

back_side

Returns the previous side before the reference side, following the right-hand rule with the thumb along the beam's frame x-axis.

compute_modelgeometry

Same as parent but handles standalone elements.

compute_modeltransformation

Same as parent but handles standalone elements.

front_side

Returns the next side after the reference side, following the right-hand rule with the thumb along the beam's frame x-axis.

get_dimensions_relative_to_side

Returns the perpendicular and parallel dimensions of the beam to the given reference side.

opp_side

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.

remove_blank_extension

Remove blank extension from the element.

remove_features

Removes a feature from the beam.

reset

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

reset_computed_properties

Reset all computed/cached properties.

side_as_surface

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

transform

Transforms the element.

transformation_to_local

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

Inherited Methods

ToString

Converts the instance to a string.

apply_features

Apply the features to the (base) geometry.

compute_aabb

Computes the Axis Aligned Bounding Box (AABB) of the geometry of the element.

compute_collision_mesh

Computes the collision geometry of the geometry of the element.

compute_contacts

Compute the contacts between this element and another element.

compute_elementgeometry

Compute the geometry of the element in local coordinates.

compute_obb

Computes the Oriented Bounding Box (OBB) of the geometry of the element.

compute_point

Computes a reference point for the element geometry (e.g.

compute_surface_mesh

Computes the triangulated surface mesh of the element's model geometry.

compute_volumetric_mesh

Computes the tetrahedral volumetric mesh of the element's model geometry.

copy

Make an independent copy of the data object.

from_json

Construct an object of this type from a JSON file.

from_jsonstring

Construct an object of this type from a JSON string.

sha256

Compute a hash of the data for comparison during version control using the sha256 algorithm.

to_json

Convert an object to its native data representation and save it to a JSON file.

to_jsonstring

Convert an object to its native data representation and save it to a JSON string.

transformed

Creates a transformed copy of the element.

validate_data

Validate the data against the object's data schema.