Skip to content

compas_timber.fabrication ¤

Classes¤

AlignmentType ¤

Enum for the alignment of the cut.

Attributes:

  • TOP (literal(top)) –

    Top alignment.

  • BOTTOM (literal(bottom)) –

    Bottom alignment.

  • LEFT (literal(left)) –

    Left alignment.

  • RIGHT (literal(right)) –

    Right alignment.

  • CENTER (literal(center)) –

    Center alignment.

BTLxFromGeometryDefinition ¤

BTLxFromGeometryDefinition(processing, geometries, elements=None, **kwargs)

Container linking a BTLx Process Type and generator function to an input geometry. This allows delaying the actual applying of features to a downstream component.

Parameters:

  • processing (class) –

    The BTLx Processing class.

  • geometries (list of :class:`~compas.geometry.Geometry`) –

    The geometries to be used as input for the processing.

  • elements (list of :class:`~compas_timber.elements.Element`, default: None ) –

    The elements to be used as input for the processing.

Attributes:

  • processing (class) –

    The BTLx Processing class.

  • geometries (list of :class:`~compas.geometry.Geometry`) –

    The geometries to be used as input for the processing.

  • elements (list of :class:`~compas_timber.elements.Element`) –

    The elements to be used as input for the processing.

BTLxPart ¤

BTLxPart(element, order_num, scale_factor=1.0)

Class representing a BTLx part. This acts as a wrapper for an Element object.

Parameters:

  • element (:class:`~compas_timber.elements.TimberElement`) –

    The element object.

  • order_num (int) –

    The order number of the part.

  • scale_factor (float, default: 1.0 ) –

    The scale factor to apply to the part's dimensions. Used when the design unit is anything other than mm. Defaults to 1.0.

Attributes:

  • attr (dict) –

    The attributes of the BTLx part.

  • element (:class:`~compas_model.elements.Element`) –

    The element object.

  • length (float) –

    The length of the element.

  • width (float) –

    The width of the element.

  • height (float) –

    The height of the element.

  • frame (:class:`~compas.geometry.Frame`) –

    The frame of the BTLxPart at the corner of the blank box that puts the blank geometry in positive coordinates.

  • processings (list) –

    A list of the processings applied to the element.

Attributes¤

attr property ¤
attr

Return the attributes dictionary for the part XML element.

part_guid property ¤
part_guid

Return the GUID of the element.

shape_strings property ¤
shape_strings

Generates the shape strings for the BTLxPart. Only works in environments where the element.geometry Brep is available.

Returns:

  • list

    A list of two strings, the first string is the brep indices string, the second string is the brep vertices string.

Functions¤

ref_side_from_face ¤
ref_side_from_face(element_face)

Finds the one-based index of the reference side with normal that matches the normal of the given element face.

This essentially translates between the element face reference system to the BTLx side reference system.

Parameters:

  • element_face (:class:`~compas.geometry.Frame`) –

    The frame of an element face from element.faces.

Returns:

  • key ( str ) –

    The key(index 1-6) of the reference surface.

BTLxProcessing ¤

BTLxProcessing(
    ref_side_index=None,
    priority=0,
    process_id=0,
    tool_id=None,
    counter_sink=None,
    tool_position=None,
    name=None,
    process=None,
    is_joinery=True,
)

Abstract base class for BTLx Processing.

Attributes:

  • ref_side_index (int) –

    The reference side, zero-based, index of the element to be cut. 0-5 correspond to RS1-RS6. Defaults to 0 (RS1).

  • priority (int) –

    The priority of the process.

  • process_id (int) –

    The process ID.

  • tool_id ((int, optional)) –

    The tool ID for the processing. Only used by specific processing types.

  • counter_sink ((bool, optional)) –

    If True, the processing creates a counter sink. Only used by specific processing types.

  • tool_position (:class:`~compas_timber.fabrication.AlignmentType`) –

    The position of the tool relative to the beam. Can be 'left', 'center', or 'right'. Only used by specific processing types.

  • PROCESSING_NAME (str) –

    The name of the process.

  • ATTRIBUTE_MAP (dict) –

    Mapping of BTLx XML attribute names to Python attribute names.

  • HEADER_ATTRIBUTE_MAP (dict) –

    Mapping of BTLx XML header attribute names (in XML attributes) to Python parameter names with converters.

  • is_joinery (bool) –

    If True, the process is a result of joinery process.

  • params (:class:`~compas_timber.fabrication.BTLxProcessingParams`) –

    The BTLx processing parameters for serialization.

Attributes¤

ATTRIBUTE_MAP abstractmethod property ¤
ATTRIBUTE_MAP

Mapping of BTLx XML attribute names to Python attribute names.

PROCESSING_NAME abstractmethod property ¤
PROCESSING_NAME

The name of the processing for BTLx serialization.

Functions¤

add_subprocessing ¤
add_subprocessing(subprocessing)

Add a nested subprocessing.

scaled ¤
scaled(factor)

Returns a new instance of the processing with the parameters scaled by a given factor.

Parameters:

  • factor (float) –

    The scaling factor.

Returns:

  • class:`~compas_timber.fabrication.BTLxProcessing`

    A new instance of the processing with the parameters scaled by the given factor.

BTLxRawpart ¤

BTLxRawpart(stock, order_number, scale_factor=1.0)

Class representing a BTLx Rawpart. This acts as a wrapper for raw material information.

Parameters:

  • stock (:class:`~compas_timber.planning.Stock`) –

    The stock object representing the raw material.

  • order_number (int) –

    The order number for the rawpart.

  • scale_factor (float, default: 1.0 ) –

    The scale factor to apply to dimensions. Defaults to 1.0.

Attributes:

  • stock (:class:`~compas_timber.planning.Stock`) –

    The stock object.

  • attr (dict) –

    The attributes of the BTLx rawpart.

  • length (float) –

    The length of the rawpart.

  • width (float) –

    The width of the rawpart.

  • height (float) –

    The height of the rawpart.

  • frame (:class:`~compas.geometry.Frame`) –

    The frame of the BTLxRawpart.

  • part_refs (list) –

    List of part references that are nested in this rawpart.

Attributes¤

attr property ¤
attr

Return the attributes dictionary for the rawpart XML element.

et_part_refs property ¤
et_part_refs

Create the part references XML element.

part_guid property ¤
part_guid

Return the cached GUID for this rawpart.

Functions¤

add_part_ref ¤
add_part_ref(part_guid, position_frame)

Add a part reference to this rawpart.

Parameters:

  • part_guid (str) –

    The GUID of the part to reference.

  • position_frame (:class:`~compas.geometry.Frame`) –

    The position frame of the part within the rawpart.

BTLxWriter ¤

BTLxWriter(project_name=None, company_name=None, file_name=None, comment=None)

Class for writing BTLx files from a given model.

BTLx is a format used for representing timber fabrication data.

Use BTLxWriter.write() to write a BTLx file from a model and a file path.

Parameters:

  • company_name (str, default: None ) –

    The name of the company. Defaults to "Gramazio Kohler Research".

  • file_name (str, default: None ) –

    The name of the file. Defaults to None.

  • comment (str, default: None ) –

    A comment to be included in the file. Defaults to None.

Functions¤

model_to_xml ¤
model_to_xml(model, nesting_result=None)

Converts the model to an XML string.

Parameters:

  • model (:class:`~compas_timber.model.TimberModel`) –

    The model object.

  • nesting_result (:class:`~compas_timber.planning.NestingResult`, default: None ) –

    The nesting result object. If provided, raw parts will be created for each stock in the nesting result.

Returns:

  • str

    The XML string of the BTLx file.

See Also

:meth:BTLxWriter.write

register_type_serializer classmethod ¤
register_type_serializer(type_, serializer)

Register a type and its serializer.

Parameters:

  • type_ (type) –

    The type to be serialized.

  • serializer (callable) –

    The serializer function. Takes an instance of type_ and returns an XML element which correspondes with it.

write ¤
write(model, file_path, nesting_result=None)

Writes the BTLx file to the given file path.

Parameters:

  • model (:class:`~compas_timber.model.TimberModel`) –

    The model object.

  • file_path (str) –

    The file path to write the BTLx file to.

  • nesting_result (:class:`~compas_timber.planning.NestingResult`, default: None ) –

    The nesting result object. If provided, raw parts will be created for each stock in the nesting result.

Returns:

  • str

    The XML string of the BTLx file.

See Also

:meth:BTLxWriter.model_to_xml

Contour ¤

Contour(polyline, depth, depth_bounded=True, inclination=None)

Represens the generic contour for specific free contour processings.

Todo

add point attributes for other types like NailContour

Parameters:

  • polyline (:class:`compas.geometry.Polyline`) –

    The polyline of the contour.

  • depth (float) –

    The depth of the contour.

  • depth_bounded (bool, default: True ) –

    If True, the depth is bounded.

  • inclination (list[float], default: None ) –

    The inclination of the contour.

Functions¤

scale ¤
scale(factor)

Scale the contour by a given factor.

Parameters:

  • factor (float) –

    The scaling factor.

scaled ¤
scaled(factor)

Returns a new instance of the contour with the parameters scaled by a given factor.

Parameters:

  • factor (float) –

    The scaling factor.

Returns:

  • class:`~compas_timber.fabrication.Contour`

    A new instance of the contour with the parameters scaled by the given factor.

to_brep ¤
to_brep()

Convert the contour to a COMPAS Brep object.

Returns:

  • class:`~compas.geometry.Brep`

    The brep representation of the contour.

DoubleCut ¤

DoubleCut(
    orientation=START,
    start_x=0.0,
    start_y=50.0,
    angle_1=45.0,
    inclination_1=90.0,
    angle_2=90.0,
    inclination_2=90.0,
    **kwargs,
)

Represents a Double Cut feature to be made on a beam.

Parameters:

  • orientation (int, default: START ) –

    The orientation of the cut. Must be either OrientationType.START or OrientationType.END.

  • start_x (float, default: 0.0 ) –

    The start x-coordinate of the cut in parametric space of the reference side. -100000.0 < start_x < 100000.0.

  • start_y (float, default: 50.0 ) –

    The start y-coordinate of the cut in parametric space of the reference side. 0.0 < start_y < 50000.0.

  • angle_1 (float, default: 45.0 ) –

    The horizontal angle of the first cut. 0.1 < angle_1 < 179.9.

  • inclination_1 (float, default: 90.0 ) –

    The vertical angle of the first cut. 0.1 < inclination_1 < 179.9.

  • angle_2 (float, default: 90.0 ) –

    The horizontal angle of the second cut. 0.1 < angle_2 < 179.9.

  • inclination_2 (float, default: 90.0 ) –

    The vertical angle of the second cut. 0.1 < inclination_2 < 179.9.

Functions¤

apply ¤
apply(geometry, beam)

Apply the feature to the beam geometry.

Parameters:

  • geometry (:class:`~compas.geometry.Brep`) –

    The beam geometry to be cut.

  • beam (:class:`compas_timber.elements.Beam`) –

    The beam that is cut by this instance.

Raises:

  • :class:`~compas_timber.errors.FeatureApplicationError`

    If the cutting plane does not intersect with beam geometry.

Returns:

  • class:`~compas.geometry.Brep`

    The resulting geometry after processing

from_planes_and_beam classmethod ¤
from_planes_and_beam(planes, beam, ref_side_index=None, **kwargs)

Create a DoubleCut instance from two cutting planes and the beam they should cut.

Parameters:

  • planes (list of :class:`~compas.geometry.Plane` or :class:`~compas.geometry.Frame`) –

    The two cutting planes that define the double cut.

  • beam (:class:`~compas_timber.elements.Beam`) –

    The beam that is cut by this instance.

  • ref_side_index (int, default: None ) –

    The reference side index of the beam to be cut. Default is 0 (i.e. RS1).

Returns:

  • class:`~compas_timber.fabrication.DoubleCut`
from_shapes_and_element classmethod ¤
from_shapes_and_element(plane_a, plane_b, element, **kwargs)

Construct a DoubleCut process from a two planes and an element.

Parameters:

  • plane_a (:class:`compas.geometry.Plane`) –

    The first cutting plane.

  • plane_b (:class:`compas.geometry.Plane`) –

    The second cutting plane.

  • element (:class:`compas_timber.elements.Element`) –

    The element to be cut.

Returns:

  • class:`compas_timber.fabrication.DoubleCut`

    The constructed double cut process.

planes_from_params_and_beam ¤
planes_from_params_and_beam(beam)

Calculates the cutting planeS from the machining parameters in this instance and the given beam

