diff --git a/tests/test_package.py b/tests/test_package.py index 764160e..ab442bb 100644 --- a/tests/test_package.py +++ b/tests/test_package.py @@ -51,8 +51,8 @@ def transport_particles_on_h5m_geometry( # initialises a new source object my_source = openmc.Source() - # sets the location of the source to x=0 y=0 z=0 - my_source.space = openmc.stats.Point((0, 0, 0)) + # sets the location of the source to x=0.1 y=0.1 z=0.1 which is not on a vertex + my_source.space = openmc.stats.Point((0.1, 0.1, 0.1)) # sets the direction to isotropic my_source.angle = openmc.stats.Isotropic() # sets the energy distribution to 100% 14MeV neutrons diff --git a/vertices_to_h5m/core.py b/vertices_to_h5m/core.py index dceafee..f4bbddf 100644 --- a/vertices_to_h5m/core.py +++ b/vertices_to_h5m/core.py @@ -1,4 +1,4 @@ -from typing import Tuple +from typing import Iterable, Tuple import numpy as np import trimesh @@ -16,21 +16,12 @@ def fix_normals(vertices, triangles_in_each_volume): def fix_normal(vertices, triangles): # for triangles in triangles_in_each_volume: - print("fixing", triangles) mesh = trimesh.Trimesh(vertices=vertices, faces=triangles, process=False) mesh.fix_normals() - print("fixed", mesh.faces) return mesh.faces - # # triangles = mesh.faces - # print('fixed',mesh.faces) - # fixed_triangles.append(mesh.faces) - # print('appending triangles') - - # return fixed_triangles - def _define_moab_core_and_tags() -> Tuple[core.Core, dict]: """Creates a MOAB Core instance which can be built up by adding sets of @@ -131,6 +122,7 @@ def add_vertices_to_moab_core(moab_core, vertices, surface_set): def add_triangles_to_moab_core( material_tag, surface_set, moab_core, tags, triangles, moab_verts, volume_set ): + for triangle in triangles: tri = ( @@ -155,9 +147,6 @@ def add_triangles_to_moab_core( return moab_core -from typing import Iterable - - def vertices_to_h5m( vertices: Iterable[Tuple[float, float, float]], triangles: Iterable[Tuple[int, int, int]],