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.

jointsset[Joint]

A set of all actual joints assigned to this model.

joint_candidatesset[JointCandidate]

A set of all joint candidates in the 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.

toleranceTolerance

The tolerance configuration used for this model. TOL if none provided.

volumefloat

The calculated total volume of the model.

Methods

add_joint

Add a joint object to the model.

add_joint_candidate

Add a joint candidate to the model.

connect_adjacent_beams

connect_adjacent_plates

Connects adjacent plates in the model.

connect_adjacent_walls

Connects adjacent walls in the model.

element_by_guid

Get a beam by its unique identifier.

get_elements_in_group

Get all elements in a group element.

get_interactions_for_element

Get all interactions for a given element.

has_group

Check if a group with group_element exists in the model.

process_joinery

Process the joinery of the model.

remove_interaction

Remove the interaction between two elements.

remove_joint

Removes this joint object from the model.

remove_joint_candidate

Removes this joint candidate from the model.

set_topologies

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

transform

Transform the model and reset all computed properties of all elements.

Inherited Methods

ToString

Converts the instance to a string.

add_element

Add an element to the model.

add_elements

Add a list of 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.

add_modifier

Add a modifier between two elements, with one the source of the modifier and the other the target.

add_or_get_material

Add a material to the model or retrieve an existing instance of the same type.

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_bvh

Compute the Bounding Volume Hierarchy (BVH) of the elements for fast collision checks.

compute_contacts

Compute the contacts between the block elements of this model.

compute_kdtree

Compute the KD tree of the elements for fast nearest neighbour queries.

compute_obb

Compute the oriented bounding box of the datastructure.

contacts

copy

Make an independent copy of the data object.

element_nnbrs

Find the nearest neighbours to a root element.

elements

Iterate over the elements contained in the model.

find_all_elements_of_type

Find all model elements of a given type.

find_element_with_name

Returns True if the model contains an element with the given name.

find_element_with_name_or_fail

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_element_with_name

Returns True if the model contains an element with the given name.

has_interaction

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

has_material

Verify that the model contains a specific material.

materials

Iterate over the materials stored in the model.

point_nnbrs

Find the nearest neighbours to a point.

remove_element

Remove an element from the model.

remove_elements_of_type

Remove all model elements of a given type.

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_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.