Skip to content

Commit

Permalink
removed jc from examples, put in docs
Browse files Browse the repository at this point in the history
  • Loading branch information
jon-proximafusion committed Sep 26, 2024
1 parent e02cde0 commit 8ac9e5d
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 38 deletions.
26 changes: 26 additions & 0 deletions docs/usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,32 @@ In all cases it is possible to add additional components such as divertors, polo
The reactors can be varied in terms of their radial build, vertical build, elongation and triangularity which gives a lot of variability.
These examples show how to make various reactors with and without different components, each example is minimal and aims to show a single feature, you will have to combine examples to make a complete model.


Visualization options
=====================

The reactors (cadquery.Assembly objects) and components (cadquery.Workplane objects) can be visualized in a number of ways.
First option is to export them to STEP, BREP or STL file then open the file with your favorite CAD software for example `FreeCAD <https://www.freecad.org/>`_.
See the `CadQuery documentation on saving <https://cadquery.readthedocs.io/en/latest/importexport.html#exporting-step>`_ for more information.
Other options include the built in visualization tools in CadQuery

.. code-block:: python
from cadquery.vis import show
show(result) # where result is the returned reactor or component object
or the jupyter_cadquery package which allows for interactive 3D visualization in a web browser.
or the jupyter_cadquery package which allows for interactive 3D visualization in a web browser.

.. code-block:: python
# pip install jupyter_cadquery
# might needed to downgrade pip with ... python -m pip install pip==24.0
from jupyter_cadquery import show
view = show(result) # where result is the returned reactor or component object
view.export_html("3d.html")
Tokamak from plasma
-------------------

Expand Down
4 changes: 0 additions & 4 deletions examples/spherical_tokamak_from_plasma_minimal.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,6 @@
)
my_reactor.save(f"spherical_tokamak_from_plasma_minimal.step")

# needed to downgrade pip with ... python -m pip install pip==24.0
# from jupyter_cadquery import show
# view = show(my_reactor)
# view.export_html('3d.html')


# my_model = CadToDagmc()
Expand Down
5 changes: 0 additions & 5 deletions examples/spherical_tokamak_from_plasma_with_divertor.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,6 @@
my_reactor.save("spherical_tokamak_from_plasma_with_divertor.step")
print('written spherical_tokamak_from_plasma_with_divertor.step')

# needed to downgrade pip with ... python -m pip install pip==24.0
# from jupyter_cadquery import show
# view = show(my_reactor)
# view.export_html("3d.html")


# my_model = CadToDagmc()
# material_tags = ["mat1"] * 21 # the two divertors split the 3 blanket layers into 9 and the magnets also splt the blanket.
Expand Down
5 changes: 0 additions & 5 deletions examples/spherical_tokamak_from_plasma_with_pf_magnets.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,6 @@
)
my_reactor.save(f"spherical_tokamak_from_plasma_with_pf_magnets.step")

# needed to downgrade pip with ... python -m pip install pip==24.0
# from jupyter_cadquery import show
# view = show(my_reactor)
# view.export_html('spherical_tokamak_from_plasma.html')


# my_model = CadToDagmc()
# material_tags = ["mat1"] * 5
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,6 @@
)
my_reactor.save(f"spherical_tokamak_from_plasma_with_pf_magnets_and_divertor.step")

# needed to downgrade pip with ... python -m pip install pip==24.0
# from jupyter_cadquery import show
# view = show(my_reactor)
# view.export_html('3d.html')


# my_model = CadToDagmc()
Expand Down
11 changes: 0 additions & 11 deletions examples/spherical_tokamak_from_plasma_with_tf_magnets.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,6 @@

result.save(f"spherical_tokamak_minimal.step")

# visualization options
#
# pip install jupyter_cadquery
# needed to downgrade pip with ... python -m pip install pip==24.0
# from jupyter_cadquery import show
# view = show(result)
# view.export_html("3d.html")
#
# from cadquery.vis import show
# show(result)

my_model = CadToDagmc()
material_tags = ["mat1"] * 7
my_model.add_cadquery_object(cadquery_object=result, material_tags=material_tags)
Expand Down
6 changes: 0 additions & 6 deletions examples/spherical_tokamak_minimal.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,6 @@
)
my_reactor.save(f"spherical_tokamak_minimal.step")

# needed to downgrade pip with ... python -m pip install pip==24.0
from jupyter_cadquery import show

view = show(my_reactor)
view.export_html("3d.html")


my_model = CadToDagmc()
material_tags = ["mat1"] * 6
Expand Down
3 changes: 0 additions & 3 deletions examples/tokamak_with_pf_magnets.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,6 @@
add_extra_cut_shapes=add_extra_cut_shapes,
)

from cadquery.vis import show
show(my_reactor)

my_reactor.save(f"tokamak_minimal.step")
print(f"Saved as tokamak_minimal.step")

Expand Down

0 comments on commit 8ac9e5d

Please sign in to comment.