diff --git a/src/CAD_to_OpenMC/assembly.py b/src/CAD_to_OpenMC/assembly.py index 8c404ea..e44a568 100644 --- a/src/CAD_to_OpenMC/assembly.py +++ b/src/CAD_to_OpenMC/assembly.py @@ -239,10 +239,10 @@ def run( ): """convenience function that assumes the stp_files field is set, etc and simply runs the mesher with the set options""" self.import_stp_files(**kwargs) + if imprint: + self.imprint_all() if merge: self.merge_all() - elif imprint: - self.imprint_all() self.solids_to_h5m(backend=backend, h5m_filename=h5m_filename, **kwargs) def import_stp_files( @@ -969,7 +969,7 @@ def _merge_solids_full(self, solids, fuzzy_value=1e-6): """ adds all solids on the solids-vector to the algorithm and merges them as arguments. This is stabler, but more resource - intesive + intensive """ bldr = OCP.BOPAlgo.BOPAlgo_MakeConnected() for shape in solids: diff --git a/src/CAD_to_OpenMC/assemblymesher_cq2.py b/src/CAD_to_OpenMC/assemblymesher_cq2.py index 0e881ae..eff71f7 100644 --- a/src/CAD_to_OpenMC/assemblymesher_cq2.py +++ b/src/CAD_to_OpenMC/assemblymesher_cq2.py @@ -80,9 +80,9 @@ def generate_stls(self): @classmethod def surface_hash(self,surface): - part1=hash(surface) - part2=abs(hash(surface.Center().toTuple())) - return int(str(part1)+str(part2)) + part1=surface + part2=surface.Center().toTuple() + return hash( (part1,part2) ) def _mesh_surfaces(self): # loop over all surfaces in all entities @@ -127,7 +127,7 @@ def _mesh_surfaces(self): return stls def _triangulate_solid(self, solid, tol: float = 1e-3, atol: float = 1e-1): - """ create a mesh /by means of the underlying OCCT IncrementalMesh + """ create a mesh by means of the underlying OCCT IncrementalMesh on a single solid. This will later be split into surfaces. This has to be done since otherwise a single solid can get leaky when surfaces do not connect