Parameters:

  • beam (:class:`compas_timber.elements.Beam`) –

    The beam that is cut by this instance.

Returns:

  • list of :class:`~compas.geometry.Plane`

    The cutting planes for this instance

scale ¤
scale(factor)

Scale the parameters of the processing by the given factor.

Notes

Only distances are scaled, angles remain unchanged.

Parameters:

  • factor (float) –

    The scaling factor. A value of 1.0 means no scaling, while a value of 2.0 means doubling the size.

DoubleCutProxy ¤

DoubleCutProxy(planes, element, ref_side_index=None)

This object behaves like a DoubleCut except it only calculates the machining parameters once unproxified. Can also be used to defer the creation of the processing instance until it is actually needed.

Until then, it can be used to visualize the machining operation. This slightly improves performance.

Parameters:

  • planes (list of :class:`~compas.geometry.Plane` or :class:`~compas.geometry.Frame`) –

    The two cutting planes that define the double cut.

  • element (:class:`~compas_timber.elements.TimberElement`) –

    The element that is cut by this instance.

  • ref_side_index (int, default: None ) –

    The reference side index of the beam to be cut. Default is None.

Functions¤

apply ¤
apply(geometry, beam)

Apply the feature to the beam geometry.

Parameters:

  • geometry (:class:`~compas.geometry.Brep`) –

    The beam geometry to be cut.

  • beam (:class:`compas_timber.elements.Beam`) –

    The beam that is cut by this instance.

Raises:

  • :class:`~compas_timber.errors.FeatureApplicationError`

    If the cutting planes do not intersect with beam geometry.

Returns:

  • class:`~compas.geometry.Brep`

    The resulting geometry after processing.

from_planes_and_beam classmethod ¤
from_planes_and_beam(planes, beam, ref_side_index=None)

Create a DoubleCutProxy instance from two cutting planes and the beam they should cut.

Parameters:

  • planes (list of :class:`~compas.geometry.Plane` or :class:`~compas.geometry.Frame`) –

    The two cutting planes that define the double cut.

  • beam (:class:`~compas_timber.elements.Beam`) –

    The beam that is cut by this instance.

  • ref_side_index (int, default: None ) –

    The reference side index of the beam to be cut. Default is None.

Returns:

  • class:`~compas_timber.fabrication.DoubleCutProxy`
from_shapes_and_element classmethod ¤
from_shapes_and_element(plane_a, plane_b, element, **kwargs)

Construct a DoubleCutProxy from two planes and an element.

Parameters:

  • plane_a (:class:`compas.geometry.Plane`) –

    The first cutting plane.

  • plane_b (:class:`compas.geometry.Plane`) –

    The second cutting plane.

  • element (:class:`compas_timber.elements.Element`) –

    The element to be cut.

Returns:

  • class:`~compas_timber.fabrication.DoubleCutProxy`

    The constructed double cut proxy.

unproxified ¤
unproxified()

Returns the unproxified processing instance.

Returns:

  • class:`~compas_timber.fabrication.DoubleCut`

DovetailMortise ¤

DovetailMortise(
    start_x=0.0,
    start_y=50.0,
    start_depth=0.0,
    angle=0.0,
    slope=90.0,
    inclination=90.0,
    limitation_top=LIMITED,
    length_limited_bottom=True,
    length=80.0,
    width=40.0,
    depth=28.0,
    cone_angle=15.0,
    use_flank_angle=False,
    flank_angle=15.0,
    shape=AUTOMATIC,
    shape_radius=20.0,
    **kwargs,
)

Represents a Dovetail Mortise feature to be made on a beam.

Parameters:

  • start_x (float, default: 0.0 ) –

    The start x-coordinate of the cut in parametric space of the reference side. Distance from the beam start to the reference point. -100000.0 < start_x < 100000.0.

  • start_y (float, default: 50.0 ) –

    The start y-coordinate of the cut in parametric space of the reference side. Distance from the reference edge to the reference point. -5000.0 < start_y < 5000.0.

  • start_depth (float, default: 0.0 ) –

    The start depth of the cut in parametric space of the reference side. Margin on the reference side. 0.0 < start_depth < 5000.0.

  • angle (float, default: 0.0 ) –

    The angle of the cut. Angle between edge and reference edge. -180.0 < angle < 180.0.

  • slope (float, default: 90.0 ) –

    The slope of the cut. Angle between axis along the length of the mortise and rederence side. 0.1 < slope < 179.9.

  • inclination (float, default: 90.0 ) –

    The inclination of the cut. Angle between axis along the width of the mortise and rederence side. 0.1 < inclination < 179.9.

  • limitation_top (str, default: LIMITED ) –

    The limitation type of the top length of the cut. Should be either 'limited', 'unlimited', or 'pocket'.

  • length_limited_bottom (bool, default: True ) –

    Whether the bottom length of the cut is limited. True or False.

  • length (float, default: 80.0 ) –

    The length of the cut. 0.0 < length < 5000.0.

  • width (float, default: 40.0 ) –

    The width of the cut. 0.0 < width < 1000.0.

  • depth (float, default: 28.0 ) –

    The depth of the mortise. 0.0 < depth < 1000.0.

  • cone_angle (float, default: 15.0 ) –

    The cone angle of the cut. 0.0 < cone_angle < 30.0.

  • use_flank_angle (bool, default: False ) –

    Whether the flank angle is used. True or False.

  • flank_angle (float, default: 15.0 ) –

    The flank angle of the cut. Angle of the tool. 5.0 < flank_angle < 35.0.

  • shape (str, default: AUTOMATIC ) –

    The shape of the cut. Must be either 'automatic', 'square', 'round', 'rounded', or 'radius'.

  • shape_radius (float, default: 20.0 ) –

    The radius of the shape of the cut. 0.0 < shape_radius < 1000.0.

Functions¤

apply ¤
apply(geometry, beam)

Apply the feature to the beam geometry.

Parameters:

  • geometry (:class:`compas.geometry.Brep`) –

    The geometry to be processed.

  • beam (:class:`compas_timber.elements.Beam`) –

    The beam that is milled by this instance.

Raises:

  • :class:`~compas_timber.errors.FeatureApplicationError`

    If the cutting planes do not create a volume that itersects with beam geometry or any step fails.

Returns:

  • class:`~compas.geometry.Brep`

    The resulting geometry after processing

define_dovetail_tool classmethod ¤
define_dovetail_tool(tool_angle, tool_diameter, tool_height)

Define the parameters for the dovetail feature based on a defined dovetail cutting tool.

Parameters:

  • tool_angle (float) –

    The angle of the dovetail cutter tool.

  • tool_diameter (float) –

    The diameter of the dovetail cutter tool.

  • tool_height (float) –

    The height of the dovetail cutter tool.

dovetail_cutting_frames_from_params_and_beam ¤
dovetail_cutting_frames_from_params_and_beam(beam)

Calculates the cutting frames for the dovetail mortise from the machining parameters in this instance and the given beam.

Parameters:

  • beam (:class:`compas_timber.elements.Beam`) –

    The beam that is cut by this instance.

Returns:

  • list of :class:`compas.geometry.Frame`

    The cutting frames for the dovetail mortise.

dovetail_volume_from_params_and_beam ¤
dovetail_volume_from_params_and_beam(beam)

Calculates the dovetail mortise volume from the machining parameters in this instance and the given beam.

Parameters:

  • beam (:class:`compas_timber.elements.Beam`) –

    The beam that is cut by this instance.

Returns:

  • class:`compas.geometry.Brep`

    The mortise volume.

frame_from_params_and_beam ¤
frame_from_params_and_beam(beam)

Calculates the cutting frame from the machining parameters in this instance and the given beam

Parameters:

  • beam (:class:`compas_timber.elements.Beam`) –

    The beam that is cut by this instance.

Returns:

  • class:`compas.geometry.Frame`

    The cutting frame.

from_frame_and_beam classmethod ¤
from_frame_and_beam(
    frame,
    beam,
    start_depth=0.0,
    angle=0.0,
    length=80.0,
    width=40.0,
    depth=28.0,
    cone_angle=10.0,
    flank_angle=15.0,
    shape=AUTOMATIC,
    shape_radius=20.0,
    ref_side_index=0,
    **kwargs,
)

Create a DovetailMortise instance from a cutting surface and the beam it should cut. This could be the ref_side of the cross beam of a Joint and the cross beam.

Parameters:

  • frame (:class:`~compas.geometry.Frame` or :class:`~compas.geometry.Plane`) –

    The cutting frame.

  • beam (:class:`~compas_timber.elements.Beam`) –

    The beam that is cut by this instance.

  • start_depth (float, default: 0.0 ) –

    The start depth of the cut along the y-axis of the beam. This offset is to be used in case of housing. Default is 0.0.

  • angle (float, default: 0.0 ) –

    The angle of the cut.

  • length (float, default: 80.0 ) –

    The length of the mortise.

  • width (float, default: 40.0 ) –

    The width of the mortise.

  • depth (float, default: 28.0 ) –

    The depth of the mortise. The equivalent value of the DovetailTenon BTLxProcessing is the height.

  • cone_angle (float, default: 10.0 ) –

    The cone angle of the dovetail mortise.

  • flank_angle (float, default: 15.0 ) –

    The flank angle of the dovetail mortise.

  • shape (str, default: AUTOMATIC ) –

    The shape of the dovetail mortise in regards to it's edges. Default is 'automatic'.

  • shape_radius (float, default: 20.0 ) –

    The radius of the shape of the dovetail mortise. Default is 20.0.

  • ref_side_index (int, default: 0 ) –

    The reference side index of the beam to be cut. Default is 0 (i.e. RS1).

Returns:

  • class:`~compas_timber.fabrication.DovetailMortise`
scale ¤
scale(factor)

Scale the parameters of this processing by a given factor.

Notes

Only distances are scaled, angles remain unchanged.

Parameters:

  • factor (float) –

    The scaling factor. A value of 1.0 means no scaling, while a value of 2.0 means doubling the size.

DovetailTenon ¤

DovetailTenon(
    orientation=START,
    start_x=0.0,
    start_y=50.0,
    start_depth=50.0,
    angle=90.0,
    inclination=90.0,
    rotation=90.0,
    length_limited_top=True,
    length_limited_bottom=True,
    length=80.0,
    width=40.0,
    height=28.0,
    cone_angle=15.0,
    use_flank_angle=False,
    flank_angle=15.0,
    shape=AUTOMATIC,
    shape_radius=20.0,
    **kwargs,
)

Represents a Dovetail Tenon feature to be made on a beam.

Parameters:

  • orientation (int, default: START ) –

    The orientation of the cut. Must be either OrientationType.START or OrientationType.END.

  • start_x (float, default: 0.0 ) –

    The start x-coordinate of the cut in parametric space of the reference side. Distance from the beam start to the reference point. -100000.0 < start_x < 100000.0.

  • start_y (float, default: 50.0 ) –

    The start y-coordinate of the cut in parametric space of the reference side. Distance from the reference edge to the reference point. -5000.0 < start_y < 5000.0.

  • start_depth (float, default: 50.0 ) –

    The start depth of the cut in parametric space of the reference side. Margin on the reference side. -5000.0 < start_depth < 5000.0.

  • angle (float, default: 90.0 ) –

    The angle of the cut. Angle between edge and reference edge. 0.1 < angle < 179.9.

  • inclination (float, default: 90.0 ) –

    The inclination of the cut. Inclination between face and reference side. 0.1 < inclination < 179.9.

  • rotation (float, default: 90.0 ) –

    The rotation of the cut. Angle between axis of the tenon and rederence side. 0.1 < rotation < 179.9.

  • length_limited_top (bool, default: True ) –

    Whether the top length of the cut is limited. True or False.

  • length_limited_bottom (bool, default: True ) –

    Whether the bottom length of the cut is limited. True or False.

  • length (float, default: 80.0 ) –

    The length of the cut. 0.0 < length < 5000.0.

  • width (float, default: 40.0 ) –

    The width of the cut. 0.0 < width < 1000.0.

  • height (float, default: 28.0 ) –

    The height of the tenon. 0.0 < height < 1000.0.

  • cone_angle (float, default: 15.0 ) –

    The cone angle of the cut. 0.0 < cone_angle < 30.0.

  • use_flank_angle (bool, default: False ) –

    Whether the flank angle is used. True or False.

  • flank_angle (float, default: 15.0 ) –

    The flank angle of the cut. Angle of the tool. 5.0 < flank_angle < 35.0.

  • shape (str, default: AUTOMATIC ) –

    The shape of the cut. Must be either 'automatic', 'square', 'round', 'rounded', or 'radius'.

  • shape_radius (float, default: 20.0 ) –

    The radius of the shape of the cut. 0.0 < shape_radius < 1000.0.

