]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Issue #2623: Ability to modify the radius of circles and arcs of circle with the...
authorazv <azv@opencascade.com>
Tue, 11 Sep 2018 09:22:10 +0000 (12:22 +0300)
committerazv <azv@opencascade.com>
Tue, 11 Sep 2018 09:22:10 +0000 (12:22 +0300)
CMakeLists.txt
src/SketchPlugin/Test/TestMoveArc.py
src/SketchPlugin/Test/TestMovementComplex.py

index dd2b1bdee57662e12293897fb32e2deef3f94ab2..05dd7e3f1e02d116b0e23ae1c8ec2807e5f77b9f 100644 (file)
@@ -114,7 +114,7 @@ ELSE(${HAVE_SALOME})
 ENDIF(${HAVE_SALOME})
 
 # Sketcher: Change radius of circular edges while dragging a point on the edge
-SET(SKETCHER_CHANGE_RADIUS_WHEN_MOVE FALSE)
+SET(SKETCHER_CHANGE_RADIUS_WHEN_MOVE TRUE)
 
 ADD_SUBDIRECTORY (src/Config)
 ADD_SUBDIRECTORY (src/Events)
index 53c49dcabe63ba862eaf572c211be6f5f34ea20b..e9f5f73b427c754e73aac05ae0de8a4f4c7a9dfe 100644 (file)
@@ -51,17 +51,17 @@ class TestMoveArc(unittest.TestCase):
     self.assertEqual(model.dof(self.mySketch), self.myDOF)
 
   def checkPointCoordinates(self, thePoint, theCoordinates):
-    self.assertAlmostEqual(thePoint.x(), theCoordinates[0])
-    self.assertAlmostEqual(thePoint.y(), theCoordinates[1])
+    self.assertAlmostEqual(thePoint.x(), theCoordinates[0], 6)
+    self.assertAlmostEqual(thePoint.y(), theCoordinates[1], 6)
 
   def checkPointOnArc(self, theCoordinates):
     distPC = model.distancePointPoint(self.myArc.center(),  theCoordinates)
     radius = model.distancePointPoint(self.myArc.center(), self.myArc.startPoint())
-    self.assertAlmostEqual(distPC, radius)
+    self.assertAlmostEqual(distPC, radius, 6)
 
   def checkArcRadius(self):
     radius = model.distancePointPoint(self.myArc.center(), self.myArc.startPoint())
-    self.assertAlmostEqual(radius, self.myRadius)
+    self.assertAlmostEqual(radius, self.myRadius, 6)
 
   def fixArcRadius(self):
     self.myRadius = 20.
index 59133d7f3d0341d92f6f14f00ccec73900b05da2..228f50427183247bc3af5d276d732706eeb46633 100644 (file)
@@ -340,10 +340,11 @@ model.do()
 Extrusion_2 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchLine_6r-SketchLine_7r-SketchLine_8r-SketchLine_9r-SketchCircle_2_2r-SketchArc_2_2r-SketchLine_13r-SketchLine_14f-SketchLine_15f-SketchArc_3_2r-SketchLine_16r")], model.selection(), -165, 155)
 Boolean_1 = model.addFuse(Part_1_doc, [model.selection("SOLID", "Extrusion_1_1")], [model.selection("SOLID", "Extrusion_2_1")])
 
-Sketch_3 = model.addSketch(Part_1_doc, model.selection("FACE", "Boolean_1_1/Modified_8"))
+Sketch_3 = model.addSketch(Part_1_doc, model.selection("FACE", "Fuse_1_1/Modified_Face_2"))
 SketchLine_17 = Sketch_3.addLine(145, 0, 165, 0)
-SketchPoint_2 = Sketch_3.addPoint(model.selection("VERTEX", "Boolean_1_1/Modified_7&Boolean_1_1/Modified_6&Boolean_1_1/Modified_2"))
-SketchConstraintCoincidence_23 = Sketch_3.setCoincident(SketchLine_17.endPoint(), SketchPoint_2.result())
+SketchProjection_2 = Sketch_3.addProjection(model.selection("VERTEX", "Fuse_1_1/Modified_Face_divided_6_1&Fuse_1_1/Modified_Face_3&Fuse_1_1/Modified_Face_divided_5_1"))
+SketchPoint_2 = SketchProjection_2.createdFeature()
+SketchConstraintCoincidence_23 = Sketch_3.setCoincident(SketchLine_17.endPoint(), SketchAPI_Point(SketchPoint_2).result())
 SketchLine_18 = Sketch_3.addLine(165, 0, 165, -20)
 SketchLine_19 = Sketch_3.addLine(165, -20, 145, -20)
 SketchLine_20 = Sketch_3.addLine(145, -20, 145, 0)
@@ -364,12 +365,12 @@ SketchArc_5 = Sketch_3.addArc(145, -20, 155, -20, 145, -10, False)
 SketchConstraintCoincidence_31 = Sketch_3.setCoincident(SketchLine_19.endPoint(), SketchArc_5.center())
 SketchConstraintCoincidence_32 = Sketch_3.setCoincident(SketchLine_20.result(), SketchArc_5.endPoint())
 SketchConstraintCoincidence_33 = Sketch_3.setCoincident(SketchArc_5.startPoint(), SketchLine_19.result())
-SketchLine_21 = Sketch_3.addLine(model.selection("EDGE", "Boolean_1_1/Modified_12&Boolean_1_1/Modified_11"))
+SketchLine_21 = Sketch_3.addLine(model.selection("EDGE", "Fuse_1_1/Modified_Face_4&Fuse_1_1/Modified_Face_divided_2_1"))
 SketchConstraintTangent_5 = Sketch_3.setTangent(SketchArc_5.results()[1], SketchLine_21.result())
 model.do()
 
-ExtrusionCut_1 = model.addExtrusionCut(Part_1_doc, [model.selection("FACE", "Sketch_3/Face-SketchLine_17r-SketchLine_18r-SketchArc_4_2r")], model.selection(), model.selection("FACE", "Boolean_1_1/Modified_5"), 0, model.selection(), 0, [model.selection("SOLID", "Boolean_1_1")])
-ExtrusionFuse_1 = model.addExtrusionFuse(Part_1_doc, [model.selection("FACE", "Sketch_3/Face-SketchLine_19r-SketchLine_20r-SketchArc_4_2f-SketchArc_5_2r")], model.selection(), model.selection("FACE", "ExtrusionCut_1_1/Modfied_7"), 0, model.selection(), 0, [model.selection("SOLID", "ExtrusionCut_1_1")])
+ExtrusionCut_1 = model.addExtrusionCut(Part_1_doc, [model.selection("FACE", "Sketch_3/Face-SketchLine_17r-SketchLine_18r-SketchArc_4_2r")], model.selection(), model.selection("FACE", "Fuse_1_1/Modified_Face_divided_1_1"), 0, model.selection(), 0, [model.selection("SOLID", "Fuse_1_1")])
+ExtrusionFuse_1 = model.addExtrusionFuse(Part_1_doc, [model.selection("FACE", "Sketch_3/Face-SketchLine_19r-SketchLine_20r-SketchArc_4_2f-SketchArc_5_2r")], model.selection(), model.selection("FACE", "ExtrusionCut_1_1/Modfied_8"), 0, model.selection(), 0, [model.selection("SOLID", "ExtrusionCut_1_1")])
 model.do()
 
 model.end()