Converts STL files to a DAGMC h5m file using PyMoab
Project description
This is a minimal Python package that provides a Python API interfaces for converting multiple STL files into a DAGMC h5m file ready for use in simulation.
Convert STL files to a DAGMC h5m file complete with material tags and ready for use neutronics simulations.
warning this approach does not imprint and merge the geometry and therefore requires that the STL files do not overlap. Overlaps could lead to particles being lost during transport. If imprinting and merging is required consider using cad-to-h5m
Installation - Pip + Conda
conda install -c conda-forge moab
pip install stl_to_h5m
Usage - single file
To convert a single STL file into a h5m file. This also tags the volume with the material tag m1.
from stl_to_h5m import stl_to_h5m
stl_to_h5m(
files_with_tags=[{'stl_filename':'part1.stl', 'material_tag':'m1'}],
h5m_filename='dagmc.h5m',
)
Usage - multiple files
To convert multiple STL files into a h5m file. This also tags the relevant volumes with material tags called m1 and m2.
from stl_to_h5m import stl_to_h5m
stl_to_h5m(
files_with_tags=[
{'stl_filename':'part1.stl', 'material_tag':'m1'},
{'stl_filename':'part2.stl', 'material_tag':'m2'}
],
h5m_filename='dagmc.h5m'
)
Acknowledgments
This package is largely based on a script by @pshriwise
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for stl_to_h5m-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 40e8e269363068ccdbd9877f3e24eb1852ff90b860e289f38a425261b0e9bb3a |
|
MD5 | 39ce2c0ed9944026f32c68c86f2b8699 |
|
BLAKE2b-256 | 3a9e35467a83b645b306b4af0ac56f6e8c30ba4eb6758dd7376f7fee963f831a |