Operations
----------
+The plug-in includes the following operations:
+
.. toctree::
:maxdepth: 1
filletFeature.rst
splitFeature.rst
trimFeature.rst
+ projectionFeature.rst
intersectionFeature.rst
mirrorFeature.rst
- projectionFeature.rst
- rotationFeature.rst
translationFeature.rst
+ rotationFeature.rst
--- /dev/null
+
+ .. _tui_create_fillet:
+
+Create Fillet
+=============
+
+.. literalinclude:: examples/fillet.py
+ :linenos:
+ :language: python
+
+:download:`Download this script <examples/fillet.py>`
--- /dev/null
+
+ .. _tui_create_intersection:
+
+Create Intersection
+===================
+
+.. literalinclude:: examples/intersection.py
+ :linenos:
+ :language: python
+
+:download:`Download this script <examples/intersection.py>`
--- /dev/null
+
+ .. _tui_create_mirror:
+
+Create Mirror copy
+==================
+
+.. literalinclude:: examples/mirror.py
+ :linenos:
+ :language: python
+
+:download:`Download this script <examples/mirror.py>`
--- /dev/null
+
+ .. _tui_create_projection:
+
+Create Projection
+=================
+
+.. literalinclude:: examples/projection.py
+ :linenos:
+ :language: python
+
+:download:`Download this script <examples/projection.py>`
--- /dev/null
+
+ .. _tui_create_rotation:
+
+Create Angular copy
+===================
+
+.. literalinclude:: examples/rotation.py
+ :linenos:
+ :language: python
+
+:download:`Download this script <examples/rotation.py>`
--- /dev/null
+
+ .. _tui_create_split:
+
+Create Split
+============
+
+.. literalinclude:: examples/split.py
+ :linenos:
+ :language: python
+
+:download:`Download this script <examples/split.py>`
--- /dev/null
+
+ .. _tui_create_translation:
+
+Create Linear copy
+==================
+
+.. literalinclude:: examples/translation.py
+ :linenos:
+ :language: python
+
+:download:`Download this script <examples/translation.py>`
--- /dev/null
+
+ .. _tui_create_trim:
+
+Create Trim
+===========
+
+.. literalinclude:: examples/trim.py
+ :linenos:
+ :language: python
+
+:download:`Download this script <examples/trim.py>`
--- /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"))
+SketchLine_1 = Sketch_1.addLine(7, 46, 63, 20)
+SketchLine_2 = Sketch_1.addLine(63, 20, 55, 85)
+SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchLine_2.startPoint())
+Fillet_1 = Sketch_1.setFillet(SketchLine_1.endPoint())
+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()
+
+Point_2 = model.addPoint(Part_1_doc, 10, 10, -10)
+Point_3 = model.addPoint(Part_1_doc, 70, 70, 50)
+Polyline_1 = model.addPolyline3D(Part_1_doc, [model.selection("VERTEX", "Point_1"), model.selection("VERTEX", "Point_2")], False)
+
+Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
+SketchIntersectionPoint_1 = Sketch_1.addIntersectionPoint(model.selection("EDGE", "Polyline_1_1/Edge_1"), 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(25, 25, 11)
+SketchLine_1 = Sketch_1.addLine(9, 78, 78, 9)
+
+SketchConstraintMirror_1 = Sketch_1.addMirror(SketchLine_1.result(), [SketchCircle_1.results()[1]])
+
+model.do()
+model.end()
\ No newline at end of file
--- /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()
+
+Point_2 = model.addPoint(Part_1_doc, 10, 10, -10)
+Point_3 = model.addPoint(Part_1_doc, 70, 70, 50)
+Polyline_1 = model.addPolyline3D(Part_1_doc, [model.selection("VERTEX", "Point_1"), model.selection("VERTEX", "Point_2")], False)
+
+Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
+SketchIntersectionPoint_1 = Sketch_1.addProjection(model.selection("EDGE", "Polyline_1_1/Edge_1"), 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"))
+SketchPoint_1 = Sketch_1.addPoint(45, 45)
+SketchCircle_1 = Sketch_1.addCircle(35, 25, 8)
+
+SketchMultiRotation_1 = Sketch_1.addRotation([SketchCircle_1.results()[1]], SketchPoint_1.coordinates(), 270, 4, True)
+[SketchCircle_2, SketchCircle_3, SketchCircle_4] = SketchMultiRotation_1.rotated()
+
+model.do()
+model.end()
--- /dev/null
+# -*- coding: utf-8 -*-
+
+from salome.shaper import model
+from salome.shaper import geom
+
+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(44, 44, 29)
+
+SketchPoint_1 = Sketch_1.addPoint(15, 44)
+SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchPoint_1.coordinates(), SketchCircle_1.results()[1])
+SketchPoint_2 = Sketch_1.addPoint(44, 73)
+SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchPoint_2.coordinates(), SketchCircle_1.results()[1])
+SketchPoint_3 = Sketch_1.addPoint(64, 23)
+SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchPoint_3.coordinates(), SketchCircle_1.results()[1])
+
+GeomPoint = geom.Pnt2d(22, 65)
+Sketch_1.addSplit(SketchCircle_1, GeomPoint)
+
+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(12, 12, 6.5)
+SketchPoint_1 = Sketch_1.addPoint(13, 50)
+SketchPoint_2 = Sketch_1.addPoint(30, 70)
+
+SketchMultiTranslation_1 = Sketch_1.addTranslation([SketchCircle_1.results()[1]], SketchPoint_1.coordinates(), SketchPoint_2.coordinates(), 4)
+[SketchCircle_2, SketchCircle_3, SketchCircle_4] = SketchMultiTranslation_1.translated()
+
+model.do()
+model.end()
\ No newline at end of file
--- /dev/null
+# -*- coding: utf-8 -*-
+
+from salome.shaper import model
+from salome.shaper import geom
+
+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(40, 45, 30)
+
+SketchPoint_1 = Sketch_1.addPoint(20, 70)
+SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchPoint_1.coordinates(), SketchCircle_1.results()[1])
+
+SketchLine_1 = Sketch_1.addLine(17, 7, 80, 70)
+
+GeomPoint = geom.Pnt2d(47, 75)
+Sketch_1.addTrim(SketchCircle_1, GeomPoint)
+
+model.do()
+model.end()
SketchLine_1 = Sketch_1.addLine(15.5, 14.5, 71.0, 62.8)
SketchConstraintVertical_1 = Sketch_1.setVertical(SketchLine_1.result())
model.do()
-model.end()
+model.end()
\ No newline at end of file
Fillet
======
+| The Fillet operation rounds the corner formed by intersection of two sketch elements in a coincident point.
+| The operation trims the elements at the intersection and creates a tangent arc between them.
-.. image:: images/Fillet.png
+To create Fillet in the active Sketch:
+
+#. select in the Main Menu *Sketch - > Fillet* item or
+#. click **Fillet** button in Sketch toolbar:
+
+.. image:: images/fillet.png
+ :align: center
+
+.. centered::
+ **Fillet** button
+
+Property panel:
+
+.. image:: images/Fillet_panel.png
:align: center
.. centered::
- Create a fillet
+ Fillet
+
+Input fields:
+
+- **Point** is the coincident point of two intersecting lines (or a line and an arc) selected in the view.
+
+After the point is selected Fillet preview appears in the view.
+
+**TUI Command**:
+
+- *Sketch_1.setFillet(Point)*
+
+ **Arguments**: coincident point
+
+- *Sketch_1.setFilletWithRadius(Point, Radius)*
+
+ **Arguments**: coincident point and fillet radius
+
+Result
+""""""
+
+Created Fillet appears in the view.
+
+.. image:: images/Fillet_res.png
+ :align: center
+
+.. centered::
+ Fillet created
+
+**See Also** a sample TUI Script of a :ref:`tui_create_fillet` operation.
\ No newline at end of file
Intersection
============
+| The Intersection operation creates intersection of a 3D edge and the sketch plane.
+| The result of intersection is a point.
-.. image:: images/Intersection.png
+To create Intersection in the active Sketch:
+
+#. select in the Main Menu *Sketch - > Intersection* item or
+#. click **Intersection** button in Sketch toolbar:
+
+.. image:: images/intersection.png
+ :align: center
+
+.. centered::
+ **Intersection** button
+
+Property panel:
+
+.. image:: images/Intersection_panel.png
:align: center
.. centered::
- Create an intersection
+ Intersection
+
+Input fields:
+
+- **Object** is the 3D edge to intersect with the sketch plane.
+- **Include into the sketch result** option defines whether to include the intersection point into the sketch result.
+
+**TUI Command**:
+
+- *Sketch_1.addIntersectionPoint(Edge, IncludeIntoResult)*
+
+ **Arguments**: Edge and include into the result flag
+
+- *Sketch_1.addIntersectionPoint(EdgeName, IncludeIntoResult)*
+
+ **Arguments**: Edge name and include into the result flag
+
+Result
+""""""
+
+Created Intersection appears in the view.
+
+.. image:: images/Intersection_res.png
+ :align: center
+
+.. centered::
+ Intersection created (purple point)
+
+**See Also** a sample TUI Script of a :ref:`tui_create_intersection` operation.
-Mirror
-======
+Mirror copy
+===========
+Mirror copy operation mirrors sketch entities across a line.
-.. image:: images/Mirror.png
+To create Mirror copy in the active Sketch:
+
+#. select in the Main Menu *Sketch - > Mirror copy* item or
+#. click **Mirror copy** button in Sketch toolbar:
+
+.. image:: images/mirror.png
+ :align: center
+
+.. centered::
+ **Mirror copy** button
+
+Property panel:
+
+.. image:: images/Mirror_panel.png
:align: center
.. centered::
- Create a mirror
+ Mirror copy
+
+Input fields:
+
+- **Mirror line** is the mirror line selected in the view.
+- **Segments** is the list of segments (lines, circles, arcs) selected in the view.
+
+**TUI Command**: *Sketch_1.addMirror(MirrorLine, Objects)*
+
+**Arguments**: Mirror line and a list of objects
+
+Result
+""""""
+
+Created Mirror copy appears in the view.
+
+| The original and a mirror copy objects are marked with the special sign.
+| Copy object is drawn with a thinner line.
+
+.. image:: images/Mirror_res.png
+ :align: center
+
+.. centered::
+ Mirror copy created
+
+**See Also** a sample TUI Script of a :ref:`tui_create_mirror` operation.
\ No newline at end of file
Projection
==========
+| The Projection operation creates projection of 3D edge or vertex onto the sketch plane.
+| The result of projection is a line.
-.. image:: images/Projection.png
+To create Projection in the active Sketch:
+
+#. select in the Main Menu *Sketch - > Projection* item or
+#. click **Projection** button in Sketch toolbar:
+
+.. image:: images/projection.png
+ :align: center
+
+.. centered::
+ **Projection** button
+
+Property panel:
+
+.. image:: images/Projection_panel.png
:align: center
.. centered::
- Create a projection
+ Projection
+
+Input fields:
+
+- **Object** is the 3D object (edge or vertex) to project onto the sketch plane.
+- **Include into the sketch result** option defines whether to include the projection line into the sketch result.
+
+**TUI Command**:
+
+- *Sketch_1.addProjection(EdgeOrVertex, IncludeIntoResult)*
+
+ **Arguments**: edge or vertex and include into the result flag
+
+- *Sketch_1.addProjection(EdgeOrVertexName, IncludeIntoResult)*
+
+ **Arguments**: edge or vertex name and include into the result flag
+
+Result
+""""""
+
+Created Projection appears in the view.
+
+.. image:: images/Projection_res.png
+ :align: center
+
+.. centered::
+ Projection created (purple line)
+
+**See Also** a sample TUI Script of a :ref:`tui_create_projection` operation.
\ No newline at end of file
Angular copy
============
+Angular copy operation creates one or multiple copies of the skecth entities by rotation relative to a specified center point.
-.. image:: images/AngularCopy.png
+To create Angular copy in the active Sketch:
+
+#. select in the Main Menu *Sketch - > Angular copy* item or
+#. click **Angular copy** button in Sketch toolbar:
+
+.. image:: images/rotate.png
+ :align: center
+
+.. centered::
+ **Angular copy** button
+
+Property panel:
+
+.. image:: images/Rotation_panel.png
:align: center
.. centered::
- Create an angular copy
+ Angular copy
+
+Input fields:
+
+- **Segments** is the list of segments (lines, circles, arcs) selected in the view.
+- **Center of rotation** is the center point selected in the view.
+- **Full angle/Single angle** option:
+
+ .. image:: images/angle_up_full_32x32.png
+ :align: left
+ **Full angle**: angle step of rotation is equal to the defined angle divided by the number of copies (total number minus one).
+
+ .. image:: images/angle_up_full_32x32.png
+ :align: left
+ **Single angle**: angle step of rotation is equal to the defined angle.
+
+- **Angle** is the angle of rotation.
+- **Reversed** defines rotation direction. If checked - in clockwise direction, otherwise - in a counterclockwise direction.
+- **Total number of objects** is the total number of objects including the original one.
+
+
+**TUI Command**: *Sketch_1.addRotation(Objects, CenterPoint, Angle, NumberOfObjects, FullValue, Reversed)*
+
+**Arguments**: list of objects + center point + angle + number of objects + full value flag + reversed flag
+
+Result
+""""""
+
+Created Angular copy appears in the view.
+
+| The original and an angular copy objects are marked with the special sign.
+| Copy objects are drawn with a thinner line.
+
+.. image:: images/Rotation_res.png
+ :align: center
+
+.. centered::
+ Angular copy created
+
+**See Also** a sample TUI Script of a :ref:`tui_create_rotation` operation.
Split
=====
+| The Split operation splits sketch curve into multiple segments.
+| The curve should have points lying on it.
+| Open curves (line or arc) require one or more points to split with; closed curves (circle) require two or more points.
-.. image:: images/Split.png
+To create Split in the active Sketch:
+
+#. select in the Main Menu *Sketch - > Split* item or
+#. click **Split** button in Sketch toolbar:
+
+.. image:: images/split.png
+ :align: center
+
+.. centered::
+ **Split** button
+
+Property panel:
+
+.. image:: images/Split_panel.png
:align: center
.. centered::
- Split a line
+ Split
+
+Input fields:
+
+- **Segment** is used to select a segment to be split off in the view.
+
+The selected segment is highlighted in the view:
+
+.. image:: images/Split_segment_sel.png
+ :align: center
+
+.. centered::
+ The segment to split off
+
+**TUI Command**: *Sketch_1.addSplit(Feature, PositionPoint)*
+
+**Arguments**: feature (line, arc or circle) and position point (a point on or closest to the segment to split off)
+
+Result
+""""""
+
+Created Split appears in the view.
+
+.. image:: images/Split_res.png
+ :align: center
+
+.. centered::
+ Split created
+
+**See Also** a sample TUI Script of a :ref:`tui_create_split` operation.
\ No newline at end of file
Linear copy
===========
+Linear copy operation creates one or multiple copies of the skecth entities along a vector defined by two points.
-.. image:: images/LinearCopy.png
+To create Linear copy in the active Sketch:
+
+#. select in the Main Menu *Sketch - > Linear copy* item or
+#. click **Linear copy** button in Sketch toolbar:
+
+.. image:: images/translate.png
+ :align: center
+
+.. centered::
+ **Linear copy** button
+
+Property panel:
+
+.. image:: images/Linear_panel.png
:align: center
.. centered::
- Create a linear copy
+ Linear copy
+
+Input fields:
+
+- **Segments** is the list of segments (lines, circles, arcs) selected in the view.
+- **Single value/Full value** option:
+
+ .. image:: images/translate_32x32.png
+ :align: left
+ **Single value**: step of translation is equal to the distance between the start and the end point.
+
+ .. image:: images/translate_full_32x32.png
+ :align: left
+ **Full value**: distance from the originals to the farthest copies is equal to the distance between the start and the end point.
+- **Start point** is the initial point of translation vector.
+- **End point** is the terminal point of translation vector.
+- **Total number of objects** is the total number of objects including the original one.
+
+
+**TUI Command**: *Sketch_1.addTranslation(Objects, Point1, Point2, NumberOfObjects, FullValue)*
+
+**Arguments**: list of objects + start and end points + number of objects + full value flag
+
+Result
+""""""
+
+Created Linear copy appears in the view.
+
+| The original and a linear copy objects are marked with the special sign.
+| Copy objects are drawn with a thinner line.
+
+.. image:: images/Linear_res.png
+ :align: center
+
+.. centered::
+ Linear copy created
+
+**See Also** a sample TUI Script of a :ref:`tui_create_translation` operation.
Trim
====
+| The Trim operation trims away the specified segment of the curve.
+| The curve should have points lying on it or intersections with other curves.
+| Open curves (line or arc) require one or more points; closed curves (circle) require two or more points.
-.. image:: images/Trim.png
+To create Trim in the active Sketch:
+
+#. select in the Main Menu *Sketch - > Trim* item or
+#. click **Trim** button in Sketch toolbar:
+
+.. image:: images/trim.png
+ :align: center
+
+.. centered::
+ **Trim** button
+
+Property panel:
+
+.. image:: images/Trim_panel.png
:align: center
.. centered::
- Trim a line
+ Trim
+
+Input fields:
+
+- **Segment** is used to select a segment to remove in the view.
+
+The selected segment is highlighted in the view:
+
+.. image:: images/Trim_segment_sel.png
+ :align: center
+
+.. centered::
+ The segment to remove
+
+**TUI Command**: *Sketch_1.addTrim(Feature, PositionPoint)*
+
+**Arguments**: feature (line, arc or circle) and position point (a point on or closest to the segment to remove)
+
+Result
+""""""
+
+Created Trim appears in the view.
+
+.. image:: images/Trim_res.png
+ :align: center
+
+.. centered::
+ Trim created
+
+**See Also** a sample TUI Script of a :ref:`tui_create_trim` operation.