Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 21 additions & 4 deletions cherab/jet/machine/cad_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -673,9 +673,24 @@


def import_jet_mesh(world, override_material=None, tungsten_material=None, beryllium_material=None,
lambert_material=None, verbose=True):

for mesh_item in JET_MESH:
lambert_material=None, verbose=True, mesh_components=JET_MESH):
""" Imports JET machine meshes.

Args:
:param world: The parent node.
:param override_material: Optional, overrides materials specified in the mesh_description.
:param tungsten_material: Optional, overrides tungsten materials specified in mesh_description.
:param beryllium_material: Optional, overrides beryllium materials specified in mesh_description.
:param lambert_material: Optional, overrides Lambertian materials specified in mesh_description.
:param verbose: Sets the verbosity, defaults True.
:param mesh_components: Optional, list of tupples of the shape (mesh file path, material). On default equals to the
JET_MESH list.
:return: list of loaded mesh primitives.
"""

primitives = []

for mesh_item in mesh_components:

mesh_path, default_material = mesh_item

Expand All @@ -694,7 +709,9 @@ def import_jet_mesh(world, override_material=None, tungsten_material=None, beryl
print("importing {} ...".format(os.path.split(mesh_path)[1]))
directory, filename = os.path.split(mesh_path)
mesh_name, ext = filename.split('.')
Mesh.from_file(mesh_path, parent=world, material=material, name=mesh_name)
primitives.append(Mesh.from_file(mesh_path, parent=world, material=material, name=mesh_name))

return primitives


###########################
Expand Down