Skip to content

Commit

Permalink
FEM: utils, add a method to get the Part to mesh
Browse files Browse the repository at this point in the history
  • Loading branch information
berndhahnebach committed Jun 26, 2019
1 parent ece1b7e commit 441b3d5
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/Mod/Fem/femtools/femutils.py
Expand Up @@ -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:
Expand Down

0 comments on commit 441b3d5

Please sign in to comment.