--- /dev/null
+
+ .. _tui_create_cone:
+
+Create / Cone
+=============
+
+.. literalinclude:: examples/cone.py
+ :linenos:
+ :language: python
+
+:download:`Download this script <examples/cone.py>`
+
**TUI Command**: *model.addBox(Part_doc, DX, DY, DZ)*
-**Arguments**: Name + Part + 3 values (dimensions at origin).
+**Arguments**: 1 Part + 3 values (dimensions at origin).
The description of input fields for **By two points** tab is given below:
-- **Point 1** and **Point 2** define the opposite vertices of the box.
+- selected **Point 1** and **Point 2** define the opposite vertices of the box.
**Apply** button creates box with defined parameters.
**TUI Command**: *model.addBox(Part_doc, FirstPoint, SecondPoint)*
-**Arguments**: Name + Part + 2 selected points (opposite vertices of the box)
+**Arguments**: 1 Part + 2 selected points (opposite vertices of the box)
The Result of operation will be a SOLID. The edges of the box will be parallel to the coordinate axes.
Cone
====
+To create a Cone in the active part:
+
+#. select in the Main Menu *Primitives - > Cone* item or
+#. click **Cone** button in the toolbar
+
+.. image:: images/Cone_button.png
+ :align: center
+
+.. centered::
+ **Cone** button
+
+The following property panel appears.
.. image:: images/Cone.png
:align: center
.. centered::
- Create a cone
+ Cone property panel
+
+The description of input fields is given below:
+
+- selected **Point** defines center of the cone base;
+- selected **Vector** defines the axis of the cone;
+- Dimensions:
+ - **Base Radius**;
+ - **Top radius**;
+ - **Height**.
+
+**Apply** button creates cone with defined parameters.
+
+**Cancel** button cancels operation.
+
+**TUI Command**: *model.addCone(Part_doc, Point, Axis, Radius1, Radius2, Height)*
+
+**Arguments**: 1 Part + 1 vertex + 1 vector + 3 values (Dimensions: base and top radii, heght).
+
+The Result of operation will be a SOLID.
+
+If both radii are non-zero, then the cone will be truncated.
+
+If the radii are equal, the Cylinder will be created instead of cone.
+
+Name is assigned automatically:
+
+* **Cone_1**, **Cone_2**, ... to Feature;
+* **Cone_1_1**, **Cone_2_1**, ... to Result.
+
+Example is shown below.
+
+.. image:: images/Cone_res.png
+ :align: center
+
+.. centered::
+ Sphere created
+
+**See Also** a sample TUI Script of a :ref:`tui_create_cone` operation.
The description of input fields for **Cylinder** tab is given below:
-- **Point** defines center of the cylinder base;
-- **Vector** defines the axis of the cylinder;
-- **Radius**;
-- **Height**.
+- selected **Point** defines center of the cylinder base;
+- selected **Vector** defines the axis of the cylinder;
+- Dimensions:
+ - **Radius**;
+ - **Height**.
Input fields for ***Portion of cylinder** tab includes in addition **Angle** to create a portion of cylinder.
* *model.addCylinder(Part_doc, Point, Axis, Radius, Height)*
* *model.addCylinder(Part_doc, Point, Axis, Radius, Height,Angle)*
-**Arguments**: Name + 1 Part + 1 vertex +1 vector + 2 or 3 values (dimensions: radius, height and angle).
+**Arguments**: 1 Part + 1 vertex +1 vector + 2 or 3 values (dimensions: radius, height and angle).
The Result of operation will be a SOLID.
--- /dev/null
+# -*- coding: utf-8 -*-
+
+from salome.shaper import model
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Cone_1 = model.addCone(Part_1_doc, model.selection("VERTEX", "PartSet/Origin"), model.selection("EDGE", "PartSet/OZ"), 10, 5, 10)
+model.do()
+model.end()
.. centered::
**Sphere** button
-The following input panel appears.
+The following property panel appears.
.. image:: images/Sphere.png
:align: center
.. centered::
- Sphere input panel
+ Sphere property panel
The description of input fields is given below:
-- **Point** defines center of the sphere;
+- selected **Point** defines center of the sphere;
- **Radius** defines the radius.
**Apply** button creates sphere with defined parameters.
**TUI Command**: *model.addSphere(Part_doc, Point, Radius)*.
-**Arguments**: Name + 1 Part + 1 vertex +1 value (radius).
+**Arguments**: 1 Part + 1 vertex +1 value (radius).
The Result of operation will be a SOLID.