BlockModel

class compas_model.models.BlockModel(name=None)

Bases: Model

Methods

compute_interfaces

compute_intersections

compute_overlaps

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

Add a contact interaction between two elements.

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.