'sphinx.ext.coverage',
'sphinx.ext.viewcode',
'sphinx.ext.napoleon',
+ 'sphinx.ext.autosummary',
]
# Add any paths that contain templates here, relative to this directory.
-:mod:`model.features.extrusion` -- Extrusion feature interface
---------------------------------------------------------------
+Extrusion
+---------
.. automodule:: model.features.extrusion
:members:
-.. Shaper python API documentation master file, created by
- sphinx-quickstart on Thu Oct 15 11:55:42 2015.
- You can adapt this file completely to your liking, but it should at least
- contain the root `toctree` directive.
+Shaper textual interface documentation
+======================================
-Welcome to Shaper python API's documentation!
-=============================================
+Shaper provides two different textual interfaces that allows you to create
+models through python scripts:
+* a "direct" API, which allows you to create geometrical objects
+ without any parametric considerations
-Sketching operations
---------------------
+* a "parametric" API, which is very close to what is done
+ in the graphical interface and allows you to recalculate a model
+ when a parameter is changed
-.. toctree::
- :maxdepth: 2
+Parametric API
+--------------
- sketcher
- arc
+This API is implemented in the model Python package. A script written
+with the parametric API will typically begin with a code like below:
+
+.. doctest::
+
+ >>> import model
+ >>> model.begin()
+ >>> partset = model.moduleDocument()
+ >>> part = model.addPart(partset).document()
+ >>> plane = model.defaultPlane("XOY")
+ >>> sketch = model.addSketch(part, plane)
+ >>> line = sketch.addLine(0, 0, 0, 1)
-Features
---------
.. toctree::
:maxdepth: 2
+ sketcher
extrusion
* :ref:`genindex`
* :ref:`modindex`
-* :ref:`search`
-
-:mod:`model.sketcher.sketch` -- Sketch interface
-================================================
+Sketch interface
+================
.. automodule:: model.sketcher.sketch
.. :members:
Create a sketch
---------------
-.. autofunction:: addSketch
+.. autosummary::
+ addSketch
-Modify the sketch
------------------
+Add geometries to the sketch
+----------------------------
-The sketch object returned by the above described :meth:`~model.sketcher.sketch.addSketch` method
-provides an interface for:
+.. autosummary::
- * creating geometries
- * setting and modifying constraints
+ Sketch.addPoint
+ Sketch.addLine
+ Sketch.addArc
+ Sketch.addCircle
-Create geometries
-.................
+Set constraints
+---------------
-.. automethod:: Sketch.addPoint
-.. automethod:: Sketch.addLine
-.. automethod:: Sketch.addArc
-.. automethod:: Sketch.addCircle
+.. autosummary::
+ Sketch.setRadius
+ Sketch.setParallel
-Set constraints
-...............
+Detailed description of sketch interface
+----------------------------------------
-.. automethod:: Sketch.setRadius
-.. automethod:: Sketch.setParallel
+Add a sketch to the document
+............................
+.. autofunction:: addSketch
+
+Sketch object
+.............
+
+The sketch object returned by the above described :meth:`~model.sketcher.sketch.addSketch` method
+provides an interface for:
+
+ * creating geometries
+ * setting and modifying constraints
+.. autoclass:: Sketch
+ :members:
# finalized by Renaud Nedelec and Sergey Pokhodenko
# Copyright (C) 2014-20xx CEA/DEN, EDF R&D
-"""Sketcher interface
-
+"""Sketcher interface.
This interface allows to add a sketch
in a part or partset.
The created sketch object provides all the needed methods