Assembly
- class compas_assembly.datastructures.Assembly(name=None, **kwargs)[source]
Bases:
compas.datastructures.datastructure.Datastructure
A data structure for managing the connections between different parts of an assembly.
- Parameters
name (str, optional) – The name of the assembly.
- Attributes
attributes (dict[str, Any]) – General attributes of the data structure that will be included in the data dict and serialization.
graph (
compas.datastructures.Graph
) – The graph that is used under the hood to store the parts and their connections.
Examples
>>>
Methods
Add a block to the assembly.
Add an interface between two blocks.
Add a block to the assembly from a normal mesh.
Retrieve the graph node corresponding to a block.
Iterate over the blocks of the assembly.
Retrieve the two blocks corresponding to a graph edge.
Retrieve the interface corresponding to a graph edge.
Retrieve the line segment between the nodes of the edge.
Iterate over the edges of the graph of the assembly.
Construct an assembly from Rhino polysurfaces.
Construct an assembly from Rhino meshes.
Construct an assembly from a parameteric template.
Verify that the assembly contains a given block.
Verify that the assembly contains a given interface.
Yield the interfaces of the assembly.
Retrieve the block corresponding to a graph node.
Retrieve a point representing the location of the node.
Iterate over the nodes of the graph of the assembly.
Return the number of blocks in the assembly.
Return the number of edges in the assembly graph.
Return the number of interfaces in the assembly.
Return the number of nodes in the assembly graph.
Set the boundary condition for a single node.
Set the boundary condition for multiple nodes.
Transform this assembly by the given transformation matrix.
Transform a copy of this assembly by the given transformation matrix.
Unset all boundary conditions.
Inherited Methods
Converts the instance to a string.
Make an independent copy of the data object.
Construct an object of this type from the provided data.
Construct an object from serialized data contained in a JSON file.
Construct an object from serialized data contained in a JSON string.
Compute a hash of the data for comparison during version control using the sha256 algorithm.
Convert an object to its native data representation.
Serialize the data representation of an object to a JSON file.
Serialize the data representation of an object to a JSON string.
Validate the object's data against its data schema.
Validate the object's data against its json schema.