compas_timber.elements
¤
Classes¤
BallNodeFastener
¤
A class to represent timber fasteners (screws, dowels, brackets).
Todo
finish this docstring
Parameters:
-
node_point(:class:`~compas.geometry.Point`) –The node point of this fastener.
-
ball_diameter(float, default:100) –The diameter of the ball representing this fastener. This is used for visualization and collision geometry but does not affect the geometry of the interfaces.
-
base_interface(:class:`~compas_timber.elements.FastenerTimberInterface` | None, default:None) –The base interface of this fastener. If None, a default interface will be used.
Attributes:
-
frame(:class:`~compas.geometry.Frame`) –The coordinate system (frame) of this fastener.
-
elements(list(:class:`~compas_model.elements.Element`)) –The elements that are connected with this fastener.
Source code in src/compas_timber/elements/fasteners/ball_node_fastener.py
Attributes¤
interface_plate
property
¤
Generate a plate from outline_points, thickness, and holes.
interface_shape
property
¤
Return a Brep representation of the interface located at the WorldXY origin.
Methods:¤
compute_collision_mesh
¤
Computes the collision geometry of the element.
Returns:
-
class:`compas.datastructures.Mesh`–The collision geometry of the element.
Source code in src/compas_timber/elements/fasteners/ball_node_fastener.py
compute_geometry
¤
Returns the geometry of the fastener including all interfaces.
Source code in src/compas_timber/elements/fasteners/ball_node_fastener.py
Beam
¤
A class to represent timber beams (studs, slats, etc.) with rectangular cross-sections.
Parameters:
-
frame(:class:`compas.geometry.Frame`) –The frame representing the beam's local coordinate system in its hierarchical context: 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
Attributes:
-
transformation(:class:`~compas.geometry.Transformation`) –The transformation matrix representing the beam's local coordinate system in its hierarchical context. This is the internal interface for the constructor
frameparameter. -
frame(:class:`~compas.geometry.Frame`) –The coordinate system (frame) of this beam in model space. This property may be different from the constructor parameter if the beam belongs to a model hierarchy.
-
length(float) –Length of the beam.
-
width(float) –Width of the cross-section
-
height(float) –Height of the cross-section
-
shape(:class:`~compas.geometry.Box`) –A feature-less box representing the parametric geometry of this beam in global coordinates.
-
blank(:class:`~compas.geometry.Box`) –A feature-less box representing the material stock geometry to produce this beam in global coordinates. Compared to
shape, this box includes any extensions added to the beam. -
blank_length(float) –The length of the blank including any extensions added to the beam.
-
centerline(:class:`~compas.geometry.Line`) –A line representing the centerline of this beam.
-
ref_frame(:class:`~compas.geometry.Frame`) –Reference frame for machining processings according to BTLx standard.
-
ref_sides(tuple(:class:`~compas.geometry.Frame`)) –A tuple containing the 6 frames representing the sides of the beam according to BTLx standard.
-
ref_edges(tuple(:class:`~compas.geometry.Line`)) –A tuple containing the 4 lines representing the long edges of the beam according to BTLx standard.
-
aabb(:class:`~compas.geometry.Box`) –An axis aligned bounding box of this beam.
-
obb(:class:`~compas.geometry.Box`) –An oriented bounding box of this beam.
Source code in src/compas_timber/elements/beam.py
Attributes¤
blank
property
¤
The blank of the beam in model space.
Compared to shape, this box includes any extensions added to the beam.
Methods:¤
add_blank_extension
¤
Adds a blank extension to the beam.
start : float The amount by which the start of the beam should be extended. end : float The amount by which the end of the beam should be extended. joint_key : int The key of the joint which required this extension. When the joint is removed, this extension will be removed as well.
Source code in src/compas_timber/elements/beam.py
compute_aabb
¤
Computes the Axis Aligned Bounding Box (AABB) of the element in global coordinates.
Parameters:
-
inflate(float, default:0.0) –Offset of box to avoid floating point errors.
Returns:
-
class:`~compas.geometry.Box`–The AABB of the element.
Source code in src/compas_timber/elements/beam.py
compute_collision_mesh
¤
Computes the collision geometry of the element in global coordinates.
Returns:
-
class:`compas.datastructures.Mesh`–The collision geometry of the element.
Source code in src/compas_timber/elements/beam.py
compute_elementgeometry
¤
Compute the geometry of the element in local coordinates.
Parameters:
-
include_features(bool, default:True) –If True, the features should be included in the element geometry.
Returns:
-
class:`compas.geometry.Brep`–
Raises:
-
:class:`compas_timber.errors.FeatureApplicationError`–If there is an error applying features to the element.
Source code in src/compas_timber/elements/beam.py
compute_obb
¤
Computes the Oriented Bounding Box (OBB) of the element in global coordinates.
Parameters:
-
inflate(float, default:0.0) –Offset of box to avoid floating point errors.
Returns:
-
class:`compas.geometry.Box`–The OBB of the element.
Source code in src/compas_timber/elements/beam.py
endpoint_closest_to_point
¤
Returns which endpoint of the centerline of the beam is closer to the given point.
Parameters:
-
point(:class:`~compas.geometry.Point`) –The point of interest.
Returns:
-
list(str, :class:`~compas.geometry.Point`)–Two element list. First element is either 'start' or 'end' depending on the result. The second element is the actual endpoint of the beam's centerline which correspond to the result.
Source code in src/compas_timber/elements/beam.py
extension_to_plane
¤
Returns the amount by which to extend the beam in each direction using metric units.
The extension is the minimum amount which allows all long faces of the beam to pass through the given plane.
Parameters:
-
plane(:class:`~compas.geometry.Frame` or :class:`~compas.geometry.Plane`) –The plane to which the beam should be extended.
Returns:
Source code in src/compas_timber/elements/beam.py
from_box
classmethod
¤
Define the beam from a box.
Parameters:
-
box(:class:`~compas.geometry.Box`) –A box whose dimensions and orientation define the beam. The box's x-axis is taken as the beam's centerline direction (length), y-axis as the width direction, and z-axis as the height direction.
Returns:
-
class:`~compas_timber.elements.Beam`–
Source code in src/compas_timber/elements/beam.py
from_centerline
classmethod
¤
Define the beam from its centerline.
Parameters:
-
centerline(:class:`~compas.geometry.Line`) –The centerline of the beam to be created.
-
width(float) –Width of the cross-section.
-
height(float) –Height of the cross-section.
-
z_vector(:class:`~compas.geometry.Vector`, default:None) –A vector indicating the height direction (z-axis) of the cross-section. Defaults to WorldZ or WorldX depending on the centerline's orientation.
Returns:
-
class:`~compas_timber.elements.Beam`–
Source code in src/compas_timber/elements/beam.py
from_endpoints
classmethod
¤
Creates a Beam from the given endpoints.
Parameters:
-
point_start(:class:`~compas.geometry.Point`) –The start point of a centerline
-
point_end(:class:`~compas.geometry.Point`) –The end point of a centerline
-
width(float) –Width of the cross-section.
-
height(float) –Height of the cross-section.
-
z_vector(:class:`~compas.geometry.Vector`, default:None) –A vector indicating the height direction (z-axis) of the cross-section. Defaults to WorldZ or WorldX depending on the centerline's orientation.
Returns:
-
class:`~compas_timber.elements.Beam`–
Source code in src/compas_timber/elements/beam.py
remove_blank_extension
¤
Removes a blank extension from the beam.
Parameters:
-
joint_key(int, default:None) –The key of the joint which required this extension.
Source code in src/compas_timber/elements/beam.py
Fastener
¤
A class to represent timber fasteners (screws, dowels, brackets).
Todo
we should rethink this class. it is not entirely clear if it's an abstract class or a generic fastener. It inherits from TimberElement/Element but does not implement the appropriate methods.
Parameters:
-
shape(:class:`~compas.geometry.Geometry`, default:None) –The geometry of the fastener.
-
frame(:class:`~compas.geometry.Frame`, default:None) –The frame of the fastener in parent space.
-
**kwargs(dict, default:{}) –Additional keyword arguments.
Attributes:
-
shape(:class:`~compas.geometry.Geometry`) –The geometry of the fastener.
-
frame(:class:`~compas.geometry.Frame`) –The frame of the fastener in parent space.
-
interfaces(list) –A list of interfaces associated with this fastener.
-
attributes(dict) –Dictionary of attributes for this fastener.
-
debug_info(list) –A list of debug information.
-
is_fastener(bool) –Always True for fasteners.
-
key(int or None) –The graph node key of this fastener.
Source code in src/compas_timber/elements/fastener.py
FastenerTimberInterface
¤
FastenerTimberInterface(
outline_points=None,
thickness=None,
holes=None,
shapes=None,
frame=None,
element=None,
features=None,
)
A class to represent the interface between a fastener and a timber element.
Todo
we need to put some thought as to what's the minimal representation of an interface. the responsibilities of the Fastener-based-joint vs. Fastener vs. FastenerTimberInterface should be perhaps more clearly defined prehaps it would make sense to move stuff over from here to the BallNodeJoint while it attempts to be generic, it is tightly coupled with the BallNodeJoint. what is the differece between the outline and the shapes? they seem to all just result in geometry.
Parameters:
-
outline_points(list[:class:`~compas.geometry.Point`], default:None) –The points of the polyline outline of the fastener geometry.
-
thickness(float, default:None) –The thickness of the fastener plate.
-
holes(list[dict], default:None) –The holes of the fastener. Structure is as follows: { "point": compas.geometry.Point, "diameter": float, "vector": compas.geometry.Vector, optional, if none, the hole is assumed to be perpendicular to the frame "through": bool, optional, if True, the hole goes through the timber element }
-
shapes(list[:class:`~compas.geometry.Geometry`], default:None) –Input for extra geometric elements. These should be solids that can be booleaned with the fastener geometry.
-
frame(:class:`~compas.geometry.Frame`, default:None) –The frame of the instance of the fastener that is applied to the model.
-
element(object, default:None) –The timber element this interface is associated with.
-
features(list[:class:`~compas_timber.fabrication.BTLxFromGeometryDefinition`], default:None) –The features that are applied by this interface to the timber element. The features are defined in world coordinates.
Attributes:
-
outline_points(list[:class:`~compas.geometry.Point`]) –The points of the polyline outline of the fastener geometry.
-
thickness(float) –The thickness of the fastener plate.
-
holes(list[dict]) –The holes of the fastener. Structure is as follows: { "point": compas.geometry.Point, "diameter": float, "vector": compas.geometry.Vector, optional, if none, the hole is assumed to be perpendicular to the frame "through": bool, optional, if True, the hole goes through the timber element }
-
frame(:class:`~compas.geometry.Frame`) –The frame of the instance of the fastener that is applied to the model.
-
element(object) –The timber element this interface is associated with.
-
shapes(list[:class:`~compas.geometry.Geometry`]) –Input for extra geometric elements. These should be solids that can be booleaned with the fastener geometry.
-
features(list[:class:`~compas_timber.fabrication.BTLxFromGeometryDefinition`]) –The features that are applied by this interface to the timber element. This returns the features in world coordinates.
Source code in src/compas_timber/elements/fastener.py
Methods:¤
get_features
¤
Get features to be applied to a timber element.
Parameters:
-
element(:class:`~compas_timber.elements.TimberElement`) –The timber element to apply features to.
Returns:
-
list[:class:`~compas_timber.fabrication.Feature`]–A list of features to be applied to the element.
Source code in src/compas_timber/elements/fastener.py
Layer
¤
Layer(
plate_geometry: PlateGeometry,
start_offset: float,
name: str | None = None,
sublayers: list | None = None,
layer_path: tuple | None = None,
frame: Frame | None = None,
**kwargs,
)
A resolved cross-section layer of a :class:~compas_timber.elements.Panel.
A Layer represents a slice of a parent panel between two
through-thickness levels, measured from the outline_a face. It is a
first-class model element that owns its own
:class:~compas_timber.elements.PlateGeometry and lives as a child of the
parent panel in the model tree.
Like :class:~compas_timber.elements.Panel and
:class:~compas_timber.elements.Plate, a Layer is constructed directly
from a :class:~compas_timber.elements.PlateGeometry -- it holds no
reference to whatever produced that geometry. Use
:meth:from_parent_start_end to build a Layer by interpolating the
outlines of a parent :class:~compas_timber.elements.Panel or another
Layer between two through-thickness levels.
Parameters:
-
plate_geometry(:class:`~compas_timber.elements.PlateGeometry`) –Geometry of this layer slice.
-
start_offset(float) –Starting offset from the panel's
outline_aface, measured along the panel's thickness direction. -
name(str, default:None) –Human-readable identifier (e.g.
"core","exterior"). -
sublayers(list[:class:`Layer`], default:None) –Child layers to attach immediately. Equivalent to setting :attr:
sublayersafter construction. -
layer_path(tuple[int, ...], default:None) –Position in the parent panel's layer tree. See :attr:
layer_path. -
frame(:class:`~compas.geometry.Frame`, default:None) –The coordinate system (frame) of this layer, relative to its parent. Defaults to worldXY.
Attributes:
-
plate_geometry(:class:`~compas_timber.elements.PlateGeometry`) –Geometry of this layer slice.
-
start_offset(float) –Starting offset of this layer from the panel's
outline_aface, measured along the panel's thickness direction. -
sublayers(list[:class:`Layer`]) –Ordered child layers. Derived from the model tree when in a model; falls back to the stored list when standalone.
-
layer_path(tuple[int, ...] or None) –Position in the parent panel's layer tree, e.g.
(1,)for the second root layer or(1, 0)for its first child. -
thickness(float) –Layer thickness, taken from :attr:
plate_geometry. -
outline_a, outline_b(:class:`~compas.geometry.Polyline`) –World-space outlines of the two main faces.
-
planes(tuple[:class:`~compas.geometry.Plane`, :class:`~compas.geometry.Plane`]) –World-space planes of the two main faces.
-
normal(:class:`~compas.geometry.Vector`) –World-space normal of the layer.
-
edge_planes(dict[int, :class:`~compas.geometry.Plane`]) –World-space edge planes by edge index.
Source code in src/compas_timber/elements/layer.py
Attributes¤
Methods:¤
apply_edge_extensions
¤
Move edge vertices onto the extension planes, then recurse to sublayers.
define_sublayers
¤
Subdivide this layer into child layers by thickness.
Parameters:
-
thicknesses(list[float | None]) –Thickness of each sublayer, ordered from :attr:
start_offsettowards the far face of this layer. At most one entry may beNone; that slot absorbs whatever thickness remains after the other entries are summed. If noNoneis present and the sum of entries is less than :attr:thickness, an extra layer is appended at the end with the remaining thickness. The sum of all explicit (non-None) values must not exceed :attr:thickness. -
names(list[str | None], default:None) –Names for the sublayers. When given, length must match thicknesses (before any auto-appended remainder layer).
Returns:
-
list[:class:`Layer`]–The newly created sublayers (also stored in :attr:
sublayers).
Source code in src/compas_timber/elements/layer.py
from_parent_start_end
classmethod
¤
from_parent_start_end(
host: Panel | Layer,
start_offset: float,
end_offset: float,
name: str | None = None,
sublayers: list | None = None,
layer_path: tuple | None = None,
**kwargs,
) -> Layer
Construct a Layer by interpolating the outlines of host between two through-thickness levels.
Parameters:
-
host(:class:`~compas_timber.elements.Panel` or :class:`Layer`) –The panel (for root layers) or enclosing layer (for sublayers) to interpolate outlines from. Not stored: the resulting
Layerholds no reference back to host. -
start_offset(float) –See :class:
Layer. -
end_offset(float) –See :class:
Layer. -
name(optional, default:None) –See :class:
Layer. -
sublayers(optional, default:None) –See :class:
Layer. -
layer_path(optional, default:None) –See :class:
Layer.
Returns:
-
class:`Layer`–
Source code in src/compas_timber/elements/layer.py
get_outlines_from_parent
staticmethod
¤
Interpolate parent's local outlines at the given panel-absolute levels.
parent is either the :class:~compas_timber.elements.Panel (for root
layers) or the enclosing :class:Layer (for sublayers).
Source code in src/compas_timber/elements/layer.py
remove_blank_extension
¤
remove_blank_extension(edge_index: int | None = None)
Remove any extension plane for the given edge index. Propagates to all sublayers.
Source code in src/compas_timber/elements/layer.py
reset
¤
Resets the element to its initial state by removing extensions and debug_info.
Source code in src/compas_timber/elements/layer.py
set_extension_plane
¤
Set an extension plane for an edge. Propagates to all sublayers.
Source code in src/compas_timber/elements/layer.py
transformation_to_local
¤
LayerDefinition
¤
Definition of a single layer slot within a :class:LayerStructure.
LayerDefinition is the panel-agnostic description of one layer: its name, thickness
fraction, and optional children. A :class:LayerStructure holds a tree of
LayerDefinition objects; when applied to a :class:~compas_timber.elements.Panel
each LayerDefinition produces one geometry-bearing :class:Layer instance.
Parameters:
-
name(str, default:None) –Human-readable identifier (e.g.
"core","exterior"). -
thickness(float, default:None) –Absolute thickness of this slot measured along the panel's thickness direction. When
Nonethe slot absorbs whatever thickness remains after all fixed siblings are summed. At most one sibling at the same level may havethickness=None. -
sublayer_defs(list[:class:`LayerDefinition`], default:None) –Child slot definitions for nested layers.
Attributes:
-
name(str or None) – -
thickness(float or None) – -
sublayer_defs(list[:class:`LayerDefinition`]) – -
layer_path(tuple[int, ...]) –Position in the :class:
LayerStructuretree, e.g.(1,)for the second root slot or(1, 0)for its first child. Set automatically by :class:LayerStructurewhen the structure is built. Not serialized.
Source code in src/compas_timber/elements/layer.py
LayerStructure
¤
Panel-agnostic cross-section definition.
A LayerStructure holds a tree of :class:LayerDefinition objects describing
the layer slots. It is shared across panels; :meth:attach creates bound
:class:Layer instances for each specific panel.
Use "core", "exterior", "interior" as :class:LayerDefinition names to
enable the matching properties on :class:~compas_timber.elements.Panel.
A sibling with thickness=None absorbs remaining thickness; at most one
sibling at the same level may do so.
Parameters:
-
layer_defs(list[:class:`LayerDefinition`], default:None) –Root-level layer definitions. Defaults to a single
"core"slot spanning the full panel thickness.
Source code in src/compas_timber/elements/layer.py
Panel
¤
Panel(
frame: Frame | None = None,
length: float | None = None,
width: float | None = None,
thickness: float | None = None,
plate_geometry: PlateGeometry | None = None,
type: str | None = None,
layer_structure: LayerStructure | None = None,
**kwargs,
)
Represents a timber panel element (wall, floor, roof, etc.).
Serves as container for beams, plates, and other related elements and groups them together to form a panel. A panel is often a single unit of prefabricated timber element. It is often referred to as an enveloping body.
Parameters:
-
frame(:class:`~compas.geometry.Frame`, default:None) –The coordinate system (frame) of this panel, relative to its parent. Defaults to worldXY.
-
length(float, default:None) –Length of the panel. Required when no plate_geometry is provided.
-
width(float, default:None) –Width of the panel. Required when no plate_geometry is provided.
-
thickness(float, default:None) –Thickness of the panel. Required when no plate_geometry is provided.
-
plate_geometry(:class:`~compas_timber.elements.PlateGeometry`, default:None) –A PlateGeometry object defining the panel shape in local space. When provided, dimensions must not be given.
-
**kwargs(dict, default:{}) –Additional keyword arguments.
Attributes:
-
frame(:class:`~compas.geometry.Frame`) –The coordinate system (frame) of this panel.
-
length(float) –Length of the panel.
-
width(float) –Width of the panel.
-
height(float) –Height (thickness) of the panel.
-
thickness(float) –Thickness of the panel.
-
planes(tuple (:class:`~compas.geometry.Plane`, :class:`~compas.geometry.Plane`)) –The two main planes of the panel (bottom and top).
-
normal(:class:`~compas.geometry.Vector`) –The normal vector of the panel.
-
edge_planes(dict[int, :class:`~compas.geometry.Plane`]) –The edge planes of the panel by edge index.
-
is_group_element(bool) –Always True for panels as they can contain other elements.
Source code in src/compas_timber/elements/panel.py
Attributes¤
core_layer
property
¤
The layer named "core" in this panel's :attr:layer_structure, or None.
exterior_layer
property
¤
The layer named "exterior" in this panel's :attr:layer_structure, or None.
interfaces
property
¤
list[:class:~compas_timber.panel_features.PanelConnectionInterface]: The interfaces associated with this panel.
interior_layer
property
¤
The layer named "interior" in this panel's :attr:layer_structure, or None.
layer_structure
property
writable
¤
The :class:~compas_timber.elements.LayerStructure definition for this panel.
Methods:¤
apply_edge_extensions
¤
adjusts segments of the outlines to lay on the edge planes created by PanelJoints.
compute_aabb
¤
Computes the Axis Aligned Bounding Box (AABB) of the element.
Parameters:
-
inflate(float, default:0.0) –Offset of box to avoid floating point errors.
Returns:
-
class:`~compas.geometry.Box`–The AABB of the element.
Source code in src/compas_timber/elements/panel.py
compute_collision_mesh
¤
compute_collision_mesh() -> Mesh
Computes the collision geometry of the element.
Returns:
-
class:`compas.datastructures.Mesh`–The collision geometry of the element.
Source code in src/compas_timber/elements/panel.py
compute_elementgeometry
¤
compute_elementgeometry(include_features: bool = True) -> Brep
Compute the geometry of the element.
Parameters:
-
include_features(bool, default:True) –If
True, include the features in the computed geometry. IfFalse, return only the plate shape.
Returns:
-
class:`compas.datastructures.Mesh` | :class:`compas.geometry.Brep`–
Source code in src/compas_timber/elements/panel.py
compute_modelgeometry
¤
Same as parent but handles standalone elements.
Source code in src/compas_timber/elements/panel.py
compute_modeltransformation
¤
Same as parent but handles standalone elements.
compute_obb
¤
Computes the Oriented Bounding Box (OBB) of the element.
Returns:
-
class:`compas.geometry.Box`–The OBB of the element.
Source code in src/compas_timber/elements/panel.py
from_brep
classmethod
¤
from_brep(brep: Brep, orientation: Vector | None = None, **kwargs)
Creates a panel from a brep by automatically detecting two parallel faces.
This method identifies the two main faces of the brep using topological analysis (edge counts and adjacency) and uses them as the top and bottom faces of the panel.
Parameters:
-
brep(:class:`~compas.geometry.Brep`) –The brep representing the panel geometry. Must have at least 2 parallel faces.
-
orientation(:class:`~compas.geometry.Vector`, default:None) –A vector indicating the desired orientation of the panel's local y-axis. If None, orientation is determined from the outline.
-
**kwargs(dict, default:{}) –Additional keyword arguments. These are passed to the :class:
~compas_timber.elements.Panelconstructor.
Returns:
-
class:`~compas_timber.elements.Panel`–A Panel object created from the two parallel faces of the brep.
Source code in src/compas_timber/elements/panel.py
from_face_thickness
classmethod
¤
from_face_thickness(
brep: Brep,
thickness: float,
vector: Vector | None = None,
orientation: Vector | None = None,
**kwargs,
)
Creates a panel from a single-face brep.
Parameters:
-
brep(:class:`~compas.geometry.Brep`) –A single-face brep representing the panel surface.
-
thickness(float) –The thickness of the panel.
-
vector(:class:`~compas.geometry.Vector`, default:None) –The vector in which the panel is extruded.
-
orientation(:class:`~compas.geometry.Vector`, default:None) –A vector indicating the desired orientation of the panel's local y-axis. If None, orientation is determined from the outline.
-
**kwargs(dict, default:{}) –Additional keyword arguments. These are passed to the :class:
~compas_timber.elements.Panelconstructor.
Returns:
-
class:`~compas_timber.elements.Panel`–A Panel object representing the panel with the given brep and thickness.
Source code in src/compas_timber/elements/panel.py
from_outline_thickness
classmethod
¤
from_outline_thickness(
outline: Polyline,
thickness: float,
vector: Vector | None = None,
openings: list[Polyline] | None = None,
orientation: Vector | None = None,
**kwargs,
)
Constructs a Plate from a polyline outline and a thickness. The outline is the top face of the plate_geometry, and the thickness is the distance to the bottom face.
Parameters:
-
outline(:class:`~compas.geometry.Polyline`) –A polyline representing the outline of the plate geometry.
-
thickness(float) –The thickness of the plate geometry.
-
vector(:class:`~compas.geometry.Vector`, default:None) –The direction of the thickness vector. If None, the thickness vector is determined from the outline.
-
openings(list[:class:`~compas.geometry.Polyline`], default:None) –A list of polyline openings to be added to the plate geometry.
-
orientation(:class:`~compas.geometry.Vector`, default:None) –A vector indicating the desired orientation of the panel's local y-axis. If None, orientation is determined from the outline.
-
**kwargs(dict, default:{}) –Additional keyword arguments to be passed to the constructor.
Returns:
-
class:`~compas_timber.elements.Panel`–A Panel object representing the panel geometry with the given outline and thickness.
Source code in src/compas_timber/elements/panel.py
from_outlines
classmethod
¤
from_outlines(
outline_a,
outline_b,
openings=None,
recognize_doors=False,
horizontal_openings=False,
orientation: Vector | None = None,
**kwargs,
)
Constructs a Panel from two polyline outlines.
Parameters:
-
outline_a(:class:`~compas.geometry.Polyline`) –A polyline representing the principal outline of the panel geometry in global space. For exterior walls, this is the interior side.
-
outline_b(:class:`~compas.geometry.Polyline`) –A polyline representing the associated outline of the panel geometry in global space. For exterior walls, this is the exterior side. This should have the same number of points as outline_a.
-
openings(list[:class:`~compas.geometry.Polyline`], default:None) –A list of window opening polylines to be added to the panel.
-
recognize_doors(bool, default:False) –If True, door features will be extracted from the outlines and added as Openings to the Panel.
-
horizontal_openings(bool, default:False) –If True, openings that are not vertical or horizontal will be extruded horizontally through the Panel.
-
orientation(:class:`~compas.geometry.Vector`, default:None) –A vector indicating the desired orientation of the panel's local y-axis. If None, orientation is determined from the outline.
-
**kwargs(dict, default:{}) –Additional keyword arguments to be passed to the constructor.
Returns:
-
class:`~compas_timber.elements.Panel`–A Panel object representing the panel with the given outlines.
Source code in src/compas_timber/elements/panel.py
get_leaf_layers
¤
Return all layers with no sublayers, in order from outline_a to outline_b.
Source code in src/compas_timber/elements/panel.py
merge_layer_structure
¤
Add all layers in this panel's layer structure to model as children of this panel.
Source code in src/compas_timber/elements/panel.py
remove_features
¤
remove_features(features: PanelFeature | list[PanelFeature] | None = None) -> None
Removes features from the element.
Parameters:
-
features(:class:`~compas_timber.panel_features.PanelFeature` | list[:class:`~compas_timber.panel_features.PanelFeature`], default:None) –The features to be removed. If None, all features will be removed.
Source code in src/compas_timber/elements/panel.py
reset
¤
Resets the element to its initial state by removing all features, extensions, and debug_info.
Source code in src/compas_timber/elements/panel.py
set_extension_plane
¤
Sets an extension plane for a specific edge of the plate. This is called by PanelJoints.
Source code in src/compas_timber/elements/panel.py
transformation_to_local
¤
Plate
¤
Plate(
frame: Frame | None = None,
length: float | None = None,
width: float | None = None,
thickness: float | None = None,
plate_geometry: PlateGeometry | None = None,
**kwargs,
)
A class to represent timber plates (plywood, CLT, etc.) defined by polylines on top and bottom faces of material.
Parameters:
-
frame(:class:`~compas.geometry.Frame`, default:None) –The coordinate system (frame) of this plate, relative to its parent. Defaults to worldXY.
-
length(float, default:None) –Length of the plate. Required when no plate_geometry is provided.
-
width(float, default:None) –Width of the plate. Required when no plate_geometry is provided.
-
thickness(float, default:None) –Thickness of the plate. Required when no plate_geometry is provided.
-
plate_geometry(:class:`~compas_timber.elements.PlateGeometry`, default:None) –A PlateGeometry object defining the plate shape in local space. When provided, dimensions must not be given.
-
**kwargs(dict, default:{}) –Additional keyword arguments.
Attributes:
-
frame(:class:`~compas.geometry.Frame`) –The coordinate system (frame) of this plate.
-
length(float) –Length of the plate.
-
width(float) –Width of the plate.
-
height(float) –Height of the plate (same as thickness).
-
thickness(float) –Thickness of the plate.
-
plate_geometry(:class:`~compas_timber.elements.PlateGeometry`) –The plate geometry object defining the shape of this plate.
-
outline_a(:class:`~compas.geometry.Polyline`) –A polyline representing the principal outline of this plate in global space.
-
outline_b(:class:`~compas.geometry.Polyline`) –A polyline representing the associated outline of this plate in global space.
-
is_plate(bool) –Always True for plates.
-
blank(:class:`~compas.geometry.Box`) –A feature-less box representing the material stock geometry to produce this plate.
-
blank_length(float) –Length of the plate blank.
-
features(list[:class:`~compas_timber.fabrication.BTLxProcessing`]) –List of features applied to this plate.
-
key((int, optional)) –Once plate is added to a model, it will have this model-wide-unique integer key.
Source code in src/compas_timber/elements/plate.py
Methods:¤
apply_edge_extensions
¤
adjusts segments of the outlines to lay on the edge planes created by plate joints.
compute_aabb
¤
Computes the Axis Aligned Bounding Box (AABB) of the element.
Parameters:
-
inflate(float, default:0.0) –Offset of box to avoid floating point errors.
Returns:
-
class:`~compas.geometry.Box`–The AABB of the element.
Source code in src/compas_timber/elements/plate.py
compute_collision_mesh
¤
compute_collision_mesh() -> Mesh
Computes the collision geometry of the element.
Returns:
-
class:`compas.datastructures.Mesh`–The collision geometry of the element.
Source code in src/compas_timber/elements/plate.py
compute_elementgeometry
¤
Compute the geometry of the element.
Parameters:
-
include_features(bool, default:True) –If
True, include the features in the computed geometry. IfFalse, return only the plate shape.
Returns:
-
class:`compas.datastructures.Mesh` | :class:`compas.geometry.Brep`–
Source code in src/compas_timber/elements/plate.py
compute_obb
¤
Computes the Oriented Bounding Box (OBB) of the element.
Returns:
-
class:`compas.geometry.Box`–The OBB of the element.
Source code in src/compas_timber/elements/plate.py
from_brep
classmethod
¤
from_brep(brep: Brep, orientation: Vector | None = None, **kwargs)
Creates a plate from a brep by automatically detecting two parallel faces.
This method identifies the two main faces of the brep using topological analysis (edge counts and adjacency) and uses them as the top and bottom faces of the plate.
Parameters:
-
brep(:class:`~compas.geometry.Brep`) –The brep representing the plate geometry. Must have at least 5 faces.
-
orientation(:class:`~compas.geometry.Vector`, default:None) –A vector indicating the desired orientation of the plate's local y-axis. If None, orientation is determined from the outline.
-
**kwargs(dict, default:{}) –Additional keyword arguments. These are passed to the :class:
~compas_timber.elements.Plateconstructor.
Returns:
-
class:`~compas_timber.elements.Plate`–A Plate object created from the two parallel faces of the brep.
Source code in src/compas_timber/elements/plate.py
from_face_thickness
classmethod
¤
from_face_thickness(
brep: Brep,
thickness: float,
vector: Vector | None = None,
orientation: Vector | None = None,
**kwargs,
)
Creates a plate from a single-face brep.
Parameters:
-
brep(:class:`~compas.geometry.Brep`) –A single-face brep representing the plate surface.
-
thickness(float) –The thickness of the plate.
-
vector(:class:`~compas.geometry.Vector`, default:None) –The vector in which the plate is extruded.
-
orientation(:class:`~compas.geometry.Vector`, default:None) –A vector indicating the desired orientation of the plate's local y-axis. If None, orientation is determined from the outline.
-
**kwargs(dict, default:{}) –Additional keyword arguments. These are passed to the :class:
~compas_timber.elements.Plateconstructor.
Returns:
-
class:`~compas_timber.elements.Plate`–A Plate object representing the plate with the given brep face and thickness.
Source code in src/compas_timber/elements/plate.py
from_outline_thickness
classmethod
¤
from_outline_thickness(
outline: Polyline,
thickness: float,
vector: Vector | None = None,
openings: list[Polyline] | None = None,
orientation: Vector | None = None,
**kwargs,
)
Constructs a Plate from a polyline outline and a thickness. The outline is the top face of the plate_geometry, and the thickness is the distance to the bottom face.
Parameters:
-
outline(:class:`~compas.geometry.Polyline`) –A polyline representing the outline of the plate geometry.
-
thickness(float) –The thickness of the plate geometry.
-
vector(:class:`~compas.geometry.Vector`, default:None) –The direction of the thickness vector. If None, the thickness vector is determined from the outline.
-
openings(list[:class:`~compas.geometry.Polyline`], default:None) –A list of polyline openings to be added to the plate geometry.
-
orientation(:class:`~compas.geometry.Vector`, default:None) –A vector indicating the desired orientation of the plate's local y-axis. If None, orientation is determined from the outline.
-
**kwargs(dict, default:{}) –Additional keyword arguments to be passed to the constructor.
Returns:
-
class:`~compas_timber.elements.Plate`–A Plate object representing the plate geometry with the given outline and thickness.
Source code in src/compas_timber/elements/plate.py
from_outlines
classmethod
¤
from_outlines(
outline_a: Polyline,
outline_b: Polyline,
openings: list[Polyline] | None = None,
orientation: Vector | None = None,
**kwargs,
)
Constructs a Plate from two polyline outlines.
Parameters:
-
outline_a(:class:`~compas.geometry.Polyline`) –A polyline representing the principal outline of the plate geometry in parent space.
-
outline_b(:class:`~compas.geometry.Polyline`) –A polyline representing the associated outline of the plate geometry in parent space. This should have the same number of points as outline_a.
-
openings(list[:class:`~compas.geometry.Polyline`], default:None) –A list of openings to be added to the plate geometry.
-
orientation(:class:`~compas.geometry.Vector`, default:None) –A vector indicating the desired orientation of the plate's local y-axis. If None, orientation is determined from the outline.
-
**kwargs(dict, default:{}) –Additional keyword arguments to be passed to the constructor.
Returns:
-
class:`~compas_timber.elements.Plate`–A Plate object representing the plate geometry with the given outlines.
Source code in src/compas_timber/elements/plate.py
reset
¤
Resets the element to its initial state by removing all features, extensions, and debug_info.
Source code in src/compas_timber/elements/plate.py
set_extension_plane
¤
Sets an extension plane for a specific edge of the plate. This is called by plate joints.
Source code in src/compas_timber/elements/plate.py
PlateFastener
¤
PlateFastener(
outline=None,
thickness=None,
interfaces=None,
frame=None,
angle=pi / 2,
topology=None,
cutouts=None,
**kwargs,
)
A class to represent flat plate timber fasteners (e.g. steel plates).
Parameters:
-
outline(list of :class:`~compas.geometry.Point`, default:None) –The outline of the plate in the local XY plane.
-
thickness(float, default:None) –Thickness of the plate.
-
interfaces(list of :class:`~compas_timber.elements.FastenerTimberInterface, default:None) –The interfaces of the fastener. The order of the interfaces should correspond to the order of the beams in the joint.
-
frame(:class:`~compas.geometry.Frame`, default:None) –The frame of the instance of the fastener that is applied to the model. The fastener should be defined at the XY plane origin with the x-axis pointing in the direction of the main_beam.
-
angle((float, optional(default=pi / 2)), default:pi / 2) –The angle of the fastener. The angle between the beam elements must be the same.
-
topology(int or list of int, default:None) –The supported topology of the joint.
-
cutouts(list of :class:`~compas.geometry.Polyline`, default:None) –A list of cutouts to be subtracted from the base shape of the fastener.
Attributes:
-
geometry(:class:`~compas.geometry.Geometry`) –The geometry of the fastener.
-
frame(:class:`~compas.geometry.Frame`) –The frame of the fastener.
Source code in src/compas_timber/elements/fasteners/plate_fastener.py
Attributes¤
shape
property
¤
Constructs the base shape of the fastener.This is located at the origin of the XY plane with the x-axis pointing in the direction of the main_beam.
Returns:
-
class:`~compas.geometry.Brep`–
Methods:¤
add_features
¤
Adds the geometric features to the beams. TODO: add btlx features in separate function.
Source code in src/compas_timber/elements/fasteners/plate_fastener.py
compute_geometry
¤
Constructs the geometry of the fastener as oriented in space.
Returns:
-
class:`~compas.geometry.Brep`–
Source code in src/compas_timber/elements/fasteners/plate_fastener.py
get_fastener_frames
¤
Calculates the frames of the fasteners.
Returns:
-
class:`~compas.geometry.Frame`–The frames of the fasteners with the x-axis along the main_beam.centerline and the y-axis along the cross_beam.centerline, offset to lay on the beam_faces.
Source code in src/compas_timber/elements/fasteners/plate_fastener.py
place_instances
¤
Adds the fasteners to the joint.
This method is automatically called when joint is created by the call to Joint.create().
Source code in src/compas_timber/elements/fasteners/plate_fastener.py
validate_fastener_beam_compatibility
¤
Checks if the beams are compatible with the joint and sets the front and back face indices.
returns the front and back face indices of the cross beam.
Raises:
-
BeamJoiningError–If the beams are not compatible.
Source code in src/compas_timber/elements/fasteners/plate_fastener.py
PlateGeometry
¤
A class to represent plate-like objects (plate, panel, etc.) defined by polylines on top and bottom faces of shape.
Parameters:
-
local_outline_a(:class:`~compas.geometry.Polyline`) –The principal outline of the plate in local space (projected on worldXY, starting at origin).
-
local_outline_b(:class:`~compas.geometry.Polyline`) –The associated outline of the plate in local space. Must have the same number of points as outline_a, be parallel to outline_a, and be offset in the +Z direction.
Attributes:
-
length(float) –Length of the plate along the local x-axis.
-
width(float) –Width of the plate along the local y-axis.
-
thickness(float) –Thickness of the plate along the local z-axis.
-
outline_a(:class:`~compas.geometry.Polyline`) –The principal outline of the plate in local space (mutable, affected by edge extensions).
-
outline_b(:class:`~compas.geometry.Polyline`) –The associated outline of the plate in local space (mutable, affected by edge extensions).
-
outlines(tuple[:class:`~compas.geometry.Polyline`, :class:`~compas.geometry.Polyline`]) –A tuple containing both outline_a and outline_b.
-
edge_planes(list[:class:`~compas.geometry.Frame`]) –Frames representing the edge planes of the plate.
-
shape(:class:`~compas.geometry.Brep`) –The geometry of the Plate before other machining features are applied.
Source code in src/compas_timber/elements/plate_geometry.py
Methods:¤
apply_edge_extensions
¤
adjusts segments of the outlines to lay on the edge planes created by plate joints.
Source code in src/compas_timber/elements/plate_geometry.py
compute_shape
¤
The shape of the plate before other features area applied.
Returns:
-
class:`~compas.geometry.Brep`–The shape of the element.
Source code in src/compas_timber/elements/plate_geometry.py
from_dims
classmethod
¤
from_dims(length: float, width: float, thickness: float) -> PlateGeometry
Creates a PlateGeometry with a rectangular outline from dimensions.
Parameters:
-
length(float) –Length of the plate along the local x-axis.
-
width(float) –Width of the plate along the local y-axis.
-
thickness(float) –Thickness of the plate along the local z-axis.
Returns:
-
class:`PlateGeometry`–
Source code in src/compas_timber/elements/plate_geometry.py
remove_blank_extension
¤
remove_blank_extension(edge_index: int | None = None)
Reverts any extension plane for the given edge index to the original and adjusts that .
Source code in src/compas_timber/elements/plate_geometry.py
reset
¤
Resets the element outlines to their initial state.
set_extension_plane
¤
Sets an extension plane for a specific edge of the plate. This is called by plate joints.
Source code in src/compas_timber/elements/plate_geometry.py
Functions:¤
global_outlines_to_local
¤
global_outlines_to_local(
outline_a: Polyline, outline_b: Polyline, orientation: Vector | None = None
) -> tuple[Frame, Polyline, Polyline]
Splits two plate outlines in global (world) space into the plate's local frame and its local outlines.
The local outlines lie on worldXY and start at the origin, as :class:PlateGeometry expects them.
The frame places them back in global space, and is what the owning element takes as its frame.
Parameters:
-
outline_a(:class:`~compas.geometry.Polyline`) –Principal outline of the plate in global space.
-
outline_b(:class:`~compas.geometry.Polyline`) –Associated outline of the plate in global space. Must be parallel to outline_a and offset in the plate's normal direction.
-
orientation(:class:`~compas.geometry.Vector`, default:None) –A vector that controls the direction of the local coordinate frame. When provided, the vector is projected onto the outline plane and used to define the local y-axis direction, overriding the frame derived automatically from the outline geometry. If
None, the frame is determined from the outline.
Returns:
-
tuple[:class:`~compas.geometry.Frame`, :class:`~compas.geometry.Polyline`, :class:`~compas.geometry.Polyline`]–The local coordinate frame of the plate in global space, and outline_a and outline_b in local space.