Part
- class compas.datastructures.Part(name=None, frame=None, shape=None, features=None, **kwargs)[source]
Bases:
Datastructure
A data structure for representing assembly parts.
- Parameters
name (str, optional) – The name of the part. The name will be stored in
Part.attributes
.frame (
compas.geometry.Frame
, optional) – The local coordinate system of the part.shape (
compas.geometry.Shape
, optional) – The base shape of the part geometry.features (sequence[tuple[
compas.geometry.Shape
, str]], optional) – The features to be added to the base shape of the part geometry.
- Attributes
attributes (dict[str, Any]) – General data structure attributes that will be included in the data dict and serialization.
key (int or str) – The identifier of the part in the connectivity graph of the parent assembly.
frame (
compas.geometry.Frame
) – The local coordinate system of the part.shape (
compas.geometry.Shape
) – The base shape of the part geometry.features (list[tuple[
compas.geometry.Shape
, str]]) – The features added to the base shape of the part geometry.transformations (Deque[
compas.geometry.Transformation
]) – The stack of transformations applied to the part geometry. The most recent transformation is on the left of the stack. All transformations are with respect to the local coordinate system.geometry (
compas.geometry.Polyhedron
, read-only) – The geometry of the part after combining the base shape and features through the specified operations.
- Class Attributes
operations (dict[str, callable]) – Available operations for combining features with a base shape.
Methods
Add a feature to the shape of the part and the operation through which it should be integrated.
Convert the part geometry to a mesh.
Transform the part with respect to the local cooordinate system.
Inherited Methods
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.
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.