Functions¤

apply ¤
apply(geometry, beam)

Apply the feature to the beam geometry.

Parameters:

  • geometry (:class:`compas.geometry.Brep`) –

    The geometry to be processed.

  • beam (:class:`compas_timber.elements.Beam`) –

    The beam that is milled by this instance.

Raises:

  • :class:`~compas_timber.errors.FeatureApplicationError`

    If the cutting frames do not create a volume that itersects with beam geometry or any step fails.

Returns:

  • class:`~compas.geometry.Brep`

    The resulting geometry after processing

define_dovetail_tool classmethod ¤
define_dovetail_tool(tool_angle, tool_diameter, tool_height)

Define the parameters for the dovetail feature based on a defined dovetail cutting tool.

Parameters:

  • tool_angle (float) –

    The angle of the dovetail cutter tool.

  • tool_diameter (float) –

    The diameter of the dovetail cutter tool.

  • tool_height (float) –

    The height of the dovetail cutter tool.

dovetail_cutting_frames_from_params_and_beam ¤
dovetail_cutting_frames_from_params_and_beam(beam)

Calculates the cutting frames for the dovetail tenon from the machining parameters in this instance and the given beam.

dovetail_volume_from_params_and_beam ¤
dovetail_volume_from_params_and_beam(beam)

Calculates the dovetail tenon volume from the machining parameters in this instance and the given beam.

Parameters:

  • beam (:class:`compas_timber.elements.Beam`) –

    The beam that is cut by this instance.

Returns:

  • class:`compas.geometry.Brep`

    The tenon volume.

frame_from_params_and_beam ¤
frame_from_params_and_beam(beam)

Calculates the cutting frame from the machining parameters in this instance and the given beam.

Parameters:

  • beam (:class:`compas_timber.elements.Beam`) –

    The beam that is cut by this instance.

Returns:

  • class:`compas.geometry.Frame`

    The cutting frame.

from_plane_and_beam classmethod ¤
from_plane_and_beam(
    plane,
    beam,
    start_y=0.0,
    start_depth=50.0,
    rotation=0.0,
    length=80.0,
    width=40.0,
    height=28.0,
    cone_angle=10.0,
    flank_angle=15.0,
    shape=AUTOMATIC,
    shape_radius=20.0,
    ref_side_index=0,
)

Create a DovetailTenon instance from a cutting surface and the beam it should cut. This could be the ref_side of the cross beam of a Joint and the main beam.

Parameters:

  • plane (:class:`~compas.geometry.Plane` or :class:`~compas.geometry.Frame`) –

    The cutting plane.

  • beam (:class:`~compas_timber.elements.Beam`) –

    The beam that is cut by this instance.

  • start_y (float, default: 0.0 ) –

    The start y-coordinate of the cut in parametric space of the reference side. Default is 0.0.

  • start_depth (float, default: 50.0 ) –

    The start depth of the tenon, which is an offset along the normal of the reference side. Default is 50.0.

  • rotation (float, default: 0.0 ) –

    The angle of rotation of the tenon. Default is 0.0.

  • length (float, default: 80.0 ) –

    The length of the tenon. Default is 80.0.

  • width (float, default: 40.0 ) –

    The width of the bottom edge of the tenon. Default is 40.0.

  • height (float, default: 28.0 ) –

    The height of the tenon. Related to the dovetail tool and can be defined using the DovetailTenon.define_dovetail_tool() method. Default is 28.0.

  • cone_angle (float, default: 10.0 ) –

    The angle of the cone of the tenon. Default is 10.0.

  • flank_angle (float, default: 15.0 ) –

    The angle of the flank of the tenon. Related to the dovetail tool and can be defined using the DovetailTenon.define_dovetail_tool() method. Default is 15.0.

  • shape (str, default: AUTOMATIC ) –

    The shape of the tenon. Default is 'automatic'.

  • shape_radius (float, default: 20.0 ) –

    The radius of the shape of the tenon. Related to the dovetail tool and can be defined using the DovetailTenon.define_dovetail_tool() method. Default is 20.0.

  • ref_side_index (int, default: 0 ) –

    The reference side index of the beam to be cut. Default is 0 (i.e. RS1).

Returns:

  • class:`~compas_timber.fabrication.DovetailTenon`
scale ¤
scale(factor)

Scale the parameters of the processing by the given factor.

Notes

Only distances are scaled, angles remain unchanged.

Parameters:

  • factor (float) –

    The scaling factor. A value of 1.0 means no scaling, while a value of 2.0 means doubling the size.

Drilling ¤

Drilling(
    start_x=0.0,
    start_y=0.0,
    angle=0.0,
    inclination=90.0,
    depth_limited=False,
    depth=50.0,
    diameter=20.0,
    **kwargs,
)

Represents a drilling processing.

Parameters:

  • start_x (float, default: 0.0 ) –

    The x-coordinate of the start point of the drilling. In the local coordinate system of the reference side.

  • start_y (float, default: 0.0 ) –

    The y-coordinate of the start point of the drilling. In the local coordinate system of the reference side.

  • angle (float, default: 0.0 ) –

    The rotation angle of the drilling. In degrees. Around the z-axis of the reference side.

  • inclination (float, default: 90.0 ) –

    The inclination angle of the drilling. In degrees. Around the y-axis of the reference side.

  • depth_limited (bool, default: True ) –

    If True, the drilling depth is limited to depth. Otherwise, drilling will go through the element.

  • depth (float, default: 50.0 ) –

    The depth of the drilling. In mm.

  • diameter (float, default: 20.0 ) –

    The diameter of the drilling. In mm.

Functions¤

apply ¤
apply(geometry, element)

Apply the feature to the element geometry.

Raises:

  • :class:`compas_timber.errors.FeatureApplicationError`

    If the cutting plane does not intersect with the element geometry.

Returns:

  • class:`compas.geometry.Brep`

    The resulting geometry after processing.

cylinder_from_params_and_element ¤
cylinder_from_params_and_element(element)

Construct the geometry of the drilling using the parameters in this instance and the element object.

Parameters:

  • element (:class:`compas_timber.elements.Element`) –

    The element to drill.

Returns:

  • class:`compas.geometry.Cylinder`

    The constructed cylinder.

from_line_and_element classmethod ¤
from_line_and_element(line, element, diameter)

Construct a drilling process from a line and diameter.

Todo

change this to point + vector instead of line. line is too fragile, it can be flipped and cause issues. make a from point alt. constructor that takes a point and a reference side and makes a straight drilling through.

Parameters:

  • line (:class:`compas.geometry.Line`) –

    The line on which the drilling is to be made.

  • element (:class:`compas_timber.elements.Element`) –

    The element to drill.

  • diameter (float) –

    The diameter of the drilling.

Returns:

  • class:`compas_timber.fabrication.Drilling`

    The constructed drilling processing.

from_shapes_and_element classmethod ¤
from_shapes_and_element(line, element, diameter, **kwargs)

Construct a drilling process from a line, element and diameter.

Parameters:

  • line (:class:`compas.geometry.Line`) –

    The line on which the drilling is to be made.

  • element (:class:`compas_timber.elements.Element`) –

    The element to drill.

  • diameter (float) –

    The diameter of the drilling.

Returns:

  • class:`compas_timber.fabrication.Drilling`

    The constructed drilling process.

scale ¤
scale(factor)

Scale the parameters of this processing by a given factor.

Notes

Only distances are scaled, angles remain unchanged.

Parameters:

  • factor (float) –

    The scaling factor. A value of 1.0 means no scaling, while a value of 2.0 means doubling the size.

DrillingProxy ¤

DrillingProxy(line, element, diameter)

This object behaves like a Drilling except it only calculates the machining parameters once unproxified. Can also be used to defer the creation of the processing instance until it is actually needed.

Until then, it can be used to visualize the machining operation. This slightly improves performance.

Parameters:

  • line (:class:`~compas.geometry.Line`) –

    The line on which the drilling is to be made.

  • element (:class:`~compas_timber.elements.Element`) –

    The element to drill.

  • diameter (float) –

    The diameter of the drilling.

Functions¤

apply ¤
apply(geometry, element)

Apply the feature to the element geometry.

Parameters:

  • geometry (:class:`~compas.geometry.Brep`) –

    The element geometry to drill.

  • element (:class:`~compas_timber.elements.Element`) –

    The element to drill.

Raises:

  • :class:`~compas_timber.errors.FeatureApplicationError`

    If the drill geometry does not intersect with element geometry.

Returns:

  • class:`~compas.geometry.Brep`

    The resulting geometry after processing.

from_line_and_element classmethod ¤
from_line_and_element(line, element, diameter)

Construct a DrillingProxy from a line and diameter.

Parameters:

  • line (:class:`~compas.geometry.Line`) –

    The line on which the drilling is to be made.

  • element (:class:`~compas_timber.elements.Element`) –

    The element to drill.

  • diameter (float) –

    The diameter of the drilling.

Returns:

  • class:`~compas_timber.fabrication.DrillingProxy`

    The constructed drilling proxy.

from_shapes_and_element classmethod ¤
from_shapes_and_element(line, element, diameter, **kwargs)

Construct a DrillingProxy from a line, element and diameter.

Parameters:

  • line (:class:`~compas.geometry.Line`) –

    The line on which the drilling is to be made.

  • element (:class:`~compas_timber.elements.Element`) –

    The element to drill.

  • diameter (float) –

    The diameter of the drilling.

Returns:

  • class:`~compas_timber.fabrication.DrillingProxy`

    The constructed drilling proxy.

unproxified ¤
unproxified()

Returns the unproxified processing instance.

Returns:

  • class:`~compas_timber.fabrication.Drilling`

DualContour ¤

DualContour(principal_contour, associated_contour, depth_bounded=None)

Represens the generic contour for specific free contour processings.

Todo

add point attributes for other types like NailContour

Parameters:

  • principal_contour (:class:`compas.geometry.Polyline`) –

    The principal contour of the dual contour.

  • associated_contour (:class:`compas.geometry.Polyline`) –

    The associated contour of the dual contour. Must have same number of segments as principal_contour.

  • depth_bounded (bool, default: None ) –

    If True, the depth is bounded.

Functions¤

scale ¤
scale(factor)

Scale the dual contour by a given factor.

Parameters:

  • factor (float) –

    The scaling factor.

scaled ¤
scaled(factor)

Returns a new instance of the dual contour with the parameters scaled by a given factor.

Parameters:

  • factor (float) –

    The scaling factor.

Returns:

  • class:`~compas_timber.fabrication.DualContour`

    A new instance of the dual contour with the parameters scaled by the given factor.

EdgePositionType ¤

Enum for the edge position of the cut.

Attributes:

  • REFEDGE (literal(refedge)) –

    Reference edge.

  • OPPEDGE (literal(oppedge)) –

    Opposite edge.

FreeContour ¤

FreeContour(
    contour_param_object,
    tool_id=0,
    counter_sink=False,
    tool_position=LEFT,
    depth_bounded=True,
    **kwargs,
)

Represents a free contour processing.

Parameters:

  • contour_param_object (:class:`compas_timber.fabrication.btlx.Contour` or :class:`compas_timber.fabrication.btlx.DualContour`) –

    The contour parameter object.

  • tool_id (int, default: 0 ) –

    The tool ID for the processing. Default is 0.

  • counter_sink (bool, default: False ) –

    If True, the contour is a counter sink. Default is False.

  • tool_position (:class:`~compas_timber.fabrication.AlignmentType`, default: LEFT ) –

    The position of the tool relative to the beam. Can be 'left', 'center', or 'right'.

  • depth_bounded (bool, default: True ) –

    If True, the depth is bounded. Default is False, meaning the machining will cut all the way through the element.

Attributes¤

params property ¤
params

Returns custom BTLx processing parameters that handle polymorphic contour serialization.

Returns:

  • class:`~compas_timber.fabrication.BTLxProcessingParams`

    Custom processing parameters that choose between Contour/DualContour based on runtime type.

Functions¤

apply ¤
apply(geometry, element)

Apply the feature to the beam geometry.

Raises:

  • :class:`compas_timber.errors.FeatureApplicationError`

    If the cutting plane does not intersect with the beam geometry.

Returns:

  • class:`compas.geometry.Brep`

    The resulting geometry after processing.

from_polyline_and_element classmethod ¤
from_polyline_and_element(
    polyline: Polyline,
    element: TimberElement,
    depth: float | None = None,
    interior: bool | None = False,
    tool_position: str | None = None,
    ref_side_index: int | None = None,
    **kwargs,
)

