Beam

class compas_timber.elements.Beam[source]

Bases: TimberElement

A class to represent timber beams (studs, slats, etc.) with rectangular cross-sections.

Parameters:
framecompas.geometry.Frame

A local coordinate system of the beam: Origin is located at the starting point of the centerline. x-axis corresponds to the centerline (major axis), usually also the fibre direction in solid wood beams. y-axis corresponds to the width of the cross-section, usually the smaller dimension. z-axis corresponds to the height of the cross-section, usually the larger dimension.

lengthfloat

Length of the beam

widthfloat

Width of the cross-section

heightfloat

Height of the cross-section

Attributes:
frameFrame

The coordinate system (frame) of this beam.

lengthfloat

Length of the beam.

widthfloat

Width of the cross-section

heightfloat

Height of the cross-section

shapeBox

A feature-less box representing the parametric geometry of this beam.

blankBox

A feature-less box representing the material stock geometry to produce this beam.

ref_frameFrame

Reference frame for machining processes according to BTLx standard.

ref_sidestuple(Frame)

A tuple containing the 6 frames representing the sides of the beam according to BTLx standard.

ref_edgestuple(Line)

A tuple containing the 4 lines representing the long edges of the beam according to BTLx standard.

faceslist(Frame)

A list of frames representing the 6 faces of this beam. 0: +y (side’s frame normal is equal to the beam’s Y positive direction) 1: +z 2: -y 3: -z 4: -x (side at the starting end) 5: +x (side at the end of the beam)

centerlineLine

A line representing the centerline of this beam.

centerline_startPoint

The point at the start of the centerline of this beam.

centerline_endPoint

The point at the end of the centerline of this beam.

aabbtuple(float, float, float, float, float, float)

An axis-aligned bounding box of this beam as a 6 valued tuple of (xmin, ymin, zmin, xmax, ymax, zmax).

long_edgeslist(Line)

A list containing the 4 lines along the long axis of this beam.

midpointPoint

The point at the middle of the centerline of this beam.

keyint, optional

Once beam is added to a model, it will have this model-wide-unique integer key.

Methods

add_blank_extension

Adds a blank extension to the beam.

add_features

Adds one or more features to the beam.

compute_aabb

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

compute_collision_mesh

Computes the collision geometry of the element.

compute_geometry

Compute the geometry of the element.

compute_obb

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

endpoint_closest_to_point

Returns which endpoint of the centerline of the beam is closer to the given point.

extension_to_plane

Returns the amount by which to extend the beam in each direction using metric units.

from_centerline

Define the beam from its centerline.

from_endpoints

Creates a Beam from the given endpoints.

opposing_side_index

Returns the index of reference side opposing the given side index.

remove_blank_extension

Removes a blank extension from the beam.

remove_features

Removes a feature from the beam.

side_as_surface

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

Inherited Methods

ToString

Converts the instance to a string.

add_feature

Add a feature to the list of features of the lement.

compute_worldtransformation

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

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.

transform

Transforms the element.

transformed

Creates a transformed copy of the element.

validate_data

Validate the data against the object's data schema.