-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
112 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
Python Package Usage, CSG to CAD conversion | ||
=========================================== | ||
|
||
The main class is ``CsgToCad()`` which converts Constructive Solid Geometry (CSG) to CAD. | ||
There are a few arguments that can be passed into the ``CsgToCad()`` class which are documented in the `Python API reference section <../python_api.html>`_ of the documentation. | ||
|
||
|
||
If you have install GEOUNED and FreeCAD into your system Python then you can simply run a .py script with Python. | ||
The most minimal use case below shows GEOUNED being imported and the CsgToCad being used to convert a CSG geometry into a STEP CAD file. | ||
The example makes use of default attributes. | ||
|
||
.. code-block:: python | ||
import geouned | ||
Users can change :meth:`geouned.Options`, :meth:`geouned.Settings`, :meth:`geouned.Tolerances` and :meth:`geouned.NumericFormat` to suit the conversion desired. | ||
The following example shows a usage with every attributes specified. | ||
|
||
.. code-block:: python | ||
import geouned |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
Command Line Tool Usage, CAD to CSG conversion | ||
============================================== | ||
|
||
GEOUNED CSG to CAD conversion can be performed in the command line. | ||
|
||
Both OpenMC XML CSG and MCNP CSG formats are supported. | ||
|
||
The first example assumes you have an OpenMC XML CSG file in the current working directory of the terminal called "cylinder_box.xml". | ||
|
||
The most minimal use case below shows a minimal config_openmc.json file being used. | ||
|
||
First create a JSON file called "config_openmc.json" containing the following. | ||
|
||
.. code-block:: json | ||
{ | ||
"export_cad":{ | ||
"input_filename": "cylinder_box.xml", | ||
"csg_format": "openmc_xml" | ||
} | ||
} | ||
Then execute the command line interface tool to convert your OpenMC XML CSG file to a STEP CAD file with the default configuration. | ||
|
||
.. code-block:: bash | ||
geouned_csgtocad -i config_openmc.json | ||
MCNP CSG files can also be converted, this example assumes you have a MCNP CSG file in te current working directory called "cylinder_box.mcnp". | ||
|
||
For MCNP CSG files, the JSON config file should be as follows and is assumed to be named "config_mcnp.json". | ||
|
||
|
||
.. code-block:: json | ||
{ | ||
"export_cad":{ | ||
"input_filename": "cylinder_box.mcnp", | ||
"csg_format": "mcnp" | ||
} | ||
} | ||
Then execute the command line interface tool to convert your MCNP CSG file to a STEP CAD file with the default configuration. | ||
|
||
.. code-block:: bash | ||
geouned_csgtocad -i config_mcnp.json | ||
The following example shows a usage with every attributes specified in the config.json file. | ||
|
||
The contents of the JSON file closely matches the Class arguments and method arguments when using the Python package. | ||
|
||
For a full description of each keyword see the `Python API reference section <../python_api.html>`_ of the documentation. | ||
|
||
Here is a complete JSON file specification | ||
|
||
.. code-block:: json | ||
{ | ||
"export_cad":{ | ||
"input_filename": "tests/csg_files/cylinder_box.xml", | ||
"csg_format": "openmc_xml", | ||
"output_filename" : "cad_from_csg", | ||
"bounding_box": [-1000, -1000, -1000, 1000, 1000, 1000], | ||
"universe_start": 0, | ||
"level_max": "all", | ||
"cell_range_type": "all", | ||
"cell_range": [], | ||
"mat_range_type": "all", | ||
"mat_range": [] | ||
} | ||
} | ||
.. code-block:: bash | ||
geouned_csgtocad -i config.json |