Construct a Contour processing from a polyline and element.

Parameters:

  • polyline (list of :class:`compas.geometry.Point`) –

    The polyline of the contour.

  • element (:class:`compas_timber.elements.Beam` or :class:`compas_timber.elements.Plate`) –

    The element.

  • depth (float, default: None ) –

    The depth of the contour. Default is the thickness of the element.

  • interior (bool, default: False ) –

    If True, the contour is an interior contour. Default is False.

  • tool_position (AlignmentType, default: None ) –

    The position of the tool. Default is "left".

  • ref_side_index (int, default: None ) –

    The reference side index. If none is given, the function will try to find the reference side index based on the polyline and element.

from_shapes_and_element classmethod ¤
from_shapes_and_element(polyline, element, depth=None, interior=True, **kwargs)

Construct a Contour processing from a list of shapes and element.

Parameters:

  • polyline (list of :class:`compas.geometry.Point`) –

    The polyline of the contour.

  • element (:class:`compas_timber.elements.Beam` or :class:`compas_timber.elements.Plate`) –

    The element.

  • depth (float, default: None ) –

    The depth of the contour. Default is the width of the element.

  • interior (bool, default: True ) –

    If True, the contour is an interior contour. Default is True.

from_top_bottom_and_elements classmethod ¤
from_top_bottom_and_elements(
    top_polyline,
    bottom_polyline,
    element,
    interior=False,
    tool_position=None,
    ref_side_index=None,
    **kwargs,
)

Construct a Contour processing from a list of polylines and element.

Parameters:

  • top_polyline (list of list of :class:`compas.geometry.Point`) –

    The top and bottom polylines of the contour.

  • bottom_polyline (list of list of :class:`compas.geometry.Point`) –

    The bottom polyline of the contour.

  • element (:class:`compas_timber.elements.Beam` or :class:`compas_timber.elements.Plate`) –

    The element.

  • interior (bool, default: False ) –

    If True, the contour is an interior contour. Default is False.

  • tool_position (AlignmentType, default: None ) –

    The position of the tool. Default is None.

  • ref_side_index (int, default: None ) –

    The reference side index. If none is given, the function will try to find the reference side index based on the polylines and element.

scale ¤
scale(factor)

Scale the parameters of this processing by a given factor.

Notes

Only distances are scaled, angles remain unchanged.

Parameters:

  • factor (float) –

    The scaling factor. A value of 1.0 means no scaling, while a value of 2.0 means doubling the size.

FrenchRidgeLap ¤

FrenchRidgeLap(
    orientation=START,
    start_x=0.0,
    angle=90.0,
    ref_position=REFEDGE,
    drillhole=False,
    drillhole_diam=0.0,
    **kwargs,
)

Represents a French Ridge Lap feature to be made on a beam.

Parameters:

  • orientation (int, default: START ) –

    The orientation of the cut. Must be either OrientationType.START or OrientationType.END.

  • start_x (float, default: 0.0 ) –

    The start x-coordinate of the cut in parametric space of the reference side. -100000.0 < start_x < 100000.0.

  • angle (float, default: 90.0 ) –

    The horizontal angle of the cut. 0.1 < angle < 179.9.

  • ref_position

    The reference position of the cut. Must be either EdgePositionType.REFEDGE or EdgePositionType.OPPEDGE.

  • drillhole (bool, default: False ) –

    Flag indicating if a drill hole should be made.

  • drillhole_diam (float, default: 0.0 ) –

    The diameter of the drill hole.

Functions¤

apply ¤
apply(geometry, beam)

Apply the feature to the beam geometry.

Parameters:

  • geometry (:class:`~compas.geometry.Brep`) –

    The beam geometry to be cut.

  • beam (:class:`compas_timber.elements.Beam`) –

    The beam that is cut by this instance.

Raises:

  • :class:`~compas_timber.errors.FeatureApplicationError`

    If the cutting plane does not intersect with beam geometry.

Returns:

  • class:`~compas.geometry.Brep`

    The resulting geometry after processing

frame_from_params_and_beam ¤
frame_from_params_and_beam(beam)

Calculates the frame that cuts the exceeding part of the blank of the beam from the machining parameters and the given beam.

Parameters:

  • beam (:class:`compas_timber.elements.Beam`) –

    The beam that is cut by this instance.

Returns:

  • class:`compas.geometry.Frame`

    The cutting frame.

from_beam_beam_and_plane classmethod ¤
from_beam_beam_and_plane(beam, other_beam, plane, drillhole_diam=0.0, ref_side_index=0)

Create a FrenchRidgeLap instance from two beams and a cutting plane. The instance is used to cut the principal beam with the other beam. The plane is the furthest reference side of the other beam that cuts the exceeding part of the principal beam.

Parameters:

  • beam (:class:`~compas_timber.elements.Beam`) –

    The beam that is cut by this instance.

  • other_beam (:class:`~compas_timber.elements.Beam`) –

    The beam that is used to cut the beam.

  • plane (:class:`~compas.geometry.Plane`) –

    The plane that cuts the principal beam.

  • drillhole_diam (float, default: 0.0 ) –

    The diameter of the drillhole.

  • ref_side_index (int, default: 0 ) –

    The reference side index of the beam to be cut. Default is 0 (i.e. RS1).

Returns:

  • class:`~compas_timber.fabrication.FrenchRidgeLap`
lap_volume_from_params_and_beam ¤
lap_volume_from_params_and_beam(beam)

Calculates the trimming volume of the french ridge lap from the machining parameters and the given beam.

Parameters:

  • beam (:class:`compas_timber.elements.Beam`) –

    The beam that is cut by this instance.

Returns:

  • class:`compas.geometry.Brep`

    The trimming volume of the lap.

scale ¤
scale(factor)

Scale the parameters of this processing by a given factor.

Notes

Only distances are scaled, angles remain unchanged.

Parameters:

  • factor (float) –

    The scaling factor. A value of 1.0 means no scaling, while a value of 2.0 means doubling the size.

JackRafterCut ¤

JackRafterCut(
    orientation=START,
    start_x=0.0,
    start_y=0.0,
    start_depth=0.0,
    angle=90.0,
    inclination=90.0,
    **kwargs,
)

Represents a Jack Rafter Cut feature to be made on a beam.

Parameters:

  • orientation (int, default: START ) –

    The orientation of the cut. Must be either OrientationType.START or OrientationType.END.

  • start_x (float, default: 0.0 ) –

    The start x-coordinate of the cut in parametric space of the reference side. -100000.0 < start_x < 100000.0.

  • start_y (float, default: 0.0 ) –

    The start y-coordinate of the cut in parametric space of the reference side. 0.0 < start_y < 50000.0.

  • start_depth (float, default: 0.0 ) –

    The start depth of the cut. 0.0 < start_depth < 50000.0.

  • angle (float, default: 90.0 ) –

    The horizontal angle of the cut. 0.1 < angle < 179.9.

  • inclination (float, default: 90.0 ) –

    The vertical angle of the cut. 0.1 < inclination < 179.9.

Functions¤

apply ¤
apply(geometry, beam)

Apply the feature to the beam geometry.

Parameters:

  • geometry (:class:`~compas.geometry.Brep`) –

    The beam geometry to be cut.

  • beam (:class:`compas_timber.elements.Beam`) –

    The beam that is cut by this instance.

Raises:

  • :class:`~compas_timber.errors.FeatureApplicationError`

    If the cutting plane does not intersect with beam geometry.

Returns:

  • class:`~compas.geometry.Brep`

    The resulting geometry after processing

from_plane_and_beam classmethod ¤
from_plane_and_beam(plane, beam, ref_side_index=0, **kwargs)

Create a JackRafterCut instance from a cutting plane and the beam it should cut.

Parameters:

  • plane (:class:`~compas.geometry.Plane` or :class:`~compas.geometry.Frame`) –

    The cutting plane.

  • beam (:class:`~compas_timber.elements.Beam`) –

    The beam that is cut by this instance.

  • ref_side_index (int, default: 0 ) –

    The reference side index of the beam to be cut. Default is 0 (i.e. RS1).

Returns:

  • class:`~compas_timber.fabrication.JackRafterCut`
from_shapes_and_element classmethod ¤
from_shapes_and_element(plane, element, **kwargs)

Construct a drilling process from a shape and a beam.

Parameters:

  • plane (:class:`compas.geometry.Plane` or :class:`compas.geometry.Frame`) –

    The cutting plane.

  • element (:class:`compas_timber.elements.Element`) –

    The element to be cut.

Returns:

  • class:`compas_timber.fabrication.JackRafterCut`

    The constructed Jack Rafter Cut process.

plane_from_params_and_beam ¤
plane_from_params_and_beam(beam)

Calculates the cutting plane from the machining parameters in this instance and the given beam

Parameters:

  • beam (:class:`compas_timber.elements.Beam`) –

    The beam that is cut by this instance.

Returns:

  • class:`compas.geometry.Plane`

    The cutting plane.

scale ¤
scale(factor)

Scale the parameters of this processing by a given factor.

Notes

Only distances are scaled, angles remain unchanged.

Parameters:

  • factor (float) –

    The scaling factor. A value of 1.0 means no scaling, while a value of 2.0 means doubling the size.

JackRafterCutProxy ¤

JackRafterCutProxy(plane, beam, ref_side_index=0)

This object behaves like a JackRafterCut except it only calculates the machining parameters once unproxified. Can also be used to defer the creation of the processing instance until it is actually needed.

Until then, it can be used to visualize the machining operation. This slightly improves performance.

Parameters:

  • plane (:class:`~compas.geometry.Plane` or :class:`~compas.geometry.Frame`) –

    The cutting plane.

  • beam (:class:`~compas_timber.elements.Beam`) –

    The beam that is cut by this instance.

  • ref_side_index (int, default: 0 ) –

    The reference side index of the beam to be cut. Default is 0 (i.e. RS1).

Functions¤

apply ¤
apply(geometry, beam)

Apply the feature to the beam geometry.

Parameters:

  • geometry (:class:`~compas.geometry.Brep`) –

    The beam geometry to be cut.

  • beam (:class:`compas_timber.elements.Beam`) –

    The beam that is cut by this instance.

Raises:

  • :class:`~compas_timber.errors.FeatureApplicationError`

    If the cutting plane does not intersect with beam geometry.

Returns:

  • class:`~compas.geometry.Brep`

    The resulting geometry after processing

from_plane_and_beam classmethod ¤
from_plane_and_beam(plane, beam, ref_side_index=0)

Create a JackRafterCutProxy instance from a cutting plane and the beam it should cut.

Parameters:

  • plane (:class:`~compas.geometry.Plane` or :class:`~compas.geometry.Frame`) –

    The cutting plane.

  • beam (:class:`~compas_timber.elements.Beam`) –

    The beam that is cut by this instance.

  • ref_side_index (int, default: 0 ) –

    The reference side index of the beam to be cut. Default is 0 (i.e. RS1).

Returns:

  • class:`~compas_timber.fabrication.JackRafterCutProxy`
unproxified ¤
unproxified()

Returns the unproxified processing instance.

Returns:

  • class:`~compas_timber.fabrication.JackRafterCut`

Lap ¤

Lap(
    orientation=START,
    start_x=0.0,
    start_y=0.0,
    angle=90.0,
    inclination=90.0,
    slope=0.0,
    length=200.0,
    width=50.0,
    depth=40.0,
    lead_angle_parallel=True,
    lead_angle=90.0,
    lead_inclination_parallel=True,
    lead_inclination=90.0,
    machining_limits=None,
    **kwargs,
)

Represents a Lap feature to be made on a beam.

Parameters:

  • orientation (int, default: START ) –

    The orientation of the cut. Must be either OrientationType.START or OrientationType.END.

  • start_x (float, default: 0.0 ) –

    The start x-coordinate of the cut in parametric space of the reference side. -100000.0 < start_x < 100000.0.

  • start_y (float, default: 0.0 ) –

    The start y-coordinate of the cut in parametric space of the reference side. -50000.0 < start_y < 50000.0.

  • angle (float, default: 90.0 ) –

    The horizontal angle of the cut. 0.1 < angle < 179.9.

  • inclination (float, default: 90.0 ) –

    The vertical angle of the cut. 0.1 < inclination < 179.9.

  • slope (float, default: 0.0 ) –

    The slope of the cut. -89.9 < slope < 89.9.

  • length (float, default: 200.0 ) –

    The length of the cut. 0.0 < length < 100000.0.

  • width (float, default: 50.0 ) –

    The width of the cut. 0.0 < width < 50000.0.

  • depth (float, default: 40.0 ) –

    The depth of the cut. -50000.0 < depth < 50000.0.

  • lead_angle_parallel (bool, default: True ) –

    The lead angle is parallel to the beam axis.

  • lead_angle (float, default: 90.0 ) –

    The lead angle of the cut. 0.1 < lead_angle < 179.9.

  • lead_inclination_parallel (bool, default: True ) –

    The lead inclination is parallel to the beam axis.

  • lead_inclination (float, default: 90.0 ) –

    The lead inclination of the cut. 0.1 < lead_inclination < 179.9.

  • machining_limits (:class:`~compas_timber.fabrication.btlx.MachiningLimits` or dict, default: None ) –

    The machining limits for the cut. Default is None

Functions¤

apply ¤
apply(geometry, beam)

Apply the feature to the beam geometry.

Parameters:

  • geometry (:class:`~compas.geometry.Brep`) –

    The beam geometry to be cut.

  • beam (:class:`compas_timber.elements.Beam`) –

    The beam that is cut by this instance.

Raises:

  • :class:`~compas_timber.errors.FeatureApplicationError`

    If the cutting plane does not intersect with beam geometry.

Returns:

  • class:`~compas.geometry.Brep`

    The resulting geometry after processing

from_plane_and_beam classmethod ¤
from_plane_and_beam(plane, beam, length, depth, ref_side_index=0)

Create a Lap instance from a plane and a beam. The lap is defined by the plane given and a plane parallel to that at a distance defined by the length and a given depth. This method is used to create pocket cuts.

Parameters:

  • plane (:class:`~compas.geometry.Plane`) –

    The plane that defines the lap.

  • beam (:class:`~compas_timber.elements.Beam`) –

    The beam that the Lap instance is applied to.

  • length (float) –

    The length of the lap.

  • depth (float) –

    The depth of the lap.

  • ref_side_index (int, default: 0 ) –

    The reference side index of the main_beam to be cut. Default is 0 (i.e. RS1).

Returns:

  • class:`~compas_timber.fabrication.Lap`
from_shapes_and_element classmethod ¤
from_shapes_and_element(volume, element, **kwargs)

Construct a Lap feature from a volume and a TimberElement.

Parameters:

  • volume (:class:`~compas.geometry.Polyhedron` or :class:`~compas.geometry.Brep` or :class:`~compas.geometry.Mesh`) –

    The volume of the Lap. Must have 6 faces.

  • element (:class:`~compas_timber.elements.Beam`) –

    The element that is cut by this instance.

Returns:

  • class:`~compas_timber.fabrication.Lap`

    The Lap feature.

from_volume_and_beam classmethod ¤
from_volume_and_beam(
    volume, beam, machining_limits=None, ref_side_index=None, **kwargs
)

Construct a Lap feature from a volume and a Beam.

Parameters:

  • volume (:class:`~compas.geometry.Polyhedron` or :class:`~compas.geometry.Brep` or :class:`~compas.geometry.Mesh`) –

    The volume of the lap. Must have 6 faces.

  • beam (:class:`~compas_timber.elements.Beam`) –

    The beam that is cut by this instance.

  • machining_limits (:class:`~compas_timber.fabrication.MachiningLimits` or dict, default: None ) –

    The machining limits for the cut. Default is None.

  • ref_side_index (int, default: None ) –

    The index of the reference side of the element. Default is 0.

Returns:

  • class:`~compas_timber.fabrication.Lap`

    The Lap feature.

scale ¤
scale(factor)

Scale the parameters of this processing by a given factor.

Notes

Only distances are scaled, angles remain unchanged.

Parameters:

  • factor (float) –

    The scaling factor. A value of 1.0 means no scaling, while a value of 2.0 means doubling the size.

volume_from_params_and_beam ¤
volume_from_params_and_beam(beam)

Calculates the subtracting volume from the machining parameters in this instance and the given beam, ensuring correct face orientation.

Parameters:

  • beam (:class:`compas_timber.elements.Beam`) –

    The beam that is cut by this instance.

Returns:

  • class:`compas.geometry.Polyhedron`

    The correctly oriented subtracting volume of the lap.

LapProxy ¤

LapProxy(volume, beam, machining_limits=None, ref_side_index=None)

This object behaves like a Lap except it only calculates the machining parameters once unproxified. Can also be used to defer the creation of the processing instance until it is actually needed.

Until then, it can be used to visualize the machining operation. This slightly improves performance.

Parameters:

  • volume (:class:`~compas.geometry.Polyhedron` or :class:`~compas.geometry.Brep`) –

    The negative volume that constitutes the lap.

  • beam (:class:`~compas_timber.elements.Beam`) –

    The beam where lap should be applied.

  • machining_limits (dict, default: None ) –

    The machining limits for the cut. Default is None.

  • ref_side_index (int, default: None ) –

    The reference side index for the Lap.

Functions¤

apply ¤
apply(geometry, _)

Apply the feature to the beam geometry.

Parameters:

  • geometry (:class:`~compas.geometry.Brep`) –

    The beam geometry to apply the lap to.

Raises:

  • :class:`~compas_timber.errors.FeatureApplicationError`

    If the lap volume does not intersect with beam geometry.

Returns:

  • class:`~compas.geometry.Brep`

    The resulting geometry after processing

from_volume_and_beam classmethod ¤
from_volume_and_beam(volume, beam, machining_limits=None, ref_side_index=None)

Construct a Lap feature from a volume and a Beam.

Parameters:

  • volume (:class:`~compas.geometry.Polyhedron` or :class:`~compas.geometry.Brep`) –

    The volume of the lap. Must have 6 faces.

  • beam (:class:`~compas_timber.elements.Beam`) –

    The beam that is cut by this instance.

  • machining_limits (:class:`compas_timber.fabrication.MachiningLimits()` or dict, default: None ) –

    The machining limits for the cut. Default is None.

  • ref_side_index (int, default: None ) –

    The index of the reference side of the element. Default is 0.

Returns:

  • class:`~compas_timber.fabrication.Lap`

    The Lap feature.

unproxified ¤
unproxified()

Returns the unproxified processing instance.

Returns:

  • class:`~compas_timber.fabrication.Lap`

LimitationTopType ¤

Enum for the top limitation of the cut.

Attributes:

  • LIMITED (literal(limited)) –

    Limitation to the cut.

  • UNLIMITED (literal(unlimited)) –

    No limit to the cut.

  • POCKET (literal(pocket)) –

    Pocket like limitation to the cut.

LongitudinalCut ¤

LongitudinalCut(
    start_x=0.0,
    start_y=0.0,
    inclination=40.0,
    start_limited=False,
    end_limited=False,
    length=0.0,
    depth_limited=False,
    depth=0.0,
    angle_start=90.0,
    angle_end=90.0,
    tool_position=LEFT,
    **kwargs,
)

Represents a Longitudinal Cut feature to be made on a beam.

Parameters:

  • start_x (float, default: 0.0 ) –

    The start x-coordinate of the cut in parametric space of the reference side. -100000.0 < start_x < 100000.0.

  • start_y (float, default: 0.0 ) –

    The start y-coordinate of the cut in parametric space of the reference side. 0.0 < start_y < 50000.0.

  • inclination (float, default: 40.0 ) –

    The vertical angle of the cut. -90.0 < inclination < 90.0.

  • start_limited (bool, default: False ) –

    Whether the cut is limited at the start. If True, the cut starts at the start_x coordinate.

  • end_limited (bool, default: False ) –

    Whether the cut is limited at the end. If True, the cut ends at the start_x + length coordinate.

  • length (float, default: 0.0 ) –

    The length of the cut in parametric space of the reference side. 0.0 < length < 100000.0.

  • depth_limited (bool, default: False ) –

    Whether the cut is limited in depth. If True, the cut goes to a certain depth.

  • depth (float, default: 0.0 ) –

    The depth of the cut in parametric space of the reference side. 0.0 < depth < 50000.0.

  • angle_start (float, default: 90.0 ) –

    The angle at the start of the cut in degrees. 0.1 < angle_start < 179.9.

  • angle_end (float, default: 90.0 ) –

    The angle at the end of the cut in degrees. 0.1 < angle_end < 179.9.

  • tool_position (:class:`~compas_timber.fabrication.AlignmentType`, default: LEFT ) –

    The position of the tool relative to the beam. Can be 'left', 'center', or 'right'.

Functions¤

apply ¤
apply(geometry, beam)

Apply the feature to the beam geometry.

Parameters:

  • geometry (:class:`~compas.geometry.Brep`) –

    The beam geometry to be cut.

  • beam (:class:`compas_timber.elements.Beam`) –

    The beam that is cut by this instance.

Raises:

  • :class:`~compas_timber.errors.FeatureApplicationError`

    If the cutting plane does not intersect with beam geometry.

Returns:

  • class:`~compas.geometry.Brep`

    The resulting geometry after processing

from_plane_and_beam classmethod ¤
from_plane_and_beam(
    plane,
    beam,
    start_x=None,
    length=None,
    depth=None,
    angle_start=90.0,
    angle_end=90.0,
    tool_position=LEFT,
    ref_side_index=None,
    **kwargs,
)

Create a LongitudinalCut instance from a cutting plane and the beam it should cut.

Parameters:

  • plane (:class:`~compas.geometry.Plane` or :class:`~compas.geometry.Frame`) –

    The cutting plane. The normal of the plane must be perpendicular to the beam's x-axis.

  • beam (:class:`~compas_timber.elements.Beam`) –

    The beam that is cut by this instance.

  • start_x (float, default: None ) –

    The start x-coordinate of the cut in parametric space of the reference side. Default is 0.0.

  • length (float, default: None ) –

    The length of the cut in parametric space of the reference side. Default is the minimum length so that the cut goes through the entire beam..

  • depth (float, default: None ) –

    The depth of the cut in parametric space of the reference side. Default is the minimum depth so that the cut goes through the entire beam.

  • angle_start (float, default: 90.0 ) –

    The chamfered angle at the start of the cut in degrees. Default is 90.0.

  • angle_end (float, default: 90.0 ) –

    The chanfered angle at the end of the cut in degrees. Default is 90.0.

  • tool_position (:class:`~compas_timber.fabrication.AlignmentType`, default: LEFT ) –

    The position of the tool relative to the beam. Can be 'left', 'center', or 'right'. Default is 'left'.

  • ref_side_index (int, default: None ) –

    The reference side index of the beam to be cut. The default ref_side_index is calculated based on the angle between the plane's normal and each ref_side's normal.

from_shapes_and_element classmethod ¤
from_shapes_and_element(plane, element, **kwargs)

Construct a Longitudinal Cut process from a shape and a beam.

Parameters:

  • plane (:class:`compas.geometry.Plane` or :class:`compas.geometry.Frame`) –

    The cutting plane.

  • element (:class:`compas_timber.elements.Element`) –

    The element to be cut.

Returns:

  • class:`compas_timber.fabrication.LongitudinalCut`

    The constructed Logitudinal Cut process.

plane_from_params_and_beam ¤
plane_from_params_and_beam(beam)

Calculates the cutting plane from the machining parameters in this instance and the given beam

Parameters:

  • beam (:class:`compas_timber.elements.Beam`) –

    The beam that is cut by this instance.

Returns:

  • class:`compas.geometry.Plane`

    The cutting plane plane.

scale ¤
scale(factor)

Scale the machining parameters of the Longitudinal Cut feature.

Parameters:

  • factor (float) –

    The scale factor.

volume_from_params_and_beam ¤
volume_from_params_and_beam(beam)

Calculates the negative volume representing the cut from the machining parameters in this instance and the given beam.

Parameters:

  • beam (:class:`compas_timber.elements.Beam`) –

    The beam that is cut by this instance.

Returns:

  • class:`~compas.geometry.Brep`

    The negative volume representing the cut.

LongitudinalCutProxy ¤

LongitudinalCutProxy(
    plane,
    beam,
    start_x=None,
    length=None,
    depth=None,
    angle_start=90.0,
    angle_end=90.0,
    tool_position=LEFT,
    ref_side_index=None,
    **kwargs,
)

This object behaves like a LongitudinalCut except it only calculates the machining parameters once unproxified. Can also be used to defer the creation of the processing instance until it is actually needed.

Until then, it can be used to visualize the machining operation. This slightly improves performance.

