cad-to-dagmc 0.8.1__py3-none-any.whl → 0.8.2__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of cad-to-dagmc might be problematic. Click here for more details.

_version.py CHANGED
@@ -12,5 +12,5 @@ __version__: str
12
12
  __version_tuple__: VERSION_TUPLE
13
13
  version_tuple: VERSION_TUPLE
14
14
 
15
- __version__ = version = '0.8.1'
16
- __version_tuple__ = version_tuple = (0, 8, 1)
15
+ __version__ = version = '0.8.2'
16
+ __version_tuple__ = version_tuple = (0, 8, 2)
cad_to_dagmc/core.py CHANGED
@@ -8,7 +8,7 @@ import tempfile
8
8
  import warnings
9
9
 
10
10
 
11
- def _define_moab_core_and_tags() -> tuple[core.Core, dict]:
11
+ def define_moab_core_and_tags() -> tuple[core.Core, dict]:
12
12
  """Creates a MOAB Core instance which can be built up by adding sets of
13
13
  triangles to the instance
14
14
 
@@ -62,7 +62,7 @@ def _define_moab_core_and_tags() -> tuple[core.Core, dict]:
62
62
  return moab_core, tags
63
63
 
64
64
 
65
- def _vertices_to_h5m(
65
+ def vertices_to_h5m(
66
66
  vertices: list[tuple[float, float, float]] | list["cadquery.occ_impl.geom.Vector"],
67
67
  triangles_by_solid_by_face: list[list[tuple[int, int, int]]],
68
68
  material_tags: list[str],
@@ -100,7 +100,7 @@ def _vertices_to_h5m(
100
100
  else:
101
101
  face_ids_with_solid_ids[face_id] = [solid_id]
102
102
 
103
- moab_core, tags = _define_moab_core_and_tags()
103
+ moab_core, tags = define_moab_core_and_tags()
104
104
 
105
105
  volume_sets_by_solid_id = {}
106
106
  for material_tag, (solid_id, triangles_on_each_face) in zip(
@@ -233,7 +233,7 @@ def init_gmsh():
233
233
  return gmsh
234
234
 
235
235
 
236
- def _mesh_brep(
236
+ def mesh_brep(
237
237
  gmsh,
238
238
  min_mesh_size: float | None = None,
239
239
  max_mesh_size: float | None = None,
@@ -355,21 +355,21 @@ def mesh_to_vertices_and_triangles(
355
355
  return vertices, triangles_by_solid_by_face
356
356
 
357
357
 
358
- def _get_ids_from_assembly(assembly: cq.assembly.Assembly):
358
+ def get_ids_from_assembly(assembly: cq.assembly.Assembly):
359
359
  ids = []
360
360
  for obj, name, loc, _ in assembly:
361
361
  ids.append(name)
362
362
  return ids
363
363
 
364
364
 
365
- def _get_ids_from_imprinted_assembly(solid_id_dict):
365
+ def get_ids_from_imprinted_assembly(solid_id_dict):
366
366
  ids = []
367
367
  for id in list(solid_id_dict.values()):
368
368
  ids.append(id[0])
369
369
  return ids
370
370
 
371
371
 
372
- def _check_material_tags(material_tags, iterable_solids):
372
+ def check_material_tags(material_tags, iterable_solids):
373
373
  if material_tags:
374
374
  if len(material_tags) != len(iterable_solids):
375
375
  msg = (
@@ -448,7 +448,7 @@ class MeshToDagmc:
448
448
 
449
449
  gmsh.finalize()
450
450
 
451
- h5m_filename = _vertices_to_h5m(
451
+ h5m_filename = vertices_to_h5m(
452
452
  vertices=vertices,
453
453
  triangles_by_solid_by_face=triangles_by_solid_by_face,
454
454
  material_tags=material_tags,
@@ -537,7 +537,7 @@ class CadToDagmc:
537
537
  else:
538
538
  scaled_iterable_solids = [part.scale(scale_factor) for part in iterable_solids]
539
539
 
540
- _check_material_tags(material_tags, scaled_iterable_solids)
540
+ check_material_tags(material_tags, scaled_iterable_solids)
541
541
  if material_tags:
542
542
  self.material_tags = self.material_tags + material_tags
543
543
  self.parts = self.parts + scaled_iterable_solids
@@ -613,7 +613,7 @@ class CadToDagmc:
613
613
 
614
614
  gmsh, _ = get_volumes(gmsh, imprinted_assembly, method=method, scale_factor=scale_factor)
615
615
 
616
- gmsh = _mesh_brep(
616
+ gmsh = mesh_brep(
617
617
  gmsh=gmsh,
618
618
  min_mesh_size=min_mesh_size,
619
619
  max_mesh_size=max_mesh_size,
@@ -690,7 +690,7 @@ class CadToDagmc:
690
690
 
691
691
  gmsh, _ = get_volumes(gmsh, imprinted_assembly, method=method, scale_factor=scale_factor)
692
692
 
693
- gmsh = _mesh_brep(
693
+ gmsh = mesh_brep(
694
694
  gmsh=gmsh,
695
695
  min_mesh_size=min_mesh_size,
696
696
  max_mesh_size=max_mesh_size,
@@ -761,7 +761,7 @@ class CadToDagmc:
761
761
  for part in self.parts:
762
762
  assembly.add(part)
763
763
 
764
- original_ids = _get_ids_from_assembly(assembly)
764
+ original_ids = get_ids_from_assembly(assembly)
765
765
 
766
766
  # both id lists should be the same length as each other and the same
767
767
  # length as the self.material_tags
@@ -774,7 +774,7 @@ class CadToDagmc:
774
774
  assembly
775
775
  )
776
776
 
777
- scrambled_ids = _get_ids_from_imprinted_assembly(imprinted_solids_with_org_id)
777
+ scrambled_ids = get_ids_from_imprinted_assembly(imprinted_solids_with_org_id)
778
778
 
779
779
  material_tags_in_brep_order = order_material_ids_by_brep_order(
780
780
  original_ids, scrambled_ids, self.material_tags
@@ -783,7 +783,7 @@ class CadToDagmc:
783
783
  material_tags_in_brep_order = self.material_tags
784
784
  imprinted_assembly = assembly
785
785
 
786
- _check_material_tags(material_tags_in_brep_order, self.parts)
786
+ check_material_tags(material_tags_in_brep_order, self.parts)
787
787
 
788
788
  gmsh = init_gmsh()
789
789
 
@@ -791,7 +791,7 @@ class CadToDagmc:
791
791
  gmsh, imprinted_assembly, method=method, scale_factor=scale_factor
792
792
  )
793
793
 
794
- gmsh = _mesh_brep(
794
+ gmsh = mesh_brep(
795
795
  gmsh=gmsh,
796
796
  min_mesh_size=min_mesh_size,
797
797
  max_mesh_size=max_mesh_size,
@@ -808,7 +808,7 @@ class CadToDagmc:
808
808
  gmsh.finalize()
809
809
 
810
810
  # checks and fixes triangle fix_normals within vertices_to_h5m
811
- return _vertices_to_h5m(
811
+ return vertices_to_h5m(
812
812
  vertices=vertices,
813
813
  triangles_by_solid_by_face=triangles_by_solid_by_face,
814
814
  material_tags=material_tags_in_brep_order,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: cad_to_dagmc
3
- Version: 0.8.1
3
+ Version: 0.8.2
4
4
  Summary: Converts CAD files to a DAGMC h5m file
5
5
  Author-email: Jonathan Shimwell <mail@jshimwell.com>
6
6
  Project-URL: Homepage, https://github.com/fusion-energy/cad_to_dagmc
@@ -0,0 +1,8 @@
1
+ _version.py,sha256=t6tJJG56wlBKsg_0M1Q4l1ir09jgXRw1tolMbDalW9g,411
2
+ cad_to_dagmc/__init__.py,sha256=fskHUTyCunSpnpJUvBfAYjx4uwDKXHTTiMP6GqnFRf0,494
3
+ cad_to_dagmc/core.py,sha256=dW8p0TuQKJHPR6dqOulc7mTkB9zB2q_odkNSg8mU-Ew,31867
4
+ cad_to_dagmc-0.8.2.dist-info/LICENSE,sha256=B8kznH_777JVNZ3HOKDc4Tj24F7wJ68ledaNYeL9sCw,1070
5
+ cad_to_dagmc-0.8.2.dist-info/METADATA,sha256=aRZgmsBIcMbAB80vBJmuCWUkN6Ejab7X0IPBXsc52lU,8700
6
+ cad_to_dagmc-0.8.2.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
7
+ cad_to_dagmc-0.8.2.dist-info/top_level.txt,sha256=zTi8C64SEBsE5WOtPovnxhOzt-E6Oc5nC3RW6M_5aEA,22
8
+ cad_to_dagmc-0.8.2.dist-info/RECORD,,
@@ -1,8 +0,0 @@
1
- _version.py,sha256=Z8fNqmfsoA07nbVEewR90wZCgaN6eyDwPwgtgc2KIak,411
2
- cad_to_dagmc/__init__.py,sha256=fskHUTyCunSpnpJUvBfAYjx4uwDKXHTTiMP6GqnFRf0,494
3
- cad_to_dagmc/core.py,sha256=DbxXCaVEIiJxulRJlatoQg-yce37SS9Dx914Gt91qKY,31883
4
- cad_to_dagmc-0.8.1.dist-info/LICENSE,sha256=B8kznH_777JVNZ3HOKDc4Tj24F7wJ68ledaNYeL9sCw,1070
5
- cad_to_dagmc-0.8.1.dist-info/METADATA,sha256=AQ41vcWt_gHdZFL_rh7n28O5CheNftqa-FWdaVWvhjI,8700
6
- cad_to_dagmc-0.8.1.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
7
- cad_to_dagmc-0.8.1.dist-info/top_level.txt,sha256=zTi8C64SEBsE5WOtPovnxhOzt-E6Oc5nC3RW6M_5aEA,22
8
- cad_to_dagmc-0.8.1.dist-info/RECORD,,