Skip to content
Snippets Groups Projects
Commit 12cb1100 authored by Boman Romain's avatar Boman Romain
Browse files

add LTMJ as coordinates

parent 7a9243ed
No related branches found
No related tags found
No related merge requests found
......@@ -9,7 +9,7 @@ def parms(d={}):
path = 'dolicorhynchops/10k'
p['mandible'] = f'{path}/mandible.ply'
# p['teeth'] = f'{path}/teeth.off'
p['LTMJ'] = [0.1458893, -73.13895, 227.3909],
p['LTMJ'] = [0.1458893, -73.13895, 227.3909]
p['RTMJ'] = f'{path}/RTMJ.off'
p['muscles'] = [
{
......
......@@ -19,8 +19,8 @@ def parms(d={}):
path = 'dolicorhynchops/10k'
p['mandible'] = f'{path}/mandible.ply' # mandible mesh (.ply/.geo/.msh)
p['teeth'] = f'{path}/teeth.off' # one or several vertices (.ply/.off) (used if p['food']=='fixteeth')
p['LTMJ'] = f'{path}/LTMJ.off' # left temporomandibular joint - 1 vertex (.ply/.off)
p['RTMJ'] = f'{path}/RTMJ.off' # right temporomandibular joint - 1 vertex (.ply/.off)
p['LTMJ'] = [0.1458893, -73.13895, 227.3909] # left temporomandibular joint - 1 vertex (.ply/.off/coordinates)
p['RTMJ'] = f'{path}/RTMJ.off' # right temporomandibular joint - 1 vertex (.ply/.off/coordinates)
p['muscles'] = [
{ 'file': f'{path}/Lmuscle.ply', 'force': 100., 'focalpt':f'{path}/LmuscleF.off', 'method':'T'},
{ 'file': f'{path}/Rmuscle.off', 'force': 100., 'focalpt':f'{path}/RmuscleF.off', 'method':'T'}
......@@ -275,14 +275,20 @@ def extract_nodes_from_group(group):
return nods_no, nods_pos
def create_group(mesh_file, all_no, all_coords, domain, groups, gname=None):
"""loads the mesh file "mesh_file" and identify vertices among vertices
def create_group(mesh_file_or_coord, all_no, all_coords, domain, groups, gname=None):
"""loads the mesh file "mesh_file_or_coord" and identify vertices among vertices
stored in all_coords.
Then, the routine creates a group named "gname" (built from mesh_file if None)
Then, the routine creates a group named "gname" (built from mesh_file_or_coord if None)
"""
# load mesh file
fullpath = os.path.join(os.path.dirname(__file__), mesh_file)
nodes, tris = boneload.load_msh(fullpath)
# load mesh file
if isinstance(mesh_file_or_coord, str):
fullpath = os.path.join(os.path.dirname(__file__), mesh_file_or_coord)
nodes, tris = boneload.load_msh(fullpath)
else:
nodes = [ mesh_file_or_coord ]
print(f'nodes={nodes}')
print(f'mesh_file_or_coord={mesh_file_or_coord}')
tris = []
# identify nodes of the mesh among the given vertices of the main mesh
ntags = boneload.identify_nodes(nodes, all_no, all_coords)
......@@ -290,7 +296,7 @@ def create_group(mesh_file, all_no, all_coords, domain, groups, gname=None):
# create a metafor group
groupset = domain.getGeometry().getGroupSet()
if gname is None:
gname, _ = os.path.splitext(os.path.basename(mesh_file))
gname, _ = os.path.splitext(os.path.basename(mesh_file_or_coord))
group = groupset.add(Group(groupset.getLargestNo()+1))
groups[gname] = group
......@@ -300,7 +306,7 @@ def create_group(mesh_file, all_no, all_coords, domain, groups, gname=None):
group.addMeshPoint(nodeset(tag))
print(f'group #{group.getNo()} ({gname}) ' \
f'created from {mesh_file} ({group.getNumberOfMeshPoints()} nodes)')
f'created from {mesh_file_or_coord} ({group.getNumberOfMeshPoints()} nodes)')
return gname, nodes, tris, ntags
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment