Beam

class compas_timber.parts.Beam[source]

Bases: Part

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.

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.

Methods

add_blank_extension

Adds a blank extension to the beam.

add_features

Adds one or more features to the beam.

align_z

Align the z_axis of the beam's definition with the given vector.

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.

remove_blank_extension

Removes a blank extension from the beam.

remove_features

Removes a feature from the beam.

Inherited Methods

ToString

Converts the instance to a string.

add_feature

Add a Feature to this Part.

clear_features

compute_aabb

Compute the axis-aligned bounding box of the datastructure.

compute_obb

Compute the oriented bounding box of the datastructure.

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.

get_geometry

Returns a transformed copy of the part's geometry.

rotate

Rotate the datastructure.

rotated

Returns a rotated copy of this geometry.

scale

Scale the datastructure.

scaled

Returns a scaled copy of this geometry.

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 data structure.

transform_numpy

Transforms the data structure.

transformed

Returns a transformed copy of this data structure.

transformed_numpy

Returns a transformed copy of this data structure.

translate

Translate the datastructure.

translated

Returns a translated copy of this geometry.

validate_data

Validate the data against the object's data schema.