From cb07b863464ad85cf4f18a2e97764db5c3bcc766 Mon Sep 17 00:00:00 2001 From: Anthony LaTorre Date: Fri, 9 Sep 2011 12:54:56 -0400 Subject: update sphinx documentation. --- doc/source/geometry.rst | 61 ++++++++++++++++++++++++++++-- doc/source/images/bipyramid.png | Bin 0 -> 19223 bytes doc/source/images/box.png | Bin 0 -> 19836 bytes doc/source/images/cube.png | Bin 0 -> 14692 bytes doc/source/images/cylinder.png | Bin 0 -> 22259 bytes doc/source/images/hexagonal_prism.png | Bin 0 -> 13874 bytes doc/source/images/sphere.png | Bin 0 -> 55150 bytes doc/source/images/torus.png | Bin 0 -> 87454 bytes doc/source/render.rst | 68 ++++++++++++++++++++++++++++++++++ 9 files changed, 125 insertions(+), 4 deletions(-) create mode 100644 doc/source/images/bipyramid.png create mode 100644 doc/source/images/box.png create mode 100644 doc/source/images/cube.png create mode 100644 doc/source/images/cylinder.png create mode 100644 doc/source/images/hexagonal_prism.png create mode 100644 doc/source/images/sphere.png create mode 100644 doc/source/images/torus.png (limited to 'doc') diff --git a/doc/source/geometry.rst b/doc/source/geometry.rst index 347e1d3..a3f7463 100644 --- a/doc/source/geometry.rst +++ b/doc/source/geometry.rst @@ -9,14 +9,67 @@ The Mesh Class .. autoclass:: Mesh :members: +The Solid Class +--------------- + +.. autoclass:: Solid + :members: + +The Material Class +------------------ + +.. autoclass:: Material + :members: + +The Geometry Class +------------------ + +.. autoclass:: Geometry + :members: + Importing from STL ------------------ -.. automodule:: chroma.stl - :members: mesh_from_stl +.. autofunction:: chroma.mesh_from_stl Mesh Modelling Tools -------------------- -.. automodule:: chroma.make - :members: linear_extrude, rotate_extrude, box, cube, cylinder, segmented_cylinder, sphere, torus +.. module:: chroma.make + +.. autofunction:: linear_extrude + +.. image:: images/hexagonal_prism.png + :height: 100px + +.. autofunction:: rotate_extrude + +.. image:: images/bipyramid.png + :height: 100px + +.. autofunction:: box + +.. image:: images/box.png + :height: 100px + +.. autofunction:: cube + +.. image:: images/cube.png + :height: 100px + +.. autofunction:: cylinder + +.. image:: images/cylinder.png + :height: 100px + +.. autofunction:: segmented_cylinder + +.. autofunction:: sphere + +.. image:: images/sphere.png + :height: 100px + +.. autofunction:: torus + +.. image:: images/torus.png + :height: 100px diff --git a/doc/source/images/bipyramid.png b/doc/source/images/bipyramid.png new file mode 100644 index 0000000..17f6f64 Binary files /dev/null and b/doc/source/images/bipyramid.png differ diff --git a/doc/source/images/box.png b/doc/source/images/box.png new file mode 100644 index 0000000..c9ab226 Binary files /dev/null and b/doc/source/images/box.png differ diff --git a/doc/source/images/cube.png b/doc/source/images/cube.png new file mode 100644 index 0000000..fff0c39 Binary files /dev/null and b/doc/source/images/cube.png differ diff --git a/doc/source/images/cylinder.png b/doc/source/images/cylinder.png new file mode 100644 index 0000000..7574f0f Binary files /dev/null and b/doc/source/images/cylinder.png differ diff --git a/doc/source/images/hexagonal_prism.png b/doc/source/images/hexagonal_prism.png new file mode 100644 index 0000000..04b1341 Binary files /dev/null and b/doc/source/images/hexagonal_prism.png differ diff --git a/doc/source/images/sphere.png b/doc/source/images/sphere.png new file mode 100644 index 0000000..bb1c8a5 Binary files /dev/null and b/doc/source/images/sphere.png differ diff --git a/doc/source/images/torus.png b/doc/source/images/torus.png new file mode 100644 index 0000000..79bde5b Binary files /dev/null and b/doc/source/images/torus.png differ diff --git a/doc/source/render.rst b/doc/source/render.rst index 297c083..23b4735 100644 --- a/doc/source/render.rst +++ b/doc/source/render.rst @@ -1,2 +1,70 @@ Rendering Tools =============== + +.. module:: chroma + +There are three different ways to render a geometry: you can explicitly create a :class:`Camera` instance, call the function :func:`view`, or use the script `chroma-cam`. + +Example: + >>> chroma.view(chroma.make.cube()) + +.. image:: images/cube.png + :height: 100px + +To control the camera refer to the following table and :ref:`camera_hotkeys`. + +.. _camera_controls: + +============== =========== =========================== +Thing You Do Modifier Thing That Happens +============== =========== =========================== +click and drag rotate camera around object +click and drag shift translate camera +click and drag control rotate camera +mouse wheel zoom +============== =========== =========================== + + +.. _camera_hotkeys: + +Camera Hotkeys +-------------- + +========= =============================== +Command Thing That Happens +========= =============================== +alt toggle fine motion +F11 toggle fullscreen +escape quit += increase the alpha depth by one +\- decrease the alpha depth by one +pagedown move down through the bounding volume hierarchy tree +pageup move up through the bounding volume hierarchy tree +3 toggle 3d mode +g toggle 3d colors between red/cyan and green/magenta +F12 take a screenshot +m make a movie +F5 [#f1]_ toggle hybrid monte carlo rendering mode +F6 [#f2]_ place a light source at the camera's current location +F7 [#f2]_ add another light source at the camera's current location +========= =============================== + +.. rubric:: Footnotes + +.. [#f1] The hybrid monte carlo rendering mode requires the geometry have surfaces with a non-zero diffuse reflection probability. + +.. [#f2] Only available in hybrid monte carlo rendering mode. + +The Camera Class +---------------- + +.. class:: Camera(geometry, size=(800,600), device_id=None) + + The :class:`Camera` class uses :mod:`pygame` to render a geometry. + :class:`Camera` objects inherit from :class:`multiprocessing.Process` so + that you can render multiple geometries in separate windows at the same + time. + + .. method:: start() + + Create a :mod:`pygame` window, intialize CUDA, and start the camera. -- cgit