From 6b615b773dd6e6901cd246ecb55003a9941e2365 Mon Sep 17 00:00:00 2001 From: azv Date: Fri, 15 Dec 2017 15:44:51 +0300 Subject: [PATCH] Adjust unit tests for Boolean Fill --- src/FeaturesPlugin/Test/TestFillFaceFace.py | 16 +--------------- src/FeaturesPlugin/Test/TestFillSolidFace.py | 8 ++++---- 2 files changed, 5 insertions(+), 19 deletions(-) diff --git a/src/FeaturesPlugin/Test/TestFillFaceFace.py b/src/FeaturesPlugin/Test/TestFillFaceFace.py index a5db1f74e..03cefe9e4 100644 --- a/src/FeaturesPlugin/Test/TestFillFaceFace.py +++ b/src/FeaturesPlugin/Test/TestFillFaceFace.py @@ -54,29 +54,15 @@ SketchConstraintCoincidence_8 = Sketch_2.setCoincident(SketchPoint_2.result(), S SketchConstraintCoincidence_9 = Sketch_2.setCoincident(SketchLine_5.endPoint(), SketchArc_2.startPoint()) SketchConstraintCoincidence_10 = Sketch_2.setCoincident(SketchArc_2.endPoint(), SketchLine_4.startPoint()) SketchConstraintRadius_2 = Sketch_2.setRadius(SketchArc_2.results()[1], "R") -SketchProjection_4 = Sketch_2.addProjection(model.selection("EDGE", "PartSet/OZ"), False) -SketchLine_6 = SketchProjection_4.createdFeature() -SketchConstraintMirror_1 = Sketch_2.addMirror(SketchLine_6.result(), [SketchArc_2.results()[1]]) -[SketchArc_3] = SketchConstraintMirror_1.mirrored() -SketchLine_7 = Sketch_2.addLine(-31.79164821526215, 49.99496405877289, -27.24680168984479, -49.85269382803261) -SketchConstraintCoincidence_11 = Sketch_2.setCoincident(SketchAPI_Arc(SketchArc_3).endPoint(), SketchLine_7.startPoint()) -SketchConstraintCoincidence_12 = Sketch_2.setCoincident(SketchAPI_Arc(SketchArc_3).startPoint(), SketchLine_7.endPoint()) model.do() Face_1 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_1/Wire-SketchLine_1f-SketchLine_3f-SketchArc_1_2f")]) Face_2 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_2/Wire-SketchLine_4f-SketchLine_5f-SketchArc_2_2f")]) -Face_3 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_2/Wire-SketchArc_3_2f-SketchLine_7r")]) -Symmetry_1 = model.addSymmetry(Part_1_doc, [model.selection("FACE", "Face_1_1")], model.selection("FACE", "PartSet/XOZ")) -Recover_1 = model.addRecover(Part_1_doc, Symmetry_1, [Face_1.result()]) -Boolean_1 = model.addFill(Part_1_doc, [model.selection("FACE", "Recover_1_1")], [model.selection("FACE", "Face_2_1")]) -Boolean_2 = model.addFill(Part_1_doc, [model.selection("FACE", "Symmetry_1_1")], [model.selection("FACE", "Face_3_1")]) +Boolean_1 = model.addFill(Part_1_doc, [model.selection("FACE", "Face_1_1")], [model.selection("FACE", "Face_2_1")]) model.do() model.checkBooleansResult(Boolean_1, model, 1, [2], [0], [2], [6], [12]) model.testHaveNamingSubshapes(Boolean_1, model, Part_1_doc) -model.checkBooleansResult(Boolean_2, model, 1, [0], [0], [1], [5], [10]) -model.testHaveNamingSubshapes(Boolean_2, model, Part_1_doc) - model.end() assert(model.checkPythonDump()) diff --git a/src/FeaturesPlugin/Test/TestFillSolidFace.py b/src/FeaturesPlugin/Test/TestFillSolidFace.py index 0e1c9c15f..ae29513b3 100644 --- a/src/FeaturesPlugin/Test/TestFillSolidFace.py +++ b/src/FeaturesPlugin/Test/TestFillSolidFace.py @@ -28,9 +28,9 @@ partSet = model.moduleDocument() Part_1 = model.addPart(partSet) Part_1_doc = Part_1.document() model.addParameter(Part_1_doc, "L", "10") -model.addParameter(Part_1_doc, "Shift", "5") +model.addParameter(Part_1_doc, "Shift", "12") Box_1 = model.addBox(Part_1_doc, "L", "L", "L") -Plane_4 = model.addPlane(Part_1_doc, model.selection("FACE", "Box_1_1/Bottom"), "Shift", True) +Plane_4 = model.addPlane(Part_1_doc, model.selection("FACE", "Box_1_1/Bottom"), "L/2", True) Sketch_1 = model.addSketch(Part_1_doc, model.selection("FACE", "Plane_1")) SketchProjection_1 = Sketch_1.addProjection(model.selection("VERTEX", "PartSet/Origin"), False) SketchPoint_1 = SketchProjection_1.createdFeature() @@ -46,14 +46,14 @@ 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(), "-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")]) Boolean_1 = model.addFill(Part_1_doc, [model.selection("SOLID", "Box_1_1")], [model.selection("FACE", "Face_1_1")]) model.do() -model.checkBooleansResult(Boolean_1, model, 1, [0], [1], [8], [39], [78]) +model.checkBooleansResult(Boolean_1, model, 1, [2], [2], [12], [48], [96]) model.testHaveNamingSubshapes(Boolean_1, model, Part_1_doc) model.end() -- 2.39.2