Parameters:

  • plane (:class:`~compas.geometry.Plane` or :class:`~compas.geometry.Frame`) –

    The cutting plane.

  • beam (:class:`~compas_timber.elements.Beam`) –

    The beam that is cut by this instance.

  • start_x (float, default: None ) –

    The start x-coordinate of the cut in parametric space of the reference side. Default is 0.0.

  • length (float, default: None ) –

    The length of the cut in parametric space of the reference side. Default is the minimum length so that the cut goes through the entire beam.

  • depth (float, default: None ) –

    The depth of the cut in parametric space of the reference side. Default is the minimum depth so that the cut goes through the entire beam.

  • angle_start (float, default: 90.0 ) –

    The chamfered angle at the start of the cut in degrees. Default is 90.0.

  • angle_end (float, default: 90.0 ) –

    The chamfered angle at the end of the cut in degrees. Default is 90.0.

  • tool_position (:class:`~compas_timber.fabrication.AlignmentType`, default: LEFT ) –

    The position of the tool relative to the beam. Can be 'left', 'center', or 'right'. Default is 'left'.

  • ref_side_index (int, default: None ) –

    The reference side index of the beam to be cut. The default ref_side_index is calculated based on the angle between the plane's normal and each ref_side's normal.

Functions¤

apply ¤
apply(geometry, _)

Apply the feature to the beam geometry. The resulting geometry might differ from the unproxified version, based on the parameters set in this instance.

Parameters:

  • geometry (:class:`~compas.geometry.Brep`) –

    The beam geometry to be cut.

Raises:

  • :class:`~compas_timber.errors.FeatureApplicationError`

    If the cutting plane does not intersect with beam geometry.

Returns:

  • class:`~compas.geometry.Brep`

    The resulting geometry after processing.

from_plane_and_beam classmethod ¤
from_plane_and_beam(
    plane,
    beam,
    start_x=None,
    length=None,
    depth=None,
    angle_start=90.0,
    angle_end=90.0,
    tool_position=LEFT,
    ref_side_index=None,
    **kwargs,
)

Create a LongitudinalCutProxy instance from a cutting plane and the beam it should cut.

Parameters:

  • plane (:class:`~compas.geometry.Plane` or :class:`~compas.geometry.Frame`) –

    The cutting plane.

  • beam (:class:`~compas_timber.elements.Beam`) –

    The beam that is cut by this instance.

  • start_x (float, default: None ) –

    The start x-coordinate of the cut in parametric space of the reference side. Default is 0.0.

  • length (float, default: None ) –

    The length of the cut in parametric space of the reference side. Default is the minimum length so that the cut goes through the entire beam.

  • depth (float, default: None ) –

    The depth of the cut in parametric space of the reference side. Default is the minimum depth so that the cut goes through the entire beam.

  • angle_start (float, default: 90.0 ) –

    The chamfered angle at the start of the cut in degrees. Default is 90.0.

  • angle_end (float, default: 90.0 ) –

    The chamfered angle at the end of the cut in degrees. Default is 90.0.

  • tool_position (:class:`~compas_timber.fabrication.AlignmentType`, default: LEFT ) –

    The position of the tool relative to the beam. Can be 'left', 'center', or 'right'. Default is 'left'.

  • ref_side_index (int, default: None ) –

    The reference side index of the beam to be cut. The default ref_side_index is calculated based on the angle between the plane's normal and each ref_side's normal.

Returns:

  • class:`~compas_timber.fabrication.LongitudinalCutProxy`
unproxified ¤
unproxified()

Returns the unproxified processing instance.

Returns:

  • class:`~compas_timber.fabrication.LongitudinalCut`

    The unproxified LongitudinalCut instance.

MachiningLimits ¤

MachiningLimits(
    face_limited_start: bool = True,
    face_limited_end: bool = True,
    face_limited_front: bool = True,
    face_limited_back: bool = True,
    face_limited_top: bool = True,
    face_limited_bottom: bool = True,
)

Configuration class for the machining limits of the cut.

Attributes:

  • EXPECTED_KEYS (set) –

    The expected keys for the limits dictionary.

  • face_limited_start (bool) –

    Limit the start face.

  • face_limited_end (bool) –

    Limit the end face.

  • face_limited_front (bool) –

    Limit the front face.

  • face_limited_back (bool) –

    Limit the back face.

  • face_limited_top (bool) –

    Limit the top face.

  • face_limited_bottom (bool) –

    Limit the bottom face.

Functions¤

as_dict ¤
as_dict()

Dynamically generate the limits dictionary with boolean values from instance attributes.

Mortise ¤

Mortise(
    start_x=0.0,
    start_y=50.0,
    start_depth=0.0,
    angle=0.0,
    slope=90.0,
    inclination=90.0,
    length_limited_top=True,
    length_limited_bottom=True,
    length=80.0,
    width=40.0,
    depth=28.0,
    shape=AUTOMATIC,
    shape_radius=20.0,
    **kwargs,
)

Represents a Mortise feature to be made on a beam.

Parameters:

  • start_x (float, default: 0.0 ) –

    The start x-coordinate of the cut in parametric space of the reference side. Distance from the beam start to the reference point. -100000.0 < start_x < 100000.0.

  • start_y (float, default: 50.0 ) –

    The start y-coordinate of the cut in parametric space of the reference side. Distance from the reference edge to the reference point. -5000.0 < start_y < 5000.0.

  • start_depth (float, default: 0.0 ) –

    The start depth of the cut in parametric space of the reference side. Margin on the reference side. 0.0 < start_depth < 5000.0.

  • angle (float, default: 0.0 ) –

    The angle of the cut. Angle between edge and reference edge. -180.0 < angle < 180.0.

  • slope (float, default: 90.0 ) –

    The slope of the cut. Angle between axis along the length of the mortise and rederence side. 0.1 < slope < 179.9.

  • inclination (float, default: 90.0 ) –

    The inclination of the cut. Angle between axis along the width of the mortise and rederence side. 0.1 < inclination < 179.9.

  • length_limited_top (bool, default: True ) –

    Whether the top length of the cut is limited. True or False.

  • length_limited_bottom (bool, default: True ) –

    Whether the bottom length of the cut is limited. True or False.

  • length (float, default: 80.0 ) –

    The length of the cut. 0.0 < length < 5000.0.

  • width (float, default: 40.0 ) –

    The width of the cut. 0.0 < width < 1000.0.

  • depth (float, default: 28.0 ) –

    The depth of the mortise. 0.0 < depth < 1000.0.

  • shape (str, default: AUTOMATIC ) –

    The shape of the cut. Must be either 'automatic', 'square', 'round', 'rounded', or 'radius'.

  • shape_radius (float, default: 20.0 ) –

    The radius of the shape of the cut. 0.0 < shape_radius < 1000.0.

Functions¤

apply ¤
apply(geometry, beam)

Apply the feature to the beam geometry.

Parameters:

  • geometry (:class:`compas.geometry.Brep`) –

    The geometry to be processed.

  • beam (:class:`compas_timber.elements.Beam`) –

    The beam that is milled by this instance.

Raises:

  • :class:`~compas_timber.errors.FeatureApplicationError`

    If the cutting planes do not create a volume that itersects with beam geometry or any step fails.

Returns:

  • class:`~compas.geometry.Brep`

    The resulting geometry after processing

frame_from_params_and_beam ¤
frame_from_params_and_beam(beam)

Calculates the cutting frame from the machining parameters in this instance and the given beam

Parameters:

  • beam (:class:`compas_timber.elements.Beam`) –

    The beam that is cut by this instance.

Returns:

  • class:`compas.geometry.Frame`

    The cutting frame.

from_frame_and_beam classmethod ¤
from_frame_and_beam(
    frame,
    beam,
    start_depth=0.0,
    length=80.0,
    width=40.0,
    depth=28.0,
    shape=AUTOMATIC,
    shape_radius=20.0,
    ref_side_index=0,
)

Create a Mortise instance from a cutting frame and the beam it should cut. This could be the ref_side of the main beam of a Joint and the cross beam.

Parameters:

  • frame (:class:`~compas.geometry.Frame` or :class:`~compas.geometry.Plane`) –

    The cutting frame.

  • beam (:class:`~compas_timber.elements.Beam`) –

    The beam that is cut by this instance.

  • start_depth (float, default: 0.0 ) –

    The start depth of the cut along the y-axis of the beam. This offset is to be used in case of housing. Default is 0.0.

  • length (float, default: 80.0 ) –

    The length of the mortise.

  • width (float, default: 40.0 ) –

    The width of the mortise.

  • depth (float, default: 28.0 ) –

    The depth of the mortise. The equivalent value of the Tenon BTLxProcessing is the height.

  • shape (str, default: AUTOMATIC ) –

    The shape of the mortise in regards to it's edges. Default is 'automatic'.

  • shape_radius (float, default: 20.0 ) –

    The radius of the shape of the mortise. Default is 20.0.

  • ref_side_index (int, default: 0 ) –

    The reference side index of the beam to be cut. Default is 0 (i.e. RS1).

Returns:

  • class:`~compas_timber.fabrication.Mortise`
scale ¤
scale(factor)

Scale the parameters of this processing by a given factor.

Notes

Only distances are scaled, angles remain unchanged.

Parameters:

  • factor (float) –

    The scaling factor. A value of 1.0 means no scaling, while a value of 2.0 means doubling the size.

volume_from_params_and_beam ¤
volume_from_params_and_beam(beam)

Calculates the mortise volume from the machining parameters in this instance and the given beam.

Parameters:

  • beam (:class:`compas_timber.elements.Beam`) –

    The beam that is cut by this instance.

Returns:

  • class:`compas.geometry.Brep`

    The mortise volume.

OrientationType ¤

Enum for the orientation of the cut.

Attributes:

  • START (literal(start)) –

    The start of the element is cut away.

  • END (literal(end)) –

    The end of the element is cut away.

Pocket ¤

Pocket(
    start_x: float = 0.0,
    start_y: float = 0.0,
    start_depth: float = 0.0,
    angle: float = 0.0,
    inclination: float = 0.0,
    slope: float = 0.0,
    length: float = 200.0,
    width: float = 50.0,
    internal_angle: float = 90.0,
    tilt_ref_side: float = 90.0,
    tilt_end_side: float = 90.0,
    tilt_opp_side: float = 90.0,
    tilt_start_side: float = 90.0,
    machining_limits: MachiningLimits | None = None,
    **kwargs,
)

Represents a Pocket feature to be made on a beam.

Parameters:

  • start_x (float, default: 0.0 ) –

    The start x-coordinate of the cut in parametric space of the reference side. -100000.0 < start_x < 100000.0.

  • start_y (float, default: 0.0 ) –

    The start y-coordinate of the cut in parametric space of the reference side. -50000.0 < start_y < 50000.0.

  • start_depth (float, default: 0.0 ) –

    The start depth of the cut. -50000.0 < start_depth < 50000.0.

  • angle (float, default: 0.0 ) –

    The horizontal angle of the cut. -179.9 < angle < 179.9.

  • inclination (float, default: 0.0 ) –

    The vertical angle of the cut. -179.9 < inclination < 179.9.

  • slope (float, default: 0.0 ) –

    The slope of the cut. -179.9 < slope < 179.9.

  • length (float, default: 200.0 ) –

    The length of the cut. 0.0 < length < 100000.0.

  • width (float, default: 50.0 ) –

    The width of the cut. 0.0 < width < 50000.0.

  • internal_angle (float, default: 90.0 ) –

    The internal angle of the cut. 0.1 < internal_angle < 179.9.

  • tilt_ref_side (float, default: 90.0 ) –

    The tilt angle of the reference side. 0.1 < tilt_ref_side < 179.9.

  • tilt_end_side (float, default: 90.0 ) –

    The tilt angle of the end side. 0.1 < tilt_end_side < 179.9.

  • tilt_opp_side (float, default: 90.0 ) –

    The tilt angle of the opposing side. 0.1 < tilt_opp_side < 179.9.

  • tilt_start_side (float, default: 90.0 ) –

    The tilt angle of the start side. 0.1 < tilt_start_side < 179.9.

  • machining_limits (:class:`~compas_timber.fabrication.MachiningLimits` or dict, default: None ) –

    The machining limits for the cut. Default is None

Functions¤

apply ¤
apply(geometry: Brep, element: TimberElement) -> Brep

Apply the feature to the element geometry.

Parameters:

  • geometry (:class:`~compas.geometry.Brep`) –

    The geometry of the elements to be processed.

  • element (:class:`compas_timber.base.TimberElement`) –

    The element that is processed by this instance.

Raises:

  • :class:`~compas_timber.errors.FeatureApplicationError`

    If the cutting plane does not intersect with element geometry.

Returns:

  • class:`~compas.geometry.Brep`

    The resulting geometry after processing

from_shapes_and_element classmethod ¤
from_shapes_and_element(volume, element, **kwargs) -> Pocket

