Sketch plug-in includes features for creation of 2D shapes.
The process of sketch creation is comprised of:
+
- definition of sketch plane
- creation of sketch objects from scratch
- generation of sketch objects via operations on the existing operations
-- definition of constaints
+- definition of constraints
Sketch could be created both in active part and a part set (if there is no active part).
.. centered::
**Sketch** button
-At first it is necessary to define a plane on which to create a sketch:
+First define a plane on which to create a sketch:
.. image:: images/PlaneDefinition.png
:align: center
- **Show dimensional constraints** check box - turns on/off dimensional constraints displaying
- **Show existing expressions** check box - turns on/off expressions displaying
-Now it is possible to create sketch objects, make sketch operations and constraints.
-To apply or cancel sketch creation it is possible to use apply and cancel buttons from the
+Now it is possible:
+
+- create :ref:`sketch objects <sketch_objects>`
+- create :ref:`constraints <sketch_constraints>`
+- perform :ref:`sketch operations <sketch_operations>`
+
+To apply or cancel sketch creation use apply and cancel buttons from the
Sketch panel as well as equivalent buttons from Sketch toolbar.
The Result of operation will be a COMPOUND. Result node in the object tree is located in
**Arguments**: Part or PartSet + plane.
+.. _sketch_objects:
+
Sketch objects
--------------
circleFeature.rst
arcFeature.rst
+.. _sketch_constraints:
+
Constraints
-----------
verticalDistFeature.rst
verticalFeature.rst
+.. _sketch_operations:
+
Operations
----------
--- /dev/null
+
+ .. _tui_create_arc:
+
+Create Skecth Arc
+=================
+
+.. literalinclude:: examples/arc.py
+ :linenos:
+ :language: python
+
+:download:`Download this script <examples/arc.py>`
--- /dev/null
+
+ .. _tui_create_circle:
+
+Create Skecth Circle
+====================
+
+.. literalinclude:: examples/circle.py
+ :linenos:
+ :language: python
+
+:download:`Download this script <examples/circle.py>`
.. image:: images/arc_tang_32x32.png
:align: left
-**By tangent and point** creates an arc segment with the tangent point and the end point.
+**By tangent point and end point** creates an arc segment with the tangent point and the end point.
By center and two points
""""""""""""""""""""""""
.. image:: images/Arc_panel_base.png
:align: center
+Click in the view once to set the center point, then move the mouse and click a second time to set the start point
+and finally move the mouse and click a third time to set the last passed point.
+- When entering a center or start point by selecting either a point or a segment, a Coincident constraint is created.
+- When entering an end point by selecting a segment, a Coincident constraint is created.
+- When entering an end point, only segments are selectable.
-**TUI Command**: *Sketch_1.addCircle(CenterX, CenterY, StartX, StartY, EndX, EndY, Inversed)*
+**TUI Command**: *Sketch_1.addArc(CenterX, CenterY, StartX, StartY, EndX, EndY, Inversed)*
**Arguments**: 7 values (coordinates of the center, the start, the end, inversed flag (if true - build arc from end to start)).
.. image:: images/Arc_panel_3pt.png
:align: center
-**TUI Command**: *Sketch_1.addCircle(StartX, StartY, EndX, EndY, PassedX, PassedY)*
+Click in the view once to set the start point, then move the mouse and click a second time to set the end point
+and finally move the mouse and click a third time to set the passed point.
+
+- When entering a start or end point by selecting either a point or a segment, a Coincident constraint is created.
+- When entering a passing point by selecting a point, a Coincident constraint is created.
+- When entering a passing point by selecting a segment, a Tangent constraint is created.
+
+**TUI Command**: *Sketch_1.addArc(StartX, StartY, EndX, EndY, PassedX, PassedY)*
**Arguments**: 6 values (coordinates of the start, end and passed points).
-By tangent and point
-""""""""""""""""""""
+By tangent point and point
+""""""""""""""""""""""""""
.. image:: images/Arc_panel_tang.png
:align: center
-**TUI Command**: *Sketch_1.addCircle(TangetPoint, EndX, EndY, Inversed)*
+Select point on segement in the view to set the tangent point, then move the mouse and click to set the end point.
+Tangent point by itself is a start point. The edge on which it lies will be tangent to the arc.
+
+- When entering a tangent point by selecting a point on segment, a Tangent constraint is created.
+- When entering an end point by selecting a segment, a Coincident constraint is created.
+- When entering an end point, only segments are selectable.
+
+**TUI Command**: *Sketch_1.addArc(TangetPoint, EndX, EndY, Inversed)*
+
+**Arguments**: 4 values (reference to tangent point, coordinates of end point, inversed flag (if true - build arc from end to start)).
+
+Result
+""""""
+
+Created arc appears in the view.
+
+.. image:: images/Arc_res.png
+ :align: center
+
+.. centered::
+ Circle created
-**Arguments**: 4 values (reference to tangent point, coordinates of end point, inversed flag (if true - build arc from end to start)).
\ No newline at end of file
+**See Also** a sample TUI Script of a :ref:`tui_create_arc` operation.
\ No newline at end of file
Click in the view once to set the center point, then move the mouse and click a second time to set the passed point.
+- When entering a center point by selecting either a point or a segment, a Coincident constraint is created.
+- When entering a passing point by selecting a point, a Coincident constraint is also created.
+- When entering a passing point by selecting a segment, a Tangent constraint is created.
+
**TUI Command**: *Sketch_1.addCircle(CenterX, CenterY, PassedX, PassedY)*
**Arguments**: 4 values (coordinates of the center and the passed point).
Click in the view once to set the first passed point, then move the mouse and click a second time to set the second passed point
and finally move the mouse and click a third time to set the last passed point.
+- When entering a passing point by selecting a point, a Coincident constraint is created.
+- When entering a passing point by selecting a segment, a Tangent constraint is created.
+
**TUI Command**: *Sketch_1.addCircle(X1, Y1, X2, Y2, X3, Y3)*
**Arguments**: 6 values (coordinates of three points).
+
+Property panel in edition context
+"""""""""""""""""""""""""""""""""
+
+The following property panel appears when the user selects an existing circle.
+
+.. image:: images/Circle_panel_edit.png
+ :align: center
+
+Note that the edition property panel doesn't show the creation algorithm used.
+
+The panel shows:
+
+- center coordinates and radius (read-only).
+- auxiliary flag (could be modified).
+
+Result
+""""""
+
+Created circle appears in the view.
+
+.. image:: images/Circle_res.png
+ :align: center
+
+.. centered::
+ Circle created
+
+**See Also** a sample TUI Script of a :ref:`tui_create_circle` operation.
--- /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()
+Sketch_1 = model.addSketch(Part_1_doc, model.standardPlane("XOY"))
+SketchArc_1 = Sketch_1.addArc(6.0, 6.2, 5.2, 34.3, 34.0, 7.7, True)
+SketchArc_2 = Sketch_1.addArc(8.1, 56.7, 58.2, 6.6, 44.8, 69.2)
+SketchLine_3 = Sketch_1.addLine(25.0, 109.4, 68.1, 153.6)
+SketchLine_3.setAuxiliary(True)
+SketchArc_3 = Sketch_1.addArc(SketchLine_3.startPoint(), 92.1, 34.0, True)
+model.do()
+model.end()
--- /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()
+Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
+SketchCircle_1 = Sketch_1.addCircle(38.6, 47.5, 31.5)
+SketchCircle_2 = Sketch_1.addCircle(0.0, 14.1, 15.0, 0.1, 17.2, 19.9)
+model.do()
+model.end()
Part_1 = model.addPart(partSet)
Part_1_doc = Part_1.document()
Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
-SketchLine_1 = Sketch_1.addLine(64.50309529234383, 87.92795791556755, -33.49721981216553, -42.5840914148601)
+SketchLine_1 = Sketch_1.addLine(64.5, 87.9, -33.4, -42.6)
model.do()
model.end()
Part_1 = model.addPart(partSet)
Part_1_doc = Part_1.document()
Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
-SketchPoint_1 = Sketch_1.addPoint(42.64092753227449, 19.02972704799864)
+SketchPoint_1 = Sketch_1.addPoint(42.6, 19.0)
model.do()
model.end()
\ No newline at end of file
Part_1 = model.addPart(partSet)
Part_1_doc = Part_1.document()
Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
-Rectangle_1 = Sketch_1.addRectangle(5.598878525298213, 8.556502484736781, 31.35634838639225, 78.97905438572354)
+Rectangle_1 = Sketch_1.addRectangle(5.5, 8.5, 31.3, 78.9)
model.do()
model.end()
Created line appears in the view.
-Example is shown below.
-
.. image:: images/Line_res.png
:align: center
Created point appears in the view.
-Example is shown below.
-
.. image:: images/Point_res.png
:align: center
Created rectangle appears in the view.
-Example is shown below.
-
.. image:: images/Rectangle_res.png
:align: center