step_to_h5m
Please note that this tool will likely change its name soon.
This is intended to be a python package heavily inspired by Paramak, and borrowing a lot from its namesake: https://github.com/fusion-energy/step_to_h5m). It's "raison d'etre" is to enable a link between the online CAD-tool onShape and the neutron transport code OpenMC.
We will use cadQuery and its links to OCCT to enable import and imprinting/merging algorithms.
The code structure we intend is a main class Assembly which contains the geometry in terms of a set of volumes. We then use gmsh to generate a surface mesh which may be used by OpenMC through DAGMC/MOAB (i.e. .h5m-files)
To install/set up in a virtual python environment
replace <name> with an arbitrary name for your virtual environment
- Clone the github repository as you'd normally do
- In the directory where you want your environment to reside do:
python -m venv <name> - Activate the environment:
source <name>/bin/activate - install the requirements:
pip install -r requirements.txt - Build and install moab (if not already installed). The moab team relies on conda for standard installation but are working on a pip-based solution. Once that is done moab would simply be added to the requirements-file instead.
- Clone the moab code-repository: e.g.
git clone git@bitbucket.org:fathomteam/moab.git - Configure and build the code:
mkdir build; cd build; cmake .. -DENABLE_PYMOAB=1; make; make install
Run a test case:
The follwing code-snippet can now be run to explore the capabilities of Assembly/step_to_h5m
import assembly as ab
a=ab.Assembly()
a.stp_files=["file.step"]
a.import_stp_files()
a.export_brep('file.brep')
a.brep_to_h5m(brep_filename='file.brep',min_mesh_size=0.1, max_mesh_size=10, samples=20)
N.b. the last 3 parameters to brep_to_h5m are simply echoing their default values, and uses the default mesher: gmsh. Their significance is that all curves are sampled by 20 points, but limits the generated mesh-elements to be within the size range [min_mesh_size,max_mesh_size]. This procedure will in turn call OCP and gmsh to produce a mesh with merged surfaces in the output file "dagmc.h5m"
The other available meshing backend is the stl-export from CadQuery (accessible by setting backend='stl') which uses the parameters stl_tol and stl_ang_tol to set meshing quality.
The export_brep-step may be omitted, in which case a temporary file will be written.
Metadata
Release files for h5massembly 0.0.12
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| h5massembly-0.0.12.tar.gz | 14.2 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| h5massembly-0.0.12-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 28.5 kB
Release files / h5massembly-0.0.12.tar.gz
| Download URL | h5massembly-0.0.12.tar.gz |
|---|---|
| Size | 14.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
019b5fac364dffb3dcecab6fe85bc3e5fba3d5c13ad0b97d0639e1aa1fc5fb3c
|
|
BLAKE2b-256 checksum How to use checksums |
5215ae08a55d9049fb713ce018529a69e8844c82d87e2c30997cdc0dcfddd7e3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.10.5
|
Release files / h5massembly-0.0.12-py3-none-any.whl
| Download URL | h5massembly-0.0.12-py3-none-any.whl |
|---|---|
| Size | 14.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2f28697509f505723509ee11cfd018df8f6d34908b85af67172d5ba4fda4cfcc
|
|
BLAKE2b-256 checksum How to use checksums |
c5a13363d24a6275510edbe14cb67975c782d80e5b56b01bdeb35ae33e3daa14
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.10.5
|
Security for h5massembly 0.0.12
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.