Skip to content

Commit

Permalink
rebase to merge with up to date main branch
Browse files Browse the repository at this point in the history
  • Loading branch information
davidsosa committed Nov 15, 2024
1 parent 0e8e0fa commit b1e9317
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 57 deletions.
11 changes: 3 additions & 8 deletions parastell/invessel_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -293,24 +293,19 @@ def merge_layer_surfaces(self):
)
prev_outer_surface_id = outer_surface_id

<<<<<<< HEAD
def import_step_cubit(self):
"""Imports STEP files from in-vessel build into Coreform Cubit."""
for name, data in self.radial_build.radial_build.items():
vol_id = cubit_io.import_step_cubit(name, self.export_dir)
data["vol_id"] = vol_id

def export_step(self, export_dir=""):
"""Export CAD solids as STEP files via CadQuery.
=======
def export_components(self, filetype ="step", export_dir=""):
def export_components(self, filetype="step", export_dir=""):
"""Export CAD solids as STEP or STL files via CadQuery.
>>>>>>> 666c81c (export_step and export_stl merged into a single function)
Arguments:
filetype (str): file extension to which solids are exported
filetype (str): file extension, excluding '.', to which solids are exported
(defaults to STEP).
export_dir (str): directory to which to export the STEP output files
export_dir (str): directory to which to export the output files
(optional, defaults to empty string).
"""
self._logger.info(f"Exporting {filetype.upper()} files for in-vessel components...")
Expand Down
53 changes: 8 additions & 45 deletions parastell/magnet_coils.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,6 @@ def build_magnet_coils(self):

self._cut_magnets()

<<<<<<< HEAD
def import_step_cubit(self):
"""Import STEP file for magnet set into Coreform Cubit."""
first_vol_id = 1
Expand All @@ -251,69 +250,33 @@ def import_step_cubit(self):

self.volume_ids = list(range(first_vol_id, last_vol_id + 1))

def export_step(self, step_filename="magnet_set", export_dir=""):
"""Export CAD solids as a STEP file via CadQuery.
=======
def export_components(self, filetype="step", filename="magnet_set", export_dir=""):
"""Export CAD solids as a STEP or STL file via CadQuery.
>>>>>>> 666c81c (export_step and export_stl merged into a single function)
Arguments:
step_filename (str): name of STEP output file, excluding '.step'
extension (optional, defaults to 'magnet_set').
export_dir (str): directory to which to export the STEP output file
filetype (str): extension, excluding '.', to which to export the output file
(defaults to STEP).
filename (str): name of output file, excluding extension
(optional, defaults to 'magnet_set').
export_dir (str): directory to which to export the output file
(optional, defaults to empty string).
"""
self._logger.info(f"Exporting {filetype.upper()} file for magnet coils...")

self.export_dir = export_dir
self.filename = filename
self.filename =filename

export_path = Path(self.export_dir) / Path(
<<<<<<< HEAD
self.step_filename
).with_suffix(".step")
coil_set = cq.Compound.makeCompound(
[coil.solid for coil in self.magnet_coils]
)
cq.exporters.export(coil_set, str(export_path))
<<<<<<< HEAD
def mesh_magnets(self, min_size=20.0, max_size=50.0, max_gradient=1.5):
"""Creates tetrahedral mesh of magnet volumes via Coreform Cubit.
=======
def export_stl(self, stl_filename="magnet_set", export_dir=""):
"""Export CAD solids as a STL file via CadQuery.
Arguments:
stl_filename (str): name of STL output file, excluding '.stl'
extension (optional, defaults to 'magnet_set').
export_dir (str): directory to which to export the STL output file
(optional, defaults to empty string).
"""
self._logger.info("Exporting STL file for magnet coils...")

self.export_dir = export_dir
self.stl_filename = stl_filename

export_path = Path(self.export_dir) / Path(
self.stl_filename
).with_suffix(".stl")
=======
self.filename
).with_suffix(f".{filetype}")
>>>>>>> 666c81c (export_step and export_stl merged into a single function)

coil_set = cq.Compound.makeCompound(
[coil.solid for coil in self.magnet_coils]
)
cq.exporters.export(coil_set, str(export_path))

def mesh_magnets(self):
"""Creates tetrahedral mesh of magnet volumes via Coreform Cubit."""
self._logger.info("Generating tetrahedral mesh of magnet coils...")
>>>>>>> b8d21a2 (export to STL format capability added)
def mesh_magnets(self, min_size=20.0, max_size=50.0, max_gradient=1.5):
"""Creates tetrahedral mesh of magnet volumes via Coreform Cubit.
Arguments:
min_size (float): minimum size of mesh elements (defaults to 20.0).
Expand Down
8 changes: 4 additions & 4 deletions parastell/parastell.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,8 @@ def export_invessel_build(
neutronics H5M file of in-vessel components via CAD-to-DAGMC.
Arguments:
filetype (str): file extension to which solids are exported
(defaults to STEP).
filetype (str): file extension, excluding '.', to which solids are
exported (defaults to STEP).
export_cad_to_dagmc (bool): export DAGMC neutronics H5M file of
in-vessel components via CAD-to-DAGMC (optional, defaults to
False).
Expand Down Expand Up @@ -241,9 +241,9 @@ def export_magnets(
"""Export magnet components.
Arguments:
filetype (str): filetype (str): file extension to which solids are
filetype (str): file extension, excluding '.', to which solids are
exported (defaults to STEP).
filename (str): name of export output file, excluding extension
filename (str): name of output file, excluding extension
(optional, defaults to 'magnet_set').
export_mesh (bool): flag to indicate tetrahedral mesh generation
for magnet volumes (optional, defaults to False).
Expand Down

0 comments on commit b1e9317

Please sign in to comment.