@@ -75,33 +75,57 @@ class Element(Data):
7575
7676 Parameters
7777 ----------
78- geometry : :class:`compas.geometry.Shape` | :class:`compas.geometry. Brep` | :class:`compas.datastructures.Mesh`, optional
78+ geometry : :class:`compas.geometry.Brep` | :class:`compas.datastructures.Mesh`, optional
7979 The complete geometry of the element.
80- frame : None, default WorldXY
81- The frame of the element.
80+ transformation : :class:`compas.geometry.Transformation`, optional
81+ The transformation of the element defining its location in the model.
82+ This transformation is relative to the combined transformation of the ancestors of the element up to the model root.
83+ If no transformation is provided (default), the geometry of the element is taken as-is.
84+ features : list[:class:`Feature`], optional
85+ A list of features that define the detailed geometry of the element.
86+ Features are defined in the local coordinate system of the element.
87+ material : :class:`Material`, optional
88+ The material of the element.
8289 name : None
8390 The name of the element.
8491
8592 Attributes
8693 ----------
94+ model : :class:`Model`
95+ Reference to the parent model.
8796 graphnode : int
8897 The identifier of the corresponding node in the interaction graph of the parent model.
8998 treenode : :class:`compas.datastructures.TreeNode`
9099 The node in the hierarchical element tree of the parent model.
91- frame : :class:`compas.geometry.Frame`
92- The local coordinate frame of the element.
93- geometry : :class:`compas.datastructures.Mesh` | :class:`compas.geometry.Brep`, readonly
94- The geometry of the element, computed from the base shape and its features.
100+ transformation : :class:`Transformation`
101+ The transformation of the element wrt its parent.
102+ features : list[:class:`Feature`]
103+ A list of features that define the detailed geometry of the element.
104+ modeltransformation : :class:`Transformation`, readonly
105+ The resolved transformation of the element wrt the model root.
106+ frame : :class:`compas.geometry.Frame`, readonly
107+ The coordinate frame corresponding to the model transformation of the element: ``Frame.from_transformation(self.modeltransformation)``
108+ elementgeometry : :class:`compas.datastructures.Mesh` | :class:`compas.geometry.Brep`, readonly
109+ The geometry of the element in element coordinates.
110+ modelgeometry : :class:`compas.datastructures.Mesh` | :class:`compas.geometry.Brep`, readonly
111+ The geometry of the element in model coordinates: ``self.elementgeometry.transformed(self.modeltransformation)``.
95112 aabb : :class:`compas.geometry.Box`, readonly
96- The Axis Aligned Bounding Box (AABB) of the element.
113+ The Axis Aligned Bounding Box (AABB) of the model geometry of the element.
97114 obb : :class:`compas.geometry.Box`, readonly
98- The Oriented Bounding Box (OBB) of the element.
115+ The Oriented Bounding Box (OBB) of the model geometry of the element.
99116 collision_mesh : :class:`compas.datastructures.Mesh`, readonly
100- The collision geometry of the element.
101- features : list[:class:`Feature`]
102- A list of features that define the detailed geometry of the element.
103- is_dirty : bool
104- Flag to indicate that modelgeometry has to be recomputed.
117+ The collision mesh of the model geometry of the element.
118+ point : :class:`compas.geometry.Point`, readonly
119+ The reference location of the element.
120+ This is, for example, the centroid of the model geometry.
121+ surface_mesh : :class:`Mesh`, readonly
122+ A triangle mesh representing the surface boundary of the model geometry of the element, for example for FEA.
123+ volumetric_mesh : :class:`VolMesh`, readonly
124+ A tetrahedral mesh representing the internal volume of the model geometry of the element, for example for FEA.
125+
126+ Notes
127+ -----
128+
105129
106130 """
107131
@@ -123,6 +147,7 @@ def __init__(
123147 geometry : Optional [Union [Brep , Mesh ]] = None ,
124148 transformation : Optional [Transformation ] = None ,
125149 features : Optional [Sequence [Union [Feature , FeatureType ]]] = None ,
150+ material : Optional [Material ] = None ,
126151 name : Optional [str ] = None ,
127152 ** kwargs ,
128153 ) -> None :
@@ -135,7 +160,7 @@ def __init__(
135160 self ._transformation = transformation
136161 self ._geometry = geometry
137162 self ._features = list (features or [])
138- self ._material = kwargs . get ( " material" )
163+ self ._material = material
139164
140165 self ._elementgeometry = None
141166 self ._modelgeometry = None
@@ -278,7 +303,9 @@ def volumetric_mesh(self) -> VolMesh:
278303 # Abstract methods
279304 # ==========================================================================
280305
281- def compute_elementgeometry (self , include_features : bool = False ) -> Union [Brep , Mesh ]:
306+ def compute_elementgeometry (
307+ self , include_features : bool = False
308+ ) -> Union [Brep , Mesh ]:
282309 """Compute the geometry of the element in local coordinates.
283310
284311 This is the parametric representation of the element,
@@ -336,7 +363,9 @@ def compute_modelgeometry(self) -> Union[Brep, Mesh]:
336363 modelgeometry = self .elementgeometry .transformed (xform )
337364
338365 for nbr in self .model .graph .neighbors_in (self .graphnode ):
339- modifiers : list [Modifier ] = self .model .graph .edge_attribute ((nbr , self .graphnode ), name = "modifiers" ) # type: ignore
366+ modifiers : list [Modifier ] = self .model .graph .edge_attribute (
367+ (nbr , self .graphnode ), name = "modifiers"
368+ ) # type: ignore
340369 if modifiers :
341370 source = self .model .graph .node_element (nbr )
342371 for modifier in modifiers :
@@ -405,7 +434,9 @@ def compute_point(self) -> Point:
405434 """
406435 raise NotImplementedError
407436
408- def compute_surface_mesh (self , meshsize_min : Optional [float ] = None , meshsize_max : Optional [float ] = None ) -> Mesh :
437+ def compute_surface_mesh (
438+ self , meshsize_min : Optional [float ] = None , meshsize_max : Optional [float ] = None
439+ ) -> Mesh :
409440 """Computes the triangulated surface mesh of the element's model geometry.
410441
411442 Parameters
@@ -423,7 +454,9 @@ def compute_surface_mesh(self, meshsize_min: Optional[float] = None, meshsize_ma
423454 """
424455 raise NotImplementedError
425456
426- def compute_volumetric_mesh (self , meshsize_min : Optional [float ] = None , meshsize_max : Optional [float ] = None ) -> VolMesh :
457+ def compute_volumetric_mesh (
458+ self , meshsize_min : Optional [float ] = None , meshsize_max : Optional [float ] = None
459+ ) -> VolMesh :
427460 """Computes the tetrahedral volumetric mesh of the element's model geometry.
428461
429462 Parameters
@@ -464,15 +497,19 @@ def compute_contacts(
464497 list[:class:`Contact`]
465498
466499 """
467- if isinstance (self .modelgeometry , Mesh ) and isinstance (other .modelgeometry , Mesh ):
500+ if isinstance (self .modelgeometry , Mesh ) and isinstance (
501+ other .modelgeometry , Mesh
502+ ):
468503 return mesh_mesh_contacts (
469504 self .modelgeometry ,
470505 other .modelgeometry ,
471506 tolerance = tolerance ,
472507 minimum_area = minimum_area ,
473508 contacttype = contacttype ,
474509 )
475- elif isinstance (self .modelgeometry , Brep ) and isinstance (other .modelgeometry , Brep ):
510+ elif isinstance (self .modelgeometry , Brep ) and isinstance (
511+ other .modelgeometry , Brep
512+ ):
476513 return brep_brep_contacts (
477514 self .modelgeometry ,
478515 other .modelgeometry ,
0 commit comments