Construct a Pocket feature from a volume and a TimberElement.

Parameters:

  • volume (:class:`~compas.geometry.Polyhedron` or :class:`~compas.geometry.Brep` or :class:`~compas.geometry.Mesh`) –

    The volume of the pocket. Must have 6 faces.

  • element (:class:`~compas_timber.base.TimberElement`) –

    The element that is cut by this instance.

Returns:

  • class:`~compas_timber.fabrication.Pocket`

    The Pocket feature.

from_volume_and_element classmethod ¤
from_volume_and_element(
    volume: Polyhedron | Brep | Mesh,
    element: TimberElement,
    machining_limits: dict | None = None,
    ref_side_index: int | None = None,
) -> Pocket

Construct a Pocket feature from a volume and a TimberElement.

Parameters:

  • volume (:class:`~compas.geometry.Polyhedron` or :class:`~compas.geometry.Brep` or :class:`~compas.geometry.Mesh`) –

    The volume of the pocket. Must have 6 faces.

  • element (:class:`~compas_timber.base.TimberElement`) –

    The element that is cut by this instance.

  • machining_limits (:class:`~compas_timber.fabrication.btlx.MachiningLimits` or dict, default: None ) –

    The machining limits for the cut. Default is None.

  • ref_side_index (int, default: None ) –

    The index of the reference side of the element. Default is 0.

Returns:

  • class:`~compas_timber.fabrication.Pocket`

    The Pocket feature.

scale ¤
scale(factor: float) -> None

Scale the parameters of this processing by a given factor.

Notes

Only distances are scaled, angles remain unchanged.

Parameters:

  • factor (float) –

    The scaling factor. A value of 1.0 means no scaling, while a value of 2.0 means doubling the size.

volume_from_params_and_element ¤
volume_from_params_and_element(element: TimberElement) -> Polyhedron

Calculates the subtracting volume from the machining parameters in this instance and the given element, ensuring correct face orientation.

Parameters:

  • element (:class:`compas_timber.base.TimberElement`) –

    The element that is cut by this instance.

Returns:

  • class:`compas.geometry.Polyhedron`

    The correctly oriented subtracting volume of the pocket.

PocketProxy ¤

PocketProxy(volume, element, machining_limits=None, ref_side_index=None)

This object behaves like a Pocket except it only calculates the machining parameters once unproxified. Can also be used to defer the creation of the processing instance until it is actually needed.

Until then, it can be used to visualize the machining operation. This slightly improves performance.

Parameters:

  • volume (:class:`~compas.geometry.Polyhedron` or :class:`~compas.geometry.Brep` or :class:`~compas.geometry.Mesh`) –

    The volume of the pocket. Must have 6 faces.

  • element (:class:`~compas_timber.base.TimberElement`) –

    The element that is cut by this instance.

  • machining_limits (:class:`~compas_timber.fabrication.MachiningLimits` or dict, default: None ) –

    The machining limits for the cut. Default is None.

  • ref_side_index (int, default: None ) –

    The index of the reference side of the element. Default is 0.

Returns:

  • class:`~compas_timber.fabrication.Pocket`

    The Pocket feature.

Functions¤

apply ¤
apply(geometry, _)

Apply the feature to the beam geometry.

Parameters:

  • geometry (:class:`~compas.geometry.Brep`) –

    The beam geometry to apply the pocket to.

Raises:

  • :class:`~compas_timber.errors.FeatureApplicationError`

    If the pocket volume does not intersect with element geometry.

Returns:

  • class:`~compas.geometry.Brep`

    The resulting geometry after processing

from_volume_and_element classmethod ¤
from_volume_and_element(volume, element, machining_limits=None, ref_side_index=None)

Construct a Pocket feature from a volume and a TimberElement.

Parameters:

  • volume (:class:`~compas.geometry.Polyhedron` or :class:`~compas.geometry.Brep` or :class:`~compas.geometry.Mesh`) –

    The volume of the pocket. Must have 6 faces.

  • element (:class:`~compas_timber.base.TimberElement`) –

    The element that is cut by this instance.

  • machining_limits (:class:`compas_timber.fabrication.MachiningLimits` or dict, default: None ) –

    The machining limits for the cut. Default is None.

  • ref_side_index (int, default: None ) –

    The index of the reference side of the element. Default is 0.

Returns:

  • class:`~compas_timber.fabrication.Pocket`

    The Pocket feature.

unproxified ¤
unproxified()

Returns the unproxified processing instance.

Returns:

  • class:`~compas_timber.fabrication.Pocket`

Slot ¤

Slot(
    orientation=START,
    start_x=0.0,
    start_y=0.0,
    start_depth=0.0,
    angle=90.0,
    inclination=90.0,
    length=200.0,
    depth=10.0,
    thickness=10.0,
    angle_ref_point=90.0,
    angle_opp_point=90.0,
    add_angle_opp_point=0.0,
    machining_limits=None,
    **kwargs,
)

Functions¤

apply ¤
apply(geometry: Brep, beam: Beam) -> Brep

Apply the feature to the beam geometry.

Parameters:

  • geometry (:class:`~compas.geometry.Brep`) –

    The beam geometry to be cut.

  • beam (:class:`compas_timber.elements.Beam`) –

    The beam that is cut by this instance.

Raises:

  • :class:`~compas_timber.errors.FeatureApplicationError`

    If the cutting plane does not intersect with beam geometry.

Returns:

  • class:`~compas.geometry.Brep`

    The resulting geometry after processing

from_plane_and_beam classmethod ¤
from_plane_and_beam(plane, beam, depth, thickness)

Makes a full horizontal or vertical slot accross one of the end faces of the beam.

Therefore, the provided plane must cut the beam at one of its ends, and it must intersect with exactly two parallel small edges of the side face. The length of the slot is equal to the full length accross.

Parameters:

  • plane (:class:`~compas.geometry.Plane`) –

    The plane which specifies the orientation and depth of the Slot.

  • beam (:class:`~compas_timber.elements.Beam`) –

    The beam that is cut by this instance.

Returns:

  • class:`~compas_timber.fabrication.Slot`

    The constructed Slot feature.

scale ¤
scale(factor)

Scale the parameters of this processing by a given factor.

Notes

Only distances are scaled, angles remain unchanged.

Parameters:

  • factor (float) –

    The scaling factor. A value of 1.0 means no scaling, while a value of 2.0 means doubling the size.

volume_from_params_and_beam ¤
volume_from_params_and_beam(beam: Beam) -> Polyhedron

Computes the cutting volume of the slot based on the machining limits and parameters.

Parameters:

  • beam (:class:`~compas_timber.elements.Beam`) –

    The beam that is cut by this instance.

Returns:

  • class:`~compas.geometry.Polyhedron`

    The cutting volume of the slot.

StepJoint ¤

StepJoint(
    orientation=START,
    start_x=0.0,
    strut_inclination=90.0,
    step_depth=20.0,
    heel_depth=20.0,
    step_shape=DOUBLE,
    tenon=False,
    tenon_width=40.0,
    tenon_height=40.0,
    **kwargs,
)

Represents a Step Joint feature to be made on a beam.

Parameters:

  • orientation (int, default: START ) –

    The orientation of the cut. Must be either OrientationType.START or OrientationType.END.

  • start_x (float, default: 0.0 ) –

    The start x-coordinate of the cut in parametric space of the reference side. -100000.0 < start_x < 100000.0.

  • strut_inclination (float, default: 90.0 ) –

    The inclination of the strut. 0.1 < strut_inclination < 179.9.

  • step_depth (float, default: 20.0 ) –

    The depth of the step. step_depth < 50000.0.

  • heel_depth (float, default: 20.0 ) –

    The depth of the heel. heel_depth < 50000.0.

  • step_shape (str, default: DOUBLE ) –

    The shape of the step. Must be either 'double', 'step', 'heel', or 'taperedheel'.

  • tenon (str, default: False ) –

    The presence of a tenon. Must be either 'no' or 'yes'.

  • tenon_width (float, default: 40.0 ) –

    The width of the tenon. tenon_width < 1000.0.

  • tenon_height (float, default: 40.0 ) –

    The height of the tenon. tenon_height < 1000.0.

Functions¤

add_tenon ¤
add_tenon(tenon_width, tenon_height)

Add a tenon to the existing StepJointNotch instance.

Parameters:

  • tenon_width (float) –

    The width of the tenon. tenon_width < 1000.0.

  • tenon_height (float) –

    The height of the tenon. tenon_height < 1000.0.

apply ¤
apply(geometry, beam)

Apply the feature to the beam geometry.

Parameters:

  • geometry (:class:`compas.geometry.Brep`) –

    The geometry to be processed.

  • beam (:class:`compas_timber.elements.Beam`) –

    The beam that is milled by this instance.

Raises:

  • :class:`~compas_timber.errors.FeatureApplicationError`

    If the cutting planes do not create a volume that itersects with beam geometry or any step fails.

Returns:

  • class:`~compas.geometry.Brep`

    The resulting geometry after processing

from_plane_and_beam classmethod ¤
from_plane_and_beam(
    plane, beam, step_depth=20.0, heel_depth=0.0, tapered_heel=False, ref_side_index=0
)

Create a StepJoint instance from a cutting surface and the beam it should cut. This could be the ref_side of the cross beam of a Joint and the main beam.

Parameters:

  • plane (:class:`~compas.geometry.Plane` or :class:`~compas.geometry.Frame`) –

    The cutting plane.

  • beam (:class:`~compas_timber.elements.Beam`) –

    The beam that is cut by this instance.

  • ref_side_index (int, default: 0 ) –

    The reference side index of the beam to be cut. Default is 0 (i.e. RS1).

Returns:

  • class:`~compas_timber.fabrication.StepJoint`
planes_from_params_and_beam ¤
planes_from_params_and_beam(beam)

Calculates the cutting planes from the machining parameters in this instance and the given beam

Parameters:

  • beam (:class:`compas_timber.elements.Beam`) –

    The beam that is cut by this instance.

Returns:

  • class:`compas.geometry.Plane`

    The cutting planes.

scale ¤
scale(factor)

Scale the parameters of this processing by a given factor.

Notes

Only distances are scaled, angles remain unchanged.

Parameters:

  • factor (float) –

    The scaling factor. A value of 1.0 means no scaling, while a value of 2.0 means doubling the size.

tenon_volume_from_params_and_beam ¤
tenon_volume_from_params_and_beam(beam)

Calculates the tenon volume from the machining parameters in this instance and the given beam

Parameters:

  • beam (:class:`compas_timber.elements.Beam`) –

    The beam that is cut by this instance.

Returns:

  • class:`compas.geometry.Brep`

    The tenon volume.

StepJointNotch ¤

StepJointNotch(
    orientation=START,
    start_x=0.0,
    start_y=0.0,
    strut_inclination=90.0,
    notch_limited=False,
    notch_width=20.0,
    step_depth=20.0,
    heel_depth=20.0,
    strut_height=20.0,
    step_shape=DOUBLE,
    mortise=False,
    mortise_width=40.0,
    mortise_height=40.0,
    **kwargs,
)

Represents a Step Joint Notch feature to be made on a beam.

Parameters:

  • orientation (int, default: START ) –

    The orientation of the cut. Must be either OrientationType.START or OrientationType.END.

  • start_x (float, default: 0.0 ) –

    The start x-coordinate of the cut in parametric space of the reference side. -100000.0 < start_x < 100000.0.

  • start_y (float, default: 0.0 ) –

    The start y-coordinate of the notch in parametric space of the reference side. -50000.0 < start_y < 50000.0.

  • strut_inclination (float, default: 90.0 ) –

    The inclination of the strut. 0.1 < strut_inclination < 179.9.

  • notch_limited (bool, default: False ) –

    Whether the notch is limited. If True, the notch is limited by the start_y and notch_width values.

  • notch_width (float, default: 20.0 ) –

    The width of the notch. notch_width < 50000.0.

  • step_depth (float, default: 20.0 ) –

    The depth of the step. step_depth < 50000.0.

  • heel_depth (float, default: 20.0 ) –

    The depth of the heel. heel_depth < 50000.0.

  • strut_height (float, default: 20.0 ) –

    The height of the strut. It is the cross beam's height. strut_height < 50000.0.

  • step_shape (str, default: DOUBLE ) –

    The shape of the step. Must be either StepShapeType.DOUBLE, StepShapeType.STEP, StepShapeType.HEEL or StepShapeType.TAPERED_HEEL.

  • mortise (str, default: False ) –

    The presence of a mortise. Must be either 'no' or 'yes'.

  • mortise_width (float, default: 40.0 ) –

    The width of the mortise. mortise_width < 1000.0.

  • mortise_height (float, default: 40.0 ) –

    The height of the mortise. mortise_height < 1000.0.

