TimberModel

class compas_timber.model.TimberModel[source]

Bases: Model

Represents a timber model containing different elements such as walls, beams and joints.

The timber model allows expressing the hierarchy and interactions between the different elements it contains.

Attributes:
beamsGenerator[Beam]

A Generator object of all beams assigned to this model.

platesGenerator[Plate]

A Generator object of all plates assigned to this model.

jointsGenerator[Joint]

A Generator object of all joints assigned to this model.

wallsGenerator[Wall]

A Generator object of all walls assigned to this model.

center_of_massPoint

The calculated center of mass of the model.

topologieslist(dict)

A list of JointTopology for model. dict is: {“detected_topo”: detected_topo, “beam_a_key”: beam_a_key, “beam_b_key”:beam_b_key} See JointTopology.

volumefloat

The calculated total volume of the model.

Methods

add_joint

Add a joint object to the model.

element_by_guid

Get a beam by its unique identifier.

process_joinery

Process the joinery of the model.

remove_joint

Removes this joint object from the model.

set_topologies

TODO: calculate the topologies inside the model using the ConnectionSolver.

Inherited Methods

ToString

Converts the instance to a string.

add_element

Add an element to the model.

add_elements

Add multiple elements to the model.

add_group

Add a group to the model.

add_interaction

Add an interaction between two elements of the model.

add_material

Add a material to the model.

assign_material

Assign a material to an element or a list of elements.

compute_aabb

Compute the axis-aligned bounding box of the datastructure.

compute_obb

Compute the oriented bounding box of the datastructure.

copy

Make an independent copy of the data object.

elements

Yield all the elements contained in the model.

elements_connected_by

Find groups of elements connected by a specific type of interaction.

from_json

Construct an object of this type from a JSON file.

from_jsonstring

Construct an object of this type from a JSON string.

has_element

Returns True if the model contains the given element.

has_interaction

Returns True if two elements have an interaction set between them.

has_material

Verify that the model contains a specific material.

interactions

Yield all interactions between all elements in the model.

materials

Yield all the materials contained in the model.

remove_element

Remove an element from the model.

remove_interaction

Remove the interaction between two elements.

rotate

Rotate the datastructure.

rotated

Returns a rotated copy of this geometry.

scale

Scale the datastructure.

scaled

Returns a scaled copy of this geometry.

sha256

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

to_json

Convert an object to its native data representation and save it to a JSON file.

to_jsonstring

Convert an object to its native data representation and save it to a JSON string.

transform

Transform the model and all that it contains.

transform_numpy

Transforms the data structure.

transformed

Returns a transformed copy of this data structure.

transformed_numpy

Returns a transformed copy of this data structure.

translate

Translate the datastructure.

translated

Returns a translated copy of this geometry.

validate_data

Validate the data against the object's data schema.