Beam

class compas_timber.parts.Beam(frame, length, width, height, geometry_type='brep', **kwargs)[source]

Bases: Part

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

Parameters:
  • frame (compas.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.

  • length (float) – Length of the beam

  • width (float) – Width of the cross-section

  • height (float) – Height of the cross-section

  • geometry_type (str) – The type of geometry created for this beam. Either ‘mesh’ or ‘brep.

Attributes:
  • frame (Frame) – The coordinate system (frame) of this beam.

  • length (float) – Length of the beam.

  • width (float) – Width of the cross-section

  • height (float) – Height of the cross-section

  • geometry (compas.geometry.Brep | compas.datastructures.Mesh) – The resolved geometry of this beam, including any applied features.

  • geometry_type (str) – The type of geometry created by this beam. Either ‘mesh’ or ‘brep’.

  • tolerance (float)

  • shape (Box) – A feature-less box representing the parametric geometry of this beam. The default tolerance used in operations performed on this beam.

  • faces (list(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)

  • centerline (Line) – A line representing the centerline of this beam.

  • centerline_start (Point) – The point at the start of the centerline of this beam.

  • centerline_end (Point) – The point at the end of the centerline of this beam.

  • aabb (tuple(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_edges (list(Line)) – A list containing the 4 lines along the long axis of this beam.

  • midpoint (Point) – The point at the middle of the centerline of this beam.

Methods

add_feature

Adds a feature to this beam.

align_z

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

apply_features

Applies all the features previously added using add_feature to the geometry of this Beam.

clear_features

Clears applied features and restores their effect.

endpoint_closest_to_point

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

extend_ends

Extends the beam's parametric definition at both ends by the given values.

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_data

Construct an object of this type from the provided data.

from_endpoints

Creates a Beam from the given endpoints.

is_identical

Returns True if the other beam's values are identicale, within TOLERANCE, to the ones of this beam.

move_endpoint

Deprecated?

update_beam_geometry

Resets the geometry representation of the beam accroding to the current parametric values.

Inherited Methods

ToString

Converts the instance to a string.

copy

Make an independent copy of the data object.

get_geometry

Returns a transformed copy of the part's geometry.

sha256

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

to_data

Convert an object to its native data representation.

validate_data

Validate the data against the object's data schema.