From: gzy Date: Fri, 21 Sep 2018 08:42:31 +0000 (+0300) Subject: linear copy, angular copy, fillet, sub-shapes help X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=19ef8d32495094e78d348a210622ea749597ad15;p=modules%2Fshaper.git linear copy, angular copy, fillet, sub-shapes help --- diff --git a/src/BuildPlugin/doc/TUI_subshapeFeature.rst b/src/BuildPlugin/doc/TUI_subshapeFeature.rst new file mode 100644 index 000000000..10d0f8f80 --- /dev/null +++ b/src/BuildPlugin/doc/TUI_subshapeFeature.rst @@ -0,0 +1,12 @@ + + .. _tui_create_subshape: + +Create Sub-shapes +================= + +.. literalinclude:: examples/subshapes.py + :linenos: + :language: python + +:download:`Download this script ` + diff --git a/src/BuildPlugin/doc/examples/subshapes.py b/src/BuildPlugin/doc/examples/subshapes.py new file mode 100644 index 000000000..4f0519ff7 --- /dev/null +++ b/src/BuildPlugin/doc/examples/subshapes.py @@ -0,0 +1,29 @@ +# -*- 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(-56.65008576329333, 13.33962264150944, 9.528301886792452, 66.69811320754719) +SketchLine_1.result().setColor(225, 0, 0) +SketchLine_2 = Sketch_1.addLine(9.528301886792452, 66.69811320754719, 78.47855917667239, -27.54545454545455) +SketchLine_2.result().setColor(225, 0, 0) +SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchLine_2.startPoint()) +SketchLine_3 = Sketch_1.addLine(78.47855917667239, -27.54545454545455, 7.795883361921087, -89.2195540308748) +SketchLine_3.result().setColor(225, 0, 0) +SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchLine_2.endPoint(), SketchLine_3.startPoint()) +SketchLine_4 = Sketch_1.addLine(7.795883361921087, -89.2195540308748, 12.64665523156088, -20.9622641509434) +SketchLine_4.result().setColor(225, 0, 0) +SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchLine_3.endPoint(), SketchLine_4.startPoint()) +SketchLine_5 = Sketch_1.addLine(12.64665523156088, -20.9622641509434, -56.65008576329333, 13.33962264150944) +SketchLine_5.result().setColor(225, 0, 0) +SketchConstraintCoincidence_4 = Sketch_1.setCoincident(SketchLine_4.endPoint(), SketchLine_5.startPoint()) +SketchConstraintCoincidence_5 = Sketch_1.setCoincident(SketchLine_5.endPoint(), SketchLine_1.startPoint()) +model.do() +Face_1 = model.addFace(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_1r-SketchLine_2r-SketchLine_3r-SketchLine_4r-SketchLine_5r")]) +SubShapes_1 = model.addSubShapes(Part_1_doc, model.selection("FACE", "Face_1_1"), [model.selection("EDGE", "Sketch_1/Edge-SketchLine_5"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_4")]) +model.do() +model.end() diff --git a/src/BuildPlugin/doc/images/feature_subshapes.png b/src/BuildPlugin/doc/images/feature_subshapes.png new file mode 100644 index 000000000..d0e088891 Binary files /dev/null and b/src/BuildPlugin/doc/images/feature_subshapes.png differ diff --git a/src/BuildPlugin/doc/polylineFeature.rst b/src/BuildPlugin/doc/polylineFeature.rst index f6f19416d..566e1f4ac 100644 --- a/src/BuildPlugin/doc/polylineFeature.rst +++ b/src/BuildPlugin/doc/polylineFeature.rst @@ -21,12 +21,12 @@ The following property panel appears. :align: center .. centered:: - Create a polyline + Polyline property panel Input fields: - **Points and vertices** panel contains list of points and vertices selected in 3D OCC viewer. Polyline consequently connects points; -- **Closed** check-box turns on/off connection of the start and end points to make polyline closed. +- **Closed** check-box turns on/off connection of the start and end points to make polyline closed/opened. **TUI Commands**: *model.addPolyline3D(Part_1_doc, Polyline_objects, Key)* diff --git a/src/BuildPlugin/doc/subShapesFeature.rst b/src/BuildPlugin/doc/subShapesFeature.rst index 174361718..975061453 100644 --- a/src/BuildPlugin/doc/subShapesFeature.rst +++ b/src/BuildPlugin/doc/subShapesFeature.rst @@ -2,9 +2,48 @@ Sub-shapes ========== +The feature **Sub-shapes** creates sub-shapes of selected entity. + +To create Sub-shapes in the active part: + +#. select in the Main Menu *Build - > Sub-shapes* item or +#. click **Sub-shapes** button in the toolbar + +.. image:: images/feature_subshapes.png + :align: center + +.. centered:: + **Sub-shapes** button + +The following property panel appears. .. image:: images/SubShapes.png :align: center .. centered:: - Create sub-shapes + Sub-shapes property panel + +Input fields: + +- **Shape** panel contains shape to be modified. Shape is selected in 3D OCC viewer or object browser; +- **Sub-shapes** panel contains list of sub-shapes of given shape to be included into result. Sub-shapes are selected in 3D OCC viewer. + +**TUI Command**: *model.addSubShapes(Part_doc, shape, sub-shapes)* + +**Arguments**: 1 part + shape in format *model.selection(TYPE, shape)* + list of sub-shapes in format *model.selection(TYPE, subshape)*. + +Result +"""""" +Result of operation is shown below. + +.. image:: images/SubShapes.png + :align: center + +.. centered:: + Sub-shapes + +**See Also** a sample TUI Script of a :ref:`tui_create_subshape` operation. + + + + diff --git a/src/FeaturesPlugin/doc/TUI_angularcopyFeature.rst b/src/FeaturesPlugin/doc/TUI_angularcopyFeature.rst new file mode 100644 index 000000000..11df5f0f8 --- /dev/null +++ b/src/FeaturesPlugin/doc/TUI_angularcopyFeature.rst @@ -0,0 +1,12 @@ + + .. _tui_create_angularcopy: + +Create Angular copy +=================== + +.. literalinclude:: examples/angularcopy.py + :linenos: + :language: python + +:download:`Download this script ` + diff --git a/src/FeaturesPlugin/doc/TUI_filletfixedFeature.rst b/src/FeaturesPlugin/doc/TUI_filletfixedFeature.rst new file mode 100644 index 000000000..e573efec2 --- /dev/null +++ b/src/FeaturesPlugin/doc/TUI_filletfixedFeature.rst @@ -0,0 +1,12 @@ + + .. _tui_create_fillet1: + +Create Fillet by fixed radius +============================= + +.. literalinclude:: examples/fillet1.py + :linenos: + :language: python + +:download:`Download this script ` + diff --git a/src/FeaturesPlugin/doc/TUI_filletvariableFeature.rst b/src/FeaturesPlugin/doc/TUI_filletvariableFeature.rst new file mode 100644 index 000000000..ddcee3c82 --- /dev/null +++ b/src/FeaturesPlugin/doc/TUI_filletvariableFeature.rst @@ -0,0 +1,12 @@ + + .. _tui_create_fillet2: + +Create Fillet by variable radius +================================ + +.. literalinclude:: examples/fillet2.py + :linenos: + :language: python + +:download:`Download this script ` + diff --git a/src/FeaturesPlugin/doc/TUI_linearcopyFeature.rst b/src/FeaturesPlugin/doc/TUI_linearcopyFeature.rst new file mode 100644 index 000000000..8b52750e5 --- /dev/null +++ b/src/FeaturesPlugin/doc/TUI_linearcopyFeature.rst @@ -0,0 +1,11 @@ + + .. _tui_create_linearcopy: + +Create Linear copy +================== + +.. literalinclude:: examples/linearcopy.py + :linenos: + :language: python + +:download:`Download this script ` diff --git a/src/FeaturesPlugin/doc/angularCopyFeature.rst b/src/FeaturesPlugin/doc/angularCopyFeature.rst index 3d3fec12c..3c5c989b8 100644 --- a/src/FeaturesPlugin/doc/angularCopyFeature.rst +++ b/src/FeaturesPlugin/doc/angularCopyFeature.rst @@ -2,9 +2,46 @@ Angular copy ============ +The feature **Angular copy** makes a compound of several rotated shapes basing on the initial shape. + +To create Angular copy in the active part: + +#. select in the Main Menu *Part - > Angular copy* item or +#. click **Angular copy** button in the toolbar + +.. image:: images/multirotation.png + :align: center + +.. centered:: + **Angular copy** button + +The following property panel appears. .. image:: images/AngularCopy.png :align: center .. centered:: - Angular copy definition + Angular copy property panel + +Input fields: + +- **Main objects** panel contains shapes to be rotated. Shapes are selected in 3D OCC viewer or object browser; +- **Vector of rotation** defines the axis of rotation. Vector is edge, axis selected in 3D OCC viewer or object browser; +- **Angular Step** check-box turns on/off definition of the angle by which the object is rotated. By default (if the checkbox is not checked), **Angular Step** = 2 * PI / NbTimes; +- **Nb. Copies** defines the number of rotated shape copies in the resulting compound. If **Nb. Copies** = 1, the result contains only the initial shape. + +**TUI Command**: *model.addMultiRotation(Part_doc, [shape], axis, step, Nb)* + +**Arguments**: 1 part + list of shapes in format *model.selection(TYPE, shape)* + axis in format *model.selection(TYPE, shape)*+ real (step value) + integer (Nb. Copies). + +Result +"""""" +Result of cylinder rotation is compound. + +.. image:: images/angularcopy.png + :align: center + +.. centered:: + Angular copy + +**See Also** a sample TUI Script of a :ref:`tui_create_angularcopy` operation. diff --git a/src/FeaturesPlugin/doc/examples/angularcopy.py b/src/FeaturesPlugin/doc/examples/angularcopy.py new file mode 100644 index 000000000..02483c19a --- /dev/null +++ b/src/FeaturesPlugin/doc/examples/angularcopy.py @@ -0,0 +1,12 @@ +# -*- coding: utf-8 -*- + +from salome.shaper import model + +model.begin() +partSet = model.moduleDocument() +Part_1 = model.addPart(partSet) +Part_1_doc = Part_1.document() +Cylinder_1 = model.addCylinder(Part_1_doc, model.selection("VERTEX", "PartSet/Origin"), model.selection("EDGE", "PartSet/OZ"), 5, 10) +AngularCopy_1 = model.addMultiRotation(Part_1_doc, [model.selection("SOLID", "Cylinder_1_1")], model.selection("EDGE", "PartSet/OY"), 90, 3) +model.do() +model.end() diff --git a/src/FeaturesPlugin/doc/examples/fillet1.py b/src/FeaturesPlugin/doc/examples/fillet1.py new file mode 100644 index 000000000..67299d876 --- /dev/null +++ b/src/FeaturesPlugin/doc/examples/fillet1.py @@ -0,0 +1,12 @@ +# -*- coding: utf-8 -*- + +from salome.shaper import model + +model.begin() +partSet = model.moduleDocument() +Part_1 = model.addPart(partSet) +Part_1_doc = Part_1.document() +Box_1 = model.addBox(Part_1_doc, 10, 10, 10) +Fillet_1 = model.addFillet(Part_1_doc, [model.selection("FACE", "Box_1_1/Front"), model.selection("EDGE", "Box_1_1/Left&Box_1_1/Top")], 2) +model.do() +model.end() diff --git a/src/FeaturesPlugin/doc/examples/fillet2.py b/src/FeaturesPlugin/doc/examples/fillet2.py new file mode 100644 index 000000000..a72a7ec78 --- /dev/null +++ b/src/FeaturesPlugin/doc/examples/fillet2.py @@ -0,0 +1,12 @@ +# -*- coding: utf-8 -*- + +from salome.shaper import model + +model.begin() +partSet = model.moduleDocument() +Part_1 = model.addPart(partSet) +Part_1_doc = Part_1.document() +Box_1 = model.addBox(Part_1_doc, 10, 10, 10) +Fillet_1 = model.addFillet(Part_1_doc, [model.selection("EDGE", "Box_1_1/Left&Box_1_1/Top")], 1, 3) +model.do() +model.end() diff --git a/src/FeaturesPlugin/doc/examples/linearcopy.py b/src/FeaturesPlugin/doc/examples/linearcopy.py new file mode 100644 index 000000000..5126b8892 --- /dev/null +++ b/src/FeaturesPlugin/doc/examples/linearcopy.py @@ -0,0 +1,12 @@ +# -*- coding: utf-8 -*- + +from salome.shaper import model + +model.begin() +partSet = model.moduleDocument() +Part_1 = model.addPart(partSet) +Part_1_doc = Part_1.document() +Sphere_1 = model.addSphere(Part_1_doc, model.selection("VERTEX", "PartSet/Origin"), 10) +LinearCopy_1 = model.addMultiTranslation(Part_1_doc, [model.selection("SOLID", "Sphere_1_1")], model.selection("EDGE", "PartSet/OX"), 30, 3, model.selection("EDGE", "PartSet/OY"), 30, 2) +model.do() +model.end() diff --git a/src/FeaturesPlugin/doc/filletFeature.rst b/src/FeaturesPlugin/doc/filletFeature.rst index 08343f728..8e9c329c5 100644 --- a/src/FeaturesPlugin/doc/filletFeature.rst +++ b/src/FeaturesPlugin/doc/filletFeature.rst @@ -2,16 +2,92 @@ Fillet ====== +The feature **Fillet** creates fillets on the edges of a shape. -.. image:: images/Fillet.png +To create Fillet in the active part: + +#. select in the Main Menu *Feature - > Fillet* item or +#. click **Fillet** button in the toolbar + +.. image:: images/fillet.png + :align: center + +.. centered:: + **Fillet** button + +There are 2 types of fillet: + + .. image:: images/fillet_fixed_radius.png + :align: left + fillet by fixed radius + + .. image:: images/fillet_var_radius.png + :align: left + fillet by variable radius + +Fillet by fixed radius +---------------------- + +The property panel is shown below. + +.. image:: images/FilletFixed.png :align: center .. centered:: - Fillet by fixed radius + Fillet by fixed radius property panel + +Input fields: + +- **Faces or/and edges** panel contains faces and edges on which fillet is done. All edges of face are subjected to fillet operation. Faces and edges are selected in 3D OCC viewer; +- **Radius** defines fillet radius. + +**TUI Command**: *model.addFillet(Part_doc, [face,edge], radius)* + +**Arguments**: 1 part + list of faces and edges subjected to fillet operation in format *model.selection(TYPE, shape)* + real (radius value). + +Result +"""""" + +Result of **Fillet by fixed radius** is shown below. +.. image:: images/fillet_fix_rad.png + :align: center -.. image:: images/Fillet2.png +.. centered:: + Fillet by fixed radius + +**See Also** a sample TUI Script of a :ref:`tui_create_fillet1` operation. + +Fillet by variable radius +------------------------- + +Alternatively, there is a possibility to create a fillet with a variable radius. + +.. image:: images/FilletVarious.png :align: center .. centered:: - Fillet by varyable radius + Fillet by variable radius + +Input fields: + +- **Faces or/and edges** panel contains faces and edges on which fillet is done. All edges of face are subjected to fillet operation. Faces and edges are selected in 3D OCC viewer; +- **Start radius** defines the fillet radius at the start of the selected edge(s); +- **End radius** defines the fillet radius at the end of the selected edge(s). + +**TUI Command**: *model.addFillet(Part_doc, [face,edge], R1, R2)* + +**Arguments**: 1 part + list of faces and edges subjected to fillet operation in format *model.selection(TYPE, shape)* + 2 reals (start and end radius values). + +Result +"""""" + +Result of **Fillet by variable radius** is shown below. + +.. image:: images/fillet_var_rad.png + :align: center + +.. centered:: + Fillet by variable radius + +**See Also** a sample TUI Script of a :ref:`tui_create_fillet2` operation. diff --git a/src/FeaturesPlugin/doc/images/Fillet.png b/src/FeaturesPlugin/doc/images/Fillet.png index 7f804075f..3b5a98289 100644 Binary files a/src/FeaturesPlugin/doc/images/Fillet.png and b/src/FeaturesPlugin/doc/images/Fillet.png differ diff --git a/src/FeaturesPlugin/doc/images/Fillet2.png b/src/FeaturesPlugin/doc/images/Fillet2.png deleted file mode 100644 index bc9708ec9..000000000 Binary files a/src/FeaturesPlugin/doc/images/Fillet2.png and /dev/null differ diff --git a/src/FeaturesPlugin/doc/images/FilletFixed.png b/src/FeaturesPlugin/doc/images/FilletFixed.png new file mode 100644 index 000000000..7f804075f Binary files /dev/null and b/src/FeaturesPlugin/doc/images/FilletFixed.png differ diff --git a/src/FeaturesPlugin/doc/images/FilletVarious.png b/src/FeaturesPlugin/doc/images/FilletVarious.png new file mode 100644 index 000000000..bc9708ec9 Binary files /dev/null and b/src/FeaturesPlugin/doc/images/FilletVarious.png differ diff --git a/src/FeaturesPlugin/doc/images/fillet.png b/src/FeaturesPlugin/doc/images/fillet.png new file mode 100644 index 000000000..3b5a98289 Binary files /dev/null and b/src/FeaturesPlugin/doc/images/fillet.png differ diff --git a/src/FeaturesPlugin/doc/images/fillet_fixed_radius.png b/src/FeaturesPlugin/doc/images/fillet_fixed_radius.png new file mode 100644 index 000000000..0897bdeb8 Binary files /dev/null and b/src/FeaturesPlugin/doc/images/fillet_fixed_radius.png differ diff --git a/src/FeaturesPlugin/doc/images/fillet_var_radius.png b/src/FeaturesPlugin/doc/images/fillet_var_radius.png new file mode 100644 index 000000000..56e4a78f3 Binary files /dev/null and b/src/FeaturesPlugin/doc/images/fillet_var_radius.png differ diff --git a/src/FeaturesPlugin/doc/images/multirotation.png b/src/FeaturesPlugin/doc/images/multirotation.png new file mode 100644 index 000000000..fb82a1e7c Binary files /dev/null and b/src/FeaturesPlugin/doc/images/multirotation.png differ diff --git a/src/FeaturesPlugin/doc/images/multitranslation.png b/src/FeaturesPlugin/doc/images/multitranslation.png new file mode 100644 index 000000000..d0d9c157b Binary files /dev/null and b/src/FeaturesPlugin/doc/images/multitranslation.png differ diff --git a/src/FeaturesPlugin/doc/linearCopyFeature.rst b/src/FeaturesPlugin/doc/linearCopyFeature.rst index 38509c3b9..8f7e92dd8 100644 --- a/src/FeaturesPlugin/doc/linearCopyFeature.rst +++ b/src/FeaturesPlugin/doc/linearCopyFeature.rst @@ -2,9 +2,54 @@ Linear copy =========== +The feature **Linear copy** makes several translations of a selected shape in one or two directions. + +To create Linear copy in the active part: + +#. select in the Main Menu *Part - > Linear copy* item or +#. click **Linear copy** button in the toolbar + +.. image:: images/multitranslation.png + :align: center + +.. centered:: + **Linear copy** button + +The following property panel appears. .. image:: images/LinearCopy.png :align: center .. centered:: - Linear copy + Linear copy property panel + +Input fields: + +- **Main objects** panel contains shapes to be translated. Shapes are selected in 3D OCC viewer or object browser; +- **First direction** defines translation in the first direction: + + - **Vector of translation** defines vector along which the object will be translated. Vector is edge, axis selected in 3D OCC viewer or object browser; + - **Step** defines the distance between the shape copies; + - **Nb. Copies** is the number of shape copies; + +- **Second direction** check-box turns on/off translation in the second direction: + + - **Vector of translation** defines vector along which the object will be translated. Vector is edge, axis selected in 3D OCC viewer or object browser; + - **Step** defines the distance between the shape copies; + - **Nb. Copies** defines the number of shape copies. + +**TUI Command**: *model.addMultiTranslation(Part_doc, [shape], axis1, step1, Nb1, axis2, step2, Nb2)* + +**Arguments**: 1 part + list of shapes in format *model.selection(TYPE, shape)* + 2 axis in format *model.selection(TYPE, shape)*+ 2 real (step values) + 2 integers (Nb. Copies). + +Result +"""""" +Result of operation is compound. + +.. image:: images/linearcopy.png + :align: center + +.. centered:: + Sub-shapes + +**See Also** a sample TUI Script of a :ref:`tui_create_linearcopy` operation. \ No newline at end of file