Element
- class compas_model.elements.Element(geometry=None, transformation=None, features=None, material=None, name=None, **kwargs)
Bases:
Data
Base class for all elements in the model.
- Parameters:
- geometry
compas.geometry.Brep
|compas.datastructures.Mesh
, optional The complete geometry of the element.
- transformation
compas.geometry.Transformation
, optional The transformation of the element defining its location in the model. This transformation is relative to the combined transformation of the ancestors of the element up to the model root. If no transformation is provided (default), the geometry of the element is taken as-is.
- featureslist[
Feature
], optional A list of features that define the detailed geometry of the element. Features are defined in the local coordinate system of the element.
- material
Material
, optional The material of the element.
- nameNone
The name of the element.
- geometry
- Attributes:
- model
Model
Reference to the parent model.
- graphnodeint
The identifier of the corresponding node in the interaction graph of the parent model.
- treenode
compas.datastructures.TreeNode
The node in the hierarchical element tree of the parent model.
- transformation
Transformation
The transformation of the element wrt its parent.
- featureslist[
Feature
] A list of features that define the detailed geometry of the element.
- modeltransformation
Transformation
, readonly The resolved transformation of the element wrt the model root.
- frame
compas.geometry.Frame
, readonly The coordinate frame corresponding to the model transformation of the element:
Frame.from_transformation(self.modeltransformation)
- elementgeometry
compas.datastructures.Mesh
|compas.geometry.Brep
, readonly The geometry of the element in element coordinates.
- modelgeometry
compas.datastructures.Mesh
|compas.geometry.Brep
, readonly The geometry of the element in model coordinates:
self.elementgeometry.transformed(self.modeltransformation)
.- aabb
compas.geometry.Box
, readonly The Axis Aligned Bounding Box (AABB) of the model geometry of the element.
- obb
compas.geometry.Box
, readonly The Oriented Bounding Box (OBB) of the model geometry of the element.
- collision_mesh
compas.datastructures.Mesh
, readonly The collision mesh of the model geometry of the element.
- point
compas.geometry.Point
, readonly The reference location of the element. This is, for example, the centroid of the model geometry.
- surface_mesh
Mesh
, readonly A triangle mesh representing the surface boundary of the model geometry of the element, for example for FEA.
- volumetric_mesh
VolMesh
, readonly A tetrahedral mesh representing the internal volume of the model geometry of the element, for example for FEA.
- model
Methods
Add a feature to the list of features of the element.
Apply the features to the (base) geometry.
Computes the Axis Aligned Bounding Box (AABB) of the geometry of the element.
Computes the collision geometry of the geometry of the element.
Compute the contacts between this element and another element.
Compute the geometry of the element in local coordinates.
Compute the geometry of the element in model coordinates and taking into account the effect of interactions with connected elements.
Compute the transformation to model coordinates of this element based on its position in the spatial hierarchy of the model.
Computes the Oriented Bounding Box (OBB) of the geometry of the element.
Computes a reference point for the element geometry (e.g.
Computes the triangulated surface mesh of the element's model geometry.
Computes the tetrahedral volumetric mesh of the element's model geometry.
Transforms the element.
Creates a transformed copy of the element.
Inherited Methods
Converts the instance to a string.
Make an independent copy of the data object.
Construct an object of this type from a JSON file.
Construct an object of this type from 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 and save it to a JSON file.
Convert an object to its native data representation and save it to a JSON string.
Validate the data against the object's data schema.