Input Sources#
cad_to_dagmc accepts geometry from three sources:
Input Type |
Description |
Use Case |
|---|---|---|
Python-defined geometry |
Parametric models, scripted geometry |
|
Multi-part CadQuery assemblies |
Complex models with multiple components |
|
Industry-standard CAD format can also contain assemblies |
Importing from CAD software |
|
Pre-existing mesh files |
When you already have a mesh |
Basic Pattern#
All input methods follow the same pattern:
Create a
CadToDagmcmodelAdd geometry using
add_cadquery_object()oradd_stp_file()Export to desired format
from cad_to_dagmc import CadToDagmc
model = CadToDagmc()
# Add geometry here...
model.export_dagmc_h5m_file(filename="dagmc.h5m")
For GMSH files, use the standalone function:
from cad_to_dagmc import export_gmsh_file_to_dagmc_h5m_file
export_gmsh_file_to_dagmc_h5m_file(
gmsh_filename="mesh.msh",
dagmc_filename="dagmc.h5m"
)