From: vsv Date: Fri, 5 Oct 2018 15:34:13 +0000 (+0300) Subject: Fix help errors X-Git-Tag: CEA_2018-2 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=9d26d1fbc0d62125a3970a742ddb92464889b707;p=modules%2Fshaper.git Fix help errors --- diff --git a/doc/gui/CMakeLists.txt b/doc/gui/CMakeLists.txt index 27f10eb91..2a40cf712 100644 --- a/doc/gui/CMakeLists.txt +++ b/doc/gui/CMakeLists.txt @@ -26,6 +26,7 @@ SET(DOC_FILES Introduction.rst Tutorial.rst TUI_tutorial.rst + tutorial.py ) CONFIGURE_FILE(${input} ${output}) diff --git a/doc/gui/FeaturesPlugin/fusionFacesFeature.rst b/doc/gui/FeaturesPlugin/fusionFacesFeature.rst deleted file mode 100644 index 1fd7f2f99..000000000 --- a/doc/gui/FeaturesPlugin/fusionFacesFeature.rst +++ /dev/null @@ -1,6 +0,0 @@ - -Fusion faces -============ - -.. centered:: - Fusion faces diff --git a/doc/gui/TUI_tutorial.rst b/doc/gui/TUI_tutorial.rst index 8a09c1ff1..949201bb8 100644 --- a/doc/gui/TUI_tutorial.rst +++ b/doc/gui/TUI_tutorial.rst @@ -1,10 +1,11 @@ + .. _tui_tutorial: Tutorial TUI Script =================== -.. literalinclude:: examples/tutorial.py +.. literalinclude:: tutorial.py :linenos: :language: python -:download:`Download this script ` \ No newline at end of file +:download:`Download this script ` \ No newline at end of file diff --git a/doc/gui/examples/tutorial.py b/doc/gui/examples/tutorial.py deleted file mode 100644 index 64e0c404e..000000000 --- a/doc/gui/examples/tutorial.py +++ /dev/null @@ -1,93 +0,0 @@ -# -*- coding: utf-8 -*- - -from SketchAPI import * - -from salome.shaper import model - -model.begin() -partSet = model.moduleDocument() -Part_1 = model.addPart(partSet) -Part_1_doc = Part_1.document() - -# Parameters -model.addParameter(Part_1_doc, "h", "90", "nut height") -model.addParameter(Part_1_doc, "a", "115.4") - -# Step1. Sketch. -Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY")) -SketchLine_1 = Sketch_1.addLine(-57.69999999999999, 99.93933159672423, 57.70000000000001, 99.93933159672423) -SketchLine_2 = Sketch_1.addLine(57.70000000000001, 99.93933159672423, 0, 0) -SketchLine_2.setAuxiliary(True) -SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchLine_2.startPoint()) -SketchLine_3 = Sketch_1.addLine(0, 0, -57.69999999999999, 99.93933159672423) -SketchLine_3.setAuxiliary(True) -SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchLine_2.endPoint(), SketchLine_3.startPoint()) -SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchLine_1.startPoint(), SketchLine_3.endPoint()) -SketchProjection_1 = Sketch_1.addProjection(model.selection("VERTEX", "PartSet/Origin"), False) -SketchPoint_1 = SketchProjection_1.createdFeature() -SketchConstraintCoincidence_4 = Sketch_1.setCoincident(SketchLine_3.startPoint(), SketchAPI_Point(SketchPoint_1).coordinates()) -SketchProjection_2 = Sketch_1.addProjection(model.selection("EDGE", "PartSet/OY"), False) -SketchLine_4 = SketchProjection_2.createdFeature() -SketchConstraintPerpendicular_1 = Sketch_1.setPerpendicular(SketchLine_4.result(), SketchLine_1.result()) -SketchConstraintEqual_1 = Sketch_1.setEqual(SketchLine_3.result(), SketchLine_1.result()) -SketchConstraintEqual_2 = Sketch_1.setEqual(SketchLine_2.result(), SketchLine_1.result()) -SketchMultiRotation_1 = Sketch_1.addRotation([SketchLine_1.result()], SketchAPI_Line(SketchLine_4).startPoint(), 360, 6, True) -[SketchLine_5, SketchLine_6, SketchLine_7, SketchLine_8, SketchLine_9] = SketchMultiRotation_1.rotated() -SketchConstraintLength_1 = Sketch_1.setLength(SketchLine_1.result(), "a") -model.do() - -# Step2. Polyline. -Point_2 = model.addPoint(Part_1_doc, 50, 0, 0) -Point_2.result().setColor(0, 0, 255) -Point_3 = model.addPoint(Part_1_doc, 80, 0, 0) -Point_3.result().setColor(0, 0, 255) -Point_4 = model.addPoint(Part_1_doc, 112, 0, 13) -Point_4.result().setColor(0, 0, 255) -Point_5 = model.addPoint(Part_1_doc, 112, 0, 48) -Point_5.result().setColor(0, 0, 255) -Point_6 = model.addPoint(Part_1_doc, 80, 0, 63) -Point_6.result().setColor(0, 0, 255) -Point_7 = model.addPoint(Part_1_doc, "80", "0", "h") -Point_7.result().setColor(0, 0, 255) -Point_8 = model.addPoint(Part_1_doc, "50", "0", "h") -Point_8.result().setColor(0, 0, 255) -Polyline_1_objects = [model.selection("VERTEX", "Point_1"), model.selection("VERTEX", "Point_2"), - model.selection("VERTEX", "Point_3"), model.selection("VERTEX", "Point_4"), - model.selection("VERTEX", "Point_5"), model.selection("VERTEX", "Point_6"), - model.selection("VERTEX", "Point_7")] -Polyline_1 = model.addPolyline3D(Part_1_doc, Polyline_1_objects, True) - -# Step3. Face. -Face_1 = model.addFace(Part_1_doc, [model.selection("WIRE", "Polyline_1_1")]) - -# Step4. Revolution. -Revolution_1 = model.addRevolution(Part_1_doc, [model.selection("FACE", "Face_1_1")], model.selection("EDGE", "PartSet/OZ"), 360, 0) - -# Step5. Extrusion. -Wire = model.selection("WIRE", "Sketch_1/Wire-SketchLine_1r-SketchLine_5r-SketchLine_6r-SketchLine_7r-SketchLine_8r-SketchLine_9r") -To = model.selection("FACE", "Revolution_1_1/Generated_Face_6") -From = model.selection("FACE", "Revolution_1_1/Generated_Face_1") - -Extrusion_1 = model.addExtrusion(Part_1_doc, [Wire], model.selection("EDGE", "PartSet/OZ"), To, 0, From, 0) - -# Step6. Common. -Common_1 = model.addCommon(Part_1_doc, [model.selection("SOLID", "Revolution_1_1"), model.selection("SOLID", "Extrusion_1_1")]) - -# Step7. Fillet. -Fillet_1 = model.addFillet(Part_1_doc, [model.selection("EDGE", "Revolution_1_1/Generated_Face_5&Common_1_1/Modified_Face_11")], 10) - -# Step8. Box. -Box_1 = model.addBox(Part_1_doc, 20, 120, 20) - -# Step9. Translation. -Translation_1 = model.addTranslation(Part_1_doc, [model.selection("SOLID", "Box_1_1")], -10, 20, 70) - -# Step10. Angular Copy. -AngularCopy_1 = model.addMultiRotation(Part_1_doc, [model.selection("SOLID", "Translation_1_1")], model.selection("EDGE", "PartSet/OZ"), 6) - -# Step11. Cut. -Cut_1 = model.addCut(Part_1_doc, [model.selection("SOLID", "Fillet_1_1")], [model.selection("COMPOUND", "AngularCopy_1_1")]) -Cut_1.result().setColor(255, 214, 0) - -model.do() -model.end() diff --git a/doc/gui/tutorial.py b/doc/gui/tutorial.py new file mode 100644 index 000000000..64e0c404e --- /dev/null +++ b/doc/gui/tutorial.py @@ -0,0 +1,93 @@ +# -*- coding: utf-8 -*- + +from SketchAPI import * + +from salome.shaper import model + +model.begin() +partSet = model.moduleDocument() +Part_1 = model.addPart(partSet) +Part_1_doc = Part_1.document() + +# Parameters +model.addParameter(Part_1_doc, "h", "90", "nut height") +model.addParameter(Part_1_doc, "a", "115.4") + +# Step1. Sketch. +Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY")) +SketchLine_1 = Sketch_1.addLine(-57.69999999999999, 99.93933159672423, 57.70000000000001, 99.93933159672423) +SketchLine_2 = Sketch_1.addLine(57.70000000000001, 99.93933159672423, 0, 0) +SketchLine_2.setAuxiliary(True) +SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchLine_2.startPoint()) +SketchLine_3 = Sketch_1.addLine(0, 0, -57.69999999999999, 99.93933159672423) +SketchLine_3.setAuxiliary(True) +SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchLine_2.endPoint(), SketchLine_3.startPoint()) +SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchLine_1.startPoint(), SketchLine_3.endPoint()) +SketchProjection_1 = Sketch_1.addProjection(model.selection("VERTEX", "PartSet/Origin"), False) +SketchPoint_1 = SketchProjection_1.createdFeature() +SketchConstraintCoincidence_4 = Sketch_1.setCoincident(SketchLine_3.startPoint(), SketchAPI_Point(SketchPoint_1).coordinates()) +SketchProjection_2 = Sketch_1.addProjection(model.selection("EDGE", "PartSet/OY"), False) +SketchLine_4 = SketchProjection_2.createdFeature() +SketchConstraintPerpendicular_1 = Sketch_1.setPerpendicular(SketchLine_4.result(), SketchLine_1.result()) +SketchConstraintEqual_1 = Sketch_1.setEqual(SketchLine_3.result(), SketchLine_1.result()) +SketchConstraintEqual_2 = Sketch_1.setEqual(SketchLine_2.result(), SketchLine_1.result()) +SketchMultiRotation_1 = Sketch_1.addRotation([SketchLine_1.result()], SketchAPI_Line(SketchLine_4).startPoint(), 360, 6, True) +[SketchLine_5, SketchLine_6, SketchLine_7, SketchLine_8, SketchLine_9] = SketchMultiRotation_1.rotated() +SketchConstraintLength_1 = Sketch_1.setLength(SketchLine_1.result(), "a") +model.do() + +# Step2. Polyline. +Point_2 = model.addPoint(Part_1_doc, 50, 0, 0) +Point_2.result().setColor(0, 0, 255) +Point_3 = model.addPoint(Part_1_doc, 80, 0, 0) +Point_3.result().setColor(0, 0, 255) +Point_4 = model.addPoint(Part_1_doc, 112, 0, 13) +Point_4.result().setColor(0, 0, 255) +Point_5 = model.addPoint(Part_1_doc, 112, 0, 48) +Point_5.result().setColor(0, 0, 255) +Point_6 = model.addPoint(Part_1_doc, 80, 0, 63) +Point_6.result().setColor(0, 0, 255) +Point_7 = model.addPoint(Part_1_doc, "80", "0", "h") +Point_7.result().setColor(0, 0, 255) +Point_8 = model.addPoint(Part_1_doc, "50", "0", "h") +Point_8.result().setColor(0, 0, 255) +Polyline_1_objects = [model.selection("VERTEX", "Point_1"), model.selection("VERTEX", "Point_2"), + model.selection("VERTEX", "Point_3"), model.selection("VERTEX", "Point_4"), + model.selection("VERTEX", "Point_5"), model.selection("VERTEX", "Point_6"), + model.selection("VERTEX", "Point_7")] +Polyline_1 = model.addPolyline3D(Part_1_doc, Polyline_1_objects, True) + +# Step3. Face. +Face_1 = model.addFace(Part_1_doc, [model.selection("WIRE", "Polyline_1_1")]) + +# Step4. Revolution. +Revolution_1 = model.addRevolution(Part_1_doc, [model.selection("FACE", "Face_1_1")], model.selection("EDGE", "PartSet/OZ"), 360, 0) + +# Step5. Extrusion. +Wire = model.selection("WIRE", "Sketch_1/Wire-SketchLine_1r-SketchLine_5r-SketchLine_6r-SketchLine_7r-SketchLine_8r-SketchLine_9r") +To = model.selection("FACE", "Revolution_1_1/Generated_Face_6") +From = model.selection("FACE", "Revolution_1_1/Generated_Face_1") + +Extrusion_1 = model.addExtrusion(Part_1_doc, [Wire], model.selection("EDGE", "PartSet/OZ"), To, 0, From, 0) + +# Step6. Common. +Common_1 = model.addCommon(Part_1_doc, [model.selection("SOLID", "Revolution_1_1"), model.selection("SOLID", "Extrusion_1_1")]) + +# Step7. Fillet. +Fillet_1 = model.addFillet(Part_1_doc, [model.selection("EDGE", "Revolution_1_1/Generated_Face_5&Common_1_1/Modified_Face_11")], 10) + +# Step8. Box. +Box_1 = model.addBox(Part_1_doc, 20, 120, 20) + +# Step9. Translation. +Translation_1 = model.addTranslation(Part_1_doc, [model.selection("SOLID", "Box_1_1")], -10, 20, 70) + +# Step10. Angular Copy. +AngularCopy_1 = model.addMultiRotation(Part_1_doc, [model.selection("SOLID", "Translation_1_1")], model.selection("EDGE", "PartSet/OZ"), 6) + +# Step11. Cut. +Cut_1 = model.addCut(Part_1_doc, [model.selection("SOLID", "Fillet_1_1")], [model.selection("COMPOUND", "AngularCopy_1_1")]) +Cut_1.result().setColor(255, 214, 0) + +model.do() +model.end() diff --git a/src/FeaturesPlugin/doc/FeaturesPlugin.rst b/src/FeaturesPlugin/doc/FeaturesPlugin.rst index 299df235f..a9abbcd28 100644 --- a/src/FeaturesPlugin/doc/FeaturesPlugin.rst +++ b/src/FeaturesPlugin/doc/FeaturesPlugin.rst @@ -19,6 +19,7 @@ Features plug-in provides a set of common topological operations. It implements fillFeature.rst filletFeature.rst fuseFeature.rst + fuseFeatureFaces.rst intersectionFeature.rst linearCopyFeature.rst measurementFeature.rst