GEOUNED-org / GEOUNED

A tool to convert CAD to CSG & CSG to CAD for Monte Carlo transport codes
European Union Public License 1.2
54 stars 30 forks source link

Persistent intermediate objects #114

Open alberto743 opened 4 months ago

alberto743 commented 4 months ago

It would be useful to have persistent/serializable output objects storing the CSG representation, in order to trigger the output data format drivers (e.g. MCNP, OpenMC, etc.) thereafter.

shimwell commented 4 months ago

partly addressed in PR #144 which splits the start method into two parts allowing

alberto743 commented 4 months ago

I guess that this kind of modification may require some substantial redesign of the objects, so that each of them will expose some introspection and explicit serialization drivers. Probably we may keep this issue as reference as a part of the refactoring.

shimwell commented 4 months ago

There are now some class attributes that get generated during the start() method that can be accessed if that helps

import geouned
geo = geouned.CadToCsg(stepFile='example.stp')
geo.start()
print(geo.UniverseBox)
print(geo.MetaList)
print(geo.Surfaces)