From 375a363427291783e25fa81fe42a14a01ecbaa1c Mon Sep 17 00:00:00 2001 From: azv Date: Mon, 18 Dec 2017 11:53:22 +0300 Subject: [PATCH] Adjust test cases according to new behavior of H/V Distance constraint through Python API --- src/FeaturesPlugin/Test/TestFillCompFaceSolid.py | 2 +- src/FeaturesPlugin/Test/TestFillEdgeShell.py | 2 +- src/FeaturesPlugin/Test/TestFillFaceSolid.py | 2 +- src/FeaturesPlugin/Test/TestFillShellConstrPlane.py | 2 +- src/FeaturesPlugin/Test/TestFillShellEdge.py | 2 +- src/FeaturesPlugin/Test/TestFillShellSolid.py | 2 +- src/FeaturesPlugin/Test/TestFillSolidCompFace.py | 2 +- src/FeaturesPlugin/Test/TestFillSolidCompShell.py | 2 +- src/FeaturesPlugin/Test/TestFillSolidFace.py | 2 +- src/FeaturesPlugin/Test/TestFillSolidShell.py | 2 +- src/FeaturesPlugin/Test/TestFillWireSolid.py | 2 +- src/ModelAPI/Test/TestCustomName_BooleanCut.py | 4 ++-- src/ModelAPI/Test/TestCustomName_CutCompSolid.py | 4 ++-- src/ModelAPI/Test/TestCustomName_CutGroup.py | 8 ++++---- src/SketchPlugin/Test/Test2341.py | 8 ++++---- src/SketchPlugin/Test/TestConstraintDistanceBehavior.py | 6 ++++-- src/SketchPlugin/Test/TestMovementComplex.py | 2 +- 17 files changed, 28 insertions(+), 26 deletions(-) diff --git a/src/FeaturesPlugin/Test/TestFillCompFaceSolid.py b/src/FeaturesPlugin/Test/TestFillCompFaceSolid.py index 55bb45e88..1fc541327 100644 --- a/src/FeaturesPlugin/Test/TestFillCompFaceSolid.py +++ b/src/FeaturesPlugin/Test/TestFillCompFaceSolid.py @@ -46,7 +46,7 @@ SketchConstraintCoincidence_4 = Sketch_1.setCoincident(SketchLine_2.endPoint(), SketchConstraintCoincidence_5 = Sketch_1.setCoincident(SketchLine_3.endPoint(), SketchArc_1.endPoint()) SketchConstraintCoincidence_6 = Sketch_1.setCoincident(SketchLine_2.endPoint(), SketchLine_1.result()) SketchConstraintRadius_1 = Sketch_1.setRadius(SketchArc_1.results()[1], "L+Shift/2") -SketchConstraintDistanceVertical_1 = Sketch_1.setVerticalDistance(SketchAPI_Line(SketchLine_1).startPoint(), SketchLine_2.startPoint(), -5) +SketchConstraintDistanceVertical_1 = Sketch_1.setVerticalDistance(SketchAPI_Line(SketchLine_1).startPoint(), SketchLine_2.startPoint(), 5) SketchConstraintDistance_1 = Sketch_1.setDistance(SketchAPI_Line(SketchLine_1).startPoint(), SketchLine_3.startPoint(), "Shift", True) model.do() Plane_5 = model.addPlane(Part_1_doc, model.selection("FACE", "Box_1_1/Left"), "Shift", True) diff --git a/src/FeaturesPlugin/Test/TestFillEdgeShell.py b/src/FeaturesPlugin/Test/TestFillEdgeShell.py index 55efa5458..9b9b7ad57 100644 --- a/src/FeaturesPlugin/Test/TestFillEdgeShell.py +++ b/src/FeaturesPlugin/Test/TestFillEdgeShell.py @@ -35,7 +35,7 @@ SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_1.result(), Sk SketchProjection_2 = Sketch_1.addProjection(model.selection("EDGE", "PartSet/OZ"), False) SketchLine_2 = SketchProjection_2.createdFeature() SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchArc_1.startPoint(), SketchLine_2.result()) -SketchConstraintDistanceVertical_1 = Sketch_1.setVerticalDistance(SketchArc_1.startPoint(), SketchAPI_Line(SketchLine_1).startPoint(), -50) +SketchConstraintDistanceVertical_1 = Sketch_1.setVerticalDistance(SketchArc_1.startPoint(), SketchAPI_Line(SketchLine_1).startPoint(), 50) SketchArc_2 = Sketch_1.addArc(38.14157263904823, 16.22495851193372, 56.77054208906745, 0, 34.15529753265601, 40.60522496371553, False) SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchArc_1.endPoint(), SketchArc_2.startPoint()) SketchConstraintTangent_1 = Sketch_1.setTangent(SketchArc_1.results()[1], SketchArc_2.results()[1]) diff --git a/src/FeaturesPlugin/Test/TestFillFaceSolid.py b/src/FeaturesPlugin/Test/TestFillFaceSolid.py index e28a05dbc..d5cf7179f 100644 --- a/src/FeaturesPlugin/Test/TestFillFaceSolid.py +++ b/src/FeaturesPlugin/Test/TestFillFaceSolid.py @@ -46,7 +46,7 @@ SketchConstraintCoincidence_4 = Sketch_1.setCoincident(SketchLine_2.endPoint(), SketchConstraintCoincidence_5 = Sketch_1.setCoincident(SketchLine_3.endPoint(), SketchArc_1.endPoint()) SketchConstraintCoincidence_6 = Sketch_1.setCoincident(SketchLine_2.endPoint(), SketchLine_1.result()) SketchConstraintRadius_1 = Sketch_1.setRadius(SketchArc_1.results()[1], "L+Shift/2") -SketchConstraintDistanceVertical_1 = Sketch_1.setVerticalDistance(SketchAPI_Line(SketchLine_1).startPoint(), SketchLine_2.startPoint(), -5) +SketchConstraintDistanceVertical_1 = Sketch_1.setVerticalDistance(SketchAPI_Line(SketchLine_1).startPoint(), SketchLine_2.startPoint(), 5) SketchConstraintDistance_1 = Sketch_1.setDistance(SketchAPI_Line(SketchLine_1).startPoint(), SketchLine_3.startPoint(), "Shift", True) model.do() Face_1 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_1/Wire-SketchArc_1_2f-SketchLine_2f-SketchLine_3f")]) diff --git a/src/FeaturesPlugin/Test/TestFillShellConstrPlane.py b/src/FeaturesPlugin/Test/TestFillShellConstrPlane.py index c28d7b69d..86c1da04f 100644 --- a/src/FeaturesPlugin/Test/TestFillShellConstrPlane.py +++ b/src/FeaturesPlugin/Test/TestFillShellConstrPlane.py @@ -35,7 +35,7 @@ SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_1.result(), Sk SketchProjection_2 = Sketch_1.addProjection(model.selection("EDGE", "PartSet/OZ"), False) SketchLine_2 = SketchProjection_2.createdFeature() SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchArc_1.startPoint(), SketchLine_2.result()) -SketchConstraintDistanceVertical_1 = Sketch_1.setVerticalDistance(SketchArc_1.startPoint(), SketchAPI_Line(SketchLine_1).startPoint(), -50) +SketchConstraintDistanceVertical_1 = Sketch_1.setVerticalDistance(SketchArc_1.startPoint(), SketchAPI_Line(SketchLine_1).startPoint(), 50) SketchArc_2 = Sketch_1.addArc(38.14157263904823, 16.22495851193372, 56.77054208906745, 0, 34.15529753265601, 40.60522496371553, False) SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchArc_1.endPoint(), SketchArc_2.startPoint()) SketchConstraintTangent_1 = Sketch_1.setTangent(SketchArc_1.results()[1], SketchArc_2.results()[1]) diff --git a/src/FeaturesPlugin/Test/TestFillShellEdge.py b/src/FeaturesPlugin/Test/TestFillShellEdge.py index 832a0feb9..207cc210c 100644 --- a/src/FeaturesPlugin/Test/TestFillShellEdge.py +++ b/src/FeaturesPlugin/Test/TestFillShellEdge.py @@ -35,7 +35,7 @@ SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_1.result(), Sk SketchProjection_2 = Sketch_1.addProjection(model.selection("EDGE", "PartSet/OZ"), False) SketchLine_2 = SketchProjection_2.createdFeature() SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchArc_1.startPoint(), SketchLine_2.result()) -SketchConstraintDistanceVertical_1 = Sketch_1.setVerticalDistance(SketchArc_1.startPoint(), SketchAPI_Line(SketchLine_1).startPoint(), -50) +SketchConstraintDistanceVertical_1 = Sketch_1.setVerticalDistance(SketchArc_1.startPoint(), SketchAPI_Line(SketchLine_1).startPoint(), 50) SketchArc_2 = Sketch_1.addArc(38.14157263904823, 16.22495851193372, 56.77054208906745, 0, 34.15529753265601, 40.60522496371553, False) SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchArc_1.endPoint(), SketchArc_2.startPoint()) SketchConstraintTangent_1 = Sketch_1.setTangent(SketchArc_1.results()[1], SketchArc_2.results()[1]) diff --git a/src/FeaturesPlugin/Test/TestFillShellSolid.py b/src/FeaturesPlugin/Test/TestFillShellSolid.py index f751b94e4..c1e57f1d7 100644 --- a/src/FeaturesPlugin/Test/TestFillShellSolid.py +++ b/src/FeaturesPlugin/Test/TestFillShellSolid.py @@ -46,7 +46,7 @@ SketchConstraintCoincidence_4 = Sketch_1.setCoincident(SketchLine_2.endPoint(), SketchConstraintCoincidence_5 = Sketch_1.setCoincident(SketchLine_3.endPoint(), SketchArc_1.endPoint()) SketchConstraintCoincidence_6 = Sketch_1.setCoincident(SketchLine_2.endPoint(), SketchLine_1.result()) SketchConstraintRadius_1 = Sketch_1.setRadius(SketchArc_1.results()[1], "L+Shift/2") -SketchConstraintDistanceVertical_1 = Sketch_1.setVerticalDistance(SketchAPI_Line(SketchLine_1).startPoint(), SketchLine_2.startPoint(), -5) +SketchConstraintDistanceVertical_1 = Sketch_1.setVerticalDistance(SketchAPI_Line(SketchLine_1).startPoint(), SketchLine_2.startPoint(), 5) SketchConstraintDistance_1 = Sketch_1.setDistance(SketchAPI_Line(SketchLine_1).startPoint(), SketchLine_3.startPoint(), "Shift", True) model.do() Plane_5 = model.addPlane(Part_1_doc, model.selection("FACE", "Box_1_1/Left"), "Shift", True) diff --git a/src/FeaturesPlugin/Test/TestFillSolidCompFace.py b/src/FeaturesPlugin/Test/TestFillSolidCompFace.py index d38ece362..759c501ad 100644 --- a/src/FeaturesPlugin/Test/TestFillSolidCompFace.py +++ b/src/FeaturesPlugin/Test/TestFillSolidCompFace.py @@ -46,7 +46,7 @@ SketchConstraintCoincidence_4 = Sketch_1.setCoincident(SketchLine_2.endPoint(), SketchConstraintCoincidence_5 = Sketch_1.setCoincident(SketchLine_3.endPoint(), SketchArc_1.endPoint()) SketchConstraintCoincidence_6 = Sketch_1.setCoincident(SketchLine_2.endPoint(), SketchLine_1.result()) SketchConstraintRadius_1 = Sketch_1.setRadius(SketchArc_1.results()[1], "L+Shift/2") -SketchConstraintDistanceVertical_1 = Sketch_1.setVerticalDistance(SketchAPI_Line(SketchLine_1).startPoint(), SketchLine_2.startPoint(), "-Shift/3") +SketchConstraintDistanceVertical_1 = Sketch_1.setVerticalDistance(SketchAPI_Line(SketchLine_1).startPoint(), SketchLine_2.startPoint(), "Shift/3") SketchConstraintDistance_1 = Sketch_1.setDistance(SketchAPI_Line(SketchLine_1).startPoint(), SketchLine_3.startPoint(), "Shift", True) model.do() Plane_5 = model.addPlane(Part_1_doc, model.selection("FACE", "Box_1_1/Left"), "Shift/3", True) diff --git a/src/FeaturesPlugin/Test/TestFillSolidCompShell.py b/src/FeaturesPlugin/Test/TestFillSolidCompShell.py index 997708c53..8e965a51c 100644 --- a/src/FeaturesPlugin/Test/TestFillSolidCompShell.py +++ b/src/FeaturesPlugin/Test/TestFillSolidCompShell.py @@ -46,7 +46,7 @@ SketchConstraintCoincidence_4 = Sketch_1.setCoincident(SketchLine_2.endPoint(), SketchConstraintCoincidence_5 = Sketch_1.setCoincident(SketchLine_3.endPoint(), SketchArc_1.endPoint()) SketchConstraintCoincidence_6 = Sketch_1.setCoincident(SketchLine_2.endPoint(), SketchLine_1.result()) SketchConstraintRadius_1 = Sketch_1.setRadius(SketchArc_1.results()[1], "L+Shift/2") -SketchConstraintDistanceVertical_1 = Sketch_1.setVerticalDistance(SketchAPI_Line(SketchLine_1).startPoint(), SketchLine_2.startPoint(), "-Shift/3") +SketchConstraintDistanceVertical_1 = Sketch_1.setVerticalDistance(SketchAPI_Line(SketchLine_1).startPoint(), SketchLine_2.startPoint(), "Shift/3") SketchConstraintDistance_1 = Sketch_1.setDistance(SketchAPI_Line(SketchLine_1).startPoint(), SketchLine_3.startPoint(), "Shift", True) model.do() Plane_5 = model.addPlane(Part_1_doc, model.selection("FACE", "Box_1_1/Left"), "Shift/3", True) diff --git a/src/FeaturesPlugin/Test/TestFillSolidFace.py b/src/FeaturesPlugin/Test/TestFillSolidFace.py index ae29513b3..f0fe20d89 100644 --- a/src/FeaturesPlugin/Test/TestFillSolidFace.py +++ b/src/FeaturesPlugin/Test/TestFillSolidFace.py @@ -46,7 +46,7 @@ SketchConstraintCoincidence_4 = Sketch_1.setCoincident(SketchLine_2.endPoint(), SketchConstraintCoincidence_5 = Sketch_1.setCoincident(SketchLine_3.endPoint(), SketchArc_1.endPoint()) SketchConstraintCoincidence_6 = Sketch_1.setCoincident(SketchLine_2.endPoint(), SketchLine_1.result()) SketchConstraintRadius_1 = Sketch_1.setRadius(SketchArc_1.results()[1], "L+Shift/2") -SketchConstraintDistanceVertical_1 = Sketch_1.setVerticalDistance(SketchAPI_Line(SketchLine_1).startPoint(), SketchLine_2.startPoint(), "-Shift/3") +SketchConstraintDistanceVertical_1 = Sketch_1.setVerticalDistance(SketchAPI_Line(SketchLine_1).startPoint(), SketchLine_2.startPoint(), "Shift/3") SketchConstraintDistance_1 = Sketch_1.setDistance(SketchAPI_Line(SketchLine_1).startPoint(), SketchLine_3.startPoint(), "Shift", True) model.do() Face_1 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_1/Wire-SketchArc_1_2f-SketchLine_2f-SketchLine_3f")]) diff --git a/src/FeaturesPlugin/Test/TestFillSolidShell.py b/src/FeaturesPlugin/Test/TestFillSolidShell.py index 2a06dab42..6cf9389d1 100644 --- a/src/FeaturesPlugin/Test/TestFillSolidShell.py +++ b/src/FeaturesPlugin/Test/TestFillSolidShell.py @@ -46,7 +46,7 @@ SketchConstraintCoincidence_4 = Sketch_1.setCoincident(SketchLine_2.endPoint(), SketchConstraintCoincidence_5 = Sketch_1.setCoincident(SketchLine_3.endPoint(), SketchArc_1.endPoint()) SketchConstraintCoincidence_6 = Sketch_1.setCoincident(SketchLine_2.endPoint(), SketchLine_1.result()) SketchConstraintRadius_1 = Sketch_1.setRadius(SketchArc_1.results()[1], "L+Shift/2") -SketchConstraintDistanceVertical_1 = Sketch_1.setVerticalDistance(SketchAPI_Line(SketchLine_1).startPoint(), SketchLine_2.startPoint(), "-Shift/3") +SketchConstraintDistanceVertical_1 = Sketch_1.setVerticalDistance(SketchAPI_Line(SketchLine_1).startPoint(), SketchLine_2.startPoint(), "Shift/3") SketchConstraintDistance_1 = Sketch_1.setDistance(SketchAPI_Line(SketchLine_1).startPoint(), SketchLine_3.startPoint(), "Shift", True) model.do() Plane_5 = model.addPlane(Part_1_doc, model.selection("FACE", "Box_1_1/Left"), "Shift/3", True) diff --git a/src/FeaturesPlugin/Test/TestFillWireSolid.py b/src/FeaturesPlugin/Test/TestFillWireSolid.py index 630f9eaf5..f2998dcee 100644 --- a/src/FeaturesPlugin/Test/TestFillWireSolid.py +++ b/src/FeaturesPlugin/Test/TestFillWireSolid.py @@ -46,7 +46,7 @@ SketchConstraintCoincidence_4 = Sketch_1.setCoincident(SketchLine_2.endPoint(), SketchConstraintCoincidence_5 = Sketch_1.setCoincident(SketchLine_3.endPoint(), SketchArc_1.endPoint()) SketchConstraintCoincidence_6 = Sketch_1.setCoincident(SketchLine_2.endPoint(), SketchLine_1.result()) SketchConstraintRadius_1 = Sketch_1.setRadius(SketchArc_1.results()[1], "L+Shift/2") -SketchConstraintDistanceVertical_1 = Sketch_1.setVerticalDistance(SketchAPI_Line(SketchLine_1).startPoint(), SketchLine_2.startPoint(), -5) +SketchConstraintDistanceVertical_1 = Sketch_1.setVerticalDistance(SketchAPI_Line(SketchLine_1).startPoint(), SketchLine_2.startPoint(), 5) SketchConstraintDistance_1 = Sketch_1.setDistance(SketchAPI_Line(SketchLine_1).startPoint(), SketchLine_3.startPoint(), "Shift", True) model.do() Wire_1 = model.addWire(Part_1_doc, [model.selection("WIRE", "Sketch_1/Wire-SketchArc_1_2f-SketchLine_2f-SketchLine_3f")]) diff --git a/src/ModelAPI/Test/TestCustomName_BooleanCut.py b/src/ModelAPI/Test/TestCustomName_BooleanCut.py index fb24a1746..5eb24bc40 100644 --- a/src/ModelAPI/Test/TestCustomName_BooleanCut.py +++ b/src/ModelAPI/Test/TestCustomName_BooleanCut.py @@ -62,8 +62,8 @@ SketchConstraintHorizontal_4 = Sketch_2.setHorizontal(SketchLine_7.result()) SketchConstraintVertical_4 = Sketch_2.setVertical(SketchLine_8.result()) SketchProjection_2 = Sketch_2.addProjection(model.selection("VERTEX", "PartSet/Origin"), False) SketchPoint_2 = SketchProjection_2.createdFeature() -SketchConstraintDistanceVertical_1 = Sketch_2.setVerticalDistance(SketchAPI_Point(SketchPoint_2).coordinates(), SketchLine_7.endPoint(), -5) -SketchConstraintDistanceHorizontal_1 = Sketch_2.setHorizontalDistance(SketchLine_8.startPoint(), SketchAPI_Point(SketchPoint_2).coordinates(), -10) +SketchConstraintDistanceVertical_1 = Sketch_2.setVerticalDistance(SketchAPI_Point(SketchPoint_2).coordinates(), SketchLine_7.endPoint(), 5) +SketchConstraintDistanceHorizontal_1 = Sketch_2.setHorizontalDistance(SketchLine_8.startPoint(), SketchAPI_Point(SketchPoint_2).coordinates(), 10) SketchConstraintLength_3 = Sketch_2.setLength(SketchLine_8.result(), 60) SketchConstraintLength_4 = Sketch_2.setLength(SketchLine_7.result(), 40) model.do() diff --git a/src/ModelAPI/Test/TestCustomName_CutCompSolid.py b/src/ModelAPI/Test/TestCustomName_CutCompSolid.py index 831f49fad..7da2b0e44 100644 --- a/src/ModelAPI/Test/TestCustomName_CutCompSolid.py +++ b/src/ModelAPI/Test/TestCustomName_CutCompSolid.py @@ -52,9 +52,9 @@ SketchConstraintCoincidence_9 = Sketch_1.setCoincident(SketchLine_6.endPoint(), SketchConstraintPerpendicular_1 = Sketch_1.setPerpendicular(SketchLine_5.result(), SketchLine_6.result()) SketchConstraintEqual_1 = Sketch_1.setEqual(SketchLine_3.result(), SketchLine_4.result()) SketchConstraintLength_1 = Sketch_1.setLength(SketchLine_2.result(), 80) -SketchConstraintDistanceVertical_1 = Sketch_1.setVerticalDistance(SketchLine_6.startPoint(), SketchLine_1.endPoint(), -20) +SketchConstraintDistanceVertical_1 = Sketch_1.setVerticalDistance(SketchLine_6.startPoint(), SketchLine_1.endPoint(), 20) SketchConstraintDistanceHorizontal_1 = Sketch_1.setHorizontalDistance(SketchLine_5.endPoint(), SketchLine_1.startPoint(), 15) -SketchConstraintDistanceVertical_2 = Sketch_1.setVerticalDistance(SketchLine_6.endPoint(), SketchLine_1.startPoint(), -50) +SketchConstraintDistanceVertical_2 = Sketch_1.setVerticalDistance(SketchLine_6.endPoint(), SketchLine_1.startPoint(), 50) model.do() Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("COMPOUND", "Sketch_1")], model.selection(), 50, 0) Extrusion_1.result().setName("compsolid") diff --git a/src/ModelAPI/Test/TestCustomName_CutGroup.py b/src/ModelAPI/Test/TestCustomName_CutGroup.py index d4fb33a30..211275e52 100644 --- a/src/ModelAPI/Test/TestCustomName_CutGroup.py +++ b/src/ModelAPI/Test/TestCustomName_CutGroup.py @@ -47,7 +47,7 @@ SketchConstraintLength_2 = Sketch_1.setLength(SketchLine_2.result(), 40) SketchCircle_1 = Sketch_1.addCircle(30, 70, 20) SketchConstraintRadius_1 = Sketch_1.setRadius(SketchCircle_1.results()[1], 20) SketchConstraintDistance_1 = Sketch_1.setDistance(SketchCircle_1.center(), SketchLine_3.result(), 30, True) -SketchConstraintDistanceHorizontal_1 = Sketch_1.setHorizontalDistance(SketchCircle_1.center(), SketchLine_2.startPoint(), -30) +SketchConstraintDistanceHorizontal_1 = Sketch_1.setHorizontalDistance(SketchCircle_1.center(), SketchLine_2.startPoint(), 30) SketchLine_5 = Sketch_1.addLine(12.50000000006628, -45.31088913249455, 30, -15) SketchLine_6 = Sketch_1.addLine(30, -15, 47.50000000006629, -45.31088913249455) SketchConstraintCoincidence_6 = Sketch_1.setCoincident(SketchLine_5.endPoint(), SketchLine_6.startPoint()) @@ -58,7 +58,7 @@ SketchConstraintEqual_1 = Sketch_1.setEqual(SketchLine_5.result(), SketchLine_7. SketchConstraintEqual_2 = Sketch_1.setEqual(SketchLine_5.result(), SketchLine_6.result()) SketchConstraintHorizontal_3 = Sketch_1.setHorizontal(SketchLine_7.result()) SketchConstraintLength_3 = Sketch_1.setLength(SketchLine_7.result(), 35) -SketchConstraintDistanceHorizontal_2 = Sketch_1.setHorizontalDistance(SketchLine_5.endPoint(), SketchLine_2.startPoint(), -30) +SketchConstraintDistanceHorizontal_2 = Sketch_1.setHorizontalDistance(SketchLine_5.endPoint(), SketchLine_2.startPoint(), 30) SketchConstraintDistanceVertical_1 = Sketch_1.setVerticalDistance(SketchLine_5.endPoint(), SketchLine_2.startPoint(), 15) model.do() Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_1r-SketchLine_2r-SketchLine_3r-SketchLine_4r")], model.selection(), 10, 0) @@ -84,8 +84,8 @@ SketchConstraintLength_4 = Sketch_2.setLength(SketchLine_10.result(), 20) SketchConstraintLength_5 = Sketch_2.setLength(SketchLine_9.result(), 130) SketchProjection_2 = Sketch_2.addProjection(model.selection("VERTEX", "box/Generated_Face_3&box/Generated_Face_2&box/From_Face_1"), False) SketchPoint_2 = SketchProjection_2.createdFeature() -SketchConstraintDistanceVertical_2 = Sketch_2.setVerticalDistance(SketchLine_8.endPoint(), SketchAPI_Point(SketchPoint_2).coordinates(), -30) -SketchConstraintDistanceHorizontal_3 = Sketch_2.setHorizontalDistance(SketchLine_8.endPoint(), SketchAPI_Point(SketchPoint_2).coordinates(), -25) +SketchConstraintDistanceVertical_2 = Sketch_2.setVerticalDistance(SketchLine_8.endPoint(), SketchAPI_Point(SketchPoint_2).coordinates(), 30) +SketchConstraintDistanceHorizontal_3 = Sketch_2.setHorizontalDistance(SketchLine_8.endPoint(), SketchAPI_Point(SketchPoint_2).coordinates(), 25) model.do() Extrusion_4 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchLine_8f-SketchLine_9f-SketchLine_10f-SketchLine_11f")], model.selection(), 5, 15) Extrusion_4.result().setName("cut_tool") diff --git a/src/SketchPlugin/Test/Test2341.py b/src/SketchPlugin/Test/Test2341.py index 0cc6544fb..a62144360 100644 --- a/src/SketchPlugin/Test/Test2341.py +++ b/src/SketchPlugin/Test/Test2341.py @@ -68,7 +68,7 @@ SketchProjection_3 = Sketch_1.addProjection(model.selection("VERTEX", "PartSet/O SketchPoint_3 = SketchProjection_3.createdFeature() SketchProjection_4 = Sketch_1.addProjection(model.selection("VERTEX", "PartSet/Origin"), False) SketchPoint_4 = SketchProjection_4.createdFeature() -SketchConstraintDistanceVertical_1 = Sketch_1.setVerticalDistance(SketchAPI_Point(SketchPoint_4).coordinates(), SketchLine_4.startPoint(), -10) +SketchConstraintDistanceVertical_1 = Sketch_1.setVerticalDistance(SketchAPI_Point(SketchPoint_4).coordinates(), SketchLine_4.startPoint(), 10) SketchProjection_5 = Sketch_1.addProjection(model.selection("VERTEX", "PartSet/Origin"), False) SketchPoint_5 = SketchProjection_5.createdFeature() SketchArc_1 = Sketch_1.addArc(0, 0, -5.830951894848558, -7.5, -6, 7.365459931328117, True) @@ -84,10 +84,10 @@ SketchConstraintRadius_2 = Sketch_1.setRadius(SketchArc_2.results()[1], 9.5) SketchArc_3 = Sketch_1.addArc(0, 0, 1.561361948645558, 3.6826822922052, 3.682682292205201, 1.561361948645557, False) SketchConstraintCoincidence_11 = Sketch_1.setCoincident(SketchAPI_Point(SketchPoint_1).coordinates(), SketchArc_3.center()) SketchConstraintRadius_3 = Sketch_1.setRadius(SketchArc_3.results()[1], 4) -SketchConstraintDistanceHorizontal_1 = Sketch_1.setHorizontalDistance(SketchLine_6.endPoint(), SketchArc_1.center(), -6) -SketchConstraintDistanceHorizontal_2 = Sketch_1.setHorizontalDistance(SketchLine_3.endPoint(), SketchArc_1.center(), -11) +SketchConstraintDistanceHorizontal_1 = Sketch_1.setHorizontalDistance(SketchLine_6.endPoint(), SketchArc_1.center(), 6) +SketchConstraintDistanceHorizontal_2 = Sketch_1.setHorizontalDistance(SketchLine_3.endPoint(), SketchArc_1.center(), 11) SketchConstraintCoincidence_12 = Sketch_1.setCoincident(SketchLine_8.endPoint(), SketchArc_1.endPoint()) -SketchConstraintDistanceVertical_2 = Sketch_1.setVerticalDistance(SketchLine_8.startPoint(), SketchLine_2.endPoint(), -22) +SketchConstraintDistanceVertical_2 = Sketch_1.setVerticalDistance(SketchLine_8.startPoint(), SketchLine_2.endPoint(), 22) SketchLine_9 = Sketch_1.addLine(0, 0, 14.14213562373095, 14.14213562373095) SketchLine_9.setAuxiliary(True) SketchConstraintCoincidence_13 = Sketch_1.setCoincident(SketchAPI_Point(SketchPoint_1).coordinates(), SketchLine_9.startPoint()) diff --git a/src/SketchPlugin/Test/TestConstraintDistanceBehavior.py b/src/SketchPlugin/Test/TestConstraintDistanceBehavior.py index a38089083..269d4acfa 100644 --- a/src/SketchPlugin/Test/TestConstraintDistanceBehavior.py +++ b/src/SketchPlugin/Test/TestConstraintDistanceBehavior.py @@ -40,7 +40,8 @@ model.do() # Test 1. # ============================================================================= # horizontal distance constraint -SketchConstraintDistanceHorizontal_1 = Sketch_1.setHorizontalDistance(firstPoint, secondPoint, "distance") +SketchConstraintDistanceHorizontal_1 = Sketch_1.setHorizontalDistance(firstPoint, secondPoint, 10) +SketchConstraintDistanceHorizontal_1.feature().real("ConstraintValue").setText(DistanceParam.name().value()) model.do() # changing the parameter @@ -63,7 +64,8 @@ model.do() # Test 2. # ============================================================================= # Vertical distance constraint -SketchConstraintDistanceVertical_1 = Sketch_1.setVerticalDistance(firstPoint, secondPoint, "distance") +SketchConstraintDistanceVertical_1 = Sketch_1.setVerticalDistance(firstPoint, secondPoint, 10) +SketchConstraintDistanceVertical_1.feature().real("ConstraintValue").setText(DistanceParam.name().value()) model.do() # changing the parameter diff --git a/src/SketchPlugin/Test/TestMovementComplex.py b/src/SketchPlugin/Test/TestMovementComplex.py index 6fe6afe90..59133d7f3 100644 --- a/src/SketchPlugin/Test/TestMovementComplex.py +++ b/src/SketchPlugin/Test/TestMovementComplex.py @@ -133,7 +133,7 @@ for i in range(1, 10): # ============================================================================= # Test 3. Constrain center of circle and move it again # ============================================================================= -SketchConstraintDistanceHorizontal_3 = Sketch_1.setHorizontalDistance(SketchCircle_1.center(), SketchArc_1.startPoint(), -30) +SketchConstraintDistanceHorizontal_3 = Sketch_1.setHorizontalDistance(SketchCircle_1.center(), SketchArc_1.startPoint(), 30) model.do() # move center delta = [1., 1.] -- 2.39.2