From: mpv Date: Tue, 18 Dec 2018 06:50:01 +0000 (+0300) Subject: Finalization of the sketch drawer "Create dimensions" flag implemented X-Git-Tag: End2018~53 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=53445a818411b3b71e3457f5e2e97c5f23d69cb7;p=modules%2Fshaper.git Finalization of the sketch drawer "Create dimensions" flag implemented --- diff --git a/src/SketchPlugin/Test/TestSketchDrawer.py b/src/SketchPlugin/Test/TestSketchDrawer.py index b90c9489c..351adabeb 100644 --- a/src/SketchPlugin/Test/TestSketchDrawer.py +++ b/src/SketchPlugin/Test/TestSketchDrawer.py @@ -44,19 +44,31 @@ SketchConstraintRadius_2 = Sketch_1.setRadius(SketchCircle_1.results()[1], 5) model.do() Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_1r-SketchArc_1_2f-SketchLine_2f-SketchLine_3f-SketchLine_4f-SketchCircle_1_2r")], model.selection(), 10, 0) model.do() -# create a drawer feature of the extrusion and upper face -Drawer = Part_1_doc.addFeature("SketchDrawer") -Drawer.selection("base_shape").setValue(Extrusion_1.feature(), None) +# create a drawer feature of the extrusion and upper face, without dimensions +Drawer1 = Part_1_doc.addFeature("SketchDrawer") +Drawer1.selection("base_shape").setValue(Extrusion_1.feature(), None) +Drawer1.boolean("add_dimensions").setValue(False) PlaneSelection = model.selection("FACE", "Extrusion_1_1/To_Face") -PlaneSelection.fillAttribute(Drawer.selection("plane")) +PlaneSelection.fillAttribute(Drawer1.selection("plane")) +model.do() +# create a drawer feature of the extrusion and upper face, with dimensions +Drawer2 = Part_1_doc.addFeature("SketchDrawer") +Drawer2.selection("base_shape").setValue(Extrusion_1.feature(), None) +Drawer2.boolean("add_dimensions").setValue(True) +PlaneSelection = model.selection("FACE", "Extrusion_1_1/To_Face") +PlaneSelection.fillAttribute(Drawer2.selection("plane")) model.end() # check that a sketch is created with valid elements -assert(Part_1_doc.size("Construction") == 2) # two sketches: base of extrusion and this new one +assert(Part_1_doc.size("Construction") == 3) # three sketches: base of extrusion and drawer's two from ModelAPI import * aFactory = ModelAPI_Session.get().validators() -Sketch = objectToFeature(Part_1_doc.object("Features", 2)) # created sketch feature -assert(aFactory.validate(Sketch)) -assert(len(Sketch.results()) == 1) +Sketch1 = objectToFeature(Part_1_doc.object("Features", 2)) # the first created sketch feature +assert(aFactory.validate(Sketch1)) +assert(len(Sketch1.results()) == 1) + +Sketch2 = objectToFeature(Part_1_doc.object("Features", 3)) # the second created sketch feature +assert(aFactory.validate(Sketch2)) +assert(len(Sketch2.results()) == 1) diff --git a/src/SketchPlugin/doc/images/SketchDrawer_panel.png b/src/SketchPlugin/doc/images/SketchDrawer_panel.png index 8b786503d..6d7db60b7 100644 Binary files a/src/SketchPlugin/doc/images/SketchDrawer_panel.png and b/src/SketchPlugin/doc/images/SketchDrawer_panel.png differ diff --git a/src/SketchPlugin/doc/sketchDrawer.rst b/src/SketchPlugin/doc/sketchDrawer.rst index 20bb2eb4d..f019f472d 100644 --- a/src/SketchPlugin/doc/sketchDrawer.rst +++ b/src/SketchPlugin/doc/sketchDrawer.rst @@ -32,6 +32,11 @@ The following property panel appears: Click in the view once to set the whole original model, then click a second time to set the plane or planar face - a base of sketch. This can be plane on the original model. + +Flag "Create dimensions" allows to disable creation of dimensional constraints in the resulting sketch. +So, if it is disabled, then lengths and radiuses will be omitted. It allows to avoid overconstraint +situation and simplify work of the sketch solver. + On Apply button press the new sketch will be created in the Object Browser tree. Result