From: jfa Date: Thu, 7 Nov 2019 11:30:46 +0000 (+0300) Subject: Tasks #3016 and #3015: 'through all' mode. Added documentation and translations. X-Git-Tag: V9_5_0a1~167^2~8 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=97ee59c98a21579b826eb095d89b861fb799b2a1;p=modules%2Fshaper.git Tasks #3016 and #3015: 'through all' mode. Added documentation and translations. --- diff --git a/src/FeaturesPlugin/FeaturesPlugin_msg_fr.ts b/src/FeaturesPlugin/FeaturesPlugin_msg_fr.ts index 3bbe138ed..95b2e83e2 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_msg_fr.ts +++ b/src/FeaturesPlugin/FeaturesPlugin_msg_fr.ts @@ -415,6 +415,10 @@ By sizes Par tailles + + Through all + À travers tous + ExtrusionCut:base @@ -601,6 +605,10 @@ By sizes Par tailles + + Through all + À travers tous + ExtrusionFuse:base @@ -1369,6 +1377,10 @@ By bounding planes and angles En délimitant des plans et des angles + + Through all + À travers tous + RevolutionCut:axis_object @@ -1529,6 +1541,10 @@ By bounding planes and angles En délimitant des plans et des angles + + Through all + À travers tous + RevolutionFuse:axis_object @@ -5710,6 +5726,10 @@ Select an edge for axis Sélectionnez une arête pour l'axe + + Attribute "%1" is not initialized. + L'axe de translation n'est pas sélectionné. + Translation:distance diff --git a/src/FeaturesPlugin/doc/TUI_extrusionCutThroughAll.rst b/src/FeaturesPlugin/doc/TUI_extrusionCutThroughAll.rst new file mode 100644 index 000000000..c5ff730ba --- /dev/null +++ b/src/FeaturesPlugin/doc/TUI_extrusionCutThroughAll.rst @@ -0,0 +1,12 @@ + + .. _tui_create_extrusion_cut_through_all: + +Create Extrusion Cut through all objects +======================================== + +.. literalinclude:: examples/extrusion_cut_through_all.py + :linenos: + :language: python + +:download:`Download this script ` + diff --git a/src/FeaturesPlugin/doc/TUI_extrusionFuseThroughAll.rst b/src/FeaturesPlugin/doc/TUI_extrusionFuseThroughAll.rst new file mode 100644 index 000000000..a65ce34ff --- /dev/null +++ b/src/FeaturesPlugin/doc/TUI_extrusionFuseThroughAll.rst @@ -0,0 +1,12 @@ + + .. _tui_create_extrusion_fuse_through_all: + +Create Extrusion Fuse through all objects +======================================== + +.. literalinclude:: examples/extrusion_fuse_through_all.py + :linenos: + :language: python + +:download:`Download this script ` + diff --git a/src/FeaturesPlugin/doc/examples/extrusion_cut_through_all.py b/src/FeaturesPlugin/doc/examples/extrusion_cut_through_all.py new file mode 100644 index 000000000..d9f380b79 --- /dev/null +++ b/src/FeaturesPlugin/doc/examples/extrusion_cut_through_all.py @@ -0,0 +1,17 @@ +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) +ExtrusionCut_1 = model.addExtrusionCut(Part_1_doc, + [], + model.selection(), + [model.selection("SOLID", "Box_1_1")]) +Sketch_1 = model.addSketch(Part_1_doc, + model.selection("FACE", "Box_1_1/Top")) +SketchCircle_1 = Sketch_1.addCircle(5, 0, 2) +ExtrusionCut_1.setNestedSketch(Sketch_1) +model.do() +model.end() diff --git a/src/FeaturesPlugin/doc/examples/extrusion_fuse_through_all.py b/src/FeaturesPlugin/doc/examples/extrusion_fuse_through_all.py new file mode 100644 index 000000000..f64d43354 --- /dev/null +++ b/src/FeaturesPlugin/doc/examples/extrusion_fuse_through_all.py @@ -0,0 +1,36 @@ +from salome.shaper import model + +model.begin() +partSet = model.moduleDocument() +Part_1 = model.addPart(partSet) +Part_1_doc = Part_1.document() + +# Objects to be cut +Box_1 = model.addBox(Part_1_doc, 10, 10, 10) +Box_2 = model.addBox(Part_1_doc, 10, 10, 10) +Box_3 = model.addBox(Part_1_doc, 20, 20, 20) +Translation_1 = model.addTranslation(Part_1_doc, [model.selection("SOLID", "Box_2_1")], 20, 10, 0) +Translation_2 = model.addTranslation(Part_1_doc, [model.selection("SOLID", "Box_3_1")], 40, 20, 0) +ExtrusionFuse_1_objects_2 = [model.selection("SOLID", "Box_1_1"), + model.selection("SOLID", "Translation_1_1"), + model.selection("SOLID", "Translation_2_1")] + +# Extrusion direction +Point_1 = model.addPoint(Part_1_doc, 0, 0, 0) +Point_2 = model.addPoint(Part_1_doc, 60, 40, 20) +Edge_1 = model.addEdge(Part_1_doc, model.selection("VERTEX", "Point_1"), model.selection("VERTEX", "Point_2")) + +# Base object for extrusion +Sketch_1 = model.addSketch(Part_1_doc, model.selection("FACE", "Box_1_1/Back")) +SketchCircle_1 = Sketch_1.addCircle(2.13, -2.43, 1.6) +model.do() +Face_1 = model.addFace(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchCircle_1_2r")]) + +# Extrusion fuse through all +ExtrusionFuse_1 = model.addExtrusionFuse(Part_1_doc, + [model.selection("FACE", "Face_1_1")], + model.selection("EDGE", "Edge_1_1"), + ExtrusionFuse_1_objects_2) + +model.do() +model.end() diff --git a/src/FeaturesPlugin/doc/extrusionCutFeature.rst b/src/FeaturesPlugin/doc/extrusionCutFeature.rst index ca3499c2c..fb6a4dee4 100644 --- a/src/FeaturesPlugin/doc/extrusionCutFeature.rst +++ b/src/FeaturesPlugin/doc/extrusionCutFeature.rst @@ -18,7 +18,7 @@ The following property panel will be opened: .. centered:: Start sketch -There are two variants of the property panel for Extrusion Cut depending on the chosen option: +There are three variants of the property panel for Extrusion Cut depending on the chosen option: .. image:: images/extrusion_by_sizes.png :align: left @@ -28,6 +28,10 @@ There are two variants of the property panel for Extrusion Cut depending on the :align: left **By Bounding Planes** extrudes objects by specifying bounding planes and offsets. +.. image:: images/extrusion_through_all.png + :align: left +**Through All** extrudes base objects through all objects to be cut. + By sizes -------- @@ -42,7 +46,7 @@ By sizes - **Axis** - if selected, it will be the direction of extrusion, otherwise objects normals will be used. - **To size** - size for extrusion in the direction. - **From size** - size for extrusion in the opposite direction. -- **Cut from** - contains a list of objects which will be cut from the result of extrusion. +- **Cut from** - contains a list of objects to be cut by the result of extrusion. **TUI Commands**: @@ -110,7 +114,7 @@ By bounding planes - **To offset** - offset for extrusion or for a bounding plane, if selected. - **From plane** - a planar face can be selected to bound extrusion from the other side. - **From offset** - offset for extrusion or for a bounding plane, if selected. -- **Cut from** - contains a list of objects which will be cut from the result of extrusion. +- **Cut from** - contains a list of objects which will be cut by the result of extrusion. **TUI Commands**: @@ -149,3 +153,46 @@ The Result of the operation will be an extruded shape: **Created Extrusion Cut** **See Also** a sample TUI Script of :ref:`tui_create_extrusion_cut_by_bounding_planes` operation. + +Through all +----------- + +.. image:: images/ExtrusionCut3.png + :align: center + +.. centered:: + Extrusion Cut: definition through all objects + +- **Base objects** - contains a list of objects selected in the Object Browser or in the Viewer, which will be extruded. +- **Axis** - if selected, it will be the direction of extrusion, otherwise objects normals will be used. +- **Cut from** - contains a list of objects to be cut by the result of extrusion. + +**TUI Commands**: + +.. py:function:: model.addExtrusionCut(part, objectsToExtrude, objectsToCut) + + :param part: The current part object. + :param list: A list of objects for extrusion. + :param list: A list of objects to cut from. + :return: Created object. + +.. py:function:: model.addExtrusionCut(part, objects, direction, objectsToCut) + + :param part: The current part object. + :param list: A list of objects for extrusion. + :param object: A direction of extrusion + :param list: A list of objects to cut from. + :return: Created object. + +Result +"""""" + +The Result of the operation will be an extruded shape: + +.. image:: images/extrusion_cut_through_all_result.png + :align: center + +.. centered:: + **Created Extrusion Cut** + +**See Also** a sample TUI Script of :ref:`tui_create_extrusion_cut_through_all` operation. diff --git a/src/FeaturesPlugin/doc/images/ExtrusionCut1.png b/src/FeaturesPlugin/doc/images/ExtrusionCut1.png index bb5d5f054..0370f02e7 100644 Binary files a/src/FeaturesPlugin/doc/images/ExtrusionCut1.png and b/src/FeaturesPlugin/doc/images/ExtrusionCut1.png differ diff --git a/src/FeaturesPlugin/doc/images/ExtrusionCut2.png b/src/FeaturesPlugin/doc/images/ExtrusionCut2.png index 348f12c0f..cb725f550 100644 Binary files a/src/FeaturesPlugin/doc/images/ExtrusionCut2.png and b/src/FeaturesPlugin/doc/images/ExtrusionCut2.png differ diff --git a/src/FeaturesPlugin/doc/images/ExtrusionCut3.png b/src/FeaturesPlugin/doc/images/ExtrusionCut3.png new file mode 100644 index 000000000..8f1388dfa Binary files /dev/null and b/src/FeaturesPlugin/doc/images/ExtrusionCut3.png differ diff --git a/src/FeaturesPlugin/doc/images/ExtrusionFuse1.png b/src/FeaturesPlugin/doc/images/ExtrusionFuse1.png index 33c2445f8..8cb3cd965 100644 Binary files a/src/FeaturesPlugin/doc/images/ExtrusionFuse1.png and b/src/FeaturesPlugin/doc/images/ExtrusionFuse1.png differ diff --git a/src/FeaturesPlugin/doc/images/ExtrusionFuse2.png b/src/FeaturesPlugin/doc/images/ExtrusionFuse2.png index f38e71c16..62e4559ae 100644 Binary files a/src/FeaturesPlugin/doc/images/ExtrusionFuse2.png and b/src/FeaturesPlugin/doc/images/ExtrusionFuse2.png differ diff --git a/src/FeaturesPlugin/doc/images/ExtrusionFuse3.png b/src/FeaturesPlugin/doc/images/ExtrusionFuse3.png new file mode 100644 index 000000000..a3fdd9929 Binary files /dev/null and b/src/FeaturesPlugin/doc/images/ExtrusionFuse3.png differ diff --git a/src/FeaturesPlugin/doc/images/RevolutionCut1.png b/src/FeaturesPlugin/doc/images/RevolutionCut1.png index 8c7a2885a..e97241e77 100644 Binary files a/src/FeaturesPlugin/doc/images/RevolutionCut1.png and b/src/FeaturesPlugin/doc/images/RevolutionCut1.png differ diff --git a/src/FeaturesPlugin/doc/images/RevolutionCut2.png b/src/FeaturesPlugin/doc/images/RevolutionCut2.png index 5cdf5d832..fd8889bfa 100644 Binary files a/src/FeaturesPlugin/doc/images/RevolutionCut2.png and b/src/FeaturesPlugin/doc/images/RevolutionCut2.png differ diff --git a/src/FeaturesPlugin/doc/images/RevolutionCut3.png b/src/FeaturesPlugin/doc/images/RevolutionCut3.png new file mode 100644 index 000000000..d2de5bb15 Binary files /dev/null and b/src/FeaturesPlugin/doc/images/RevolutionCut3.png differ diff --git a/src/FeaturesPlugin/doc/images/RevolutionFuse1.png b/src/FeaturesPlugin/doc/images/RevolutionFuse1.png index 600d78e68..bd074071e 100644 Binary files a/src/FeaturesPlugin/doc/images/RevolutionFuse1.png and b/src/FeaturesPlugin/doc/images/RevolutionFuse1.png differ diff --git a/src/FeaturesPlugin/doc/images/RevolutionFuse2.png b/src/FeaturesPlugin/doc/images/RevolutionFuse2.png index 87fc70918..1316c378d 100644 Binary files a/src/FeaturesPlugin/doc/images/RevolutionFuse2.png and b/src/FeaturesPlugin/doc/images/RevolutionFuse2.png differ diff --git a/src/FeaturesPlugin/doc/images/RevolutionFuse3.png b/src/FeaturesPlugin/doc/images/RevolutionFuse3.png new file mode 100644 index 000000000..eef253ade Binary files /dev/null and b/src/FeaturesPlugin/doc/images/RevolutionFuse3.png differ diff --git a/src/FeaturesPlugin/doc/images/extrusion_cut_through_all_result.png b/src/FeaturesPlugin/doc/images/extrusion_cut_through_all_result.png new file mode 100644 index 000000000..99c1b8d37 Binary files /dev/null and b/src/FeaturesPlugin/doc/images/extrusion_cut_through_all_result.png differ diff --git a/src/FeaturesPlugin/doc/images/extrusion_through_all.png b/src/FeaturesPlugin/doc/images/extrusion_through_all.png new file mode 100644 index 000000000..6ecb15201 Binary files /dev/null and b/src/FeaturesPlugin/doc/images/extrusion_through_all.png differ diff --git a/src/FeaturesPlugin/doc/images/revolution_fuse_through_all_result.png b/src/FeaturesPlugin/doc/images/revolution_fuse_through_all_result.png new file mode 100644 index 000000000..f1f549da7 Binary files /dev/null and b/src/FeaturesPlugin/doc/images/revolution_fuse_through_all_result.png differ diff --git a/src/FeaturesPlugin/doc/images/revolution_through_all.png b/src/FeaturesPlugin/doc/images/revolution_through_all.png index 2c1a4b2b7..3c75206c5 100644 Binary files a/src/FeaturesPlugin/doc/images/revolution_through_all.png and b/src/FeaturesPlugin/doc/images/revolution_through_all.png differ