From ee63bacd24d19b3134c98e3c3185a22ac9e14fa1 Mon Sep 17 00:00:00 2001 From: mzn Date: Tue, 24 Jul 2018 14:17:24 +0300 Subject: [PATCH] Tests adjustment. --- test.models/bearing_puller.py | 30 +++++++++++++++--------------- test.models/bobine_film_reel.py | 4 ++-- test.models/flange.py | 22 +++++++++++----------- test.models/piece_12.py | 11 +++++------ 4 files changed, 33 insertions(+), 34 deletions(-) diff --git a/test.models/bearing_puller.py b/test.models/bearing_puller.py index 393843543..c6e7f6c47 100644 --- a/test.models/bearing_puller.py +++ b/test.models/bearing_puller.py @@ -228,9 +228,9 @@ SketchConstraintDistance_9 = Sketch_2.setDistance(SketchArc_9.center(), SketchPo SketchConstraintDistance_9.setName("SketchConstraintDistance_8") model.do() Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("WIRE", "Sketch_2/Wire-SketchLine_10r-SketchLine_11r-SketchArc_3_2f-SketchArc_4_2f"), model.selection("WIRE", "Sketch_2/Wire-SketchLine_14r-SketchArc_7_2f-SketchLine_15r-SketchArc_8_2f"), model.selection("FACE", "Sketch_2/Face-SketchLine_12r-SketchArc_5_2f-SketchLine_13r-SketchArc_6_2f"), model.selection("FACE", "Sketch_2/Face-SketchLine_19f-SketchLine_20f-SketchLine_21f-SketchArc_10_2f"), model.selection("FACE", "Sketch_2/Face-SketchLine_16f-SketchLine_17f-SketchLine_18f-SketchArc_9_2f"), model.selection("WIRE", "Sketch_2/Wire-SketchLine_22f-SketchLine_23f-SketchLine_24f-SketchArc_11_2f")], model.selection(), model.selection(), 10, model.selection("FACE", "Revolution_1_1/Generated_Face_5"), 10) -Boolean_1 = model.addCut(Part_1_doc, [model.selection("SOLID", "Revolution_1_1")], [model.selection("SOLID", "Extrusion_1_1"), model.selection("SOLID", "Extrusion_1_4"), model.selection("SOLID", "Extrusion_1_5")]) -Boolean_2 = model.addCut(Part_1_doc, [model.selection("SOLID", "Boolean_1_1")], [model.selection("SOLID", "Extrusion_1_2"), model.selection("SOLID", "Extrusion_1_3"), model.selection("SOLID", "Extrusion_1_6")]) -Plane_4 = model.addPlane(Part_1_doc, model.selection("FACE", "Boolean_2_1/Modified_Face_7"), model.selection("FACE", "Boolean_2_1/Modified_Face_9")) +Cut_1 = model.addCut(Part_1_doc, [model.selection("SOLID", "Revolution_1_1")], [model.selection("SOLID", "Extrusion_1_1"), model.selection("SOLID", "Extrusion_1_4"), model.selection("SOLID", "Extrusion_1_5")]) +Cut_2 = model.addCut(Part_1_doc, [model.selection("SOLID", "Cut_1_1")], [model.selection("SOLID", "Extrusion_1_2"), model.selection("SOLID", "Extrusion_1_3"), model.selection("SOLID", "Extrusion_1_6")]) +Plane_4 = model.addPlane(Part_1_doc, model.selection("FACE", "Cut_2_1/Modified_Face_7"), model.selection("FACE", "Cut_2_1/Modified_Face_9")) Sketch_3 = model.addSketch(Part_1_doc, model.selection("FACE", "Plane_1")) SketchCircle_3 = Sketch_3.addCircle(25, -10, 4) SketchCircle_4 = Sketch_3.addCircle(40, -10, 4) @@ -243,7 +243,7 @@ SketchConstraintDistance_10 = Sketch_3.setDistance(SketchCircle_3.center(), Sket SketchConstraintDistance_10.setName("SketchConstraintDistance_9") SketchConstraintDistance_11 = Sketch_3.setDistance(SketchCircle_4.center(), SketchLine_28.result(), 40) SketchConstraintDistance_11.setName("SketchConstraintDistance_10") -SketchProjection_1 = Sketch_3.addProjection(model.selection("EDGE", "Boolean_2_1/Modified_Face_17&Boolean_2_1/Modified_Face_7")) +SketchProjection_1 = Sketch_3.addProjection(model.selection("EDGE", "Cut_2_1/Modified_Face_17&Cut_2_1/Modified_Face_7")) SketchLine_29 = SketchProjection_1.createdFeature() SketchLine_29.setName("SketchLine_26") SketchLine_29.result().setName("SketchLine_26") @@ -252,14 +252,14 @@ SketchConstraintDistance_12.setName("SketchConstraintDistance_11") SketchConstraintDistance_13 = Sketch_3.setDistance(SketchCircle_3.center(), SketchLine_29.result(), 10) SketchConstraintDistance_13.setName("SketchConstraintDistance_12") model.do() -Extrusion_2 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_3/Face-SketchCircle_3_2f"), model.selection("WIRE", "Sketch_3/Wire-SketchCircle_4_2f")], model.selection(), model.selection("FACE", "Boolean_1_1/Modified_Face_6"), 5, model.selection("FACE", "Boolean_1_1/Modified_Face_8"), 5) -Boolean_3 = model.addCut(Part_1_doc, [model.selection("SOLID", "Boolean_2_1")], [model.selection("SOLID", "Extrusion_2_1"), model.selection("SOLID", "Extrusion_2_2")]) -Recover_1 = model.addRecover(Part_1_doc, Boolean_3, [Extrusion_2.results()[1], Extrusion_2.result()]) +Extrusion_2 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_3/Face-SketchCircle_3_2f"), model.selection("WIRE", "Sketch_3/Wire-SketchCircle_4_2f")], model.selection(), model.selection("FACE", "Cut_1_1/Modified_Face_6"), 5, model.selection("FACE", "Cut_1_1/Modified_Face_8"), 5) +Cut_3 = model.addCut(Part_1_doc, [model.selection("SOLID", "Cut_2_1")], [model.selection("SOLID", "Extrusion_2_1"), model.selection("SOLID", "Extrusion_2_2")]) +Recover_1 = model.addRecover(Part_1_doc, Cut_3, [Extrusion_2.results()[1], Extrusion_2.result()]) Rotation_1 = model.addRotation(Part_1_doc, [model.selection("SOLID", "Recover_1_1"), model.selection("SOLID", "Recover_1_2")], model.selection("EDGE", "PartSet/OZ"), 120) -Boolean_4 = model.addCut(Part_1_doc, [model.selection("SOLID", "Boolean_3_1")], [model.selection("SOLID", "Rotation_1_1"), model.selection("SOLID", "Rotation_1_2")]) -Recover_2 = model.addRecover(Part_1_doc, Boolean_4, [Rotation_1.results()[1], Rotation_1.result()]) +Cut_4 = model.addCut(Part_1_doc, [model.selection("SOLID", "Cut_3_1")], [model.selection("SOLID", "Rotation_1_1"), model.selection("SOLID", "Rotation_1_2")]) +Recover_2 = model.addRecover(Part_1_doc, Cut_4, [Rotation_1.results()[1], Rotation_1.result()]) Rotation_2 = model.addRotation(Part_1_doc, [model.selection("SOLID", "Recover_2_1"), model.selection("SOLID", "Recover_2_2")], model.selection("EDGE", "PartSet/OZ"), 120) -Boolean_5 = model.addCut(Part_1_doc, [model.selection("SOLID", "Boolean_4_1")], [model.selection("SOLID", "Rotation_2_2"), model.selection("SOLID", "Rotation_2_1")]) +Cut_5 = model.addCut(Part_1_doc, [model.selection("SOLID", "Cut_4_1")], [model.selection("SOLID", "Rotation_2_2"), model.selection("SOLID", "Rotation_2_1")]) model.do() Part_2 = model.addPart(partSet) Part_2.setName("Arm 1") @@ -499,10 +499,10 @@ Axis_4 = model.addAxis(Part_2_doc, model.selection("FACE", "PartSet/XOZ"), model Rotation_3 = model.addRotation(Part_2_doc, [model.selection("FACE", "Face_1_1")], model.selection("EDGE", "Axis_1"), -43.8752) Pipe_1 = model.addPipe(Part_2_doc, [model.selection("FACE", "Rotation_1_1")], model.selection("EDGE", "Sketch_2/Edge-SketchArc_3_2")) Extrusion_3 = model.addExtrusion(Part_2_doc, [model.selection("WIRE", "Sketch_2/Wire-SketchCircle_2_2f"), model.selection("WIRE", "Sketch_2/Wire-SketchLine_14r-SketchLine_15r-SketchLine_16r-SketchLine_17r")], model.selection(), "Gap/2", "Gap/2") -Boolean_6 = model.addFuse(Part_2_doc, [model.selection("SOLID", "Pipe_1_1")], [model.selection("SOLID", "Extrusion_1_1"), model.selection("SOLID", "Extrusion_1_2")]) +Fuse_1 = model.addFuse(Part_2_doc, [model.selection("SOLID", "Pipe_1_1")], [model.selection("SOLID", "Extrusion_1_1"), model.selection("SOLID", "Extrusion_1_2")]) Extrusion_4 = model.addExtrusion(Part_2_doc, [model.selection("FACE", "Sketch_2/Face-SketchCircle_3_2f")], model.selection(), "Gap", "Gap") -Boolean_7 = model.addCut(Part_2_doc, [model.selection("SOLID", "Boolean_1_1")], [model.selection("SOLID", "Extrusion_2_1")]) -Translation_1 = model.addTranslation(Part_2_doc, [model.selection("SOLID", "Boolean_2_1")], model.selection("VERTEX", "Sketch_2/Vertex-SketchArc_3_2s"), model.selection("VERTEX", "Sketch_2/Vertex-SketchLine_21e")) +Cut_1 = model.addCut(Part_2_doc, [model.selection("SOLID", "Fuse_1_1")], [model.selection("SOLID", "Extrusion_2_1")]) +Translation_1 = model.addTranslation(Part_2_doc, [model.selection("SOLID", "Cut_1_1")], model.selection("VERTEX", "Sketch_2/Vertex-SketchArc_3_2s"), model.selection("VERTEX", "Sketch_2/Vertex-SketchLine_21e")) model.do() Part_3 = model.duplicatePart(Part_2) Part_3.setName("Arm 2") @@ -597,8 +597,8 @@ SketchLine_111 = Sketch_12.addLine(model.selection("EDGE", "PartSet/OZ")) SketchConstraintDistance_37 = Sketch_12.setDistance(SketchLine_108.startPoint(), SketchLine_111.result(), 4) model.do() Revolution_3 = model.addRevolution(Part_5_doc, [model.selection("FACE", "Sketch_3/Face-SketchLine_14f-SketchLine_15f-SketchLine_16f")], model.selection("EDGE", "PartSet/OZ"), 360, 0) -Boolean_12 = model.addCut(Part_5_doc, [model.selection("SOLID", "Extrusion_1_1")], [model.selection("SOLID", "Revolution_2_1")]) -Boolean_13 = model.addFuse(Part_5_doc, [model.selection("SOLID", "Boolean_1_1"), model.selection("SOLID", "Revolution_1_1")], []) +Cut_12 = model.addCut(Part_5_doc, [model.selection("SOLID", "Extrusion_1_1")], [model.selection("SOLID", "Revolution_2_1")]) +Cut_13 = model.addFuse(Part_5_doc, [model.selection("SOLID", "Cut_1_1"), model.selection("SOLID", "Revolution_1_1")], []) # Test reexecution after parameter change Parameter_H.setValue(120) diff --git a/test.models/bobine_film_reel.py b/test.models/bobine_film_reel.py index f4dad7328..1fade828a 100644 --- a/test.models/bobine_film_reel.py +++ b/test.models/bobine_film_reel.py @@ -78,8 +78,8 @@ SketchConstraintRadius_5 = Sketch_5.setRadius(SketchCircle_5.results()[1], 8) SketchConstraintCoincidence_8 = Sketch_5.setCoincident(SketchAPI_Line(SketchLine_5).startPoint(), SketchCircle_5.center()) SketchConstraintCoincidence_8.setName("SketchConstraintCoincidence_16") Extrusion_5.setNestedSketch(Sketch_5) -Boolean_1 = model.addFuse(Part_1_doc, [model.selection("SOLID", "Extrusion_4_1"), model.selection("SOLID", "Extrusion_5_1"), model.selection("SOLID", "Extrusion_1_1"), model.selection("SOLID", "Extrusion_2_1"), model.selection("SOLID", "Extrusion_3_1")], []) -ExtrusionCut_1 = model.addExtrusionCut(Part_1_doc, [], model.selection(), model.selection("FACE", "Extrusion_5_1/To_Face_1"), 0, model.selection(), 0, [model.selection("SOLID", "Boolean_1_1")]) +Fuse_1 = model.addFuse(Part_1_doc, [model.selection("SOLID", "Extrusion_4_1"), model.selection("SOLID", "Extrusion_5_1"), model.selection("SOLID", "Extrusion_1_1"), model.selection("SOLID", "Extrusion_2_1"), model.selection("SOLID", "Extrusion_3_1")], []) +ExtrusionCut_1 = model.addExtrusionCut(Part_1_doc, [], model.selection(), model.selection("FACE", "Extrusion_5_1/To_Face_1"), 0, model.selection(), 0, [model.selection("SOLID", "Fuse_1_1")]) Sketch_6 = model.addSketch(Part_1_doc, model.selection("FACE", "Extrusion_1_1/From_Face_1")) SketchCircle_6 = Sketch_6.addCircle(0, 0, 4.2) SketchConstraintRadius_6 = Sketch_6.setRadius(SketchCircle_6.results()[1], 4.2) diff --git a/test.models/flange.py b/test.models/flange.py index 1015b0598..e3f64e294 100644 --- a/test.models/flange.py +++ b/test.models/flange.py @@ -80,7 +80,7 @@ SketchConstraintCoincidence_16 = Sketch_2.setCoincident(SketchArc_9.startPoint() SketchConstraintCoincidence_17 = Sketch_2.setCoincident(SketchArc_9.endPoint(), SketchLine_11.endPoint()) model.do() Revolution_1 = model.addRevolution(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchArc_9_2f-SketchLine_11f")], model.selection("EDGE", "PartSet/OZ"), 360, 0) -Boolean_1 = model.addCut(Part_1_doc, [model.selection("SOLID", "Extrusion_1_1")], [model.selection("SOLID", "Revolution_1_1")]) +Cut_1 = model.addCut(Part_1_doc, [model.selection("SOLID", "Extrusion_1_1")], [model.selection("SOLID", "Revolution_1_1")]) Sketch_3 = model.addSketch(Part_1_doc, model.selection("FACE", "PartSet/YOZ")) SketchLine_12 = Sketch_3.addLine(0, 106, -4, 106) SketchLine_13 = Sketch_3.addLine(-4, 106, -4, 67.34428877022477) @@ -111,7 +111,7 @@ SketchLine_16.result().setName("SketchLine_17") SketchConstraintCoincidence_22 = Sketch_3.setCoincident(SketchArc_10.endPoint(), SketchLine_16.result()) model.do() Extrusion_2 = model.addExtrusion(Part_1_doc, [model.selection("WIRE", "Sketch_3/Wire-SketchLine_12f-SketchLine_13f-SketchLine_17r-SketchLine_18r-SketchArc_10_2f")], model.selection(), "172/2", "172/2") -Boolean_2 = model.addCut(Part_1_doc, [model.selection("SOLID", "Boolean_1_1")], [model.selection("SOLID", "Extrusion_2_1")]) +Cut_2 = model.addCut(Part_1_doc, [model.selection("SOLID", "Cut_1_1")], [model.selection("SOLID", "Extrusion_2_1")]) Sketch_4 = model.addSketch(Part_1_doc, model.selection("FACE", "Extrusion_1_1/Generated_Face_10")) SketchLine_18 = Sketch_4.addLine(-65, 16, -65, -16) SketchLine_18.setName("SketchLine_19") @@ -151,7 +151,7 @@ SketchConstraintTangent_7 = Sketch_4.setTangent(SketchArc_12.results()[1], Sketc model.do() Extrusion_3 = model.addExtrusion(Part_1_doc, [model.selection("WIRE", "Sketch_4/Wire-SketchArc_11_2f-SketchArc_12_2f-SketchLine_21f-SketchLine_22r")], model.selection(), model.selection(), 0, model.selection("FACE", "Extrusion_1_1/Generated_Face_12"), 0) MultiTranslation_1 = model.addMultiTranslation(Part_1_doc, [model.selection("SOLID", "Extrusion_3_1")], model.selection("EDGE", "Extrusion_1_1/To_Face_1&Extrusion_1_1/Generated_Face_12"), -130, 2) -Boolean_3 = model.addCut(Part_1_doc, [model.selection("SOLID", "Boolean_2_1")], [model.selection("COMPOUND", "LinearCopy_1_1")]) +Cut_3 = model.addCut(Part_1_doc, [model.selection("SOLID", "Cut_2_1")], [model.selection("COMPOUND", "LinearCopy_1_1")]) model.do() # Test reexecution after parameter change @@ -159,7 +159,7 @@ Parameter_dint.setValue(62) Parameter_thick.setValue(20) Parameter_length.setValue(200) model.do() -model.testResultsVolumes(Boolean_3, [409550.515091864974237978458404541]) +model.testResultsVolumes(Cut_3, [409550.515091864974237978458404541]) Parameter_dint.setValue(58) Parameter_thick.setValue(16) Parameter_length.setValue(172) @@ -168,12 +168,12 @@ model.end() from GeomAPI import GeomAPI_Shape -model.testNbResults(Boolean_3, 1) -model.testNbSubResults(Boolean_3, [0]) -model.testNbSubShapes(Boolean_3, GeomAPI_Shape.SOLID, [1]) -model.testNbSubShapes(Boolean_3, GeomAPI_Shape.FACE, [32]) -model.testNbSubShapes(Boolean_3, GeomAPI_Shape.EDGE, [192]) -model.testNbSubShapes(Boolean_3, GeomAPI_Shape.VERTEX, [384]) -model.testResultsVolumes(Boolean_3, [307084.534467286430299282073974609]) +model.testNbResults(Cut_3, 1) +model.testNbSubResults(Cut_3, [0]) +model.testNbSubShapes(Cut_3, GeomAPI_Shape.SOLID, [1]) +model.testNbSubShapes(Cut_3, GeomAPI_Shape.FACE, [32]) +model.testNbSubShapes(Cut_3, GeomAPI_Shape.EDGE, [192]) +model.testNbSubShapes(Cut_3, GeomAPI_Shape.VERTEX, [384]) +model.testResultsVolumes(Cut_3, [307084.534467286430299282073974609]) assert(model.checkPythonDump()) diff --git a/test.models/piece_12.py b/test.models/piece_12.py index 1868b2b2d..391436d04 100644 --- a/test.models/piece_12.py +++ b/test.models/piece_12.py @@ -431,10 +431,9 @@ SketchConstraintDistance_14 = Sketch_3.setDistance(SketchLine_23.result(), Sketc SketchConstraintDistance_14.setName("SketchConstraintDistance_12") model.do() Extrusion_3 = model.addExtrusion(Part_1_doc, [model.selection("WIRE", "Sketch_3/Wire-SketchLine_9r-SketchLine_12r-SketchLine_14r-SketchLine_26r-SketchLine_27r-SketchLine_28r")], model.selection(), model.selection("FACE", "Extrusion_1_1/Generated_Face_3"), 0, model.selection(), 0) -Boolean_1 = model.addSmash(Part_1_doc, [model.selection("SOLID", "Extrusion_3_1")], [model.selection("SOLID", "ExtrusionCut_4_1")]) -ExtrusionCut_5 = model.addExtrusionCut(Part_1_doc, [model.selection("WIRE", "Sketch_3/Wire-SketchCircle_8_2f")], model.selection(), 10, 0, [model.selection("SOLID", "Boolean_1_1_1")]) +Smash_1 = model.addSmash(Part_1_doc, [model.selection("SOLID", "Extrusion_3_1")], [model.selection("SOLID", "ExtrusionCut_4_1")]) +ExtrusionCut_5 = model.addExtrusionCut(Part_1_doc, [model.selection("WIRE", "Sketch_3/Wire-SketchCircle_8_2f")], model.selection(), 10, 0, [model.selection("SOLID", "Smash_1_1_1")]) ExtrusionCut_6 = model.addExtrusionCut(Part_1_doc, [model.selection("FACE", "Sketch_3/Face-SketchCircle_8_2f")], model.selection(), 10, 0, [model.selection("SOLID", "ExtrusionCut_5_1_1")]) -Axis_4 = model.addAxis(Part_1_doc, model.selection("FACE", "ExtrusionCut_6_1_2/Modfied_1")) Sketch_4 = model.addSketch(Part_1_doc, model.selection("FACE", "Plane_1")) SketchProjection_7 = Sketch_4.addProjection(model.selection("EDGE", "PartSet/OY")) SketchLine_28 = SketchProjection_7.createdFeature() @@ -519,10 +518,10 @@ SketchConstraintLength_10 = Sketch_4.setLength(SketchLine_36.result(), 12.975642 SketchConstraintLength_10.setName("SketchConstraintLength_7") model.do() Extrusion_4 = model.addExtrusion(Part_1_doc, [model.selection("WIRE", "Sketch_4/Wire-SketchLine_19f-SketchLine_20f-SketchLine_24f-SketchLine_21f-SketchLine_22f-SketchLine_23f")], model.selection(), model.selection("FACE", "Extrusion_1_1/Generated_Face_1"), 0, model.selection(), 0) -Boolean_2 = model.addSmash(Part_1_doc, [model.selection("SOLID", "ExtrusionCut_6_1_1"), model.selection("SOLID", "Extrusion_4_1")], [model.selection("SOLID", "ExtrusionCut_6_1_2")]) -ExtrusionCut_7 = model.addExtrusionCut(Part_1_doc, [model.selection("FACE", "Sketch_4/Face-SketchCircle_9_2f")], model.selection(), 0, 10, [model.selection("SOLID", "Boolean_2_1_1")]) +Smash_2 = model.addSmash(Part_1_doc, [model.selection("SOLID", "ExtrusionCut_6_1_1"), model.selection("SOLID", "Extrusion_4_1")], [model.selection("SOLID", "ExtrusionCut_6_1_2")]) +ExtrusionCut_7 = model.addExtrusionCut(Part_1_doc, [model.selection("FACE", "Sketch_4/Face-SketchCircle_9_2f")], model.selection(), 0, 10, [model.selection("SOLID", "Smash_2_1_1")]) ExtrusionCut_8 = model.addExtrusionCut(Part_1_doc, [model.selection("FACE", "Sketch_4/Face-SketchCircle_9_2f")], model.selection(), 0, 10, [model.selection("SOLID", "ExtrusionCut_7_1_1")]) -Sketch_5 = model.addSketch(Part_1_doc, model.selection("FACE", "Boolean_2_1_1/Modified_Face_1")) +Sketch_5 = model.addSketch(Part_1_doc, model.selection("FACE", "Smash_2_1_1/Modified_Face_1")) SketchPoint_3 = Sketch_5.addPoint(model.selection("VERTEX", "PartSet/Origin")) SketchPoint_3.setName("SketchPoint_2") SketchPoint_3.result().setName("SketchPoint_2") -- 2.39.2