cad-to-dagmc 0.8.0__py3-none-any.whl → 0.8.1__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.0'
16
- __version_tuple__ = version_tuple = (0, 8, 0)
15
+ __version__ = version = '0.8.1'
16
+ __version_tuple__ = version_tuple = (0, 8, 1)
cad_to_dagmc/core.py CHANGED
@@ -503,6 +503,7 @@ class CadToDagmc:
503
503
  cq.assembly.Assembly | cq.occ_impl.shapes.Compound | cq.occ_impl.shapes.Solid
504
504
  ),
505
505
  material_tags: list[str] | None,
506
+ scale_factor: float = 1.0,
506
507
  ) -> int:
507
508
  """Loads the parts from CadQuery object into the model.
508
509
 
@@ -514,6 +515,10 @@ class CadToDagmc:
514
515
  same order as the volumes in the geometry added (STP file and
515
516
  CadQuery objects) and match the material tags used in the
516
517
  neutronics code (e.g. OpenMC).
518
+ scale_factor: a scaling factor to apply to the geometry that can be
519
+ used to increase the size or decrease the size of the geometry.
520
+ Useful when converting the geometry to cm for use in neutronics
521
+ simulations.
517
522
 
518
523
  Returns:
519
524
  int: number of volumes in the stp file.
@@ -527,12 +532,17 @@ class CadToDagmc:
527
532
  else:
528
533
  iterable_solids = cadquery_object.val().Solids()
529
534
 
530
- _check_material_tags(material_tags, iterable_solids)
535
+ if scale_factor == 1.0:
536
+ scaled_iterable_solids = iterable_solids
537
+ else:
538
+ scaled_iterable_solids = [part.scale(scale_factor) for part in iterable_solids]
539
+
540
+ _check_material_tags(material_tags, scaled_iterable_solids)
531
541
  if material_tags:
532
542
  self.material_tags = self.material_tags + material_tags
533
- self.parts = self.parts + iterable_solids
543
+ self.parts = self.parts + scaled_iterable_solids
534
544
 
535
- return len(iterable_solids)
545
+ return len(scaled_iterable_solids)
536
546
 
537
547
  def export_unstructured_mesh_file(
538
548
  self,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: cad_to_dagmc
3
- Version: 0.8.0
3
+ Version: 0.8.1
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=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,,
@@ -1,8 +0,0 @@
1
- _version.py,sha256=vspFLRfYI6gAAN7kyihey2lhPos0jxqKaNDWFlKPlmU,411
2
- cad_to_dagmc/__init__.py,sha256=fskHUTyCunSpnpJUvBfAYjx4uwDKXHTTiMP6GqnFRf0,494
3
- cad_to_dagmc/core.py,sha256=w8Bu3MyjhQtW4KYRXktib7aPbjTy8jfSdpSgzw57gIc,31366
4
- cad_to_dagmc-0.8.0.dist-info/LICENSE,sha256=B8kznH_777JVNZ3HOKDc4Tj24F7wJ68ledaNYeL9sCw,1070
5
- cad_to_dagmc-0.8.0.dist-info/METADATA,sha256=GvclO4Hs5U2TwJLenoQZVAsQ0GSNOjOQ1IUhqS0rNWA,8700
6
- cad_to_dagmc-0.8.0.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
7
- cad_to_dagmc-0.8.0.dist-info/top_level.txt,sha256=zTi8C64SEBsE5WOtPovnxhOzt-E6Oc5nC3RW6M_5aEA,22
8
- cad_to_dagmc-0.8.0.dist-info/RECORD,,