Functions¤

add_mortise ¤
add_mortise(mortise_width, mortise_height)

Add a mortise to the existing StepJointNotch instance.

Parameters:

  • mortise_width (float) –

    The width of the mortise. mortise_width < 1000.0.

  • mortise_height (float) –

    The height of the mortise. mortise_height < 1000.0.

apply ¤
apply(geometry, beam)

Apply the feature to the beam geometry.

Parameters:

  • geometry (:class:`~compas.geometry.Brep`) –

    The beam geometry to be processed.

  • beam (:class:`compas_timber.elements.Beam`) –

    The beam that is milled by this instance.

Raises:

  • :class:`~compas_timber.errors.FeatureApplicationError`

    If the cutting planes do not create a volume that itersects with beam geometry or any step fails.

Returns:

  • class:`~compas.geometry.Brep`

    The resulting geometry after processing

from_plane_and_beam classmethod ¤
from_plane_and_beam(
    plane,
    beam,
    start_y=0.0,
    notch_limited=False,
    notch_width=20.0,
    step_depth=20.0,
    heel_depth=0.0,
    strut_height=20.0,
    tapered_heel=False,
    ref_side_index=0,
)

Create a StepJointNotch instance from a cutting surface and the beam it should cut. This could be the ref_side of the main beam of a Joint and the cross beam.

Parameters:

  • plane

    The cutting plane.

  • beam (:class:`~compas_timber.elements.Beam`) –

    The beam that is cut by this instance.

  • ref_side_index (int, default: 0 ) –

    The reference side index of the beam to be cut. Default is 0 (i.e. RS1).

Returns:

  • class:`~compas_timber.fabrication.StepJointNotch`
mortise_volume_from_params_and_beam ¤
mortise_volume_from_params_and_beam(beam)

Calculates the mortise volume from the machining parameters in this instance and the given beam

Parameters:

  • beam (:class:`compas_timber.elements.Beam`) –

    The beam that is cut by this instance.

Returns:

  • class:`compas.geometry.Box`

    The mortise volume.

planes_from_params_and_beam ¤
planes_from_params_and_beam(beam)

Calculates the cutting planes from the machining parameters in this instance and the given beam

Parameters:

  • beam (:class:`compas_timber.elements.Beam`) –

    The beam that is cut by this instance.

Returns:

  • class:`compas.geometry.Plane`

    The cutting planes.

scale ¤
scale(factor)

Scale the parameters of this processing by a given factor.

Notes

Only distances are scaled, angles remain unchanged.

Parameters:

  • factor (float) –

    The scaling factor. A value of 1.0 means no scaling, while a value of 2.0 means doubling the size.

StepShapeType ¤

Enum for the step shape of the cut.

Attributes:

  • STEP (literal(step)) –

    A step shape.

  • HEEL (literal(heel)) –

    A heel shape.

  • TAPERED_HEEL (literal(taperedheel)) –

    A tapered heel shape.

  • DOUBLE (literal(double)) –

    A double shape.

Tenon ¤

Tenon(
    orientation=START,
    start_x=0.0,
    start_y=50.0,
    start_depth=50.0,
    angle=90.0,
    inclination=90.0,
    rotation=90.0,
    length_limited_top=True,
    length_limited_bottom=True,
    length=80.0,
    width=40.0,
    height=28.0,
    shape=AUTOMATIC,
    shape_radius=20.0,
    chamfer=False,
    **kwargs,
)

Represents a Tenon feature to be made on a beam.

Parameters:

  • orientation (int, default: START ) –

    The orientation of the cut. Must be either OrientationType.START or OrientationType.END.

  • start_x (float, default: 0.0 ) –

    The start x-coordinate of the cut in parametric space of the reference side. Distance from the beam start to the reference point. -100000.0 < start_x < 100000.0.

  • start_y (float, default: 50.0 ) –

    The start y-coordinate of the cut in parametric space of the reference side. Distance from the reference edge to the reference point. -5000.0 < start_y < 5000.0.

  • start_depth (float, default: 50.0 ) –

    The start depth of the cut in parametric space of the reference side. Margin on the reference side. -5000.0 < start_depth < 5000.0.

  • angle (float, default: 90.0 ) –

    The angle of the cut. Angle between edge and reference edge. 0.1 < angle < 179.9.

  • inclination (float, default: 90.0 ) –

    The inclination of the cut. Inclination between face and reference side. 0.1 < inclination < 179.9.

  • rotation (float, default: 90.0 ) –

    The rotation of the cut. Angle between axis of the tenon and rederence side. 0.1 < rotation < 179.9.

  • length_limited_top (bool, default: True ) –

    Whether the top length of the cut is limited. True or False.

  • length_limited_bottom (bool, default: True ) –

    Whether the bottom length of the cut is limited. True or False.

  • length (float, default: 80.0 ) –

    The length of the cut. 0.0 < length < 5000.0.

  • width (float, default: 40.0 ) –

    The width of the cut. 0.0 < width < 1000.0.

  • height (float, default: 28.0 ) –

    The height of the tenon. 0.0 < height < 1000.0.

  • shape (str, default: AUTOMATIC ) –

    The shape of the cut. Must be either 'automatic', 'square', 'round', 'rounded', or 'radius'.

  • shape_radius (float, default: 20.0 ) –

    The radius of the shape of the cut. 0.0 < shape_radius < 1000.0.

  • chamfer (bool, default: False ) –

    Whether the edges of the tenon are chamfered. True or False.

Functions¤

apply ¤
apply(geometry, beam)

Apply the feature to the beam geometry.

Parameters:

  • geometry (:class:`compas.geometry.Brep`) –

    The geometry to be processed.

  • beam (:class:`compas_timber.elements.Beam`) –

    The beam that is milled by this instance.

Raises:

  • :class:`~compas_timber.errors.FeatureApplicationError`

    If the cutting frames do not create a volume that itersects with beam geometry or any step fails.

Returns:

  • class:`~compas.geometry.Brep`

    The resulting geometry after processing

frame_from_params_and_beam ¤
frame_from_params_and_beam(beam)

Calculates the cutting plane from the machining parameters in this instance and the given beam.

Parameters:

  • beam (:class:`compas_timber.elements.Beam`) –

    The beam that is cut by this instance.

Returns:

  • class:`compas.geometry.Frame`

    The cutting Frame.

from_plane_and_beam classmethod ¤
from_plane_and_beam(
    plane,
    beam,
    start_y=0.0,
    start_depth=0.0,
    rotation=0.0,
    length_limited_top=True,
    length_limited_bottom=True,
    length=80.0,
    width=40.0,
    height=40.0,
    shape=AUTOMATIC,
    shape_radius=20.0,
    chamfer=False,
    ref_side_index=0,
)

Create a Tenon instance from a cutting plane and the beam it should cut. This could be the ref_side of the cross beam of a Joint and the main beam.

Parameters:

  • plane (:class:`~compas.geometry.Plane` or :class:`~compas.geometry.Frame`) –

    The cutting plane.

  • beam (:class:`~compas_timber.elements.Beam`) –

    The beam that is cut by this instance.

  • start_y (float, default: 0.0 ) –

    The start y-coordinate of the cut in parametric space of the reference side. Default is 0.0.

  • start_depth (float, default: 0.0 ) –

    The start depth of the tenon, which is an offset along the normal of the reference side. Default is 50.0.

  • rotation (float, default: 0.0 ) –

    The angle of rotation of the tenon. Default is 0.0.

  • length_limited_top (bool, default: True ) –

    Whether the top length of the tenon is limited. Default is True.

  • length_limited_bottom (bool, default: True ) –

    Whether the bottom length of the tenon is limited. Default is True.

  • length (float, default: 80.0 ) –

    The length of the tenon. Default is 80.0.

  • width (float, default: 40.0 ) –

    The width of the bottom edge of the tenon. Default is 40.0.

  • height (float, default: 40.0 ) –

    The height of the tenon. Related to the dovetail tool and can be defined using the DovetailTenon.define_dovetail_tool() method. Default is 28.0.

  • shape (str, default: AUTOMATIC ) –

    The shape of the tenon. Default is 'automatic'.

  • shape_radius (float, default: 20.0 ) –

    The radius of the shape of the tenon. Related to the dovetail tool and can be defined using the DovetailTenon.define_dovetail_tool() method. Default is 20.0.

  • chamfer (bool, default: False ) –

    Whether the edges of the tenon are chamfered. Default is False.

  • ref_side_index (int, default: 0 ) –

    The reference side index of the beam to be cut. Default is 0 (i.e. RS1).

Returns:

  • class:`~compas_timber.fabrication.Tenon`
scale ¤
scale(factor)

Scale the parameters of this processing by a given factor.

Notes

Only distances are scaled, angles remain unchanged.

Parameters:

  • factor (float) –

    The scaling factor. A value of 1.0 means no scaling, while a value of 2.0 means doubling the size.

volume_from_params_and_beam ¤
volume_from_params_and_beam(beam)

Calculates the tenon volume from the machining parameters in this instance and the given beam.

Parameters:

  • beam (:class:`compas_timber.elements.Beam`) –

    The beam that is cut by this instance.

Returns:

  • class:`compas.geometry.Brep`

    The tenon volume.

TenonShapeType ¤

Enum for the tenon shape of the cut.

Attributes:

  • AUTOMATIC (literal(automatic)) –

    Automatic tenon shape.

  • SQUARE (literal(square)) –

    Square tenon shape.

  • ROUND (literal(round)) –

    Round tenon shape.

  • ROUNDED (literal(rounded)) –

    Rounded tenon shape.

  • RADIUS (literal(radius)) –

    Radius tenon shape.

Text ¤

Text(
    text,
    start_x=0.0,
    start_y=0.0,
    angle=0.0,
    alignment_vertical=BOTTOM,
    alignment_horizontal=LEFT,
    alignment_multiline=LEFT,
    stacked_marking=False,
    text_height_auto=True,
    text_height=20.0,
    **kwargs,
)

Represents a Text feature to be made on a beam.

Parameters:

  • text (str) –

    The text to be engraved on the beam.

  • start_x (float, default: 0.0 ) –

    The start x-coordinate of the cut in parametric space of the reference side. -100000.0 < start_x < 100000.0. Default is 0.0.

  • start_y (float, default: 0.0 ) –

    The start y-coordinate of the cut in parametric space of the reference side. -50000.0 < start_y < 50000.0. Default is 0.0.

  • angle (float, default: 0.0 ) –

    The horizontal angle of the first cut. -180.0 < angle < 180.0. Default is 0.0.

  • alignment_vertical (`AlignmentType.BOTTOM`, `AlignmentType.CENTER` or `AlignmentType.TOP`, default: `AlignmentType.BOTTOM` ) –

    The vertical alignment of the text. Default is AlignmentType.BOTTOM.

  • alignment_horizontal (`AlignmentType.LEFT`, `AlignmentType.CENTER` or `AlignmentType.RIGHT`, default: `AlignmentType.LEFT` ) –

    The horizontal alignment of the text. Default is AlignmentType.LEFT.

  • alignment_multiline (`AlignmentType.LEFT`, `AlignmentType.CENTER` or `AlignmentType.RIGHT`, default: `AlignmentType.LEFT` ) –

    The alignment of the text in multiline mode. Default is AlignmentType.LEFT.

  • stacked_marking (bool, default: False ) –

    If the text is a stacked marking. Default is False.

  • text_height_auto (bool, default: True ) –

    If the text height is automatically calculated. Default is True.

  • text_height (float, default: 20.0 ) –

    The height of the text. 0 < text_height < 50000.0. Default is 20.0.

Functions¤

apply ¤
apply(geometry, _)

Apply the feature to the beam geometry.

Raises:

  • Returns
  • -------
  • :class:`compas.geometry.Brep`

    The resulting geometry after processing.

create_text_curves_for_element ¤
create_text_curves_for_element(element)

This returns translated and scaled curves which correspond to the text and the element the text is engraved on.

Parameters:

  • element (:class:`compas_timber.elements.Beam`) –

    The beam on which the text is engraved.

Returns:

  • list[:class:`compas.geometry.Curve`]

    The curves representing the text.

scale ¤
scale(factor)

Scale the parameters of this processing by a given factor.

Notes

Only distances are scaled, angles remain unchanged.

Parameters:

  • factor (float) –

    The scaling factor. A value of 1.0 means no scaling, while a value of 2.0 means doubling the size.