Assembly

class compas_assembly.datastructures.Assembly

Bases: Datastructure

A data structure for managing the connections between different parts of an assembly.

Parameters:
namestr, optional

The name of the assembly.

Examples

>>>
Attributes:
attributesdict[str, Any]

General attributes of the data structure that will be included in the data dict and serialization.

graphcompas.datastructures.Graph

The graph that is used under the hood to store the parts and their connections.

Methods

add_block

Add a block to the assembly.

add_block_block_interfaces

Add an interface between two blocks.

add_block_from_mesh

Add a block to the assembly from a normal mesh.

block_node

Retrieve the graph node corresponding to a block.

blocks

Iterate over the blocks of the assembly.

edge_blocks

Retrieve the two blocks corresponding to a graph edge.

edge_interfaces

Retrieve the interface corresponding to a graph edge.

edge_line

Retrieve the line segment between the nodes of the edge.

edges

Iterate over the edges of the graph of the assembly.

from_polysurfaces

Construct an assembly from Rhino polysurfaces.

from_rhinomeshes

Construct an assembly from Rhino meshes.

from_template

Construct an assembly from a parameteric template.

has_block

Verify that the assembly contains a given block.

has_interface

Verify that the assembly contains a given interface.

interfaces

Yield the interfaces of the assembly.

node_block

Retrieve the block corresponding to a graph node.

node_point

Retrieve a point representing the location of the node.

nodes

Iterate over the nodes of the graph of the assembly.

number_of_blocks

Return the number of blocks in the assembly.

number_of_edges

Return the number of edges in the assembly graph.

number_of_interfaces

Return the number of interfaces in the assembly.

number_of_nodes

Return the number of nodes in the assembly graph.

set_boundary_condition

Set the boundary condition for a single node.

set_boundary_conditions

Set the boundary condition for multiple nodes.

transform

Transform this assembly by the given transformation matrix.

transformed

Transform a copy of this assembly by the given transformation matrix.

unset_boundary_conditions

Unset all boundary conditions.

Inherited Methods

ToString

Converts the instance to a string.

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.

from_json

Construct an object of this type from a JSON file.

from_jsonstring

Construct an object of this type from a JSON string.

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