diff --git a/src/Mod/Fem/femtools/femutils.py b/src/Mod/Fem/femtools/femutils.py index 47817ad776ef..11051e15a9fa 100644 --- a/src/Mod/Fem/femtools/femutils.py +++ b/src/Mod/Fem/femtools/femutils.py @@ -152,6 +152,23 @@ def get_pref_working_dir(solver_obj): # other +def get_part_to_mesh(mesh_obj): + ''' + gmsh mesh object: the Attribute is Part + netgen mesh object: the Attribute is Shape + other mesh objects: do not have a Attribute which holds the part to mesh + ''' + if is_derived_from(mesh_obj, "Fem::FemMeshGmsh"): + return mesh_obj.Part + elif is_derived_from(mesh_obj, "Fem::FemMeshShapeNetgenObject"): + return mesh_obj.Shape + else: + return None + # TODO: the Attributes should be named with the same name + # should it be Shape or Part? + # IMHO Part since the Attributes references the document object and not a Shape + + def getBoundBoxOfAllDocumentShapes(doc): overalboundbox = None for o in doc.Objects: