From: dbv Date: Thu, 25 Oct 2018 07:58:05 +0000 (+0300) Subject: Converted most of the features tests. X-Git-Tag: End2018~269 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=63b8fb5369c00637c57274850176e095a60a0e08;p=modules%2Fshaper.git Converted most of the features tests. --- diff --git a/src/FeaturesPlugin/Test/Test1379.py b/src/FeaturesPlugin/Test/Test1379.py index a9d0762a9..576c1e282 100644 --- a/src/FeaturesPlugin/Test/Test1379.py +++ b/src/FeaturesPlugin/Test/Test1379.py @@ -19,7 +19,6 @@ ## # -*- coding: utf-8 -*- -from SketchAPI import * from salome.shaper import model @@ -30,7 +29,7 @@ SketchProjection_1 = Sketch_1.addProjection(model.selection("EDGE", "OZ"), False SketchLine_1 = SketchProjection_1.createdFeature() SketchLine_1.setName("SketchLine_5") SketchLine_1.result().setName("SketchLine_5") -SketchLine_2 = Sketch_1.addLine(0.008, 0.0005000000000000006, 0.0075, -1.258295422426014e-035) +SketchLine_2 = Sketch_1.addLine(0.008, 0.0005000000000000006, 0.0075, -1.258295422426014e-35) SketchLine_2.setName("SketchLine_9") SketchLine_2.result().setName("SketchLine_9") SketchProjection_2 = Sketch_1.addProjection(model.selection("EDGE", "OX"), False) @@ -39,7 +38,7 @@ SketchLine_3.setName("SketchLine_10") SketchLine_3.result().setName("SketchLine_10") SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_2.endPoint(), SketchLine_3.result()) SketchConstraintCoincidence_1.setName("SketchConstraintCoincidence_12") -SketchLine_4 = Sketch_1.addLine(0.0075, -1.258295422426014e-035, 0.005, 0) +SketchLine_4 = Sketch_1.addLine(0.0075, -1.258295422426014e-35, 0.005, 0) SketchLine_4.setName("SketchLine_11") SketchLine_4.result().setName("SketchLine_11") SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchLine_2.endPoint(), SketchLine_4.startPoint()) @@ -60,7 +59,7 @@ SketchConstraintVertical_1 = Sketch_1.setVertical(SketchLine_5.result()) SketchConstraintVertical_1.setName("SketchConstraintVertical_3") SketchConstraintHorizontal_1 = Sketch_1.setHorizontal(SketchLine_6.result()) SketchConstraintHorizontal_1.setName("SketchConstraintHorizontal_3") -SketchConstraintAngle_1 = Sketch_1.setAngle(SketchLine_3.result(), SketchLine_2.result(), 45) +SketchConstraintAngle_1 = Sketch_1.setAngle(SketchLine_3.result(), SketchLine_2.result(), 45.00000000000001) SketchConstraintLength_1 = Sketch_1.setLength(SketchLine_5.result(), 0.02) SketchConstraintLength_2 = Sketch_1.setLength(SketchLine_6.result(), 0.005) SketchConstraintLength_2.setName("SketchConstraintLength_4") @@ -95,14 +94,14 @@ SketchLine_11.setName("SketchLine_16") SketchLine_11.result().setName("SketchLine_16") SketchConstraintCoincidence_12 = Sketch_1.setCoincident(SketchLine_10.endPoint(), SketchLine_11.startPoint()) SketchConstraintCoincidence_12.setName("SketchConstraintCoincidence_17") -SketchLine_12 = Sketch_1.addLine(0.008999999999999999, 0.042, -5.446629538236431e-036, 0.042) +SketchLine_12 = Sketch_1.addLine(0.008999999999999999, 0.042, -5.446629538236431e-36, 0.042) SketchLine_12.setName("SketchLine_17") SketchLine_12.result().setName("SketchLine_17") SketchConstraintCoincidence_13 = Sketch_1.setCoincident(SketchLine_11.endPoint(), SketchLine_12.startPoint()) SketchConstraintCoincidence_13.setName("SketchConstraintCoincidence_18") SketchConstraintCoincidence_14 = Sketch_1.setCoincident(SketchLine_12.endPoint(), SketchLine_1.result()) SketchConstraintCoincidence_14.setName("SketchConstraintCoincidence_19") -SketchLine_13 = Sketch_1.addLine(-5.446629538236431e-036, 0.042, 0, 0.02) +SketchLine_13 = Sketch_1.addLine(-5.446629538236431e-36, 0.042, 0, 0.02) SketchLine_13.setName("SketchLine_18") SketchLine_13.result().setName("SketchLine_18") SketchConstraintCoincidence_15 = Sketch_1.setCoincident(SketchLine_12.endPoint(), SketchLine_13.startPoint()) @@ -141,16 +140,16 @@ SketchConstraintCoincidence_17.setName("SketchConstraintCoincidence_22") model.do() Part_1 = model.addPart(partSet) Part_1_doc = Part_1.document() -Revolution_1 = model.addRevolution(Part_1_doc, [model.selection("FACE", "PartSet/Sketch_1/Face-SketchLine_9r-SketchLine_11r-SketchLine_12r-SketchLine_13r-SketchLine_7f-SketchLine_8f-SketchArc_1_2r-SketchLine_14f-SketchArc_2_2r-SketchLine_15f-SketchLine_16f-SketchLine_17f-SketchLine_18f")], model.selection("EDGE", "PartSet/OZ"), 360, 0) +Revolution_1 = model.addRevolution(Part_1_doc, [model.selection("FACE", "PartSet/Sketch_1/Face-SketchLine_7f-SketchLine_8f-SketchArc_1_2r-SketchLine_14f-SketchArc_2_2r-SketchLine_15f-SketchLine_16f-SketchLine_17f-SketchLine_18f-SketchLine_13r-SketchLine_12r-SketchLine_11r-SketchLine_9r")], model.selection("EDGE", "PartSet/OZ"), 360, 0) Sketch_2 = model.addSketch(Part_1_doc, model.standardPlane("XOZ")) -SketchLine_14 = Sketch_2.addLine(-5.446629538236431e-036, 0.042, 5.172728347136208e-022, 0.03963932022500211) -SketchProjection_3 = Sketch_2.addProjection(model.selection("VERTEX", "PartSet/Sketch_1/Vertex-SketchLine_18s-SketchLine_17e"), False) +SketchLine_14 = Sketch_2.addLine(-5.446629538236431e-36, 0.042, 5.172728347136208e-22, 0.03963932022500211) +SketchProjection_3 = Sketch_2.addProjection(model.selection("VERTEX", "PartSet/Sketch_1/SketchLine_17_EndVertex"), False) SketchPoint_1 = SketchProjection_3.createdFeature() SketchConstraintCoincidence_18 = Sketch_2.setCoincident(SketchLine_14.startPoint(), SketchPoint_1.result()) -SketchProjection_4 = Sketch_2.addProjection(model.selection("EDGE", "PartSet/Sketch_1/Edge-SketchLine_18"), False) +SketchProjection_4 = Sketch_2.addProjection(model.selection("EDGE", "PartSet/Sketch_1/SketchLine_18"), False) SketchLine_15 = SketchProjection_4.createdFeature() SketchConstraintCoincidence_19 = Sketch_2.setCoincident(SketchLine_14.endPoint(), SketchLine_15.result()) -SketchArc_3 = Sketch_2.addArc(0.02, 0.062, 5.172728347136208e-022, 0.03963932022500211, 0.02, 0.032, False) +SketchArc_3 = Sketch_2.addArc(0.02, 0.062, 5.172728347136208e-22, 0.03963932022500211, 0.02, 0.032, False) SketchConstraintCoincidence_20 = Sketch_2.setCoincident(SketchLine_14.endPoint(), SketchArc_3.startPoint()) SketchLine_16 = Sketch_2.addLine(0.02, 0.032, 0.02, 0.042) SketchConstraintCoincidence_21 = Sketch_2.setCoincident(SketchArc_3.endPoint(), SketchLine_16.startPoint()) @@ -166,9 +165,9 @@ SketchProjection_5 = Sketch_2.addProjection(model.selection("EDGE", "PartSet/OX" SketchLine_18 = SketchProjection_5.createdFeature() SketchConstraintDistance_7 = Sketch_2.setDistance(SketchLine_18.result(), SketchArc_3.center(), 0.062, True) model.do() -Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_1f-SketchArc_1_2f-SketchLine_3f-SketchLine_4f")], model.selection(), 0.008999999999999999, 0.008999999999999999) +Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_1r-SketchArc_1_2f-SketchLine_3f-SketchLine_4f")], model.selection(), 0.008999999999999999, 0.008999999999999999) Fuse_1 = model.addFuse(Part_1_doc, [model.selection("SOLID", "Revolution_1_1")], [model.selection("SOLID", "Extrusion_1_1")]) -Axis_4 = model.addAxis(Part_1_doc, model.selection("FACE", "Revolution_1_1/Generated_Face_13")) +Axis_4 = model.addAxis(Part_1_doc, model.selection("FACE", "Revolution_1_1/Generated_Face&weak_name_4")) RevolutionCut_1 = model.addRevolutionCut(Part_1_doc, [], model.selection("EDGE", "PartSet/OZ"), 10, 28, [model.selection("SOLID", "Fuse_1_1")]) Sketch_3 = model.addSketch(Part_1_doc, model.standardPlane("XOZ")) SketchLine_19 = Sketch_3.addLine(0.029, 0.042, 0.029, 0.03267384683690003) @@ -183,7 +182,7 @@ SketchConstraintVertical_6 = Sketch_3.setVertical(SketchLine_19.result()) SketchLine_21 = Sketch_3.addLine(0.008999999999999999, 0.042, 0.029, 0.042) SketchLine_21.setName("SketchLine_9") SketchLine_21.result().setName("SketchLine_9") -SketchProjection_6 = Sketch_3.addProjection(model.selection("EDGE", "Sketch_1/Edge-SketchLine_4"), False) +SketchProjection_6 = Sketch_3.addProjection(model.selection("EDGE", "Sketch_1/SketchLine_4"), False) SketchLine_22 = SketchProjection_6.createdFeature() SketchLine_22.setName("SketchLine_10") SketchLine_22.result().setName("SketchLine_10") @@ -195,9 +194,11 @@ SketchConstraintCoincidence_27 = Sketch_3.setCoincident(SketchLine_21.startPoint SketchConstraintCoincidence_27.setName("SketchConstraintCoincidence_11") SketchConstraintHorizontal_6 = Sketch_3.setHorizontal(SketchLine_21.result()) SketchConstraintAngle_2 = Sketch_3.setAngle(SketchLine_20.result(), SketchLine_21.result(), 25) -SketchProjection_7 = Sketch_3.addProjection(model.selection("VERTEX", "PartSet/Sketch_1/Vertex-SketchLine_17s-SketchLine_16e"), False) +SketchProjection_7 = Sketch_3.addProjection(model.selection("VERTEX", "PartSet/Sketch_1/SketchLine_16_EndVertex"), False) +SketchPoint_2 = SketchProjection_7.createdFeature() SketchConstraintLength_6 = Sketch_3.setLength(SketchLine_21.result(), 0.02) RevolutionCut_1.setNestedSketch(Sketch_3) +model.do() model.end() # check that result was created diff --git a/src/FeaturesPlugin/Test/Test1467.py b/src/FeaturesPlugin/Test/Test1467.py index 9347af3ff..70dac9592 100644 --- a/src/FeaturesPlugin/Test/Test1467.py +++ b/src/FeaturesPlugin/Test/Test1467.py @@ -18,15 +18,14 @@ ## email : webmaster.salome@opencascade.com ## +# -*- coding: utf-8 -*- + from salome.shaper import model -# Create document model.begin() partSet = model.moduleDocument() Part_1 = model.addPart(partSet) Part_1_doc = Part_1.document() - -# Create base and path for pipe Point_2 = model.addPoint(Part_1_doc, 5, 20, 0) Point_3 = model.addPoint(Part_1_doc, 0, 40, 30) Point_4 = model.addPoint(Part_1_doc, 10, 50, 70) @@ -59,7 +58,7 @@ SketchConstraintTangent_2 = Sketch_1.setTangent(SketchArc_2.results()[1], Sketch SketchConstraintRigid_1 = Sketch_1.setFixed(SketchArc_1.startPoint()) SketchConstraintRigid_2 = Sketch_1.setFixed(SketchLine_2.endPoint()) model.do() -Wire_1_objects = [model.selection("EDGE", "Sketch_1/Edge-SketchArc_2_2"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_1"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_3"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_4"), model.selection("EDGE", "Sketch_1/Edge-SketchArc_1_2")] +Wire_1_objects = [model.selection("EDGE", "Sketch_1/SketchArc_2_2"), model.selection("EDGE", "Sketch_1/SketchLine_1"), model.selection("EDGE", "Sketch_1/SketchLine_3"), model.selection("EDGE", "Sketch_1/SketchLine_4"), model.selection("EDGE", "Sketch_1/SketchArc_1_2")] Wire_1 = model.addWire(Part_1_doc, Wire_1_objects) Sketch_2 = model.addSketch(Part_1_doc, model.standardPlane("XOY")) SketchLine_4 = Sketch_2.addLine(9.525599451781, 2.539525405208, -21.231656152164, 2.539525405208) @@ -87,18 +86,11 @@ SketchConstraintVertical_1 = Sketch_2.setVertical(SketchLine_5.result()) SketchConstraintHorizontal_2 = Sketch_2.setHorizontal(SketchLine_6.result()) SketchConstraintVertical_2 = Sketch_2.setVertical(SketchLine_7.result()) model.do() - -# Create pipe on the entire path (big pipe) Pipe_1 = model.addPipe(Part_1_doc, [model.selection("COMPOUND", "Sketch_2")], model.selection("WIRE", "Wire_1_1")) - -# Create pipe on the fisrt segment of the path (small pipe) -Pipe_2 = model.addPipe(Part_1_doc, [model.selection("COMPOUND", "Sketch_2")], model.selection("EDGE", "Sketch_1/Edge-SketchArc_2_2")) - -# Cut big pipe from the small pipe +Pipe_2 = model.addPipe(Part_1_doc, [model.selection("COMPOUND", "Sketch_2")], model.selection("EDGE", "Sketch_1/SketchArc_2_2")) Cut_1 = model.addCut(Part_1_doc, [model.selection("SOLID", "Pipe_2_1")], [model.selection("SOLID", "Pipe_1_1")]) model.do() +model.end() # Check that the small pipe is a part of the big one assert(len(Cut_1.results()) == 0) - -model.end() diff --git a/src/FeaturesPlugin/Test/Test1816.py b/src/FeaturesPlugin/Test/Test1816.py index 3fe9e47ee..33e29d18f 100644 --- a/src/FeaturesPlugin/Test/Test1816.py +++ b/src/FeaturesPlugin/Test/Test1816.py @@ -60,28 +60,28 @@ SketchConstraintLength_1 = Sketch_1.setLength(SketchLine_1.result(), "Lgz") SketchConstraintLength_2 = Sketch_1.setLength(SketchLine_6.result(), "Lgx") SketchConstraintRadius_1 = Sketch_1.setRadius(SketchArc_1.results()[1], "Ray") model.do() -Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_1r-SketchLine_3r-SketchArc_1_2f-SketchLine_4r-SketchLine_6r")], model.selection(), 0, "Lgy") -Sketch_2 = model.addSketch(Part_1_doc, model.selection("FACE", "Extrusion_1_1/Generated_Face_1")) +Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_6r-SketchLine_4r-SketchArc_1_2f-SketchLine_3r-SketchLine_1r")], model.selection(), 0, "Lgy") +Sketch_2 = model.addSketch(Part_1_doc, model.selection("FACE", "Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_1")) SketchLine_7 = Sketch_2.addLine(0, -75, 0, 0) -SketchProjection_4 = Sketch_2.addProjection(model.selection("VERTEX", "Sketch_1/Vertex-SketchLine_3s-SketchLine_1e"), False) +SketchProjection_4 = Sketch_2.addProjection(model.selection("VERTEX", "Sketch_1/SketchLine_1_EndVertex"), False) SketchPoint_2 = SketchProjection_4.createdFeature() SketchConstraintCoincidence_9 = Sketch_2.setCoincident(SketchLine_7.startPoint(), SketchPoint_2.result()) -SketchProjection_5 = Sketch_2.addProjection(model.selection("VERTEX", "Extrusion_1_1/Generated_Face_5&Extrusion_1_1/Generated_Face_1&Extrusion_1_1/To_Face_1"), False) +SketchProjection_5 = Sketch_2.addProjection(model.selection("VERTEX", "[Extrusion_1_1/To_Face][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_6][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_1]"), False) SketchPoint_3 = SketchProjection_5.createdFeature() SketchConstraintCoincidence_10 = Sketch_2.setCoincident(SketchLine_7.endPoint(), SketchPoint_3.result()) SketchLine_8 = Sketch_2.addLine(0, 0, 60, 0) SketchConstraintCoincidence_11 = Sketch_2.setCoincident(SketchLine_7.endPoint(), SketchLine_8.startPoint()) -SketchProjection_6 = Sketch_2.addProjection(model.selection("VERTEX", "Extrusion_1_1/Generated_Face_5&Extrusion_1_1/Generated_Face_1&Extrusion_1_1/From_Face_1"), False) +SketchProjection_6 = Sketch_2.addProjection(model.selection("VERTEX", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_6][Extrusion_1_1/From_Face][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_1]"), False) SketchPoint_4 = SketchProjection_6.createdFeature() SketchConstraintCoincidence_12 = Sketch_2.setCoincident(SketchLine_8.endPoint(), SketchPoint_4.result()) SketchLine_9 = Sketch_2.addLine(60, 0, 59.99999999999999, -62.5) SketchConstraintCoincidence_13 = Sketch_2.setCoincident(SketchLine_8.endPoint(), SketchLine_9.startPoint()) -SketchProjection_7 = Sketch_2.addProjection(model.selection("EDGE", "Extrusion_1_1/Generated_Face_1&Extrusion_1_1/From_Face_1"), False) +SketchProjection_7 = Sketch_2.addProjection(model.selection("EDGE", "[Extrusion_1_1/From_Face][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_1]"), False) SketchLine_10 = SketchProjection_7.createdFeature() SketchConstraintCoincidence_14 = Sketch_2.setCoincident(SketchLine_9.endPoint(), SketchLine_10.result()) SketchLine_11 = Sketch_2.addLine(0, -75, 47.49999999999999, -75) SketchConstraintCoincidence_15 = Sketch_2.setCoincident(SketchLine_7.startPoint(), SketchLine_11.startPoint()) -SketchProjection_8 = Sketch_2.addProjection(model.selection("EDGE", "Extrusion_1_1/Generated_Face_2&Extrusion_1_1/Generated_Face_1"), False) +SketchProjection_8 = Sketch_2.addProjection(model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_1][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_3]"), False) SketchLine_12 = SketchProjection_8.createdFeature() SketchConstraintCoincidence_16 = Sketch_2.setCoincident(SketchLine_11.endPoint(), SketchLine_12.result()) SketchArc_2 = Sketch_2.addArc(47.49999999999999, -62.5, 59.99999999999999, -62.5, 47.49999999999999, -75, True) @@ -91,8 +91,9 @@ SketchConstraintCoincidence_18 = Sketch_2.setCoincident(SketchArc_2.endPoint(), SketchConstraintTangent_3 = Sketch_2.setTangent(SketchArc_2.results()[1], SketchLine_11.result()) SketchConstraintTangent_4 = Sketch_2.setTangent(SketchLine_9.result(), SketchArc_2.results()[1]) model.do() -Extrusion_2 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchLine_7r-SketchLine_8r-SketchLine_9r-SketchLine_11f-SketchArc_2_2f")], model.selection(), 0, "Lgx") +Extrusion_2 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchLine_11f-SketchArc_2_2f-SketchLine_9r-SketchLine_8r-SketchLine_7r")], model.selection(), 0, "Lgx") Common_1 = model.addCommon(Part_1_doc, [model.selection("SOLID", "Extrusion_1_1"), model.selection("SOLID", "Extrusion_2_1")]) +model.do() model.end() assert(len(Common_1.results()) == 1) diff --git a/src/FeaturesPlugin/Test/Test1915.py b/src/FeaturesPlugin/Test/Test1915.py index 3d4de21bf..388ccab83 100644 --- a/src/FeaturesPlugin/Test/Test1915.py +++ b/src/FeaturesPlugin/Test/Test1915.py @@ -18,6 +18,8 @@ ## email : webmaster.salome@opencascade.com ## +# -*- coding: utf-8 -*- + from salome.shaper import model model.begin() @@ -33,7 +35,8 @@ Sketch_2 = model.addSketch(Part_1_doc, model.defaultPlane("XOY")) SketchCircle_2 = Sketch_2.addCircle(-111.0503834053735, -148.4878232655183, 89.21253106334201) model.do() Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("COMPOUND", "Sketch_1"), model.selection("COMPOUND", "Sketch_2")], model.selection(), 10, 0) -Boolean_1 = model.addCut(Part_1_doc, [model.selection("SOLID", "Extrusion_1_2_2"), model.selection("SOLID", "Extrusion_1_2_1")], [model.selection("SOLID", "Extrusion_1_1")]) +Cut_1 = model.addCut(Part_1_doc, [model.selection("SOLID", "Extrusion_1_2_2"), model.selection("SOLID", "Extrusion_1_2_1")], [model.selection("SOLID", "Extrusion_1_1")]) +model.do() model.end() assert(model.checkPythonDump()) diff --git a/src/FeaturesPlugin/Test/Test1922.py b/src/FeaturesPlugin/Test/Test1922.py index 8b1fc660b..2191da481 100644 --- a/src/FeaturesPlugin/Test/Test1922.py +++ b/src/FeaturesPlugin/Test/Test1922.py @@ -18,7 +18,8 @@ ## email : webmaster.salome@opencascade.com ## -from ModelAPI import * +# -*- coding: utf-8 -*- + from salome.shaper import model model.begin() @@ -90,45 +91,47 @@ SketchPoint_11 = Sketch_1.addPoint(-342.6051560379917, -180.9380775505472) SketchPoint_11.setName("SketchPoint_13") SketchPoint_11.result().setName("SketchPoint_13") SketchConstraintCoincidence_17 = Sketch_1.setCoincident(SketchPoint_11.coordinates(), SketchLine_5.result()) -SketchPoint_12 = Sketch_1.addPoint(-584.124830393487, -180.9380775505472) +SketchPoint_12 = Sketch_1.addPoint(-584.1248303934869, -180.9380775505472) SketchPoint_12.setName("SketchPoint_14") SketchPoint_12.result().setName("SketchPoint_14") SketchConstraintCoincidence_18 = Sketch_1.setCoincident(SketchPoint_12.coordinates(), SketchLine_5.result()) model.do() -Vertex_1 = model.addVertex(Part_1_doc, [model.selection("VERTEX", "Sketch_1/Vertex-SketchLine_6s-SketchLine_5e"), model.selection("VERTEX", "Sketch_1/Vertex-SketchPoint_7"), model.selection("VERTEX", "Sketch_1/Vertex-SketchLine_5s-SketchLine_4e"), model.selection("VERTEX", "Sketch_1/Vertex-SketchPoint_11"), model.selection("VERTEX", "Sketch_1/Vertex-SketchLine_3s-SketchLine_2e"), model.selection("VERTEX", "Sketch_1/Vertex-SketchPoint_10"), model.selection("VERTEX", "Sketch_1/Vertex-SketchPoint_8"), model.selection("VERTEX", "Sketch_1/Vertex-SketchPoint_9"), model.selection("VERTEX", "Sketch_1/Vertex-SketchLine_2s-SketchLine_1e"), model.selection("VERTEX", "Sketch_1/Vertex-SketchLine_4s-SketchLine_3e"), model.selection("VERTEX", "Sketch_1/Vertex-SketchPoint_13"), model.selection("VERTEX", "Sketch_1/Vertex-SketchLine_1s-SketchLine_6e"), model.selection("VERTEX", "Sketch_1/Vertex-SketchPoint_14"), model.selection("VERTEX", "Sketch_1/Vertex-SketchPoint_2"), model.selection("VERTEX", "Sketch_1/Vertex-SketchPoint_6"), model.selection("VERTEX", "Sketch_1/Vertex-SketchPoint_1"), model.selection("VERTEX", "Sketch_1/Vertex-SketchPoint_4"), model.selection("VERTEX", "Sketch_1/Vertex-SketchPoint_5")]) -Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("VERTEX", "Vertex_1_1"), model.selection("VERTEX", "Vertex_1_2"), model.selection("VERTEX", "Vertex_1_3"), model.selection("VERTEX", "Vertex_1_4"), model.selection("VERTEX", "Vertex_1_5"), model.selection("VERTEX", "Vertex_1_6"), model.selection("VERTEX", "Vertex_1_7"), model.selection("VERTEX", "Vertex_1_8"), model.selection("VERTEX", "Vertex_1_9"), model.selection("VERTEX", "Vertex_1_10"), model.selection("VERTEX", "Vertex_1_11"), model.selection("VERTEX", "Vertex_1_12"), model.selection("VERTEX", "Vertex_1_13"), model.selection("VERTEX", "Vertex_1_14"), model.selection("VERTEX", "Vertex_1_15"), model.selection("VERTEX", "Vertex_1_16"), model.selection("VERTEX", "Vertex_1_17"), model.selection("VERTEX", "Vertex_1_18")], model.selection("EDGE", "PartSet/OZ"), 100, 0) -Plane_4 = model.addPlane(Part_1_doc, model.selection("VERTEX", "Extrusion_1_12/To_Vertex_1"), model.selection("VERTEX", "Extrusion_1_13/To_Vertex_1"), model.selection("VERTEX", "Extrusion_1_3/To_Vertex_1")) +Vertex_1_objects = [model.selection("VERTEX", "Sketch_1/SketchLine_5_EndVertex"), model.selection("VERTEX", "Sketch_1/SketchPoint_7"), model.selection("VERTEX", "Sketch_1/SketchLine_4_EndVertex"), model.selection("VERTEX", "Sketch_1/SketchPoint_11"), model.selection("VERTEX", "Sketch_1/SketchLine_2_EndVertex"), model.selection("VERTEX", "Sketch_1/SketchPoint_10"), model.selection("VERTEX", "Sketch_1/SketchPoint_8"), model.selection("VERTEX", "Sketch_1/SketchPoint_9"), model.selection("VERTEX", "Sketch_1/SketchLine_1_EndVertex"), model.selection("VERTEX", "Sketch_1/SketchLine_3_EndVertex"), model.selection("VERTEX", "Sketch_1/SketchPoint_13"), model.selection("VERTEX", "Sketch_1/SketchLine_1_StartVertex"), model.selection("VERTEX", "Sketch_1/SketchPoint_14"), model.selection("VERTEX", "Sketch_1/SketchPoint_2"), model.selection("VERTEX", "Sketch_1/SketchPoint_6"), model.selection("VERTEX", "Sketch_1/SketchPoint_1"), model.selection("VERTEX", "Sketch_1/SketchPoint_4"), model.selection("VERTEX", "Sketch_1/SketchPoint_5")] +Vertex_1 = model.addVertex(Part_1_doc, Vertex_1_objects) +Extrusion_1_objects = [model.selection("VERTEX", "Vertex_1_1"), model.selection("VERTEX", "Vertex_1_2"), model.selection("VERTEX", "Vertex_1_3"), model.selection("VERTEX", "Vertex_1_4"), model.selection("VERTEX", "Vertex_1_5"), model.selection("VERTEX", "Vertex_1_6"), model.selection("VERTEX", "Vertex_1_7"), model.selection("VERTEX", "Vertex_1_8"), model.selection("VERTEX", "Vertex_1_9"), model.selection("VERTEX", "Vertex_1_10"), model.selection("VERTEX", "Vertex_1_11"), model.selection("VERTEX", "Vertex_1_12"), model.selection("VERTEX", "Vertex_1_13"), model.selection("VERTEX", "Vertex_1_14"), model.selection("VERTEX", "Vertex_1_15"), model.selection("VERTEX", "Vertex_1_16"), model.selection("VERTEX", "Vertex_1_17"), model.selection("VERTEX", "Vertex_1_18")] +Extrusion_1 = model.addExtrusion(Part_1_doc, Extrusion_1_objects, model.selection("EDGE", "PartSet/OZ"), 100, 0) +Plane_4 = model.addPlane(Part_1_doc, model.selection("VERTEX", "Extrusion_1_12/To_Vertex"), model.selection("VERTEX", "Extrusion_1_13/To_Vertex"), model.selection("VERTEX", "Extrusion_1_3/To_Vertex")) Sketch_2 = model.addSketch(Part_1_doc, model.selection("FACE", "Plane_1")) SketchLine_7 = Sketch_2.addLine(-717.0963364993213, -45.06817090071282, -717.0963364993213, -180.9380775505473) -SketchPoint_13 = Sketch_2.addPoint(model.selection("VERTEX", "Extrusion_1_12/To_Vertex_1")) +SketchPoint_13 = Sketch_2.addPoint(model.selection("VERTEX", "Extrusion_1_12/To_Vertex")) SketchPoint_13.setName("SketchPoint_15") SketchPoint_13.result().setName("SketchPoint_15") SketchConstraintCoincidence_19 = Sketch_2.setCoincident(SketchLine_7.startPoint(), SketchPoint_13.result()) -SketchPoint_14 = Sketch_2.addPoint(model.selection("VERTEX", "Extrusion_1_1/To_Vertex_1")) +SketchPoint_14 = Sketch_2.addPoint(model.selection("VERTEX", "Extrusion_1_1/To_Vertex")) SketchPoint_14.setName("SketchPoint_16") SketchPoint_14.result().setName("SketchPoint_16") SketchConstraintCoincidence_20 = Sketch_2.setCoincident(SketchLine_7.endPoint(), SketchPoint_14.result()) SketchLine_8 = Sketch_2.addLine(-717.0963364993213, -180.9380775505473, -102.0809741405142, -180.9380775505473) SketchConstraintCoincidence_21 = Sketch_2.setCoincident(SketchLine_7.endPoint(), SketchLine_8.startPoint()) -SketchPoint_15 = Sketch_2.addPoint(model.selection("VERTEX", "Extrusion_1_3/To_Vertex_1")) +SketchPoint_15 = Sketch_2.addPoint(model.selection("VERTEX", "Extrusion_1_3/To_Vertex")) SketchPoint_15.setName("SketchPoint_17") SketchPoint_15.result().setName("SketchPoint_17") SketchConstraintCoincidence_22 = Sketch_2.setCoincident(SketchLine_8.endPoint(), SketchPoint_15.result()) SketchLine_9 = Sketch_2.addLine(-102.0809741405142, -180.9380775505473, -102.0809741405142, 193.0685819822336) SketchConstraintCoincidence_23 = Sketch_2.setCoincident(SketchLine_8.endPoint(), SketchLine_9.startPoint()) -SketchPoint_16 = Sketch_2.addPoint(model.selection("VERTEX", "Extrusion_1_10/To_Vertex_1")) +SketchPoint_16 = Sketch_2.addPoint(model.selection("VERTEX", "Extrusion_1_10/To_Vertex")) SketchPoint_16.setName("SketchPoint_18") SketchPoint_16.result().setName("SketchPoint_18") SketchConstraintCoincidence_24 = Sketch_2.setCoincident(SketchLine_9.endPoint(), SketchPoint_16.result()) SketchLine_10 = Sketch_2.addLine(-102.0809741405142, 193.0685819822336, -254.8675173043772, 193.0685819822336) SketchConstraintCoincidence_25 = Sketch_2.setCoincident(SketchLine_9.endPoint(), SketchLine_10.startPoint()) -SketchPoint_17 = Sketch_2.addPoint(model.selection("VERTEX", "Extrusion_1_5/To_Vertex_1")) +SketchPoint_17 = Sketch_2.addPoint(model.selection("VERTEX", "Extrusion_1_5/To_Vertex")) SketchPoint_17.setName("SketchPoint_19") SketchPoint_17.result().setName("SketchPoint_19") SketchConstraintCoincidence_26 = Sketch_2.setCoincident(SketchLine_10.endPoint(), SketchPoint_17.result()) SketchLine_11 = Sketch_2.addLine(-254.8675173043772, 193.0685819822336, -254.8675173043772, -45.06817090071281) SketchConstraintCoincidence_27 = Sketch_2.setCoincident(SketchLine_10.endPoint(), SketchLine_11.startPoint()) -SketchPoint_18 = Sketch_2.addPoint(model.selection("VERTEX", "Extrusion_1_9/To_Vertex_1")) +SketchPoint_18 = Sketch_2.addPoint(model.selection("VERTEX", "Extrusion_1_9/To_Vertex")) SketchPoint_18.setName("SketchPoint_20") SketchPoint_18.result().setName("SketchPoint_20") SketchConstraintCoincidence_28 = Sketch_2.setCoincident(SketchLine_11.endPoint(), SketchPoint_18.result()) @@ -136,18 +139,18 @@ SketchLine_12 = Sketch_2.addLine(-254.8675173043772, -45.06817090071281, -717.09 SketchConstraintCoincidence_29 = Sketch_2.setCoincident(SketchLine_11.endPoint(), SketchLine_12.startPoint()) SketchConstraintCoincidence_30 = Sketch_2.setCoincident(SketchLine_7.startPoint(), SketchLine_12.endPoint()) SketchConstraintCoincidence_31 = Sketch_2.setCoincident(SketchPoint_13.coordinates(), SketchLine_12.endPoint()) -SketchLine_13 = Sketch_2.addLine(-599.2405881202537, -45.06817090071282, -584.124830393487, -180.9380775505472) +SketchLine_13 = Sketch_2.addLine(-599.2405881202537, -45.06817090071282, -584.1248303934869, -180.9380775505472) SketchConstraintCoincidence_32 = Sketch_2.setCoincident(SketchLine_13.startPoint(), SketchLine_12.result()) -SketchPoint_19 = Sketch_2.addPoint(model.selection("VERTEX", "Extrusion_1_13/To_Vertex_1")) +SketchPoint_19 = Sketch_2.addPoint(model.selection("VERTEX", "Extrusion_1_13/To_Vertex")) SketchPoint_19.setName("SketchPoint_21") SketchPoint_19.result().setName("SketchPoint_21") SketchConstraintCoincidence_33 = Sketch_2.setCoincident(SketchLine_13.endPoint(), SketchPoint_19.result()) SketchLine_14 = Sketch_2.addLine(-356.1736770691994, -45.06817090071282, -342.6051560379917, -180.9380775505472) -SketchPoint_20 = Sketch_2.addPoint(model.selection("VERTEX", "Extrusion_1_15/To_Vertex_1")) +SketchPoint_20 = Sketch_2.addPoint(model.selection("VERTEX", "Extrusion_1_15/To_Vertex")) SketchPoint_20.setName("SketchPoint_22") SketchPoint_20.result().setName("SketchPoint_22") SketchConstraintCoincidence_34 = Sketch_2.setCoincident(SketchLine_14.startPoint(), SketchPoint_20.result()) -SketchPoint_21 = Sketch_2.addPoint(model.selection("VERTEX", "Extrusion_1_11/To_Vertex_1")) +SketchPoint_21 = Sketch_2.addPoint(model.selection("VERTEX", "Extrusion_1_11/To_Vertex")) SketchPoint_21.setName("SketchPoint_23") SketchPoint_21.result().setName("SketchPoint_23") SketchConstraintCoincidence_35 = Sketch_2.setCoincident(SketchLine_14.endPoint(), SketchPoint_21.result()) @@ -157,12 +160,17 @@ SketchConstraintCoincidence_37 = Sketch_2.setCoincident(SketchPoint_18.coordinat SketchConstraintCoincidence_38 = Sketch_2.setCoincident(SketchLine_12.startPoint(), SketchLine_15.startPoint()) SketchConstraintCoincidence_39 = Sketch_2.setCoincident(SketchLine_15.endPoint(), SketchLine_9.result()) model.do() -Face_1 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_2/Wire-SketchLine_7f-SketchLine_8f-SketchLine_12f-SketchLine_13r")]) -Face_2 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_2/Wire-SketchLine_8f-SketchLine_12f-SketchLine_13f-SketchLine_14r")]) -Face_3 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_2/Wire-SketchLine_8f-SketchLine_9f-SketchLine_12f-SketchLine_14f-SketchLine_15r")]) -Face_4 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_2/Wire-SketchLine_9f-SketchLine_10f-SketchLine_11f-SketchLine_15f")]) -Partition_1 = model.addPartition(Part_1_doc, [model.selection("EDGE", "Extrusion_1_1"), model.selection("EDGE", "Extrusion_1_2"), model.selection("EDGE", "Extrusion_1_3"), model.selection("EDGE", "Extrusion_1_4"), model.selection("EDGE", "Extrusion_1_5"), model.selection("EDGE", "Extrusion_1_6"), model.selection("EDGE", "Extrusion_1_7"), model.selection("EDGE", "Extrusion_1_8"), model.selection("EDGE", "Extrusion_1_9"), model.selection("EDGE", "Extrusion_1_10"), model.selection("EDGE", "Extrusion_1_11"), model.selection("EDGE", "Extrusion_1_12"), model.selection("EDGE", "Extrusion_1_13"), model.selection("EDGE", "Extrusion_1_14"), model.selection("EDGE", "Extrusion_1_15"), model.selection("EDGE", "Extrusion_1_16"), model.selection("EDGE", "Extrusion_1_17"), model.selection("EDGE", "Extrusion_1_18"), model.selection("FACE", "Face_1_1"), model.selection("FACE", "Face_2_1"), model.selection("FACE", "Face_3_1"), model.selection("FACE", "Face_4_1")]) +Face_1 = model.addFace(Part_1_doc, [model.selection("WIRE", "[Sketch_2/SubEdge&Sketch_2/SketchLine_7][Sketch_2/SubEdge&Sketch_2/SketchLine_8][Sketch_2/SketchLine_13][Sketch_2/SubEdge&Sketch_2/SketchLine_12]")]) +Face_2 = model.addFace(Part_1_doc, [model.selection("WIRE", "[Sketch_2/SubEdge&Sketch_2/SketchLine_8][Sketch_2/SketchLine_14][Sketch_2/SubEdge&Sketch_2/SketchLine_12][Sketch_2/SketchLine_13]")]) +Face_3 = model.addFace(Part_1_doc, [model.selection("WIRE", "[Sketch_2/SubEdge&Sketch_2/SketchLine_8][Sketch_2/SubEdge&Sketch_2/SketchLine_9][Sketch_2/SubEdge&Sketch_2/SketchLine_15][Sketch_2/SubEdge&Sketch_2/SketchLine_12][Sketch_2/SketchLine_14]")]) +Face_4 = model.addFace(Part_1_doc, [model.selection("WIRE", "[Sketch_2/SubEdge&Sketch_2/SketchLine_9][Sketch_2/SubEdge&Sketch_2/SketchLine_10][Sketch_2/SubEdge&Sketch_2/SketchLine_11][Sketch_2/SubEdge&Sketch_2/SketchLine_15]")]) +Partition_1_objects = [model.selection("EDGE", "Extrusion_1_1"), model.selection("EDGE", "Extrusion_1_2"), model.selection("EDGE", "Extrusion_1_3"), model.selection("EDGE", "Extrusion_1_4"), model.selection("EDGE", "Extrusion_1_5"), model.selection("EDGE", "Extrusion_1_6"), model.selection("EDGE", "Extrusion_1_7"), model.selection("EDGE", "Extrusion_1_8"), model.selection("EDGE", "Extrusion_1_9"), model.selection("EDGE", "Extrusion_1_10"), model.selection("EDGE", "Extrusion_1_11"), model.selection("EDGE", "Extrusion_1_12"), model.selection("EDGE", "Extrusion_1_13"), model.selection("EDGE", "Extrusion_1_14"), model.selection("EDGE", "Extrusion_1_15"), model.selection("EDGE", "Extrusion_1_16"), model.selection("EDGE", "Extrusion_1_17"), model.selection("EDGE", "Extrusion_1_18"), model.selection("FACE", "Face_1_1"), model.selection("FACE", "Face_2_1"), model.selection("FACE", "Face_3_1"), model.selection("FACE", "Face_4_1")] +Partition_1 = model.addPartition(Part_1_doc, Partition_1_objects) +model.do() model.end() + +from ModelAPI import * + PartitionFeature = Partition_1.feature() assert(len(PartitionFeature.results()) == 1) PartitionResult = modelAPI_ResultBody(PartitionFeature.firstResult()) diff --git a/src/FeaturesPlugin/Test/Test1942.py b/src/FeaturesPlugin/Test/Test1942.py index b4ffe9143..d6d365738 100644 --- a/src/FeaturesPlugin/Test/Test1942.py +++ b/src/FeaturesPlugin/Test/Test1942.py @@ -18,6 +18,8 @@ ## email : webmaster.salome@opencascade.com ## +# -*- coding: utf-8 -*- + from salome.shaper import model model.begin() @@ -29,25 +31,25 @@ Part_1 = model.addPart(partSet) Part_1_doc = Part_1.document() model.addParameter(Part_1_doc, "a", "100") Sketch_1 = model.addSketch(Part_1_doc, model.selection("FACE", "PartSet/Plane_4")) -SketchLine_1 = Sketch_1.addLine(-5.023684372475525, -46.5755143466786, -14.75825153820805, -43.01597925234075) +SketchLine_1 = Sketch_1.addLine(-5.024014514861164, -46.57477619916804, -15.03025649976126, -42.91660461599292) SketchLine_1.setName("SketchLine_9") SketchLine_1.result().setName("SketchLine_9") -SketchLine_2 = Sketch_1.addLine(-33.96152175760117, -20.26294727816075, -38.72043789437247, 5.632510332222703) +SketchLine_2 = Sketch_1.addLine(-34.15308715195452, -20.5925185611531, -39.51293324824182, 6.356619200673476) SketchLine_2.setName("SketchLine_10") SketchLine_2.result().setName("SketchLine_10") -SketchLine_3 = Sketch_1.addLine(-5.023684372475525, -46.5755143466786, -30.86227207373359, -37.12739424591874) +SketchLine_3 = Sketch_1.addLine(-5.024014514861164, -46.57477619916804, -30.86442523156243, -37.12780736470863) SketchLine_3.setName("SketchLine_1") SketchLine_3.result().setName("SketchLine_1") SketchLine_3.setAuxiliary(True) -SketchLine_4 = Sketch_1.addLine(-30.86227207373359, -37.12739424591874, -38.72043789437247, 5.632510332222703) +SketchLine_4 = Sketch_1.addLine(-30.86442523156243, -37.12780736470863, -39.51293324824182, 6.356619200673476) SketchLine_4.setName("SketchLine_2") SketchLine_4.result().setName("SketchLine_2") SketchLine_4.setAuxiliary(True) SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_3.endPoint(), SketchLine_4.startPoint()) -SketchLine_5 = Sketch_1.addLine(-20.37351638704503, 39.82660556161157, 5.515492360623621, 50.89855436380311) +SketchLine_5 = Sketch_1.addLine(-21.88471935002519, 39.79243387785534, 5.516674902531107, 51.5099134867221) SketchLine_5.setName("SketchLine_4") SketchLine_5.result().setName("SketchLine_4") -SketchLine_6 = Sketch_1.addLine(5.515492360623621, 50.89855436380311, 32.11790618078412, 35.7788047045564) +SketchLine_6 = Sketch_1.addLine(5.516674902531107, 51.5099134867221, 32.11790618078412, 35.7788047045564) SketchLine_6.setName("SketchLine_5") SketchLine_6.result().setName("SketchLine_5") SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchLine_5.endPoint(), SketchLine_6.startPoint()) @@ -57,19 +59,19 @@ SketchLine_7.setName("SketchLine_6") SketchLine_7.result().setName("SketchLine_6") SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchLine_6.endPoint(), SketchLine_7.startPoint()) SketchConstraintCoincidence_3.setName("SketchConstraintCoincidence_5") -SketchLine_8 = Sketch_1.addLine(51.23593736581751, -10.42185420425237, 33.52439630860805, -30.08966199583723) +SketchLine_8 = Sketch_1.addLine(51.23593736581751, -10.42185420425237, 33.52471395405271, -30.09043472300023) SketchLine_8.setName("SketchLine_7") SketchLine_8.result().setName("SketchLine_7") SketchConstraintCoincidence_4 = Sketch_1.setCoincident(SketchLine_7.endPoint(), SketchLine_8.startPoint()) SketchConstraintCoincidence_4.setName("SketchConstraintCoincidence_6") -SketchLine_9 = Sketch_1.addLine(33.52439630860805, -30.08966199583723, -5.023684372475525, -46.5755143466786) +SketchLine_9 = Sketch_1.addLine(33.52471395405271, -30.09043472300023, -5.024014514861164, -46.57477619916804) SketchLine_9.setName("SketchLine_8") SketchLine_9.result().setName("SketchLine_8") SketchConstraintCoincidence_5 = Sketch_1.setCoincident(SketchLine_8.endPoint(), SketchLine_9.startPoint()) SketchConstraintCoincidence_5.setName("SketchConstraintCoincidence_7") SketchConstraintCoincidence_6 = Sketch_1.setCoincident(SketchLine_3.startPoint(), SketchLine_9.endPoint()) SketchConstraintCoincidence_6.setName("SketchConstraintCoincidence_8") -SketchArc_1 = Sketch_1.addArc(-4.455634849643539, -14.84052735945157, -33.96152175760117, -20.26294727816075, -14.75825153820805, -43.01597925234075, False) +SketchArc_1 = Sketch_1.addArc(-4.72938863253667, -14.74051331180418, -34.15308715195452, -20.5925185611531, -15.03025649976126, -42.91660461599292, False) SketchConstraintCoincidence_7 = Sketch_1.setCoincident(SketchArc_1.startPoint(), SketchLine_2.startPoint()) SketchConstraintCoincidence_7.setName("SketchConstraintCoincidence_9") SketchConstraintCoincidence_8 = Sketch_1.setCoincident(SketchArc_1.endPoint(), SketchLine_1.endPoint()) @@ -85,7 +87,7 @@ SketchConstraintCoincidence_11.setName("SketchConstraintCoincidence_13") SketchConstraintCoincidence_12 = Sketch_1.setCoincident(SketchLine_2.startPoint(), SketchLine_4.result()) SketchConstraintCoincidence_12.setName("SketchConstraintCoincidence_14") SketchConstraintRadius_1 = Sketch_1.setRadius(SketchArc_1.results()[1], 30) -SketchArc_2 = Sketch_1.addArc(-8.152231059872202, 11.25015706261054, -38.72043789437247, 5.632510332222703, -20.37351638704503, 39.82660556161157, True) +SketchArc_2 = Sketch_1.addArc(-10.08923472882396, 12.20862445002239, -39.51293324824182, 6.356619200673476, -21.88471935002519, 39.79243387785534, True) SketchConstraintRadius_2 = Sketch_1.setRadius(SketchArc_2.results()[1], 30) SketchConstraintCoincidence_13 = Sketch_1.setCoincident(SketchArc_2.startPoint(), SketchLine_2.endPoint()) SketchConstraintCoincidence_13.setName("SketchConstraintCoincidence_15") @@ -175,14 +177,18 @@ SketchConstraintParallel_2 = Sketch_2.setParallel(SketchLine_10.result(), Sketch SketchConstraintCoincidence_32 = Sketch_2.setCoincident(SketchLine_11.endPoint(), SketchPoint_7.coordinates()) SketchConstraintCoincidence_32.setName("SketchConstraintCoincidence_34") model.do() -Revolution_1 = model.addRevolution(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_9r-SketchLine_10r-SketchLine_4r-SketchLine_5r-SketchLine_6r-SketchLine_7r-SketchLine_8r-SketchArc_1_2f-SketchArc_2_2f-SketchArc_4_2r-SketchArc_3_2r")], model.selection("EDGE", "Sketch_2/Edge-SketchLine_12"), 360, 0) +Revolution_1 = model.addRevolution(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_8r-SketchLine_7r-SketchLine_6r-SketchLine_5r-SketchLine_4r-SketchArc_2_2f-SketchLine_10r-SketchArc_1_2f-SketchLine_9r-SketchArc_3_2r-SketchArc_4_2r")], model.selection("EDGE", "Sketch_2/SketchLine_12"), 360, 0) Partition_1 = model.addPartition(Part_1_doc, [model.selection("FACE", "PartSet/Plane_4"), model.selection("SOLID", "Revolution_1_1")]) Recover_1 = model.addRecover(Part_1_doc, Partition_1, [Revolution_1.result()]) Plane_5 = model.addPlane(Part_1_doc, model.selection("EDGE", "PartSet/Axis_4"), model.selection("VERTEX", "PartSet/Point_2"), True) -Face_1 = model.addFace(Part_1_doc, [model.selection("EDGE", "Sketch_1/Edge-SketchArc_2_2"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_4"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_5"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_6"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_7"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_8"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_1"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_2")]) +Face_1_objects = [model.selection("EDGE", "Sketch_1/SketchArc_2_2"), model.selection("EDGE", "Sketch_1/SketchLine_4"), model.selection("EDGE", "Sketch_1/SketchLine_5"), model.selection("EDGE", "Sketch_1/SketchLine_6"), model.selection("EDGE", "Sketch_1/SketchLine_7"), model.selection("EDGE", "Sketch_1/SketchLine_8"), model.selection("EDGE", "Sketch_1/SketchLine_1"), model.selection("EDGE", "Sketch_1/SketchLine_2")] +Face_1 = model.addFace(Part_1_doc, Face_1_objects) Intersection_1 = model.addIntersection(Part_1_doc, [model.selection("SOLID", "Recover_1_1"), model.selection("FACE", "Face_1_1")]) -Group_1 = model.addGroup(Part_1_doc, [model.selection("VERTEX", "Intersection_1_1/Modified_Vertex_2_1"), model.selection("VERTEX", "Intersection_1_1/Generated_Vertex_2"), model.selection("VERTEX", "Intersection_1_1/Modified_Vertex_6_1"), model.selection("VERTEX", "Intersection_1_1/Modified_Vertex_4_1"), model.selection("VERTEX", "Intersection_1_1/Generated_Vertex_3"), model.selection("VERTEX", "Intersection_1_1/Generated_Vertex_1"), model.selection("VERTEX", "Intersection_1_1/Modified_Vertex_1_1"), model.selection("VERTEX", "Intersection_1_1/Generated_Vertex_4"), model.selection("VERTEX", "Intersection_1_1/Modified_Vertex_3_1"), model.selection("VERTEX", "Intersection_1_1/Modified_Vertex_7_1"), model.selection("VERTEX", "Intersection_1_1/Modified_Vertex_5_1")]) -Group_2 = model.addGroup(Part_1_doc, [model.selection("EDGE", "Intersection_1_1_7"), model.selection("EDGE", "Intersection_1_1_6"), model.selection("EDGE", "Intersection_1_1_3"), model.selection("EDGE", "Intersection_1_1_11"), model.selection("EDGE", "Intersection_1_1_5"), model.selection("EDGE", "Intersection_1_1_1"), model.selection("EDGE", "Intersection_1_1_4"), model.selection("EDGE", "Intersection_1_1_2"), model.selection("EDGE", "Intersection_1_1_10"), model.selection("EDGE", "Intersection_1_1_9"), model.selection("EDGE", "Intersection_1_1_8")]) +Group_1_objects = [model.selection("VERTEX", "Intersection_1_1_4/Modified_Vertex&weak_name_3"), model.selection("VERTEX", "Intersection_1_1/Generated_Vertex_2"), model.selection("VERTEX", "Intersection_1_1_4/Modified_Vertex&weak_name_4"), model.selection("VERTEX", "Intersection_1_1_4/Modified_Vertex&weak_name_7"), model.selection("VERTEX", "Intersection_1_1/Generated_Vertex_3"), model.selection("VERTEX", "Intersection_1_1_11/Generated_Vertex_1"), model.selection("VERTEX", "Intersection_1_1_4/Modified_Vertex&weak_name_1"), model.selection("VERTEX", "Intersection_1_1/Generated_Vertex_4"), model.selection("VERTEX", "Intersection_1_1_4/Modified_Vertex&weak_name_5"), model.selection("VERTEX", "Intersection_1_1_4/Modified_Vertex&weak_name_2"), model.selection("VERTEX", "Intersection_1_1_4/Modified_Vertex&weak_name_6")] +Group_1 = model.addGroup(Part_1_doc, Group_1_objects) +Group_2_objects = [model.selection("EDGE", "Intersection_1_1_7"), model.selection("EDGE", "Intersection_1_1_6"), model.selection("EDGE", "Intersection_1_1_3"), model.selection("EDGE", "Intersection_1_1_11"), model.selection("EDGE", "Intersection_1_1_5"), model.selection("EDGE", "Intersection_1_1_1"), model.selection("EDGE", "Intersection_1_1_4"), model.selection("EDGE", "Intersection_1_1_2"), model.selection("EDGE", "Intersection_1_1_10"), model.selection("EDGE", "Intersection_1_1_9"), model.selection("EDGE", "Intersection_1_1_8")] +Group_2 = model.addGroup(Part_1_doc, Group_2_objects) +model.do() model.end() aGroupFeature = Group_1.feature() diff --git a/src/FeaturesPlugin/Test/Test2023.py b/src/FeaturesPlugin/Test/Test2023.py index cfde51a81..0c9156338 100644 --- a/src/FeaturesPlugin/Test/Test2023.py +++ b/src/FeaturesPlugin/Test/Test2023.py @@ -18,6 +18,8 @@ ## email : webmaster.salome@opencascade.com ## +# -*- coding: utf-8 -*- + from salome.shaper import model model.begin() @@ -38,8 +40,8 @@ SketchConstraintVertical_1 = Sketch_1.setVertical(SketchLine_2.result()) SketchConstraintHorizontal_2 = Sketch_1.setHorizontal(SketchLine_3.result()) SketchConstraintVertical_2 = Sketch_1.setVertical(SketchLine_4.result()) model.do() -Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_1f-SketchLine_2f-SketchLine_3f-SketchLine_4f")], model.selection(), 100, 0) -Sketch_2 = model.addSketch(Part_1_doc, model.selection("FACE", "Extrusion_1_1/To_Face_1")) +Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_1r-SketchLine_2f-SketchLine_3f-SketchLine_4f")], model.selection(), 100, 0) +Sketch_2 = model.addSketch(Part_1_doc, model.selection("FACE", "Extrusion_1_1/To_Face")) SketchLine_5 = Sketch_2.addLine(99.48542024013722, 69.46826758147516, -34.30531732418524, 69.46826758147516) SketchLine_6 = Sketch_2.addLine(-34.30531732418524, 69.46826758147516, -34.30531732418524, -62.60720411663805) SketchLine_7 = Sketch_2.addLine(-34.30531732418524, -62.60720411663805, 99.48542024013722, -62.60720411663805) @@ -53,9 +55,10 @@ SketchConstraintVertical_3 = Sketch_2.setVertical(SketchLine_6.result()) SketchConstraintHorizontal_4 = Sketch_2.setHorizontal(SketchLine_7.result()) SketchConstraintVertical_4 = Sketch_2.setVertical(SketchLine_8.result()) model.do() -Extrusion_2 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchLine_5f-SketchLine_6f-SketchLine_7f-SketchLine_8f")], model.selection(), 10, 110) +Extrusion_2 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchLine_5r-SketchLine_6f-SketchLine_7f-SketchLine_8f")], model.selection(), 10, 110) Intersection_1 = model.addIntersection(Part_1_doc, [model.selection("SOLID", "Extrusion_1_1"), model.selection("SOLID", "Extrusion_2_1")]) Rotation_1 = model.addRotation(Part_1_doc, [model.selection("COMPOUND", "Intersection_1_1")], model.selection("EDGE", "PartSet/OZ"), 45) +model.do() model.end() assert(model.checkPythonDump()) diff --git a/src/FeaturesPlugin/Test/Test2038.py b/src/FeaturesPlugin/Test/Test2038.py index 8a98df7e9..8cc936b8e 100644 --- a/src/FeaturesPlugin/Test/Test2038.py +++ b/src/FeaturesPlugin/Test/Test2038.py @@ -18,6 +18,8 @@ ## email : webmaster.salome@opencascade.com ## +# -*- coding: utf-8 -*- + from salome.shaper import model model.begin() @@ -37,14 +39,14 @@ SketchLine_5 = Sketch_1.addLine(-379.073756432247, 108.9193825042881, -360.20583 SketchConstraintCoincidence_5 = Sketch_1.setCoincident(SketchLine_1.startPoint(), SketchLine_5.startPoint()) SketchConstraintCoincidence_6 = Sketch_1.setCoincident(SketchLine_2.endPoint(), SketchLine_5.endPoint()) model.do() -Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_1f-SketchLine_2f-SketchLine_5r")], model.selection(), 100, 0) +Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_1r-SketchLine_2f-SketchLine_5r")], model.selection(), 100, 0) Extrusion_2 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_3f-SketchLine_4f-SketchLine_5f")], model.selection(), 100, 0) Translation_1 = model.addTranslation(Part_1_doc, [model.selection("SOLID", "Extrusion_1_1")], model.selection("EDGE", "PartSet/OX"), 50) Partition_1 = model.addPartition(Part_1_doc, [model.selection("SOLID", "Translation_1_1"), model.selection("SOLID", "Extrusion_2_1")]) Translation_2 = model.addTranslation(Part_1_doc, [model.selection("COMPSOLID", "Partition_1_1")], model.selection("EDGE", "PartSet/OZ"), 50) -Group_1 = model.addGroup(Part_1_doc, [model.selection("FACE", "Translation_2_1/Translated_Face_24"), model.selection("FACE", "Translation_2_1/Translated_Face_13"), model.selection("FACE", "Translation_2_1/Translated_Face_16"), model.selection("FACE", "Translation_2_1/Translated_Face_12"), model.selection("FACE", "Translation_2_1/Translated_Face_9"), model.selection("FACE", "Translation_2_1/Translated_Face_10"), model.selection("FACE", "Translation_2_1/Translated_Face_11"), model.selection("FACE", "Translation_2_1/Translated_Face_25"), model.selection("FACE", "Translation_2_1/Translated_Face_20"), model.selection("FACE", "Translation_2_1/Translated_Face_19"), model.selection("FACE", "Translation_2_1/Translated_Face_18"), model.selection("FACE", "Translation_2_1/Translated_Face_27"), model.selection("FACE", "Translation_2_1/Translated_Face_17"), model.selection("FACE", "Translation_2_1/Translated_Face_31"), model.selection("FACE", "Translation_2_1/Translated_Face_32"), model.selection("FACE", "Translation_2_1/Translated_Face_30"), model.selection("FACE", "Translation_2_1/Translated_Face_28"), model.selection("FACE", "Translation_2_1/Translated_Face_29"), model.selection("FACE", "Translation_2_1/Translated_Face_8"), model.selection("FACE", "Translation_2_1/Translated_Face_22"), model.selection("FACE", "Translation_2_1/Translated_Face_7"), model.selection("FACE", "Translation_2_1/Translated_Face_6"), model.selection("FACE", "Translation_2_1/Translated_Face_5"), model.selection("FACE", "Translation_2_1/Translated_Face_3"), model.selection("FACE", "Translation_2_1/Translated_Face_1"), model.selection("FACE", "Translation_2_1/Translated_Face_2"), model.selection("FACE", "Translation_2_1/Translated_Face_21"), model.selection("FACE", "Translation_2_1/Translated_Face_4"), model.selection("FACE", "Translation_2_1/Translated_Face_25"), model.selection("FACE", "Translation_2_1/Translated_Face_27"), model.selection("FACE", "Translation_2_1/Translated_Face_21"), model.selection("FACE", "Translation_2_1/Translated_Face_22"), model.selection("FACE", "Translation_2_1/Translated_Face_26"), model.selection("FACE", "Translation_2_1/Translated_Face_23"), model.selection("FACE", "Translation_2_1/Translated_Face_30"), model.selection("FACE", "Translation_2_1/Translated_Face_23"), model.selection("FACE", "Translation_2_1/Translated_Face_14"), model.selection("FACE", "Translation_2_1/Translated_Face_15")]) -#Group_1 = model.addGroup(Part_1_doc, [model.selection("FACE", "Translation_2_1_6/Translated_Face_1"), model.selection("FACE", "Translation_2_1_5/Translated_Face_1"), model.selection("FACE", "Translation_2_1_5/Translated_Face_4"), model.selection("FACE", "Translation_2_1_4/Translated_Face_4"), model.selection("FACE", "Translation_2_1_5/Translated_Face_3"), model.selection("FACE", "Translation_2_1_5/Translated_Face_2"), model.selection("FACE", "Translation_2_1_5/Translated_Face_5"), model.selection("FACE", "Translation_2_1_7/Translated_Face_5"), model.selection("FACE", "Translation_2_1_6/Translated_Face_5"), model.selection("FACE", "Translation_2_1_4/Translated_Face_1"), model.selection("FACE", "Translation_2_1_2/Translated_Face_2"), model.selection("FACE", "Translation_2_1_5/Translated_Face_5"), model.selection("FACE", "Translation_2_1_2/Translated_Face_1"), model.selection("FACE", "Translation_2_1_4/Translated_Face_5"), model.selection("FACE", "Translation_2_1_2/Translated_Face_3"), model.selection("FACE", "Translation_2_1_3/Translated_Face_5"), model.selection("FACE", "Translation_2_1_1/Translated_Face_3"), model.selection("FACE", "Translation_2_1_4/Translated_Face_2"), model.selection("FACE", "Translation_2_1_2/Translated_Face_3"), model.selection("FACE", "Translation_2_1_1/Translated_Face_4"), model.selection("FACE", "Translation_2_1_1/Translated_Face_1"), model.selection("FACE", "Translation_2_1_1/Translated_Face_2"), model.selection("FACE", "Translation_2_1_3/Translated_Face_4"), model.selection("FACE", "Translation_2_1_4/Translated_Face_3"), model.selection("FACE", "Translation_2_1_3/Translated_Face_5"), model.selection("FACE", "Translation_2_1_3/Translated_Face_2"), model.selection("FACE", "Translation_2_1_3/Translated_Face_3"), model.selection("FACE", "Translation_2_1_3/Translated_Face_1"), model.selection("FACE", "Translation_2_1_7/Translated_Face_3"), model.selection("FACE", "Translation_2_1_7/Translated_Face_5"), model.selection("FACE", "Translation_2_1_7/Translated_Face_4"), model.selection("FACE", "Translation_2_1_7/Translated_Face_1"), model.selection("FACE", "Translation_2_1_7/Translated_Face_2"), model.selection("FACE", "Translation_2_1_6/Translated_Face_4"), model.selection("FACE", "Translation_2_1_4/Translated_Face_5"), model.selection("FACE", "Translation_2_1_6/Translated_Face_5"), model.selection("FACE", "Translation_2_1_6/Translated_Face_2"), model.selection("FACE", "Translation_2_1_6/Translated_Face_3")]) - +Group_1_objects = [model.selection("FACE", "Translation_2_1_3/MF:Translated&Sketch_1/SketchLine_4"), model.selection("FACE", "Translation_2_1_4/MF:Translated&Extrusion_1_1/To_Face"), model.selection("FACE", "Translation_2_1_4/MF:Translated&Extrusion_1_1/From_Face"), model.selection("FACE", "Translation_2_1_5/MF:Translated&Extrusion_2_1/From_Face"), model.selection("FACE", "Translation_2_1_5/MF:Translated&Extrusion_2_1/To_Face"), model.selection("FACE", "Translation_2_1_5/MF:Translated&Sketch_1/SketchLine_4"), model.selection("FACE", "Translation_2_1_5/MF:Translated&Sketch_1/SketchLine_5"), model.selection("FACE", "Translation_2_1_2/MF:Translated&Extrusion_2_1/To_Face&Extrusion_1_1/To_Face"), model.selection("FACE", "Translation_2_1_3/MF:Translated&Sketch_1/SketchLine_1"), model.selection("FACE", "Translation_2_1_3/MF:Translated&Extrusion_1_1/From_Face"), model.selection("FACE", "Translation_2_1_3/MF:Translated&Extrusion_1_1/To_Face"), model.selection("FACE", "Translation_2_1_5/MF:Translated&Sketch_1/SketchLine_1"), model.selection("FACE", "Translation_2_1_3/MF:Translated&Sketch_1/SketchLine_5"), model.selection("FACE", "Translation_2_1_1/MF:Translated&Extrusion_1_1/From_Face"), model.selection("FACE", "Translation_2_1_1/MF:Translated&Sketch_1/SketchLine_1"), model.selection("FACE", "Translation_2_1_1/MF:Translated&Sketch_1/SketchLine_2"), model.selection("FACE", "(Translation_2_1_2/MF:Translated&Sketch_1/SketchLine_1)(Translation_2_1_2/MF:Translated&Extrusion_2_1/From_Face&Extrusion_1_1/From_Face)(Translation_2_1_2/MF:Translated&Extrusion_2_1/To_Face&Extrusion_1_1/To_Face)(Translation_2_1_2/MF:Translated&Sketch_1/SketchLine_2)"), model.selection("FACE", "Translation_2_1_1/MF:Translated&Extrusion_1_1/To_Face"), model.selection("FACE", "Translation_2_1_6/MF:Translated&Sketch_1/SketchLine_3"), model.selection("FACE", "Translation_2_1_4/MF:Translated&Sketch_1/SketchLine_3"), model.selection("FACE", "Translation_2_1_6/MF:Translated&Extrusion_2_1/From_Face"), model.selection("FACE", "Translation_2_1_6/MF:Translated&Extrusion_2_1/To_Face"), model.selection("FACE", "Translation_2_1_6/MF:Translated&Sketch_1/SketchLine_5"), model.selection("FACE", "Translation_2_1_7/MF:Translated&Extrusion_2_1/From_Face"), model.selection("FACE", "Translation_2_1_7/MF:Translated&Extrusion_2_1/To_Face"), model.selection("FACE", "Translation_2_1_7/MF:Translated&Sketch_1/SketchLine_4"), model.selection("FACE", "Translation_2_1_6/MF:Translated&Sketch_1/SketchLine_2"), model.selection("FACE", "Translation_2_1_7/MF:Translated&Sketch_1/SketchLine_3"), model.selection("FACE", "Translation_2_1_2/MF:Translated&Extrusion_2_1/To_Face&Extrusion_1_1/To_Face"), model.selection("FACE", "Translation_2_1_5/MF:Translated&Sketch_1/SketchLine_1"), model.selection("FACE", "Translation_2_1_6/MF:Translated&Sketch_1/SketchLine_2"), model.selection("FACE", "Translation_2_1_4/MF:Translated&Sketch_1/SketchLine_3"), model.selection("FACE", "Translation_2_1_2/MF:Translated&Extrusion_2_1/From_Face&Extrusion_1_1/From_Face"), model.selection("FACE", "Translation_2_1_7/MF:Translated&Sketch_1/SketchLine_5"), model.selection("FACE", "Translation_2_1_1/MF:Translated&Sketch_1/SketchLine_2"), model.selection("FACE", "Translation_2_1_7/MF:Translated&Sketch_1/SketchLine_5"), model.selection("FACE", "Translation_2_1_4/MF:Translated&Sketch_1/SketchLine_2"), model.selection("FACE", "Translation_2_1_4/MF:Translated&Sketch_1/SketchLine_5")] +Group_1 = model.addGroup(Part_1_doc, Group_1_objects) +model.do() model.end() groupFeature = Group_1.feature() diff --git a/src/FeaturesPlugin/Test/Test2046.py b/src/FeaturesPlugin/Test/Test2046.py index 72c1b77f1..6d2642714 100644 --- a/src/FeaturesPlugin/Test/Test2046.py +++ b/src/FeaturesPlugin/Test/Test2046.py @@ -18,6 +18,8 @@ ## email : webmaster.salome@opencascade.com ## +# -*- coding: utf-8 -*- + from salome.shaper import model model.begin() @@ -31,9 +33,11 @@ SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchLine_2.endPoint(), model.do() Part_1 = model.addPart(partSet) Part_1_doc = Part_1.document() -Wire_1 = model.addWire(Part_1_doc, [model.selection("EDGE", "PartSet/Sketch_1/Edge-SketchLine_1"), model.selection("EDGE", "PartSet/Sketch_1/Edge-SketchLine_2"), model.selection("EDGE", "PartSet/Sketch_1/Edge-SketchLine_3")]) +Wire_1_objects = [model.selection("EDGE", "PartSet/Sketch_1/SketchLine_1"), model.selection("EDGE", "PartSet/Sketch_1/SketchLine_2"), model.selection("EDGE", "PartSet/Sketch_1/SketchLine_3")] +Wire_1 = model.addWire(Part_1_doc, Wire_1_objects) Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("WIRE", "Wire_1_1")], model.selection(), 100, 0) -Group_1 = model.addGroup(Part_1_doc, [model.selection("FACE", "Extrusion_1_1/Generated_Face_3"), model.selection("FACE", "Extrusion_1_1/Generated_Face_2"), model.selection("FACE", "Extrusion_1_1/Generated_Face_1")]) +Group_1_objects = [model.selection("FACE", "Extrusion_1_1/Generated_Face&weak_name_1"), model.selection("FACE", "Extrusion_1_1/Generated_Face&weak_name_2"), model.selection("FACE", "Extrusion_1_1/Generated_Face&weak_name_3")] +Group_1 = model.addGroup(Part_1_doc, Group_1_objects) model.do() model.end() diff --git a/src/FeaturesPlugin/Test/Test2172.py b/src/FeaturesPlugin/Test/Test2172.py index 993dceb2e..1c389ba1b 100644 --- a/src/FeaturesPlugin/Test/Test2172.py +++ b/src/FeaturesPlugin/Test/Test2172.py @@ -18,6 +18,8 @@ ## email : webmaster.salome@opencascade.com ## +# -*- coding: utf-8 -*- + from salome.shaper import model model.begin() @@ -36,7 +38,7 @@ SketchLine_5 = Sketch_1.addLine(551.916977573864, -398.3514326277755, -18.083022 SketchConstraintCoincidence_4 = Sketch_1.setCoincident(SketchLine_4.endPoint(), SketchLine_5.startPoint()) SketchLine_6 = Sketch_1.addLine(-18.08302242613596, -398.3514326277755, -18.08302242613596, -98.35143262777552) SketchConstraintCoincidence_5 = Sketch_1.setCoincident(SketchLine_5.endPoint(), SketchLine_6.startPoint()) -SketchArc_1 = Sketch_1.addArc(0, -7.626897158721915e-023, -85.62958302127123, 51.64856737222455, -18.08302242613596, -98.35143262777552, False) +SketchArc_1 = Sketch_1.addArc(0, -7.626897158721915e-23, -85.62958302127123, 51.64856737222455, -18.08302242613596, -98.35143262777552, False) SketchConstraintCoincidence_6 = Sketch_1.setCoincident(SketchLine_6.endPoint(), SketchArc_1.endPoint()) SketchConstraintCoincidence_7 = Sketch_1.setCoincident(SketchLine_1.startPoint(), SketchArc_1.startPoint()) SketchConstraintHorizontal_1 = Sketch_1.setHorizontal(SketchLine_2.result()) @@ -50,8 +52,8 @@ SketchConstraintLength_3 = Sketch_1.setLength(SketchLine_5.result(), 570) SketchConstraintAngle_1 = Sketch_1.setAngleBackward(SketchLine_5.result(), SketchLine_4.result(), 139.9999999999999) SketchConstraintAngle_2 = Sketch_1.setAngle(SketchLine_1.result(), SketchLine_2.result(), 124.9999999999987) SketchConstraintLength_4 = Sketch_1.setLength(SketchLine_6.result(), 300) -SketchConstraintDistance_1 = Sketch_1.setDistance(SketchArc_1.startPoint(), SketchLine_2.result(), 350) -SketchConstraintDistance_2 = Sketch_1.setDistance(SketchLine_4.startPoint(), SketchLine_5.result(), 300) +SketchConstraintDistance_1 = Sketch_1.setDistance(SketchArc_1.startPoint(), SketchLine_2.result(), 350, False) +SketchConstraintDistance_2 = Sketch_1.setDistance(SketchLine_4.startPoint(), SketchLine_5.result(), 300, False) SketchPoint_1 = Sketch_1.addPoint(model.selection("VERTEX", "PartSet/Origin")) SketchConstraintCoincidence_8 = Sketch_1.setCoincident(SketchArc_1.center(), SketchPoint_1.coordinates()) SketchCircle_1 = Sketch_1.addCircle(623.3624504738834, 247.4315530304268, 75) @@ -68,13 +70,15 @@ SketchPoint_2 = Sketch_1.addPoint(557.3438493481349, 211.8430112592427) SketchConstraintCoincidence_13 = Sketch_1.setCoincident(SketchPoint_2.coordinates(), SketchLine_8.startPoint()) SketchConstraintCollinear_1 = Sketch_1.setCollinear(SketchLine_7.result(), SketchLine_8.result()) SketchConstraintCoincidence_14 = Sketch_1.setCoincident(SketchLine_7.endPoint(), SketchCircle_2.results()[1]) -SketchConstraintDistance_3 = Sketch_1.setDistance(SketchCircle_2.center(), SketchLine_6.endPoint(), 325) +SketchConstraintDistance_3 = Sketch_1.setDistance(SketchCircle_2.center(), SketchLine_6.endPoint(), 325, False) SketchConstraintCoincidence_15 = Sketch_1.setCoincident(SketchPoint_2.coordinates(), SketchCircle_1.results()[1]) -SketchConstraintDistance_4 = Sketch_1.setDistance(SketchCircle_1.center(), SketchLine_2.endPoint(), 325) +SketchConstraintDistance_4 = Sketch_1.setDistance(SketchCircle_1.center(), SketchLine_2.endPoint(), 325, False) model.do() Revolution_1 = model.addRevolution(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchCircle_1_2f-SketchLine_8f")], model.selection("EDGE", "PartSet/OZ"), 360, 0) -Revolution_2 = model.addRevolution(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchCircle_2_2f-SketchLine_7r")], model.selection("EDGE", "PartSet/OZ"), 360, 0) -Group_1 = model.addGroup(Part_1_doc, [model.selection("EDGE", "Revolution_1_1/Lateral_2"), model.selection("EDGE", "Revolution_1_1/Lateral_4"), model.selection("EDGE", "Revolution_1_1/Base_Edge_6"), model.selection("EDGE", "Revolution_1_1/Base_Edge_8"), model.selection("EDGE", "Revolution_2_1/Base_Edge_8"), model.selection("EDGE", "Revolution_2_1/Lateral_2"), model.selection("EDGE", "Revolution_2_1/Lateral_4"), model.selection("EDGE", "Revolution_2_1/Base_Edge_10"), model.selection("EDGE", "Revolution_2_1/Base_Edge_12"), model.selection("EDGE", "Revolution_2_1/Lateral_6")]) +Revolution_2 = model.addRevolution(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchCircle_2_2f-SketchCircle_2_2f-SketchLine_7r")], model.selection("EDGE", "PartSet/OZ"), 360, 0) +Group_1_objects = [model.selection("EDGE", "[Revolution_1_1/Generated_Face&Sketch_1/SketchCircle_1_2][Revolution_1_1/Generated_Face&Sketch_1/SketchLine_8][weak_name_2]"), model.selection("EDGE", "[Revolution_1_1/Generated_Face&Sketch_1/SketchCircle_1_2][Revolution_1_1/Generated_Face&Sketch_1/SketchLine_8][weak_name_1]"), model.selection("EDGE", "[Revolution_1_1/Generated_Face&Sketch_1/SketchCircle_1_2][weak_name_3]"), model.selection("EDGE", "[Revolution_1_1/Generated_Face&Sketch_1/SketchLine_8][weak_name_3]"), model.selection("EDGE", "([Revolution_2_1/Generated_Face&Sketch_1/SketchCircle_2_2&weak_name_1][Revolution_2_1/Generated_Face&Sketch_1/SketchCircle_2_2&weak_name_2])([Revolution_2_1/Generated_Face&Sketch_1/SketchCircle_2_2&weak_name_1][Revolution_2_1/Generated_Face&Sketch_1/SketchLine_7])"), model.selection("EDGE", "[Revolution_2_1/Generated_Face&Sketch_1/SketchCircle_2_2&weak_name_1][Revolution_2_1/Generated_Face&Sketch_1/SketchLine_7]"), model.selection("EDGE", "[Revolution_2_1/Generated_Face&Sketch_1/SketchCircle_2_2&weak_name_1][Revolution_2_1/Generated_Face&Sketch_1/SketchCircle_2_2&weak_name_2]"), model.selection("EDGE", "([Revolution_2_1/Generated_Face&Sketch_1/SketchCircle_2_2&weak_name_1][Revolution_2_1/Generated_Face&Sketch_1/SketchCircle_2_2&weak_name_2])([Revolution_2_1/Generated_Face&Sketch_1/SketchCircle_2_2&weak_name_2][Revolution_2_1/Generated_Face&Sketch_1/SketchLine_7])"), model.selection("EDGE", "([Revolution_2_1/Generated_Face&Sketch_1/SketchCircle_2_2&weak_name_1][Revolution_2_1/Generated_Face&Sketch_1/SketchLine_7])([Revolution_2_1/Generated_Face&Sketch_1/SketchCircle_2_2&weak_name_2][Revolution_2_1/Generated_Face&Sketch_1/SketchLine_7])"), model.selection("EDGE", "[Revolution_2_1/Generated_Face&Sketch_1/SketchCircle_2_2&weak_name_2][Revolution_2_1/Generated_Face&Sketch_1/SketchLine_7]")] +Group_1 = model.addGroup(Part_1_doc, Group_1_objects) +model.do() model.end() # check that resulting group selection is valid diff --git a/src/FeaturesPlugin/Test/Test2194.py b/src/FeaturesPlugin/Test/Test2194.py index d42a091f4..070a1393d 100644 --- a/src/FeaturesPlugin/Test/Test2194.py +++ b/src/FeaturesPlugin/Test/Test2194.py @@ -18,6 +18,8 @@ ## email : webmaster.salome@opencascade.com ## +# -*- coding: utf-8 -*- + from salome.shaper import model model.begin() @@ -27,14 +29,15 @@ Part_1_doc = Part_1.document() Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("YOZ")) SketchCircle_1 = Sketch_1.addCircle(-79.57211859899775, 93.0358363165245, 69.46562387481423) model.do() -Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchCircle_1_2f")], model.selection(), 10, 0) -Sketch_2 = model.addSketch(Part_1_doc, model.selection("FACE", "Extrusion_1_1/To_Face_1")) +Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchCircle_1_2r")], model.selection(), 10, 0) +Sketch_2 = model.addSketch(Part_1_doc, model.selection("FACE", "Extrusion_1_1/To_Face")) SketchCircle_2 = Sketch_2.addCircle(-111.8968837135755, 98.96901887198163, 6.57145775571253) SketchCircle_3 = Sketch_2.addCircle(-41.97827733564338, 89.35676702647821, 6.102067916018811) model.do() -Extrusion_2 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchCircle_2_2f"), model.selection("FACE", "Sketch_2/Face-SketchCircle_3_2f")], model.selection(), 10, 0) -Boolean_1 = model.addSmash(Part_1_doc, [model.selection("SOLID", "Extrusion_1_1")], [model.selection("SOLID", "Extrusion_2_1"), model.selection("SOLID", "Extrusion_2_2")]) -Group_1 = model.addGroup(Part_1_doc, [model.selection("FACE", "Extrusion_2_2/To_Face_1"), model.selection("FACE", "Extrusion_2_2/From_Face_1"), model.selection("FACE", "Extrusion_2_2/Generated_Face_1"), model.selection("FACE", "Extrusion_2_1/From_Face_1"), model.selection("FACE", "Smash_1_1_1/Modified_Face_1"), model.selection("FACE", "Extrusion_1_1/From_Face_1"), model.selection("FACE", "Extrusion_1_1/Generated_Face_1"), model.selection("FACE", "Extrusion_2_2/From_Face_1"), model.selection("FACE", "Extrusion_2_1/Generated_Face_1"), model.selection("FACE", "Extrusion_2_1/From_Face_1"), model.selection("FACE", "Extrusion_2_1/To_Face_1")]) +Extrusion_2 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchCircle_2_2r"), model.selection("FACE", "Sketch_2/Face-SketchCircle_3_2f")], model.selection(), 10, 0) +Smash_1 = model.addSmash(Part_1_doc, [model.selection("SOLID", "Extrusion_1_1")], [model.selection("SOLID", "Extrusion_2_1"), model.selection("SOLID", "Extrusion_2_2")]) +Group_1_objects = [model.selection("FACE", "Extrusion_2_2/To_Face"), model.selection("FACE", "Extrusion_2_2/From_Face"), model.selection("FACE", "Extrusion_2_2/Generated_Face&Sketch_2/SketchCircle_3_2"), model.selection("FACE", "Extrusion_2_1/From_Face"), model.selection("FACE", "(Extrusion_2_1/From_Face)(Extrusion_1_1/Generated_Face&Sketch_1/SketchCircle_1_2)(Extrusion_2_2/From_Face)"), model.selection("FACE", "Extrusion_1_1/From_Face"), model.selection("FACE", "Extrusion_1_1/Generated_Face&Sketch_1/SketchCircle_1_2"), model.selection("FACE", "Extrusion_2_2/From_Face"), model.selection("FACE", "Extrusion_2_1/Generated_Face&Sketch_2/SketchCircle_2_2"), model.selection("FACE", "Extrusion_2_1/From_Face"), model.selection("FACE", "Extrusion_2_1/To_Face")] +Group_1 = model.addGroup(Part_1_doc, Group_1_objects) model.do() model.end() diff --git a/src/FeaturesPlugin/Test/Test2197_1.py b/src/FeaturesPlugin/Test/Test2197_1.py index 4375edb71..d739407f7 100644 --- a/src/FeaturesPlugin/Test/Test2197_1.py +++ b/src/FeaturesPlugin/Test/Test2197_1.py @@ -18,6 +18,8 @@ ## email : webmaster.salome@opencascade.com ## +# -*- coding: utf-8 -*- + from salome.shaper import model model.begin() @@ -25,12 +27,15 @@ partSet = model.moduleDocument() Part_1 = model.addPart(partSet) Part_1_doc = Part_1.document() Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("YOZ")) -SketchCircle_1 = Sketch_1.addCircle(-150, 79, -50, 79) -SketchCircle_2 = Sketch_1.addCircle(-155, 278, -10, 278) +SketchCircle_1 = Sketch_1.addCircle(-155, 278, 145) +SketchCircle_2 = Sketch_1.addCircle(-150, 79, 100) +model.do() +Revolution_1 = model.addRevolution(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchCircle_1_2r-SketchCircle_2_2f-SketchCircle_2_2f")], model.selection("EDGE", "PartSet/OZ"), 360, 0) +Group_1_objects = [model.selection("EDGE", "([Revolution_1_1/Generated_Face&Sketch_1/SketchCircle_2_2&weak_name_2][Revolution_1_1/Generated_Face&Sketch_1/SketchCircle_1_2])([Revolution_1_1/Generated_Face&Sketch_1/SketchCircle_2_2&weak_name_1][Revolution_1_1/Generated_Face&Sketch_1/SketchCircle_1_2])"), model.selection("EDGE", "([Revolution_1_1/Generated_Face&Sketch_1/SketchCircle_2_2&weak_name_2][Revolution_1_1/Generated_Face&Sketch_1/SketchCircle_1_2])([Revolution_1_1/Generated_Face&Sketch_1/SketchCircle_2_2&weak_name_1][Revolution_1_1/Generated_Face&Sketch_1/SketchCircle_2_2&weak_name_2])"), model.selection("EDGE", "([Revolution_1_1/Generated_Face&Sketch_1/SketchCircle_2_2&weak_name_1][Revolution_1_1/Generated_Face&Sketch_1/SketchCircle_1_2])([Revolution_1_1/Generated_Face&Sketch_1/SketchCircle_2_2&weak_name_1][Revolution_1_1/Generated_Face&Sketch_1/SketchCircle_2_2&weak_name_2])")] +Group_1 = model.addGroup(Part_1_doc, Group_1_objects) +Group_2_objects = [model.selection("EDGE", "[Revolution_1_1/Generated_Face&Sketch_1/SketchCircle_2_2&weak_name_1][Revolution_1_1/Generated_Face&Sketch_1/SketchCircle_1_2]"), model.selection("EDGE", "[Revolution_1_1/Generated_Face&Sketch_1/SketchCircle_2_2&weak_name_2][Revolution_1_1/Generated_Face&Sketch_1/SketchCircle_1_2]"), model.selection("EDGE", "[Revolution_1_1/Generated_Face&Sketch_1/SketchCircle_2_2&weak_name_1][Revolution_1_1/Generated_Face&Sketch_1/SketchCircle_2_2&weak_name_2]")] +Group_2 = model.addGroup(Part_1_doc, Group_2_objects) model.do() -Revolution_1 = model.addRevolution(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchCircle_1_2f-SketchCircle_2_2f")], model.selection("EDGE", "PartSet/OZ"), 360, 0) -Group_1 = model.addGroup(Part_1_doc, [model.selection("EDGE", "Revolution_1_1/Base_Edge_8"), model.selection("EDGE", "Revolution_1_1/Base_Edge_10"), model.selection("EDGE", "Revolution_1_1/Base_Edge_12")]) -Group_2 = model.addGroup(Part_1_doc, [model.selection("EDGE", "Revolution_1_1/Lateral_2"), model.selection("EDGE", "Revolution_1_1/Lateral_4"), model.selection("EDGE", "Revolution_1_1/Lateral_6")]) model.end() # check that resulting group selection is valid diff --git a/src/FeaturesPlugin/Test/Test2197_2.py b/src/FeaturesPlugin/Test/Test2197_2.py index cedd7f88f..8c57780a0 100644 --- a/src/FeaturesPlugin/Test/Test2197_2.py +++ b/src/FeaturesPlugin/Test/Test2197_2.py @@ -18,6 +18,8 @@ ## email : webmaster.salome@opencascade.com ## +# -*- coding: utf-8 -*- + from salome.shaper import model model.begin() @@ -27,11 +29,12 @@ Part_1_doc = Part_1.document() Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("YOZ")) SketchCircle_1 = Sketch_1.addCircle(-150, 80, 100) model.do() -Face_1 = model.addFace(Part_1_doc, [model.selection("EDGE", "Sketch_1/Edge-SketchCircle_1_2")]) +Face_1 = model.addFace(Part_1_doc, [model.selection("EDGE", "Sketch_1/SketchCircle_1_2")]) Revolution_1 = model.addRevolution(Part_1_doc, [model.selection("FACE", "Face_1_1")], model.selection("EDGE", "PartSet/OZ"), 360, 0) -Group_1 = model.addGroup(Part_1_doc, [model.selection("EDGE", "Revolution_1_1/Base_Edge_4")]) -Group_2 = model.addGroup(Part_1_doc, [model.selection("EDGE", "Revolution_1_1/Lateral_2")]) -Group_3 = model.addGroup(Part_1_doc, [model.selection("VERTEX", "Revolution_1_1/Lateral_2&Revolution_1_1/Base_Edge_4")]) +Group_1 = model.addGroup(Part_1_doc, [model.selection("EDGE", "[Revolution_1_1/Generated_Face&Face_1_1/Edge_1][weak_name_1]")]) +Group_2 = model.addGroup(Part_1_doc, [model.selection("EDGE", "[Revolution_1_1/Generated_Face&Face_1_1/Edge_1][weak_name_2]")]) +Group_3 = model.addGroup(Part_1_doc, [model.selection("VERTEX", "[Revolution_1_1/Generated_Face&Face_1_1/Edge_1]")]) +model.do() model.end() # check that resulting group selection is valid diff --git a/src/FeaturesPlugin/Test/Test2197_3.py b/src/FeaturesPlugin/Test/Test2197_3.py index dc6122bb3..c2baaa72f 100644 --- a/src/FeaturesPlugin/Test/Test2197_3.py +++ b/src/FeaturesPlugin/Test/Test2197_3.py @@ -19,6 +19,7 @@ ## # revolution of 3-edges contour (4th is used as axis of rotation) is checking for naming of edges + from salome.shaper import model model.begin() @@ -35,8 +36,10 @@ SketchLine_4 = Sketch_1.addLine(138, 234, 138, 47) SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchLine_3.endPoint(), SketchLine_4.startPoint()) SketchConstraintCoincidence_4 = Sketch_1.setCoincident(SketchLine_1.startPoint(), SketchLine_4.endPoint()) model.do() -Revolution_1 = model.addRevolution(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_1f-SketchLine_2f-SketchLine_3f-SketchLine_4f")], model.selection("EDGE", "Sketch_1/Edge-SketchLine_4"), 360, 0) -Group_1 = model.addGroup(Part_1_doc, [model.selection("EDGE", "Revolution_1_1/Lateral_4"), model.selection("EDGE", "Revolution_1_1/Base_Edge_10"), model.selection("EDGE", "Revolution_1_1/Lateral_6"), model.selection("EDGE", "Revolution_1_1/Base_Edge_12"), model.selection("EDGE", "Revolution_1_1/Base_Edge_14")]) +Revolution_1 = model.addRevolution(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_1r-SketchLine_2f-SketchLine_3f-SketchLine_4f")], model.selection("EDGE", "Sketch_1/SketchLine_4"), 360, 0) +Group_1_objects = [model.selection("EDGE", "[Revolution_1_1/Generated_Face&Sketch_1/SketchLine_1][Revolution_1_1/Generated_Face&Sketch_1/SketchLine_2]"), model.selection("EDGE", "[Revolution_1_1/Generated_Face&Sketch_1/SketchLine_1][weak_name_3]"), model.selection("EDGE", "[Revolution_1_1/Generated_Face&Sketch_1/SketchLine_3][Revolution_1_1/Generated_Face&Sketch_1/SketchLine_2]"), model.selection("EDGE", "([Revolution_1_1/Generated_Face&Sketch_1/SketchLine_1][Revolution_1_1/Generated_Face&Sketch_1/SketchLine_2])([Revolution_1_1/Generated_Face&Sketch_1/SketchLine_3][Revolution_1_1/Generated_Face&Sketch_1/SketchLine_2])"), model.selection("EDGE", "[Revolution_1_1/Generated_Face&Sketch_1/SketchLine_3][weak_name_3]")] +Group_1 = model.addGroup(Part_1_doc, Group_1_objects) +model.do() model.end() # check that resulting group selection is valid diff --git a/src/FeaturesPlugin/Test/Test2197_4.py b/src/FeaturesPlugin/Test/Test2197_4.py index 23bb4ff7b..933eee108 100644 --- a/src/FeaturesPlugin/Test/Test2197_4.py +++ b/src/FeaturesPlugin/Test/Test2197_4.py @@ -51,8 +51,10 @@ SketchConstraintCoincidence_4.setName("SketchConstraintCoincidence_6") SketchConstraintCoincidence_5 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchLine_5.endPoint()) SketchConstraintCoincidence_5.setName("SketchConstraintCoincidence_7") model.do() -Revolution_1 = model.addRevolution(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_1f-SketchLine_3f-SketchLine_4f-SketchLine_5r-SketchLine_6r")], model.selection("EDGE", "Sketch_1/Edge-SketchLine_4"), 360, 0) -Group_1 = model.addGroup(Part_1_doc, [model.selection("EDGE", "Revolution_1_1/Generated_Face_5&Revolution_1_1/Generated_Face_4"), model.selection("EDGE", "Revolution_1_1/Generated_Face_4&Revolution_1_1/Generated_Face_3"), model.selection("EDGE", "Revolution_1_1/Generated_Face_3&Revolution_1_1/Generated_Face_2"), model.selection("EDGE", "Revolution_1_1/Base_Edge_6"), model.selection("EDGE", "Revolution_1_1/Base_Edge_2"), model.selection("EDGE", "Revolution_1_1/Generated_Face_4"), model.selection("EDGE", "Revolution_1_1/Generated_Face_3")]) +Revolution_1 = model.addRevolution(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_1r-SketchLine_6r-SketchLine_5r-SketchLine_3f-SketchLine_4f")], model.selection("EDGE", "Sketch_1/SketchLine_4"), 360, 0) +Group_1_objects = [model.selection("EDGE", "[Revolution_1_1/Generated_Face&Sketch_1/SketchLine_1][Revolution_1_1/Generated_Face&Sketch_1/SketchLine_6]"), model.selection("EDGE", "[Revolution_1_1/Generated_Face&Sketch_1/SketchLine_6][Revolution_1_1/Generated_Face&Sketch_1/SketchLine_5]"), model.selection("EDGE", "[Revolution_1_1/Generated_Face&Sketch_1/SketchLine_3][Revolution_1_1/Generated_Face&Sketch_1/SketchLine_5]"), model.selection("EDGE", "[Revolution_1_1/Generated_Face&Sketch_1/SketchLine_3][weak_name_3]"), model.selection("EDGE", "[Revolution_1_1/Generated_Face&Sketch_1/SketchLine_1][weak_name_3]"), model.selection("EDGE", "([Revolution_1_1/Generated_Face&Sketch_1/SketchLine_6][Revolution_1_1/Generated_Face&Sketch_1/SketchLine_5])([Revolution_1_1/Generated_Face&Sketch_1/SketchLine_1][Revolution_1_1/Generated_Face&Sketch_1/SketchLine_6])"), model.selection("EDGE", "([Revolution_1_1/Generated_Face&Sketch_1/SketchLine_3][Revolution_1_1/Generated_Face&Sketch_1/SketchLine_5])([Revolution_1_1/Generated_Face&Sketch_1/SketchLine_6][Revolution_1_1/Generated_Face&Sketch_1/SketchLine_5])")] +Group_1 = model.addGroup(Part_1_doc, Group_1_objects) +model.do() model.end() # check that resulting group selection is valid diff --git a/src/FeaturesPlugin/Test/Test2215.py b/src/FeaturesPlugin/Test/Test2215.py index 6c2b3f92d..f43d3273b 100644 --- a/src/FeaturesPlugin/Test/Test2215.py +++ b/src/FeaturesPlugin/Test/Test2215.py @@ -18,6 +18,8 @@ ## email : webmaster.salome@opencascade.com ## +# -*- coding: utf-8 -*- + from salome.shaper import model model.begin() @@ -41,8 +43,8 @@ SketchConstraintParallel_1 = Sketch_1.setParallel(SketchLine_1.result(), SketchL SketchConstraintParallel_2 = Sketch_1.setParallel(SketchLine_2.result(), SketchLine_4.result()) SketchConstraintPerpendicular_1 = Sketch_1.setPerpendicular(SketchLine_1.result(), SketchLine_4.result()) 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(), 50, 0) -Plane_4 = model.addPlane(Part_1_doc, model.selection("FACE", "Extrusion_1_1/From_Face_1"), 25, True) +Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_4r-SketchLine_3r-SketchLine_2r-SketchLine_1r")], model.selection(), 50, 0) +Plane_4 = model.addPlane(Part_1_doc, model.selection("FACE", "Extrusion_1_1/From_Face"), 25, True) Sketch_2 = model.addSketch(Part_1_doc, model.selection("FACE", "Plane_1")) SketchLine_5 = Sketch_2.addLine(84.67753244325934, -72.65003691291119, -28.95543815719345, -72.65003691291119) SketchLine_6 = Sketch_2.addLine(-28.95543815719345, -72.65003691291119, -28.95543815719345, 10.01640181835304) @@ -57,7 +59,8 @@ SketchConstraintVertical_2 = Sketch_2.setVertical(SketchLine_6.result()) SketchConstraintHorizontal_2 = Sketch_2.setHorizontal(SketchLine_7.result()) SketchConstraintVertical_3 = Sketch_2.setVertical(SketchLine_8.result()) model.do() -Wire_1 = model.addWire(Part_1_doc, [model.selection("EDGE", "Sketch_2/Edge-SketchLine_6"), model.selection("EDGE", "Sketch_2/Edge-SketchLine_8"), model.selection("EDGE", "Sketch_2/Edge-SketchLine_5"), model.selection("EDGE", "Sketch_2/Edge-SketchLine_7")]) +Wire_1_objects = [model.selection("EDGE", "Sketch_2/SketchLine_6"), model.selection("EDGE", "Sketch_2/SketchLine_8"), model.selection("EDGE", "Sketch_2/SketchLine_5"), model.selection("EDGE", "Sketch_2/SketchLine_7")] +Wire_1 = model.addWire(Part_1_doc, Wire_1_objects) Face_1 = model.addFace(Part_1_doc, [model.selection("WIRE", "Wire_1_1")]) Partition_1 = model.addPartition(Part_1_doc, [model.selection("SOLID", "Extrusion_1_1"), model.selection("FACE", "Face_1_1")]) Sketch_3 = model.addSketch(Part_1_doc, model.defaultPlane("XOY")) @@ -77,7 +80,7 @@ SketchConstraintParallel_3 = Sketch_3.setParallel(SketchLine_9.result(), SketchL SketchConstraintParallel_4 = Sketch_3.setParallel(SketchLine_10.result(), SketchLine_12.result()) SketchConstraintPerpendicular_2 = Sketch_3.setPerpendicular(SketchLine_9.result(), SketchLine_12.result()) model.do() -Extrusion_2 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_3/Face-SketchLine_9r-SketchLine_10r-SketchLine_11r-SketchLine_12r")], model.selection(), 50, 0) -Boolean_1 = model.addCut(Part_1_doc, [model.selection("COMPSOLID", "Partition_1_1_1")], [model.selection("SOLID", "Extrusion_2_1")]) +Extrusion_2 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_3/Face-SketchLine_12r-SketchLine_11r-SketchLine_10r-SketchLine_9r")], model.selection(), 50, 0) +Cut_1 = model.addCut(Part_1_doc, [model.selection("COMPSOLID", "Partition_1_1_1")], [model.selection("SOLID", "Extrusion_2_1")]) model.do() model.end() diff --git a/src/FeaturesPlugin/Test/Test2222.py b/src/FeaturesPlugin/Test/Test2222.py index ccbab14c6..3143406a9 100644 --- a/src/FeaturesPlugin/Test/Test2222.py +++ b/src/FeaturesPlugin/Test/Test2222.py @@ -40,10 +40,12 @@ SketchConstraintVertical_1 = Sketch_1.setVertical(SketchLine_2.result()) SketchConstraintHorizontal_2 = Sketch_1.setHorizontal(SketchLine_3.result()) SketchConstraintVertical_2 = Sketch_1.setVertical(SketchLine_4.result()) model.do() -Face_1 = model.addFace(Part_1_doc, [model.selection("EDGE", "Sketch_1/Edge-SketchLine_2"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_3"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_1"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_4")]) +Face_1_objects = [model.selection("EDGE", "Sketch_1/SketchLine_2"), model.selection("EDGE", "Sketch_1/SketchLine_3"), model.selection("EDGE", "Sketch_1/SketchLine_1"), model.selection("EDGE", "Sketch_1/SketchLine_4")] +Face_1 = model.addFace(Part_1_doc, Face_1_objects) Plane_4 = model.addPlane(Part_1_doc, model.selection("FACE", "PartSet/YOZ"), 1, False) Partition_1 = model.addPartition(Part_1_doc, [model.selection("FACE", "Face_1_1"), model.selection("FACE", "Plane_1")]) -Group_1 = model.addGroup(Part_1_doc, [model.selection("EDGE", "Partition_1_1_2/Modified_Edge_1_1")]) +Group_1 = model.addGroup(Part_1_doc, [model.selection("EDGE", "Partition_1_1_2/Modified_Edge&Face_1_1/Edge_4")]) +model.do() model.end() # check that resulting group selection is valid diff --git a/src/FeaturesPlugin/Test/Test2231.py b/src/FeaturesPlugin/Test/Test2231.py index f51ba4f89..f306093b7 100644 --- a/src/FeaturesPlugin/Test/Test2231.py +++ b/src/FeaturesPlugin/Test/Test2231.py @@ -18,6 +18,8 @@ ## email : webmaster.salome@opencascade.com ## +# -*- coding: utf-8 -*- + from salome.shaper import model model.begin() @@ -72,7 +74,8 @@ SketchConstraintVertical_6 = Sketch_1.setVertical(SketchLine_12.result()) SketchConstraintHorizontal_7 = Sketch_1.setHorizontal(SketchLine_13.result()) SketchConstraintVertical_7 = Sketch_1.setVertical(SketchLine_14.result()) model.do() -Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_2f-SketchLine_5f-SketchLine_6f-SketchLine_7f"), model.selection("FACE", "Sketch_1/Face-SketchLine_1r-SketchLine_2r-SketchLine_3r-SketchLine_4r"), model.selection("FACE", "Sketch_1/Face-SketchLine_7r-SketchLine_8r-SketchLine_9r-SketchLine_10r"), model.selection("FACE", "Sketch_1/Face-SketchLine_11f-SketchLine_12f-SketchLine_13f-SketchLine_14f")], model.selection(), 10, 0) +Extrusion_1_objects = [model.selection("FACE", "Sketch_1/Face-SketchLine_2f-SketchLine_5f-SketchLine_6f-SketchLine_7f"), model.selection("FACE", "Sketch_1/Face-SketchLine_4r-SketchLine_3r-SketchLine_2r-SketchLine_1r"), model.selection("FACE", "Sketch_1/Face-SketchLine_10r-SketchLine_9r-SketchLine_8r-SketchLine_7r"), model.selection("FACE", "Sketch_1/Face-SketchLine_11f-SketchLine_12f-SketchLine_13f-SketchLine_14f")] +Extrusion_1 = model.addExtrusion(Part_1_doc, Extrusion_1_objects, model.selection(), 10, 0) Partition_1 = model.addPartition(Part_1_doc, [model.selection("SOLID", "Extrusion_1_1"), model.selection("COMPSOLID", "Extrusion_1_2")]) model.do() model.end() diff --git a/src/FeaturesPlugin/Test/Test2233.py b/src/FeaturesPlugin/Test/Test2233.py index c4015977d..1ece01748 100644 --- a/src/FeaturesPlugin/Test/Test2233.py +++ b/src/FeaturesPlugin/Test/Test2233.py @@ -37,8 +37,9 @@ SketchLine_2 = Sketch_1.addLine(0, 50, 0, -50) SketchConstraintCoincidence_4 = Sketch_1.setCoincident(SketchArc_1.startPoint(), SketchLine_2.startPoint()) SketchConstraintCoincidence_5 = Sketch_1.setCoincident(SketchLine_2.endPoint(), SketchArc_1.endPoint()) model.do() -Revolution_1 = model.addRevolution(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchArc_1_2f-SketchLine_2f")], model.selection("EDGE", "Sketch_1/Edge-SketchLine_2"), 360, 0) -Group_1 = model.addGroup(Part_1_doc, [model.selection("VERTEX", "Revolution_1_1/Vertex_6"), model.selection("VERTEX", "Revolution_1_1/Vertex_8")]) +Revolution_1 = model.addRevolution(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchArc_1_2f-SketchLine_2f")], model.selection("EDGE", "Sketch_1/SketchLine_2"), 360, 0) +Group_1 = model.addGroup(Part_1_doc, [model.selection("VERTEX", "[[Revolution_1_1/Generated_Face&Sketch_1/SketchArc_1_2][weak_name_3]][[Revolution_1_1/Generated_Face&Sketch_1/SketchArc_1_2][weak_name_1]]"), model.selection("VERTEX", "[[Revolution_1_1/Generated_Face&Sketch_1/SketchArc_1_2][weak_name_2]][[Revolution_1_1/Generated_Face&Sketch_1/SketchArc_1_2][weak_name_3]]")]) +model.do() model.end() # check that resulting group selection is valid and names are different diff --git a/src/FeaturesPlugin/Test/Test2240.py b/src/FeaturesPlugin/Test/Test2240.py index dd709a1bc..b0f1ae18f 100644 --- a/src/FeaturesPlugin/Test/Test2240.py +++ b/src/FeaturesPlugin/Test/Test2240.py @@ -18,6 +18,8 @@ ## email : webmaster.salome@opencascade.com ## +# -*- coding: utf-8 -*- + from salome.shaper import model model.begin() @@ -52,20 +54,20 @@ SketchConstraintHorizontal_2 = Sketch_1.setHorizontal(SketchLine_4.result()) SketchConstraintHorizontal_3 = Sketch_1.setHorizontal(SketchLine_6.result()) SketchConstraintVertical_1 = Sketch_1.setVertical(SketchLine_3.result()) SketchConstraintVertical_2 = Sketch_1.setVertical(SketchLine_5.result()) -SketchArc_1 = Sketch_1.addArc(4.151438510550382e-034, -3.089278765476956e-034, 81.26217508737108, 0, 0, 81.26217508737108, False) +SketchArc_1 = Sketch_1.addArc(4.151438510550382e-34, -3.089278765476956e-34, 81.26217508737108, 0, 0, 81.26217508737108, False) SketchConstraintCoincidence_12 = Sketch_1.setCoincident(SketchLine_2.startPoint(), SketchArc_1.center()) SketchConstraintCoincidence_13 = Sketch_1.setCoincident(SketchLine_9.endPoint(), SketchArc_1.startPoint()) SketchConstraintCoincidence_14 = Sketch_1.setCoincident(SketchLine_2.result(), SketchArc_1.endPoint()) SketchConstraintCoincidence_15 = Sketch_1.setCoincident(SketchLine_10.endPoint(), SketchArc_1.endPoint()) SketchConstraintVertical_3 = Sketch_1.setVertical(SketchLine_7.result()) -SketchArc_2 = Sketch_1.addArc(4.151438510550382e-034, -3.089278765476956e-034, 76.26217508737108, 0, 0, 76.26217508737108, False) +SketchArc_2 = Sketch_1.addArc(4.151438510550382e-34, -3.089278765476956e-34, 76.26217508737108, 0, 0, 76.26217508737108, False) SketchConstraintCoincidence_16 = Sketch_1.setCoincident(SketchLine_2.startPoint(), SketchArc_2.center()) SketchConstraintCoincidence_16.setName("SketchConstraintCoincidence_23") SketchConstraintCoincidence_17 = Sketch_1.setCoincident(SketchLine_9.result(), SketchArc_2.startPoint()) SketchConstraintCoincidence_17.setName("SketchConstraintCoincidence_24") SketchConstraintCoincidence_18 = Sketch_1.setCoincident(SketchLine_10.result(), SketchArc_2.endPoint()) SketchConstraintCoincidence_18.setName("SketchConstraintCoincidence_25") -SketchConstraintDistance_1 = Sketch_1.setDistance(SketchArc_1.endPoint(), SketchArc_2.endPoint(), 5) +SketchConstraintDistance_1 = Sketch_1.setDistance(SketchArc_1.endPoint(), SketchArc_2.endPoint(), 5, False) SketchConstraintLength_1 = Sketch_1.setLength(SketchLine_7.result(), "2*length_assemblage") SketchConstraintLength_1.setName("SketchConstraintLength_2") SketchConstraintLength_2 = Sketch_1.setLength(SketchLine_6.result(), "length_assemblage") @@ -93,27 +95,35 @@ SketchCircle_10 = Sketch_2.addCircle(49.58498153094326, 15.18789884296047, 2.552 SketchCircle_11 = Sketch_2.addCircle(66.22695092615982, 10.77677442495125, 4.536925074373645) SketchCircle_12 = Sketch_2.addCircle(50.98852111849166, 6.165144351577979, 3.547307159201085) model.do() -Face_1 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_1/Wire-SketchLine_1f-SketchLine_3f-SketchLine_4f-SketchLine_5f-SketchLine_6f-SketchLine_7f-SketchLine_9f-SketchLine_10r-SketchArc_2_2f")]) -Face_2 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_1/Wire-SketchLine_9f-SketchLine_10r-SketchArc_1_2f-SketchArc_2_2r")]) -Face_3 = model.addFace(Part_1_doc, [model.selection("EDGE", "Sketch_2/Edge-SketchCircle_1_2"), model.selection("EDGE", "Sketch_2/Edge-SketchCircle_2_2"), model.selection("EDGE", "Sketch_2/Edge-SketchCircle_3_2"), model.selection("EDGE", "Sketch_2/Edge-SketchCircle_4_2"), model.selection("EDGE", "Sketch_2/Edge-SketchCircle_5_2"), model.selection("EDGE", "Sketch_2/Edge-SketchCircle_6_2"), model.selection("EDGE", "Sketch_2/Edge-SketchCircle_7_2"), model.selection("EDGE", "Sketch_2/Edge-SketchCircle_9_2"), model.selection("EDGE", "Sketch_2/Edge-SketchCircle_8_2"), model.selection("EDGE", "Sketch_2/Edge-SketchCircle_10_2"), model.selection("EDGE", "Sketch_2/Edge-SketchCircle_12_2"), model.selection("EDGE", "Sketch_2/Edge-SketchCircle_11_2")]) -Face_4 = model.addFace(Part_1_doc, [model.selection("EDGE", "Sketch_2/Edge-SketchCircle_1_2"), model.selection("EDGE", "Sketch_2/Edge-SketchCircle_2_2"), model.selection("EDGE", "Sketch_2/Edge-SketchCircle_3_2"), model.selection("EDGE", "Sketch_2/Edge-SketchCircle_4_2"), model.selection("EDGE", "Sketch_2/Edge-SketchCircle_5_2"), model.selection("EDGE", "Sketch_2/Edge-SketchCircle_7_2"), model.selection("EDGE", "Sketch_2/Edge-SketchCircle_6_2"), model.selection("EDGE", "Sketch_2/Edge-SketchCircle_9_2"), model.selection("EDGE", "Sketch_2/Edge-SketchCircle_8_2"), model.selection("EDGE", "Sketch_2/Edge-SketchCircle_10_2"), model.selection("EDGE", "Sketch_2/Edge-SketchCircle_12_2"), model.selection("EDGE", "Sketch_2/Edge-SketchCircle_11_2"), model.selection("WIRE", "Sketch_1/Wire-SketchLine_1f-SketchLine_3f-SketchLine_4f-SketchLine_5f-SketchLine_6f-SketchLine_7f-SketchLine_9f-SketchLine_10r-SketchArc_2_2f")]) -Partition_1 = model.addPartition(Part_1_doc, [model.selection("FACE", "Face_1_1"), model.selection("FACE", "Face_2_1"), model.selection("FACE", "Face_3_1"), model.selection("FACE", "Face_3_2"), model.selection("FACE", "Face_3_3"), model.selection("FACE", "Face_3_4"), model.selection("FACE", "Face_3_5"), model.selection("FACE", "Face_3_6"), model.selection("FACE", "Face_3_7"), model.selection("FACE", "Face_3_8"), model.selection("FACE", "Face_3_9"), model.selection("FACE", "Face_3_10"), model.selection("FACE", "Face_3_11"), model.selection("FACE", "Face_3_12"), model.selection("FACE", "Face_4_1")]) -Group_1 = model.addGroup(Part_1_doc, [model.selection("FACE", "Face_2_1"), model.selection("FACE", "Face_3_7"), model.selection("FACE", "Face_3_5"), model.selection("FACE", "Face_3_3"), model.selection("FACE", "Face_3_4"), model.selection("FACE", "Face_3_1"), model.selection("FACE", "Face_3_2"), model.selection("FACE", "Face_3_6"), model.selection("FACE", "Face_3_11"), model.selection("FACE", "Face_3_10"), model.selection("FACE", "Face_3_8"), model.selection("FACE", "Face_3_9"), model.selection("FACE", "Face_3_12")]) +Face_1 = model.addFace(Part_1_doc, [model.selection("WIRE", "[Sketch_1/SubEdge&Sketch_1/SketchLine_1][Sketch_1/SubEdge&Sketch_1/SketchLine_3][Sketch_1/SubEdge&Sketch_1/SketchLine_4][Sketch_1/SubEdge&Sketch_1/SketchLine_5][Sketch_1/SubEdge&Sketch_1/SketchLine_6][Sketch_1/SubEdge&Sketch_1/SketchLine_7][Sketch_1/SubEdge&Sketch_1/SketchLine_9][Sketch_1/SketchArc_2_2][Sketch_1/SubEdge&Sketch_1/SketchLine_10]")]) +Face_2 = model.addFace(Part_1_doc, [model.selection("WIRE", "[Sketch_1/SubEdge&Sketch_1/SketchLine_9][Sketch_1/SubEdge&Sketch_1/SketchArc_1_2][Sketch_1/SubEdge&Sketch_1/SketchLine_10][Sketch_1/SketchArc_2_2]")]) +Face_3_objects = [model.selection("EDGE", "Sketch_2/SketchCircle_1_2"), model.selection("EDGE", "Sketch_2/SketchCircle_2_2"), model.selection("EDGE", "Sketch_2/SketchCircle_3_2"), model.selection("EDGE", "Sketch_2/SketchCircle_4_2"), model.selection("EDGE", "Sketch_2/SketchCircle_5_2"), model.selection("EDGE", "Sketch_2/SketchCircle_6_2"), model.selection("EDGE", "Sketch_2/SketchCircle_7_2"), model.selection("EDGE", "Sketch_2/SketchCircle_9_2"), model.selection("EDGE", "Sketch_2/SketchCircle_8_2"), model.selection("EDGE", "Sketch_2/SketchCircle_10_2"), model.selection("EDGE", "Sketch_2/SketchCircle_12_2"), model.selection("EDGE", "Sketch_2/SketchCircle_11_2")] +Face_3 = model.addFace(Part_1_doc, Face_3_objects) +Face_4_objects = [model.selection("EDGE", "Sketch_2/SketchCircle_1_2"), model.selection("EDGE", "Sketch_2/SketchCircle_2_2"), model.selection("EDGE", "Sketch_2/SketchCircle_3_2"), model.selection("EDGE", "Sketch_2/SketchCircle_4_2"), model.selection("EDGE", "Sketch_2/SketchCircle_5_2"), model.selection("EDGE", "Sketch_2/SketchCircle_7_2"), model.selection("EDGE", "Sketch_2/SketchCircle_6_2"), model.selection("EDGE", "Sketch_2/SketchCircle_9_2"), model.selection("EDGE", "Sketch_2/SketchCircle_8_2"), model.selection("EDGE", "Sketch_2/SketchCircle_10_2"), model.selection("EDGE", "Sketch_2/SketchCircle_12_2"), model.selection("EDGE", "Sketch_2/SketchCircle_11_2"), model.selection("WIRE", "[Sketch_1/SubEdge&Sketch_1/SketchLine_1][Sketch_1/SubEdge&Sketch_1/SketchLine_3][Sketch_1/SubEdge&Sketch_1/SketchLine_4][Sketch_1/SubEdge&Sketch_1/SketchLine_5][Sketch_1/SubEdge&Sketch_1/SketchLine_6][Sketch_1/SubEdge&Sketch_1/SketchLine_7][Sketch_1/SubEdge&Sketch_1/SketchLine_9][Sketch_1/SketchArc_2_2][Sketch_1/SubEdge&Sketch_1/SketchLine_10]")] +Face_4 = model.addFace(Part_1_doc, Face_4_objects) +Partition_1_objects = [model.selection("FACE", "Face_1_1"), model.selection("FACE", "Face_2_1"), model.selection("FACE", "Face_3_1"), model.selection("FACE", "Face_3_2"), model.selection("FACE", "Face_3_3"), model.selection("FACE", "Face_3_4"), model.selection("FACE", "Face_3_5"), model.selection("FACE", "Face_3_6"), model.selection("FACE", "Face_3_7"), model.selection("FACE", "Face_3_8"), model.selection("FACE", "Face_3_9"), model.selection("FACE", "Face_3_10"), model.selection("FACE", "Face_3_11"), model.selection("FACE", "Face_3_12"), model.selection("FACE", "Face_4_1")] +Partition_1 = model.addPartition(Part_1_doc, Partition_1_objects) +Group_1_objects = [model.selection("FACE", "Face_2_1"), model.selection("FACE", "Face_3_7"), model.selection("FACE", "Face_3_5"), model.selection("FACE", "Face_3_3"), model.selection("FACE", "Face_3_4"), model.selection("FACE", "Face_3_1"), model.selection("FACE", "Face_3_2"), model.selection("FACE", "Face_3_6"), model.selection("FACE", "Face_3_11"), model.selection("FACE", "Face_3_10"), model.selection("FACE", "Face_3_8"), model.selection("FACE", "Face_3_9"), model.selection("FACE", "Face_3_12")] +Group_1 = model.addGroup(Part_1_doc, Group_1_objects) Group_1.result().setName("eau") Group_1.result().setColor(0, 170, 255) Group_2 = model.addGroup(Part_1_doc, [model.selection("FACE", "Face_4_1")]) Group_2.result().setName("acier") Group_2.result().setColor(170, 85, 0) -Sketch_3 = model.addSketch(Part_1_doc, model.selection("FACE", "PartSet/XOY")) +Sketch_3 = model.addSketch(Part_1_doc, model.standardPlane("XOY")) SketchLine_11 = Sketch_3.addLine(40, 0, 30, 0) -SketchPoint_1 = Sketch_3.addPoint(model.selection("VERTEX", "Partition_1_1_1/Modified_Edge_14_15&Partition_1_1_1/Modified_Edge_14_16")) +SketchPoint_1 = Sketch_3.addPoint(model.selection("VERTEX", "[Partition_1_1_1/Modified_Edge&Face_4_1/Edge_7&Face_1_1/Edge_7][Partition_1_1_1/Modified_Edge&Face_4_1/Edge_6&Face_1_1/Edge_6]")) SketchConstraintCoincidence_19 = Sketch_3.setCoincident(SketchLine_11.endPoint(), SketchPoint_1.result()) +SketchConstraintCoincidence_19.setName("SketchConstraintCoincidence_19") SketchLine_12 = Sketch_3.addLine(30, 0, 30, 10) SketchLine_13 = Sketch_3.addLine(30, 10, 40, 10) SketchLine_14 = Sketch_3.addLine(40, 10, 40, 0) SketchConstraintCoincidence_20 = Sketch_3.setCoincident(SketchLine_14.endPoint(), SketchLine_11.startPoint()) +SketchConstraintCoincidence_20.setName("SketchConstraintCoincidence_20") SketchConstraintCoincidence_21 = Sketch_3.setCoincident(SketchLine_11.endPoint(), SketchLine_12.startPoint()) +SketchConstraintCoincidence_21.setName("SketchConstraintCoincidence_21") SketchConstraintCoincidence_22 = Sketch_3.setCoincident(SketchLine_12.endPoint(), SketchLine_13.startPoint()) +SketchConstraintCoincidence_22.setName("SketchConstraintCoincidence_22") SketchConstraintCoincidence_23 = Sketch_3.setCoincident(SketchLine_13.endPoint(), SketchLine_14.startPoint()) SketchConstraintCoincidence_23.setName("SketchConstraintCoincidence_26") SketchConstraintHorizontal_4 = Sketch_3.setHorizontal(SketchLine_11.result()) @@ -125,21 +135,23 @@ SketchConstraintLength_3.setName("SketchConstraintLength_1") SketchConstraintEqual_5 = Sketch_3.setEqual(SketchLine_13.result(), SketchLine_14.result()) SketchConstraintEqual_5.setName("SketchConstraintEqual_1") model.do() -Face_5 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_3/Wire-SketchLine_11r-SketchLine_12r-SketchLine_13r-SketchLine_14r")]) -MultiTranslation_1 = model.addMultiTranslation(Part_1_doc, [model.selection("FACE", "Face_5_1")], model.selection("EDGE", "Sketch_1/Edge-SketchLine_9"), "length_assemblage", 4, model.selection("EDGE", "PartSet/OY"), "length_assemblage", 2) -Recover_1 = model.addRecover(Part_1_doc, MultiTranslation_1, [Face_5.result()]) -Translation_1 = model.addTranslation(Part_1_doc, [model.selection("FACE", "Recover_1_1")], model.selection("VERTEX", "Sketch_3/Vertex-SketchPoint_1-SketchLine_12s-SketchLine_11e"), model.selection("VERTEX", "Sketch_1/Vertex-SketchLine_6s-SketchLine_5e")) -MultiTranslation_2 = model.addMultiTranslation(Part_1_doc, [model.selection("FACE", "Translation_1_1")], model.selection("EDGE", "PartSet/OX"), "length_assemblage", 4, model.selection("EDGE", "PartSet/OY"), "length_assemblage", 2) -Recover_2 = model.addRecover(Part_1_doc, MultiTranslation_1, [Face_5.result()]) -Translation_2 = model.addTranslation(Part_1_doc, [model.selection("FACE", "Recover_2_1")], model.selection("VERTEX", "Sketch_3/Vertex-SketchPoint_1-SketchLine_12s-SketchLine_11e"), model.selection("VERTEX", "Sketch_1/Vertex-SketchLine_4s-SketchLine_3e")) -MultiTranslation_3 = model.addMultiTranslation(Part_1_doc, [model.selection("FACE", "Translation_2_1")], model.selection("EDGE", "PartSet/OX"), "length_assemblage", 4) -Recover_3 = model.addRecover(Part_1_doc, MultiTranslation_1, [Face_5.result()]) -Translation_3 = model.addTranslation(Part_1_doc, [model.selection("FACE", "Recover_3_1")], model.selection("VERTEX", "Sketch_1/Vertex-SketchLine_9s-SketchLine_7e"), model.selection("VERTEX", "LinearCopy_3_1/Translated_Edge_1_4&LinearCopy_3_1/Translated_Edge_1_1")) -MultiTranslation_4 = model.addMultiTranslation(Part_1_doc, [model.selection("FACE", "Translation_3_1")], model.selection("EDGE", "PartSet/OX"), "length_assemblage", 3) -Recover_4 = model.addRecover(Part_1_doc, MultiTranslation_1, [Face_5.result()]) -Translation_4 = model.addTranslation(Part_1_doc, [model.selection("FACE", "Recover_4_1")], model.selection("VERTEX", "Sketch_1/Vertex-SketchLine_9s-SketchLine_7e"), model.selection("VERTEX", "Sketch_1/Vertex-SketchLine_1s-SketchLine_10s")) -MultiTranslation_5 = model.addMultiTranslation(Part_1_doc, [model.selection("FACE", "Translation_4_1")], model.selection("EDGE", "PartSet/OX"), "length_assemblage", 2) -Partition_2 = model.addPartition(Part_1_doc, [model.selection("COMPOUND", "Partition_1_1"), model.selection("COMPOUND", "LinearCopy_1_1"), model.selection("COMPOUND", "LinearCopy_2_1"), model.selection("COMPOUND", "LinearCopy_3_1"), model.selection("COMPOUND", "LinearCopy_4_1"), model.selection("COMPOUND", "LinearCopy_5_1")]) +Face_5 = model.addFace(Part_1_doc, [model.selection("WIRE", "[Sketch_3/SubEdge&Sketch_3/SketchLine_14][Sketch_3/SubEdge&Sketch_3/SketchLine_13][Sketch_3/SubEdge&Sketch_3/SketchLine_12][Sketch_3/SubEdge&Sketch_3/SketchLine_11]")]) +LinearCopy_1 = model.addMultiTranslation(Part_1_doc, [model.selection("FACE", "Face_5_1")], model.selection("EDGE", "Sketch_1/SketchLine_9"), "length_assemblage", 4, model.selection("EDGE", "PartSet/OY"), "length_assemblage", 2) +Recover_1 = model.addRecover(Part_1_doc, LinearCopy_1, [Face_5.result()]) +Translation_1 = model.addTranslation(Part_1_doc, [model.selection("FACE", "Recover_1_1")], model.selection("VERTEX", "Sketch_3/SketchLine_11_EndVertex"), model.selection("VERTEX", "Sketch_1/SketchLine_5_EndVertex")) +LinearCopy_2 = model.addMultiTranslation(Part_1_doc, [model.selection("FACE", "Translation_1_1")], model.selection("EDGE", "PartSet/OX"), "length_assemblage", 4, model.selection("EDGE", "PartSet/OY"), "length_assemblage", 2) +Recover_2 = model.addRecover(Part_1_doc, LinearCopy_1, [Face_5.result()]) +Translation_2 = model.addTranslation(Part_1_doc, [model.selection("FACE", "Recover_2_1")], model.selection("VERTEX", "Sketch_3/SketchLine_11_EndVertex"), model.selection("VERTEX", "Sketch_1/SketchLine_3_EndVertex")) +LinearCopy_3 = model.addMultiTranslation(Part_1_doc, [model.selection("FACE", "Translation_2_1")], model.selection("EDGE", "PartSet/OX"), "length_assemblage", 4) +Recover_3 = model.addRecover(Part_1_doc, LinearCopy_1, [Face_5.result()]) +Translation_3 = model.addTranslation(Part_1_doc, [model.selection("FACE", "Recover_3_1")], model.selection("VERTEX", "Sketch_1/SketchLine_7_EndVertex"), model.selection("VERTEX", "[LinearCopy_3_1_1/ME:Translated_Edge&Recover_2_1/Shape_4][LinearCopy_3_1_1/ME:Translated_Edge&Recover_2_1/Shape_1]")) +LinearCopy_4 = model.addMultiTranslation(Part_1_doc, [model.selection("FACE", "Translation_3_1")], model.selection("EDGE", "PartSet/OX"), "length_assemblage", 3) +Recover_4 = model.addRecover(Part_1_doc, LinearCopy_1, [Face_5.result()]) +Translation_4 = model.addTranslation(Part_1_doc, [model.selection("FACE", "Recover_4_1")], model.selection("VERTEX", "Sketch_1/SketchLine_7_EndVertex"), model.selection("VERTEX", "Sketch_1/SketchLine_1_StartVertex")) +LinearCopy_5 = model.addMultiTranslation(Part_1_doc, [model.selection("FACE", "Translation_4_1")], model.selection("EDGE", "PartSet/OX"), "length_assemblage", 2) +Partition_2_objects = [model.selection("COMPOUND", "Partition_1_1"), model.selection("COMPOUND", "LinearCopy_1_1"), model.selection("COMPOUND", "LinearCopy_2_1"), model.selection("COMPOUND", "LinearCopy_3_1"), model.selection("COMPOUND", "LinearCopy_4_1"), model.selection("COMPOUND", "LinearCopy_5_1")] +Partition_2 = model.addPartition(Part_1_doc, Partition_2_objects) +model.do() model.end() # check that partition constructed correctly diff --git a/src/FeaturesPlugin/Test/Test2246.py b/src/FeaturesPlugin/Test/Test2246.py index c178e45ab..5a0cad94d 100644 --- a/src/FeaturesPlugin/Test/Test2246.py +++ b/src/FeaturesPlugin/Test/Test2246.py @@ -37,9 +37,10 @@ SketchLine_2 = Sketch_1.addLine(0, -62, 0, 62) SketchConstraintCoincidence_4 = Sketch_1.setCoincident(SketchArc_1.endPoint(), SketchLine_2.startPoint()) SketchConstraintCoincidence_5 = Sketch_1.setCoincident(SketchArc_1.startPoint(), SketchLine_2.endPoint()) model.do() -Revolution_1 = model.addRevolution(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchArc_1_2f-SketchLine_2f")], model.selection("EDGE", "Sketch_1/Edge-SketchLine_2"), 360, 0) +Revolution_1 = model.addRevolution(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchArc_1_2f-SketchLine_2f")], model.selection("EDGE", "Sketch_1/SketchLine_2"), 360, 0) Translation_1 = model.addTranslation(Part_1_doc, [model.selection("SOLID", "Revolution_1_1")], model.selection("EDGE", "PartSet/OY"), 150) -Group_1 = model.addGroup(Part_1_doc, [model.selection("VERTEX", "Translation_1_1/Translated_Vertex_1"), model.selection("VERTEX", "Translation_1_1/Translated_Vertex_2")]) +Group_1 = model.addGroup(Part_1_doc, [model.selection("VERTEX", "[[Translation_1_1/MF:Translated&Sketch_1/SketchArc_1_2][weak_name_2]][[Translation_1_1/MF:Translated&Sketch_1/SketchArc_1_2][weak_name_1]]"), model.selection("VERTEX", "[[Translation_1_1/MF:Translated&Sketch_1/SketchArc_1_2][weak_name_3]][[Translation_1_1/MF:Translated&Sketch_1/SketchArc_1_2][weak_name_1]]")]) +model.do() model.end() # check that resulting group selection is valid, names exist and different diff --git a/src/FeaturesPlugin/Test/Test2248.py b/src/FeaturesPlugin/Test/Test2248.py index 20e48f5b9..c2a820ad2 100644 --- a/src/FeaturesPlugin/Test/Test2248.py +++ b/src/FeaturesPlugin/Test/Test2248.py @@ -48,7 +48,9 @@ SketchConstraintTangent_2 = Sketch_1.setTangent(SketchLine_3.result(), SketchArc SketchCircle_1 = Sketch_1.addCircle(-13.45056286489504, 169.4770920976776, 150.6703210346195) model.do() Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("COMPOUND", "Sketch_1")], model.selection(), 10, 0) -Group_1 = model.addGroup(Part_1_doc, [model.selection("EDGE", "Extrusion_1_1/Generated_Face_3&Extrusion_1_1/To_Face_2"), model.selection("EDGE", "Extrusion_1_1/Generated_Face_4&Extrusion_1_1/From_Face_2"), model.selection("EDGE", "Extrusion_1_1/Generated_Face_4&Extrusion_1_1/To_Face_2"), model.selection("EDGE", "Extrusion_1_1/Generated_Face_3&Extrusion_1_1/From_Face_2"), model.selection("EDGE", "Extrusion_1_1/Generated_Face_10&Extrusion_1_1/To_Face_3"), model.selection("EDGE", "Extrusion_1_1/Generated_Face_10&Extrusion_1_1/From_Face_3"), model.selection("EDGE", "Extrusion_1_1/Generated_Face_3&Extrusion_1_1/To_Face_3"), model.selection("EDGE", "Extrusion_1_1/Generated_Face_3&Extrusion_1_1/From_Face_3"), model.selection("EDGE", "Extrusion_1_1/Generated_Face_3&Extrusion_1_1/Generated_Face_10"), model.selection("EDGE", "Extrusion_1_1/Generated_Face_9&Extrusion_1_1/Generated_Face_10"), model.selection("EDGE", "Extrusion_1_1/Generated_Face_9&Extrusion_1_1/To_Face_3"), model.selection("EDGE", "Extrusion_1_1/Generated_Face_9&Extrusion_1_1/From_Face_3"), model.selection("EDGE", "Extrusion_1_1/Generated_Face_3&Extrusion_1_1/Generated_Face_9"), model.selection("EDGE", "Extrusion_1_1/Generated_Face_2&Extrusion_1_1/Generated_Face_1"), model.selection("EDGE", "Extrusion_1_1/Generated_Face_2&Extrusion_1_1/To_Face_4"), model.selection("EDGE", "Extrusion_1_1/Generated_Face_2&Extrusion_1_1/From_Face_4"), model.selection("EDGE", "Extrusion_1_1/Generated_Face_7&Extrusion_1_1/From_Face_4"), model.selection("EDGE", "Extrusion_1_1/Generated_Face_7&Extrusion_1_1/To_Face_4"), model.selection("EDGE", "Extrusion_1_1/Generated_Face_2&Extrusion_1_1/Generated_Face_7"), model.selection("EDGE", "Extrusion_1_1/Generated_Face_7&Extrusion_1_1/Generated_Face_6"), model.selection("EDGE", "Extrusion_1_1/Generated_Face_6&Extrusion_1_1/From_Face_4"), model.selection("EDGE", "Extrusion_1_1/Generated_Face_6&Extrusion_1_1/To_Face_4"), model.selection("EDGE", "Extrusion_1_1/Generated_Face_1&Extrusion_1_1/To_Face_4"), model.selection("EDGE", "Extrusion_1_1/Generated_Face_1&Extrusion_1_1/From_Face_4"), model.selection("EDGE", "Extrusion_1_1/Generated_Face_6&Extrusion_1_1/Generated_Face_1"), model.selection("EDGE", "Extrusion_1_1/Generated_Face_5&Extrusion_1_1/To_Face_1"), model.selection("EDGE", "Extrusion_1_1/Generated_Face_5&Extrusion_1_1/From_Face_1"), model.selection("EDGE", "Extrusion_1_1/Generated_Face_11&Extrusion_1_1/Generated_Face_5"), model.selection("EDGE", "Extrusion_1_1/Generated_Face_11&Extrusion_1_1/To_Face_1"), model.selection("EDGE", "Extrusion_1_1/Generated_Face_11&Extrusion_1_1/From_Face_1"), model.selection("EDGE", "Extrusion_1_1/Generated_Face_11&Extrusion_1_1/Generated_Face_10"), model.selection("EDGE", "Extrusion_1_1/Generated_Face_6&Extrusion_1_1/Generated_Face_5"), model.selection("EDGE", "Extrusion_1_1/Generated_Face_10&Extrusion_1_1/From_Face_1"), model.selection("EDGE", "Extrusion_1_1/Generated_Face_10&Extrusion_1_1/To_Face_1"), model.selection("EDGE", "Extrusion_1_1/Generated_Face_6&Extrusion_1_1/From_Face_1"), model.selection("EDGE", "Extrusion_1_1/Generated_Face_6&Extrusion_1_1/To_Face_1"), model.selection("EDGE", "Extrusion_1_1/Generated_Face_7&Extrusion_1_1/Generated_Face_6"), model.selection("EDGE", "Extrusion_1_1/Generated_Face_7&Extrusion_1_1/To_Face_1"), model.selection("EDGE", "Extrusion_1_1/Generated_Face_7&Extrusion_1_1/From_Face_1"), model.selection("EDGE", "Extrusion_1_1/Generated_Face_10&Extrusion_1_1/Generated_Face_9"), model.selection("EDGE", "Extrusion_1_1/Generated_Face_9&Extrusion_1_1/From_Face_1"), model.selection("EDGE", "Extrusion_1_1/Generated_Face_9&Extrusion_1_1/To_Face_1"), model.selection("EDGE", "Extrusion_1_1/Generated_Face_9&Extrusion_1_1/Generated_Face_8"), model.selection("EDGE", "Extrusion_1_1/Generated_Face_8&Extrusion_1_1/To_Face_1"), model.selection("EDGE", "Extrusion_1_1/Generated_Face_8&Extrusion_1_1/From_Face_1"), model.selection("EDGE", "Extrusion_1_1/Generated_Face_8&Extrusion_1_1/Generated_Face_7")]) +Group_1_objects = [model.selection("EDGE", "[Extrusion_1_1_3/Generated_Face&Sketch_1/SketchLine_1&weak_name_2][Extrusion_1_1/To_Face_1]"), model.selection("EDGE", "[Extrusion_1_1/From_Face_4][Extrusion_1_1_3/Generated_Face&Sketch_1/SketchCircle_1_2&weak_name_2]"), model.selection("EDGE", "[Extrusion_1_1/To_Face_4][Extrusion_1_1_3/Generated_Face&Sketch_1/SketchCircle_1_2&weak_name_2]"), model.selection("EDGE", "[Extrusion_1_1/From_Face_1][Extrusion_1_1_3/Generated_Face&Sketch_1/SketchLine_1&weak_name_2]"), model.selection("EDGE", "[Extrusion_1_1/To_Face_1][Extrusion_1_1_3/Generated_Face&Sketch_1/SketchCircle_1_2&weak_name_3]"), model.selection("EDGE", "[Extrusion_1_1/From_Face_1][Extrusion_1_1_3/Generated_Face&Sketch_1/SketchCircle_1_2&weak_name_3]"), model.selection("EDGE", "[Extrusion_1_1_3/Generated_Face&Sketch_1/SketchLine_1&weak_name_2][Extrusion_1_1/To_Face_1]"), model.selection("EDGE", "[Extrusion_1_1/From_Face_1][Extrusion_1_1_3/Generated_Face&Sketch_1/SketchLine_1&weak_name_2]"), model.selection("EDGE", "[Extrusion_1_1_3/Generated_Face&Sketch_1/SketchLine_1&weak_name_2][Extrusion_1_1_3/Generated_Face&Sketch_1/SketchCircle_1_2&weak_name_3]"), model.selection("EDGE", "[Extrusion_1_1_3/Generated_Face&Sketch_1/SketchCircle_1_2&weak_name_1][Extrusion_1_1_3/Generated_Face&Sketch_1/SketchCircle_1_2&weak_name_3]"), model.selection("EDGE", "[Extrusion_1_1_3/Generated_Face&Sketch_1/SketchCircle_1_2&weak_name_1][Extrusion_1_1/To_Face_1]"), model.selection("EDGE", "[Extrusion_1_1/From_Face_1][Extrusion_1_1_3/Generated_Face&Sketch_1/SketchCircle_1_2&weak_name_1]"), model.selection("EDGE", "[Extrusion_1_1_3/Generated_Face&Sketch_1/SketchLine_1&weak_name_2][Extrusion_1_1_3/Generated_Face&Sketch_1/SketchCircle_1_2&weak_name_1]"), model.selection("EDGE", "[Extrusion_1_1_3/Generated_Face&Sketch_1/SketchLine_3][Extrusion_1_1_3/Generated_Face&Sketch_1/SketchLine_2]"), model.selection("EDGE", "[Extrusion_1_1/To_Face_3][Extrusion_1_1_3/Generated_Face&Sketch_1/SketchLine_2]"), model.selection("EDGE", "[Extrusion_1_1/From_Face_3][Extrusion_1_1_3/Generated_Face&Sketch_1/SketchLine_2]"), model.selection("EDGE", "[Extrusion_1_1/From_Face_2][Extrusion_1_1_3/Generated_Face&Sketch_1/SketchArc_1_2]"), model.selection("EDGE", "[Extrusion_1_1_3/Generated_Face&Sketch_1/SketchArc_1_2][Extrusion_1_1/To_Face_2]"), model.selection("EDGE", "[Extrusion_1_1_3/Generated_Face&Sketch_1/SketchLine_1&weak_name_1][Extrusion_1_1_3/Generated_Face&Sketch_1/SketchArc_1_2]"), model.selection("EDGE", "[Extrusion_1_1_3/Generated_Face&Sketch_1/SketchArc_1_2][Extrusion_1_1_3/Generated_Face&Sketch_1/SketchArc_2_2]"), model.selection("EDGE", "[Extrusion_1_1/From_Face_2][Extrusion_1_1_3/Generated_Face&Sketch_1/SketchArc_2_2]"), model.selection("EDGE", "[Extrusion_1_1/To_Face_2][Extrusion_1_1_3/Generated_Face&Sketch_1/SketchArc_2_2]"), model.selection("EDGE", "[Extrusion_1_1/To_Face_3][Extrusion_1_1_3/Generated_Face&Sketch_1/SketchLine_3]"), model.selection("EDGE", "[Extrusion_1_1_3/Generated_Face&Sketch_1/SketchLine_3][Extrusion_1_1/From_Face_3]"), model.selection("EDGE", "[Extrusion_1_1_3/Generated_Face&Sketch_1/SketchLine_4][Extrusion_1_1_3/Generated_Face&Sketch_1/SketchArc_2_2]"), model.selection("EDGE", "[Extrusion_1_1_3/Generated_Face&Sketch_1/SketchLine_4][Extrusion_1_1/To_Face_2]"), model.selection("EDGE", "[Extrusion_1_1_3/Generated_Face&Sketch_1/SketchLine_4][Extrusion_1_1/From_Face_2]"), model.selection("EDGE", "[Extrusion_1_1_3/Generated_Face&Sketch_1/SketchLine_4][Extrusion_1_1_3/Generated_Face&Sketch_1/SketchLine_1&weak_name_3]"), model.selection("EDGE", "[Extrusion_1_1/To_Face_2][Extrusion_1_1_3/Generated_Face&Sketch_1/SketchLine_1&weak_name_3]"), model.selection("EDGE", "[Extrusion_1_1/From_Face_2][Extrusion_1_1_3/Generated_Face&Sketch_1/SketchLine_1&weak_name_3]"), model.selection("EDGE", "[Extrusion_1_1_3/Generated_Face&Sketch_1/SketchLine_1&weak_name_2][Extrusion_1_1_3/Generated_Face&Sketch_1/SketchCircle_1_2&weak_name_3]"), model.selection("EDGE", "[Extrusion_1_1_3/Generated_Face&Sketch_1/SketchLine_4][Extrusion_1_1_3/Generated_Face&Sketch_1/SketchArc_2_2]"), model.selection("EDGE", "[Extrusion_1_1/From_Face_1][Extrusion_1_1_3/Generated_Face&Sketch_1/SketchCircle_1_2&weak_name_3]"), model.selection("EDGE", "[Extrusion_1_1/To_Face_1][Extrusion_1_1_3/Generated_Face&Sketch_1/SketchCircle_1_2&weak_name_3]"), model.selection("EDGE", "[Extrusion_1_1/From_Face_2][Extrusion_1_1_3/Generated_Face&Sketch_1/SketchArc_2_2]"), model.selection("EDGE", "[Extrusion_1_1/To_Face_2][Extrusion_1_1_3/Generated_Face&Sketch_1/SketchArc_2_2]"), model.selection("EDGE", "[Extrusion_1_1_3/Generated_Face&Sketch_1/SketchArc_1_2][Extrusion_1_1_3/Generated_Face&Sketch_1/SketchArc_2_2]"), model.selection("EDGE", "[Extrusion_1_1_3/Generated_Face&Sketch_1/SketchArc_1_2][Extrusion_1_1/To_Face_2]"), model.selection("EDGE", "[Extrusion_1_1/From_Face_2][Extrusion_1_1_3/Generated_Face&Sketch_1/SketchArc_1_2]"), model.selection("EDGE", "[Extrusion_1_1_3/Generated_Face&Sketch_1/SketchCircle_1_2&weak_name_1][Extrusion_1_1_3/Generated_Face&Sketch_1/SketchCircle_1_2&weak_name_3]"), model.selection("EDGE", "[Extrusion_1_1/From_Face_1][Extrusion_1_1_3/Generated_Face&Sketch_1/SketchCircle_1_2&weak_name_1]"), model.selection("EDGE", "[Extrusion_1_1_3/Generated_Face&Sketch_1/SketchCircle_1_2&weak_name_1][Extrusion_1_1/To_Face_1]"), model.selection("EDGE", "[Extrusion_1_1_3/Generated_Face&Sketch_1/SketchLine_1&weak_name_2][Extrusion_1_1_3/Generated_Face&Sketch_1/SketchCircle_1_2&weak_name_1]"), model.selection("EDGE", "[Extrusion_1_1_3/Generated_Face&Sketch_1/SketchLine_1&weak_name_1][Extrusion_1_1/To_Face_2]"), model.selection("EDGE", "[Extrusion_1_1_3/Generated_Face&Sketch_1/SketchLine_1&weak_name_1][Extrusion_1_1/From_Face_2]"), model.selection("EDGE", "[Extrusion_1_1_3/Generated_Face&Sketch_1/SketchLine_1&weak_name_1][Extrusion_1_1_3/Generated_Face&Sketch_1/SketchArc_1_2]")] +Group_1 = model.addGroup(Part_1_doc, Group_1_objects) +model.do() model.end() # check that resulting group selection is valid diff --git a/src/FeaturesPlugin/Test/Test2251.py b/src/FeaturesPlugin/Test/Test2251.py index c2694960e..69564d544 100644 --- a/src/FeaturesPlugin/Test/Test2251.py +++ b/src/FeaturesPlugin/Test/Test2251.py @@ -56,7 +56,9 @@ SketchConstraintTangent_4 = Sketch_1.setTangent(SketchArc_3.results()[1], Sketch SketchConstraintCoincidence_9 = Sketch_1.setCoincident(SketchArc_2.results()[1], SketchArc_4.endPoint()) model.do() Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("COMPOUND", "Sketch_1")], model.selection(), 100, 0) -Group_1 = model.addGroup(Part_1_doc, [model.selection("FACE", "Extrusion_1_1/Generated_Face_19"), model.selection("FACE", "Extrusion_1_1/Generated_Face_18"), model.selection("FACE", "Extrusion_1_1/Generated_Face_16"), model.selection("FACE", "Extrusion_1_1/Generated_Face_15"), model.selection("FACE", "Extrusion_1_1/Generated_Face_15"), model.selection("FACE", "Extrusion_1_1/Generated_Face_5"), model.selection("FACE", "Extrusion_1_1/Generated_Face_4"), model.selection("FACE", "Extrusion_1_1/From_Face_3"), model.selection("FACE", "Extrusion_1_1/Generated_Face_3"), model.selection("FACE", "Extrusion_1_1/To_Face_3"), model.selection("FACE", "Extrusion_1_1/Generated_Face_19"), model.selection("FACE", "Extrusion_1_1/Generated_Face_4"), model.selection("FACE", "Extrusion_1_1/From_Face_4"), model.selection("FACE", "Extrusion_1_1/To_Face_4"), model.selection("FACE", "Extrusion_1_1/Generated_Face_8"), model.selection("FACE", "Extrusion_1_1/Generated_Face_3"), model.selection("FACE", "Extrusion_1_1/Generated_Face_9"), model.selection("FACE", "Extrusion_1_1/From_Face_6"), model.selection("FACE", "Extrusion_1_1/Generated_Face_13"), model.selection("FACE", "Extrusion_1_1/To_Face_6"), model.selection("FACE", "Extrusion_1_1/Generated_Face_1"), model.selection("FACE", "Extrusion_1_1/Generated_Face_12"), model.selection("FACE", "Extrusion_1_1/To_Face_5"), model.selection("FACE", "Extrusion_1_1/Generated_Face_2"), model.selection("FACE", "Extrusion_1_1/From_Face_5"), model.selection("FACE", "Extrusion_1_1/Generated_Face_1"), model.selection("FACE", "Extrusion_1_1/Generated_Face_8"), model.selection("FACE", "Extrusion_1_1/Generated_Face_9"), model.selection("FACE", "Extrusion_1_1/Generated_Face_13"), model.selection("FACE", "Extrusion_1_1/Generated_Face_7"), model.selection("FACE", "Extrusion_1_1/Generated_Face_14"), model.selection("FACE", "Extrusion_1_1/Generated_Face_12"), model.selection("FACE", "Extrusion_1_1/Generated_Face_18"), model.selection("FACE", "Extrusion_1_1/From_Face_2"), model.selection("FACE", "Extrusion_1_1/Generated_Face_11"), model.selection("FACE", "Extrusion_1_1/Generated_Face_6"), model.selection("FACE", "Extrusion_1_1/To_Face_2"), model.selection("FACE", "Extrusion_1_1/Generated_Face_10"), model.selection("FACE", "Extrusion_1_1/Generated_Face_6"), model.selection("FACE", "Extrusion_1_1/To_Face_7"), model.selection("FACE", "Extrusion_1_1/From_Face_7"), model.selection("FACE", "Extrusion_1_1/Generated_Face_17"), model.selection("FACE", "Extrusion_1_1/From_Face_1"), model.selection("FACE", "Extrusion_1_1/To_Face_1")]) +Group_1_objects = [model.selection("FACE", "Extrusion_1_1_3/Generated_Face&Sketch_1/SketchLine_1&weak_name_3"), model.selection("FACE", "Extrusion_1_1_3/Generated_Face&Sketch_1/SketchCircle_1_2&weak_name_3"), model.selection("FACE", "Extrusion_1_1_3/Generated_Face&Sketch_1/SketchLine_1&weak_name_1"), model.selection("FACE", "Extrusion_1_1_3/Generated_Face&Sketch_1/SketchLine_2&weak_name_2"), model.selection("FACE", "Extrusion_1_1_3/Generated_Face&Sketch_1/SketchLine_2&weak_name_2"), model.selection("FACE", "Extrusion_1_1_3/Generated_Face&Sketch_1/SketchArc_3_2&weak_name_1"), model.selection("FACE", "Extrusion_1_1_3/Generated_Face&Sketch_1/SketchLine_3&weak_name_1"), model.selection("FACE", "Extrusion_1_1/From_Face_7"), model.selection("FACE", "Extrusion_1_1_3/Generated_Face&Sketch_1/SketchLine_2&weak_name_1"), model.selection("FACE", "Extrusion_1_1/To_Face_7"), model.selection("FACE", "Extrusion_1_1_3/Generated_Face&Sketch_1/SketchLine_1&weak_name_3"), model.selection("FACE", "Extrusion_1_1_3/Generated_Face&Sketch_1/SketchLine_3&weak_name_1"), model.selection("FACE", "Extrusion_1_1/From_Face_6"), model.selection("FACE", "Extrusion_1_1/To_Face_6"), model.selection("FACE", "Extrusion_1_1_3/Generated_Face&Sketch_1/SketchLine_1&weak_name_2"), model.selection("FACE", "Extrusion_1_1_3/Generated_Face&Sketch_1/SketchLine_2&weak_name_1"), model.selection("FACE", "Extrusion_1_1_3/Generated_Face&Sketch_1/SketchCircle_1_2&weak_name_2"), model.selection("FACE", "Extrusion_1_1/From_Face_1"), model.selection("FACE", "Extrusion_1_1_3/Generated_Face&Sketch_1/SketchArc_3_2&weak_name_2"), model.selection("FACE", "Extrusion_1_1/To_Face_1"), model.selection("FACE", "Extrusion_1_1_3/Generated_Face&Sketch_1/SketchArc_1_2"), model.selection("FACE", "Extrusion_1_1_3/Generated_Face&Sketch_1/SketchLine_3&weak_name_2"), model.selection("FACE", "Extrusion_1_1/To_Face_4"), model.selection("FACE", "Extrusion_1_1_3/Generated_Face&Sketch_1/SketchArc_2_2&weak_name_1"), model.selection("FACE", "Extrusion_1_1/From_Face_4"), model.selection("FACE", "Extrusion_1_1_3/Generated_Face&Sketch_1/SketchArc_1_2"), model.selection("FACE", "Extrusion_1_1_3/Generated_Face&Sketch_1/SketchLine_1&weak_name_2"), model.selection("FACE", "Extrusion_1_1_3/Generated_Face&Sketch_1/SketchCircle_1_2&weak_name_2"), model.selection("FACE", "Extrusion_1_1_3/Generated_Face&Sketch_1/SketchArc_3_2&weak_name_2"), model.selection("FACE", "Extrusion_1_1_3/Generated_Face&Sketch_1/SketchArc_4_2&weak_name_1"), model.selection("FACE", "Extrusion_1_1_3/Generated_Face&Sketch_1/SketchArc_4_2&weak_name_2"), model.selection("FACE", "Extrusion_1_1_3/Generated_Face&Sketch_1/SketchLine_3&weak_name_2"), model.selection("FACE", "Extrusion_1_1_3/Generated_Face&Sketch_1/SketchCircle_1_2&weak_name_3"), model.selection("FACE", "Extrusion_1_1/From_Face_2"), model.selection("FACE", "Extrusion_1_1_3/Generated_Face&Sketch_1/SketchLine_4"), model.selection("FACE", "Extrusion_1_1_3/Generated_Face&Sketch_1/SketchArc_2_2&weak_name_2"), model.selection("FACE", "Extrusion_1_1/To_Face_2"), model.selection("FACE", "Extrusion_1_1_3/Generated_Face&Sketch_1/SketchCircle_2_2"), model.selection("FACE", "Extrusion_1_1_3/Generated_Face&Sketch_1/SketchArc_2_2&weak_name_2"), model.selection("FACE", "Extrusion_1_1/To_Face_5"), model.selection("FACE", "Extrusion_1_1/From_Face_5"), model.selection("FACE", "Extrusion_1_1_3/Generated_Face&Sketch_1/SketchCircle_1_2&weak_name_1"), model.selection("FACE", "Extrusion_1_1/From_Face_3"), model.selection("FACE", "Extrusion_1_1/To_Face_3")] +Group_1 = model.addGroup(Part_1_doc, Group_1_objects) +model.do() model.end() # check that resulting group selection is valid diff --git a/src/FeaturesPlugin/Test/Test2255.py b/src/FeaturesPlugin/Test/Test2255.py index 92193a3a5..4c9921d13 100644 --- a/src/FeaturesPlugin/Test/Test2255.py +++ b/src/FeaturesPlugin/Test/Test2255.py @@ -18,6 +18,8 @@ ## email : webmaster.salome@opencascade.com ## +# -*- coding: utf-8 -*- + from salome.shaper import model model.begin() @@ -42,12 +44,13 @@ SketchConstraintVertical_2 = Sketch_1.setVertical(SketchLine_4.result()) SketchCircle_1 = Sketch_1.addCircle(0, 0, 24.97092001270093) SketchConstraintCoincidence_6 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchCircle_1.center()) model.do() -Wire_1 = model.addWire(Part_1_doc, [model.selection("EDGE", "Sketch_1/Edge-SketchLine_2"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_3"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_4"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_1")]) -Wire_2 = model.addWire(Part_1_doc, [model.selection("EDGE", "Sketch_1/Edge-SketchCircle_1_2")]) +Wire_1_objects = [model.selection("EDGE", "Sketch_1/SketchLine_2"), model.selection("EDGE", "Sketch_1/SketchLine_3"), model.selection("EDGE", "Sketch_1/SketchLine_4"), model.selection("EDGE", "Sketch_1/SketchLine_1")] +Wire_1 = model.addWire(Part_1_doc, Wire_1_objects) +Wire_2 = model.addWire(Part_1_doc, [model.selection("EDGE", "Sketch_1/SketchCircle_1_2")]) Face_1 = model.addFace(Part_1_doc, [model.selection("WIRE", "Wire_1_1")]) Face_2 = model.addFace(Part_1_doc, [model.selection("WIRE", "Wire_2_1")]) Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Face_1_1"), model.selection("FACE", "Face_2_1")], model.selection(), 50, 0) -Sketch_2 = model.addSketch(Part_1_doc, model.selection("FACE", "PartSet/YOZ")) +Sketch_2 = model.addSketch(Part_1_doc, model.standardPlane("YOZ")) SketchLine_5 = Sketch_2.addLine(49.62901186301215, 25.3130971701971, 39.15939470736273, 25.3130971701971) SketchLine_6 = Sketch_2.addLine(39.15939470736273, 25.3130971701971, 39.15939470736273, 38.96586914453801) SketchLine_7 = Sketch_2.addLine(39.15939470736273, 38.96586914453801, 49.62901186301215, 38.96586914453801) @@ -61,7 +64,7 @@ SketchConstraintVertical_3 = Sketch_2.setVertical(SketchLine_6.result()) SketchConstraintHorizontal_4 = Sketch_2.setHorizontal(SketchLine_7.result()) SketchConstraintVertical_4 = Sketch_2.setVertical(SketchLine_8.result()) model.do() -ExtrusionCut_1 = model.addExtrusionCut(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchLine_5r-SketchLine_6r-SketchLine_7r-SketchLine_8r")], model.selection(), 50, 50, [model.selection("SOLID", "Extrusion_1_1"), model.selection("SOLID", "Extrusion_1_2")]) +ExtrusionCut_1 = model.addExtrusionCut(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchLine_8r-SketchLine_7r-SketchLine_6r-SketchLine_5r")], model.selection(), 50, 50, [model.selection("SOLID", "Extrusion_1_1"), model.selection("SOLID", "Extrusion_1_2")]) model.do() model.end() diff --git a/src/FeaturesPlugin/Test/Test2289.py b/src/FeaturesPlugin/Test/Test2289.py index 90675d37e..8540d2dbe 100644 --- a/src/FeaturesPlugin/Test/Test2289.py +++ b/src/FeaturesPlugin/Test/Test2289.py @@ -18,6 +18,8 @@ ## email : webmaster.salome@opencascade.com ## +# -*- coding: utf-8 -*- + from salome.shaper import model model.begin() @@ -45,7 +47,8 @@ SketchConstraintAngle_1 = Sketch_1.setAngleBackward(SketchLine_2.result(), Sketc SketchConstraintEqual_1 = Sketch_1.setEqual(SketchLine_2.result(), SketchLine_3.result()) SketchConstraintEqual_2 = Sketch_1.setEqual(SketchLine_1.result(), SketchLine_4.result()) model.do() -Wire_1 = model.addWire(Part_1_doc, [model.selection("EDGE", "Sketch_1/Edge-SketchLine_3"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_2"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_4"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_1"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_5")]) +Wire_1_objects = [model.selection("EDGE", "Sketch_1/SketchLine_3"), model.selection("EDGE", "Sketch_1/SketchLine_2"), model.selection("EDGE", "Sketch_1/SketchLine_4"), model.selection("EDGE", "Sketch_1/SketchLine_1"), model.selection("EDGE", "Sketch_1/SketchLine_5")] +Wire_1 = model.addWire(Part_1_doc, Wire_1_objects) Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("WIRE", "Wire_1_1")], model.selection(), 10, 0) model.do() diff --git a/src/FeaturesPlugin/Test/Test2304.py b/src/FeaturesPlugin/Test/Test2304.py index cd9c8d689..5726b506b 100644 --- a/src/FeaturesPlugin/Test/Test2304.py +++ b/src/FeaturesPlugin/Test/Test2304.py @@ -18,6 +18,8 @@ ## email : webmaster.salome@opencascade.com ## +# -*- coding: utf-8 -*- + from salome.shaper import model model.begin() @@ -51,7 +53,8 @@ SketchConstraintHorizontal_4 = Sketch_1.setHorizontal(SketchLine_7.result()) SketchConstraintVertical_4 = Sketch_1.setVertical(SketchLine_8.result()) model.do() Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_5f-SketchLine_6f-SketchLine_7f-SketchLine_8f")], model.selection(), 100, 100) -Face_1 = model.addFace(Part_1_doc, [model.selection("EDGE", "Sketch_1/Edge-SketchLine_2"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_1"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_4"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_3")]) +Face_1_objects = [model.selection("EDGE", "Sketch_1/SketchLine_2"), model.selection("EDGE", "Sketch_1/SketchLine_1"), model.selection("EDGE", "Sketch_1/SketchLine_4"), model.selection("EDGE", "Sketch_1/SketchLine_3")] +Face_1 = model.addFace(Part_1_doc, Face_1_objects) Partition_1 = model.addPartition(Part_1_doc, [model.selection("SOLID", "Extrusion_1_1"), model.selection("FACE", "Face_1_1")]) model.do() model.end() diff --git a/src/FeaturesPlugin/Test/Test2304_2.py b/src/FeaturesPlugin/Test/Test2304_2.py index 0558504b8..cbdc10602 100644 --- a/src/FeaturesPlugin/Test/Test2304_2.py +++ b/src/FeaturesPlugin/Test/Test2304_2.py @@ -18,6 +18,8 @@ ## email : webmaster.salome@opencascade.com ## +# -*- coding: utf-8 -*- + from salome.shaper import model model.begin() @@ -131,11 +133,11 @@ SketchConstraintAngle_2 = Sketch_1.setAngleComplementary(SketchLine_6.result(), SketchConstraintDistance_3 = Sketch_1.setDistance(SketchLine_5.startPoint(), SketchLine_12.endPoint(), 8.1, False) SketchConstraintAngle_3 = Sketch_1.setAngle(SketchLine_3.result(), SketchLine_12.result(), 45) model.do() -Edge_1_objects = [model.selection("EDGE", "Sketch_1/Edge-SketchLine_3"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_4"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_1"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_2")] +Edge_1_objects = [model.selection("EDGE", "Sketch_1/SketchLine_3"), model.selection("EDGE", "Sketch_1/SketchLine_4"), model.selection("EDGE", "Sketch_1/SketchLine_1"), model.selection("EDGE", "Sketch_1/SketchLine_2")] Edge_1 = model.addEdge(Part_1_doc, Edge_1_objects) Face_1_objects = [model.selection("EDGE", "Edge_1_1"), model.selection("EDGE", "Edge_1_2"), model.selection("EDGE", "Edge_1_3"), model.selection("EDGE", "Edge_1_4")] Face_1 = model.addFace(Part_1_doc, Face_1_objects) -Edge_2_objects = [model.selection("EDGE", "Sketch_1/Edge-SketchLine_7"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_6"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_16"), model.selection("EDGE", "Sketch_1/Edge-SketchCircle_3_2"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_15"), model.selection("EDGE", "Sketch_1/Edge-SketchCircle_2_2"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_5"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_13"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_14"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_8"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_9")] +Edge_2_objects = [model.selection("EDGE", "Sketch_1/SketchLine_7"), model.selection("EDGE", "Sketch_1/SketchLine_6"), model.selection("EDGE", "Sketch_1/SketchLine_16"), model.selection("EDGE", "Sketch_1/SketchCircle_3_2"), model.selection("EDGE", "Sketch_1/SketchLine_15"), model.selection("EDGE", "Sketch_1/SketchCircle_2_2"), model.selection("EDGE", "Sketch_1/SketchLine_5"), model.selection("EDGE", "Sketch_1/SketchLine_13"), model.selection("EDGE", "Sketch_1/SketchLine_14"), model.selection("EDGE", "Sketch_1/SketchLine_8"), model.selection("EDGE", "Sketch_1/SketchLine_9")] Edge_2 = model.addEdge(Part_1_doc, Edge_2_objects) Partition_1_objects = [model.selection("FACE", "Face_1_1"), model.selection("EDGE", "Edge_2_1"), model.selection("EDGE", "Edge_2_2"), model.selection("EDGE", "Edge_2_3"), model.selection("EDGE", "Edge_2_4"), model.selection("EDGE", "Edge_2_5"), model.selection("EDGE", "Edge_2_6"), model.selection("EDGE", "Edge_2_7"), model.selection("EDGE", "Edge_2_8"), model.selection("EDGE", "Edge_2_9"), model.selection("EDGE", "Edge_2_10"), model.selection("EDGE", "Edge_2_11")] Partition_1 = model.addPartition(Part_1_doc, Partition_1_objects) diff --git a/src/FeaturesPlugin/Test/Test2375.py b/src/FeaturesPlugin/Test/Test2375.py index 1fbbd14c5..670d0882c 100644 --- a/src/FeaturesPlugin/Test/Test2375.py +++ b/src/FeaturesPlugin/Test/Test2375.py @@ -18,6 +18,8 @@ ## email : webmaster.salome@opencascade.com ## +# -*- coding: utf-8 -*- + from SketchAPI import * from salome.shaper import model @@ -56,9 +58,9 @@ SketchConstraintLength_3 = Sketch_1.setLength(SketchLine_5.result(), 2) SketchConstraintLength_4 = Sketch_1.setLength(SketchLine_3.result(), 1.5) SketchConstraintLength_5 = Sketch_1.setLength(SketchLine_8.result(), 4) model.do() -Revolution_1 = model.addRevolution(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_1r-SketchLine_3r-SketchLine_4r-SketchLine_5r-SketchLine_7r-SketchLine_8f")], model.selection("EDGE", "PartSet/OZ"), 360, 0) -Sketch_2 = model.addSketch(Part_1_doc, model.selection("FACE", "Revolution_1_1/Generated_Face_1")) -SketchProjection_3 = Sketch_2.addProjection(model.selection("VERTEX", "Revolution_1_1/Generated_Face_2&Revolution_1_1/Generated_Face_1__cc"), False) +Revolution_1 = model.addRevolution(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_8f-SketchLine_7r-SketchLine_5r-SketchLine_4r-SketchLine_3r-SketchLine_1r")], model.selection("EDGE", "PartSet/OZ"), 360, 0) +Sketch_2 = model.addSketch(Part_1_doc, model.selection("FACE", "Revolution_1_1/Generated_Face&Sketch_1/SketchLine_1")) +SketchProjection_3 = Sketch_2.addProjection(model.selection("VERTEX", "[Revolution_1_1/Generated_Face&Sketch_1/SketchLine_3][Revolution_1_1/Generated_Face&Sketch_1/SketchLine_1]__cc"), False) SketchPoint_1 = SketchProjection_3.createdFeature() SketchCircle_1 = Sketch_2.addCircle(0, 0, 4.75) SketchCircle_1.setAuxiliary(True) @@ -67,7 +69,7 @@ SketchCircle_2 = Sketch_2.addCircle(4.113620667976081, 2.375000000000003, 1.1) SketchConstraintCoincidence_11 = Sketch_2.setCoincident(SketchCircle_1.results()[1], SketchCircle_2.center()) SketchCircle_3 = Sketch_2.addCircle(-4.113620667974014, 2.375000000003604, 1.1) SketchConstraintCoincidence_12 = Sketch_2.setCoincident(SketchCircle_1.results()[1], SketchCircle_3.center()) -SketchCircle_4 = Sketch_2.addCircle(4.163806340121522e-012, -4.75000000000001, 1.1) +SketchCircle_4 = Sketch_2.addCircle(4.163806340121522e-12, -4.75000000000001, 1.1) SketchConstraintCoincidence_13 = Sketch_2.setCoincident(SketchCircle_1.results()[1], SketchCircle_4.center()) SketchConstraintEqual_1 = Sketch_2.setEqual(SketchCircle_2.results()[1], SketchCircle_3.results()[1]) SketchConstraintEqual_2 = Sketch_2.setEqual(SketchCircle_3.results()[1], SketchCircle_4.results()[1]) @@ -79,12 +81,12 @@ SketchLine_10 = Sketch_2.addLine(-4.113620667974014, 2.375000000003604, 0, 0) SketchLine_10.setAuxiliary(True) SketchConstraintCoincidence_16 = Sketch_2.setCoincident(SketchCircle_3.center(), SketchLine_10.startPoint()) SketchConstraintCoincidence_17 = Sketch_2.setCoincident(SketchAPI_Point(SketchPoint_1).coordinates(), SketchLine_10.endPoint()) -SketchLine_11 = Sketch_2.addLine(4.163806340121522e-012, -4.75000000000001, 0, 0) +SketchLine_11 = Sketch_2.addLine(4.163806340121522e-12, -4.75000000000001, 0, 0) SketchLine_11.setAuxiliary(True) SketchConstraintCoincidence_18 = Sketch_2.setCoincident(SketchCircle_4.center(), SketchLine_11.startPoint()) SketchConstraintCoincidence_19 = Sketch_2.setCoincident(SketchAPI_Point(SketchPoint_1).coordinates(), SketchLine_11.endPoint()) SketchConstraintRadius_1 = Sketch_2.setRadius(SketchCircle_2.results()[1], 1.1) -SketchProjection_4 = Sketch_2.addProjection(model.selection("EDGE", "Sketch_1/Edge-SketchLine_1"), False) +SketchProjection_4 = Sketch_2.addProjection(model.selection("EDGE", "Sketch_1/SketchLine_1"), False) SketchLine_12 = SketchProjection_4.createdFeature() SketchConstraintAngle_1 = Sketch_2.setAngleBackward(SketchLine_9.result(), SketchLine_12.result(), 30.00000000000006) SketchConstraintAngle_2 = Sketch_2.setAngle(SketchLine_9.result(), SketchLine_10.result(), 119.9999999999498) @@ -173,49 +175,48 @@ SketchConstraintDistance_2 = Sketch_2.setDistance(SketchCircle_16.center(), Sket SketchConstraintDistance_3 = Sketch_2.setDistance(SketchAPI_Line(SketchLine_19).startPoint(), SketchCircle_17.center(), 5.2, True) model.do() ExtrusionCut_1_objects_1 = [model.selection("FACE", "Sketch_2/Face-SketchCircle_9_2f"), model.selection("FACE", "Sketch_2/Face-SketchCircle_10_2f"), model.selection("FACE", "Sketch_2/Face-SketchCircle_5_2f"), model.selection("FACE", "Sketch_2/Face-SketchCircle_2_2f"), model.selection("FACE", "Sketch_2/Face-SketchCircle_7_2f"), model.selection("FACE", "Sketch_2/Face-SketchCircle_17_2f"), model.selection("FACE", "Sketch_2/Face-SketchCircle_16_2f"), model.selection("FACE", "Sketch_2/Face-SketchCircle_4_2f"), model.selection("FACE", "Sketch_2/Face-SketchCircle_3_2f")] -ExtrusionCut_1 = model.addExtrusionCut(Part_1_doc, ExtrusionCut_1_objects_1, model.selection(), model.selection("FACE", "Revolution_1_1/Generated_Face_5"), 0, model.selection(), 0, [model.selection("SOLID", "Revolution_1_1")]) -ExtrusionCut_2_objects_1 = [model.selection("WIRE", "Sketch_2/Wire-SketchCircle_11_2f"), model.selection("WIRE", "Sketch_2/Wire-SketchCircle_12_2f"), model.selection("WIRE", "Sketch_2/Wire-SketchCircle_6_2f"), model.selection("WIRE", "Sketch_2/Wire-SketchCircle_8_2f")] +ExtrusionCut_1 = model.addExtrusionCut(Part_1_doc, ExtrusionCut_1_objects_1, model.selection(), model.selection("FACE", "Revolution_1_1/Generated_Face&Sketch_1/SketchLine_7"), 0, model.selection(), 0, [model.selection("SOLID", "Revolution_1_1")]) +ExtrusionCut_2_objects_1 = [model.selection("WIRE", "[Sketch_2/SketchCircle_11_2]"), model.selection("WIRE", "[Sketch_2/SketchCircle_12_2]"), model.selection("WIRE", "[Sketch_2/SketchCircle_6_2]"), model.selection("WIRE", "[Sketch_2/SketchCircle_8_2]")] ExtrusionCut_2 = model.addExtrusionCut(Part_1_doc, ExtrusionCut_2_objects_1, model.selection(), 0, 0.75, [model.selection("SOLID", "ExtrusionCut_1_1")]) Axis_4 = model.addAxis(Part_1_doc, 0, -1, -10) -ExtrusionCut_3 = model.addExtrusionCut(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchCircle_15_2f")], model.selection("EDGE", "Axis_1"), model.selection("FACE", "Revolution_1_1/Generated_Face_5"), 0, model.selection(), 0, [model.selection("SOLID", "ExtrusionCut_2_1")]) -ExtrusionCut_3.result().setDeflection(1e-005) +ExtrusionCut_3 = model.addExtrusionCut(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchCircle_15_2f")], model.selection("EDGE", "Axis_1"), model.selection("FACE", "Revolution_1_1/Generated_Face&Sketch_1/SketchLine_7"), 0, model.selection(), 0, [model.selection("SOLID", "ExtrusionCut_2_1")]) +ExtrusionCut_3.result().setDeflection(1e-05) Sketch_3 = model.addSketch(Part_1_doc, model.standardPlane("XOZ")) SketchLine_21 = Sketch_3.addLine(3.5, 2.508501119175777, 3.5, 4.934853156880259) SketchLine_22 = Sketch_3.addLine(3.5, 4.934853156880259, 6.2, 4.934853156880259) SketchConstraintCoincidence_49 = Sketch_3.setCoincident(SketchLine_21.endPoint(), SketchLine_22.startPoint()) SketchLine_23 = Sketch_3.addLine(6.2, 4.934853156880259, 6.2, 3.008501119175777) SketchConstraintCoincidence_50 = Sketch_3.setCoincident(SketchLine_22.endPoint(), SketchLine_23.startPoint()) -SketchProjection_6 = Sketch_3.addProjection(model.selection("EDGE", "Sketch_1/Edge-SketchLine_3"), False) +SketchProjection_6 = Sketch_3.addProjection(model.selection("EDGE", "Sketch_1/SketchLine_3"), False) SketchLine_24 = SketchProjection_6.createdFeature() SketchConstraintCoincidence_51 = Sketch_3.setCoincident(SketchLine_23.endPoint(), SketchLine_24.result()) SketchLine_25 = Sketch_3.addLine(6.2, 3.008501119175777, 3.5, 2.508501119175777) SketchConstraintCoincidence_52 = Sketch_3.setCoincident(SketchLine_23.endPoint(), SketchLine_25.startPoint()) SketchConstraintCoincidence_53 = Sketch_3.setCoincident(SketchLine_21.startPoint(), SketchLine_25.endPoint()) -SketchProjection_7 = Sketch_3.addProjection(model.selection("EDGE", "Sketch_1/Edge-SketchLine_5"), False) +SketchProjection_7 = Sketch_3.addProjection(model.selection("EDGE", "Sketch_1/SketchLine_5"), False) SketchLine_26 = SketchProjection_7.createdFeature() SketchConstraintCoincidence_54 = Sketch_3.setCoincident(SketchLine_21.startPoint(), SketchLine_26.result()) SketchConstraintCoincidence_55 = Sketch_3.setCoincident(SketchLine_21.endPoint(), SketchLine_26.result()) SketchConstraintHorizontal_2 = Sketch_3.setHorizontal(SketchLine_22.result()) SketchConstraintCoincidence_56 = Sketch_3.setCoincident(SketchLine_22.endPoint(), SketchLine_24.result()) -SketchProjection_8 = Sketch_3.addProjection(model.selection("EDGE", "Sketch_1/Edge-SketchLine_4"), False) +SketchProjection_8 = Sketch_3.addProjection(model.selection("EDGE", "Sketch_1/SketchLine_4"), False) SketchLine_27 = SketchProjection_8.createdFeature() SketchConstraintParallel_1 = Sketch_3.setParallel(SketchLine_25.result(), SketchLine_27.result()) -SketchProjection_9 = Sketch_3.addProjection(model.selection("EDGE", "Sketch_1/Edge-SketchLine_4"), False) +SketchProjection_9 = Sketch_3.addProjection(model.selection("EDGE", "Sketch_1/SketchLine_4"), False) SketchLine_28 = SketchProjection_9.createdFeature() SketchConstraintDistance_4 = Sketch_3.setDistance(SketchLine_21.startPoint(), SketchLine_28.result(), 0.5, True) model.do() Revolution_2 = model.addRevolution(Part_1_doc, [model.selection("COMPOUND", "Sketch_3")], model.selection("EDGE", "PartSet/OZ"), 360, 0) -Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchCircle_13_2f"), model.selection("FACE", "Sketch_2/Face-SketchCircle_14_2f")], model.selection(), model.selection("FACE", "Revolution_1_1/Generated_Face_5"), 0, model.selection(), 0) +Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchCircle_13_2f"), model.selection("FACE", "Sketch_2/Face-SketchCircle_14_2f")], model.selection(), model.selection("FACE", "Revolution_1_1/Generated_Face&Sketch_1/SketchLine_7"), 0, model.selection(), 0) Common_1 = model.addCommon(Part_1_doc, [model.selection("SOLID", "Extrusion_1_2"), model.selection("SOLID", "Extrusion_1_1")], [model.selection("SOLID", "Revolution_2_1")]) Cut_1 = model.addCut(Part_1_doc, [model.selection("SOLID", "ExtrusionCut_3_1")], [model.selection("SOLID", "Common_1_1"), model.selection("SOLID", "Common_1_2")]) -# skip 3 vertices, limitation -Group_1_objects = [model.selection("VERTEX", "Revolution_1_1/Generated_Face_5&Revolution_1_1/Generated_Face_4"), model.selection("VERTEX", "Revolution_1_1/Generated_Face_4&ExtrusionCut_3_1/Modfied_2"), model.selection("VERTEX", "ExtrusionCut_3_1/Modfied_2&Revolution_1_1/Generated_Face_2"), model.selection("VERTEX", "ExtrusionCut_3_1/Modfied_2&ExtrusionCut_1_1/Modfied_4"), model.selection("VERTEX", "ExtrusionCut_3_1/Modfied_2&ExtrusionCut_2_1/Modfied_2"), model.selection("VERTEX", "ExtrusionCut_3_1/Modfied_2&ExtrusionCut_3_1/Modfied_3"), model.selection("VERTEX", "ExtrusionCut_3_1/Modfied_2&ExtrusionCut_2_1/Modfied_4"), model.selection("VERTEX", "ExtrusionCut_3_1/Modfied_2&ExtrusionCut_2_1/Modfied_3"), model.selection("VERTEX", "ExtrusionCut_3_1/Modfied_2&ExtrusionCut_1_1/Modfied_3"), model.selection("VERTEX", "ExtrusionCut_3_1/Modfied_2&ExtrusionCut_1_1/Modfied_5"), model.selection("VERTEX", "ExtrusionCut_3_1/Modfied_2&ExtrusionCut_1_1/Modfied_6"), model.selection("VERTEX", "ExtrusionCut_3_1/Modfied_2&ExtrusionCut_1_1/Modfied_8"), model.selection("VERTEX", "Revolution_1_1/Generated_Face_2&Cut_1_1/Modified_Face_1"), model.selection("VERTEX", "ExtrusionCut_2_1/Modfied_5&ExtrusionCut_2_1/Modfied_6"), model.selection("VERTEX", "ExtrusionCut_1_1/Lateral_5095"), model.selection("VERTEX", "ExtrusionCut_2_1/Modfied_2&ExtrusionCut_2_1/Modfied_7"), model.selection("VERTEX", "ExtrusionCut_3_1/Lateral_5004"), model.selection("VERTEX", "ExtrusionCut_2_1/Modfied_4&ExtrusionCut_2_1/Modfied_9"), model.selection("VERTEX", "ExtrusionCut_2_1/Modfied_3&ExtrusionCut_2_1/Modfied_8"), model.selection("VERTEX", "ExtrusionCut_1_1/Lateral_5108"), model.selection("VERTEX", "ExtrusionCut_1_1/Lateral_5082"), model.selection("VERTEX", "ExtrusionCut_1_1/Lateral_5069"), model.selection("VERTEX", "ExtrusionCut_1_1/Lateral_5043"), model.selection("VERTEX", "ExtrusionCut_2_1/Vertex_5024"), model.selection("VERTEX", "ExtrusionCut_2_1/Vertex_5006"), model.selection("VERTEX", "ExtrusionCut_2_1/Vertex_5015"), model.selection("VERTEX", "Extrusion_1_1/Lateral_4"), model.selection("VERTEX", "Extrusion_1_2/Lateral_4"), model.selection("VERTEX", "ExtrusionCut_2_1/Vertex_5033"), model.selection("VERTEX", "ExtrusionCut_2_1/Vertex_5031"), model.selection("VERTEX", "ExtrusionCut_2_1/Vertex_5022"), model.selection("VERTEX", "ExtrusionCut_2_1/Vertex_5004"), model.selection("VERTEX", "ExtrusionCut_2_1/Vertex_5013"), model.selection("VERTEX", "Common_1_2/Modified_Face_2&Common_1_2/Modified_Face_1"), model.selection("VERTEX", "Common_1_1/Modified_Face_2&Common_1_1/Modified_Face_1")] +Group_1_objects = [model.selection("VERTEX", "[Revolution_1_1/Generated_Face&Sketch_1/SketchLine_7][Revolution_1_1/Generated_Face&Sketch_1/SketchLine_5]"), model.selection("VERTEX", "[Revolution_1_1/Generated_Face&Sketch_1/SketchLine_5][ExtrusionCut_3_1/Modified_Face&Sketch_1/SketchLine_4]"), model.selection("VERTEX", "[Revolution_1_1/Generated_Face&Sketch_1/SketchLine_3][ExtrusionCut_3_1/Modified_Face&Sketch_1/SketchLine_4]"), model.selection("VERTEX", "[ExtrusionCut_1_1/Modified_Face&Sketch_2/SketchCircle_4_2][ExtrusionCut_3_1/Modified_Face&Sketch_1/SketchLine_4]"), model.selection("VERTEX", "[ExtrusionCut_2_1/Modified_Face&Sketch_2/SketchCircle_5_2][ExtrusionCut_3_1/Modified_Face&Sketch_1/SketchLine_4]"), model.selection("VERTEX", "[ExtrusionCut_3_1/Modified_Face&Sketch_2/SketchCircle_15_2][ExtrusionCut_3_1/Modified_Face&Sketch_1/SketchLine_4]"), model.selection("VERTEX", "[ExtrusionCut_2_1/Modified_Face&Sketch_2/SketchCircle_9_2][ExtrusionCut_3_1/Modified_Face&Sketch_1/SketchLine_4]"), model.selection("VERTEX", "[ExtrusionCut_2_1/Modified_Face&Sketch_2/SketchCircle_10_2][ExtrusionCut_3_1/Modified_Face&Sketch_1/SketchLine_4]"), model.selection("VERTEX", "[ExtrusionCut_1_1/Modified_Face&Sketch_2/SketchCircle_3_2][ExtrusionCut_3_1/Modified_Face&Sketch_1/SketchLine_4]"), model.selection("VERTEX", "[ExtrusionCut_1_1/Modified_Face&Sketch_2/SketchCircle_16_2][ExtrusionCut_3_1/Modified_Face&Sketch_1/SketchLine_4]"), model.selection("VERTEX", "[ExtrusionCut_1_1/Modified_Face&Sketch_2/SketchCircle_17_2][ExtrusionCut_3_1/Modified_Face&Sketch_1/SketchLine_4]"), model.selection("VERTEX", "[ExtrusionCut_1_1/Modified_Face&Sketch_2/SketchCircle_2_2][ExtrusionCut_3_1/Modified_Face&Sketch_1/SketchLine_4]"), model.selection("VERTEX", "[Revolution_1_1/Generated_Face&Sketch_1/SketchLine_3][Cut_1_1/Modified_Face&Sketch_1/SketchLine_1]"), model.selection("VERTEX", "[ExtrusionCut_2_1/Modified_Face&ExtrusionCut_2_1/From_Face_4][ExtrusionCut_2_1/Modified_Face&Sketch_2/SketchCircle_7_2]"), model.selection("VERTEX", "[ExtrusionCut_1_1/Modified_Face&Sketch_2/SketchCircle_4_2][Cut_1_1/Modified_Face&Sketch_1/SketchLine_1]"), model.selection("VERTEX", "[ExtrusionCut_2_1/Modified_Face&Sketch_2/SketchCircle_5_2][ExtrusionCut_2_1/Modified_Face&ExtrusionCut_2_1/From_Face_3]"), model.selection("VERTEX", "[ExtrusionCut_3_1/Modified_Face&Sketch_2/SketchCircle_15_2][Cut_1_1/Modified_Face&Sketch_1/SketchLine_1]"), model.selection("VERTEX", "[ExtrusionCut_2_1/Modified_Face&Sketch_2/SketchCircle_9_2][ExtrusionCut_2_1/Modified_Face&ExtrusionCut_2_1/From_Face_1]"), model.selection("VERTEX", "[ExtrusionCut_2_1/Modified_Face&Sketch_2/SketchCircle_10_2][ExtrusionCut_2_1/Modified_Face&ExtrusionCut_2_1/From_Face_2]"), model.selection("VERTEX", "[Cut_1_1/Modified_Face&Sketch_1/SketchLine_1][ExtrusionCut_1_1/Modified_Face&Sketch_2/SketchCircle_3_2]"), model.selection("VERTEX", "[ExtrusionCut_1_1/Modified_Face&Sketch_2/SketchCircle_16_2][Cut_1_1/Modified_Face&Sketch_1/SketchLine_1]"), model.selection("VERTEX", "[ExtrusionCut_1_1/Modified_Face&Sketch_2/SketchCircle_17_2][Cut_1_1/Modified_Face&Sketch_1/SketchLine_1]"), model.selection("VERTEX", "[ExtrusionCut_1_1/Modified_Face&Sketch_2/SketchCircle_2_2][Cut_1_1/Modified_Face&Sketch_1/SketchLine_1]"), model.selection("VERTEX", "[Cut_1_1/Modified_Face&Sketch_1/SketchLine_1][ExtrusionCut_2_1/Generated_Face&Sketch_2/SketchCircle_6_2]"), model.selection("VERTEX", "[ExtrusionCut_2_1/Generated_Face&Sketch_2/SketchCircle_11_2][Cut_1_1/Modified_Face&Sketch_1/SketchLine_1]"), model.selection("VERTEX", "[Cut_1_1/Modified_Face&Sketch_1/SketchLine_1][ExtrusionCut_2_1/Generated_Face&Sketch_2/SketchCircle_12_2]"), model.selection("VERTEX", "[Cut_1_1/Modified_Face&Sketch_1/SketchLine_1][Common_1_2/Modified_Face&Sketch_2/SketchCircle_13_2]"), model.selection("VERTEX", "[Cut_1_1/Modified_Face&Sketch_1/SketchLine_1][Common_1_1/Modified_Face&Sketch_2/SketchCircle_14_2]"), model.selection("VERTEX", "[ExtrusionCut_2_1/Generated_Face&Sketch_2/SketchCircle_8_2][Cut_1_1/Modified_Face&Sketch_1/SketchLine_1]"), model.selection("VERTEX", "[ExtrusionCut_2_1/Modified_Face&ExtrusionCut_2_1/From_Face_4][ExtrusionCut_2_1/Generated_Face&Sketch_2/SketchCircle_8_2]"), model.selection("VERTEX", "[ExtrusionCut_2_1/Generated_Face&Sketch_2/SketchCircle_6_2][ExtrusionCut_2_1/Modified_Face&ExtrusionCut_2_1/From_Face_3]"), model.selection("VERTEX", "[ExtrusionCut_2_1/Modified_Face&ExtrusionCut_2_1/From_Face_1][ExtrusionCut_2_1/Generated_Face&Sketch_2/SketchCircle_11_2]"), model.selection("VERTEX", "[ExtrusionCut_2_1/Modified_Face&ExtrusionCut_2_1/From_Face_2][ExtrusionCut_2_1/Generated_Face&Sketch_2/SketchCircle_12_2]"), model.selection("VERTEX", "Common_1_2/Generated_Vertex&Sketch_3/SketchLine_25"), model.selection("VERTEX", "Common_1_1/Generated_Vertex&Sketch_3/SketchLine_25")] Group_1 = model.addGroup(Part_1_doc, Group_1_objects) -# skip 3 edges, limitation -Group_2_objects = [model.selection("EDGE", "ExtrusionCut_3_1/Modfied_2&ExtrusionCut_2_1/Modfied_3"), model.selection("EDGE", "ExtrusionCut_2_1/Modfied_3"), model.selection("EDGE", "Cut_1_1/Modified_Face_1&ExtrusionCut_2_1/Generated_Face_1"), model.selection("EDGE", "ExtrusionCut_2_1/Modfied_3&ExtrusionCut_2_1/Modfied_8"), model.selection("EDGE", "ExtrusionCut_2_1/Lateral_5011"), model.selection("EDGE", "ExtrusionCut_3_1/Modfied_2&ExtrusionCut_1_1/Modfied_3"), model.selection("EDGE", "ExtrusionCut_1_1/Modfied_3&Cut_1_1/Modified_Face_1"), model.selection("EDGE", "Common_1_2/Modified_Face_2&Common_1_2/Modified_Face_1"), model.selection("EDGE", "Cut_1_1/Modified_Face_1&Common_1_2/Modified_Face_2"), model.selection("EDGE", "Common_1_2/Modified_Edge_1"), model.selection("EDGE", "ExtrusionCut_3_1/Modfied_2&ExtrusionCut_1_1/Modfied_4"), model.selection("EDGE", "ExtrusionCut_1_1/Modfied_3"), model.selection("EDGE", "ExtrusionCut_2_1/Modfied_4"), model.selection("EDGE", "ExtrusionCut_3_1/Modfied_2&ExtrusionCut_2_1/Modfied_4"), model.selection("EDGE", "ExtrusionCut_2_1/Modfied_4&ExtrusionCut_2_1/Modfied_9"), model.selection("EDGE", "ExtrusionCut_2_1/Modfied_9&ExtrusionCut_2_1/Generated_Face_1"), model.selection("EDGE", "Cut_1_1/Modified_Face_1&ExtrusionCut_2_1/Generated_Face_1"), model.selection("EDGE", "ExtrusionCut_2_1/Lateral_5002"), model.selection("EDGE", "ExtrusionCut_3_1/Modfied_2&ExtrusionCut_3_1/Modfied_3"), model.selection("EDGE", "Common_1_1/Modified_Edge_1"), model.selection("EDGE", "Common_1_1/Modified_Face_2&Common_1_1/Modified_Face_1"), model.selection("EDGE", "Cut_1_1/Modified_Face_1&ExtrusionCut_2_1/Generated_Face_1"), model.selection("EDGE", "ExtrusionCut_3_1/Modfied_2&Revolution_1_1/Generated_Face_2"), model.selection("EDGE", "Cut_1_1/Modified_Face_1&Common_1_1/Modified_Face_2"), model.selection("EDGE", "Revolution_1_1/Generated_Face_4&ExtrusionCut_3_1/Modfied_2"), model.selection("EDGE", "Revolution_1_1/Generated_Face_5&Revolution_1_1/Generated_Face_4"), model.selection("EDGE", "ExtrusionCut_3_1/Modfied_2&ExtrusionCut_2_1/Modfied_2"), model.selection("EDGE", "ExtrusionCut_2_1/Modfied_2&ExtrusionCut_2_1/Modfied_7"), model.selection("EDGE", "ExtrusionCut_1_1/Modfied_4&Cut_1_1/Modified_Face_1"), model.selection("EDGE", "ExtrusionCut_1_1/Modfied_4"), model.selection("EDGE", "ExtrusionCut_3_1/Modfied_3"), model.selection("EDGE", "Revolution_1_1/Generated_Face_2&Cut_1_1/Modified_Face_1"), model.selection("EDGE", "ExtrusionCut_3_1/Modfied_3&Cut_1_1/Modified_Face_1"), model.selection("EDGE", "ExtrusionCut_3_1/Modfied_2&ExtrusionCut_1_1/Modfied_5"), model.selection("EDGE", "ExtrusionCut_3_1/Modfied_2&ExtrusionCut_1_1/Modfied_6"), model.selection("EDGE", "ExtrusionCut_1_1/Modfied_6"), model.selection("EDGE", "ExtrusionCut_1_1/Modfied_5"), model.selection("EDGE", "ExtrusionCut_1_1/Modfied_5&Cut_1_1/Modified_Face_1"), model.selection("EDGE", "ExtrusionCut_1_1/Modfied_6&Cut_1_1/Modified_Face_1"), model.selection("EDGE", "Revolution_1_1/Generated_Face_4"), model.selection("EDGE", "Cut_1_1/Modified_Face_1&ExtrusionCut_2_1/Generated_Face_1"), model.selection("EDGE", "ExtrusionCut_2_1/Modfied_5&ExtrusionCut_2_1/Modfied_6"), model.selection("EDGE", "ExtrusionCut_2_1/Modfied_5"), model.selection("EDGE", "Revolution_1_1/Generated_Face_2"), model.selection("EDGE", "ExtrusionCut_2_1/Lateral_5029"), model.selection("EDGE", "ExtrusionCut_3_1/Modfied_2&ExtrusionCut_1_1/Modfied_8"), model.selection("EDGE", "ExtrusionCut_1_1/Modfied_8"), model.selection("EDGE", "ExtrusionCut_1_1/Modfied_8&Cut_1_1/Modified_Face_1"), model.selection("EDGE", "ExtrusionCut_2_1/Modfied_2"), model.selection("EDGE", "ExtrusionCut_2_1/Lateral_5020")] +Group_2_objects = [model.selection("EDGE", "[ExtrusionCut_2_1/Modified_Face&Sketch_2/SketchCircle_10_2][ExtrusionCut_3_1/Modified_Face&Sketch_1/SketchLine_4]"), model.selection("EDGE", "([ExtrusionCut_2_1/Modified_Face&Sketch_2/SketchCircle_10_2][ExtrusionCut_2_1/Modified_Face&ExtrusionCut_2_1/From_Face_2])([ExtrusionCut_2_1/Modified_Face&Sketch_2/SketchCircle_10_2][ExtrusionCut_3_1/Modified_Face&Sketch_1/SketchLine_4])"), model.selection("EDGE", "[ExtrusionCut_2_1/Generated_Face&Sketch_2/SketchCircle_11_2][Cut_1_1/Modified_Face&Sketch_1/SketchLine_1]"), model.selection("EDGE", "[ExtrusionCut_2_1/Modified_Face&Sketch_2/SketchCircle_10_2][ExtrusionCut_2_1/Modified_Face&ExtrusionCut_2_1/From_Face_2]"), model.selection("EDGE", "([ExtrusionCut_2_1/Modified_Face&ExtrusionCut_2_1/From_Face_2][ExtrusionCut_2_1/Generated_Face&Sketch_2/SketchCircle_12_2])([Cut_1_1/Modified_Face&Sketch_1/SketchLine_1][ExtrusionCut_2_1/Generated_Face&Sketch_2/SketchCircle_12_2])"), model.selection("EDGE", "[ExtrusionCut_1_1/Modified_Face&Sketch_2/SketchCircle_3_2][ExtrusionCut_3_1/Modified_Face&Sketch_1/SketchLine_4]"), model.selection("EDGE", "[Cut_1_1/Modified_Face&Sketch_1/SketchLine_1][ExtrusionCut_1_1/Modified_Face&Sketch_2/SketchCircle_3_2]"), model.selection("EDGE", "Common_1_2/Generated_Edge&Sketch_3/SketchLine_25&Sketch_2/SketchCircle_13_2"), model.selection("EDGE", "[Cut_1_1/Modified_Face&Sketch_1/SketchLine_1][Common_1_2/Modified_Face&Sketch_2/SketchCircle_13_2]"), model.selection("EDGE", "(Common_1_2/Generated_Edge&Sketch_3/SketchLine_25&Sketch_2/SketchCircle_13_2)([Cut_1_1/Modified_Face&Sketch_1/SketchLine_1][Common_1_2/Modified_Face&Sketch_2/SketchCircle_13_2])"), model.selection("EDGE", "[ExtrusionCut_1_1/Modified_Face&Sketch_2/SketchCircle_4_2][ExtrusionCut_3_1/Modified_Face&Sketch_1/SketchLine_4]"), model.selection("EDGE", "([Cut_1_1/Modified_Face&Sketch_1/SketchLine_1][ExtrusionCut_1_1/Modified_Face&Sketch_2/SketchCircle_3_2])([ExtrusionCut_1_1/Modified_Face&Sketch_2/SketchCircle_3_2][ExtrusionCut_3_1/Modified_Face&Sketch_1/SketchLine_4])"), model.selection("EDGE", "([ExtrusionCut_2_1/Modified_Face&Sketch_2/SketchCircle_9_2][ExtrusionCut_3_1/Modified_Face&Sketch_1/SketchLine_4])([ExtrusionCut_2_1/Modified_Face&Sketch_2/SketchCircle_9_2][ExtrusionCut_2_1/Modified_Face&ExtrusionCut_2_1/From_Face_1])"), model.selection("EDGE", "[ExtrusionCut_2_1/Modified_Face&Sketch_2/SketchCircle_9_2][ExtrusionCut_3_1/Modified_Face&Sketch_1/SketchLine_4]"), model.selection("EDGE", "[ExtrusionCut_2_1/Modified_Face&Sketch_2/SketchCircle_9_2][ExtrusionCut_2_1/Modified_Face&ExtrusionCut_2_1/From_Face_1]"), model.selection("EDGE", "[ExtrusionCut_2_1/Modified_Face&ExtrusionCut_2_1/From_Face_1][ExtrusionCut_2_1/Generated_Face&Sketch_2/SketchCircle_11_2]"), model.selection("EDGE", "[ExtrusionCut_2_1/Generated_Face&Sketch_2/SketchCircle_11_2][Cut_1_1/Modified_Face&Sketch_1/SketchLine_1]"), model.selection("EDGE", "([ExtrusionCut_2_1/Generated_Face&Sketch_2/SketchCircle_11_2][Cut_1_1/Modified_Face&Sketch_1/SketchLine_1])([ExtrusionCut_2_1/Modified_Face&ExtrusionCut_2_1/From_Face_1][ExtrusionCut_2_1/Generated_Face&Sketch_2/SketchCircle_11_2])"), model.selection("EDGE", "[ExtrusionCut_3_1/Modified_Face&Sketch_2/SketchCircle_15_2][ExtrusionCut_3_1/Modified_Face&Sketch_1/SketchLine_4]"), model.selection("EDGE", "(Common_1_1/Generated_Edge&Sketch_3/SketchLine_25&Sketch_2/SketchCircle_14_2)([Cut_1_1/Modified_Face&Sketch_1/SketchLine_1][Common_1_1/Modified_Face&Sketch_2/SketchCircle_14_2])"), model.selection("EDGE", "Common_1_1/Generated_Edge&Sketch_3/SketchLine_25&Sketch_2/SketchCircle_14_2"), model.selection("EDGE", "[ExtrusionCut_2_1/Generated_Face&Sketch_2/SketchCircle_11_2][Cut_1_1/Modified_Face&Sketch_1/SketchLine_1]"), model.selection("EDGE", "[Revolution_1_1/Generated_Face&Sketch_1/SketchLine_3][ExtrusionCut_3_1/Modified_Face&Sketch_1/SketchLine_4]"), model.selection("EDGE", "[Cut_1_1/Modified_Face&Sketch_1/SketchLine_1][Common_1_1/Modified_Face&Sketch_2/SketchCircle_14_2]"), model.selection("EDGE", "[Revolution_1_1/Generated_Face&Sketch_1/SketchLine_5][ExtrusionCut_3_1/Modified_Face&Sketch_1/SketchLine_4]"), model.selection("EDGE", "[Revolution_1_1/Generated_Face&Sketch_1/SketchLine_7][Revolution_1_1/Generated_Face&Sketch_1/SketchLine_5]"), model.selection("EDGE", "[ExtrusionCut_2_1/Modified_Face&Sketch_2/SketchCircle_5_2][ExtrusionCut_3_1/Modified_Face&Sketch_1/SketchLine_4]"), model.selection("EDGE", "[ExtrusionCut_2_1/Modified_Face&Sketch_2/SketchCircle_5_2][ExtrusionCut_2_1/Modified_Face&ExtrusionCut_2_1/From_Face_3]"), model.selection("EDGE", "[ExtrusionCut_1_1/Modified_Face&Sketch_2/SketchCircle_4_2][Cut_1_1/Modified_Face&Sketch_1/SketchLine_1]"), model.selection("EDGE", "([ExtrusionCut_1_1/Modified_Face&Sketch_2/SketchCircle_4_2][ExtrusionCut_3_1/Modified_Face&Sketch_1/SketchLine_4])([ExtrusionCut_1_1/Modified_Face&Sketch_2/SketchCircle_4_2][Cut_1_1/Modified_Face&Sketch_1/SketchLine_1])"), model.selection("EDGE", "([ExtrusionCut_3_1/Modified_Face&Sketch_2/SketchCircle_15_2][ExtrusionCut_3_1/Modified_Face&Sketch_1/SketchLine_4])([ExtrusionCut_3_1/Modified_Face&Sketch_2/SketchCircle_15_2][Cut_1_1/Modified_Face&Sketch_1/SketchLine_1])"), model.selection("EDGE", "[Revolution_1_1/Generated_Face&Sketch_1/SketchLine_3][Cut_1_1/Modified_Face&Sketch_1/SketchLine_1]"), model.selection("EDGE", "[ExtrusionCut_3_1/Modified_Face&Sketch_2/SketchCircle_15_2][Cut_1_1/Modified_Face&Sketch_1/SketchLine_1]"), model.selection("EDGE", "[ExtrusionCut_1_1/Modified_Face&Sketch_2/SketchCircle_16_2][ExtrusionCut_3_1/Modified_Face&Sketch_1/SketchLine_4]"), model.selection("EDGE", "[ExtrusionCut_1_1/Modified_Face&Sketch_2/SketchCircle_17_2][ExtrusionCut_3_1/Modified_Face&Sketch_1/SketchLine_4]"), model.selection("EDGE", "([ExtrusionCut_1_1/Modified_Face&Sketch_2/SketchCircle_17_2][Cut_1_1/Modified_Face&Sketch_1/SketchLine_1])([ExtrusionCut_1_1/Modified_Face&Sketch_2/SketchCircle_17_2][ExtrusionCut_3_1/Modified_Face&Sketch_1/SketchLine_4])"), model.selection("EDGE", "([ExtrusionCut_1_1/Modified_Face&Sketch_2/SketchCircle_16_2][ExtrusionCut_3_1/Modified_Face&Sketch_1/SketchLine_4])([ExtrusionCut_1_1/Modified_Face&Sketch_2/SketchCircle_16_2][Cut_1_1/Modified_Face&Sketch_1/SketchLine_1])"), model.selection("EDGE", "[ExtrusionCut_1_1/Modified_Face&Sketch_2/SketchCircle_16_2][Cut_1_1/Modified_Face&Sketch_1/SketchLine_1]"), model.selection("EDGE", "[ExtrusionCut_1_1/Modified_Face&Sketch_2/SketchCircle_17_2][Cut_1_1/Modified_Face&Sketch_1/SketchLine_1]"), model.selection("EDGE", "([Revolution_1_1/Generated_Face&Sketch_1/SketchLine_5][ExtrusionCut_3_1/Modified_Face&Sketch_1/SketchLine_4])([Revolution_1_1/Generated_Face&Sketch_1/SketchLine_7][Revolution_1_1/Generated_Face&Sketch_1/SketchLine_5])"), model.selection("EDGE", "[ExtrusionCut_2_1/Generated_Face&Sketch_2/SketchCircle_11_2][Cut_1_1/Modified_Face&Sketch_1/SketchLine_1]"), model.selection("EDGE", "[ExtrusionCut_2_1/Modified_Face&ExtrusionCut_2_1/From_Face_4][ExtrusionCut_2_1/Modified_Face&Sketch_2/SketchCircle_7_2]"), model.selection("EDGE", "([ExtrusionCut_2_1/Modified_Face&ExtrusionCut_2_1/From_Face_4][ExtrusionCut_2_1/Modified_Face&Sketch_2/SketchCircle_7_2])"), model.selection("EDGE", "([Revolution_1_1/Generated_Face&Sketch_1/SketchLine_3][ExtrusionCut_3_1/Modified_Face&Sketch_1/SketchLine_4])([Revolution_1_1/Generated_Face&Sketch_1/SketchLine_3][Cut_1_1/Modified_Face&Sketch_1/SketchLine_1])"), model.selection("EDGE", "([ExtrusionCut_2_1/Generated_Face&Sketch_2/SketchCircle_8_2][Cut_1_1/Modified_Face&Sketch_1/SketchLine_1])([ExtrusionCut_2_1/Modified_Face&ExtrusionCut_2_1/From_Face_4][ExtrusionCut_2_1/Generated_Face&Sketch_2/SketchCircle_8_2])"), model.selection("EDGE", "[ExtrusionCut_1_1/Modified_Face&Sketch_2/SketchCircle_2_2][ExtrusionCut_3_1/Modified_Face&Sketch_1/SketchLine_4]"), model.selection("EDGE", "([ExtrusionCut_1_1/Modified_Face&Sketch_2/SketchCircle_2_2][ExtrusionCut_3_1/Modified_Face&Sketch_1/SketchLine_4])([ExtrusionCut_1_1/Modified_Face&Sketch_2/SketchCircle_2_2][Cut_1_1/Modified_Face&Sketch_1/SketchLine_1])"), model.selection("EDGE", "[ExtrusionCut_1_1/Modified_Face&Sketch_2/SketchCircle_2_2][Cut_1_1/Modified_Face&Sketch_1/SketchLine_1]"), model.selection("EDGE", "([ExtrusionCut_2_1/Modified_Face&Sketch_2/SketchCircle_5_2][ExtrusionCut_2_1/Modified_Face&ExtrusionCut_2_1/From_Face_3])([ExtrusionCut_2_1/Modified_Face&Sketch_2/SketchCircle_5_2][ExtrusionCut_3_1/Modified_Face&Sketch_1/SketchLine_4])"), model.selection("EDGE", "([ExtrusionCut_2_1/Generated_Face&Sketch_2/SketchCircle_6_2][ExtrusionCut_2_1/Modified_Face&ExtrusionCut_2_1/From_Face_3])([Cut_1_1/Modified_Face&Sketch_1/SketchLine_1][ExtrusionCut_2_1/Generated_Face&Sketch_2/SketchCircle_6_2])")] Group_2 = model.addGroup(Part_1_doc, Group_2_objects) -Group_3_objects = [model.selection("FACE", "ExtrusionCut_2_1/Modfied_3"), model.selection("FACE", "ExtrusionCut_2_1/Generated_Face_1"), model.selection("FACE", "ExtrusionCut_2_1/Modfied_8"), model.selection("FACE", "ExtrusionCut_1_1/Modfied_3"), model.selection("FACE", "Common_1_2/Modified_Face_1"), model.selection("FACE", "ExtrusionCut_1_1/Modfied_4"), model.selection("FACE", "ExtrusionCut_2_1/Modfied_4"), model.selection("FACE", "ExtrusionCut_2_1/Modfied_9"), model.selection("FACE", "Common_1_1/Modified_Face_1"), model.selection("FACE", "Revolution_1_1/Generated_Face_5"), model.selection("FACE", "ExtrusionCut_2_1/Generated_Face_1"), model.selection("FACE", "Cut_1_1/Modified_Face_1"), model.selection("FACE", "ExtrusionCut_2_1/Modfied_2"), model.selection("FACE", "ExtrusionCut_2_1/Modfied_7"), model.selection("FACE", "Common_1_1/Modified_Face_2"), model.selection("FACE", "ExtrusionCut_3_1/Modfied_2"), model.selection("FACE", "Revolution_1_1/Generated_Face_4"), model.selection("FACE", "ExtrusionCut_2_1/Generated_Face_1"), model.selection("FACE", "Common_1_2/Modified_Face_2"), model.selection("FACE", "Revolution_1_1/Generated_Face_2"), model.selection("FACE", "ExtrusionCut_3_1/Modfied_3"), model.selection("FACE", "ExtrusionCut_1_1/Modfied_5"), model.selection("FACE", "ExtrusionCut_1_1/Modfied_6"), model.selection("FACE", "ExtrusionCut_2_1/Modfied_5"), model.selection("FACE", "ExtrusionCut_2_1/Generated_Face_1"), model.selection("FACE", "ExtrusionCut_2_1/Modfied_6"), model.selection("FACE", "ExtrusionCut_1_1/Modfied_8")] +Group_3_objects = [model.selection("FACE", "ExtrusionCut_2_1/Modified_Face&Sketch_2/SketchCircle_10_2"), model.selection("FACE", "ExtrusionCut_2_1/Generated_Face&Sketch_2/SketchCircle_11_2"), model.selection("FACE", "ExtrusionCut_2_1/Modified_Face&ExtrusionCut_2_1/From_Face_2"), model.selection("FACE", "ExtrusionCut_1_1/Modified_Face&Sketch_2/SketchCircle_3_2"), model.selection("FACE", "Common_1_2/Modified_Face&Sketch_3/SketchLine_25"), model.selection("FACE", "ExtrusionCut_1_1/Modified_Face&Sketch_2/SketchCircle_4_2"), model.selection("FACE", "ExtrusionCut_2_1/Modified_Face&Sketch_2/SketchCircle_9_2"), model.selection("FACE", "ExtrusionCut_2_1/Modified_Face&ExtrusionCut_2_1/From_Face_1"), model.selection("FACE", "Common_1_1/Modified_Face&Sketch_3/SketchLine_25"), model.selection("FACE", "Revolution_1_1/Generated_Face&Sketch_1/SketchLine_7"), model.selection("FACE", "ExtrusionCut_2_1/Generated_Face&Sketch_2/SketchCircle_11_2"), model.selection("FACE", "Cut_1_1/Modified_Face&Sketch_1/SketchLine_1"), model.selection("FACE", "ExtrusionCut_2_1/Modified_Face&Sketch_2/SketchCircle_5_2"), model.selection("FACE", "ExtrusionCut_2_1/Modified_Face&ExtrusionCut_2_1/From_Face_3"), model.selection("FACE", "Common_1_1/Modified_Face&Sketch_2/SketchCircle_14_2"), model.selection("FACE", "ExtrusionCut_3_1/Modified_Face&Sketch_1/SketchLine_4"), model.selection("FACE", "Revolution_1_1/Generated_Face&Sketch_1/SketchLine_5"), model.selection("FACE", "ExtrusionCut_2_1/Generated_Face&Sketch_2/SketchCircle_11_2"), model.selection("FACE", "Common_1_2/Modified_Face&Sketch_2/SketchCircle_13_2"), model.selection("FACE", "Revolution_1_1/Generated_Face&Sketch_1/SketchLine_3"), model.selection("FACE", "ExtrusionCut_3_1/Modified_Face&Sketch_2/SketchCircle_15_2"), model.selection("FACE", "ExtrusionCut_1_1/Modified_Face&Sketch_2/SketchCircle_16_2"), model.selection("FACE", "ExtrusionCut_1_1/Modified_Face&Sketch_2/SketchCircle_17_2"), model.selection("FACE", "ExtrusionCut_2_1/Modified_Face&Sketch_2/SketchCircle_7_2"), model.selection("FACE", "ExtrusionCut_2_1/Generated_Face&Sketch_2/SketchCircle_11_2"), model.selection("FACE", "ExtrusionCut_2_1/Modified_Face&ExtrusionCut_2_1/From_Face_4"), model.selection("FACE", "ExtrusionCut_1_1/Modified_Face&Sketch_2/SketchCircle_2_2")] Group_3 = model.addGroup(Part_1_doc, Group_3_objects) +model.do() model.end() assert(model.checkPythonDump()) diff --git a/src/FeaturesPlugin/Test/Test2377.py b/src/FeaturesPlugin/Test/Test2377.py index 36e38d9d5..5f794351f 100644 --- a/src/FeaturesPlugin/Test/Test2377.py +++ b/src/FeaturesPlugin/Test/Test2377.py @@ -18,6 +18,8 @@ ## email : webmaster.salome@opencascade.com ## +# -*- coding: utf-8 -*- + from salome.shaper import model model.begin() @@ -32,11 +34,11 @@ SketchLine_3 = Sketch_1.addLine(46.08233276157804, -21.30874785591767, -1.039451 SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchLine_2.endPoint(), SketchLine_3.startPoint()) SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchLine_1.startPoint(), SketchLine_3.endPoint()) model.do() -Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_1f-SketchLine_2f-SketchLine_3f")], model.selection(), 100, 0) -Sketch_2 = model.addSketch(Part_1_doc, model.selection("FACE", "Extrusion_1_1/Generated_Face_3")) +Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_1r-SketchLine_2f-SketchLine_3f")], model.selection(), 100, 0) +Sketch_2 = model.addSketch(Part_1_doc, model.selection("FACE", "Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_1")) SketchCircle_1 = Sketch_2.addCircle(-10.74792845018279, -51.46099937127247, 20.55678647017868) model.do() -Extrusion_2 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchCircle_1_2f")], model.selection("EDGE", "PartSet/OX"), model.selection("FACE", "PartSet/YOZ"), 0, model.selection(), 0) +Extrusion_2 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchCircle_1_2r")], model.selection("EDGE", "PartSet/OX"), model.selection("FACE", "PartSet/YOZ"), 0, model.selection(), 0) model.do() model.end() diff --git a/src/FeaturesPlugin/Test/Test2394.py b/src/FeaturesPlugin/Test/Test2394.py index 13639bba7..c60225714 100644 --- a/src/FeaturesPlugin/Test/Test2394.py +++ b/src/FeaturesPlugin/Test/Test2394.py @@ -1,6 +1,4 @@ -# -*- coding: utf-8 -*- - -## Copyright (C) 2018-20xx CEA/DEN, EDF R&D +## Copyright (C) 2014-2017 CEA/DEN, EDF R&D ## ## This library is free software; you can redistribute it and/or ## modify it under the terms of the GNU Lesser General Public @@ -20,7 +18,8 @@ ## email : webmaster.salome@opencascade.com ## -from GeomAPI import * +# -*- coding: utf-8 -*- + from SketchAPI import * from salome.shaper import model @@ -29,7 +28,6 @@ model.begin() partSet = model.moduleDocument() Part_1 = model.addPart(partSet) Part_1_doc = Part_1.document() - model.addParameter(Part_1_doc, "R", "58") model.addParameter(Part_1_doc, "cote_cube", "R/2") model.addParameter(Part_1_doc, "theta", "54") @@ -60,9 +58,8 @@ SketchConstraintCoincidence_6 = Sketch_1.setCoincident(SketchArc_1.startPoint(), SketchConstraintVertical_1 = Sketch_1.setVertical(SketchLine_2.result()) SketchConstraintLength_1 = Sketch_1.setLength(SketchLine_2.result(), "R") Revolution_1.setNestedSketch(Sketch_1) - Extrusion_1 = model.addExtrusion(Part_1_doc, [], model.selection(), 0, "cote_cube") -Sketch_2 = model.addSketch(Part_1_doc, model.selection("FACE", "Revolution_1_1/Generated_Face_2")) +Sketch_2 = model.addSketch(Part_1_doc, model.selection("FACE", "Revolution_1_1/Generated_Face&Sketch_1/SketchLine_3")) SketchLine_4 = Sketch_2.addLine(29, 0, 0, 0) SketchLine_5 = Sketch_2.addLine(0, 0, 0, 29) SketchLine_6 = Sketch_2.addLine(0, 29, 29, 29) @@ -77,25 +74,22 @@ SketchConstraintHorizontal_2 = Sketch_2.setHorizontal(SketchLine_6.result()) SketchConstraintVertical_3 = Sketch_2.setVertical(SketchLine_7.result()) SketchConstraintLength_2 = Sketch_2.setLength(SketchLine_6.result(), "cote_cube") SketchConstraintEqual_1 = Sketch_2.setEqual(SketchLine_6.result(), SketchLine_7.result()) -SketchProjection_3 = Sketch_2.addProjection(model.selection("EDGE", "Revolution_1_1/Generated_Face_2&Revolution_1_1/To_Face_1"), False) +SketchProjection_3 = Sketch_2.addProjection(model.selection("EDGE", "[Revolution_1_1/Generated_Face&Sketch_1/SketchLine_3][Revolution_1_1/To_Face]"), False) SketchLine_8 = SketchProjection_3.createdFeature() SketchConstraintCoincidence_11 = Sketch_2.setCoincident(SketchLine_5.endPoint(), SketchLine_8.result()) -SketchProjection_4 = Sketch_2.addProjection(model.selection("EDGE", "Revolution_1_1/Generated_Face_2&Revolution_1_1/From_Face_1"), False) +SketchProjection_4 = Sketch_2.addProjection(model.selection("EDGE", "[Revolution_1_1/Generated_Face&Sketch_1/SketchLine_3][Revolution_1_1/From_Face]"), False) SketchLine_9 = SketchProjection_4.createdFeature() SketchConstraintCoincidence_12 = Sketch_2.setCoincident(SketchLine_4.startPoint(), SketchLine_9.result()) Extrusion_1.setNestedSketch(Sketch_2) - Fill_1 = model.addFill(Part_1_doc, [model.selection("SOLID", "Revolution_1_1")], [model.selection("SOLID", "Extrusion_1_1")]) - Point_2 = model.addPoint(Part_1_doc, "x", "y", "-z") -Axis_4 = model.addAxis(Part_1_doc, model.selection("VERTEX", "Point_1"), model.selection("VERTEX", "Fill_1_1_2/Modified_Face_3&Fill_1_1_2/Modified_Face_2&Fill_1_1_2/Modified_Face_1")) +Axis_4 = model.addAxis(Part_1_doc, model.selection("VERTEX", "Point_1"), model.selection("VERTEX", "[Fill_1_1_2/Modified_Face&Sketch_2/SketchLine_4&Revolution_1_1/From_Face][Fill_1_1_2/Modified_Face&Extrusion_1_1/To_Face&Sketch_1/SketchLine_3][Fill_1_1_2/Modified_Face&Sketch_2/SketchLine_5&Revolution_1_1/To_Face]")) Plane_4 = model.addPlane(Part_1_doc, model.selection("EDGE", "Axis_1"), model.selection("VERTEX", "Point_1"), True) Plane_5 = model.addPlane(Part_1_doc, model.selection("FACE", "Plane_1"), "haut_ext_tuyau", True) Plane_5.result().setName("Plane_2 arrivee tuyau") -Plane_6 = model.addPlane(Part_1_doc, model.selection("FACE", "Extrusion_1_1/Generated_Face_3"), model.selection("EDGE", "Extrusion_1_1/Generated_Face_3&Extrusion_1_1/From_Face_1"), 45) -Plane_7 = model.addPlane(Part_1_doc, model.selection("FACE", "Extrusion_1_1/Generated_Face_4"), model.selection("EDGE", "Extrusion_1_1/Generated_Face_4&Extrusion_1_1/From_Face_1"), 45) -Plane_8 = model.addPlane(Part_1_doc, model.selection("FACE", "Extrusion_1_1/Generated_Face_4"), model.selection("EDGE", "Extrusion_1_1/Generated_Face_3&Extrusion_1_1/Generated_Face_4"), "90+45") - +Plane_6 = model.addPlane(Part_1_doc, model.selection("FACE", "Extrusion_1_1/Generated_Face&Sketch_2/SketchLine_6"), model.selection("EDGE", "[Extrusion_1_1/From_Face][Extrusion_1_1/Generated_Face&Sketch_2/SketchLine_6]"), 45) +Plane_7 = model.addPlane(Part_1_doc, model.selection("FACE", "Extrusion_1_1/Generated_Face&Sketch_2/SketchLine_7"), model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_2/SketchLine_7][Extrusion_1_1/From_Face]"), 45) +Plane_8 = model.addPlane(Part_1_doc, model.selection("FACE", "Extrusion_1_1/Generated_Face&Sketch_2/SketchLine_7"), model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_2/SketchLine_7][Extrusion_1_1/Generated_Face&Sketch_2/SketchLine_6]"), "90+45") Fill_2 = model.addFill(Part_1_doc, [model.selection("SOLID", "Fill_1_1_1")], [model.selection("FACE", "Plane_5")]) Fill_3 = model.addFill(Part_1_doc, [model.selection("SOLID", "Fill_2_1_2")], [model.selection("FACE", "Plane_3")]) Fill_4 = model.addFill(Part_1_doc, [model.selection("SOLID", "Fill_3_1_2")], [model.selection("FACE", "Plane_4")]) @@ -105,11 +99,8 @@ Fill_4.result().subResult(1).setColor(0, 204, 204) Fill_4.result().subResult(2).setColor(51, 51, 102) Fill_4.result().subResult(3).setColor(102, 204, 102) Fill_4.result().subResult(4).setColor(204, 204, 0) - Union_1 = model.addUnion(Part_1_doc, [model.selection("SOLID", "Fill_4_1_4"), model.selection("SOLID", "Fill_4_1_2")]) - Point_3 = model.addPoint(Part_1_doc, model.selection("EDGE", "Axis_1"), model.selection("FACE", "Plane_2 arrivee tuyau")) - Sketch_3 = model.addSketch(Part_1_doc, model.selection("FACE", "Plane_2 arrivee tuyau")) SketchProjection_5 = Sketch_3.addProjection(model.selection("VERTEX", "Point_2"), False) SketchPoint_2 = SketchProjection_5.createdFeature() @@ -147,15 +138,13 @@ SketchConstraintEqual_3 = Sketch_3.setEqual(SketchLine_14.result(), SketchLine_1 SketchConstraintEqual_4 = Sketch_3.setEqual(SketchLine_17.result(), SketchLine_16.result()) SketchConstraintLength_3 = Sketch_3.setLength(SketchLine_10.result(), "diam_tuyau") model.do() - -Extrusion_2_objects = [model.selection("FACE", "Sketch_3/Face-SketchCircle_1_2f-SketchLine_11f-SketchLine_14r-SketchLine_16r"), model.selection("FACE", "Sketch_3/Face-SketchCircle_1_2f-SketchLine_10f-SketchLine_14f-SketchLine_17r"), model.selection("FACE", "Sketch_3/Face-SketchCircle_1_2f-SketchLine_13f-SketchLine_15r-SketchLine_17f"), model.selection("FACE", "Sketch_3/Face-SketchCircle_1_2f-SketchLine_12f-SketchLine_15f-SketchLine_16f")] +Extrusion_2_objects = [model.selection("FACE", "Sketch_3/Face-SketchCircle_1_2f-SketchLine_14r-SketchLine_11f-SketchLine_16r"), model.selection("FACE", "Sketch_3/Face-SketchCircle_1_2f-SketchCircle_1_2f-SketchLine_17r-SketchLine_10f-SketchLine_14f"), model.selection("FACE", "Sketch_3/Face-SketchCircle_1_2f-SketchLine_15r-SketchLine_13f-SketchLine_17f"), model.selection("FACE", "Sketch_3/Face-SketchCircle_1_2f-SketchLine_16f-SketchLine_12f-SketchLine_15f")] Extrusion_2 = model.addExtrusion(Part_1_doc, Extrusion_2_objects, model.selection(), 10, 0) -Extrusion_3 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_3/Face-SketchLine_10r-SketchLine_11r-SketchLine_12r-SketchLine_13r")], model.selection(), "haut_int_tuyau", 0) - +Extrusion_3 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_3/Face-SketchLine_13r-SketchLine_12r-SketchLine_11r-SketchLine_10r")], model.selection(), "haut_int_tuyau", 0) Sketch_4 = model.addSketch(Part_1_doc, model.selection("FACE", "Extrusion_2_1/To_Face_3")) -SketchProjection_6 = Sketch_4.addProjection(model.selection("VERTEX", "Extrusion_2_1/Generated_Face_2&Extrusion_2_1/Generated_Face_4&Extrusion_2_1/To_Face_4"), False) +SketchProjection_6 = Sketch_4.addProjection(model.selection("VERTEX", "[Extrusion_2_1_3/Generated_Face&Sketch_3/SketchCircle_1_2&weak_name_1][Extrusion_2_1/To_Face_3][Extrusion_2_1_3/Generated_Face&Sketch_3/SketchLine_15]"), False) SketchPoint_3 = SketchProjection_6.createdFeature() -SketchProjection_7 = Sketch_4.addProjection(model.selection("VERTEX", "Extrusion_2_1/Generated_Face_5&Extrusion_2_1/Generated_Face_7&Extrusion_2_1/To_Face_3"), False) +SketchProjection_7 = Sketch_4.addProjection(model.selection("VERTEX", "[Extrusion_2_1/To_Face_2][Extrusion_2_1_3/Generated_Face&Sketch_3/SketchLine_17][Extrusion_2_1_3/Generated_Face&Sketch_3/SketchCircle_1_2&weak_name_2]"), False) SketchPoint_4 = SketchProjection_7.createdFeature() SketchArc_2 = Sketch_4.addArc(0, 0, -7.071067811865476, -7.071067811865472, 7.071067811865476, 7.071067811865472, True) SketchConstraintCoincidence_26 = Sketch_4.setCoincident(SketchPoint_3.result(), SketchArc_2.startPoint()) @@ -163,48 +152,102 @@ SketchConstraintCoincidence_27 = Sketch_4.setCoincident(SketchPoint_4.result(), SketchLine_18 = Sketch_4.addLine(7.071067811865476, 7.071067811865472, -7.071067811865476, -7.071067811865472) SketchConstraintCoincidence_28 = Sketch_4.setCoincident(SketchArc_2.endPoint(), SketchLine_18.startPoint()) SketchConstraintCoincidence_29 = Sketch_4.setCoincident(SketchAPI_Point(SketchPoint_3).coordinates(), SketchLine_18.endPoint()) -SketchProjection_8 = Sketch_4.addProjection(model.selection("VERTEX", "Extrusion_2_1/Generated_Face_13&Extrusion_2_1/Generated_Face_12&Extrusion_2_1/To_Face_1"), False) +SketchProjection_8 = Sketch_4.addProjection(model.selection("VERTEX", "[Extrusion_2_1_3/Generated_Face&Sketch_3/SketchCircle_1_2&weak_name_5][Extrusion_2_1/To_Face_1][Extrusion_2_1_3/Generated_Face&Sketch_3/SketchLine_14]"), False) SketchPoint_5 = SketchProjection_8.createdFeature() SketchConstraintCoincidence_30 = Sketch_4.setCoincident(SketchArc_2.endPoint(), SketchAPI_Point(SketchPoint_5).coordinates()) model.do() - -Revolution_2 = model.addRevolution(Part_1_doc, [model.selection("FACE", "Sketch_4/Face-SketchArc_2_2f-SketchLine_18r")], model.selection("EDGE", "Sketch_4/Edge-SketchLine_18"), 0, 180) - +Revolution_2 = model.addRevolution(Part_1_doc, [model.selection("FACE", "Sketch_4/Face-SketchArc_2_2f-SketchLine_18r")], model.selection("EDGE", "Sketch_4/SketchLine_18"), 0, 180) Cut_1 = model.addCut(Part_1_doc, [model.selection("SOLID", "Revolution_2_1")], [model.selection("SOLID", "Extrusion_3_1")]) Cut_1.result().setName("demi-sphere") - -Plane_9 = model.addPlane(Part_1_doc, model.selection("VERTEX", "Extrusion_2_1/Generated_Face_10&Extrusion_2_1/Generated_Face_1&Extrusion_2_1/From_Face_4"), model.selection("VERTEX", "Extrusion_2_1/Generated_Face_10&Extrusion_2_1/Generated_Face_1&Extrusion_2_1/To_Face_4"), model.selection("VERTEX", "Extrusion_2_1/Generated_Face_2&Extrusion_2_1/Generated_Face_10&Extrusion_2_1/To_Face_4")) -Plane_10 = model.addPlane(Part_1_doc, model.selection("VERTEX", "Extrusion_2_1/Generated_Face_12&Extrusion_2_1/Generated_Face_11&Extrusion_2_1/To_Face_1"), model.selection("VERTEX", "Extrusion_2_1/Generated_Face_13&Extrusion_2_1/Generated_Face_12&Extrusion_2_1/To_Face_1"), model.selection("VERTEX", "Extrusion_2_1/Generated_Face_13&Extrusion_2_1/Generated_Face_12&Extrusion_2_1/From_Face_1")) -Plane_11 = model.addPlane(Part_1_doc, model.selection("VERTEX", "Extrusion_2_1/Generated_Face_5&Extrusion_2_1/Generated_Face_7&Extrusion_2_1/To_Face_3"), model.selection("VERTEX", "Extrusion_2_1/Generated_Face_3&Extrusion_2_1/Generated_Face_7&Extrusion_2_1/To_Face_3"), model.selection("VERTEX", "Extrusion_2_1/Generated_Face_5&Extrusion_2_1/Generated_Face_7&Extrusion_2_1/From_Face_3")) -Plane_12 = model.addPlane(Part_1_doc, model.selection("VERTEX", "Extrusion_2_1/Generated_Face_1&Extrusion_2_1/Generated_Face_4&Extrusion_2_1/To_Face_4"), model.selection("VERTEX", "Extrusion_2_1/Generated_Face_2&Extrusion_2_1/Generated_Face_4&Extrusion_2_1/To_Face_4"), model.selection("VERTEX", "Extrusion_2_1/Generated_Face_2&Extrusion_2_1/Generated_Face_4&Extrusion_2_1/From_Face_4")) - +Plane_9 = model.addPlane(Part_1_doc, model.selection("VERTEX", "[Extrusion_2_1_3/Generated_Face&Sketch_3/SketchLine_11][Extrusion_2_1/From_Face_1][Extrusion_2_1_3/Generated_Face&Sketch_3/SketchLine_16]"), model.selection("VERTEX", "[Extrusion_2_1_3/Generated_Face&Sketch_3/SketchLine_11][Extrusion_2_1_3/Generated_Face&Sketch_3/SketchLine_16][Extrusion_2_1/To_Face_1]"), model.selection("VERTEX", "[Extrusion_2_1_3/Generated_Face&Sketch_3/SketchCircle_1_2&weak_name_5][Extrusion_2_1_3/Generated_Face&Sketch_3/SketchLine_16][Extrusion_2_1/To_Face_1]")) +Plane_10 = model.addPlane(Part_1_doc, model.selection("VERTEX", "[Extrusion_2_1_3/Generated_Face&Sketch_3/SketchLine_11][Extrusion_2_1/To_Face_1][Extrusion_2_1_3/Generated_Face&Sketch_3/SketchLine_14]"), model.selection("VERTEX", "[Extrusion_2_1_3/Generated_Face&Sketch_3/SketchCircle_1_2&weak_name_5][Extrusion_2_1/To_Face_1][Extrusion_2_1_3/Generated_Face&Sketch_3/SketchLine_14]"), model.selection("VERTEX", "[Extrusion_2_1/From_Face_1][Extrusion_2_1_3/Generated_Face&Sketch_3/SketchCircle_1_2&weak_name_5][Extrusion_2_1_3/Generated_Face&Sketch_3/SketchLine_14]")) +Plane_11 = model.addPlane(Part_1_doc, model.selection("VERTEX", "[Extrusion_2_1/To_Face_2][Extrusion_2_1_3/Generated_Face&Sketch_3/SketchLine_17][Extrusion_2_1_3/Generated_Face&Sketch_3/SketchCircle_1_2&weak_name_2]"), model.selection("VERTEX", "[Extrusion_2_1_3/Generated_Face&Sketch_3/SketchLine_10][Extrusion_2_1/To_Face_2][Extrusion_2_1_3/Generated_Face&Sketch_3/SketchLine_17]"), model.selection("VERTEX", "[Extrusion_2_1/From_Face_2][Extrusion_2_1_3/Generated_Face&Sketch_3/SketchLine_17][Extrusion_2_1_3/Generated_Face&Sketch_3/SketchCircle_1_2&weak_name_2]")) +Plane_12 = model.addPlane(Part_1_doc, model.selection("VERTEX", "[Extrusion_2_1/To_Face_3][Extrusion_2_1_3/Generated_Face&Sketch_3/SketchLine_15][Extrusion_2_1_3/Generated_Face&Sketch_3/SketchLine_13]"), model.selection("VERTEX", "[Extrusion_2_1_3/Generated_Face&Sketch_3/SketchCircle_1_2&weak_name_1][Extrusion_2_1/To_Face_3][Extrusion_2_1_3/Generated_Face&Sketch_3/SketchLine_15]"), model.selection("VERTEX", "[Extrusion_2_1_3/Generated_Face&Sketch_3/SketchCircle_1_2&weak_name_1][Extrusion_2_1_3/Generated_Face&Sketch_3/SketchLine_15][Extrusion_2_1/From_Face_3]")) Recover_1 = model.addRecover(Part_1_doc, Cut_1, [Extrusion_3.result()]) - -Plane_13 = model.addPlane(Part_1_doc, model.selection("FACE", "Recover_1_1/Shape4"), model.selection("EDGE", "Recover_1_1/Shape4&Recover_1_1/Shape6"), "90+45") -Plane_14 = model.addPlane(Part_1_doc, model.selection("FACE", "Recover_1_1/Shape1"), model.selection("EDGE", "Recover_1_1/Shape1&Recover_1_1/Shape6"), "90+45") -Plane_15 = model.addPlane(Part_1_doc, model.selection("FACE", "Recover_1_1/Shape2"), model.selection("EDGE", "Recover_1_1/Shape2&Recover_1_1/Shape6"), "90+45") -Plane_16 = model.addPlane(Part_1_doc, model.selection("FACE", "Recover_1_1/Shape6"), model.selection("EDGE", "Recover_1_1/Shape3&Recover_1_1/Shape6"), 45) - +Plane_13 = model.addPlane(Part_1_doc, model.selection("FACE", "Recover_1_1/Shape_4"), model.selection("EDGE", "[Recover_1_1/Shape_4][Recover_1_1/Shape_6]"), "90+45") +Plane_14 = model.addPlane(Part_1_doc, model.selection("FACE", "Recover_1_1/Shape_1"), model.selection("EDGE", "[Recover_1_1/Shape_6][Recover_1_1/Shape_1]"), "90+45") +Plane_15 = model.addPlane(Part_1_doc, model.selection("FACE", "Recover_1_1/Shape_2"), model.selection("EDGE", "[Recover_1_1/Shape_6][Recover_1_1/Shape_2]"), "90+45") +Plane_16 = model.addPlane(Part_1_doc, model.selection("FACE", "Recover_1_1/Shape_6"), model.selection("EDGE", "[Recover_1_1/Shape_6][Recover_1_1/Shape_3]"), 45) Fill_5_objects_2 = [model.selection("FACE", "Plane_6"), model.selection("FACE", "Plane_7"), model.selection("FACE", "Plane_8"), model.selection("FACE", "Plane_9"), model.selection("FACE", "Plane_10"), model.selection("FACE", "Plane_11"), model.selection("FACE", "Plane_12"), model.selection("FACE", "Plane_13")] Fill_5 = model.addFill(Part_1_doc, [model.selection("SOLID", "demi-sphere")], Fill_5_objects_2) - +Fill_5.result().subResult(0).setName("Fill_5_1_1") +Fill_5.result().subResult(1).setName("Fill_5_1_2") +Fill_5.result().subResult(2).setName("Fill_5_1_3") +Fill_5.result().subResult(3).setName("Fill_5_1_4") +Fill_5.result().subResult(4).setName("Fill_5_1_5") +Fill_5.result().subResult(5).setName("Fill_5_1_6") +Fill_5.result().subResult(6).setName("Fill_5_1_7") +Fill_5.result().subResult(7).setName("Fill_5_1_8") +Fill_5.result().subResult(8).setName("Fill_5_1_9") +Fill_5.result().subResult(9).setName("Fill_5_1_10") +Fill_5.result().subResult(10).setName("Fill_5_1_11") +Fill_5.result().subResult(11).setName("Fill_5_1_12") +Fill_5.result().subResult(12).setName("Fill_5_1_13") +Fill_5.result().subResult(13).setName("Fill_5_1_14") +Fill_5.result().subResult(14).setName("Fill_5_1_15") +Fill_5.result().subResult(15).setName("Fill_5_1_16") Union_2_objects = [model.selection("SOLID", "Fill_5_1_14"), model.selection("SOLID", "Fill_5_1_15"), model.selection("SOLID", "Fill_5_1_16")] Union_2 = model.addUnion(Part_1_doc, Union_2_objects) -Union_3_objects = [model.selection("SOLID", "Fill_5_1_8/Fill_5_1_8"), model.selection("SOLID", "Fill_5_1_4/Fill_5_1_4"), model.selection("SOLID", "Fill_5_1_9/Fill_5_1_9"), model.selection("SOLID", "Fill_5_1_11/Fill_5_1_11")] +Union_2.result().subResult(0).setName("Union_2_1_1") +Union_2.result().subResult(1).setName("Union_2_1_2") +Union_2.result().subResult(2).setName("Union_2_1_3") +Union_2.result().subResult(3).setName("Union_2_1_4") +Union_2.result().subResult(4).setName("Union_2_1_5") +Union_2.result().subResult(5).setName("Union_2_1_6") +Union_2.result().subResult(6).setName("Union_2_1_7") +Union_2.result().subResult(7).setName("Union_2_1_8") +Union_2.result().subResult(8).setName("Union_2_1_9") +Union_2.result().subResult(9).setName("Union_2_1_10") +Union_2.result().subResult(10).setName("Union_2_1_11") +Union_2.result().subResult(11).setName("Union_2_1_12") +Union_2.result().subResult(12).setName("Union_2_1_13") +Union_2.result().subResult(13).setName("Union_2_1_14") +Union_3_objects = [model.selection("SOLID", "Union_2_1_8"), model.selection("SOLID", "Union_2_1_4"), model.selection("SOLID", "Union_2_1_9"), model.selection("SOLID", "Union_2_1_11")] Union_3 = model.addUnion(Part_1_doc, Union_3_objects) -Union_4_objects = [model.selection("SOLID", "Fill_5_1_6/Fill_5_1_6"), model.selection("SOLID", "Fill_5_1_10/Fill_5_1_10"), model.selection("SOLID", "Fill_5_1_13/Fill_5_1_13")] +Union_3.result().subResult(0).setName("Union_3_1_1") +Union_3.result().subResult(1).setName("Union_3_1_2") +Union_3.result().subResult(2).setName("Union_3_1_3") +Union_3.result().subResult(3).setName("Union_3_1_4") +Union_3.result().subResult(4).setName("Union_3_1_5") +Union_3.result().subResult(5).setName("Union_3_1_6") +Union_3.result().subResult(6).setName("Union_3_1_7") +Union_3.result().subResult(7).setName("Union_3_1_8") +Union_3.result().subResult(8).setName("Union_3_1_9") +Union_3.result().subResult(9).setName("Union_3_1_10") +Union_3.result().subResult(10).setName("Union_3_1_11") +Union_4_objects = [model.selection("SOLID", "Union_3_1_5"), model.selection("SOLID", "Union_3_1_7"), model.selection("SOLID", "Union_3_1_9")] Union_4 = model.addUnion(Part_1_doc, Union_4_objects) -Union_5_objects = [model.selection("SOLID", "Fill_5_1_2/Fill_5_1_2"), model.selection("SOLID", "Fill_5_1_1/Fill_5_1_1"), model.selection("SOLID", "Fill_5_1_3/Fill_5_1_3")] +Union_4.result().subResult(0).setName("Union_4_1_1") +Union_4.result().subResult(1).setName("Union_4_1_2") +Union_4.result().subResult(2).setName("Union_4_1_3") +Union_4.result().subResult(3).setName("Union_4_1_4") +Union_4.result().subResult(4).setName("Union_4_1_5") +Union_4.result().subResult(5).setName("Union_4_1_6") +Union_4.result().subResult(6).setName("Union_4_1_7") +Union_4.result().subResult(7).setName("Union_4_1_8") +Union_4.result().subResult(8).setName("Union_4_1_9") +Union_5_objects = [model.selection("SOLID", "Union_4_1_2"), model.selection("SOLID", "Union_4_1_1"), model.selection("SOLID", "Union_4_1_3")] Union_5 = model.addUnion(Part_1_doc, Union_5_objects) -Union_6_objects = [model.selection("SOLID", "Fill_5_1_5/Fill_5_1_5"), model.selection("SOLID", "Fill_5_1_7/Fill_5_1_7"), model.selection("SOLID", "Fill_5_1_12/Fill_5_1_12")] +Union_5.result().subResult(0).setName("Union_5_1_1") +Union_5.result().subResult(1).setName("Union_5_1_2") +Union_5.result().subResult(2).setName("Union_5_1_3") +Union_5.result().subResult(3).setName("Union_5_1_4") +Union_5.result().subResult(4).setName("Union_5_1_5") +Union_5.result().subResult(5).setName("Union_5_1_6") +Union_5.result().subResult(6).setName("Union_5_1_7") +Union_6_objects = [model.selection("SOLID", "Union_5_1_1"), model.selection("SOLID", "Union_5_1_2"), model.selection("SOLID", "Union_5_1_3")] Union_6 = model.addUnion(Part_1_doc, Union_6_objects) Union_6.result().setColor(0, 0, 204) +Union_6.result().subResult(0).setName("Union_6_1_1") Union_6.result().subResult(0).setColor(204, 102, 102) +Union_6.result().subResult(1).setName("Union_6_1_2") Union_6.result().subResult(1).setColor(127, 254, 127) +Union_6.result().subResult(2).setName("Union_6_1_3") Union_6.result().subResult(2).setColor(102, 51, 102) +Union_6.result().subResult(3).setName("Union_6_1_4") Union_6.result().subResult(3).setColor(76, 76, 153) +Union_6.result().subResult(4).setName("Union_6_1_5") Union_6.result().subResult(4).setColor(0, 0, 254) - Partition_1_objects = [model.selection("SOLID", "Recover_1_1"), model.selection("COMPSOLID", "Union_1_1"), model.selection("COMPSOLID", "Extrusion_2_1"), model.selection("COMPSOLID", "demi-sphere")] Partition_1 = model.addPartition(Part_1_doc, Partition_1_objects) Partition_1.result().setColor(102, 0, 0) @@ -227,7 +270,6 @@ Partition_1.result().subResult(15).setColor(254, 127, 254) Partition_1.result().subResult(16).setColor(153, 153, 0) Partition_1.result().subResult(17).setColor(153, 153, 0) Partition_1.result().subResult(18).setColor(204, 0, 204) - Folder_1 = model.addFolder(Part_1_doc, Revolution_1, Union_1) Folder_2 = model.addFolder(Part_1_doc, Point_3, Union_6) model.do() diff --git a/src/FeaturesPlugin/Test/Test2395.py b/src/FeaturesPlugin/Test/Test2395.py index 5364304ea..3d1c0368c 100644 --- a/src/FeaturesPlugin/Test/Test2395.py +++ b/src/FeaturesPlugin/Test/Test2395.py @@ -18,6 +18,8 @@ ## email : webmaster.salome@opencascade.com ## +# -*- coding: utf-8 -*- + from salome.shaper import model model.begin() @@ -43,11 +45,11 @@ SketchConstraintVertical_2 = Sketch_1.setVertical(SketchLine_4.result()) model.do() Sketch_2 = model.addSketch(Part_1_doc, model.defaultPlane("YOZ")) SketchLine_5 = Sketch_2.addLine(0, 0, -37.87650574447493, 64.03712943185892) -SketchProjection_2 = Sketch_2.addProjection(model.selection("VERTEX", "Sketch_1/Vertex-SketchProjection_1-SketchPoint_1-SketchLine_2s-SketchLine_1e"), False) +SketchProjection_2 = Sketch_2.addProjection(model.selection("VERTEX", "Sketch_1/SketchLine_1_EndVertex"), False) SketchPoint_2 = SketchProjection_2.createdFeature() SketchConstraintCoincidence_6 = Sketch_2.setCoincident(SketchLine_5.startPoint(), SketchPoint_2.result()) model.do() -Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("WIRE", "Sketch_1/Wire-SketchLine_1r-SketchLine_2r-SketchLine_3r-SketchLine_4r")], model.selection("EDGE", "Sketch_2/Edge-SketchLine_5"), 100, 0) +Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("WIRE", "[Sketch_1/SubEdge&Sketch_1/SketchLine_4][Sketch_1/SubEdge&Sketch_1/SketchLine_3][Sketch_1/SubEdge&Sketch_1/SketchLine_2][Sketch_1/SubEdge&Sketch_1/SketchLine_1]")], model.selection("EDGE", "Sketch_2/SketchLine_5"), 100, 0) model.do() model.end() diff --git a/src/FeaturesPlugin/Test/Test2419_1.py b/src/FeaturesPlugin/Test/Test2419_1.py index e1366fd36..8badeee3e 100644 --- a/src/FeaturesPlugin/Test/Test2419_1.py +++ b/src/FeaturesPlugin/Test/Test2419_1.py @@ -18,6 +18,8 @@ ## email : webmaster.salome@opencascade.com ## +# -*- coding: utf-8 -*- + from salome.shaper import model model.begin() @@ -52,13 +54,13 @@ SketchConstraintHorizontal_2 = Sketch_1.setHorizontal(SketchLine_4.result()) SketchConstraintHorizontal_3 = Sketch_1.setHorizontal(SketchLine_6.result()) SketchConstraintVertical_1 = Sketch_1.setVertical(SketchLine_3.result()) SketchConstraintVertical_2 = Sketch_1.setVertical(SketchLine_5.result()) -SketchArc_1 = Sketch_1.addArc(4.151438510550382e-034, -3.089278765476956e-034, 81.26217508737108, 0, 0, 81.26217508737108, False) +SketchArc_1 = Sketch_1.addArc(4.151438510550382e-34, -3.089278765476956e-34, 81.26217508737108, 0, 0, 81.26217508737108, False) SketchConstraintCoincidence_12 = Sketch_1.setCoincident(SketchLine_2.startPoint(), SketchArc_1.center()) SketchConstraintCoincidence_13 = Sketch_1.setCoincident(SketchLine_9.endPoint(), SketchArc_1.startPoint()) SketchConstraintCoincidence_14 = Sketch_1.setCoincident(SketchLine_2.result(), SketchArc_1.endPoint()) SketchConstraintCoincidence_15 = Sketch_1.setCoincident(SketchLine_10.endPoint(), SketchArc_1.endPoint()) SketchConstraintVertical_3 = Sketch_1.setVertical(SketchLine_7.result()) -SketchArc_2 = Sketch_1.addArc(4.151438510550382e-034, -3.089278765476956e-034, 76.26217508737108, 0, 0, 76.26217508737108, False) +SketchArc_2 = Sketch_1.addArc(4.151438510550382e-34, -3.089278765476956e-34, 76.26217508737108, 0, 0, 76.26217508737108, False) SketchConstraintCoincidence_16 = Sketch_1.setCoincident(SketchLine_2.startPoint(), SketchArc_2.center()) SketchConstraintCoincidence_16.setName("SketchConstraintCoincidence_23") SketchConstraintCoincidence_17 = Sketch_1.setCoincident(SketchLine_9.result(), SketchArc_2.startPoint()) @@ -79,15 +81,18 @@ SketchConstraintEqual_3.setName("SketchConstraintEqual_4") SketchConstraintEqual_4 = Sketch_1.setEqual(SketchLine_4.result(), SketchLine_1.result()) SketchConstraintEqual_4.setName("SketchConstraintEqual_5") model.do() -Face_1 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_1/Wire-SketchLine_1f-SketchLine_3f-SketchLine_4f-SketchLine_5f-SketchLine_6f-SketchLine_7f-SketchLine_9f-SketchLine_10r-SketchArc_2_2f")]) +Face_1 = model.addFace(Part_1_doc, [model.selection("WIRE", "[Sketch_1/SubEdge&Sketch_1/SketchLine_1][Sketch_1/SubEdge&Sketch_1/SketchLine_3][Sketch_1/SubEdge&Sketch_1/SketchLine_4][Sketch_1/SubEdge&Sketch_1/SketchLine_5][Sketch_1/SubEdge&Sketch_1/SketchLine_6][Sketch_1/SubEdge&Sketch_1/SketchLine_7][Sketch_1/SubEdge&Sketch_1/SketchLine_9][Sketch_1/SketchArc_2_2][Sketch_1/SubEdge&Sketch_1/SketchLine_10]")]) Sketch_2 = model.addSketch(Part_1_doc, model.standardPlane("XOY")) SketchLine_11 = Sketch_2.addLine(40, 0, 30, 0) SketchLine_12 = Sketch_2.addLine(30, 0, 30, 10) SketchLine_13 = Sketch_2.addLine(30, 10, 40, 10) SketchLine_14 = Sketch_2.addLine(40, 10, 40, 0) SketchConstraintCoincidence_19 = Sketch_2.setCoincident(SketchLine_14.endPoint(), SketchLine_11.startPoint()) +SketchConstraintCoincidence_19.setName("SketchConstraintCoincidence_19") SketchConstraintCoincidence_20 = Sketch_2.setCoincident(SketchLine_11.endPoint(), SketchLine_12.startPoint()) +SketchConstraintCoincidence_20.setName("SketchConstraintCoincidence_20") SketchConstraintCoincidence_21 = Sketch_2.setCoincident(SketchLine_12.endPoint(), SketchLine_13.startPoint()) +SketchConstraintCoincidence_21.setName("SketchConstraintCoincidence_21") SketchConstraintCoincidence_22 = Sketch_2.setCoincident(SketchLine_13.endPoint(), SketchLine_14.startPoint()) SketchConstraintCoincidence_22.setName("SketchConstraintCoincidence_26") SketchConstraintHorizontal_4 = Sketch_2.setHorizontal(SketchLine_11.result()) @@ -101,23 +106,22 @@ SketchConstraintEqual_5.setName("SketchConstraintEqual_1") model.do() Sketch_2.setName("Sketch_3") Sketch_2.result().setName("Sketch_3") -Face_2 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_3/Wire-SketchLine_11r-SketchLine_12r-SketchLine_13r-SketchLine_14r")]) +Face_2 = model.addFace(Part_1_doc, [model.selection("WIRE", "[Sketch_3/SubEdge&Sketch_3/SketchLine_14][Sketch_3/SubEdge&Sketch_3/SketchLine_13][Sketch_3/SubEdge&Sketch_3/SketchLine_12][Sketch_3/SubEdge&Sketch_3/SketchLine_11]")]) Face_2.setName("Face_5") Face_2.result().setName("Face_5_1") -LinearCopy_1 = model.addMultiTranslation(Part_1_doc, [model.selection("FACE", "Face_5_1")], model.selection("EDGE", "Sketch_1/Edge-SketchLine_9"), 10, 2) +LinearCopy_1 = model.addMultiTranslation(Part_1_doc, [model.selection("FACE", "Face_5_1")], model.selection("EDGE", "Sketch_1/SketchLine_9"), 10, 2) LinearCopy_1.result().setName("LinearCopy") -LinearCopy_1.result().subResult(0).setName("LinearCopy_1_1_1") -LinearCopy_1.result().subResult(1).setName("LinearCopy_1_1_2") -Boolean_1 = model.addFill(Part_1_doc, [model.selection("FACE", "Face_1_1")], [model.selection("COMPOUND", "LinearCopy")]) +Fill_1 = model.addFill(Part_1_doc, [model.selection("FACE", "Face_1_1")], [model.selection("COMPOUND", "LinearCopy")]) +model.do() model.end() from GeomAPI import GeomAPI_Shape -model.testNbResults(Boolean_1, 1) -model.testNbSubResults(Boolean_1, [3]) -model.testNbSubShapes(Boolean_1, GeomAPI_Shape.SOLID, [0]) -model.testNbSubShapes(Boolean_1, GeomAPI_Shape.FACE, [3]) -model.testNbSubShapes(Boolean_1, GeomAPI_Shape.EDGE, [20]) -model.testNbSubShapes(Boolean_1, GeomAPI_Shape.VERTEX, [40]) +model.testNbResults(Fill_1, 1) +model.testNbSubResults(Fill_1, [3]) +model.testNbSubShapes(Fill_1, GeomAPI_Shape.SOLID, [0]) +model.testNbSubShapes(Fill_1, GeomAPI_Shape.FACE, [3]) +model.testNbSubShapes(Fill_1, GeomAPI_Shape.EDGE, [20]) +model.testNbSubShapes(Fill_1, GeomAPI_Shape.VERTEX, [40]) assert(model.checkPythonDump()) diff --git a/src/FeaturesPlugin/Test/Test2419_2.py b/src/FeaturesPlugin/Test/Test2419_2.py index 4f591ed01..bc0ac8a99 100644 --- a/src/FeaturesPlugin/Test/Test2419_2.py +++ b/src/FeaturesPlugin/Test/Test2419_2.py @@ -18,6 +18,8 @@ ## email : webmaster.salome@opencascade.com ## +# -*- coding: utf-8 -*- + from salome.shaper import model model.begin() @@ -93,11 +95,11 @@ SketchCircle_10 = Sketch_2.addCircle(49.58498153094326, 15.18789884296047, 2.552 SketchCircle_11 = Sketch_2.addCircle(66.22695092615982, 10.77677442495125, 4.536925074373645) SketchCircle_12 = Sketch_2.addCircle(50.98852111849166, 6.165144351577979, 3.547307159201085) model.do() -Face_1 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_1/Wire-SketchLine_1f-SketchLine_3f-SketchLine_4f-SketchLine_5f-SketchLine_6f-SketchLine_7f-SketchLine_9f-SketchLine_10r-SketchArc_2_2f")]) -Face_2 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_1/Wire-SketchLine_9f-SketchLine_10r-SketchArc_1_2f-SketchArc_2_2r")]) -Face_3_objects = [model.selection("EDGE", "Sketch_2/Edge-SketchCircle_1_2"), model.selection("EDGE", "Sketch_2/Edge-SketchCircle_2_2"), model.selection("EDGE", "Sketch_2/Edge-SketchCircle_3_2"), model.selection("EDGE", "Sketch_2/Edge-SketchCircle_4_2"), model.selection("EDGE", "Sketch_2/Edge-SketchCircle_5_2"), model.selection("EDGE", "Sketch_2/Edge-SketchCircle_6_2"), model.selection("EDGE", "Sketch_2/Edge-SketchCircle_7_2"), model.selection("EDGE", "Sketch_2/Edge-SketchCircle_9_2"), model.selection("EDGE", "Sketch_2/Edge-SketchCircle_8_2"), model.selection("EDGE", "Sketch_2/Edge-SketchCircle_10_2"), model.selection("EDGE", "Sketch_2/Edge-SketchCircle_12_2"), model.selection("EDGE", "Sketch_2/Edge-SketchCircle_11_2")] +Face_1 = model.addFace(Part_1_doc, [model.selection("WIRE", "[Sketch_1/SubEdge&Sketch_1/SketchLine_1][Sketch_1/SubEdge&Sketch_1/SketchLine_3][Sketch_1/SubEdge&Sketch_1/SketchLine_4][Sketch_1/SubEdge&Sketch_1/SketchLine_5][Sketch_1/SubEdge&Sketch_1/SketchLine_6][Sketch_1/SubEdge&Sketch_1/SketchLine_7][Sketch_1/SubEdge&Sketch_1/SketchLine_9][Sketch_1/SketchArc_2_2][Sketch_1/SubEdge&Sketch_1/SketchLine_10]")]) +Face_2 = model.addFace(Part_1_doc, [model.selection("WIRE", "[Sketch_1/SubEdge&Sketch_1/SketchLine_9][Sketch_1/SubEdge&Sketch_1/SketchArc_1_2][Sketch_1/SubEdge&Sketch_1/SketchLine_10][Sketch_1/SketchArc_2_2]")]) +Face_3_objects = [model.selection("EDGE", "Sketch_2/SketchCircle_1_2"), model.selection("EDGE", "Sketch_2/SketchCircle_2_2"), model.selection("EDGE", "Sketch_2/SketchCircle_3_2"), model.selection("EDGE", "Sketch_2/SketchCircle_4_2"), model.selection("EDGE", "Sketch_2/SketchCircle_5_2"), model.selection("EDGE", "Sketch_2/SketchCircle_6_2"), model.selection("EDGE", "Sketch_2/SketchCircle_7_2"), model.selection("EDGE", "Sketch_2/SketchCircle_9_2"), model.selection("EDGE", "Sketch_2/SketchCircle_8_2"), model.selection("EDGE", "Sketch_2/SketchCircle_10_2"), model.selection("EDGE", "Sketch_2/SketchCircle_12_2"), model.selection("EDGE", "Sketch_2/SketchCircle_11_2")] Face_3 = model.addFace(Part_1_doc, Face_3_objects) -Face_4_objects = [model.selection("EDGE", "Sketch_2/Edge-SketchCircle_1_2"), model.selection("EDGE", "Sketch_2/Edge-SketchCircle_2_2"), model.selection("EDGE", "Sketch_2/Edge-SketchCircle_3_2"), model.selection("EDGE", "Sketch_2/Edge-SketchCircle_4_2"), model.selection("EDGE", "Sketch_2/Edge-SketchCircle_5_2"), model.selection("EDGE", "Sketch_2/Edge-SketchCircle_7_2"), model.selection("EDGE", "Sketch_2/Edge-SketchCircle_6_2"), model.selection("EDGE", "Sketch_2/Edge-SketchCircle_9_2"), model.selection("EDGE", "Sketch_2/Edge-SketchCircle_8_2"), model.selection("EDGE", "Sketch_2/Edge-SketchCircle_10_2"), model.selection("EDGE", "Sketch_2/Edge-SketchCircle_12_2"), model.selection("EDGE", "Sketch_2/Edge-SketchCircle_11_2"), model.selection("WIRE", "Sketch_1/Wire-SketchLine_1f-SketchLine_3f-SketchLine_4f-SketchLine_5f-SketchLine_6f-SketchLine_7f-SketchLine_9f-SketchLine_10r-SketchArc_2_2f")] +Face_4_objects = [model.selection("EDGE", "Sketch_2/SketchCircle_1_2"), model.selection("EDGE", "Sketch_2/SketchCircle_2_2"), model.selection("EDGE", "Sketch_2/SketchCircle_3_2"), model.selection("EDGE", "Sketch_2/SketchCircle_4_2"), model.selection("EDGE", "Sketch_2/SketchCircle_5_2"), model.selection("EDGE", "Sketch_2/SketchCircle_7_2"), model.selection("EDGE", "Sketch_2/SketchCircle_6_2"), model.selection("EDGE", "Sketch_2/SketchCircle_9_2"), model.selection("EDGE", "Sketch_2/SketchCircle_8_2"), model.selection("EDGE", "Sketch_2/SketchCircle_10_2"), model.selection("EDGE", "Sketch_2/SketchCircle_12_2"), model.selection("EDGE", "Sketch_2/SketchCircle_11_2"), model.selection("WIRE", "[Sketch_1/SubEdge&Sketch_1/SketchLine_1][Sketch_1/SubEdge&Sketch_1/SketchLine_3][Sketch_1/SubEdge&Sketch_1/SketchLine_4][Sketch_1/SubEdge&Sketch_1/SketchLine_5][Sketch_1/SubEdge&Sketch_1/SketchLine_6][Sketch_1/SubEdge&Sketch_1/SketchLine_7][Sketch_1/SubEdge&Sketch_1/SketchLine_9][Sketch_1/SketchArc_2_2][Sketch_1/SubEdge&Sketch_1/SketchLine_10]")] Face_4 = model.addFace(Part_1_doc, Face_4_objects) Group_1_objects = [model.selection("FACE", "Face_2_1"), model.selection("FACE", "Face_3_7"), model.selection("FACE", "Face_3_5"), model.selection("FACE", "Face_3_3"), model.selection("FACE", "Face_3_4"), model.selection("FACE", "Face_3_1"), model.selection("FACE", "Face_3_2"), model.selection("FACE", "Face_3_6"), model.selection("FACE", "Face_3_11"), model.selection("FACE", "Face_3_10"), model.selection("FACE", "Face_3_8"), model.selection("FACE", "Face_3_9"), model.selection("FACE", "Face_3_12")] Group_1 = model.addGroup(Part_1_doc, Group_1_objects) @@ -108,15 +110,19 @@ Group_2.result().setName("acier") Group_2.result().setColor(170, 85, 0) Sketch_3 = model.addSketch(Part_1_doc, model.standardPlane("XOY")) SketchLine_11 = Sketch_3.addLine(40, 0, 30, 0) -SketchProjection_1 = Sketch_3.addProjection(model.selection("VERTEX", "Face_4_1/Edge_6&Face_4_1/Edge_7"), False) +SketchProjection_1 = Sketch_3.addProjection(model.selection("VERTEX", "[Face_4_1/Edge_7][Face_4_1/Edge_6]"), False) SketchPoint_1 = SketchProjection_1.createdFeature() SketchConstraintCoincidence_19 = Sketch_3.setCoincident(SketchLine_11.endPoint(), SketchPoint_1.result()) +SketchConstraintCoincidence_19.setName("SketchConstraintCoincidence_19") SketchLine_12 = Sketch_3.addLine(30, 0, 30, 10) SketchLine_13 = Sketch_3.addLine(30, 10, 40, 10) SketchLine_14 = Sketch_3.addLine(40, 10, 40, 0) SketchConstraintCoincidence_20 = Sketch_3.setCoincident(SketchLine_14.endPoint(), SketchLine_11.startPoint()) +SketchConstraintCoincidence_20.setName("SketchConstraintCoincidence_20") SketchConstraintCoincidence_21 = Sketch_3.setCoincident(SketchLine_11.endPoint(), SketchLine_12.startPoint()) +SketchConstraintCoincidence_21.setName("SketchConstraintCoincidence_21") SketchConstraintCoincidence_22 = Sketch_3.setCoincident(SketchLine_12.endPoint(), SketchLine_13.startPoint()) +SketchConstraintCoincidence_22.setName("SketchConstraintCoincidence_22") SketchConstraintCoincidence_23 = Sketch_3.setCoincident(SketchLine_13.endPoint(), SketchLine_14.startPoint()) SketchConstraintCoincidence_23.setName("SketchConstraintCoincidence_26") SketchConstraintHorizontal_4 = Sketch_3.setHorizontal(SketchLine_11.result()) @@ -128,33 +134,33 @@ SketchConstraintLength_3.setName("SketchConstraintLength_1") SketchConstraintEqual_5 = Sketch_3.setEqual(SketchLine_13.result(), SketchLine_14.result()) SketchConstraintEqual_5.setName("SketchConstraintEqual_1") model.do() -Face_5 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_3/Wire-SketchLine_11r-SketchLine_12r-SketchLine_13r-SketchLine_14r")]) -LinearCopy_1 = model.addMultiTranslation(Part_1_doc, [model.selection("FACE", "Face_5_1")], model.selection("EDGE", "Sketch_1/Edge-SketchLine_9"), "length_assemblage", 4, model.selection("EDGE", "PartSet/OY"), "length_assemblage", 2) +Face_5 = model.addFace(Part_1_doc, [model.selection("WIRE", "[Sketch_3/SubEdge&Sketch_3/SketchLine_14][Sketch_3/SubEdge&Sketch_3/SketchLine_13][Sketch_3/SubEdge&Sketch_3/SketchLine_12][Sketch_3/SubEdge&Sketch_3/SketchLine_11]")]) +LinearCopy_1 = model.addMultiTranslation(Part_1_doc, [model.selection("FACE", "Face_5_1")], model.selection("EDGE", "Sketch_1/SketchLine_9"), "length_assemblage", 4, model.selection("EDGE", "PartSet/OY"), "length_assemblage", 2) Recover_1 = model.addRecover(Part_1_doc, LinearCopy_1, [Face_5.result()]) -Translation_1 = model.addTranslation(Part_1_doc, [model.selection("FACE", "Recover_1_1")], model.selection("VERTEX", "Sketch_3/Vertex-SketchProjection_1-SketchPoint_1-SketchLine_12s-SketchLine_11e"), model.selection("VERTEX", "Sketch_1/Vertex-SketchLine_6s-SketchLine_5e")) +Translation_1 = model.addTranslation(Part_1_doc, [model.selection("FACE", "Recover_1_1")], model.selection("VERTEX", "Sketch_3/SketchLine_11_EndVertex"), model.selection("VERTEX", "Sketch_1/SketchLine_5_EndVertex")) LinearCopy_2 = model.addMultiTranslation(Part_1_doc, [model.selection("FACE", "Translation_1_1")], model.selection("EDGE", "PartSet/OX"), "length_assemblage", 4, model.selection("EDGE", "PartSet/OY"), "length_assemblage", 2) Recover_2 = model.addRecover(Part_1_doc, LinearCopy_1, [Face_5.result()]) -Translation_2 = model.addTranslation(Part_1_doc, [model.selection("FACE", "Recover_2_1")], model.selection("VERTEX", "Sketch_3/Vertex-SketchProjection_1-SketchPoint_1-SketchLine_12s-SketchLine_11e"), model.selection("VERTEX", "Sketch_1/Vertex-SketchLine_4s-SketchLine_3e")) +Translation_2 = model.addTranslation(Part_1_doc, [model.selection("FACE", "Recover_2_1")], model.selection("VERTEX", "Sketch_3/SketchLine_11_EndVertex"), model.selection("VERTEX", "Sketch_1/SketchLine_3_EndVertex")) LinearCopy_3 = model.addMultiTranslation(Part_1_doc, [model.selection("FACE", "Translation_2_1")], model.selection("EDGE", "PartSet/OX"), "length_assemblage", 4) Recover_3 = model.addRecover(Part_1_doc, LinearCopy_1, [Face_5.result()]) -Translation_3 = model.addTranslation(Part_1_doc, [model.selection("FACE", "Recover_3_1")], model.selection("VERTEX", "Sketch_1/Vertex-SketchLine_9s-SketchLine_7e"), model.selection("VERTEX", "LinearCopy_3_1/Translated_Edge_1_4&LinearCopy_3_1/Translated_Edge_1_1")) +Translation_3 = model.addTranslation(Part_1_doc, [model.selection("FACE", "Recover_3_1")], model.selection("VERTEX", "Sketch_1/SketchLine_7_EndVertex"), model.selection("VERTEX", "[LinearCopy_3_1_1/ME:Translated_Edge&Recover_2_1/Shape_4][LinearCopy_3_1_1/ME:Translated_Edge&Recover_2_1/Shape_1]")) LinearCopy_4 = model.addMultiTranslation(Part_1_doc, [model.selection("FACE", "Translation_3_1")], model.selection("EDGE", "PartSet/OX"), "length_assemblage", 3) Recover_4 = model.addRecover(Part_1_doc, LinearCopy_1, [Face_5.result()]) -Translation_4 = model.addTranslation(Part_1_doc, [model.selection("FACE", "Recover_4_1")], model.selection("VERTEX", "Sketch_1/Vertex-SketchLine_9s-SketchLine_7e"), model.selection("VERTEX", "Sketch_1/Vertex-SketchLine_1s-SketchLine_10s")) +Translation_4 = model.addTranslation(Part_1_doc, [model.selection("FACE", "Recover_4_1")], model.selection("VERTEX", "Sketch_1/SketchLine_7_EndVertex"), model.selection("VERTEX", "Sketch_1/SketchLine_1_StartVertex")) LinearCopy_5 = model.addMultiTranslation(Part_1_doc, [model.selection("FACE", "Translation_4_1")], model.selection("EDGE", "PartSet/OX"), "length_assemblage", 2) Partition_1 = model.addPartition(Part_1_doc, [model.selection("FACE", "Face_1_1"), model.selection("FACE", "Face_2_1")]) -Boolean_1_objects_2 = [model.selection("FACE", "Face_3_1"), model.selection("FACE", "Face_3_2"), model.selection("FACE", "Face_3_3"), model.selection("FACE", "Face_3_4"), model.selection("FACE", "Face_3_5"), model.selection("FACE", "Face_3_6"), model.selection("FACE", "Face_3_7"), model.selection("FACE", "Face_3_8"), model.selection("FACE", "Face_3_9"), model.selection("FACE", "Face_3_10"), model.selection("FACE", "Face_3_11"), model.selection("FACE", "Face_3_12"), model.selection("FACE", "Face_4_1"), model.selection("COMPOUND", "LinearCopy_1_1"), model.selection("COMPOUND", "LinearCopy_2_1"), model.selection("COMPOUND", "LinearCopy_3_1"), model.selection("COMPOUND", "LinearCopy_4_1"), model.selection("COMPOUND", "LinearCopy_5_1")] -Boolean_1 = model.addFill(Part_1_doc, [model.selection("COMPOUND", "Partition_1_1")], Boolean_1_objects_2) +Fill_1_objects_2 = [model.selection("FACE", "Face_3_1"), model.selection("FACE", "Face_3_2"), model.selection("FACE", "Face_3_3"), model.selection("FACE", "Face_3_4"), model.selection("FACE", "Face_3_5"), model.selection("FACE", "Face_3_6"), model.selection("FACE", "Face_3_7"), model.selection("FACE", "Face_3_8"), model.selection("FACE", "Face_3_9"), model.selection("FACE", "Face_3_10"), model.selection("FACE", "Face_3_11"), model.selection("FACE", "Face_3_12"), model.selection("FACE", "Face_4_1"), model.selection("COMPOUND", "LinearCopy_1_1"), model.selection("COMPOUND", "LinearCopy_2_1"), model.selection("COMPOUND", "LinearCopy_3_1"), model.selection("COMPOUND", "LinearCopy_4_1"), model.selection("COMPOUND", "LinearCopy_5_1")] +Fill_1 = model.addFill(Part_1_doc, [model.selection("COMPOUND", "Partition_1_1")], Fill_1_objects_2) model.do() model.end() from GeomAPI import GeomAPI_Shape -model.testNbResults(Boolean_1, 1) -model.testNbSubResults(Boolean_1, [60]) -model.testNbSubShapes(Boolean_1, GeomAPI_Shape.SOLID, [0]) -model.testNbSubShapes(Boolean_1, GeomAPI_Shape.FACE, [60]) -model.testNbSubShapes(Boolean_1, GeomAPI_Shape.EDGE, [273]) -model.testNbSubShapes(Boolean_1, GeomAPI_Shape.VERTEX, [546]) +model.testNbResults(Fill_1, 1) +model.testNbSubResults(Fill_1, [60]) +model.testNbSubShapes(Fill_1, GeomAPI_Shape.SOLID, [0]) +model.testNbSubShapes(Fill_1, GeomAPI_Shape.FACE, [60]) +model.testNbSubShapes(Fill_1, GeomAPI_Shape.EDGE, [273]) +model.testNbSubShapes(Fill_1, GeomAPI_Shape.VERTEX, [546]) assert(model.checkPythonDump()) diff --git a/src/FeaturesPlugin/Test/Test2419_3.py b/src/FeaturesPlugin/Test/Test2419_3.py index dd6e4c4e9..72b95b44d 100644 --- a/src/FeaturesPlugin/Test/Test2419_3.py +++ b/src/FeaturesPlugin/Test/Test2419_3.py @@ -18,6 +18,8 @@ ## email : webmaster.salome@opencascade.com ## +# -*- coding: utf-8 -*- + from salome.shaper import model model.begin() @@ -93,11 +95,11 @@ SketchCircle_10 = Sketch_2.addCircle(49.58498153094326, 15.18789884296047, 2.552 SketchCircle_11 = Sketch_2.addCircle(66.22695092615982, 10.77677442495125, 4.536925074373645) SketchCircle_12 = Sketch_2.addCircle(50.98852111849166, 6.165144351577979, 3.547307159201085) model.do() -Face_1 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_1/Wire-SketchLine_1f-SketchLine_3f-SketchLine_4f-SketchLine_5f-SketchLine_6f-SketchLine_7f-SketchLine_9f-SketchLine_10r-SketchArc_2_2f")]) -Face_2 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_1/Wire-SketchLine_9f-SketchLine_10r-SketchArc_1_2f-SketchArc_2_2r")]) -Face_3_objects = [model.selection("EDGE", "Sketch_2/Edge-SketchCircle_1_2"), model.selection("EDGE", "Sketch_2/Edge-SketchCircle_2_2"), model.selection("EDGE", "Sketch_2/Edge-SketchCircle_3_2"), model.selection("EDGE", "Sketch_2/Edge-SketchCircle_4_2"), model.selection("EDGE", "Sketch_2/Edge-SketchCircle_5_2"), model.selection("EDGE", "Sketch_2/Edge-SketchCircle_6_2"), model.selection("EDGE", "Sketch_2/Edge-SketchCircle_7_2"), model.selection("EDGE", "Sketch_2/Edge-SketchCircle_9_2"), model.selection("EDGE", "Sketch_2/Edge-SketchCircle_8_2"), model.selection("EDGE", "Sketch_2/Edge-SketchCircle_10_2"), model.selection("EDGE", "Sketch_2/Edge-SketchCircle_12_2"), model.selection("EDGE", "Sketch_2/Edge-SketchCircle_11_2")] +Face_1 = model.addFace(Part_1_doc, [model.selection("WIRE", "[Sketch_1/SubEdge&Sketch_1/SketchLine_1][Sketch_1/SubEdge&Sketch_1/SketchLine_3][Sketch_1/SubEdge&Sketch_1/SketchLine_4][Sketch_1/SubEdge&Sketch_1/SketchLine_5][Sketch_1/SubEdge&Sketch_1/SketchLine_6][Sketch_1/SubEdge&Sketch_1/SketchLine_7][Sketch_1/SubEdge&Sketch_1/SketchLine_9][Sketch_1/SketchArc_2_2][Sketch_1/SubEdge&Sketch_1/SketchLine_10]")]) +Face_2 = model.addFace(Part_1_doc, [model.selection("WIRE", "[Sketch_1/SubEdge&Sketch_1/SketchLine_9][Sketch_1/SubEdge&Sketch_1/SketchArc_1_2][Sketch_1/SubEdge&Sketch_1/SketchLine_10][Sketch_1/SketchArc_2_2]")]) +Face_3_objects = [model.selection("EDGE", "Sketch_2/SketchCircle_1_2"), model.selection("EDGE", "Sketch_2/SketchCircle_2_2"), model.selection("EDGE", "Sketch_2/SketchCircle_3_2"), model.selection("EDGE", "Sketch_2/SketchCircle_4_2"), model.selection("EDGE", "Sketch_2/SketchCircle_5_2"), model.selection("EDGE", "Sketch_2/SketchCircle_6_2"), model.selection("EDGE", "Sketch_2/SketchCircle_7_2"), model.selection("EDGE", "Sketch_2/SketchCircle_9_2"), model.selection("EDGE", "Sketch_2/SketchCircle_8_2"), model.selection("EDGE", "Sketch_2/SketchCircle_10_2"), model.selection("EDGE", "Sketch_2/SketchCircle_12_2"), model.selection("EDGE", "Sketch_2/SketchCircle_11_2")] Face_3 = model.addFace(Part_1_doc, Face_3_objects) -Face_4_objects = [model.selection("EDGE", "Sketch_2/Edge-SketchCircle_1_2"), model.selection("EDGE", "Sketch_2/Edge-SketchCircle_2_2"), model.selection("EDGE", "Sketch_2/Edge-SketchCircle_3_2"), model.selection("EDGE", "Sketch_2/Edge-SketchCircle_4_2"), model.selection("EDGE", "Sketch_2/Edge-SketchCircle_5_2"), model.selection("EDGE", "Sketch_2/Edge-SketchCircle_7_2"), model.selection("EDGE", "Sketch_2/Edge-SketchCircle_6_2"), model.selection("EDGE", "Sketch_2/Edge-SketchCircle_9_2"), model.selection("EDGE", "Sketch_2/Edge-SketchCircle_8_2"), model.selection("EDGE", "Sketch_2/Edge-SketchCircle_10_2"), model.selection("EDGE", "Sketch_2/Edge-SketchCircle_12_2"), model.selection("EDGE", "Sketch_2/Edge-SketchCircle_11_2"), model.selection("WIRE", "Sketch_1/Wire-SketchLine_1f-SketchLine_3f-SketchLine_4f-SketchLine_5f-SketchLine_6f-SketchLine_7f-SketchLine_9f-SketchLine_10r-SketchArc_2_2f")] +Face_4_objects = [model.selection("EDGE", "Sketch_2/SketchCircle_1_2"), model.selection("EDGE", "Sketch_2/SketchCircle_2_2"), model.selection("EDGE", "Sketch_2/SketchCircle_3_2"), model.selection("EDGE", "Sketch_2/SketchCircle_4_2"), model.selection("EDGE", "Sketch_2/SketchCircle_5_2"), model.selection("EDGE", "Sketch_2/SketchCircle_7_2"), model.selection("EDGE", "Sketch_2/SketchCircle_6_2"), model.selection("EDGE", "Sketch_2/SketchCircle_9_2"), model.selection("EDGE", "Sketch_2/SketchCircle_8_2"), model.selection("EDGE", "Sketch_2/SketchCircle_10_2"), model.selection("EDGE", "Sketch_2/SketchCircle_12_2"), model.selection("EDGE", "Sketch_2/SketchCircle_11_2"), model.selection("WIRE", "[Sketch_1/SubEdge&Sketch_1/SketchLine_1][Sketch_1/SubEdge&Sketch_1/SketchLine_3][Sketch_1/SubEdge&Sketch_1/SketchLine_4][Sketch_1/SubEdge&Sketch_1/SketchLine_5][Sketch_1/SubEdge&Sketch_1/SketchLine_6][Sketch_1/SubEdge&Sketch_1/SketchLine_7][Sketch_1/SubEdge&Sketch_1/SketchLine_9][Sketch_1/SketchArc_2_2][Sketch_1/SubEdge&Sketch_1/SketchLine_10]")] Face_4 = model.addFace(Part_1_doc, Face_4_objects) Group_1_objects = [model.selection("FACE", "Face_2_1"), model.selection("FACE", "Face_3_7"), model.selection("FACE", "Face_3_5"), model.selection("FACE", "Face_3_3"), model.selection("FACE", "Face_3_4"), model.selection("FACE", "Face_3_1"), model.selection("FACE", "Face_3_2"), model.selection("FACE", "Face_3_6"), model.selection("FACE", "Face_3_11"), model.selection("FACE", "Face_3_10"), model.selection("FACE", "Face_3_8"), model.selection("FACE", "Face_3_9"), model.selection("FACE", "Face_3_12")] Group_1 = model.addGroup(Part_1_doc, Group_1_objects) @@ -108,15 +110,19 @@ Group_2.result().setName("acier") Group_2.result().setColor(170, 85, 0) Sketch_3 = model.addSketch(Part_1_doc, model.standardPlane("XOY")) SketchLine_11 = Sketch_3.addLine(40, 0, 30, 0) -SketchProjection_1 = Sketch_3.addProjection(model.selection("VERTEX", "Face_4_1/Edge_6&Face_4_1/Edge_7"), False) +SketchProjection_1 = Sketch_3.addProjection(model.selection("VERTEX", "[Face_4_1/Edge_7][Face_4_1/Edge_6]"), False) SketchPoint_1 = SketchProjection_1.createdFeature() SketchConstraintCoincidence_19 = Sketch_3.setCoincident(SketchLine_11.endPoint(), SketchPoint_1.result()) +SketchConstraintCoincidence_19.setName("SketchConstraintCoincidence_19") SketchLine_12 = Sketch_3.addLine(30, 0, 30, 10) SketchLine_13 = Sketch_3.addLine(30, 10, 40, 10) SketchLine_14 = Sketch_3.addLine(40, 10, 40, 0) SketchConstraintCoincidence_20 = Sketch_3.setCoincident(SketchLine_14.endPoint(), SketchLine_11.startPoint()) +SketchConstraintCoincidence_20.setName("SketchConstraintCoincidence_20") SketchConstraintCoincidence_21 = Sketch_3.setCoincident(SketchLine_11.endPoint(), SketchLine_12.startPoint()) +SketchConstraintCoincidence_21.setName("SketchConstraintCoincidence_21") SketchConstraintCoincidence_22 = Sketch_3.setCoincident(SketchLine_12.endPoint(), SketchLine_13.startPoint()) +SketchConstraintCoincidence_22.setName("SketchConstraintCoincidence_22") SketchConstraintCoincidence_23 = Sketch_3.setCoincident(SketchLine_13.endPoint(), SketchLine_14.startPoint()) SketchConstraintCoincidence_23.setName("SketchConstraintCoincidence_26") SketchConstraintHorizontal_4 = Sketch_3.setHorizontal(SketchLine_11.result()) @@ -128,33 +134,33 @@ SketchConstraintLength_3.setName("SketchConstraintLength_1") SketchConstraintEqual_5 = Sketch_3.setEqual(SketchLine_13.result(), SketchLine_14.result()) SketchConstraintEqual_5.setName("SketchConstraintEqual_1") model.do() -Face_5 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_3/Wire-SketchLine_11r-SketchLine_12r-SketchLine_13r-SketchLine_14r")]) -LinearCopy_1 = model.addMultiTranslation(Part_1_doc, [model.selection("FACE", "Face_5_1")], model.selection("EDGE", "Sketch_1/Edge-SketchLine_9"), "length_assemblage", 4, model.selection("EDGE", "PartSet/OY"), "length_assemblage", 2) +Face_5 = model.addFace(Part_1_doc, [model.selection("WIRE", "[Sketch_3/SubEdge&Sketch_3/SketchLine_14][Sketch_3/SubEdge&Sketch_3/SketchLine_13][Sketch_3/SubEdge&Sketch_3/SketchLine_12][Sketch_3/SubEdge&Sketch_3/SketchLine_11]")]) +LinearCopy_1 = model.addMultiTranslation(Part_1_doc, [model.selection("FACE", "Face_5_1")], model.selection("EDGE", "Sketch_1/SketchLine_9"), "length_assemblage", 4, model.selection("EDGE", "PartSet/OY"), "length_assemblage", 2) Recover_1 = model.addRecover(Part_1_doc, LinearCopy_1, [Face_5.result()]) -Translation_1 = model.addTranslation(Part_1_doc, [model.selection("FACE", "Recover_1_1")], model.selection("VERTEX", "Sketch_3/Vertex-SketchProjection_1-SketchPoint_1-SketchLine_12s-SketchLine_11e"), model.selection("VERTEX", "Sketch_1/Vertex-SketchLine_6s-SketchLine_5e")) +Translation_1 = model.addTranslation(Part_1_doc, [model.selection("FACE", "Recover_1_1")], model.selection("VERTEX", "Sketch_3/SketchLine_11_EndVertex"), model.selection("VERTEX", "Sketch_1/SketchLine_5_EndVertex")) LinearCopy_2 = model.addMultiTranslation(Part_1_doc, [model.selection("FACE", "Translation_1_1")], model.selection("EDGE", "PartSet/OX"), "length_assemblage", 4, model.selection("EDGE", "PartSet/OY"), "length_assemblage", 2) Recover_2 = model.addRecover(Part_1_doc, LinearCopy_1, [Face_5.result()]) -Translation_2 = model.addTranslation(Part_1_doc, [model.selection("FACE", "Recover_2_1")], model.selection("VERTEX", "Sketch_3/Vertex-SketchProjection_1-SketchPoint_1-SketchLine_12s-SketchLine_11e"), model.selection("VERTEX", "Sketch_1/Vertex-SketchLine_4s-SketchLine_3e")) +Translation_2 = model.addTranslation(Part_1_doc, [model.selection("FACE", "Recover_2_1")], model.selection("VERTEX", "Sketch_3/SketchLine_11_EndVertex"), model.selection("VERTEX", "Sketch_1/SketchLine_3_EndVertex")) LinearCopy_3 = model.addMultiTranslation(Part_1_doc, [model.selection("FACE", "Translation_2_1")], model.selection("EDGE", "PartSet/OX"), "length_assemblage", 4) Recover_3 = model.addRecover(Part_1_doc, LinearCopy_1, [Face_5.result()]) -Translation_3 = model.addTranslation(Part_1_doc, [model.selection("FACE", "Recover_3_1")], model.selection("VERTEX", "Sketch_1/Vertex-SketchLine_9s-SketchLine_7e"), model.selection("VERTEX", "LinearCopy_3_1/Translated_Edge_1_4&LinearCopy_3_1/Translated_Edge_1_1")) +Translation_3 = model.addTranslation(Part_1_doc, [model.selection("FACE", "Recover_3_1")], model.selection("VERTEX", "Sketch_1/SketchLine_7_EndVertex"), model.selection("VERTEX", "[LinearCopy_3_1_1/ME:Translated_Edge&Recover_2_1/Shape_1][LinearCopy_3_1_1/ME:Translated_Edge&Recover_2_1/Shape_4]")) LinearCopy_4 = model.addMultiTranslation(Part_1_doc, [model.selection("FACE", "Translation_3_1")], model.selection("EDGE", "PartSet/OX"), "length_assemblage", 3) Recover_4 = model.addRecover(Part_1_doc, LinearCopy_1, [Face_5.result()]) -Translation_4 = model.addTranslation(Part_1_doc, [model.selection("FACE", "Recover_4_1")], model.selection("VERTEX", "Sketch_1/Vertex-SketchLine_9s-SketchLine_7e"), model.selection("VERTEX", "Sketch_1/Vertex-SketchLine_1s-SketchLine_10s")) +Translation_4 = model.addTranslation(Part_1_doc, [model.selection("FACE", "Recover_4_1")], model.selection("VERTEX", "Sketch_1/SketchLine_7_EndVertex"), model.selection("VERTEX", "Sketch_1/SketchLine_1_StartVertex")) LinearCopy_5 = model.addMultiTranslation(Part_1_doc, [model.selection("FACE", "Translation_4_1")], model.selection("EDGE", "PartSet/OX"), "length_assemblage", 2) Shell_1 = model.addShell(Part_1_doc, [model.selection("FACE", "Face_1_1"), model.selection("FACE", "Face_2_1")]) -Boolean_1_objects_2 = [model.selection("FACE", "Face_3_1"), model.selection("FACE", "Face_3_2"), model.selection("FACE", "Face_3_3"), model.selection("FACE", "Face_3_4"), model.selection("FACE", "Face_3_5"), model.selection("FACE", "Face_3_6"), model.selection("FACE", "Face_3_7"), model.selection("FACE", "Face_3_8"), model.selection("FACE", "Face_3_9"), model.selection("FACE", "Face_3_10"), model.selection("FACE", "Face_3_11"), model.selection("FACE", "Face_3_12"), model.selection("FACE", "Face_4_1"), model.selection("COMPOUND", "LinearCopy_1_1"), model.selection("COMPOUND", "LinearCopy_2_1"), model.selection("COMPOUND", "LinearCopy_3_1"), model.selection("COMPOUND", "LinearCopy_4_1"), model.selection("COMPOUND", "LinearCopy_5_1")] -Boolean_1 = model.addFill(Part_1_doc, [model.selection("SHELL", "Shell_1_1")], Boolean_1_objects_2) +Fill_1_objects_2 = [model.selection("FACE", "Face_3_1"), model.selection("FACE", "Face_3_2"), model.selection("FACE", "Face_3_3"), model.selection("FACE", "Face_3_4"), model.selection("FACE", "Face_3_5"), model.selection("FACE", "Face_3_6"), model.selection("FACE", "Face_3_7"), model.selection("FACE", "Face_3_8"), model.selection("FACE", "Face_3_9"), model.selection("FACE", "Face_3_10"), model.selection("FACE", "Face_3_11"), model.selection("FACE", "Face_3_12"), model.selection("FACE", "Face_4_1"), model.selection("COMPOUND", "LinearCopy_1_1"), model.selection("COMPOUND", "LinearCopy_2_1"), model.selection("COMPOUND", "LinearCopy_3_1"), model.selection("COMPOUND", "LinearCopy_4_1"), model.selection("COMPOUND", "LinearCopy_5_1")] +Fill_1 = model.addFill(Part_1_doc, [model.selection("SHELL", "Shell_1_1")], Fill_1_objects_2) model.do() model.end() from GeomAPI import GeomAPI_Shape -model.testNbResults(Boolean_1, 1) -model.testNbSubResults(Boolean_1, [0]) -model.testNbSubShapes(Boolean_1, GeomAPI_Shape.SOLID, [0]) -model.testNbSubShapes(Boolean_1, GeomAPI_Shape.FACE, [60]) -model.testNbSubShapes(Boolean_1, GeomAPI_Shape.EDGE, [273]) -model.testNbSubShapes(Boolean_1, GeomAPI_Shape.VERTEX, [546]) +model.testNbResults(Fill_1, 1) +model.testNbSubResults(Fill_1, [0]) +model.testNbSubShapes(Fill_1, GeomAPI_Shape.SOLID, [0]) +model.testNbSubShapes(Fill_1, GeomAPI_Shape.FACE, [60]) +model.testNbSubShapes(Fill_1, GeomAPI_Shape.EDGE, [273]) +model.testNbSubShapes(Fill_1, GeomAPI_Shape.VERTEX, [546]) assert(model.checkPythonDump()) diff --git a/src/FeaturesPlugin/Test/Test2465.py b/src/FeaturesPlugin/Test/Test2465.py index d23abdd5e..313f436ad 100644 --- a/src/FeaturesPlugin/Test/Test2465.py +++ b/src/FeaturesPlugin/Test/Test2465.py @@ -18,6 +18,8 @@ ## email : webmaster.salome@opencascade.com ## +# -*- coding: utf-8 -*- + from salome.shaper import model model.begin() @@ -26,7 +28,8 @@ Part_1 = model.addPart(partSet) Part_1_doc = Part_1.document() Ellipsoid_1 = model.addEllipsoid(Part_1_doc, 10, 20, 40) Torus_1 = model.addTorus(Part_1_doc, model.selection("VERTEX", "PartSet/Origin"), model.selection("EDGE", "PartSet/OZ"), 15, 3) -LinearCopy_1 = model.addMultiTranslation(Part_1_doc, [model.selection("SOLID", "Ellipsoid_1_1")], model.selection("EDGE", "Ellipsoid_1_1/Face_1"), 10, 2) +LinearCopy_1 = model.addMultiTranslation(Part_1_doc, [model.selection("SOLID", "Ellipsoid_1_1")], model.selection("EDGE", "[Ellipsoid_1_1/Face_1][weak_name_3]"), 10, 2) +model.do() model.end() # check that for the linear copy direction the elliptical edge is invalid diff --git a/src/FeaturesPlugin/Test/Test2495.py b/src/FeaturesPlugin/Test/Test2495.py index 8154bd4bd..f7c74d590 100644 --- a/src/FeaturesPlugin/Test/Test2495.py +++ b/src/FeaturesPlugin/Test/Test2495.py @@ -1,4 +1,4 @@ -## Copyright (C) 2017 CEA/DEN, EDF R&D +## Copyright (C) 2014-2017 CEA/DEN, EDF R&D ## ## This library is free software; you can redistribute it and/or ## modify it under the terms of the GNU Lesser General Public @@ -36,7 +36,7 @@ SketchLine_1 = Sketch_1.addLine(153.5, 27.7, -153.5, 27.7) SketchLine_2 = Sketch_1.addLine(-153.5, 27.7, -153.5, 16.19999999999975) SketchLine_3 = Sketch_1.addLine(-151.5000000000398, -24.69999999999951, 151.5000000000377, -24.69999999999977) SketchLine_4 = Sketch_1.addLine(153.5000000000001, -22.70000000003736, 153.5, -15.80000000000003) -SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchLine_2.startPoint()) +SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchLine_2.startPoint()) SketchConstraintHorizontal_1 = Sketch_1.setHorizontal(SketchLine_1.result()) SketchConstraintVertical_1 = Sketch_1.setVertical(SketchLine_2.result()) SketchConstraintHorizontal_2 = Sketch_1.setHorizontal(SketchLine_3.result()) @@ -44,20 +44,20 @@ SketchConstraintVertical_2 = Sketch_1.setVertical(SketchLine_4.result()) SketchConstraintLength_1 = Sketch_1.setLength(SketchLine_1.result(), 307) SketchConstraintLength_2 = Sketch_1.setLength(SketchLine_2.result(), 11.50000000000025) SketchPoint_1 = Sketch_1.addPoint(0, 27.7) -SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchPoint_1.coordinates(), SketchLine_1.result()) -SketchConstraintCoincidence_3.setName("SketchConstraintCoincidence_5") +SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchPoint_1.coordinates(), SketchLine_1.result()) +SketchConstraintCoincidence_2.setName("SketchConstraintCoincidence_5") SketchProjection_1 = Sketch_1.addProjection(model.selection("EDGE", "PartSet/OY"), False) SketchLine_5 = SketchProjection_1.createdFeature() -SketchConstraintCoincidence_4 = Sketch_1.setCoincident(SketchPoint_1.coordinates(), SketchLine_5.result()) -SketchConstraintCoincidence_4.setName("SketchConstraintCoincidence_6") +SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchPoint_1.coordinates(), SketchLine_5.result()) +SketchConstraintCoincidence_3.setName("SketchConstraintCoincidence_6") SketchConstraintMiddle_1 = Sketch_1.setMiddlePoint(SketchLine_1.result(), SketchPoint_1.coordinates()) SketchPoint_2 = Sketch_1.addPoint(153.5, 0) -SketchConstraintCoincidence_5 = Sketch_1.setCoincident(SketchPoint_2.coordinates(), SketchLine_4.result()) -SketchConstraintCoincidence_5.setName("SketchConstraintCoincidence_7") +SketchConstraintCoincidence_4 = Sketch_1.setCoincident(SketchPoint_2.coordinates(), SketchLine_4.result()) +SketchConstraintCoincidence_4.setName("SketchConstraintCoincidence_7") SketchProjection_2 = Sketch_1.addProjection(model.selection("EDGE", "PartSet/OX"), False) SketchLine_6 = SketchProjection_2.createdFeature() -SketchConstraintCoincidence_6 = Sketch_1.setCoincident(SketchPoint_2.coordinates(), SketchLine_6.result()) -SketchConstraintCoincidence_6.setName("SketchConstraintCoincidence_8") +SketchConstraintCoincidence_5 = Sketch_1.setCoincident(SketchPoint_2.coordinates(), SketchLine_6.result()) +SketchConstraintCoincidence_5.setName("SketchConstraintCoincidence_8") SketchLine_7 = Sketch_1.addLine(-108.1499999999999, 23.04999999999991, -109.8500000000001, 23.04999999999991) SketchLine_8 = Sketch_1.addLine(-109.8500000000001, 19.75000000000008, -108.1499999999999, 19.75000000000008) SketchLine_8.setName("SketchLine_9") @@ -65,15 +65,15 @@ SketchLine_8.result().setName("SketchLine_9") SketchConstraintHorizontal_3 = Sketch_1.setHorizontal(SketchLine_7.result()) SketchConstraintHorizontal_4 = Sketch_1.setHorizontal(SketchLine_8.result()) SketchArc_1 = Sketch_1.addArc(-109.8500000000001, 21.39999999999999, -109.8500000000001, 19.75000000000008, -109.8500000000001, 23.04999999999991, True) -SketchConstraintCoincidence_7 = Sketch_1.setCoincident(SketchLine_8.startPoint(), SketchArc_1.startPoint()) -SketchConstraintCoincidence_7.setName("SketchConstraintCoincidence_9") +SketchConstraintCoincidence_6 = Sketch_1.setCoincident(SketchLine_8.startPoint(), SketchArc_1.startPoint()) +SketchConstraintCoincidence_6.setName("SketchConstraintCoincidence_9") SketchArc_2 = Sketch_1.addArc(-108.1499999999999, 21.39999999999999, -108.1499999999999, 19.75000000000008, -108.1499999999999, 23.04999999999991, False) -SketchConstraintCoincidence_8 = Sketch_1.setCoincident(SketchLine_8.endPoint(), SketchArc_2.startPoint()) -SketchConstraintCoincidence_8.setName("SketchConstraintCoincidence_10") -SketchConstraintCoincidence_9 = Sketch_1.setCoincident(SketchArc_2.endPoint(), SketchLine_7.startPoint()) -SketchConstraintCoincidence_9.setName("SketchConstraintCoincidence_11") -SketchConstraintCoincidence_10 = Sketch_1.setCoincident(SketchArc_1.endPoint(), SketchLine_7.endPoint()) -SketchConstraintCoincidence_10.setName("SketchConstraintCoincidence_12") +SketchConstraintCoincidence_7 = Sketch_1.setCoincident(SketchLine_8.endPoint(), SketchArc_2.startPoint()) +SketchConstraintCoincidence_7.setName("SketchConstraintCoincidence_10") +SketchConstraintCoincidence_8 = Sketch_1.setCoincident(SketchArc_2.endPoint(), SketchLine_7.startPoint()) +SketchConstraintCoincidence_8.setName("SketchConstraintCoincidence_11") +SketchConstraintCoincidence_9 = Sketch_1.setCoincident(SketchArc_1.endPoint(), SketchLine_7.endPoint()) +SketchConstraintCoincidence_9.setName("SketchConstraintCoincidence_12") SketchConstraintTangent_1 = Sketch_1.setTangent(SketchArc_2.results()[1], SketchLine_7.result()) SketchConstraintTangent_2 = Sketch_1.setTangent(SketchLine_8.result(), SketchArc_2.results()[1]) SketchConstraintTangent_3 = Sketch_1.setTangent(SketchLine_8.result(), SketchArc_1.results()[1]) @@ -82,24 +82,24 @@ SketchLine_9 = Sketch_1.addLine(-111.5, 21.39999999999998, -106.5, 21.4000000000 SketchLine_9.setName("SketchLine_10") SketchLine_9.result().setName("SketchLine_10") SketchLine_9.setAuxiliary(True) -SketchConstraintCoincidence_11 = Sketch_1.setCoincident(SketchLine_9.startPoint(), SketchArc_1.results()[1]) -SketchConstraintCoincidence_11.setName("SketchConstraintCoincidence_13") -SketchConstraintCoincidence_12 = Sketch_1.setCoincident(SketchLine_9.endPoint(), SketchArc_2.results()[1]) -SketchConstraintCoincidence_12.setName("SketchConstraintCoincidence_14") -SketchConstraintCoincidence_13 = Sketch_1.setCoincident(SketchArc_1.center(), SketchLine_9.result()) -SketchConstraintCoincidence_13.setName("SketchConstraintCoincidence_15") -SketchConstraintCoincidence_14 = Sketch_1.setCoincident(SketchArc_2.center(), SketchLine_9.result()) -SketchConstraintCoincidence_14.setName("SketchConstraintCoincidence_16") +SketchConstraintCoincidence_10 = Sketch_1.setCoincident(SketchLine_9.startPoint(), SketchArc_1.results()[1]) +SketchConstraintCoincidence_10.setName("SketchConstraintCoincidence_13") +SketchConstraintCoincidence_11 = Sketch_1.setCoincident(SketchLine_9.endPoint(), SketchArc_2.results()[1]) +SketchConstraintCoincidence_11.setName("SketchConstraintCoincidence_14") +SketchConstraintCoincidence_12 = Sketch_1.setCoincident(SketchArc_1.center(), SketchLine_9.result()) +SketchConstraintCoincidence_12.setName("SketchConstraintCoincidence_15") +SketchConstraintCoincidence_13 = Sketch_1.setCoincident(SketchArc_2.center(), SketchLine_9.result()) +SketchConstraintCoincidence_13.setName("SketchConstraintCoincidence_16") SketchConstraintLength_3 = Sketch_1.setLength(SketchLine_9.result(), 5) SketchConstraintDistance_1 = Sketch_1.setDistance(SketchArc_1.startPoint(), SketchLine_7.result(), 3.3, True) SketchPoint_3 = Sketch_1.addPoint(0, 21.40000000000294) -SketchConstraintCoincidence_15 = Sketch_1.setCoincident(SketchPoint_3.coordinates(), SketchLine_5.result()) -SketchConstraintCoincidence_15.setName("SketchConstraintCoincidence_17") -SketchConstraintCoincidence_16 = Sketch_1.setCoincident(SketchPoint_3.coordinates(), SketchLine_9.result()) -SketchConstraintCoincidence_16.setName("SketchConstraintCoincidence_18") +SketchConstraintCoincidence_14 = Sketch_1.setCoincident(SketchPoint_3.coordinates(), SketchLine_5.result()) +SketchConstraintCoincidence_14.setName("SketchConstraintCoincidence_17") +SketchConstraintCoincidence_15 = Sketch_1.setCoincident(SketchPoint_3.coordinates(), SketchLine_9.result()) +SketchConstraintCoincidence_15.setName("SketchConstraintCoincidence_18") SketchPoint_4 = Sketch_1.addPoint(-109, 21.4) -SketchConstraintCoincidence_17 = Sketch_1.setCoincident(SketchPoint_4.coordinates(), SketchLine_9.result()) -SketchConstraintCoincidence_17.setName("SketchConstraintCoincidence_19") +SketchConstraintCoincidence_16 = Sketch_1.setCoincident(SketchPoint_4.coordinates(), SketchLine_9.result()) +SketchConstraintCoincidence_16.setName("SketchConstraintCoincidence_19") SketchConstraintMiddle_2 = Sketch_1.setMiddlePoint(SketchPoint_4.coordinates(), SketchLine_9.result()) SketchConstraintMiddle_2.setName("SketchConstraintMiddle_3") SketchConstraintDistanceHorizontal_1 = Sketch_1.setHorizontalDistance(SketchPoint_4.coordinates(), SketchPoint_3.coordinates(), 109) @@ -122,8 +122,8 @@ SketchArc_4.result().setName("SketchArc_5") SketchArc_4.results()[1].setName("SketchArc_5_2") SketchConstraintDistance_2 = Sketch_1.setDistance(SketchPoint_4.coordinates(), SketchLine_6.result(), 21.4, True) SketchPoint_5 = Sketch_1.addPoint(0, -21) -SketchConstraintCoincidence_18 = Sketch_1.setCoincident(SketchPoint_5.coordinates(), SketchLine_5.result()) -SketchConstraintCoincidence_18.setName("SketchConstraintCoincidence_20") +SketchConstraintCoincidence_17 = Sketch_1.setCoincident(SketchPoint_5.coordinates(), SketchLine_5.result()) +SketchConstraintCoincidence_17.setName("SketchConstraintCoincidence_20") SketchConstraintDistance_3 = Sketch_1.setDistance(SketchPoint_5.coordinates(), SketchLine_6.result(), 21, True) SketchMultiTranslation_2_objects = [SketchArc_1.results()[1], SketchLine_7.result(), SketchLine_8.result(), SketchArc_2.results()[1], SketchLine_10.result(), SketchArc_5.results()[1], SketchLine_12.result(), SketchArc_3.results()[1], SketchArc_4.results()[1], SketchLine_13.result(), SketchLine_11.result(), SketchArc_6.results()[1]] SketchMultiTranslation_2 = Sketch_1.addTranslation(SketchMultiTranslation_2_objects, SketchPoint_3.coordinates(), SketchPoint_5.coordinates(), 2) @@ -160,49 +160,49 @@ SketchConstraintLength_4 = Sketch_1.setLength(SketchLine_20.result(), 37) SketchConstraintLength_5 = Sketch_1.setLength(SketchLine_21.result(), 8) SketchArc_13 = Sketch_1.addArc(-146.43, 15.7, -145.43, 15.69999999999999, -146.43, 14.7, False) SketchConstraintRadius_1 = Sketch_1.setRadius(SketchArc_13.results()[1], 1) -SketchConstraintCoincidence_19 = Sketch_1.setCoincident(SketchLine_20.endPoint(), SketchArc_13.startPoint()) -SketchConstraintCoincidence_19.setName("SketchConstraintCoincidence_31") -SketchConstraintCoincidence_20 = Sketch_1.setCoincident(SketchArc_13.endPoint(), SketchLine_21.startPoint()) -SketchConstraintCoincidence_20.setName("SketchConstraintCoincidence_29") -SketchConstraintCoincidence_21 = Sketch_1.setCoincident(SketchArc_13.center(), SketchLine_20.result()) -SketchConstraintCoincidence_21.setName("SketchConstraintCoincidence_30") -SketchConstraintCoincidence_22 = Sketch_1.setCoincident(SketchArc_13.center(), SketchLine_21.result()) -SketchConstraintCoincidence_22.setName("SketchConstraintCoincidence_32") +SketchConstraintCoincidence_18 = Sketch_1.setCoincident(SketchLine_20.endPoint(), SketchArc_13.startPoint()) +SketchConstraintCoincidence_18.setName("SketchConstraintCoincidence_31") +SketchConstraintCoincidence_19 = Sketch_1.setCoincident(SketchArc_13.endPoint(), SketchLine_21.startPoint()) +SketchConstraintCoincidence_19.setName("SketchConstraintCoincidence_29") +SketchConstraintCoincidence_20 = Sketch_1.setCoincident(SketchArc_13.center(), SketchLine_20.result()) +SketchConstraintCoincidence_20.setName("SketchConstraintCoincidence_30") +SketchConstraintCoincidence_21 = Sketch_1.setCoincident(SketchArc_13.center(), SketchLine_21.result()) +SketchConstraintCoincidence_21.setName("SketchConstraintCoincidence_32") SketchArc_14 = Sketch_1.addArc(-146.43, 5.699999999999998, -146.43, 6.699999999999998, -145.43, 5.7, False) SketchConstraintEqual_1 = Sketch_1.setEqual(SketchArc_13.results()[1], SketchArc_14.results()[1]) -SketchConstraintCoincidence_23 = Sketch_1.setCoincident(SketchArc_14.startPoint(), SketchLine_21.endPoint()) -SketchConstraintCoincidence_23.setName("SketchConstraintCoincidence_35") -SketchConstraintCoincidence_24 = Sketch_1.setCoincident(SketchArc_14.endPoint(), SketchLine_22.startPoint()) -SketchConstraintCoincidence_24.setName("SketchConstraintCoincidence_34") -SketchConstraintCoincidence_25 = Sketch_1.setCoincident(SketchArc_14.center(), SketchLine_22.result()) -SketchConstraintCoincidence_25.setName("SketchConstraintCoincidence_33") -SketchConstraintCoincidence_26 = Sketch_1.setCoincident(SketchArc_14.center(), SketchLine_21.result()) -SketchConstraintCoincidence_26.setName("SketchConstraintCoincidence_36") +SketchConstraintCoincidence_22 = Sketch_1.setCoincident(SketchArc_14.startPoint(), SketchLine_21.endPoint()) +SketchConstraintCoincidence_22.setName("SketchConstraintCoincidence_35") +SketchConstraintCoincidence_23 = Sketch_1.setCoincident(SketchArc_14.endPoint(), SketchLine_22.startPoint()) +SketchConstraintCoincidence_23.setName("SketchConstraintCoincidence_34") +SketchConstraintCoincidence_24 = Sketch_1.setCoincident(SketchArc_14.center(), SketchLine_22.result()) +SketchConstraintCoincidence_24.setName("SketchConstraintCoincidence_33") +SketchConstraintCoincidence_25 = Sketch_1.setCoincident(SketchArc_14.center(), SketchLine_21.result()) +SketchConstraintCoincidence_25.setName("SketchConstraintCoincidence_36") SketchArc_15 = Sketch_1.addArc(-107.43, 15.69999999999999, -107.43, 14.69999999999999, -108.43, 15.69999999999999, False) SketchConstraintEqual_2 = Sketch_1.setEqual(SketchArc_15.results()[1], SketchArc_13.results()[1]) -SketchConstraintCoincidence_27 = Sketch_1.setCoincident(SketchArc_15.endPoint(), SketchLine_20.startPoint()) -SketchConstraintCoincidence_27.setName("SketchConstraintCoincidence_39") -SketchConstraintCoincidence_28 = Sketch_1.setCoincident(SketchArc_15.startPoint(), SketchLine_23.endPoint()) -SketchConstraintCoincidence_28.setName("SketchConstraintCoincidence_37") -SketchConstraintCoincidence_29 = Sketch_1.setCoincident(SketchArc_15.center(), SketchLine_20.result()) -SketchConstraintCoincidence_29.setName("SketchConstraintCoincidence_38") -SketchConstraintCoincidence_30 = Sketch_1.setCoincident(SketchArc_15.center(), SketchLine_23.result()) -SketchConstraintCoincidence_30.setName("SketchConstraintCoincidence_40") +SketchConstraintCoincidence_26 = Sketch_1.setCoincident(SketchArc_15.endPoint(), SketchLine_20.startPoint()) +SketchConstraintCoincidence_26.setName("SketchConstraintCoincidence_39") +SketchConstraintCoincidence_27 = Sketch_1.setCoincident(SketchArc_15.startPoint(), SketchLine_23.endPoint()) +SketchConstraintCoincidence_27.setName("SketchConstraintCoincidence_37") +SketchConstraintCoincidence_28 = Sketch_1.setCoincident(SketchArc_15.center(), SketchLine_20.result()) +SketchConstraintCoincidence_28.setName("SketchConstraintCoincidence_38") +SketchConstraintCoincidence_29 = Sketch_1.setCoincident(SketchArc_15.center(), SketchLine_23.result()) +SketchConstraintCoincidence_29.setName("SketchConstraintCoincidence_40") SketchArc_16 = Sketch_1.addArc(-107.43, 5.7, -108.43, 5.7, -107.43, 6.7, False) SketchConstraintEqual_3 = Sketch_1.setEqual(SketchArc_15.results()[1], SketchArc_16.results()[1]) -SketchConstraintCoincidence_31 = Sketch_1.setCoincident(SketchArc_16.startPoint(), SketchLine_22.endPoint()) -SketchConstraintCoincidence_31.setName("SketchConstraintCoincidence_43") -SketchConstraintCoincidence_32 = Sketch_1.setCoincident(SketchArc_16.endPoint(), SketchLine_23.startPoint()) -SketchConstraintCoincidence_32.setName("SketchConstraintCoincidence_42") -SketchConstraintCoincidence_33 = Sketch_1.setCoincident(SketchArc_16.center(), SketchLine_22.result()) -SketchConstraintCoincidence_33.setName("SketchConstraintCoincidence_41") -SketchConstraintCoincidence_34 = Sketch_1.setCoincident(SketchArc_16.center(), SketchLine_23.result()) -SketchConstraintCoincidence_34.setName("SketchConstraintCoincidence_44") +SketchConstraintCoincidence_30 = Sketch_1.setCoincident(SketchArc_16.startPoint(), SketchLine_22.endPoint()) +SketchConstraintCoincidence_30.setName("SketchConstraintCoincidence_43") +SketchConstraintCoincidence_31 = Sketch_1.setCoincident(SketchArc_16.endPoint(), SketchLine_23.startPoint()) +SketchConstraintCoincidence_31.setName("SketchConstraintCoincidence_42") +SketchConstraintCoincidence_32 = Sketch_1.setCoincident(SketchArc_16.center(), SketchLine_22.result()) +SketchConstraintCoincidence_32.setName("SketchConstraintCoincidence_41") +SketchConstraintCoincidence_33 = Sketch_1.setCoincident(SketchArc_16.center(), SketchLine_23.result()) +SketchConstraintCoincidence_33.setName("SketchConstraintCoincidence_44") SketchConstraintDistance_4 = Sketch_1.setDistance(SketchArc_15.center(), SketchLine_5.result(), 107.43, True) SketchConstraintDistance_5 = Sketch_1.setDistance(SketchArc_16.center(), SketchLine_6.result(), 5.7, True) SketchPoint_6 = Sketch_1.addPoint(-95.65000000000001, 15.7) -SketchConstraintCoincidence_35 = Sketch_1.setCoincident(SketchPoint_6.coordinates(), SketchLine_20.result()) -SketchConstraintCoincidence_35.setName("SketchConstraintCoincidence_45") +SketchConstraintCoincidence_34 = Sketch_1.setCoincident(SketchPoint_6.coordinates(), SketchLine_20.result()) +SketchConstraintCoincidence_34.setName("SketchConstraintCoincidence_45") SketchConstraintDistance_6 = Sketch_1.setDistance(SketchArc_15.center(), SketchPoint_6.coordinates(), "5.89*2", True) SketchMultiTranslation_3_objects = [SketchLine_23.result(), SketchArc_13.results()[1], SketchLine_21.result(), SketchArc_14.results()[1], SketchArc_16.results()[1], SketchLine_22.result(), SketchLine_20.result(), SketchArc_15.results()[1]] SketchMultiTranslation_3 = Sketch_1.addTranslation(SketchMultiTranslation_3_objects, SketchArc_13.center(), SketchPoint_6.coordinates(), 6) @@ -293,8 +293,8 @@ SketchLine_25.result().setName("SketchLine_29") SketchLine_24.setName("SketchLine_25") SketchLine_24.result().setName("SketchLine_25") SketchPoint_7 = Sketch_1.addPoint(-107.43, -5.3) -SketchConstraintCoincidence_36 = Sketch_1.setCoincident(SketchPoint_7.coordinates(), SketchLine_23.result()) -SketchConstraintCoincidence_36.setName("SketchConstraintCoincidence_46") +SketchConstraintCoincidence_35 = Sketch_1.setCoincident(SketchPoint_7.coordinates(), SketchLine_23.result()) +SketchConstraintCoincidence_35.setName("SketchConstraintCoincidence_46") SketchConstraintDistance_7 = Sketch_1.setDistance(SketchPoint_7.coordinates(), SketchLine_6.result(), 5.3, True) SketchMultiTranslation_4_objects = [SketchLine_20.result(), SketchArc_21.results()[1], SketchLine_22.result(), SketchArc_16.results()[1], SketchLine_41.result(), SketchLine_37.result(), SketchLine_38.result(), SketchArc_33.results()[1], SketchLine_43.result(), SketchLine_24.result(), SketchLine_42.result(), SketchArc_13.results()[1], SketchArc_31.results()[1], SketchLine_36.result(), SketchLine_28.result(), SketchArc_19.results()[1], SketchLine_21.result(), SketchArc_36.results()[1], SketchArc_14.results()[1], SketchArc_24.results()[1], SketchLine_31.result(), SketchArc_32.results()[1], SketchArc_20.results()[1], SketchLine_27.result(), SketchLine_34.result(), SketchArc_30.results()[1], SketchLine_39.result(), SketchArc_25.results()[1], SketchArc_34.results()[1], SketchArc_18.results()[1], SketchLine_40.result(), SketchLine_35.result(), SketchArc_35.results()[1], SketchArc_28.results()[1], SketchLine_32.result(), SketchArc_22.results()[1], SketchArc_26.results()[1], SketchLine_26.result(), SketchLine_30.result(), SketchArc_15.results()[1], SketchLine_33.result(), SketchLine_29.result(), SketchLine_23.result(), SketchLine_25.result(), SketchArc_29.results()[1], SketchArc_23.results()[1], SketchArc_27.results()[1], SketchArc_17.results()[1]] SketchMultiTranslation_4 = Sketch_1.addTranslation(SketchMultiTranslation_4_objects, SketchArc_15.center(), SketchPoint_7.coordinates(), 2) @@ -360,17 +360,17 @@ SketchConstraintHorizontal_7 = Sketch_1.setHorizontal(SketchLine_68.result()) SketchConstraintHorizontal_8 = Sketch_1.setHorizontal(SketchLine_70.result()) SketchConstraintVertical_5 = Sketch_1.setVertical(SketchLine_69.result()) SketchArc_61 = Sketch_1.addArc(-152.2999999999999, 14.70000000000002, -150.7999999999999, 14.70000000000003, -152.2999999999999, 16.20000000000002, False) -SketchConstraintCoincidence_37 = Sketch_1.setCoincident(SketchArc_61.startPoint(), SketchLine_69.startPoint()) -SketchConstraintCoincidence_37.setName("SketchConstraintCoincidence_47") -SketchConstraintCoincidence_38 = Sketch_1.setCoincident(SketchArc_61.endPoint(), SketchLine_68.endPoint()) -SketchConstraintCoincidence_38.setName("SketchConstraintCoincidence_50") +SketchConstraintCoincidence_36 = Sketch_1.setCoincident(SketchArc_61.startPoint(), SketchLine_69.startPoint()) +SketchConstraintCoincidence_36.setName("SketchConstraintCoincidence_47") +SketchConstraintCoincidence_37 = Sketch_1.setCoincident(SketchArc_61.endPoint(), SketchLine_68.endPoint()) +SketchConstraintCoincidence_37.setName("SketchConstraintCoincidence_50") SketchConstraintTangent_5 = Sketch_1.setTangent(SketchArc_61.results()[1], SketchLine_69.result()) SketchConstraintTangent_6 = Sketch_1.setTangent(SketchArc_61.results()[1], SketchLine_68.result()) SketchArc_62 = Sketch_1.addArc(-152.2999999999999, 9.699999999999999, -152.2999999999999, 8.199999999999999, -150.7999999999999, 9.699999999999999, False) -SketchConstraintCoincidence_39 = Sketch_1.setCoincident(SketchArc_62.startPoint(), SketchLine_70.startPoint()) -SketchConstraintCoincidence_39.setName("SketchConstraintCoincidence_48") -SketchConstraintCoincidence_40 = Sketch_1.setCoincident(SketchArc_62.endPoint(), SketchLine_69.endPoint()) -SketchConstraintCoincidence_40.setName("SketchConstraintCoincidence_51") +SketchConstraintCoincidence_38 = Sketch_1.setCoincident(SketchArc_62.startPoint(), SketchLine_70.startPoint()) +SketchConstraintCoincidence_38.setName("SketchConstraintCoincidence_48") +SketchConstraintCoincidence_39 = Sketch_1.setCoincident(SketchArc_62.endPoint(), SketchLine_69.endPoint()) +SketchConstraintCoincidence_39.setName("SketchConstraintCoincidence_51") SketchConstraintTangent_7 = Sketch_1.setTangent(SketchArc_62.results()[1], SketchLine_69.result()) SketchConstraintTangent_8 = Sketch_1.setTangent(SketchArc_62.results()[1], SketchLine_70.result()) SketchConstraintDistance_8 = Sketch_1.setDistance(SketchLine_70.startPoint(), SketchLine_68.result(), 8, True) @@ -379,8 +379,8 @@ SketchConstraintRadius_2 = Sketch_1.setRadius(SketchArc_61.results()[1], 1.5) SketchConstraintEqual_4 = Sketch_1.setEqual(SketchArc_61.results()[1], SketchArc_62.results()[1]) SketchConstraintDistance_10 = Sketch_1.setDistance(SketchLine_70.endPoint(), SketchLine_6.result(), 8.199999999999999, True) SketchPoint_8 = Sketch_1.addPoint(-153.5, -7.799999999999999) -SketchConstraintCoincidence_41 = Sketch_1.setCoincident(SketchPoint_8.coordinates(), SketchLine_2.result()) -SketchConstraintCoincidence_41.setName("SketchConstraintCoincidence_53") +SketchConstraintCoincidence_40 = Sketch_1.setCoincident(SketchPoint_8.coordinates(), SketchLine_2.result()) +SketchConstraintCoincidence_40.setName("SketchConstraintCoincidence_53") SketchConstraintDistance_11 = Sketch_1.setDistance(SketchPoint_8.coordinates(), SketchLine_6.result(), 7.8, True) SketchMultiTranslation_5_objects = [SketchLine_68.result(), SketchArc_61.results()[1], SketchLine_69.result(), SketchArc_62.results()[1], SketchLine_70.result()] SketchMultiTranslation_5 = Sketch_1.addTranslation(SketchMultiTranslation_5_objects, SketchLine_68.startPoint(), SketchPoint_8.coordinates(), 2) @@ -410,23 +410,24 @@ SketchLine_80 = Sketch_1.addLine(-153.4999999999999, 8.199999999999999, -153.5, SketchLine_80.setName("SketchLine_81") SketchLine_80.result().setName("SketchLine_81") SketchConstraintCollinear_1 = Sketch_1.setCollinear(SketchLine_2.result(), SketchLine_80.result()) -SketchConstraintCoincidence_42 = Sketch_1.setCoincident(SketchLine_70.endPoint(), SketchLine_80.startPoint()) -SketchConstraintCoincidence_42.setName("SketchConstraintCoincidence_54") -SketchConstraintCoincidence_43 = Sketch_1.setCoincident(SketchLine_68.startPoint(), SketchLine_2.endPoint()) -SketchConstraintCoincidence_43.setName("SketchConstraintCoincidence_55") +SketchConstraintCoincidence_41 = Sketch_1.setCoincident(SketchLine_70.endPoint(), SketchLine_80.startPoint()) +SketchConstraintCoincidence_41.setName("SketchConstraintCoincidence_54") +SketchConstraintCoincidence_42 = Sketch_1.setCoincident(SketchLine_68.startPoint(), SketchLine_2.endPoint()) +SketchConstraintCoincidence_42.setName("SketchConstraintCoincidence_55") SketchLine_81 = Sketch_1.addLine(-153.4999999999999, -15.79999999999969, -153.5, -22.70000000003739) SketchLine_81.setName("SketchLine_82") SketchLine_81.result().setName("SketchLine_82") SketchConstraintCollinear_2 = Sketch_1.setCollinear(SketchLine_80.result(), SketchLine_81.result()) -SketchConstraintCoincidence_44 = Sketch_1.setCoincident(SketchLine_81.startPoint(), SketchLine_73.result()) -SketchConstraintCoincidence_44.setName("SketchConstraintCoincidence_49") -SketchConstraintCoincidence_45 = Sketch_1.setCoincident(SketchLine_80.endPoint(), SketchPoint_8.result()) -SketchConstraintCoincidence_45.setName("SketchConstraintCoincidence_52") +SketchConstraintCoincidence_43 = Sketch_1.setCoincident(SketchLine_81.startPoint(), SketchLine_73.result()) +SketchConstraintCoincidence_43.setName("SketchConstraintCoincidence_49") +SketchConstraintCoincidence_44 = Sketch_1.setCoincident(SketchLine_80.endPoint(), SketchPoint_8.result()) +SketchConstraintCoincidence_44.setName("SketchConstraintCoincidence_52") SketchConstraintVertical_6 = Sketch_1.setVertical(SketchLine_80.result()) SketchLine_82 = Sketch_1.addLine(153.5, 16.19999999999975, 153.5, 27.7) SketchLine_82.setName("SketchLine_83") SketchLine_82.result().setName("SketchLine_83") -SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_82.endPoint(), SketchLine_1.startPoint()) +SketchConstraintCoincidence_45 = Sketch_1.setCoincident(SketchLine_82.endPoint(), SketchLine_1.startPoint()) +SketchConstraintCoincidence_45.setName("SketchConstraintCoincidence_56") SketchConstraintCollinear_3 = Sketch_1.setCollinear(SketchLine_4.result(), SketchLine_82.result()) SketchConstraintCoincidence_46 = Sketch_1.setCoincident(SketchLine_82.startPoint(), SketchLine_74.result()) SketchConstraintCoincidence_46.setName("SketchConstraintCoincidence_56") @@ -443,7 +444,7 @@ SketchConstraintCoincidence_49.setName("SketchConstraintCoincidence_59") SketchLine_84 = Sketch_1.addLine(-153.5, -22.70000000003739, -151.5000000000398, -24.69999999999951) SketchLine_84.setName("SketchLine_85") SketchLine_84.result().setName("SketchLine_85") -SketchConstraintAngle_1 = Sketch_1.setAngleComplementary(SketchLine_84.result(), SketchLine_3.result(), 45) +SketchConstraintAngle_1 = Sketch_1.setAngleComplementary(SketchLine_84.result(), SketchLine_3.result(), 45.0000000000272) SketchConstraintCoincidence_50 = Sketch_1.setCoincident(SketchLine_84.startPoint(), SketchLine_81.endPoint()) SketchConstraintCoincidence_50.setName("SketchConstraintCoincidence_62") SketchConstraintCoincidence_51 = Sketch_1.setCoincident(SketchLine_84.endPoint(), SketchLine_3.startPoint()) @@ -459,14 +460,14 @@ SketchConstraintCoincidence_52.setName("SketchConstraintCoincidence_61") SketchConstraintCoincidence_53 = Sketch_1.setCoincident(SketchLine_4.startPoint(), SketchLine_85.result()) SketchConstraintCoincidence_53.setName("SketchConstraintCoincidence_63") model.do() -Plane_4 = model.addPlane(Part_1_doc, model.selection("FACE", "PartSet/YOZ"), model.selection("VERTEX", "Sketch_1/Vertex-SketchLine_4e-SketchLine_80e")) +Plane_4 = model.addPlane(Part_1_doc, model.selection("FACE", "PartSet/YOZ"), model.selection("VERTEX", "Sketch_1/SketchLine_4_EndVertex")) Sketch_2 = model.addSketch(Part_1_doc, model.selection("FACE", "Plane_1")) -SketchProjection_3 = Sketch_2.addProjection(model.selection("VERTEX", "Sketch_1/Vertex-SketchLine_1s-SketchLine_83e"), False) +SketchProjection_3 = Sketch_2.addProjection(model.selection("VERTEX", "Sketch_1/SketchLine_1_StartVertex"), False) SketchPoint_9 = SketchProjection_3.createdFeature() SketchArc_69 = Sketch_2.addArc(27.70000001097709, 0.85, 27.7, 0, 28.55000001097708, 0.85, False) SketchConstraintCoincidence_54 = Sketch_2.setCoincident(SketchPoint_9.result(), SketchArc_69.startPoint()) SketchConstraintCoincidence_54.setName("SketchConstraintCoincidence_64") -SketchProjection_4 = Sketch_2.addProjection(model.selection("EDGE", "Sketch_1/Edge-SketchLine_83"), False) +SketchProjection_4 = Sketch_2.addProjection(model.selection("EDGE", "Sketch_1/SketchLine_83"), False) SketchLine_86 = SketchProjection_4.createdFeature() SketchLine_86.setName("SketchLine_87") SketchLine_86.result().setName("SketchLine_87") @@ -489,13 +490,13 @@ SketchConstraintCoincidence_57.setName("SketchConstraintCoincidence_67") SketchConstraintVertical_7 = Sketch_2.setVertical(SketchLine_88.result()) SketchConstraintLength_6 = Sketch_2.setLength(SketchLine_88.result(), 10) model.do() -Edge_1 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_2/Edge-SketchArc_69_2"), model.selection("EDGE", "Sketch_2/Edge-SketchLine_89")]) +Edge_1 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_2/SketchArc_69_2"), model.selection("EDGE", "Sketch_2/SketchLine_89")]) Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("EDGE", "Edge_1_1"), model.selection("EDGE", "Edge_1_2")], model.selection("EDGE", "PartSet/OX"), 0, 307) -Plane_5 = model.addPlane(Part_1_doc, model.selection("FACE", "PartSet/YOZ"), model.selection("VERTEX", "Sketch_1/Vertex-SketchLine_3e-SketchLine_86e")) +Plane_5 = model.addPlane(Part_1_doc, model.selection("FACE", "PartSet/YOZ"), model.selection("VERTEX", "Sketch_1/SketchLine_3_EndVertex")) Sketch_3 = model.addSketch(Part_1_doc, model.selection("FACE", "Plane_2")) -SketchProjection_5 = Sketch_3.addProjection(model.selection("VERTEX", "Sketch_1/Vertex-SketchLine_3e-SketchLine_86e"), False) +SketchProjection_5 = Sketch_3.addProjection(model.selection("VERTEX", "Sketch_1/SketchLine_3_EndVertex"), False) SketchPoint_10 = SketchProjection_5.createdFeature() -SketchArc_70 = Sketch_3.addArc(-24.69999999999951, 1.85, -24.69999999999928, -3.648414406296559e-014, -26.54999999999951, 1.85, True) +SketchArc_70 = Sketch_3.addArc(-24.69999999999951, 1.85, -24.69999999999928, -3.648414406296559e-14, -26.54999999999951, 1.85, True) SketchConstraintCoincidence_58 = Sketch_3.setCoincident(SketchPoint_10.result(), SketchArc_70.startPoint()) SketchConstraintCoincidence_58.setName("SketchConstraintCoincidence_68") SketchLine_89 = Sketch_3.addLine(-26.54999999999951, 1.85, -24.69999999999951, 1.85) @@ -525,18 +526,18 @@ SketchConstraintVertical_9 = Sketch_3.setVertical(SketchLine_91.result()) SketchConstraintRadius_4 = Sketch_3.setRadius(SketchArc_70.results()[1], "rext_2-ep/2") SketchConstraintLength_7 = Sketch_3.setLength(SketchLine_91.result(), 10) model.do() -Edge_2 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_3/Edge-SketchLine_92"), model.selection("EDGE", "Sketch_3/Edge-SketchArc_70_2")]) +Edge_2 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_3/SketchLine_92"), model.selection("EDGE", "Sketch_3/SketchArc_70_2")]) Extrusion_2 = model.addExtrusion(Part_1_doc, [model.selection("EDGE", "Edge_2_1"), model.selection("EDGE", "Edge_2_2")], model.selection("EDGE", "PartSet/OX"), 0, 299) Translation_1 = model.addTranslation(Part_1_doc, [model.selection("FACE", "Extrusion_2_2"), model.selection("FACE", "Extrusion_2_1")], model.selection("EDGE", "PartSet/OX"), -2) -Face_1 = model.addFace(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_1f-SketchLine_2f-SketchLine_3f-SketchLine_4f-SketchLine_7r-SketchLine_9r-SketchArc_1_2r-SketchArc_2_2r-SketchArc_3_2r-SketchLine_11r-SketchLine_12r-SketchArc_4_2r-SketchArc_5_2r-SketchLine_13r-SketchLine_14r-SketchArc_6_2r-SketchArc_7_2r-SketchLine_15r-SketchLine_16r-SketchArc_8_2r-SketchLine_17r-SketchArc_9_2r-SketchLine_18r-SketchArc_10_2r-SketchArc_11_2r-SketchLine_19r-SketchLine_20r-SketchArc_12_2r-SketchLine_21r-SketchLine_22r-SketchLine_23r-SketchLine_24r-SketchArc_13_2r-SketchArc_14_2r-SketchArc_15_2r-SketchArc_16_2r-SketchLine_25r-SketchArc_17_2r-SketchLine_26r-SketchArc_18_2r-SketchArc_19_2r-SketchLine_27r-SketchLine_28r-SketchArc_20_2r-SketchLine_29r-SketchLine_30r-SketchLine_31r-SketchLine_32r-SketchArc_21_2r-SketchArc_22_2r-SketchArc_23_2r-SketchArc_24_2r-SketchLine_33r-SketchLine_34r-SketchLine_35r-SketchLine_36r-SketchArc_25_2r-SketchArc_26_2r-SketchArc_27_2r-SketchArc_28_2r-SketchArc_29_2r-SketchArc_30_2r-SketchArc_31_2r-SketchArc_32_2r-SketchLine_37r-SketchLine_38r-SketchLine_39r-SketchLine_40r-SketchLine_41r-SketchLine_42r-SketchLine_43r-SketchLine_44r-SketchArc_33_2r-SketchArc_34_2r-SketchArc_35_2r-SketchArc_36_2r-SketchLine_45r-SketchArc_37_2r-SketchLine_46r-SketchArc_38_2r-SketchLine_47r-SketchLine_48r-SketchLine_49r-SketchArc_39_2r-SketchLine_50r-SketchLine_51r-SketchLine_52r-SketchArc_40_2r-SketchArc_41_2r-SketchLine_53r-SketchLine_54r-SketchArc_42_2r-SketchLine_55r-SketchArc_43_2r-SketchArc_44_2r-SketchArc_45_2r-SketchLine_56r-SketchArc_46_2r-SketchArc_47_2r-SketchLine_57r-SketchLine_58r-SketchArc_48_2r-SketchLine_59r-SketchArc_49_2r-SketchArc_50_2r-SketchArc_51_2r-SketchLine_60r-SketchLine_61r-SketchArc_52_2r-SketchArc_53_2r-SketchLine_62r-SketchArc_54_2r-SketchArc_55_2r-SketchLine_63r-SketchLine_64r-SketchArc_56_2r-SketchLine_65r-SketchLine_66r-SketchLine_67r-SketchLine_68r-SketchArc_57_2r-SketchArc_58_2r-SketchArc_59_2r-SketchArc_60_2r-SketchLine_69f-SketchLine_70f-SketchLine_71f-SketchArc_61_2r-SketchArc_62_2r-SketchLine_72f-SketchArc_63_2r-SketchLine_73f-SketchArc_64_2r-SketchLine_74f-SketchLine_75r-SketchArc_65_2r-SketchLine_76r-SketchArc_66_2r-SketchLine_77r-SketchLine_78r-SketchArc_67_2r-SketchLine_79r-SketchArc_68_2r-SketchLine_80r-SketchLine_81f-SketchLine_82f-SketchLine_83f-SketchLine_84f-SketchLine_85f-SketchLine_86r")]) +Face_1 = model.addFace(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_1r-SketchLine_2f-SketchLine_69f-SketchArc_61_2r-SketchLine_70f-SketchArc_62_2r-SketchLine_71f-SketchLine_81f-SketchLine_72f-SketchArc_63_2r-SketchLine_73f-SketchArc_64_2r-SketchLine_74f-SketchLine_82f-SketchLine_85f-SketchLine_3f-SketchLine_86r-SketchLine_4f-SketchLine_80r-SketchArc_68_2r-SketchLine_79r-SketchArc_67_2r-SketchLine_78r-SketchLine_84f-SketchLine_77r-SketchArc_66_2r-SketchLine_76r-SketchArc_65_2r-SketchLine_75r-SketchLine_83f-SketchLine_15r-SketchArc_8_2r-SketchLine_16r-SketchArc_7_2r-SketchArc_2_2r-SketchLine_9r-SketchArc_1_2r-SketchLine_7r-SketchLine_11r-SketchArc_4_2r-SketchLine_12r-SketchArc_3_2r-SketchArc_32_2r-SketchLine_40r-SketchArc_28_2r-SketchLine_36r-SketchArc_24_2r-SketchLine_44r-SketchArc_36_2r-SketchLine_32r-SketchLine_50r-SketchArc_43_2r-SketchLine_54r-SketchArc_41_2r-SketchLine_49r-SketchArc_55_2r-SketchLine_65r-SketchArc_37_2r-SketchLine_13r-SketchArc_6_2r-SketchLine_14r-SketchArc_5_2r-SketchArc_9_2r-SketchLine_18r-SketchArc_10_2r-SketchLine_17r-SketchLine_20r-SketchArc_12_2r-SketchLine_19r-SketchArc_11_2r-SketchArc_29_2r-SketchLine_37r-SketchArc_25_2r-SketchLine_33r-SketchArc_21_2r-SketchLine_41r-SketchArc_33_2r-SketchLine_29r-SketchArc_30_2r-SketchLine_38r-SketchArc_26_2r-SketchLine_34r-SketchArc_22_2r-SketchLine_42r-SketchArc_34_2r-SketchLine_30r-SketchLine_68r-SketchArc_53_2r-SketchLine_61r-SketchArc_58_2r-SketchLine_64r-SketchArc_51_2r-SketchLine_60r-SketchArc_39_2r-SketchArc_50_2r-SketchLine_63r-SketchArc_57_2r-SketchLine_53r-SketchArc_45_2r-SketchLine_56r-SketchArc_42_2r-SketchLine_47r-SketchArc_49_2r-SketchLine_62r-SketchArc_47_2r-SketchLine_52r-SketchArc_52_2r-SketchLine_57r-SketchArc_48_2r-SketchLine_48r-SketchArc_31_2r-SketchLine_39r-SketchArc_27_2r-SketchLine_35r-SketchArc_23_2r-SketchLine_43r-SketchArc_35_2r-SketchLine_31r-SketchArc_59_2r-SketchLine_58r-SketchArc_54_2r-SketchLine_66r-SketchArc_60_2r-SketchLine_59r-SketchArc_46_2r-SketchLine_51r-SketchArc_19_2r-SketchLine_27r-SketchArc_18_2r-SketchLine_26r-SketchArc_17_2r-SketchLine_28r-SketchArc_20_2r-SketchLine_25r-SketchArc_56_2r-SketchLine_67r-SketchArc_38_2r-SketchLine_46r-SketchArc_44_2r-SketchLine_55r-SketchArc_40_2r-SketchLine_45r-SketchArc_15_2r-SketchLine_24r-SketchArc_16_2r-SketchLine_23r-SketchArc_14_2r-SketchLine_22r-SketchArc_13_2r-SketchLine_21r")]) Sketch_4 = model.addSketch(Part_1_doc, model.selection("FACE", "Translation_1_2")) SketchCircle_1 = Sketch_4.addCircle(96.50000000003769, 5.5, 1.65) -SketchProjection_6 = Sketch_4.addProjection(model.selection("EDGE", "Translation_1_2/Translated_Edge_1"), False) +SketchProjection_6 = Sketch_4.addProjection(model.selection("EDGE", "Translation_1_2/ME:Translated&Extrusion_2_1/To_Edge"), False) SketchLine_92 = SketchProjection_6.createdFeature() SketchLine_92.setName("SketchLine_93") SketchLine_92.result().setName("SketchLine_93") SketchConstraintDistance_14 = Sketch_4.setDistance(SketchCircle_1.center(), SketchLine_92.result(), 53, True) -SketchProjection_7 = Sketch_4.addProjection(model.selection("EDGE", "Extrusion_1_2/To_Edge_1"), False) +SketchProjection_7 = Sketch_4.addProjection(model.selection("EDGE", "Extrusion_1_2/To_Edge"), False) SketchLine_93 = SketchProjection_7.createdFeature() SketchLine_93.setName("SketchLine_94") SketchLine_93.result().setName("SketchLine_94") @@ -560,11 +561,11 @@ SketchConstraintLength_8 = Sketch_4.setLength(SketchLine_95.result(), 67) SketchMultiTranslation_6 = Sketch_4.addTranslation([SketchCircle_1.results()[1]], SketchLine_95.endPoint(), SketchLine_95.startPoint(), 4) [SketchCircle_2, SketchCircle_3, SketchCircle_4] = SketchMultiTranslation_6.translated() model.do() -Face_2_objects = [model.selection("EDGE", "Sketch_4/Edge-SketchCircle_4_2"), model.selection("EDGE", "Sketch_4/Edge-SketchCircle_3_2"), model.selection("WIRE", "Sketch_4/Wire-SketchCircle_2_2f"), model.selection("EDGE", "Sketch_4/Edge-SketchCircle_1_2")] +Face_2_objects = [model.selection("EDGE", "Sketch_4/SketchCircle_4_2"), model.selection("EDGE", "Sketch_4/SketchCircle_3_2"), model.selection("WIRE", "[Sketch_4/SketchCircle_2_2]"), model.selection("EDGE", "Sketch_4/SketchCircle_1_2")] Face_2 = model.addFace(Part_1_doc, Face_2_objects) Partition_1_objects = [model.selection("FACE", "Extrusion_1_1"), model.selection("FACE", "Extrusion_1_2"), model.selection("FACE", "Translation_1_1"), model.selection("FACE", "Translation_1_2"), model.selection("FACE", "Face_1_1"), model.selection("FACE", "Face_2_1"), model.selection("FACE", "Face_2_2"), model.selection("FACE", "Face_2_3"), model.selection("FACE", "Face_2_4")] Partition_1 = model.addPartition(Part_1_doc, Partition_1_objects) -Remove_SubShapes_1_objects_2 = [model.selection("FACE", "Face_2_1/Face_2_1"), model.selection("FACE", "Face_2_2/Face_2_2"), model.selection("FACE", "Face_2_3/Face_2_3"), model.selection("FACE", "Face_2_4/Face_2_4")] +Remove_SubShapes_1_objects_2 = [model.selection("FACE", "Partition_1_1_5"), model.selection("FACE", "Partition_1_1_6"), model.selection("FACE", "Partition_1_1_7"), model.selection("FACE", "Partition_1_1_8")] Remove_SubShapes_1 = model.addRemoveSubShapes(Part_1_doc, model.selection("COMPOUND", "Partition_1_1")) Remove_SubShapes_1.setSubShapesToRemove(Remove_SubShapes_1_objects_2) model.do() diff --git a/src/FeaturesPlugin/Test/Test2514.py b/src/FeaturesPlugin/Test/Test2514.py index d8ea46b65..5d15a2555 100644 --- a/src/FeaturesPlugin/Test/Test2514.py +++ b/src/FeaturesPlugin/Test/Test2514.py @@ -88,14 +88,14 @@ SketchConstraintCoincidence_13.setName("SketchConstraintCoincidence_16") SketchConstraintCoincidence_14 = Sketch_1.setCoincident(SketchArc_1.startPoint(), SketchLine_3.result()) SketchConstraintCoincidence_14.setName("SketchConstraintCoincidence_17") model.do() -Edge_1_objects = [model.selection("EDGE", "Sketch_1/Edge-SketchArc_1_2"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_1"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_6"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_7"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_8"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_2"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_9")] +Edge_1_objects = [model.selection("EDGE", "Sketch_1/SketchArc_1_2"), model.selection("EDGE", "Sketch_1/SketchLine_1"), model.selection("EDGE", "Sketch_1/SketchLine_6"), model.selection("EDGE", "Sketch_1/SketchLine_7"), model.selection("EDGE", "Sketch_1/SketchLine_8"), model.selection("EDGE", "Sketch_1/SketchLine_2"), model.selection("EDGE", "Sketch_1/SketchLine_9")] Edge_1 = model.addEdge(Part_1_doc, Edge_1_objects) Revolution_1_objects = [model.selection("EDGE", "Edge_1_1"), model.selection("EDGE", "Edge_1_2"), model.selection("EDGE", "Edge_1_3"), model.selection("EDGE", "Edge_1_4"), model.selection("EDGE", "Edge_1_5"), model.selection("EDGE", "Edge_1_6"), model.selection("EDGE", "Edge_1_7")] Revolution_1 = model.addRevolution(Part_1_doc, Revolution_1_objects, model.selection("EDGE", "PartSet/OZ"), 360, 0) Sketch_2 = model.addSketch(Part_1_doc, model.standardPlane("XOZ")) -SketchProjection_3 = Sketch_2.addProjection(model.selection("VERTEX", "Sketch_1/Vertex-SketchLine_2e"), False) +SketchProjection_3 = Sketch_2.addProjection(model.selection("VERTEX", "Sketch_1/SketchLine_2_EndVertex"), False) SketchPoint_1 = SketchProjection_3.createdFeature() -SketchProjection_4 = Sketch_2.addProjection(model.selection("EDGE", "Sketch_1/Edge-SketchLine_2"), False) +SketchProjection_4 = Sketch_2.addProjection(model.selection("EDGE", "Sketch_1/SketchLine_2"), False) SketchLine_9 = SketchProjection_4.createdFeature() SketchLine_9.setName("SketchLine_11") SketchLine_9.result().setName("SketchLine_11") @@ -122,197 +122,198 @@ SketchConstraintCoincidence_18.setName("SketchConstraintCoincidence_21") SketchConstraintCoincidence_19 = Sketch_2.setCoincident(SketchLine_10.startPoint(), SketchLine_13.endPoint()) SketchConstraintCoincidence_19.setName("SketchConstraintCoincidence_22") SketchConstraintHorizontal_2 = Sketch_2.setHorizontal(SketchLine_12.result()) -SketchPoint_2 = Sketch_2.addPoint(-5.903605550615992e-026, -5) -SketchConstraintCoincidence_21 = Sketch_2.setCoincident(SketchPoint_2.coordinates(), SketchLine_12.result()) -SketchConstraintCoincidence_21.setName("SketchConstraintCoincidence_24") +SketchPoint_2 = Sketch_2.addPoint(-5.903605550615992e-26, -5) +SketchConstraintCoincidence_20 = Sketch_2.setCoincident(SketchPoint_2.coordinates(), SketchLine_12.result()) +SketchConstraintCoincidence_20.setName("SketchConstraintCoincidence_24") SketchConstraintMiddle_1 = Sketch_2.setMiddlePoint(SketchPoint_2.coordinates(), SketchLine_12.result()) -SketchProjection_6 = Sketch_2.addProjection(model.selection("EDGE", "PartSet/OZ"), False) -SketchLine_15 = SketchProjection_6.createdFeature() -SketchLine_15.setName("SketchLine_16") -SketchLine_15.result().setName("SketchLine_16") -SketchConstraintCoincidence_22 = Sketch_2.setCoincident(SketchPoint_2.coordinates(), SketchLine_15.result()) -SketchConstraintCoincidence_22.setName("SketchConstraintCoincidence_25") +SketchProjection_5 = Sketch_2.addProjection(model.selection("EDGE", "PartSet/OZ"), False) +SketchLine_14 = SketchProjection_5.createdFeature() +SketchLine_14.setName("SketchLine_16") +SketchLine_14.result().setName("SketchLine_16") +SketchConstraintCoincidence_21 = Sketch_2.setCoincident(SketchPoint_2.coordinates(), SketchLine_14.result()) +SketchConstraintCoincidence_21.setName("SketchConstraintCoincidence_25") SketchConstraintDistance_2 = Sketch_2.setDistance(SketchLine_11.endPoint(), SketchLine_10.result(), 2, True) SketchConstraintLength_4 = Sketch_2.setLength(SketchLine_10.result(), 3) SketchConstraintMiddle_2 = Sketch_2.setMiddlePoint(SketchAPI_Line(SketchLine_9).endPoint(), SketchLine_10.result()) SketchConstraintLength_5 = Sketch_2.setLength(SketchLine_12.result(), 2) model.do() -Edge_2_objects = [model.selection("EDGE", "Sketch_2/Edge-SketchLine_12"), model.selection("EDGE", "Sketch_2/Edge-SketchLine_13"), model.selection("EDGE", "Sketch_2/Edge-SketchLine_14"), model.selection("EDGE", "Sketch_2/Edge-SketchLine_10")] +Edge_2_objects = [model.selection("EDGE", "Sketch_2/SketchLine_12"), model.selection("EDGE", "Sketch_2/SketchLine_13"), model.selection("EDGE", "Sketch_2/SketchLine_14"), model.selection("EDGE", "Sketch_2/SketchLine_10")] Edge_2 = model.addEdge(Part_1_doc, Edge_2_objects) Extrusion_1_objects = [model.selection("EDGE", "Edge_2_1"), model.selection("EDGE", "Edge_2_2"), model.selection("EDGE", "Edge_2_3"), model.selection("EDGE", "Edge_2_4")] Extrusion_1 = model.addExtrusion(Part_1_doc, Extrusion_1_objects, model.selection("EDGE", "PartSet/OY"), 3, 3) Sketch_3 = model.addSketch(Part_1_doc, model.selection("FACE", "Revolution_1_6")) -SketchLine_16 = Sketch_3.addLine(-15, 0, -10, 2.951677693621839e-024) -SketchLine_16.setName("SketchLine_17") -SketchLine_16.result().setName("SketchLine_17") -SketchProjection_7 = Sketch_3.addProjection(model.selection("EDGE", "Revolution_1_6/Generated_Edge_1"), False) -SketchCircle_1 = SketchProjection_7.createdFeature() -SketchConstraintCoincidence_23 = Sketch_3.setCoincident(SketchLine_16.startPoint(), SketchCircle_1.results()[1]) -SketchConstraintCoincidence_23.setName("SketchConstraintCoincidence_26") -SketchLine_17 = Sketch_3.addLine(-10, 2.951677693621839e-024, -10, -3) -SketchLine_17.setName("SketchLine_18") -SketchLine_17.result().setName("SketchLine_18") +SketchLine_15 = Sketch_3.addLine(-15, 0, -10, 2.951677693621839e-24) +SketchLine_15.setName("SketchLine_17") +SketchLine_15.result().setName("SketchLine_17") +SketchProjection_6 = Sketch_3.addProjection(model.selection("EDGE", "Revolution_1_6/Generated_Edge&Sketch_1/SketchLine_2_StartVertex"), False) +SketchCircle_1 = SketchProjection_6.createdFeature() +SketchConstraintCoincidence_22 = Sketch_3.setCoincident(SketchLine_15.startPoint(), SketchCircle_1.results()[1]) +SketchConstraintCoincidence_22.setName("SketchConstraintCoincidence_26") +SketchLine_16 = Sketch_3.addLine(-10, 2.951677693621839e-24, -10, -3) +SketchLine_16.setName("SketchLine_18") +SketchLine_16.result().setName("SketchLine_18") +SketchConstraintCoincidence_23 = Sketch_3.setCoincident(SketchLine_15.endPoint(), SketchLine_16.startPoint()) +SketchConstraintCoincidence_23.setName("SketchConstraintCoincidence_27") +SketchLine_17 = Sketch_3.addLine(-10, -3, -14.69693845669907, -3) +SketchLine_17.setName("SketchLine_19") +SketchLine_17.result().setName("SketchLine_19") SketchConstraintCoincidence_24 = Sketch_3.setCoincident(SketchLine_16.endPoint(), SketchLine_17.startPoint()) -SketchConstraintCoincidence_24.setName("SketchConstraintCoincidence_27") -SketchLine_18 = Sketch_3.addLine(-10, -3, -14.69693845669907, -3) -SketchLine_18.setName("SketchLine_19") -SketchLine_18.result().setName("SketchLine_19") -SketchConstraintCoincidence_25 = Sketch_3.setCoincident(SketchLine_17.endPoint(), SketchLine_18.startPoint()) -SketchConstraintCoincidence_25.setName("SketchConstraintCoincidence_28") -SketchConstraintCoincidence_26 = Sketch_3.setCoincident(SketchLine_18.endPoint(), SketchCircle_1.results()[1]) -SketchConstraintCoincidence_26.setName("SketchConstraintCoincidence_29") -SketchConstraintVertical_3 = Sketch_3.setVertical(SketchLine_17.result()) -SketchConstraintCoincidence_27 = Sketch_3.setCoincident(SketchLine_16.result(), SketchAPI_Circle(SketchCircle_1).center()) -SketchConstraintCoincidence_27.setName("SketchConstraintCoincidence_30") -SketchConstraintParallel_1 = Sketch_3.setParallel(SketchLine_16.result(), SketchLine_18.result()) -SketchConstraintLength_6 = Sketch_3.setLength(SketchLine_16.result(), 5) -SketchConstraintLength_7 = Sketch_3.setLength(SketchLine_17.result(), 3) -SketchConstraintMirror_1 = Sketch_3.addMirror(SketchLine_16.result(), [SketchLine_17.result(), SketchLine_18.result()]) -[SketchLine_19, SketchLine_20] = SketchConstraintMirror_1.mirrored() -SketchLine_20.setName("SketchLine_21") -SketchLine_20.result().setName("SketchLine_21") -SketchLine_19.setName("SketchLine_20") -SketchLine_19.result().setName("SketchLine_20") -SketchLine_21 = Sketch_3.addLine(-1.5, -2, 2, -2) -SketchLine_21.setName("SketchLine_22") -SketchLine_21.result().setName("SketchLine_22") -SketchLine_22 = Sketch_3.addLine(2, -2, 2, 2) -SketchLine_22.setName("SketchLine_23") -SketchLine_22.result().setName("SketchLine_23") +SketchConstraintCoincidence_24.setName("SketchConstraintCoincidence_28") +SketchConstraintCoincidence_25 = Sketch_3.setCoincident(SketchLine_17.endPoint(), SketchCircle_1.results()[1]) +SketchConstraintCoincidence_25.setName("SketchConstraintCoincidence_29") +SketchConstraintVertical_3 = Sketch_3.setVertical(SketchLine_16.result()) +SketchConstraintCoincidence_26 = Sketch_3.setCoincident(SketchLine_15.result(), SketchAPI_Circle(SketchCircle_1).center()) +SketchConstraintCoincidence_26.setName("SketchConstraintCoincidence_30") +SketchConstraintParallel_1 = Sketch_3.setParallel(SketchLine_15.result(), SketchLine_17.result()) +SketchConstraintLength_6 = Sketch_3.setLength(SketchLine_15.result(), 5) +SketchConstraintLength_7 = Sketch_3.setLength(SketchLine_16.result(), 3) +SketchConstraintMirror_1 = Sketch_3.addMirror(SketchLine_15.result(), [SketchLine_16.result(), SketchLine_17.result()]) +[SketchLine_18, SketchLine_19] = SketchConstraintMirror_1.mirrored() +SketchLine_19.setName("SketchLine_21") +SketchLine_19.result().setName("SketchLine_21") +SketchLine_18.setName("SketchLine_20") +SketchLine_18.result().setName("SketchLine_20") +SketchLine_20 = Sketch_3.addLine(-1.5, -2, 2, -2) +SketchLine_20.setName("SketchLine_22") +SketchLine_20.result().setName("SketchLine_22") +SketchLine_21 = Sketch_3.addLine(2, -2, 2, 2) +SketchLine_21.setName("SketchLine_23") +SketchLine_21.result().setName("SketchLine_23") +SketchConstraintCoincidence_27 = Sketch_3.setCoincident(SketchLine_20.endPoint(), SketchLine_21.startPoint()) +SketchConstraintCoincidence_27.setName("SketchConstraintCoincidence_31") +SketchLine_22 = Sketch_3.addLine(2, 2, -1.5, 2) +SketchLine_22.setName("SketchLine_24") +SketchLine_22.result().setName("SketchLine_24") SketchConstraintCoincidence_28 = Sketch_3.setCoincident(SketchLine_21.endPoint(), SketchLine_22.startPoint()) -SketchConstraintCoincidence_28.setName("SketchConstraintCoincidence_31") -SketchLine_23 = Sketch_3.addLine(2, 2, -1.5, 2) -SketchLine_23.setName("SketchLine_24") -SketchLine_23.result().setName("SketchLine_24") -SketchConstraintCoincidence_29 = Sketch_3.setCoincident(SketchLine_22.endPoint(), SketchLine_23.startPoint()) -SketchConstraintCoincidence_29.setName("SketchConstraintCoincidence_32") -SketchProjection_8 = Sketch_3.addProjection(model.selection("EDGE", "PartSet/OX"), False) -SketchLine_24 = SketchProjection_8.createdFeature() -SketchLine_24.setName("SketchLine_25") -SketchLine_24.result().setName("SketchLine_25") -SketchConstraintCoincidence_30 = Sketch_3.setCoincident(SketchLine_16.startPoint(), SketchLine_24.result()) -SketchConstraintCoincidence_30.setName("SketchConstraintCoincidence_33") -SketchConstraintHorizontal_3 = Sketch_3.setHorizontal(SketchLine_23.result()) -SketchConstraintHorizontal_4 = Sketch_3.setHorizontal(SketchLine_21.result()) -SketchConstraintVertical_4 = Sketch_3.setVertical(SketchLine_22.result()) +SketchConstraintCoincidence_28.setName("SketchConstraintCoincidence_32") +SketchProjection_7 = Sketch_3.addProjection(model.selection("EDGE", "PartSet/OX"), False) +SketchLine_23 = SketchProjection_7.createdFeature() +SketchLine_23.setName("SketchLine_25") +SketchLine_23.result().setName("SketchLine_25") +SketchConstraintCoincidence_29 = Sketch_3.setCoincident(SketchLine_15.startPoint(), SketchLine_23.result()) +SketchConstraintCoincidence_29.setName("SketchConstraintCoincidence_33") +SketchConstraintHorizontal_3 = Sketch_3.setHorizontal(SketchLine_22.result()) +SketchConstraintHorizontal_4 = Sketch_3.setHorizontal(SketchLine_20.result()) +SketchConstraintVertical_4 = Sketch_3.setVertical(SketchLine_21.result()) SketchArc_2 = Sketch_3.addArc(0, 0, -1.5, -2, -1.5, 2, True) -SketchConstraintCoincidence_31 = Sketch_3.setCoincident(SketchAPI_Circle(SketchCircle_1).center(), SketchArc_2.center()) -SketchConstraintCoincidence_31.setName("SketchConstraintCoincidence_34") -SketchConstraintCoincidence_32 = Sketch_3.setCoincident(SketchArc_2.startPoint(), SketchLine_21.startPoint()) -SketchConstraintCoincidence_32.setName("SketchConstraintCoincidence_35") -SketchConstraintCoincidence_33 = Sketch_3.setCoincident(SketchArc_2.endPoint(), SketchLine_23.endPoint()) -SketchConstraintCoincidence_33.setName("SketchConstraintCoincidence_36") +SketchConstraintCoincidence_30 = Sketch_3.setCoincident(SketchAPI_Circle(SketchCircle_1).center(), SketchArc_2.center()) +SketchConstraintCoincidence_30.setName("SketchConstraintCoincidence_34") +SketchConstraintCoincidence_31 = Sketch_3.setCoincident(SketchArc_2.startPoint(), SketchLine_20.startPoint()) +SketchConstraintCoincidence_31.setName("SketchConstraintCoincidence_35") +SketchConstraintCoincidence_32 = Sketch_3.setCoincident(SketchArc_2.endPoint(), SketchLine_22.endPoint()) +SketchConstraintCoincidence_32.setName("SketchConstraintCoincidence_36") SketchPoint_3 = Sketch_3.addPoint(2, 0) -SketchConstraintCoincidence_34 = Sketch_3.setCoincident(SketchPoint_3.coordinates(), SketchLine_22.result()) -SketchConstraintCoincidence_34.setName("SketchConstraintCoincidence_37") -SketchConstraintCoincidence_35 = Sketch_3.setCoincident(SketchPoint_3.coordinates(), SketchLine_24.result()) -SketchConstraintCoincidence_35.setName("SketchConstraintCoincidence_38") -SketchConstraintMiddle_3 = Sketch_3.setMiddlePoint(SketchPoint_3.coordinates(), SketchLine_22.result()) -SketchLine_25 = Sketch_3.addLine(-1.5, -2, -1.5, 2) -SketchLine_25.setName("SketchLine_26") -SketchLine_25.result().setName("SketchLine_26") -SketchLine_25.setAuxiliary(True) -SketchConstraintCoincidence_36 = Sketch_3.setCoincident(SketchLine_21.startPoint(), SketchLine_25.startPoint()) -SketchConstraintCoincidence_36.setName("SketchConstraintCoincidence_39") -SketchConstraintCoincidence_37 = Sketch_3.setCoincident(SketchLine_23.endPoint(), SketchLine_25.endPoint()) -SketchConstraintCoincidence_37.setName("SketchConstraintCoincidence_40") -SketchProjection_9 = Sketch_3.addProjection(model.selection("VERTEX", "Sketch_2/Vertex-SketchLine_12s-SketchLine_10e"), False) -SketchPoint_4 = SketchProjection_9.createdFeature() -SketchConstraintCoincidence_38 = Sketch_3.setCoincident(SketchAPI_Point(SketchPoint_4).coordinates(), SketchLine_25.result()) -SketchConstraintCoincidence_38.setName("SketchConstraintCoincidence_41") -SketchConstraintLength_8 = Sketch_3.setLength(SketchLine_25.result(), 4) -SketchProjection_10 = Sketch_3.addProjection(model.selection("VERTEX", "Sketch_2/Vertex-SketchLine_10s-SketchLine_14e"), False) -SketchPoint_5 = SketchProjection_10.createdFeature() -SketchConstraintDistance_3 = Sketch_3.setDistance(SketchAPI_Point(SketchPoint_5).coordinates(), SketchLine_22.result(), 0.5, True) -SketchLine_26 = Sketch_3.addLine(-7.5, -7.382311001750988e-022, -7.5, -3) -SketchLine_26.setName("SketchLine_27") -SketchLine_26.result().setName("SketchLine_27") -SketchConstraintVertical_5 = Sketch_3.setVertical(SketchLine_26.result()) -SketchConstraintCoincidence_39 = Sketch_3.setCoincident(SketchLine_26.startPoint(), SketchLine_16.result()) -SketchConstraintCoincidence_39.setName("SketchConstraintCoincidence_42") -SketchConstraintCoincidence_40 = Sketch_3.setCoincident(SketchLine_26.endPoint(), SketchLine_18.result()) -SketchConstraintCoincidence_40.setName("SketchConstraintCoincidence_43") -SketchLine_27 = Sketch_3.addLine(-7.5, -7.382311001750988e-022, -2.500000000000019, -5.187200122832181e-016) -SketchLine_27.setName("SketchLine_28") -SketchLine_27.result().setName("SketchLine_28") -SketchConstraintCoincidence_41 = Sketch_3.setCoincident(SketchLine_26.startPoint(), SketchLine_27.startPoint()) -SketchConstraintCoincidence_41.setName("SketchConstraintCoincidence_44") -SketchConstraintCoincidence_42 = Sketch_3.setCoincident(SketchLine_27.endPoint(), SketchArc_2.results()[1]) -SketchConstraintCoincidence_42.setName("SketchConstraintCoincidence_45") -SketchConstraintHorizontal_5 = Sketch_3.setHorizontal(SketchLine_27.result()) -SketchConstraintDistance_4 = Sketch_3.setDistance(SketchLine_17.startPoint(), SketchLine_26.result(), 2.5, True) -SketchLine_28 = Sketch_3.addLine(2, 0, 11, 0) -SketchLine_28.setName("SketchLine_29") -SketchLine_28.result().setName("SketchLine_29") -SketchConstraintCoincidence_43 = Sketch_3.setCoincident(SketchPoint_3.coordinates(), SketchLine_28.startPoint()) -SketchConstraintCoincidence_43.setName("SketchConstraintCoincidence_46") -SketchConstraintCoincidence_44 = Sketch_3.setCoincident(SketchLine_28.endPoint(), SketchLine_24.result()) -SketchConstraintCoincidence_44.setName("SketchConstraintCoincidence_47") -SketchLine_29 = Sketch_3.addLine(15, 0, 14, 0) -SketchLine_29.setName("SketchLine_30") -SketchLine_29.result().setName("SketchLine_30") -SketchProjection_11 = Sketch_3.addProjection(model.selection("VERTEX", "Revolution_1_6/Generated_Edge_1"), False) -SketchPoint_6 = SketchProjection_11.createdFeature() -SketchConstraintCoincidence_45 = Sketch_3.setCoincident(SketchLine_29.startPoint(), SketchPoint_6.result()) -SketchConstraintCoincidence_45.setName("SketchConstraintCoincidence_48") -SketchConstraintCoincidence_46 = Sketch_3.setCoincident(SketchLine_29.endPoint(), SketchLine_24.result()) -SketchConstraintCoincidence_46.setName("SketchConstraintCoincidence_49") -SketchConstraintDistance_5 = Sketch_3.setDistance(SketchLine_28.endPoint(), SketchLine_29.endPoint(), 3, True) -SketchConstraintLength_9 = Sketch_3.setLength(SketchLine_29.result(), 1) -SketchLine_30 = Sketch_3.addLine(11, 0, 11, -2.000000000000004) -SketchLine_30.setName("SketchLine_31") -SketchLine_30.result().setName("SketchLine_31") -SketchConstraintCoincidence_47 = Sketch_3.setCoincident(SketchLine_28.endPoint(), SketchLine_30.startPoint()) -SketchConstraintCoincidence_47.setName("SketchConstraintCoincidence_50") -SketchLine_31 = Sketch_3.addLine(9.500000000000002, 2.627360613063856e-019, 9.5, -2.000000000000004) -SketchLine_31.setName("SketchLine_32") -SketchLine_31.result().setName("SketchLine_32") -SketchConstraintCoincidence_48 = Sketch_3.setCoincident(SketchLine_31.startPoint(), SketchLine_28.result()) -SketchConstraintCoincidence_48.setName("SketchConstraintCoincidence_51") -SketchLine_32 = Sketch_3.addLine(8, -1.882265929199326e-020, 8, -2.000000000000004) -SketchLine_32.setName("SketchLine_33") -SketchLine_32.result().setName("SketchLine_33") -SketchConstraintCoincidence_49 = Sketch_3.setCoincident(SketchLine_32.startPoint(), SketchLine_28.result()) -SketchConstraintCoincidence_49.setName("SketchConstraintCoincidence_52") -SketchLine_33 = Sketch_3.addLine(5, -3.396138881322731e-022, 5, -2.000000000000004) -SketchLine_33.setName("SketchLine_34") -SketchLine_33.result().setName("SketchLine_34") -SketchConstraintCoincidence_50 = Sketch_3.setCoincident(SketchLine_33.startPoint(), SketchLine_28.result()) -SketchConstraintCoincidence_50.setName("SketchConstraintCoincidence_53") -SketchLine_34 = Sketch_3.addLine(5, -2.000000000000004, 11, -2.000000000000004) -SketchLine_34.setName("SketchLine_35") -SketchLine_34.result().setName("SketchLine_35") -SketchLine_34.setAuxiliary(True) -SketchConstraintCoincidence_51 = Sketch_3.setCoincident(SketchLine_33.endPoint(), SketchLine_34.startPoint()) -SketchConstraintCoincidence_51.setName("SketchConstraintCoincidence_54") -SketchConstraintCoincidence_52 = Sketch_3.setCoincident(SketchLine_30.endPoint(), SketchLine_34.endPoint()) -SketchConstraintCoincidence_52.setName("SketchConstraintCoincidence_55") -SketchConstraintVertical_6 = Sketch_3.setVertical(SketchLine_33.result()) -SketchConstraintVertical_7 = Sketch_3.setVertical(SketchLine_32.result()) -SketchConstraintVertical_8 = Sketch_3.setVertical(SketchLine_31.result()) -#SketchConstraintVertical_9 = Sketch_3.setVertical(SketchLine_30.result()) -SketchConstraintHorizontal_6 = Sketch_3.setHorizontal(SketchLine_34.result()) -SketchConstraintCoincidence_53 = Sketch_3.setCoincident(SketchLine_32.endPoint(), SketchLine_34.result()) -SketchConstraintCoincidence_53.setName("SketchConstraintCoincidence_56") -SketchConstraintCoincidence_54 = Sketch_3.setCoincident(SketchLine_31.endPoint(), SketchLine_34.result()) -SketchConstraintCoincidence_54.setName("SketchConstraintCoincidence_57") -SketchConstraintDistance_6 = Sketch_3.setDistance(SketchLine_21.endPoint(), SketchLine_33.result(), 3, True) -SketchConstraintDistance_7 = Sketch_3.setDistance(SketchLine_33.endPoint(), SketchLine_32.result(), 3, True) -SketchConstraintDistance_8 = Sketch_3.setDistance(SketchLine_32.endPoint(), SketchLine_31.result(), 1.5, True) -SketchConstraintDistance_9 = Sketch_3.setDistance(SketchLine_31.endPoint(), SketchLine_30.result(), 1.5, True) -SketchConstraintCoincidence_55 = Sketch_3.setCoincident(SketchLine_33.endPoint(), SketchLine_21.result()) -SketchConstraintCoincidence_55.setName("SketchConstraintCoincidence_58") -SketchConstraintMirror_2_objects = [SketchLine_33.result(), SketchLine_32.result(), SketchLine_31.result(), SketchLine_30.result()] -SketchConstraintMirror_2 = Sketch_3.addMirror(SketchLine_24.result(), SketchConstraintMirror_2_objects) -[SketchLine_35, SketchLine_36, SketchLine_37, SketchLine_38] = SketchConstraintMirror_2.mirrored() -SketchLine_38.setName("SketchLine_39") -SketchLine_38.result().setName("SketchLine_39") -SketchLine_37.setName("SketchLine_38") -SketchLine_37.result().setName("SketchLine_38") -SketchLine_36.setName("SketchLine_37") -SketchLine_36.result().setName("SketchLine_37") -SketchLine_35.setName("SketchLine_36") -SketchLine_35.result().setName("SketchLine_36") +SketchConstraintCoincidence_33 = Sketch_3.setCoincident(SketchPoint_3.coordinates(), SketchLine_21.result()) +SketchConstraintCoincidence_33.setName("SketchConstraintCoincidence_37") +SketchConstraintCoincidence_34 = Sketch_3.setCoincident(SketchPoint_3.coordinates(), SketchLine_23.result()) +SketchConstraintCoincidence_34.setName("SketchConstraintCoincidence_38") +SketchConstraintMiddle_3 = Sketch_3.setMiddlePoint(SketchPoint_3.coordinates(), SketchLine_21.result()) +SketchLine_24 = Sketch_3.addLine(-1.5, -2, -1.5, 2) +SketchLine_24.setName("SketchLine_26") +SketchLine_24.result().setName("SketchLine_26") +SketchLine_24.setAuxiliary(True) +SketchConstraintCoincidence_35 = Sketch_3.setCoincident(SketchLine_20.startPoint(), SketchLine_24.startPoint()) +SketchConstraintCoincidence_35.setName("SketchConstraintCoincidence_39") +SketchConstraintCoincidence_36 = Sketch_3.setCoincident(SketchLine_22.endPoint(), SketchLine_24.endPoint()) +SketchConstraintCoincidence_36.setName("SketchConstraintCoincidence_40") +SketchProjection_8 = Sketch_3.addProjection(model.selection("VERTEX", "Sketch_2/SketchLine_10_EndVertex"), False) +SketchPoint_4 = SketchProjection_8.createdFeature() +SketchConstraintCoincidence_37 = Sketch_3.setCoincident(SketchAPI_Point(SketchPoint_4).coordinates(), SketchLine_24.result()) +SketchConstraintCoincidence_37.setName("SketchConstraintCoincidence_41") +SketchConstraintLength_8 = Sketch_3.setLength(SketchLine_24.result(), 4) +SketchProjection_9 = Sketch_3.addProjection(model.selection("VERTEX", "Sketch_2/SketchLine_10_StartVertex"), False) +SketchPoint_5 = SketchProjection_9.createdFeature() +SketchConstraintDistance_3 = Sketch_3.setDistance(SketchAPI_Point(SketchPoint_5).coordinates(), SketchLine_21.result(), 0.5, True) +SketchLine_25 = Sketch_3.addLine(-7.5, -7.382311001750988e-22, -7.5, -3) +SketchLine_25.setName("SketchLine_27") +SketchLine_25.result().setName("SketchLine_27") +SketchConstraintVertical_5 = Sketch_3.setVertical(SketchLine_25.result()) +SketchConstraintCoincidence_38 = Sketch_3.setCoincident(SketchLine_25.startPoint(), SketchLine_15.result()) +SketchConstraintCoincidence_38.setName("SketchConstraintCoincidence_42") +SketchConstraintCoincidence_39 = Sketch_3.setCoincident(SketchLine_25.endPoint(), SketchLine_17.result()) +SketchConstraintCoincidence_39.setName("SketchConstraintCoincidence_43") +SketchLine_26 = Sketch_3.addLine(-7.5, -7.382311001750988e-22, -2.500000000000019, -5.187200122832181e-16) +SketchLine_26.setName("SketchLine_28") +SketchLine_26.result().setName("SketchLine_28") +SketchConstraintCoincidence_40 = Sketch_3.setCoincident(SketchLine_25.startPoint(), SketchLine_26.startPoint()) +SketchConstraintCoincidence_40.setName("SketchConstraintCoincidence_44") +SketchConstraintCoincidence_41 = Sketch_3.setCoincident(SketchLine_26.endPoint(), SketchArc_2.results()[1]) +SketchConstraintCoincidence_41.setName("SketchConstraintCoincidence_45") +SketchConstraintHorizontal_5 = Sketch_3.setHorizontal(SketchLine_26.result()) +SketchConstraintDistance_4 = Sketch_3.setDistance(SketchLine_16.startPoint(), SketchLine_25.result(), 2.5, True) +SketchLine_27 = Sketch_3.addLine(2, 0, 11, 0) +SketchLine_27.setName("SketchLine_29") +SketchLine_27.result().setName("SketchLine_29") +SketchConstraintCoincidence_42 = Sketch_3.setCoincident(SketchPoint_3.coordinates(), SketchLine_27.startPoint()) +SketchConstraintCoincidence_42.setName("SketchConstraintCoincidence_46") +SketchConstraintCoincidence_43 = Sketch_3.setCoincident(SketchLine_27.endPoint(), SketchLine_23.result()) +SketchConstraintCoincidence_43.setName("SketchConstraintCoincidence_47") +SketchLine_28 = Sketch_3.addLine(15, 0, 14, 0) +SketchLine_28.setName("SketchLine_30") +SketchLine_28.result().setName("SketchLine_30") +SketchProjection_10 = Sketch_3.addProjection(model.selection("VERTEX", "[Revolution_1_6/Revolution_1_6&Sketch_1/SketchLine_2]"), False) +SketchPoint_6 = SketchProjection_10.createdFeature() +SketchConstraintCoincidence_44 = Sketch_3.setCoincident(SketchLine_28.startPoint(), SketchPoint_6.result()) +SketchConstraintCoincidence_44.setName("SketchConstraintCoincidence_48") +SketchConstraintCoincidence_45 = Sketch_3.setCoincident(SketchLine_28.endPoint(), SketchLine_23.result()) +SketchConstraintCoincidence_45.setName("SketchConstraintCoincidence_49") +SketchConstraintDistance_5 = Sketch_3.setDistance(SketchLine_27.endPoint(), SketchLine_28.endPoint(), 3, True) +SketchConstraintLength_9 = Sketch_3.setLength(SketchLine_28.result(), 1) +SketchLine_29 = Sketch_3.addLine(11, 0, 11, -2.000000000000004) +SketchLine_29.setName("SketchLine_31") +SketchLine_29.result().setName("SketchLine_31") +SketchConstraintCoincidence_46 = Sketch_3.setCoincident(SketchLine_27.endPoint(), SketchLine_29.startPoint()) +SketchConstraintCoincidence_46.setName("SketchConstraintCoincidence_50") +SketchLine_30 = Sketch_3.addLine(9.500000000000002, 2.627360613063856e-19, 9.5, -2.000000000000004) +SketchLine_30.setName("SketchLine_32") +SketchLine_30.result().setName("SketchLine_32") +SketchConstraintCoincidence_47 = Sketch_3.setCoincident(SketchLine_30.startPoint(), SketchLine_27.result()) +SketchConstraintCoincidence_47.setName("SketchConstraintCoincidence_51") +SketchLine_31 = Sketch_3.addLine(8, -1.882265929199326e-20, 8, -2.000000000000004) +SketchLine_31.setName("SketchLine_33") +SketchLine_31.result().setName("SketchLine_33") +SketchConstraintCoincidence_48 = Sketch_3.setCoincident(SketchLine_31.startPoint(), SketchLine_27.result()) +SketchConstraintCoincidence_48.setName("SketchConstraintCoincidence_52") +SketchLine_32 = Sketch_3.addLine(5, -3.396138881322731e-22, 5, -2.000000000000004) +SketchLine_32.setName("SketchLine_34") +SketchLine_32.result().setName("SketchLine_34") +SketchConstraintCoincidence_49 = Sketch_3.setCoincident(SketchLine_32.startPoint(), SketchLine_27.result()) +SketchConstraintCoincidence_49.setName("SketchConstraintCoincidence_53") +SketchLine_33 = Sketch_3.addLine(5, -2.000000000000004, 11, -2.000000000000004) +SketchLine_33.setName("SketchLine_35") +SketchLine_33.result().setName("SketchLine_35") +SketchLine_33.setAuxiliary(True) +SketchConstraintCoincidence_50 = Sketch_3.setCoincident(SketchLine_32.endPoint(), SketchLine_33.startPoint()) +SketchConstraintCoincidence_50.setName("SketchConstraintCoincidence_54") +SketchConstraintCoincidence_51 = Sketch_3.setCoincident(SketchLine_29.endPoint(), SketchLine_33.endPoint()) +SketchConstraintCoincidence_51.setName("SketchConstraintCoincidence_55") +SketchConstraintVertical_6 = Sketch_3.setVertical(SketchLine_32.result()) +SketchConstraintVertical_7 = Sketch_3.setVertical(SketchLine_31.result()) +SketchConstraintVertical_8 = Sketch_3.setVertical(SketchLine_30.result()) +SketchConstraintHorizontal_6 = Sketch_3.setHorizontal(SketchLine_33.result()) +SketchConstraintCoincidence_52 = Sketch_3.setCoincident(SketchLine_31.endPoint(), SketchLine_33.result()) +SketchConstraintCoincidence_52.setName("SketchConstraintCoincidence_56") +SketchConstraintCoincidence_53 = Sketch_3.setCoincident(SketchLine_30.endPoint(), SketchLine_33.result()) +SketchConstraintCoincidence_53.setName("SketchConstraintCoincidence_57") +SketchConstraintDistance_6 = Sketch_3.setDistance(SketchLine_20.endPoint(), SketchLine_32.result(), 3, True) +SketchConstraintDistance_7 = Sketch_3.setDistance(SketchLine_32.endPoint(), SketchLine_31.result(), 3, True) +SketchConstraintDistance_8 = Sketch_3.setDistance(SketchLine_31.endPoint(), SketchLine_30.result(), 1.5, True) +SketchConstraintDistance_9 = Sketch_3.setDistance(SketchLine_30.endPoint(), SketchLine_29.result(), 1.5, True) +SketchConstraintCoincidence_54 = Sketch_3.setCoincident(SketchLine_32.endPoint(), SketchLine_20.result()) +SketchConstraintCoincidence_54.setName("SketchConstraintCoincidence_58") +SketchConstraintMirror_2_objects = [SketchLine_32.result(), SketchLine_31.result(), SketchLine_30.result(), SketchLine_29.result()] +SketchConstraintMirror_2 = Sketch_3.addMirror(SketchLine_23.result(), SketchConstraintMirror_2_objects) +[SketchLine_34, SketchLine_35, SketchLine_36, SketchLine_37] = SketchConstraintMirror_2.mirrored() +SketchLine_37.setName("SketchLine_39") +SketchLine_37.result().setName("SketchLine_39") +SketchLine_36.setName("SketchLine_38") +SketchLine_36.result().setName("SketchLine_38") +SketchLine_35.setName("SketchLine_37") +SketchLine_35.result().setName("SketchLine_37") +SketchLine_34.setName("SketchLine_36") +SketchLine_34.result().setName("SketchLine_36") +model.do() +model.do() model.end() assert(model.checkPythonDump()) diff --git a/src/FeaturesPlugin/Test/Test2520.py b/src/FeaturesPlugin/Test/Test2520.py index 206998deb..c6aa13dd7 100644 --- a/src/FeaturesPlugin/Test/Test2520.py +++ b/src/FeaturesPlugin/Test/Test2520.py @@ -29,7 +29,7 @@ partSet = model.moduleDocument() Part_1 = model.addPart(partSet) Part_1_doc = Part_1.document() Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY")) -SketchLine_1 = Sketch_1.addLine(7.823413936076148e-032, 6, 18, 6) +SketchLine_1 = Sketch_1.addLine(7.823413936076148e-32, 6, 18, 6) SketchLine_2 = Sketch_1.addLine(18, 6, 18, 10) SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchLine_2.startPoint()) SketchLine_3 = Sketch_1.addLine(18, 10, 63, 10) @@ -46,11 +46,11 @@ SketchLine_8 = Sketch_1.addLine(70, 18, 70, 6.999999999999999) SketchConstraintCoincidence_7 = Sketch_1.setCoincident(SketchLine_7.endPoint(), SketchLine_8.startPoint()) SketchLine_9 = Sketch_1.addLine(70, 6.999999999999999, 38, 6.999999999999999) SketchConstraintCoincidence_8 = Sketch_1.setCoincident(SketchLine_8.endPoint(), SketchLine_9.startPoint()) -SketchLine_10 = Sketch_1.addLine(38, 6.999999999999999, 34, 1.232595164407831e-032) +SketchLine_10 = Sketch_1.addLine(38, 6.999999999999999, 34, 1.232595164407831e-32) SketchConstraintCoincidence_9 = Sketch_1.setCoincident(SketchLine_9.endPoint(), SketchLine_10.startPoint()) -SketchLine_11 = Sketch_1.addLine(34, 1.232595164407831e-032, 7.823413936076148e-032, 1.232595164407831e-032) +SketchLine_11 = Sketch_1.addLine(34, 1.232595164407831e-32, 7.823413936076148e-32, 1.232595164407831e-32) SketchConstraintCoincidence_10 = Sketch_1.setCoincident(SketchLine_10.endPoint(), SketchLine_11.startPoint()) -SketchLine_12 = Sketch_1.addLine(7.823413936076148e-032, 1.232595164407831e-032, 7.823413936076148e-032, 6) +SketchLine_12 = Sketch_1.addLine(7.823413936076148e-32, 1.232595164407831e-32, 7.823413936076148e-32, 6) SketchConstraintCoincidence_11 = Sketch_1.setCoincident(SketchLine_11.endPoint(), SketchLine_12.startPoint()) SketchConstraintCoincidence_12 = Sketch_1.setCoincident(SketchLine_1.startPoint(), SketchLine_12.endPoint()) SketchConstraintHorizontal_1 = Sketch_1.setHorizontal(SketchLine_11.result()) diff --git a/src/FeaturesPlugin/Test/Test2545.py b/src/FeaturesPlugin/Test/Test2545.py index dcc1b884c..1400e32c9 100644 --- a/src/FeaturesPlugin/Test/Test2545.py +++ b/src/FeaturesPlugin/Test/Test2545.py @@ -1,4 +1,4 @@ -## Copyright (C) 2018-20xx CEA/DEN, EDF R&D +## Copyright (C) 2014-2017 CEA/DEN, EDF R&D ## ## This library is free software; you can redistribute it and/or ## modify it under the terms of the GNU Lesser General Public @@ -18,6 +18,8 @@ ## email : webmaster.salome@opencascade.com ## +# -*- coding: utf-8 -*- + from salome.shaper import model import math @@ -30,7 +32,7 @@ Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY")) SketchArc_1 = Sketch_1.addArc(-47.73523320343703, -72.31551328948351, 43.26553250145439, -30.85636904935887, -50.76060275488791, 27.63871192924931, False) SketchConstraintRadius_1 = Sketch_1.setRadius(SketchArc_1.results()[1], "R") model.do() -Edge_1 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_1/Edge-SketchArc_1_2")]) +Edge_1 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_1/SketchArc_1_2")]) model.do() radius = model.measureRadius(Part_1_doc, model.selection("EDGE", "Edge_1_1")) diff --git a/src/FeaturesPlugin/Test/Test2588.py b/src/FeaturesPlugin/Test/Test2588.py index b0a4da97f..29eed9c90 100644 --- a/src/FeaturesPlugin/Test/Test2588.py +++ b/src/FeaturesPlugin/Test/Test2588.py @@ -18,6 +18,8 @@ ## email : webmaster.salome@opencascade.com ## +# -*- coding: utf-8 -*- + from SketchAPI import * from salome.shaper import model @@ -33,10 +35,11 @@ SketchPoint_1 = SketchProjection_1.createdFeature() SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchCircle_1.center(), SketchAPI_Point(SketchPoint_1).coordinates()) SketchConstraintRadius_1 = Sketch_1.setRadius(SketchCircle_1.results()[1], 2) model.do() -Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchCircle_1_2f")], model.selection(), 10, 0) -Symmetry_1 = model.addSymmetry(Part_1_doc, [model.selection("COMPOUND", "all-in-Extrusion_1")], model.selection("VERTEX", "Sketch_1/Edge-SketchCircle_1_2__cc"), True) +Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchCircle_1_2r")], model.selection(), 10, 0) +Symmetry_1 = model.addSymmetry(Part_1_doc, [model.selection("COMPOUND", "all-in-Extrusion_1")], model.selection("VERTEX", "Sketch_1/SketchCircle_1_2__cc"), True) LinearCopy_1 = model.addMultiTranslation(Part_1_doc, [model.selection("COMPOUND", "all-in-Symmetry_1")], model.selection("EDGE", "PartSet/OY"), 5, 3) AngularCopy_1 = model.addMultiRotation(Part_1_doc, [model.selection("COMPOUND", "all-in-LinearCopy_1")], model.selection("EDGE", "PartSet/OZ"), 45, 8) +model.do() model.end() from GeomAPI import GeomAPI_Shape diff --git a/src/FeaturesPlugin/Test/Test2592.py b/src/FeaturesPlugin/Test/Test2592.py index d102679c5..66ce2a132 100644 --- a/src/FeaturesPlugin/Test/Test2592.py +++ b/src/FeaturesPlugin/Test/Test2592.py @@ -18,6 +18,8 @@ ## email : webmaster.salome@opencascade.com ## +# -*- coding: utf-8 -*- + from salome.shaper import model model.begin() @@ -25,8 +27,9 @@ partSet = model.moduleDocument() Part_1 = model.addPart(partSet) Part_1_doc = Part_1.document() Box_1 = model.addBox(Part_1_doc, 10, 10, 10) -Symmetry_1 = model.addSymmetry(Part_1_doc, [model.selection("SOLID", "Box_1_1")], model.selection("VERTEX", "Box_1_1/Back&Box_1_1/Left&Box_1_1/Bottom"), True) +Symmetry_1 = model.addSymmetry(Part_1_doc, [model.selection("SOLID", "Box_1_1")], model.selection("VERTEX", "[Box_1_1/Bottom][Box_1_1/Left][Box_1_1/Back]"), True) Symmetry_2 = model.addSymmetry(Part_1_doc, [model.selection("SOLID", "Symmetry_1_1_1")], model.selection("EDGE", "PartSet/OX"), True) +model.do() model.end() # check python dump failed before the bug fix: selection in symmetry 2 changed to the whole symmetry 1 compound diff --git a/src/FeaturesPlugin/Test/Test2596.py b/src/FeaturesPlugin/Test/Test2596.py index 529861ae1..c01c2e3c3 100644 --- a/src/FeaturesPlugin/Test/Test2596.py +++ b/src/FeaturesPlugin/Test/Test2596.py @@ -18,6 +18,8 @@ ## email : webmaster.salome@opencascade.com ## +# -*- coding: utf-8 -*- + from salome.shaper import model model.begin() @@ -41,7 +43,7 @@ SketchConstraintVertical_1 = Sketch_2.setVertical(SketchLine_2.result()) SketchConstraintHorizontal_2 = Sketch_2.setHorizontal(SketchLine_3.result()) SketchConstraintVertical_2 = Sketch_2.setVertical(SketchLine_4.result()) model.do() -Face_1 = model.addFace(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchCircle_1_2f"), model.selection("FACE", "Sketch_2/Face-SketchLine_1f-SketchLine_2f-SketchLine_3f-SketchLine_4f")]) +Face_1 = model.addFace(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchCircle_1_2r"), model.selection("FACE", "Sketch_2/Face-SketchLine_1r-SketchLine_2f-SketchLine_3f-SketchLine_4f")]) Smash_1 = model.addSmash(Part_1_doc, [model.selection("FACE", "Face_1_1")], [model.selection("FACE", "Face_1_2")]) model.testHaveNamingSubshapes(Smash_1, model, Part_1_doc) model.do() diff --git a/src/FeaturesPlugin/Test/Test2631.py b/src/FeaturesPlugin/Test/Test2631.py index a254a0723..f3e679e31 100644 --- a/src/FeaturesPlugin/Test/Test2631.py +++ b/src/FeaturesPlugin/Test/Test2631.py @@ -18,6 +18,8 @@ ## email : webmaster.salome@opencascade.com ## +# -*- coding: utf-8 -*- + from SketchAPI import * from salome.shaper import model @@ -33,18 +35,18 @@ SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_1.endPoint(), model.do() Sketch_2 = model.addSketch(Part_1_doc, model.defaultPlane("XOY")) SketchLine_3 = Sketch_2.addLine(31.90519577166173, 58.11303515552675, 60.012153951459, 58.11303515552675) -SketchProjection_1 = Sketch_2.addProjection(model.selection("EDGE", "Sketch_1/Edge-SketchLine_1"), False) +SketchProjection_1 = Sketch_2.addProjection(model.selection("EDGE", "Sketch_1/SketchLine_1"), False) SketchLine_4 = SketchProjection_1.createdFeature() SketchConstraintCoincidence_2 = Sketch_2.setCoincident(SketchLine_3.startPoint(), SketchLine_4.result()) SketchConstraintCoincidence_3 = Sketch_2.setCoincident(SketchAPI_Line(SketchLine_4).endPoint(), SketchLine_3.endPoint()) SketchLine_5 = Sketch_2.addLine(60.012153951459, 58.11303515552675, 60.012153951459, 33.0446670492211) SketchConstraintCoincidence_4 = Sketch_2.setCoincident(SketchLine_3.endPoint(), SketchLine_5.startPoint()) -SketchProjection_2 = Sketch_2.addProjection(model.selection("EDGE", "Sketch_1/Edge-SketchLine_2"), False) +SketchProjection_2 = Sketch_2.addProjection(model.selection("EDGE", "Sketch_1/SketchLine_2"), False) SketchLine_6 = SketchProjection_2.createdFeature() SketchConstraintCoincidence_5 = Sketch_2.setCoincident(SketchLine_5.endPoint(), SketchLine_6.result()) model.do() -Edge_1 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_1/Edge-SketchLine_1"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_2")]) -Edge_2 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_2/Edge-SketchLine_3"), model.selection("EDGE", "Sketch_2/Edge-SketchLine_5")]) +Edge_1 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_1/SketchLine_1"), model.selection("EDGE", "Sketch_1/SketchLine_2")]) +Edge_2 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_2/SketchLine_3"), model.selection("EDGE", "Sketch_2/SketchLine_5")]) Cut_1 = model.addCut(Part_1_doc, [model.selection("EDGE", "Edge_1_1"), model.selection("EDGE", "Edge_1_2")], [model.selection("EDGE", "Edge_2_1"), model.selection("EDGE", "Edge_2_2")]) model.testHaveNamingSubshapes(Cut_1, model, Part_1_doc) model.do() diff --git a/src/FeaturesPlugin/Test/Test2650.py b/src/FeaturesPlugin/Test/Test2650.py index 8d7c256e6..53f6606e5 100644 --- a/src/FeaturesPlugin/Test/Test2650.py +++ b/src/FeaturesPlugin/Test/Test2650.py @@ -18,6 +18,8 @@ ## email : webmaster.salome@opencascade.com ## +# -*- coding: utf-8 -*- + from salome.shaper import model model.begin() @@ -37,7 +39,7 @@ SketchLine_5 = Sketch_2.addLine(64.54729867171925, -32.684941224703, 20.69511709 SketchConstraintCoincidence_3 = Sketch_2.setCoincident(SketchLine_4.endPoint(), SketchLine_5.startPoint()) SketchConstraintCoincidence_4 = Sketch_2.setCoincident(SketchLine_2.startPoint(), SketchLine_5.endPoint()) model.do() -Plane_4 = model.addPlane(Part_1_doc, model.selection("FACE", "PartSet/XOY"), model.selection("VERTEX", "Sketch_1/Vertex-SketchLine_1e")) +Plane_4 = model.addPlane(Part_1_doc, model.selection("FACE", "PartSet/XOY"), model.selection("VERTEX", "Sketch_1/SketchLine_1_EndVertex")) Sketch_3 = model.addSketch(Part_1_doc, model.selection("FACE", "Plane_1")) SketchLine_6 = Sketch_3.addLine(18.78449167586506, 11.40320166178118, 18.60732592394469, -15.47067574876233) SketchLine_7 = Sketch_3.addLine(18.60732592394469, -15.47067574876233, 57.06415928764967, -9.455161348995592) @@ -48,7 +50,7 @@ SketchLine_9 = Sketch_3.addLine(56.5687276408287, 11.2362868340608, 18.784491675 SketchConstraintCoincidence_7 = Sketch_3.setCoincident(SketchLine_8.endPoint(), SketchLine_9.startPoint()) SketchConstraintCoincidence_8 = Sketch_3.setCoincident(SketchLine_6.startPoint(), SketchLine_9.endPoint()) model.do() -Pipe_1 = model.addPipe(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchLine_2r-SketchLine_3r-SketchLine_4r-SketchLine_5r"), model.selection("FACE", "Sketch_3/Face-SketchLine_6f-SketchLine_7f-SketchLine_8f-SketchLine_9f")], model.selection("EDGE", "Sketch_1/Edge-SketchLine_1"), [model.selection("VERTEX", "Sketch_1/Vertex-SketchLine_1s"), model.selection("VERTEX", "Sketch_1/Vertex-SketchLine_1e")]) +Pipe_1 = model.addPipe(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchLine_5r-SketchLine_4r-SketchLine_3r-SketchLine_2r"), model.selection("FACE", "Sketch_3/Face-SketchLine_6r-SketchLine_7f-SketchLine_8f-SketchLine_9f")], model.selection("EDGE", "Sketch_1/SketchLine_1"), [model.selection("VERTEX", "Sketch_1/SketchLine_1_StartVertex"), model.selection("VERTEX", "Sketch_1/SketchLine_1_EndVertex")]) model.do() model.end() diff --git a/src/FeaturesPlugin/Test/TestBoolean.py b/src/FeaturesPlugin/Test/TestBoolean.py index 84c893e42..75015cca8 100644 --- a/src/FeaturesPlugin/Test/TestBoolean.py +++ b/src/FeaturesPlugin/Test/TestBoolean.py @@ -150,9 +150,9 @@ Sketch_2 = model.addSketch(Part_1_doc, model.defaultPlane("XOY")) SketchCircle_2 = Sketch_2.addCircle(-126.929674099485, -2.572898799314, 176.971885556791) model.do() Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchCircle_1_2f"), model.selection("FACE", "Sketch_2/Face-SketchCircle_2_2f")], model.selection(), 10, 0) -Boolean_1 = model.addCommon(Part_1_doc, [model.selection("SOLID", "Extrusion_1_1")], [model.selection("SOLID", "Extrusion_1_2")]) +Common_1 = model.addCommon(Part_1_doc, [model.selection("SOLID", "Extrusion_1_1")], [model.selection("SOLID", "Extrusion_1_2")]) model.end() -assert(len(Boolean_1.results()) > 0) +assert(len(Common_1.results()) > 0) model.begin() partSet = model.moduleDocument() @@ -165,8 +165,8 @@ Sketch_2 = model.addSketch(Part_1_doc, model.defaultPlane("XOY")) SketchCircle_2 = Sketch_2.addCircle(-126.929674099485, -2.572898799314, 176.971885556791) model.do() Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchCircle_1_2f"), model.selection("FACE", "Sketch_2/Face-SketchCircle_2_2f")], model.selection(), 10, 0) -Boolean_1 = model.addSmash(Part_1_doc, [model.selection("SOLID", "Extrusion_1_1")], [model.selection("SOLID", "Extrusion_1_2")]) +Smash_1 = model.addSmash(Part_1_doc, [model.selection("SOLID", "Extrusion_1_1")], [model.selection("SOLID", "Extrusion_1_2")]) model.end() -assert(len(Boolean_1.results()) > 0) +assert(len(Smash_1.results()) > 0) assert(model.checkPythonDump()) diff --git a/src/FeaturesPlugin/Test/TestBooleanCommon_CompSolidCompound_CompSolidCompound.py b/src/FeaturesPlugin/Test/TestBooleanCommon_CompSolidCompound_CompSolidCompound.py index c74354f89..11a62f645 100644 --- a/src/FeaturesPlugin/Test/TestBooleanCommon_CompSolidCompound_CompSolidCompound.py +++ b/src/FeaturesPlugin/Test/TestBooleanCommon_CompSolidCompound_CompSolidCompound.py @@ -18,6 +18,8 @@ ## email : webmaster.salome@opencascade.com ## +# -*- coding: utf-8 -*- + from salome.shaper import model model.begin() diff --git a/src/FeaturesPlugin/Test/TestBooleanCommon_CompSolidCompound_Face.py b/src/FeaturesPlugin/Test/TestBooleanCommon_CompSolidCompound_Face.py index 4ed9772d1..7fa5c0af2 100644 --- a/src/FeaturesPlugin/Test/TestBooleanCommon_CompSolidCompound_Face.py +++ b/src/FeaturesPlugin/Test/TestBooleanCommon_CompSolidCompound_Face.py @@ -18,6 +18,8 @@ ## email : webmaster.salome@opencascade.com ## +# -*- coding: utf-8 -*- + from salome.shaper import model model.begin() @@ -71,7 +73,7 @@ SketchConstraintHorizontal_6 = Sketch_2.setHorizontal(SketchLine_13.result()) SketchConstraintVertical_6 = Sketch_2.setVertical(SketchLine_14.result()) model.do() Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("COMPOUND", "Sketch_1")], model.selection(), 10, 10) -Face_1 = model.addFace(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchLine_11f-SketchLine_12f-SketchLine_13f-SketchLine_14f")]) +Face_1 = model.addFace(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchLine_11r-SketchLine_12f-SketchLine_13f-SketchLine_14f")]) Compound_1 = model.addCompound(Part_1_doc, [model.selection("COMPSOLID", "Extrusion_1_1"), model.selection("COMPSOLID", "Extrusion_1_2")]) Common_1 = model.addCommon(Part_1_doc, [model.selection("FACE", "Face_1_1"), model.selection("COMPOUND", "Compound_1_1")]) model.testHaveNamingSubshapes(Common_1, model, Part_1_doc) diff --git a/src/FeaturesPlugin/Test/TestBooleanCommon_CompSolidCompound_Shell.py b/src/FeaturesPlugin/Test/TestBooleanCommon_CompSolidCompound_Shell.py index 474ee4f0d..fba6de97f 100644 --- a/src/FeaturesPlugin/Test/TestBooleanCommon_CompSolidCompound_Shell.py +++ b/src/FeaturesPlugin/Test/TestBooleanCommon_CompSolidCompound_Shell.py @@ -18,6 +18,8 @@ ## email : webmaster.salome@opencascade.com ## +# -*- coding: utf-8 -*- + from salome.shaper import model model.begin() @@ -75,7 +77,7 @@ SketchConstraintCoincidence_18 = Sketch_2.setCoincident(SketchLine_15.endPoint() model.do() Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("COMPOUND", "Sketch_1")], model.selection(), 10, 10) Compound_1 = model.addCompound(Part_1_doc, [model.selection("COMPSOLID", "Extrusion_1_1"), model.selection("COMPSOLID", "Extrusion_1_2")]) -Shell_1 = model.addShell(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchLine_11f-SketchLine_13f-SketchLine_14f-SketchLine_15f"), model.selection("FACE", "Sketch_2/Face-SketchLine_11f-SketchLine_12f-SketchLine_13f-SketchLine_15r")]) +Shell_1 = model.addShell(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchLine_11r-SketchLine_15f-SketchLine_13f-SketchLine_14f"), model.selection("FACE", "Sketch_2/Face-SketchLine_11r-SketchLine_12f-SketchLine_13f-SketchLine_15r")]) Common_1 = model.addCommon(Part_1_doc, [model.selection("SHELL", "Shell_1_1"), model.selection("COMPOUND", "Compound_1_1")]) model.testHaveNamingSubshapes(Common_1, model, Part_1_doc) model.do() diff --git a/src/FeaturesPlugin/Test/TestBooleanCommon_CompSolid_CompSolid.py b/src/FeaturesPlugin/Test/TestBooleanCommon_CompSolid_CompSolid.py index 30e2a876b..a6ac0b278 100644 --- a/src/FeaturesPlugin/Test/TestBooleanCommon_CompSolid_CompSolid.py +++ b/src/FeaturesPlugin/Test/TestBooleanCommon_CompSolid_CompSolid.py @@ -18,6 +18,8 @@ ## email : webmaster.salome@opencascade.com ## +# -*- coding: utf-8 -*- + from salome.shaper import model model.begin() diff --git a/src/FeaturesPlugin/Test/TestBooleanCommon_CompSolid_Face.py b/src/FeaturesPlugin/Test/TestBooleanCommon_CompSolid_Face.py index 8799458b1..317b8b9ac 100644 --- a/src/FeaturesPlugin/Test/TestBooleanCommon_CompSolid_Face.py +++ b/src/FeaturesPlugin/Test/TestBooleanCommon_CompSolid_Face.py @@ -18,6 +18,8 @@ ## email : webmaster.salome@opencascade.com ## +# -*- coding: utf-8 -*- + from salome.shaper import model model.begin() @@ -56,7 +58,7 @@ SketchConstraintHorizontal_4 = Sketch_2.setHorizontal(SketchLine_8.result()) SketchConstraintVertical_4 = Sketch_2.setVertical(SketchLine_9.result()) model.do() Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("COMPOUND", "Sketch_1")], model.selection(), 10, 10) -Face_1 = model.addFace(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchLine_6f-SketchLine_7f-SketchLine_8f-SketchLine_9f")]) +Face_1 = model.addFace(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchLine_6r-SketchLine_7f-SketchLine_8f-SketchLine_9f")]) Common_1 = model.addCommon(Part_1_doc, [model.selection("FACE", "Face_1_1"), model.selection("COMPSOLID", "Extrusion_1_1")]) model.testHaveNamingSubshapes(Common_1, model, Part_1_doc) model.do() diff --git a/src/FeaturesPlugin/Test/TestBooleanCommon_CompSolid_Shell.py b/src/FeaturesPlugin/Test/TestBooleanCommon_CompSolid_Shell.py index f43929d82..f2d4c518d 100644 --- a/src/FeaturesPlugin/Test/TestBooleanCommon_CompSolid_Shell.py +++ b/src/FeaturesPlugin/Test/TestBooleanCommon_CompSolid_Shell.py @@ -18,6 +18,8 @@ ## email : webmaster.salome@opencascade.com ## +# -*- coding: utf-8 -*- + from salome.shaper import model model.begin() @@ -42,9 +44,9 @@ SketchConstraintCoincidence_5 = Sketch_1.setCoincident(SketchLine_5.startPoint() SketchConstraintCoincidence_6 = Sketch_1.setCoincident(SketchLine_5.endPoint(), SketchLine_3.result()) model.do() Sketch_2 = model.addSketch(Part_1_doc, model.defaultPlane("XOY")) -SketchLine_6 = Sketch_2.addLine(26.29086071781277, 6.827405438264643, 9.220324256871813, 6.827405438264643) -SketchLine_7 = Sketch_2.addLine(9.220324256871813, 6.827405438264643, 9.220324256871813, -3.640935176083419) -SketchLine_8 = Sketch_2.addLine(9.220324256871813, -3.640935176083419, 26.29086071781277, -3.640935176083419) +SketchLine_6 = Sketch_2.addLine(26.29086071781277, 6.827405438264643, 9.220324256871812, 6.827405438264643) +SketchLine_7 = Sketch_2.addLine(9.220324256871812, 6.827405438264643, 9.220324256871812, -3.640935176083419) +SketchLine_8 = Sketch_2.addLine(9.220324256871812, -3.640935176083419, 26.29086071781277, -3.640935176083419) SketchLine_9 = Sketch_2.addLine(26.29086071781277, -3.640935176083419, 26.29086071781277, 6.827405438264643) SketchConstraintCoincidence_7 = Sketch_2.setCoincident(SketchLine_9.endPoint(), SketchLine_6.startPoint()) SketchConstraintCoincidence_8 = Sketch_2.setCoincident(SketchLine_6.endPoint(), SketchLine_7.startPoint()) @@ -59,7 +61,7 @@ SketchConstraintCoincidence_11 = Sketch_2.setCoincident(SketchLine_10.startPoint SketchConstraintCoincidence_12 = Sketch_2.setCoincident(SketchLine_10.endPoint(), SketchLine_8.result()) model.do() Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("COMPOUND", "Sketch_1")], model.selection(), 10, 10) -Shell_1 = model.addShell(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchLine_6f-SketchLine_7f-SketchLine_8f-SketchLine_10r"), model.selection("FACE", "Sketch_2/Face-SketchLine_6f-SketchLine_8f-SketchLine_9f-SketchLine_10f")]) +Shell_1 = model.addShell(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchLine_6r-SketchLine_7f-SketchLine_8f-SketchLine_10r"), model.selection("FACE", "Sketch_2/Face-SketchLine_6r-SketchLine_10f-SketchLine_8f-SketchLine_9f")]) Common_1 = model.addCommon(Part_1_doc, [model.selection("SHELL", "Shell_1_1"), model.selection("COMPSOLID", "Extrusion_1_1")]) model.testHaveNamingSubshapes(Common_1, model, Part_1_doc) model.do() diff --git a/src/FeaturesPlugin/Test/TestBooleanCommon_EdgeCompound_EdgeCompound.py b/src/FeaturesPlugin/Test/TestBooleanCommon_EdgeCompound_EdgeCompound.py index ad29cd18d..ac4c913fd 100644 --- a/src/FeaturesPlugin/Test/TestBooleanCommon_EdgeCompound_EdgeCompound.py +++ b/src/FeaturesPlugin/Test/TestBooleanCommon_EdgeCompound_EdgeCompound.py @@ -18,6 +18,8 @@ ## email : webmaster.salome@opencascade.com ## +# -*- coding: utf-8 -*- + from salome.shaper import model model.begin() @@ -34,8 +36,8 @@ SketchLine_4 = Sketch_1.addLine(31.27467463593981, 24.52070441885453, 55.1316738 SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchLine_4.startPoint(), SketchLine_3.result()) SketchConstraintCoincidence_4 = Sketch_1.setCoincident(SketchLine_4.endPoint(), SketchLine_3.result()) model.do() -Edge_1 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_1/Edge-SketchLine_1"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_2")]) -Edge_2 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_1/Edge-SketchLine_4"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_3")]) +Edge_1 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_1/SketchLine_1"), model.selection("EDGE", "Sketch_1/SketchLine_2")]) +Edge_2 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_1/SketchLine_4"), model.selection("EDGE", "Sketch_1/SketchLine_3")]) Compound_1 = model.addCompound(Part_1_doc, [model.selection("EDGE", "Edge_1_1"), model.selection("EDGE", "Edge_2_2")]) Compound_2 = model.addCompound(Part_1_doc, [model.selection("EDGE", "Edge_1_2"), model.selection("EDGE", "Edge_2_1")]) Common_1 = model.addCommon(Part_1_doc, [model.selection("COMPOUND", "Compound_1_1"), model.selection("COMPOUND", "Compound_2_1")]) diff --git a/src/FeaturesPlugin/Test/TestBooleanCommon_Edge_Edge.py b/src/FeaturesPlugin/Test/TestBooleanCommon_Edge_Edge.py index 69b8e39f8..edee7c4f8 100644 --- a/src/FeaturesPlugin/Test/TestBooleanCommon_Edge_Edge.py +++ b/src/FeaturesPlugin/Test/TestBooleanCommon_Edge_Edge.py @@ -18,6 +18,8 @@ ## email : webmaster.salome@opencascade.com ## +# -*- coding: utf-8 -*- + from salome.shaper import model model.begin() @@ -30,7 +32,7 @@ SketchLine_2 = Sketch_1.addLine(-81.47249047471176, -8.020952206935315, 40.54932 SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_2.startPoint(), SketchLine_1.result()) SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchLine_2.endPoint()) model.do() -Edge_1 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_1/Edge-SketchLine_2"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_1")]) +Edge_1 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_1/SketchLine_2"), model.selection("EDGE", "Sketch_1/SketchLine_1")]) Common_1 = model.addCommon(Part_1_doc, [model.selection("EDGE", "Edge_1_1"), model.selection("EDGE", "Edge_1_2")]) model.testHaveNamingSubshapes(Common_1, model, Part_1_doc) model.do() diff --git a/src/FeaturesPlugin/Test/TestBooleanCommon_FaceCompound_FaceCompound.py b/src/FeaturesPlugin/Test/TestBooleanCommon_FaceCompound_FaceCompound.py index 23195447d..f0dd9175f 100644 --- a/src/FeaturesPlugin/Test/TestBooleanCommon_FaceCompound_FaceCompound.py +++ b/src/FeaturesPlugin/Test/TestBooleanCommon_FaceCompound_FaceCompound.py @@ -18,6 +18,8 @@ ## email : webmaster.salome@opencascade.com ## +# -*- coding: utf-8 -*- + from salome.shaper import model model.begin() @@ -76,8 +78,8 @@ SketchConstraintVertical_7 = Sketch_2.setVertical(SketchLine_14.result()) SketchConstraintHorizontal_8 = Sketch_2.setHorizontal(SketchLine_15.result()) SketchConstraintVertical_8 = Sketch_2.setVertical(SketchLine_16.result()) model.do() -Face_1 = model.addFace(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_1f-SketchLine_2f-SketchLine_3f-SketchLine_4f"), model.selection("FACE", "Sketch_1/Face-SketchLine_5f-SketchLine_6f-SketchLine_7f-SketchLine_8f")]) -Face_2 = model.addFace(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchLine_9f-SketchLine_10f-SketchLine_11f-SketchLine_12f"), model.selection("FACE", "Sketch_2/Face-SketchLine_13f-SketchLine_14f-SketchLine_15f-SketchLine_16f")]) +Face_1 = model.addFace(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_1r-SketchLine_2f-SketchLine_3f-SketchLine_4f"), model.selection("FACE", "Sketch_1/Face-SketchLine_5f-SketchLine_6f-SketchLine_7f-SketchLine_8f")]) +Face_2 = model.addFace(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchLine_9r-SketchLine_10f-SketchLine_11f-SketchLine_12f"), model.selection("FACE", "Sketch_2/Face-SketchLine_13f-SketchLine_14f-SketchLine_15f-SketchLine_16f")]) Compound_1 = model.addCompound(Part_1_doc, [model.selection("FACE", "Face_1_1"), model.selection("FACE", "Face_1_2")]) Compound_2 = model.addCompound(Part_1_doc, [model.selection("FACE", "Face_2_1"), model.selection("FACE", "Face_2_2")]) Common_1 = model.addCommon(Part_1_doc, [model.selection("COMPOUND", "Compound_1_1"), model.selection("COMPOUND", "Compound_2_1")]) diff --git a/src/FeaturesPlugin/Test/TestBooleanCommon_Face_Face.py b/src/FeaturesPlugin/Test/TestBooleanCommon_Face_Face.py index 0c2edd99d..9a6edb525 100644 --- a/src/FeaturesPlugin/Test/TestBooleanCommon_Face_Face.py +++ b/src/FeaturesPlugin/Test/TestBooleanCommon_Face_Face.py @@ -18,6 +18,8 @@ ## email : webmaster.salome@opencascade.com ## +# -*- coding: utf-8 -*- + from salome.shaper import model model.begin() @@ -52,7 +54,7 @@ SketchConstraintVertical_3 = Sketch_2.setVertical(SketchLine_6.result()) SketchConstraintHorizontal_4 = Sketch_2.setHorizontal(SketchLine_7.result()) SketchConstraintVertical_4 = Sketch_2.setVertical(SketchLine_8.result()) model.do() -Face_1 = model.addFace(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_1f-SketchLine_2f-SketchLine_3f-SketchLine_4f"), model.selection("FACE", "Sketch_2/Face-SketchLine_5f-SketchLine_6f-SketchLine_7f-SketchLine_8f")]) +Face_1 = model.addFace(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_1r-SketchLine_2f-SketchLine_3f-SketchLine_4f"), model.selection("FACE", "Sketch_2/Face-SketchLine_5r-SketchLine_6f-SketchLine_7f-SketchLine_8f")]) Common_1 = model.addCommon(Part_1_doc, [model.selection("FACE", "Face_1_1"), model.selection("FACE", "Face_1_2")]) model.testHaveNamingSubshapes(Common_1, model, Part_1_doc) model.do() diff --git a/src/FeaturesPlugin/Test/TestBooleanCommon_ShellCompound_ShellCompound.py b/src/FeaturesPlugin/Test/TestBooleanCommon_ShellCompound_ShellCompound.py index 8cb5b9078..6e6060d4c 100644 --- a/src/FeaturesPlugin/Test/TestBooleanCommon_ShellCompound_ShellCompound.py +++ b/src/FeaturesPlugin/Test/TestBooleanCommon_ShellCompound_ShellCompound.py @@ -18,6 +18,8 @@ ## email : webmaster.salome@opencascade.com ## +# -*- coding: utf-8 -*- + from salome.shaper import model model.begin() @@ -88,9 +90,9 @@ SketchLine_20 = Sketch_2.addLine(62.43123950606181, 3.491482965931855, 86.073169 SketchConstraintCoincidence_23 = Sketch_2.setCoincident(SketchLine_20.startPoint(), SketchLine_17.result()) SketchConstraintCoincidence_24 = Sketch_2.setCoincident(SketchLine_20.endPoint(), SketchLine_19.result()) model.do() -Shell_1_objects = [model.selection("FACE", "Sketch_1/Face-SketchLine_1f-SketchLine_2f-SketchLine_3f-SketchLine_9r"), model.selection("FACE", "Sketch_1/Face-SketchLine_1f-SketchLine_3f-SketchLine_4f-SketchLine_9f"), model.selection("FACE", "Sketch_1/Face-SketchLine_5f-SketchLine_6f-SketchLine_7f-SketchLine_10f"), model.selection("FACE", "Sketch_1/Face-SketchLine_5f-SketchLine_7f-SketchLine_8f-SketchLine_10r")] +Shell_1_objects = [model.selection("FACE", "Sketch_1/Face-SketchLine_1r-SketchLine_2f-SketchLine_3f-SketchLine_9r"), model.selection("FACE", "Sketch_1/Face-SketchLine_1r-SketchLine_9f-SketchLine_3f-SketchLine_4f"), model.selection("FACE", "Sketch_1/Face-SketchLine_5f-SketchLine_6f-SketchLine_7f-SketchLine_10f"), model.selection("FACE", "Sketch_1/Face-SketchLine_5f-SketchLine_10r-SketchLine_7f-SketchLine_8f")] Shell_1 = model.addShell(Part_1_doc, Shell_1_objects) -Shell_2_objects = [model.selection("FACE", "Sketch_2/Face-SketchLine_11f-SketchLine_12f-SketchLine_14f-SketchLine_15f"), model.selection("FACE", "Sketch_2/Face-SketchLine_12f-SketchLine_13f-SketchLine_14f-SketchLine_15r"), model.selection("FACE", "Sketch_2/Face-SketchLine_16f-SketchLine_17f-SketchLine_19f-SketchLine_20f"), model.selection("FACE", "Sketch_2/Face-SketchLine_17f-SketchLine_18f-SketchLine_19f-SketchLine_20r")] +Shell_2_objects = [model.selection("FACE", "Sketch_2/Face-SketchLine_11r-SketchLine_12f-SketchLine_15f-SketchLine_14f"), model.selection("FACE", "Sketch_2/Face-SketchLine_12f-SketchLine_13f-SketchLine_14f-SketchLine_15r"), model.selection("FACE", "Sketch_2/Face-SketchLine_16f-SketchLine_17f-SketchLine_20f-SketchLine_19f"), model.selection("FACE", "Sketch_2/Face-SketchLine_17f-SketchLine_18f-SketchLine_19f-SketchLine_20r")] Shell_2 = model.addShell(Part_1_doc, Shell_2_objects) Compound_1 = model.addCompound(Part_1_doc, [model.selection("SHELL", "Shell_1_1"), model.selection("SHELL", "Shell_1_2")]) Compound_2 = model.addCompound(Part_1_doc, [model.selection("SHELL", "Shell_2_1"), model.selection("SHELL", "Shell_2_2")]) diff --git a/src/FeaturesPlugin/Test/TestBooleanCommon_Shell_Shell.py b/src/FeaturesPlugin/Test/TestBooleanCommon_Shell_Shell.py index 5930b955e..e552c0000 100644 --- a/src/FeaturesPlugin/Test/TestBooleanCommon_Shell_Shell.py +++ b/src/FeaturesPlugin/Test/TestBooleanCommon_Shell_Shell.py @@ -18,6 +18,8 @@ ## email : webmaster.salome@opencascade.com ## +# -*- coding: utf-8 -*- + from salome.shaper import model model.begin() @@ -58,8 +60,8 @@ SketchLine_10 = Sketch_2.addLine(-61.96570844393754, -12.80210420841683, -27.699 SketchConstraintCoincidence_11 = Sketch_2.setCoincident(SketchLine_10.startPoint(), SketchLine_7.result()) SketchConstraintCoincidence_12 = Sketch_2.setCoincident(SketchLine_10.endPoint(), SketchLine_9.result()) model.do() -Shell_1 = model.addShell(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_1f-SketchLine_2f-SketchLine_3f-SketchLine_5r"), model.selection("FACE", "Sketch_1/Face-SketchLine_1f-SketchLine_3f-SketchLine_4f-SketchLine_5f")]) -Shell_2 = model.addShell(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchLine_7r-SketchLine_8r-SketchLine_9r-SketchLine_10f"), model.selection("FACE", "Sketch_2/Face-SketchLine_6r-SketchLine_7r-SketchLine_9r-SketchLine_10r")]) +Shell_1 = model.addShell(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_1r-SketchLine_2f-SketchLine_3f-SketchLine_5r"), model.selection("FACE", "Sketch_1/Face-SketchLine_1r-SketchLine_5f-SketchLine_3f-SketchLine_4f")]) +Shell_2 = model.addShell(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchLine_10f-SketchLine_9r-SketchLine_8r-SketchLine_7r"), model.selection("FACE", "Sketch_2/Face-SketchLine_9r-SketchLine_10r-SketchLine_7r-SketchLine_6r")]) Common_1 = model.addCommon(Part_1_doc, [model.selection("SHELL", "Shell_1_1"), model.selection("SHELL", "Shell_2_1")]) model.testHaveNamingSubshapes(Common_1, model, Part_1_doc) model.do() diff --git a/src/FeaturesPlugin/Test/TestBooleanCommon_SolidCompound_Face.py b/src/FeaturesPlugin/Test/TestBooleanCommon_SolidCompound_Face.py index 29b3e9109..38b7a13cb 100644 --- a/src/FeaturesPlugin/Test/TestBooleanCommon_SolidCompound_Face.py +++ b/src/FeaturesPlugin/Test/TestBooleanCommon_SolidCompound_Face.py @@ -18,6 +18,8 @@ ## email : webmaster.salome@opencascade.com ## +# -*- coding: utf-8 -*- + from salome.shaper import model model.begin() @@ -65,8 +67,8 @@ SketchConstraintVertical_5 = Sketch_2.setVertical(SketchLine_10.result()) SketchConstraintHorizontal_6 = Sketch_2.setHorizontal(SketchLine_11.result()) SketchConstraintVertical_6 = Sketch_2.setVertical(SketchLine_12.result()) model.do() -Face_1 = model.addFace(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchLine_9f-SketchLine_10f-SketchLine_11f-SketchLine_12f")]) -Compound_1 = model.addCompound(Part_1_doc, [model.selection("SOLID", "Extrusion_1_1"), model.selection("SOLID", "Extrusion_1_2")]) +Face_1 = model.addFace(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchLine_9r-SketchLine_10f-SketchLine_11f-SketchLine_12f")]) +Compound_1 = model.addCompound(Part_1_doc, [model.selection("SOLID", "Extrusion_1_2"), model.selection("SOLID", "Extrusion_1_1")]) Common_1 = model.addCommon(Part_1_doc, [model.selection("FACE", "Face_1_1"), model.selection("COMPOUND", "Compound_1_1")]) model.testHaveNamingSubshapes(Common_1, model, Part_1_doc) model.do() diff --git a/src/FeaturesPlugin/Test/TestBooleanCommon_SolidCompound_Shell.py b/src/FeaturesPlugin/Test/TestBooleanCommon_SolidCompound_Shell.py index 7435166fd..6335dcd9d 100644 --- a/src/FeaturesPlugin/Test/TestBooleanCommon_SolidCompound_Shell.py +++ b/src/FeaturesPlugin/Test/TestBooleanCommon_SolidCompound_Shell.py @@ -18,6 +18,8 @@ ## email : webmaster.salome@opencascade.com ## +# -*- coding: utf-8 -*- + from salome.shaper import model model.begin() @@ -68,7 +70,7 @@ SketchConstraintCoincidence_15 = Sketch_2.setCoincident(SketchLine_13.endPoint() SketchConstraintCoincidence_16 = Sketch_2.setCoincident(SketchLine_10.endPoint(), SketchLine_15.endPoint()) model.do() Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("COMPOUND", "Sketch_1")], model.selection(), 10, 10) -Shell_1 = model.addShell(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchLine_9r-SketchLine_10r-SketchLine_14r-SketchLine_15f"), model.selection("FACE", "Sketch_2/Face-SketchLine_11r-SketchLine_12r-SketchLine_13r-SketchLine_15r")]) +Shell_1 = model.addShell(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchLine_14r-SketchLine_15f-SketchLine_10r-SketchLine_9r"), model.selection("FACE", "Sketch_2/Face-SketchLine_15r-SketchLine_13r-SketchLine_12r-SketchLine_11r")]) Compound_1 = model.addCompound(Part_1_doc, [model.selection("SOLID", "Extrusion_1_1"), model.selection("SOLID", "Extrusion_1_2")]) Common_1 = model.addCommon(Part_1_doc, [model.selection("SHELL", "Shell_1_1"), model.selection("COMPOUND", "Compound_1_1")]) model.testHaveNamingSubshapes(Common_1, model, Part_1_doc) diff --git a/src/FeaturesPlugin/Test/TestBooleanCommon_SolidCompound_SolidCompound.py b/src/FeaturesPlugin/Test/TestBooleanCommon_SolidCompound_SolidCompound.py index 37bf47049..eb65219ec 100644 --- a/src/FeaturesPlugin/Test/TestBooleanCommon_SolidCompound_SolidCompound.py +++ b/src/FeaturesPlugin/Test/TestBooleanCommon_SolidCompound_SolidCompound.py @@ -18,6 +18,8 @@ ## email : webmaster.salome@opencascade.com ## +# -*- coding: utf-8 -*- + from salome.shaper import model model.begin() diff --git a/src/FeaturesPlugin/Test/TestBooleanCommon_Solid_Face.py b/src/FeaturesPlugin/Test/TestBooleanCommon_Solid_Face.py index 36cee473d..ce3da4b77 100644 --- a/src/FeaturesPlugin/Test/TestBooleanCommon_Solid_Face.py +++ b/src/FeaturesPlugin/Test/TestBooleanCommon_Solid_Face.py @@ -18,6 +18,8 @@ ## email : webmaster.salome@opencascade.com ## +# -*- coding: utf-8 -*- + from salome.shaper import model model.begin() @@ -27,7 +29,7 @@ Part_1_doc = Part_1.document() Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY")) SketchCircle_1 = Sketch_1.addCircle(-19.01903137581643, 2.528314065029049, 44.55011038017909) model.do() -Face_1 = model.addFace(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchCircle_1_2f")]) +Face_1 = model.addFace(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchCircle_1_2r")]) Sphere_1 = model.addSphere(Part_1_doc, model.selection("VERTEX", "PartSet/Origin"), 10) Common_1 = model.addCommon(Part_1_doc, [model.selection("FACE", "Face_1_1"), model.selection("SOLID", "Sphere_1_1")]) model.testHaveNamingSubshapes(Common_1, model, Part_1_doc) diff --git a/src/FeaturesPlugin/Test/TestBooleanCommon_Solid_Shell.py b/src/FeaturesPlugin/Test/TestBooleanCommon_Solid_Shell.py index c9364c2bc..b5ca6b4fb 100644 --- a/src/FeaturesPlugin/Test/TestBooleanCommon_Solid_Shell.py +++ b/src/FeaturesPlugin/Test/TestBooleanCommon_Solid_Shell.py @@ -18,6 +18,8 @@ ## email : webmaster.salome@opencascade.com ## +# -*- coding: utf-8 -*- + from salome.shaper import model model.begin() @@ -41,7 +43,7 @@ SketchLine_5 = Sketch_1.addLine(4.250501002003999, 22.87174348697394, 4.25050100 SketchConstraintCoincidence_5 = Sketch_1.setCoincident(SketchLine_5.startPoint(), SketchLine_1.result()) SketchConstraintCoincidence_6 = Sketch_1.setCoincident(SketchLine_5.endPoint(), SketchLine_3.result()) model.do() -Shell_1 = model.addShell(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_1f-SketchLine_2f-SketchLine_3f-SketchLine_5r"), model.selection("FACE", "Sketch_1/Face-SketchLine_1f-SketchLine_3f-SketchLine_4f-SketchLine_5f")]) +Shell_1 = model.addShell(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_1r-SketchLine_2f-SketchLine_3f-SketchLine_5r"), model.selection("FACE", "Sketch_1/Face-SketchLine_1r-SketchLine_5f-SketchLine_3f-SketchLine_4f")]) Sphere_1 = model.addSphere(Part_1_doc, model.selection("VERTEX", "PartSet/Origin"), 10) Common_1 = model.addCommon(Part_1_doc, [model.selection("SHELL", "Shell_1_1"), model.selection("SOLID", "Sphere_1_1")]) model.testHaveNamingSubshapes(Common_1, model, Part_1_doc) diff --git a/src/FeaturesPlugin/Test/TestBooleanCommon_Solid_Solid.py b/src/FeaturesPlugin/Test/TestBooleanCommon_Solid_Solid.py index cd4fd2ade..9cda92d25 100644 --- a/src/FeaturesPlugin/Test/TestBooleanCommon_Solid_Solid.py +++ b/src/FeaturesPlugin/Test/TestBooleanCommon_Solid_Solid.py @@ -18,6 +18,8 @@ ## email : webmaster.salome@opencascade.com ## +# -*- coding: utf-8 -*- + from salome.shaper import model model.begin() diff --git a/src/FeaturesPlugin/Test/TestBooleanCommon_VertexCompound_VertexCompound.py b/src/FeaturesPlugin/Test/TestBooleanCommon_VertexCompound_VertexCompound.py index e3389a117..99b823f5c 100644 --- a/src/FeaturesPlugin/Test/TestBooleanCommon_VertexCompound_VertexCompound.py +++ b/src/FeaturesPlugin/Test/TestBooleanCommon_VertexCompound_VertexCompound.py @@ -18,6 +18,8 @@ ## email : webmaster.salome@opencascade.com ## +# -*- coding: utf-8 -*- + from salome.shaper import model model.begin() @@ -29,8 +31,8 @@ SketchPoint_1 = Sketch_1.addPoint(-28.13426853707415, 23.27655310621242) SketchPoint_2 = Sketch_1.addPoint(10.32264529058116, 23.27655310621242) SketchPoint_3 = Sketch_1.addPoint(47.56513026052106, 23.27655310621242) model.do() -Vertex_1 = model.addVertex(Part_1_doc, [model.selection("VERTEX", "Sketch_1/Vertex-SketchPoint_1"), model.selection("VERTEX", "Sketch_1/Vertex-SketchPoint_2")]) -Vertex_2 = model.addVertex(Part_1_doc, [model.selection("VERTEX", "Sketch_1/Vertex-SketchPoint_2"), model.selection("VERTEX", "Sketch_1/Vertex-SketchPoint_3")]) +Vertex_1 = model.addVertex(Part_1_doc, [model.selection("VERTEX", "Sketch_1/SketchPoint_1"), model.selection("VERTEX", "Sketch_1/SketchPoint_2")]) +Vertex_2 = model.addVertex(Part_1_doc, [model.selection("VERTEX", "Sketch_1/SketchPoint_2"), model.selection("VERTEX", "Sketch_1/SketchPoint_3")]) Compound_1 = model.addCompound(Part_1_doc, [model.selection("VERTEX", "Vertex_1_1"), model.selection("VERTEX", "Vertex_1_2")]) Compound_2 = model.addCompound(Part_1_doc, [model.selection("VERTEX", "Vertex_2_1"), model.selection("VERTEX", "Vertex_2_2")]) Common_1 = model.addCommon(Part_1_doc, [model.selection("COMPOUND", "Compound_1_1"), model.selection("COMPOUND", "Compound_2_1")]) diff --git a/src/FeaturesPlugin/Test/TestBooleanCommon_Vertex_Vertex.py b/src/FeaturesPlugin/Test/TestBooleanCommon_Vertex_Vertex.py index c89dda3f3..8e18283a2 100644 --- a/src/FeaturesPlugin/Test/TestBooleanCommon_Vertex_Vertex.py +++ b/src/FeaturesPlugin/Test/TestBooleanCommon_Vertex_Vertex.py @@ -18,6 +18,8 @@ ## email : webmaster.salome@opencascade.com ## +# -*- coding: utf-8 -*- + from salome.shaper import model model.begin() @@ -28,16 +30,16 @@ Sketch_1 = model.addSketch(Part_1_doc, model.standardPlane("XOY")) SketchPoint_1 = Sketch_1.addPoint(15.05904629113425, 12.50050543761873) SketchPoint_2 = Sketch_1.addPoint(47.25352258215165, 31.63008715695855) model.do() -Vertex_1 = model.addVertex(Part_1_doc, [model.selection("VERTEX", "Sketch_1/Vertex-SketchPoint_1"), model.selection("VERTEX", "Sketch_1/Vertex-SketchPoint_2")]) +Vertex_1 = model.addVertex(Part_1_doc, [model.selection("VERTEX", "Sketch_1/SketchPoint_1"), model.selection("VERTEX", "Sketch_1/SketchPoint_2")]) Common_1 = model.addCommon(Part_1_doc, [model.selection("VERTEX", "Vertex_1_1"), model.selection("VERTEX", "Vertex_1_2")]) Sketch_2 = model.addSketch(Part_1_doc, model.defaultPlane("XOY")) SketchPoint_3 = Sketch_2.addPoint(15.05904629113425, 12.50050543761873) -SketchProjection_1 = Sketch_2.addProjection(model.selection("VERTEX", "Sketch_1/Vertex-SketchPoint_1"), False) +SketchProjection_1 = Sketch_2.addProjection(model.selection("VERTEX", "Sketch_1/SketchPoint_1"), False) SketchPoint_4 = SketchProjection_1.createdFeature() SketchConstraintCoincidence_1 = Sketch_2.setCoincident(SketchPoint_3.coordinates(), SketchPoint_4.result()) model.do() -Vertex_2 = model.addVertex(Part_1_doc, [model.selection("VERTEX", "Sketch_2/Vertex-SketchPoint_3-SketchProjection_1-SketchPoint_4")]) -Vertex_3 = model.addVertex(Part_1_doc, [model.selection("VERTEX", "Sketch_1/Vertex-SketchPoint_1")]) +Vertex_2 = model.addVertex(Part_1_doc, [model.selection("VERTEX", "Sketch_2/SketchPoint_3")]) +Vertex_3 = model.addVertex(Part_1_doc, [model.selection("VERTEX", "Sketch_1/SketchPoint_1")]) Common_2 = model.addCommon(Part_1_doc, [model.selection("VERTEX", "Vertex_2_1"), model.selection("VERTEX", "Vertex_3_1")]) model.testHaveNamingSubshapes(Common_2, model, Part_1_doc) model.do() diff --git a/src/FeaturesPlugin/Test/TestBooleanCommon_WireCompound_WireCompound.py b/src/FeaturesPlugin/Test/TestBooleanCommon_WireCompound_WireCompound.py index 5d06579a2..ed878934a 100644 --- a/src/FeaturesPlugin/Test/TestBooleanCommon_WireCompound_WireCompound.py +++ b/src/FeaturesPlugin/Test/TestBooleanCommon_WireCompound_WireCompound.py @@ -18,6 +18,8 @@ ## email : webmaster.salome@opencascade.com ## +# -*- coding: utf-8 -*- + from SketchAPI import * from salome.shaper import model @@ -36,30 +38,30 @@ SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchLine_3.endPoint(), model.do() Sketch_2 = model.addSketch(Part_1_doc, model.defaultPlane("XOY")) SketchLine_5 = Sketch_2.addLine(-75.23467769579756, 14.76574658950986, -60.62456998069012, -7.998839850308684) -SketchProjection_1 = Sketch_2.addProjection(model.selection("EDGE", "Sketch_1/Edge-SketchLine_1"), False) +SketchProjection_1 = Sketch_2.addProjection(model.selection("EDGE", "Sketch_1/SketchLine_1"), False) SketchLine_6 = SketchProjection_1.createdFeature() SketchConstraintCoincidence_3 = Sketch_2.setCoincident(SketchLine_5.startPoint(), SketchLine_6.result()) SketchConstraintCoincidence_4 = Sketch_2.setCoincident(SketchAPI_Line(SketchLine_6).endPoint(), SketchLine_5.endPoint()) SketchLine_7 = Sketch_2.addLine(-60.62456998069012, -7.998839850308684, -47.51524103341781, 13.8500417284785) SketchConstraintCoincidence_5 = Sketch_2.setCoincident(SketchLine_5.endPoint(), SketchLine_7.startPoint()) -SketchProjection_2 = Sketch_2.addProjection(model.selection("EDGE", "Sketch_1/Edge-SketchLine_2"), False) +SketchProjection_2 = Sketch_2.addProjection(model.selection("EDGE", "Sketch_1/SketchLine_2"), False) SketchLine_8 = SketchProjection_2.createdFeature() SketchConstraintCoincidence_6 = Sketch_2.setCoincident(SketchLine_7.endPoint(), SketchLine_8.result()) SketchLine_9 = Sketch_2.addLine(35.74952364371219, 12.81217486039606, 47.60078384600371, -9.954719738742909) -SketchProjection_3 = Sketch_2.addProjection(model.selection("EDGE", "Sketch_1/Edge-SketchLine_3"), False) +SketchProjection_3 = Sketch_2.addProjection(model.selection("EDGE", "Sketch_1/SketchLine_3"), False) SketchLine_10 = SketchProjection_3.createdFeature() SketchConstraintCoincidence_7 = Sketch_2.setCoincident(SketchLine_9.startPoint(), SketchLine_10.result()) SketchConstraintCoincidence_8 = Sketch_2.setCoincident(SketchAPI_Line(SketchLine_10).endPoint(), SketchLine_9.endPoint()) SketchLine_11 = Sketch_2.addLine(47.60078384600371, -9.954719738742909, 64.13719888777418, 18.68151118724985) SketchConstraintCoincidence_9 = Sketch_2.setCoincident(SketchLine_9.endPoint(), SketchLine_11.startPoint()) -SketchProjection_4 = Sketch_2.addProjection(model.selection("EDGE", "Sketch_1/Edge-SketchLine_4"), False) +SketchProjection_4 = Sketch_2.addProjection(model.selection("EDGE", "Sketch_1/SketchLine_4"), False) SketchLine_12 = SketchProjection_4.createdFeature() SketchConstraintCoincidence_10 = Sketch_2.setCoincident(SketchLine_11.endPoint(), SketchLine_12.result()) model.do() -Wire_1 = model.addWire(Part_1_doc, [model.selection("EDGE", "Sketch_1/Edge-SketchLine_1"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_2")]) -Wire_2 = model.addWire(Part_1_doc, [model.selection("EDGE", "Sketch_1/Edge-SketchLine_3"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_4")]) -Wire_3 = model.addWire(Part_1_doc, [model.selection("EDGE", "Sketch_2/Edge-SketchLine_5"), model.selection("EDGE", "Sketch_2/Edge-SketchLine_7")]) -Wire_4 = model.addWire(Part_1_doc, [model.selection("EDGE", "Sketch_2/Edge-SketchLine_9"), model.selection("EDGE", "Sketch_2/Edge-SketchLine_11")]) +Wire_1 = model.addWire(Part_1_doc, [model.selection("EDGE", "Sketch_1/SketchLine_1"), model.selection("EDGE", "Sketch_1/SketchLine_2")]) +Wire_2 = model.addWire(Part_1_doc, [model.selection("EDGE", "Sketch_1/SketchLine_3"), model.selection("EDGE", "Sketch_1/SketchLine_4")]) +Wire_3 = model.addWire(Part_1_doc, [model.selection("EDGE", "Sketch_2/SketchLine_5"), model.selection("EDGE", "Sketch_2/SketchLine_7")]) +Wire_4 = model.addWire(Part_1_doc, [model.selection("EDGE", "Sketch_2/SketchLine_9"), model.selection("EDGE", "Sketch_2/SketchLine_11")]) Compound_1 = model.addCompound(Part_1_doc, [model.selection("WIRE", "Wire_1_1"), model.selection("WIRE", "Wire_2_1")]) Compound_2 = model.addCompound(Part_1_doc, [model.selection("WIRE", "Wire_3_1"), model.selection("WIRE", "Wire_4_1")]) Common_1 = model.addCommon(Part_1_doc, [model.selection("COMPOUND", "Compound_1_1"), model.selection("COMPOUND", "Compound_2_1")]) diff --git a/src/FeaturesPlugin/Test/TestBooleanCommon_Wire_Wire.py b/src/FeaturesPlugin/Test/TestBooleanCommon_Wire_Wire.py index 0e802ce83..3ead1bf48 100644 --- a/src/FeaturesPlugin/Test/TestBooleanCommon_Wire_Wire.py +++ b/src/FeaturesPlugin/Test/TestBooleanCommon_Wire_Wire.py @@ -18,6 +18,8 @@ ## email : webmaster.salome@opencascade.com ## +# -*- coding: utf-8 -*- + from SketchAPI import * from salome.shaper import model @@ -33,18 +35,18 @@ SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_1.endPoint(), model.do() Sketch_2 = model.addSketch(Part_1_doc, model.defaultPlane("XOY")) SketchLine_3 = Sketch_2.addLine(-15.313984501828, -1.226571041729713, -1.296213364851965, -18.43019925529121) -SketchProjection_1 = Sketch_2.addProjection(model.selection("EDGE", "Sketch_1/Edge-SketchLine_1"), False) +SketchProjection_1 = Sketch_2.addProjection(model.selection("EDGE", "Sketch_1/SketchLine_1"), False) SketchLine_4 = SketchProjection_1.createdFeature() SketchConstraintCoincidence_2 = Sketch_2.setCoincident(SketchLine_3.startPoint(), SketchLine_4.result()) SketchConstraintCoincidence_3 = Sketch_2.setCoincident(SketchAPI_Line(SketchLine_4).endPoint(), SketchLine_3.endPoint()) SketchLine_5 = Sketch_2.addLine(-1.296213364851965, -18.43019925529121, 20.70651786493702, 7.831125115747244) SketchConstraintCoincidence_4 = Sketch_2.setCoincident(SketchLine_3.endPoint(), SketchLine_5.startPoint()) -SketchProjection_2 = Sketch_2.addProjection(model.selection("EDGE", "Sketch_1/Edge-SketchLine_2"), False) +SketchProjection_2 = Sketch_2.addProjection(model.selection("EDGE", "Sketch_1/SketchLine_2"), False) SketchLine_6 = SketchProjection_2.createdFeature() SketchConstraintCoincidence_5 = Sketch_2.setCoincident(SketchLine_5.endPoint(), SketchLine_6.result()) model.do() -Wire_1 = model.addWire(Part_1_doc, [model.selection("EDGE", "Sketch_1/Edge-SketchLine_1"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_2")]) -Wire_2 = model.addWire(Part_1_doc, [model.selection("EDGE", "Sketch_2/Edge-SketchLine_3"), model.selection("EDGE", "Sketch_2/Edge-SketchLine_5")]) +Wire_1 = model.addWire(Part_1_doc, [model.selection("EDGE", "Sketch_1/SketchLine_1"), model.selection("EDGE", "Sketch_1/SketchLine_2")]) +Wire_2 = model.addWire(Part_1_doc, [model.selection("EDGE", "Sketch_2/SketchLine_3"), model.selection("EDGE", "Sketch_2/SketchLine_5")]) Common_1 = model.addCommon(Part_1_doc, [model.selection("WIRE", "Wire_1_1"), model.selection("WIRE", "Wire_2_1")]) model.testHaveNamingSubshapes(Common_1, model, Part_1_doc) model.do() diff --git a/src/FeaturesPlugin/Test/TestBooleanCut_CompSolidCompound_CompSolidCompound.py b/src/FeaturesPlugin/Test/TestBooleanCut_CompSolidCompound_CompSolidCompound.py index 3df97a612..82f6ceff0 100644 --- a/src/FeaturesPlugin/Test/TestBooleanCut_CompSolidCompound_CompSolidCompound.py +++ b/src/FeaturesPlugin/Test/TestBooleanCut_CompSolidCompound_CompSolidCompound.py @@ -18,6 +18,8 @@ ## email : webmaster.salome@opencascade.com ## +# -*- coding: utf-8 -*- + from salome.shaper import model model.begin() @@ -47,7 +49,7 @@ model.do() Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("COMPOUND", "Sketch_1")], model.selection(), 10, 0) Extrusion_2 = model.addExtrusion(Part_1_doc, [model.selection("COMPOUND", "Sketch_2")], model.selection(), 20, 20) Compound_1 = model.addCompound(Part_1_doc, [model.selection("COMPSOLID", "Extrusion_1_1"), model.selection("COMPSOLID", "Extrusion_1_2")]) -Compound_2 = model.addCompound(Part_1_doc, [model.selection("COMPSOLID", "Extrusion_2_1"), model.selection("COMPSOLID", "Extrusion_2_2")]) +Compound_2 = model.addCompound(Part_1_doc, [model.selection("COMPSOLID", "Extrusion_2_2"), model.selection("COMPSOLID", "Extrusion_2_1")]) Cut_1 = model.addCut(Part_1_doc, [model.selection("COMPOUND", "Compound_1_1")], [model.selection("COMPOUND", "Compound_2_1")]) model.testHaveNamingSubshapes(Cut_1, model, Part_1_doc) model.do() diff --git a/src/FeaturesPlugin/Test/TestBooleanCut_CompSolid_CompSolid.py b/src/FeaturesPlugin/Test/TestBooleanCut_CompSolid_CompSolid.py index 5d20e521f..5328ea5bd 100644 --- a/src/FeaturesPlugin/Test/TestBooleanCut_CompSolid_CompSolid.py +++ b/src/FeaturesPlugin/Test/TestBooleanCut_CompSolid_CompSolid.py @@ -18,6 +18,8 @@ ## email : webmaster.salome@opencascade.com ## +# -*- coding: utf-8 -*- + from salome.shaper import model model.begin() @@ -32,7 +34,7 @@ SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchLine_1.endPoint(), model.do() Sketch_2 = model.addSketch(Part_1_doc, model.defaultPlane("XOY")) SketchCircle_2 = Sketch_2.addCircle(32.08143103297851, 1.286314091165838, 40.2404383217231) -SketchLine_2 = Sketch_2.addLine(-8.153954725266397, 0.6486549270159857, 72.23884334545456, 3.869938036363647) +SketchLine_2 = Sketch_2.addLine(-8.153954725266397, 0.6486549270159857, 72.23884334545455, 3.869938036363647) SketchConstraintCoincidence_3 = Sketch_2.setCoincident(SketchLine_2.startPoint(), SketchCircle_2.results()[1]) SketchConstraintCoincidence_4 = Sketch_2.setCoincident(SketchLine_2.endPoint(), SketchCircle_2.results()[1]) model.do() diff --git a/src/FeaturesPlugin/Test/TestBooleanCut_EdgeCompound_EdgeCompound.py b/src/FeaturesPlugin/Test/TestBooleanCut_EdgeCompound_EdgeCompound.py index 45674c700..1e361757b 100644 --- a/src/FeaturesPlugin/Test/TestBooleanCut_EdgeCompound_EdgeCompound.py +++ b/src/FeaturesPlugin/Test/TestBooleanCut_EdgeCompound_EdgeCompound.py @@ -18,6 +18,8 @@ ## email : webmaster.salome@opencascade.com ## +# -*- coding: utf-8 -*- + from salome.shaper import model model.begin() @@ -30,8 +32,8 @@ SketchLine_2 = Sketch_1.addLine(-13.21145377197118, 31.16583469441819, 14.897138 SketchLine_3 = Sketch_1.addLine(-5.074756009927738, 49.65832960815328, -4.828189411077946, 26.48106931627197) SketchLine_4 = Sketch_1.addLine(7.993273729111718, 49.41176300930348, 8.23984032796152, 26.48106931627197) model.do() -Compound_1 = model.addCompound(Part_1_doc, [model.selection("EDGE", "Sketch_1/Edge-SketchLine_1"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_2")]) -Compound_2 = model.addCompound(Part_1_doc, [model.selection("EDGE", "Sketch_1/Edge-SketchLine_3"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_4")]) +Compound_1 = model.addCompound(Part_1_doc, [model.selection("EDGE", "Sketch_1/SketchLine_1"), model.selection("EDGE", "Sketch_1/SketchLine_2")]) +Compound_2 = model.addCompound(Part_1_doc, [model.selection("EDGE", "Sketch_1/SketchLine_3"), model.selection("EDGE", "Sketch_1/SketchLine_4")]) Cut_1 = model.addCut(Part_1_doc, [model.selection("COMPOUND", "Compound_1_1")], [model.selection("COMPOUND", "Compound_2_1")]) model.testHaveNamingSubshapes(Cut_1, model, Part_1_doc) model.do() diff --git a/src/FeaturesPlugin/Test/TestBooleanCut_EdgeCompound_Solid.py b/src/FeaturesPlugin/Test/TestBooleanCut_EdgeCompound_Solid.py index 9d51ddc1c..0ae1a159f 100644 --- a/src/FeaturesPlugin/Test/TestBooleanCut_EdgeCompound_Solid.py +++ b/src/FeaturesPlugin/Test/TestBooleanCut_EdgeCompound_Solid.py @@ -18,6 +18,8 @@ ## email : webmaster.salome@opencascade.com ## +# -*- coding: utf-8 -*- + from salome.shaper import model model.begin() @@ -28,7 +30,7 @@ Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY")) SketchLine_1 = Sketch_1.addLine(-28.62948623265935, 53.77363153293705, 40.23707952134417, 53.11775947813702) SketchLine_2 = Sketch_1.addLine(-26.66187006825925, 26.22700523133564, 40.89295157614425, 26.22700523133564) model.do() -Compound_1 = model.addCompound(Part_1_doc, [model.selection("EDGE", "Sketch_1/Edge-SketchLine_1"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_2")]) +Compound_1 = model.addCompound(Part_1_doc, [model.selection("EDGE", "Sketch_1/SketchLine_1"), model.selection("EDGE", "Sketch_1/SketchLine_2")]) Extrusion_1 = model.addExtrusion(Part_1_doc, [], model.selection(), 10, 10) Sketch_2 = model.addSketch(Part_1_doc, model.defaultPlane("XOY")) SketchLine_3 = Sketch_2.addLine(14.6580693841429, 60.98822413573743, -10.2650686982584, 60.98822413573743) diff --git a/src/FeaturesPlugin/Test/TestBooleanCut_Edge_Edge.py b/src/FeaturesPlugin/Test/TestBooleanCut_Edge_Edge.py index ccd2c2c30..b7d16f2e6 100644 --- a/src/FeaturesPlugin/Test/TestBooleanCut_Edge_Edge.py +++ b/src/FeaturesPlugin/Test/TestBooleanCut_Edge_Edge.py @@ -18,6 +18,8 @@ ## email : webmaster.salome@opencascade.com ## +# -*- coding: utf-8 -*- + from salome.shaper import model model.begin() @@ -28,7 +30,7 @@ Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY")) SketchLine_1 = Sketch_1.addLine(-25.12006861063466, 20.61578044596912, 27.54545454545454, 58.72898799313897) SketchLine_2 = Sketch_1.addLine(-19.22984562607204, 56.30360205831907, 22.69468267581474, 22.00171526586621) model.do() -Edge_1 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_1/Edge-SketchLine_2"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_1")]) +Edge_1 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_1/SketchLine_2"), model.selection("EDGE", "Sketch_1/SketchLine_1")]) Cut_1 = model.addCut(Part_1_doc, [model.selection("EDGE", "Edge_1_1")], [model.selection("EDGE", "Edge_1_2")]) model.testHaveNamingSubshapes(Cut_1, model, Part_1_doc) model.do() diff --git a/src/FeaturesPlugin/Test/TestBooleanCut_Edge_Face.py b/src/FeaturesPlugin/Test/TestBooleanCut_Edge_Face.py index 5e8d25fe1..528c77740 100644 --- a/src/FeaturesPlugin/Test/TestBooleanCut_Edge_Face.py +++ b/src/FeaturesPlugin/Test/TestBooleanCut_Edge_Face.py @@ -18,6 +18,8 @@ ## email : webmaster.salome@opencascade.com ## +# -*- coding: utf-8 -*- + from salome.shaper import model model.begin() @@ -41,8 +43,8 @@ SketchConstraintVertical_1 = Sketch_2.setVertical(SketchLine_3.result()) SketchConstraintHorizontal_2 = Sketch_2.setHorizontal(SketchLine_4.result()) SketchConstraintVertical_2 = Sketch_2.setVertical(SketchLine_5.result()) model.do() -Edge_1 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_1/Edge-SketchLine_1")]) -Face_1 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_2/Wire-SketchLine_2f-SketchLine_3f-SketchLine_4f-SketchLine_5f")]) +Edge_1 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_1/SketchLine_1")]) +Face_1 = model.addFace(Part_1_doc, [model.selection("WIRE", "[Sketch_2/SubEdge&Sketch_2/SketchLine_2][Sketch_2/SubEdge&Sketch_2/SketchLine_3][Sketch_2/SubEdge&Sketch_2/SketchLine_4][Sketch_2/SubEdge&Sketch_2/SketchLine_5]")]) Cut_1 = model.addCut(Part_1_doc, [model.selection("EDGE", "Edge_1_1")], [model.selection("FACE", "Face_1_1")]) model.testHaveNamingSubshapes(Cut_1, model, Part_1_doc) model.do() diff --git a/src/FeaturesPlugin/Test/TestBooleanCut_FaceCompound_FaceCompound.py b/src/FeaturesPlugin/Test/TestBooleanCut_FaceCompound_FaceCompound.py index d3c727e67..daf6e38d3 100644 --- a/src/FeaturesPlugin/Test/TestBooleanCut_FaceCompound_FaceCompound.py +++ b/src/FeaturesPlugin/Test/TestBooleanCut_FaceCompound_FaceCompound.py @@ -18,6 +18,8 @@ ## email : webmaster.salome@opencascade.com ## +# -*- coding: utf-8 -*- + from salome.shaper import model model.begin() @@ -32,8 +34,8 @@ Sketch_2 = model.addSketch(Part_1_doc, model.defaultPlane("XOY")) SketchCircle_3 = Sketch_2.addCircle(-15.35052744425385, 1.145561749571189, 23.35148318113706) SketchCircle_4 = Sketch_2.addCircle(82.70955831903943, -3.436685248713552, 26.06650182177207) model.do() -Face_1 = model.addFace(Part_1_doc, [model.selection("EDGE", "Sketch_1/Edge-SketchCircle_1_2"), model.selection("EDGE", "Sketch_1/Edge-SketchCircle_2_2")]) -Face_2 = model.addFace(Part_1_doc, [model.selection("EDGE", "Sketch_2/Edge-SketchCircle_3_2"), model.selection("EDGE", "Sketch_2/Edge-SketchCircle_4_2")]) +Face_1 = model.addFace(Part_1_doc, [model.selection("EDGE", "Sketch_1/SketchCircle_1_2"), model.selection("EDGE", "Sketch_1/SketchCircle_2_2")]) +Face_2 = model.addFace(Part_1_doc, [model.selection("EDGE", "Sketch_2/SketchCircle_3_2"), model.selection("EDGE", "Sketch_2/SketchCircle_4_2")]) Compound_1 = model.addCompound(Part_1_doc, [model.selection("FACE", "Face_1_1"), model.selection("FACE", "Face_1_2")]) Compound_2 = model.addCompound(Part_1_doc, [model.selection("FACE", "Face_2_1"), model.selection("FACE", "Face_2_2")]) Cut_1 = model.addCut(Part_1_doc, [model.selection("COMPOUND", "Compound_1_1")], [model.selection("COMPOUND", "Compound_2_1")]) diff --git a/src/FeaturesPlugin/Test/TestBooleanCut_Face_Face.py b/src/FeaturesPlugin/Test/TestBooleanCut_Face_Face.py index f314c44d5..6cdfcddc7 100644 --- a/src/FeaturesPlugin/Test/TestBooleanCut_Face_Face.py +++ b/src/FeaturesPlugin/Test/TestBooleanCut_Face_Face.py @@ -18,6 +18,8 @@ ## email : webmaster.salome@opencascade.com ## +# -*- coding: utf-8 -*- + from salome.shaper import model model.begin() @@ -25,9 +27,9 @@ partSet = model.moduleDocument() Part_1 = model.addPart(partSet) Part_1_doc = Part_1.document() Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY")) -SketchCircle_1 = Sketch_1.addCircle(-6.063464837049752, 0.8662092624356818, 32.2304349637617) +SketchCircle_1 = Sketch_1.addCircle(-6.063464837049752, 0.8662092624356817, 32.2304349637617) model.do() -Face_1 = model.addFace(Part_1_doc, [model.selection("EDGE", "Sketch_1/Edge-SketchCircle_1_2")]) +Face_1 = model.addFace(Part_1_doc, [model.selection("EDGE", "Sketch_1/SketchCircle_1_2")]) Sketch_2 = model.addSketch(Part_1_doc, model.standardPlane("XOY")) SketchProjection_1 = Sketch_2.addProjection(model.selection("VERTEX", "PartSet/Origin"), False) SketchPoint_1 = SketchProjection_1.createdFeature() diff --git a/src/FeaturesPlugin/Test/TestBooleanCut_Face_Solid.py b/src/FeaturesPlugin/Test/TestBooleanCut_Face_Solid.py index bd0752f91..07c2e15c7 100644 --- a/src/FeaturesPlugin/Test/TestBooleanCut_Face_Solid.py +++ b/src/FeaturesPlugin/Test/TestBooleanCut_Face_Solid.py @@ -18,6 +18,8 @@ ## email : webmaster.salome@opencascade.com ## +# -*- coding: utf-8 -*- + from salome.shaper import model model.begin() @@ -27,7 +29,7 @@ Part_1_doc = Part_1.document() Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY")) SketchCircle_1 = Sketch_1.addCircle(-8.850181926352695, 1.062021831162306, 46.73432400996293) model.do() -Face_1 = model.addFace(Part_1_doc, [model.selection("EDGE", "Sketch_1/Edge-SketchCircle_1_2")]) +Face_1 = model.addFace(Part_1_doc, [model.selection("EDGE", "Sketch_1/SketchCircle_1_2")]) Sketch_2 = model.addSketch(Part_1_doc, model.standardPlane("XOY")) SketchLine_1 = Sketch_2.addLine(64.95207814695526, 55.29739830292169, -8.272875875352462, 55.29739830292169) SketchLine_2 = Sketch_2.addLine(-8.272875875352462, 55.29739830292169, -8.272875875352462, -5.036618941767999) @@ -42,11 +44,11 @@ SketchConstraintVertical_1 = Sketch_2.setVertical(SketchLine_2.result()) SketchConstraintHorizontal_2 = Sketch_2.setHorizontal(SketchLine_3.result()) SketchConstraintVertical_2 = Sketch_2.setVertical(SketchLine_4.result()) model.do() -Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchLine_1f-SketchLine_2f-SketchLine_3f-SketchLine_4f")], model.selection(), 10, 10) +Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchLine_1r-SketchLine_2f-SketchLine_3f-SketchLine_4f")], model.selection(), 10, 10) Cut_1 = model.addCut(Part_1_doc, [model.selection("FACE", "Face_1_1")], [model.selection("SOLID", "Extrusion_1_1")]) -Group_1_objects = [model.selection("VERTEX", "Cut_1_1/Modified_Edge_divided_2_v_2_1"), model.selection("FACE", "Cut_1_1"), model.selection("FACE", "Cut_1_1"), model.selection("VERTEX", "Cut_1_1/Modified_Face_divided_4_v_3_1")] +Group_1_objects = [model.selection("VERTEX", "Cut_1_1/Generated_Vertex&Sketch_2/SketchLine_3&Face_1_1/Edge_1"), model.selection("FACE", "Cut_1_1"), model.selection("FACE", "Cut_1_1"), model.selection("VERTEX", "Cut_1_1/Generated_Vertex&Face_1_1/Face_1_1")] Group_1 = model.addGroup(Part_1_doc, Group_1_objects) -Group_2_objects = [model.selection("FACE", "Cut_1_1"), model.selection("EDGE", "Cut_1_1/Modified_Face_divided_3_e_2_1"), model.selection("VERTEX", "Cut_1_1/Modified_Face_divided_4_v_3_1"), model.selection("FACE", "Cut_1_1")] +Group_2_objects = [model.selection("FACE", "Cut_1_1"), model.selection("EDGE", "Cut_1_1/Generated_Edge&Sketch_2/SketchLine_3&Face_1_1/Face_1_1"), model.selection("VERTEX", "Cut_1_1/Generated_Vertex&Face_1_1/Face_1_1"), model.selection("FACE", "Cut_1_1")] Group_2 = model.addGroup(Part_1_doc, Group_2_objects) Group_3 = model.addGroup(Part_1_doc, [model.selection("FACE", "Cut_1_1")]) model.testHaveNamingSubshapes(Cut_1, model, Part_1_doc) diff --git a/src/FeaturesPlugin/Test/TestBooleanCut_ShellCompound_ShellCompound.py b/src/FeaturesPlugin/Test/TestBooleanCut_ShellCompound_ShellCompound.py index 9bed1636b..d7ecbef44 100644 --- a/src/FeaturesPlugin/Test/TestBooleanCut_ShellCompound_ShellCompound.py +++ b/src/FeaturesPlugin/Test/TestBooleanCut_ShellCompound_ShellCompound.py @@ -18,6 +18,8 @@ ## email : webmaster.salome@opencascade.com ## +# -*- coding: utf-8 -*- + from salome.shaper import model model.begin() @@ -44,9 +46,9 @@ SketchLine_4 = Sketch_2.addLine(207.6267015097382, 3.521847530670962, 440.264781 SketchConstraintCoincidence_7 = Sketch_2.setCoincident(SketchLine_4.startPoint(), SketchCircle_4.results()[1]) SketchConstraintCoincidence_8 = Sketch_2.setCoincident(SketchLine_4.endPoint(), SketchCircle_4.results()[1]) model.do() -Shell_1_objects = [model.selection("FACE", "Sketch_1/Face-SketchCircle_1_2f-SketchLine_1r"), model.selection("FACE", "Sketch_1/Face-SketchCircle_1_2f-SketchLine_1f"), model.selection("FACE", "Sketch_1/Face-SketchCircle_2_2f-SketchLine_2r"), model.selection("FACE", "Sketch_1/Face-SketchCircle_2_2f-SketchLine_2f")] +Shell_1_objects = [model.selection("FACE", "Sketch_1/Face-SketchCircle_1_2r-SketchLine_1r"), model.selection("FACE", "Sketch_1/Face-SketchCircle_1_2r-SketchCircle_1_2r-SketchLine_1f"), model.selection("FACE", "Sketch_1/Face-SketchCircle_2_2f-SketchLine_2r"), model.selection("FACE", "Sketch_1/Face-SketchCircle_2_2f-SketchCircle_2_2f-SketchLine_2f")] Shell_1 = model.addShell(Part_1_doc, Shell_1_objects) -Shell_2_objects = [model.selection("FACE", "Sketch_2/Face-SketchCircle_3_2f-SketchLine_3f"), model.selection("FACE", "Sketch_2/Face-SketchCircle_3_2f-SketchLine_3r"), model.selection("FACE", "Sketch_2/Face-SketchCircle_4_2f-SketchLine_4f"), model.selection("FACE", "Sketch_2/Face-SketchCircle_4_2f-SketchLine_4r")] +Shell_2_objects = [model.selection("FACE", "Sketch_2/Face-SketchCircle_3_2r-SketchLine_3f"), model.selection("FACE", "Sketch_2/Face-SketchCircle_3_2r-SketchCircle_3_2r-SketchLine_3r"), model.selection("FACE", "Sketch_2/Face-SketchCircle_4_2f-SketchCircle_4_2f-SketchLine_4f"), model.selection("FACE", "Sketch_2/Face-SketchCircle_4_2f-SketchLine_4r")] Shell_2 = model.addShell(Part_1_doc, Shell_2_objects) Compound_1 = model.addCompound(Part_1_doc, [model.selection("SHELL", "Shell_1_1"), model.selection("SHELL", "Shell_1_2")]) Compound_2 = model.addCompound(Part_1_doc, [model.selection("SHELL", "Shell_2_1"), model.selection("SHELL", "Shell_2_2")]) diff --git a/src/FeaturesPlugin/Test/TestBooleanCut_Shell_Shell.py b/src/FeaturesPlugin/Test/TestBooleanCut_Shell_Shell.py index 0757d3a9b..e09a76193 100644 --- a/src/FeaturesPlugin/Test/TestBooleanCut_Shell_Shell.py +++ b/src/FeaturesPlugin/Test/TestBooleanCut_Shell_Shell.py @@ -18,6 +18,8 @@ ## email : webmaster.salome@opencascade.com ## +# -*- coding: utf-8 -*- + from salome.shaper import model model.begin() @@ -36,7 +38,7 @@ SketchLine_2 = Sketch_2.addLine(112.0898160449407, 1.460291967886176, -7.7048053 SketchConstraintCoincidence_3 = Sketch_2.setCoincident(SketchLine_2.startPoint(), SketchCircle_2.results()[1]) SketchConstraintCoincidence_4 = Sketch_2.setCoincident(SketchLine_2.endPoint(), SketchCircle_2.results()[1]) model.do() -Shell_1_objects = [model.selection("FACE", "Sketch_2/Face-SketchCircle_2_2f-SketchLine_2r"), model.selection("FACE", "Sketch_2/Face-SketchCircle_2_2f-SketchLine_2f"), model.selection("FACE", "Sketch_1/Face-SketchCircle_1_2f-SketchLine_1r"), model.selection("FACE", "Sketch_1/Face-SketchCircle_1_2f-SketchLine_1f")] +Shell_1_objects = [model.selection("FACE", "Sketch_2/Face-SketchCircle_2_2r-SketchCircle_2_2r-SketchLine_2r"), model.selection("FACE", "Sketch_2/Face-SketchCircle_2_2r-SketchLine_2f"), model.selection("FACE", "Sketch_1/Face-SketchCircle_1_2r-SketchLine_1r"), model.selection("FACE", "Sketch_1/Face-SketchCircle_1_2r-SketchCircle_1_2r-SketchLine_1f")] Shell_1 = model.addShell(Part_1_doc, Shell_1_objects) Cut_1 = model.addCut(Part_1_doc, [model.selection("SHELL", "Shell_1_2")], [model.selection("SHELL", "Shell_1_1")]) model.testHaveNamingSubshapes(Cut_1, model, Part_1_doc) diff --git a/src/FeaturesPlugin/Test/TestBooleanCut_SolidCompound_SolidCompound.py b/src/FeaturesPlugin/Test/TestBooleanCut_SolidCompound_SolidCompound.py index 987532453..f8803c16b 100644 --- a/src/FeaturesPlugin/Test/TestBooleanCut_SolidCompound_SolidCompound.py +++ b/src/FeaturesPlugin/Test/TestBooleanCut_SolidCompound_SolidCompound.py @@ -18,6 +18,8 @@ ## email : webmaster.salome@opencascade.com ## +# -*- coding: utf-8 -*- + from salome.shaper import model model.begin() @@ -34,8 +36,8 @@ SketchCircle_4 = Sketch_2.addCircle(78.03127953954764, -3.93858425080257, 22.765 model.do() Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("COMPOUND", "Sketch_1")], model.selection(), 10, 0) Extrusion_2 = model.addExtrusion(Part_1_doc, [model.selection("COMPOUND", "Sketch_2")], model.selection(), 20, 20) -Compound_1 = model.addCompound(Part_1_doc, [model.selection("SOLID", "Extrusion_1_1"), model.selection("SOLID", "Extrusion_1_2")]) -Compound_2 = model.addCompound(Part_1_doc, [model.selection("SOLID", "Extrusion_2_1"), model.selection("SOLID", "Extrusion_2_2")]) +Compound_1 = model.addCompound(Part_1_doc, [model.selection("SOLID", "Extrusion_1_2"), model.selection("SOLID", "Extrusion_1_1")]) +Compound_2 = model.addCompound(Part_1_doc, [model.selection("SOLID", "Extrusion_2_2"), model.selection("SOLID", "Extrusion_2_1")]) Cut_1 = model.addCut(Part_1_doc, [model.selection("COMPOUND", "Compound_1_1")], [model.selection("COMPOUND", "Compound_2_1")]) model.testHaveNamingSubshapes(Cut_1, model, Part_1_doc) model.do() diff --git a/src/FeaturesPlugin/Test/TestBooleanCut_Solid_Solid.py b/src/FeaturesPlugin/Test/TestBooleanCut_Solid_Solid.py index 602d704bf..36fc87b1a 100644 --- a/src/FeaturesPlugin/Test/TestBooleanCut_Solid_Solid.py +++ b/src/FeaturesPlugin/Test/TestBooleanCut_Solid_Solid.py @@ -18,6 +18,8 @@ ## email : webmaster.salome@opencascade.com ## +# -*- coding: utf-8 -*- + from salome.shaper import model model.begin() diff --git a/src/FeaturesPlugin/Test/TestBooleanCut_VertexCompound_Solid.py b/src/FeaturesPlugin/Test/TestBooleanCut_VertexCompound_Solid.py index 681a33893..4cfcc864c 100644 --- a/src/FeaturesPlugin/Test/TestBooleanCut_VertexCompound_Solid.py +++ b/src/FeaturesPlugin/Test/TestBooleanCut_VertexCompound_Solid.py @@ -18,6 +18,8 @@ ## email : webmaster.salome@opencascade.com ## +# -*- coding: utf-8 -*- + from salome.shaper import model model.begin() @@ -30,7 +32,7 @@ SketchPoint_2 = Sketch_1.addPoint(-27.26436963979418, 34.59596483704974) SketchPoint_3 = Sketch_1.addPoint(25.43147084048027, 34.59596483704974) SketchPoint_4 = Sketch_1.addPoint(54.29962692967411, 33.67951543739281) model.do() -Compound_1_objects = [model.selection("VERTEX", "Sketch_1/Vertex-SketchPoint_1"), model.selection("VERTEX", "Sketch_1/Vertex-SketchPoint_2"), model.selection("VERTEX", "Sketch_1/Vertex-SketchPoint_3"), model.selection("VERTEX", "Sketch_1/Vertex-SketchPoint_4")] +Compound_1_objects = [model.selection("VERTEX", "Sketch_1/SketchPoint_1"), model.selection("VERTEX", "Sketch_1/SketchPoint_2"), model.selection("VERTEX", "Sketch_1/SketchPoint_3"), model.selection("VERTEX", "Sketch_1/SketchPoint_4")] Compound_1 = model.addCompound(Part_1_doc, Compound_1_objects) Sketch_2 = model.addSketch(Part_1_doc, model.defaultPlane("XOY")) SketchLine_1 = Sketch_2.addLine(42.11715050385933, 45.75316349699826, -43.32915483490565, 45.75316349699826) @@ -46,7 +48,7 @@ SketchConstraintVertical_1 = Sketch_2.setVertical(SketchLine_2.result()) SketchConstraintHorizontal_2 = Sketch_2.setHorizontal(SketchLine_3.result()) SketchConstraintVertical_2 = Sketch_2.setVertical(SketchLine_4.result()) model.do() -Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchLine_1f-SketchLine_2f-SketchLine_3f-SketchLine_4f")], model.selection(), 10, 10) +Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchLine_1r-SketchLine_2f-SketchLine_3f-SketchLine_4f")], model.selection(), 10, 10) Cut_1 = model.addCut(Part_1_doc, [model.selection("COMPOUND", "Compound_1_1")], [model.selection("SOLID", "Extrusion_1_1")]) model.testHaveNamingSubshapes(Cut_1, model, Part_1_doc) model.do() diff --git a/src/FeaturesPlugin/Test/TestBooleanCut_VertexCompound_VertexCompound.py b/src/FeaturesPlugin/Test/TestBooleanCut_VertexCompound_VertexCompound.py index 702fa1e9c..314fb4efa 100644 --- a/src/FeaturesPlugin/Test/TestBooleanCut_VertexCompound_VertexCompound.py +++ b/src/FeaturesPlugin/Test/TestBooleanCut_VertexCompound_VertexCompound.py @@ -18,6 +18,8 @@ ## email : webmaster.salome@opencascade.com ## +# -*- coding: utf-8 -*- + from salome.shaper import model model.begin() @@ -30,9 +32,9 @@ SketchPoint_2 = Sketch_1.addPoint(-27.26436963979418, 34.59596483704974) SketchPoint_3 = Sketch_1.addPoint(25.43147084048027, 34.59596483704974) SketchPoint_4 = Sketch_1.addPoint(54.29962692967411, 33.67951543739281) model.do() -Compound_1_objects = [model.selection("VERTEX", "Sketch_1/Vertex-SketchPoint_1"), model.selection("VERTEX", "Sketch_1/Vertex-SketchPoint_2"), model.selection("VERTEX", "Sketch_1/Vertex-SketchPoint_3"), model.selection("VERTEX", "Sketch_1/Vertex-SketchPoint_4")] +Compound_1_objects = [model.selection("VERTEX", "Sketch_1/SketchPoint_1"), model.selection("VERTEX", "Sketch_1/SketchPoint_2"), model.selection("VERTEX", "Sketch_1/SketchPoint_3"), model.selection("VERTEX", "Sketch_1/SketchPoint_4")] Compound_1 = model.addCompound(Part_1_doc, Compound_1_objects) -Compound_2 = model.addCompound(Part_1_doc, [model.selection("VERTEX", "Sketch_1/Vertex-SketchPoint_2"), model.selection("VERTEX", "Sketch_1/Vertex-SketchPoint_3")]) +Compound_2 = model.addCompound(Part_1_doc, [model.selection("VERTEX", "Sketch_1/SketchPoint_2"), model.selection("VERTEX", "Sketch_1/SketchPoint_3")]) Cut_1 = model.addCut(Part_1_doc, [model.selection("COMPOUND", "Compound_1_1")], [model.selection("COMPOUND", "Compound_2_1")]) model.testHaveNamingSubshapes(Cut_1, model, Part_1_doc) model.do() diff --git a/src/FeaturesPlugin/Test/TestBooleanCut_Vertex_Vertex.py b/src/FeaturesPlugin/Test/TestBooleanCut_Vertex_Vertex.py index cc53f7725..a109e0cdd 100644 --- a/src/FeaturesPlugin/Test/TestBooleanCut_Vertex_Vertex.py +++ b/src/FeaturesPlugin/Test/TestBooleanCut_Vertex_Vertex.py @@ -18,6 +18,8 @@ ## email : webmaster.salome@opencascade.com ## +# -*- coding: utf-8 -*- + from salome.shaper import model model.begin() @@ -28,10 +30,10 @@ Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY")) SketchPoint_1 = Sketch_1.addPoint(0, 50) SketchPoint_2 = Sketch_1.addPoint(0, 25) model.do() -Vertex_1 = model.addVertex(Part_1_doc, [model.selection("VERTEX", "Sketch_1/Vertex-SketchPoint_1")]) -Vertex_2 = model.addVertex(Part_1_doc, [model.selection("VERTEX", "Sketch_1/Vertex-SketchPoint_1")]) -Vertex_3 = model.addVertex(Part_1_doc, [model.selection("VERTEX", "Sketch_1/Vertex-SketchPoint_1")]) -Vertex_4 = model.addVertex(Part_1_doc, [model.selection("VERTEX", "Sketch_1/Vertex-SketchPoint_2")]) +Vertex_1 = model.addVertex(Part_1_doc, [model.selection("VERTEX", "Sketch_1/SketchPoint_1")]) +Vertex_2 = model.addVertex(Part_1_doc, [model.selection("VERTEX", "Sketch_1/SketchPoint_1")]) +Vertex_3 = model.addVertex(Part_1_doc, [model.selection("VERTEX", "Sketch_1/SketchPoint_1")]) +Vertex_4 = model.addVertex(Part_1_doc, [model.selection("VERTEX", "Sketch_1/SketchPoint_2")]) Cut_1 = model.addCut(Part_1_doc, [model.selection("VERTEX", "Vertex_1_1")], [model.selection("VERTEX", "Vertex_2_1")]) Cut_2 = model.addCut(Part_1_doc, [model.selection("VERTEX", "Vertex_3_1")], [model.selection("VERTEX", "Vertex_4_1")]) model.testHaveNamingSubshapes(Cut_1, model, Part_1_doc) diff --git a/src/FeaturesPlugin/Test/TestBooleanCut_WireCompound_WireCompound.py b/src/FeaturesPlugin/Test/TestBooleanCut_WireCompound_WireCompound.py index baf9bc921..8b37dcefc 100644 --- a/src/FeaturesPlugin/Test/TestBooleanCut_WireCompound_WireCompound.py +++ b/src/FeaturesPlugin/Test/TestBooleanCut_WireCompound_WireCompound.py @@ -18,6 +18,8 @@ ## email : webmaster.salome@opencascade.com ## +# -*- coding: utf-8 -*- + from salome.shaper import model model.begin() @@ -33,17 +35,17 @@ SketchLine_4 = Sketch_1.addLine(33.43567753001715, 55.95711835334479, 50.7598627 SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchLine_3.endPoint(), SketchLine_4.startPoint()) model.do() Sketch_2 = model.addSketch(Part_1_doc, model.defaultPlane("XOY")) -SketchLine_5 = Sketch_2.addLine(-67.39108061749573, 66.6981132075472, -42.44425385934821, 35.51457975986279) -SketchLine_6 = Sketch_2.addLine(-42.44425385934821, 35.51457975986279, -16.1114922813036, 69.1234991423671) +SketchLine_5 = Sketch_2.addLine(-67.39108061749573, 66.69811320754719, -42.44425385934821, 35.51457975986279) +SketchLine_6 = Sketch_2.addLine(-42.44425385934821, 35.51457975986279, -16.1114922813036, 69.12349914236709) SketchConstraintCoincidence_3 = Sketch_2.setCoincident(SketchLine_5.endPoint(), SketchLine_6.startPoint()) -SketchLine_7 = Sketch_2.addLine(12.64665523156088, 66.6981132075472, 35.16809605488852, 36.5540308747856) +SketchLine_7 = Sketch_2.addLine(12.64665523156088, 66.69811320754719, 35.16809605488852, 36.5540308747856) SketchLine_8 = Sketch_2.addLine(35.16809605488852, 36.5540308747856, 52.49228130360206, 66.35162950257292) SketchConstraintCoincidence_4 = Sketch_2.setCoincident(SketchLine_7.endPoint(), SketchLine_8.startPoint()) model.do() -Wire_1 = model.addWire(Part_1_doc, [model.selection("EDGE", "Sketch_1/Edge-SketchLine_1"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_2")]) -Wire_2 = model.addWire(Part_1_doc, [model.selection("EDGE", "Sketch_1/Edge-SketchLine_3"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_4")]) -Wire_3 = model.addWire(Part_1_doc, [model.selection("EDGE", "Sketch_2/Edge-SketchLine_5"), model.selection("EDGE", "Sketch_2/Edge-SketchLine_6")]) -Wire_4 = model.addWire(Part_1_doc, [model.selection("EDGE", "Sketch_2/Edge-SketchLine_7"), model.selection("EDGE", "Sketch_2/Edge-SketchLine_8")]) +Wire_1 = model.addWire(Part_1_doc, [model.selection("EDGE", "Sketch_1/SketchLine_1"), model.selection("EDGE", "Sketch_1/SketchLine_2")]) +Wire_2 = model.addWire(Part_1_doc, [model.selection("EDGE", "Sketch_1/SketchLine_3"), model.selection("EDGE", "Sketch_1/SketchLine_4")]) +Wire_3 = model.addWire(Part_1_doc, [model.selection("EDGE", "Sketch_2/SketchLine_5"), model.selection("EDGE", "Sketch_2/SketchLine_6")]) +Wire_4 = model.addWire(Part_1_doc, [model.selection("EDGE", "Sketch_2/SketchLine_7"), model.selection("EDGE", "Sketch_2/SketchLine_8")]) Compound_1 = model.addCompound(Part_1_doc, [model.selection("WIRE", "Wire_1_1"), model.selection("WIRE", "Wire_2_1")]) Compound_2 = model.addCompound(Part_1_doc, [model.selection("WIRE", "Wire_3_1"), model.selection("WIRE", "Wire_4_1")]) Cut_1 = model.addCut(Part_1_doc, [model.selection("COMPOUND", "Compound_1_1")], [model.selection("COMPOUND", "Compound_2_1")]) diff --git a/src/FeaturesPlugin/Test/TestBooleanCut_Wire_Face.py b/src/FeaturesPlugin/Test/TestBooleanCut_Wire_Face.py index 9739b75fa..6a9f8d678 100644 --- a/src/FeaturesPlugin/Test/TestBooleanCut_Wire_Face.py +++ b/src/FeaturesPlugin/Test/TestBooleanCut_Wire_Face.py @@ -18,6 +18,8 @@ ## email : webmaster.salome@opencascade.com ## +# -*- coding: utf-8 -*- + from salome.shaper import model model.begin() @@ -34,9 +36,9 @@ model.do() Sketch_2 = model.addSketch(Part_1_doc, model.defaultPlane("XOY")) SketchCircle_1 = Sketch_2.addCircle(3.984562607204112, 58.72898799313897, 38.16357190022508) model.do() -Wire_1_objects = [model.selection("EDGE", "Sketch_1/Edge-SketchLine_1"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_2"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_3")] +Wire_1_objects = [model.selection("EDGE", "Sketch_1/SketchLine_1"), model.selection("EDGE", "Sketch_1/SketchLine_2"), model.selection("EDGE", "Sketch_1/SketchLine_3")] Wire_1 = model.addWire(Part_1_doc, Wire_1_objects) -Face_1 = model.addFace(Part_1_doc, [model.selection("EDGE", "Sketch_2/Edge-SketchCircle_1_2")]) +Face_1 = model.addFace(Part_1_doc, [model.selection("EDGE", "Sketch_2/SketchCircle_1_2")]) Cut_1 = model.addCut(Part_1_doc, [model.selection("WIRE", "Wire_1_1")], [model.selection("FACE", "Face_1_1")]) model.testHaveNamingSubshapes(Cut_1, model, Part_1_doc) model.do() diff --git a/src/FeaturesPlugin/Test/TestBooleanCut_Wire_Wire.py b/src/FeaturesPlugin/Test/TestBooleanCut_Wire_Wire.py index 0944b7ea5..3b608b1a8 100644 --- a/src/FeaturesPlugin/Test/TestBooleanCut_Wire_Wire.py +++ b/src/FeaturesPlugin/Test/TestBooleanCut_Wire_Wire.py @@ -18,6 +18,8 @@ ## email : webmaster.salome@opencascade.com ## +# -*- coding: utf-8 -*- + from salome.shaper import model model.begin() @@ -34,9 +36,9 @@ SketchLine_4 = Sketch_1.addLine(-58.79960075346089, 25.5711331765356, 3.50824445 SketchLine_5 = Sketch_1.addLine(3.508244452542322, 60.3323520809374, 63.1926014393454, 22.94764495733547) SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchLine_4.endPoint(), SketchLine_5.startPoint()) model.do() -Wire_1_objects = [model.selection("EDGE", "Sketch_1/Edge-SketchLine_1"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_2"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_3")] +Wire_1_objects = [model.selection("EDGE", "Sketch_1/SketchLine_1"), model.selection("EDGE", "Sketch_1/SketchLine_2"), model.selection("EDGE", "Sketch_1/SketchLine_3")] Wire_1 = model.addWire(Part_1_doc, Wire_1_objects) -Wire_2 = model.addWire(Part_1_doc, [model.selection("EDGE", "Sketch_1/Edge-SketchLine_4"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_5")]) +Wire_2 = model.addWire(Part_1_doc, [model.selection("EDGE", "Sketch_1/SketchLine_4"), model.selection("EDGE", "Sketch_1/SketchLine_5")]) Cut_1 = model.addCut(Part_1_doc, [model.selection("WIRE", "Wire_1_1")], [model.selection("WIRE", "Wire_2_1")]) model.testHaveNamingSubshapes(Cut_1, model, Part_1_doc) model.do() diff --git a/src/FeaturesPlugin/Test/TestBooleanFill.py b/src/FeaturesPlugin/Test/TestBooleanFill.py index 449508b03..c181b3744 100644 --- a/src/FeaturesPlugin/Test/TestBooleanFill.py +++ b/src/FeaturesPlugin/Test/TestBooleanFill.py @@ -18,50 +18,25 @@ ## email : webmaster.salome@opencascade.com ## -""" -Test case for Boolean Fill feature. Written on High API. -""" -from ModelAPI import * -from GeomAPI import * +# -*- coding: utf-8 -*- from salome.shaper import model -# Get session -aSession = ModelAPI_Session.get() - -# Create a part -aDocument = aSession.activeDocument() -aSession.startOperation() -model.addPart(aDocument) -aDocument = aSession.activeDocument() -aSession.finishOperation() - -# Create a sketch with circle to extrude -aSession.startOperation() -anOrigin = GeomAPI_Pnt(0, 0, 0) -aDirX = GeomAPI_Dir(1, 0, 0) -aNorm = GeomAPI_Dir(0, 0, 1) -aCircleSketch = model.addSketch(aDocument, GeomAPI_Ax3(anOrigin, aDirX, aNorm)) -aCircleSketch.addCircle(0, 0, 50) -aSession.finishOperation() - -# Create a sketch with triangle to extrude -aSession.startOperation() -aTriangleSketch = model.addSketch(aDocument, GeomAPI_Ax3(anOrigin, aDirX, aNorm)) -aTriangleSketch.addLine(25, 25, 100, 25) -aTriangleSketch.addLine(100, 25, 60, 75) -aTriangleSketch.addLine(60, 75, 25, 25) -aSession.finishOperation() - -# Make extrusion on circle (cylinder) and triangle (prism) -aSession.startOperation() -anExtrusion = model.addExtrusion(aDocument, aCircleSketch.results() + aTriangleSketch.results(), 100) -aSession.finishOperation() - -# Fill prism with cylinder -aSession.startOperation() -aBoolean = model.addFill(aDocument, [anExtrusion.results()[0]], [anExtrusion.results()[1]]) -assert (len(aBoolean.results()) > 0) -aSession.finishOperation() - +model.begin() +partSet = model.moduleDocument() +Part_1 = model.addPart(partSet) +Part_1_doc = Part_1.document() +Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY")) +SketchCircle_1 = Sketch_1.addCircle(0, 0, 50) +model.do() +Sketch_2 = model.addSketch(Part_1_doc, model.defaultPlane("XOY")) +SketchLine_1 = Sketch_2.addLine(25, 25, 100, 25) +SketchLine_2 = Sketch_2.addLine(100, 25, 60, 75) +SketchLine_3 = Sketch_2.addLine(60, 75, 25, 25) +model.do() +Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("COMPOUND", "Sketch_1"), model.selection("COMPOUND", "Sketch_2")], model.selection(), 100, 0) +Fill_1 = model.addFill(Part_1_doc, [model.selection("SOLID", "Extrusion_1_1")], [model.selection("SOLID", "Extrusion_1_2")]) +model.do() +model.end() +assert (len(Fill_1.results()) > 0) assert(model.checkPythonDump()) diff --git a/src/FeaturesPlugin/Test/TestBooleanFillWithPlane.py b/src/FeaturesPlugin/Test/TestBooleanFillWithPlane.py index eeb224064..ed575a9b7 100644 --- a/src/FeaturesPlugin/Test/TestBooleanFillWithPlane.py +++ b/src/FeaturesPlugin/Test/TestBooleanFillWithPlane.py @@ -18,6 +18,10 @@ ## email : webmaster.salome@opencascade.com ## +# -*- coding: utf-8 -*- + +from GeomAPI import GeomAPI_Pnt + from salome.shaper import model model.begin() @@ -50,22 +54,20 @@ SketchConstraintVertical_3 = Sketch_1.setVertical(SketchLine_6.result()) SketchConstraintHorizontal_4 = Sketch_1.setHorizontal(SketchLine_7.result()) SketchConstraintVertical_4 = Sketch_1.setVertical(SketchLine_8.result()) model.do() -Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("COMPOUND", "Sketch_1")], model.selection(), 100, 0) -Boolean_1 = model.addFill(Part_1_doc, [model.selection("SOLID", "Extrusion_1_1_2")], [model.selection("FACE", "PartSet/YOZ")]) +Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("COMPOUND", GeomAPI_Pnt(17.35551764280096, -11.01190794150899, 0))], model.selection(), 100, 0) +Fill_1 = model.addFill(Part_1_doc, [model.selection("SOLID", GeomAPI_Pnt(-0.3180832609141306, -28.0220443670531, 50.00000000000001))], [model.selection("FACE", "PartSet/YOZ")]) model.do() - -model.testHaveNamingSubshapes(Boolean_1, model, Part_1_doc) - +model.testHaveNamingSubshapes(Fill_1, model, Part_1_doc) model.end() from GeomAPI import GeomAPI_Shape -model.testNbResults(Boolean_1, 1) -model.testNbSubResults(Boolean_1, [4]) -model.testNbSubShapes(Boolean_1, GeomAPI_Shape.SOLID, [4]) -model.testNbSubShapes(Boolean_1, GeomAPI_Shape.FACE, [30]) -model.testNbSubShapes(Boolean_1, GeomAPI_Shape.EDGE, [132]) -model.testNbSubShapes(Boolean_1, GeomAPI_Shape.VERTEX, [264]) -model.testResultsVolumes(Boolean_1, [11003613.329450136050581932067871094]) +model.testNbResults(Fill_1, 1) +model.testNbSubResults(Fill_1, [4]) +model.testNbSubShapes(Fill_1, GeomAPI_Shape.SOLID, [4]) +model.testNbSubShapes(Fill_1, GeomAPI_Shape.FACE, [30]) +model.testNbSubShapes(Fill_1, GeomAPI_Shape.EDGE, [132]) +model.testNbSubShapes(Fill_1, GeomAPI_Shape.VERTEX, [264]) +model.testResultsVolumes(Fill_1, [11003613.329450136050581932067871094]) assert(model.checkPythonDump()) diff --git a/src/FeaturesPlugin/Test/TestBooleanFuse_CompSolidCompound_CompSolidCompound.py b/src/FeaturesPlugin/Test/TestBooleanFuse_CompSolidCompound_CompSolidCompound.py index ca8aae00d..5267db93a 100644 --- a/src/FeaturesPlugin/Test/TestBooleanFuse_CompSolidCompound_CompSolidCompound.py +++ b/src/FeaturesPlugin/Test/TestBooleanFuse_CompSolidCompound_CompSolidCompound.py @@ -18,6 +18,8 @@ ## email : webmaster.salome@opencascade.com ## +# -*- coding: utf-8 -*- + from salome.shaper import model model.begin() @@ -74,8 +76,8 @@ SketchConstraintCoincidence_24 = Sketch_2.setCoincident(SketchLine_17.endPoint() model.do() Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("COMPOUND", "Sketch_1")], model.selection(), 100, 0) Extrusion_2 = model.addExtrusion(Part_1_doc, [model.selection("COMPOUND", "Sketch_2")], model.selection(), 50, -20) -Compound_1 = model.addCompound(Part_1_doc, [model.selection("COMPSOLID", "Extrusion_1_1"), model.selection("COMPSOLID", "Extrusion_1_2")]) -Compound_2 = model.addCompound(Part_1_doc, [model.selection("COMPSOLID", "Extrusion_2_1"), model.selection("COMPSOLID", "Extrusion_2_2")]) +Compound_1 = model.addCompound(Part_1_doc, [model.selection("COMPSOLID", "Extrusion_1_2"), model.selection("COMPSOLID", "Extrusion_1_1")]) +Compound_2 = model.addCompound(Part_1_doc, [model.selection("COMPSOLID", "Extrusion_2_2"), model.selection("COMPSOLID", "Extrusion_2_1")]) Fuse_1 = model.addFuse(Part_1_doc, [model.selection("COMPOUND", "Compound_1_1"), model.selection("COMPOUND", "Compound_2_1")], True) model.testHaveNamingSubshapes(Fuse_1, model, Part_1_doc) model.do() diff --git a/src/FeaturesPlugin/Test/TestBooleanFuse_CompSolid_CompSolid.py b/src/FeaturesPlugin/Test/TestBooleanFuse_CompSolid_CompSolid.py index a5d5577e0..5140319a5 100644 --- a/src/FeaturesPlugin/Test/TestBooleanFuse_CompSolid_CompSolid.py +++ b/src/FeaturesPlugin/Test/TestBooleanFuse_CompSolid_CompSolid.py @@ -18,6 +18,7 @@ ## email : webmaster.salome@opencascade.com ## +# -*- coding: utf-8 -*- from salome.shaper import model diff --git a/src/FeaturesPlugin/Test/TestBooleanFuse_EdgeCompound_EdgeCompound.py b/src/FeaturesPlugin/Test/TestBooleanFuse_EdgeCompound_EdgeCompound.py index 14a1cb140..904b8dd34 100644 --- a/src/FeaturesPlugin/Test/TestBooleanFuse_EdgeCompound_EdgeCompound.py +++ b/src/FeaturesPlugin/Test/TestBooleanFuse_EdgeCompound_EdgeCompound.py @@ -18,6 +18,8 @@ ## email : webmaster.salome@opencascade.com ## +# -*- coding: utf-8 -*- + from salome.shaper import model model.begin() @@ -32,7 +34,7 @@ Sketch_2 = model.addSketch(Part_1_doc, model.defaultPlane("XOY")) SketchLine_3 = Sketch_2.addLine(-70.53968253968257, 29.92592592592593, -31.52910052910054, -5.343915343915344) SketchLine_4 = Sketch_2.addLine(14.96296296296294, 26.18518518518519, 50.23280423280426, -8.015873015873021) model.do() -Edge_1_objects = [model.selection("EDGE", "Sketch_1/Edge-SketchLine_1"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_2"), model.selection("EDGE", "Sketch_2/Edge-SketchLine_3"), model.selection("EDGE", "Sketch_2/Edge-SketchLine_4")] +Edge_1_objects = [model.selection("EDGE", "Sketch_1/SketchLine_1"), model.selection("EDGE", "Sketch_1/SketchLine_2"), model.selection("EDGE", "Sketch_2/SketchLine_3"), model.selection("EDGE", "Sketch_2/SketchLine_4")] Edge_1 = model.addEdge(Part_1_doc, Edge_1_objects) Compound_1 = model.addCompound(Part_1_doc, [model.selection("EDGE", "Edge_1_1"), model.selection("EDGE", "Edge_1_2")]) Compound_2 = model.addCompound(Part_1_doc, [model.selection("EDGE", "Edge_1_3"), model.selection("EDGE", "Edge_1_4")]) diff --git a/src/FeaturesPlugin/Test/TestBooleanFuse_Edge_Edge.py b/src/FeaturesPlugin/Test/TestBooleanFuse_Edge_Edge.py index 3a3a78be3..faecb17e3 100644 --- a/src/FeaturesPlugin/Test/TestBooleanFuse_Edge_Edge.py +++ b/src/FeaturesPlugin/Test/TestBooleanFuse_Edge_Edge.py @@ -18,6 +18,8 @@ ## email : webmaster.salome@opencascade.com ## +# -*- coding: utf-8 -*- + from salome.shaper import model model.begin() @@ -30,7 +32,7 @@ model.do() Sketch_2 = model.addSketch(Part_1_doc, model.defaultPlane("XOY")) SketchLine_2 = Sketch_2.addLine(-24.04761904761907, 40.07936507936508, 39.54497354497357, -14.96296296296296) model.do() -Edge_1 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_1/Edge-SketchLine_1"), model.selection("EDGE", "Sketch_2/Edge-SketchLine_2")]) +Edge_1 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_1/SketchLine_1"), model.selection("EDGE", "Sketch_2/SketchLine_2")]) Fuse_1 = model.addFuse(Part_1_doc, [model.selection("EDGE", "Edge_1_2"), model.selection("EDGE", "Edge_1_1")]) model.testHaveNamingSubshapes(Fuse_1, model, Part_1_doc) model.do() diff --git a/src/FeaturesPlugin/Test/TestBooleanFuse_FaceCompound_FaceCompound.py b/src/FeaturesPlugin/Test/TestBooleanFuse_FaceCompound_FaceCompound.py index d9cebddfd..33a3ff96f 100644 --- a/src/FeaturesPlugin/Test/TestBooleanFuse_FaceCompound_FaceCompound.py +++ b/src/FeaturesPlugin/Test/TestBooleanFuse_FaceCompound_FaceCompound.py @@ -18,6 +18,8 @@ ## email : webmaster.salome@opencascade.com ## +# -*- coding: utf-8 -*- + from salome.shaper import model model.begin() @@ -32,9 +34,9 @@ Sketch_2 = model.addSketch(Part_1_doc, model.defaultPlane("XOY")) SketchCircle_3 = Sketch_2.addCircle(-36.12101408450705, -7.148950704225357, 25.24032590912034) SketchCircle_4 = Sketch_2.addCircle(51.92395774647893, -12.41659859154929, 31.3630728131964) model.do() -Face_1 = model.addFace(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchCircle_1_2f")]) +Face_1 = model.addFace(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchCircle_1_2r")]) Face_2 = model.addFace(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchCircle_2_2f")]) -Face_3 = model.addFace(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchCircle_3_2f")]) +Face_3 = model.addFace(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchCircle_3_2r")]) Face_4 = model.addFace(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchCircle_4_2f")]) Compound_1 = model.addCompound(Part_1_doc, [model.selection("FACE", "Face_1_1"), model.selection("FACE", "Face_2_1")]) Compound_2 = model.addCompound(Part_1_doc, [model.selection("FACE", "Face_3_1"), model.selection("FACE", "Face_4_1")]) diff --git a/src/FeaturesPlugin/Test/TestBooleanFuse_Face_Face.py b/src/FeaturesPlugin/Test/TestBooleanFuse_Face_Face.py index a7f012ab2..c9b803e50 100644 --- a/src/FeaturesPlugin/Test/TestBooleanFuse_Face_Face.py +++ b/src/FeaturesPlugin/Test/TestBooleanFuse_Face_Face.py @@ -18,6 +18,7 @@ ## email : webmaster.salome@opencascade.com ## +# -*- coding: utf-8 -*- from salome.shaper import model @@ -31,8 +32,8 @@ model.do() Sketch_2 = model.addSketch(Part_1_doc, model.defaultPlane("XOY")) SketchCircle_2 = Sketch_2.addCircle(22.86792452830187, 26.50600343053173, 30.90704565816075) model.do() -Face_1 = model.addFace(Part_1_doc, [model.selection("EDGE", "Sketch_1/Edge-SketchCircle_1_2")]) -Face_2 = model.addFace(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchCircle_2_2f")]) +Face_1 = model.addFace(Part_1_doc, [model.selection("EDGE", "Sketch_1/SketchCircle_1_2")]) +Face_2 = model.addFace(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchCircle_2_2r")]) Fuse_1 = model.addFuse(Part_1_doc, [model.selection("FACE", "Face_1_1"), model.selection("FACE", "Face_2_1")], True) model.testHaveNamingSubshapes(Fuse_1, model, Part_1_doc) model.do() diff --git a/src/FeaturesPlugin/Test/TestBooleanFuse_RemoveEdges.py b/src/FeaturesPlugin/Test/TestBooleanFuse_RemoveEdges.py index 6065be805..b1ab2c6ae 100644 --- a/src/FeaturesPlugin/Test/TestBooleanFuse_RemoveEdges.py +++ b/src/FeaturesPlugin/Test/TestBooleanFuse_RemoveEdges.py @@ -18,6 +18,8 @@ ## email : webmaster.salome@opencascade.com ## +# -*- coding: utf-8 -*- + from salome.shaper import model model.begin() diff --git a/src/FeaturesPlugin/Test/TestBooleanFuse_ShellCompound_ShellCompound.py b/src/FeaturesPlugin/Test/TestBooleanFuse_ShellCompound_ShellCompound.py index df924e429..79d4d308d 100644 --- a/src/FeaturesPlugin/Test/TestBooleanFuse_ShellCompound_ShellCompound.py +++ b/src/FeaturesPlugin/Test/TestBooleanFuse_ShellCompound_ShellCompound.py @@ -18,6 +18,8 @@ ## email : webmaster.salome@opencascade.com ## +# -*- coding: utf-8 -*- + from salome.shaper import model model.begin() @@ -72,7 +74,7 @@ SketchLine_20 = Sketch_2.addLine(31.63598289786226, 11.9441976247031, 52.2962166 SketchConstraintCoincidence_23 = Sketch_2.setCoincident(SketchLine_16.startPoint(), SketchLine_20.startPoint()) SketchConstraintCoincidence_24 = Sketch_2.setCoincident(SketchLine_17.endPoint(), SketchLine_20.endPoint()) model.do() -Shell_1_objects = [model.selection("FACE", "Sketch_1/Face-SketchLine_1r-SketchLine_4r-SketchLine_5r"), model.selection("FACE", "Sketch_1/Face-SketchLine_2r-SketchLine_3r-SketchLine_5f"), model.selection("FACE", "Sketch_1/Face-SketchLine_6r-SketchLine_9r-SketchLine_10r"), model.selection("FACE", "Sketch_1/Face-SketchLine_7r-SketchLine_8r-SketchLine_10f"), model.selection("FACE", "Sketch_2/Face-SketchLine_11r-SketchLine_12r-SketchLine_15f"), model.selection("FACE", "Sketch_2/Face-SketchLine_13r-SketchLine_14r-SketchLine_15r"), model.selection("FACE", "Sketch_2/Face-SketchLine_16r-SketchLine_17r-SketchLine_20f"), model.selection("FACE", "Sketch_2/Face-SketchLine_18r-SketchLine_19r-SketchLine_20r")] +Shell_1_objects = [model.selection("FACE", "Sketch_1/Face-SketchLine_4r-SketchLine_5r-SketchLine_1r"), model.selection("FACE", "Sketch_1/Face-SketchLine_5f-SketchLine_3r-SketchLine_2r"), model.selection("FACE", "Sketch_1/Face-SketchLine_9r-SketchLine_10r-SketchLine_6r"), model.selection("FACE", "Sketch_1/Face-SketchLine_10f-SketchLine_8r-SketchLine_7r"), model.selection("FACE", "Sketch_2/Face-SketchLine_15f-SketchLine_12r-SketchLine_11r"), model.selection("FACE", "Sketch_2/Face-SketchLine_15r-SketchLine_14r-SketchLine_13r"), model.selection("FACE", "Sketch_2/Face-SketchLine_20f-SketchLine_17r-SketchLine_16r"), model.selection("FACE", "Sketch_2/Face-SketchLine_20r-SketchLine_19r-SketchLine_18r")] Shell_1 = model.addShell(Part_1_doc, Shell_1_objects) Compound_1 = model.addCompound(Part_1_doc, [model.selection("SHELL", "Shell_1_1"), model.selection("SHELL", "Shell_1_2")]) Compound_2 = model.addCompound(Part_1_doc, [model.selection("SHELL", "Shell_1_3"), model.selection("SHELL", "Shell_1_4")]) diff --git a/src/FeaturesPlugin/Test/TestBooleanFuse_Shell_Shell.py b/src/FeaturesPlugin/Test/TestBooleanFuse_Shell_Shell.py index 495756723..b612327c6 100644 --- a/src/FeaturesPlugin/Test/TestBooleanFuse_Shell_Shell.py +++ b/src/FeaturesPlugin/Test/TestBooleanFuse_Shell_Shell.py @@ -18,6 +18,8 @@ ## email : webmaster.salome@opencascade.com ## +# -*- coding: utf-8 -*- + from salome.shaper import model model.begin() @@ -50,7 +52,7 @@ SketchLine_10 = Sketch_2.addLine(-84.57783182897859, 11.29856532066509, -60.6894 SketchConstraintCoincidence_11 = Sketch_2.setCoincident(SketchLine_6.startPoint(), SketchLine_10.startPoint()) SketchConstraintCoincidence_12 = Sketch_2.setCoincident(SketchLine_7.endPoint(), SketchLine_10.endPoint()) model.do() -Shell_1_objects = [model.selection("FACE", "Sketch_1/Face-SketchLine_1r-SketchLine_4r-SketchLine_5r"), model.selection("FACE", "Sketch_1/Face-SketchLine_2r-SketchLine_3r-SketchLine_5f"), model.selection("FACE", "Sketch_2/Face-SketchLine_6r-SketchLine_7r-SketchLine_10f"), model.selection("FACE", "Sketch_2/Face-SketchLine_8r-SketchLine_9r-SketchLine_10r")] +Shell_1_objects = [model.selection("FACE", "Sketch_1/Face-SketchLine_4r-SketchLine_5r-SketchLine_1r"), model.selection("FACE", "Sketch_1/Face-SketchLine_5f-SketchLine_3r-SketchLine_2r"), model.selection("FACE", "Sketch_2/Face-SketchLine_10f-SketchLine_7r-SketchLine_6r"), model.selection("FACE", "Sketch_2/Face-SketchLine_10r-SketchLine_9r-SketchLine_8r")] Shell_1 = model.addShell(Part_1_doc, Shell_1_objects) Fuse_1 = model.addFuse(Part_1_doc, [model.selection("SHELL", "Shell_1_1"), model.selection("SHELL", "Shell_1_2")], True) model.testHaveNamingSubshapes(Fuse_1, model, Part_1_doc) diff --git a/src/FeaturesPlugin/Test/TestBooleanFuse_SimpleMode.py b/src/FeaturesPlugin/Test/TestBooleanFuse_SimpleMode.py index e985d2876..7f7dba73e 100644 --- a/src/FeaturesPlugin/Test/TestBooleanFuse_SimpleMode.py +++ b/src/FeaturesPlugin/Test/TestBooleanFuse_SimpleMode.py @@ -18,6 +18,8 @@ ## email : webmaster.salome@opencascade.com ## +# -*- coding: utf-8 -*- + from salome.shaper import model model.begin() diff --git a/src/FeaturesPlugin/Test/TestBooleanFuse_SolidCompound_SolidCompound.py b/src/FeaturesPlugin/Test/TestBooleanFuse_SolidCompound_SolidCompound.py index 3cd98f2ef..c5fdfc25a 100644 --- a/src/FeaturesPlugin/Test/TestBooleanFuse_SolidCompound_SolidCompound.py +++ b/src/FeaturesPlugin/Test/TestBooleanFuse_SolidCompound_SolidCompound.py @@ -18,6 +18,7 @@ ## email : webmaster.salome@opencascade.com ## +# -*- coding: utf-8 -*- from salome.shaper import model @@ -79,7 +80,7 @@ SketchConstraintHorizontal_8 = Sketch_2.setHorizontal(SketchLine_15.result()) SketchConstraintVertical_8 = Sketch_2.setVertical(SketchLine_16.result()) model.do() Extrusion_2 = model.addExtrusion(Part_1_doc, [model.selection("COMPOUND", "Sketch_2")], model.selection(), 40, -20) -Compound_1 = model.addCompound(Part_1_doc, [model.selection("SOLID", "Extrusion_1_1"), model.selection("SOLID", "Extrusion_1_2")]) +Compound_1 = model.addCompound(Part_1_doc, [model.selection("SOLID", "Extrusion_1_2"), model.selection("SOLID", "Extrusion_1_1")]) Compound_2 = model.addCompound(Part_1_doc, [model.selection("SOLID", "Extrusion_2_1"), model.selection("SOLID", "Extrusion_2_2")]) Fuse_1 = model.addFuse(Part_1_doc, [model.selection("COMPOUND", "Compound_1_1"), model.selection("COMPOUND", "Compound_2_1")]) model.testHaveNamingSubshapes(Fuse_1, model, Part_1_doc) diff --git a/src/FeaturesPlugin/Test/TestBooleanFuse_Solid_Solid.py b/src/FeaturesPlugin/Test/TestBooleanFuse_Solid_Solid.py index 809ff19f6..3167f9c69 100644 --- a/src/FeaturesPlugin/Test/TestBooleanFuse_Solid_Solid.py +++ b/src/FeaturesPlugin/Test/TestBooleanFuse_Solid_Solid.py @@ -18,6 +18,8 @@ ## email : webmaster.salome@opencascade.com ## +# -*- coding: utf-8 -*- + from salome.shaper import model model.begin() @@ -38,7 +40,7 @@ SketchConstraintVertical_1 = Sketch_1.setVertical(SketchLine_2.result()) SketchConstraintHorizontal_2 = Sketch_1.setHorizontal(SketchLine_3.result()) SketchConstraintVertical_2 = Sketch_1.setVertical(SketchLine_4.result()) model.do() -Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_1f-SketchLine_2f-SketchLine_3f-SketchLine_4f")], model.selection(), 50, 0) +Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_1r-SketchLine_2f-SketchLine_3f-SketchLine_4f")], model.selection(), 50, 0) Sketch_2 = model.addSketch(Part_1_doc, model.standardPlane("XOY")) SketchLine_5 = Sketch_2.addLine(-38.01624011480907, 11.11021000825241, -18.03083750064881, 11.11021000825241) SketchLine_6 = Sketch_2.addLine(-18.03083750064881, 11.11021000825241, -18.03083750064881, 22.05701811772883) @@ -53,7 +55,7 @@ SketchConstraintVertical_3 = Sketch_2.setVertical(SketchLine_6.result()) SketchConstraintHorizontal_4 = Sketch_2.setHorizontal(SketchLine_7.result()) SketchConstraintVertical_4 = Sketch_2.setVertical(SketchLine_8.result()) model.do() -Extrusion_2 = model.addExtrusion(Part_1_doc, [model.selection("WIRE", "Sketch_2/Wire-SketchLine_5f-SketchLine_6f-SketchLine_7f-SketchLine_8f")], model.selection(), 30, -20) +Extrusion_2 = model.addExtrusion(Part_1_doc, [model.selection("WIRE", "[Sketch_2/SubEdge&Sketch_2/SketchLine_5][Sketch_2/SubEdge&Sketch_2/SketchLine_6][Sketch_2/SubEdge&Sketch_2/SketchLine_7][Sketch_2/SubEdge&Sketch_2/SketchLine_8]")], model.selection(), 30, -20) Fuse_1 = model.addFuse(Part_1_doc, [model.selection("SOLID", "Extrusion_1_1"), model.selection("SOLID", "Extrusion_2_1")]) model.testHaveNamingSubshapes(Fuse_1, model, Part_1_doc) model.do() diff --git a/src/FeaturesPlugin/Test/TestBooleanFuse_VertexCompound_VertexCompound.py b/src/FeaturesPlugin/Test/TestBooleanFuse_VertexCompound_VertexCompound.py index 3a497f317..23e9bf54c 100644 --- a/src/FeaturesPlugin/Test/TestBooleanFuse_VertexCompound_VertexCompound.py +++ b/src/FeaturesPlugin/Test/TestBooleanFuse_VertexCompound_VertexCompound.py @@ -18,6 +18,8 @@ ## email : webmaster.salome@opencascade.com ## +# -*- coding: utf-8 -*- + from salome.shaper import model model.begin() @@ -30,7 +32,7 @@ SketchPoint_2 = Sketch_1.addPoint(18.16931216931219, 17.1005291005291) SketchPoint_3 = Sketch_1.addPoint(-19.77248677248678, -16.03174603174603) SketchPoint_4 = Sketch_1.addPoint(21.37566137566138, -16.03174603174603) model.do() -Vertex_1_objects = [model.selection("VERTEX", "Sketch_1/Vertex-SketchPoint_3"), model.selection("VERTEX", "Sketch_1/Vertex-SketchPoint_1"), model.selection("VERTEX", "Sketch_1/Vertex-SketchPoint_4"), model.selection("VERTEX", "Sketch_1/Vertex-SketchPoint_2")] +Vertex_1_objects = [model.selection("VERTEX", "Sketch_1/SketchPoint_3"), model.selection("VERTEX", "Sketch_1/SketchPoint_1"), model.selection("VERTEX", "Sketch_1/SketchPoint_4"), model.selection("VERTEX", "Sketch_1/SketchPoint_2")] Vertex_1 = model.addVertex(Part_1_doc, Vertex_1_objects) Compound_1 = model.addCompound(Part_1_doc, [model.selection("VERTEX", "Vertex_1_1"), model.selection("VERTEX", "Vertex_1_2")]) Compound_2 = model.addCompound(Part_1_doc, [model.selection("VERTEX", "Vertex_1_3"), model.selection("VERTEX", "Vertex_1_4")]) diff --git a/src/FeaturesPlugin/Test/TestBooleanFuse_Vertex_Vertex.py b/src/FeaturesPlugin/Test/TestBooleanFuse_Vertex_Vertex.py index 70ce3aad8..c246d7f39 100644 --- a/src/FeaturesPlugin/Test/TestBooleanFuse_Vertex_Vertex.py +++ b/src/FeaturesPlugin/Test/TestBooleanFuse_Vertex_Vertex.py @@ -18,6 +18,8 @@ ## email : webmaster.salome@opencascade.com ## +# -*- coding: utf-8 -*- + from salome.shaper import model model.begin() @@ -28,7 +30,7 @@ Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY")) SketchPoint_1 = Sketch_1.addPoint(-6.078627161807992, -0.4501231771005025) SketchPoint_2 = Sketch_1.addPoint(7.482208269631659, 3.929326826374309) model.do() -Vertex_1 = model.addVertex(Part_1_doc, [model.selection("VERTEX", "Sketch_1/Vertex-SketchPoint_2"), model.selection("VERTEX", "Sketch_1/Vertex-SketchPoint_1")]) +Vertex_1 = model.addVertex(Part_1_doc, [model.selection("VERTEX", "Sketch_1/SketchPoint_2"), model.selection("VERTEX", "Sketch_1/SketchPoint_1")]) Fuse_1 = model.addFuse(Part_1_doc, [model.selection("VERTEX", "Vertex_1_1"), model.selection("VERTEX", "Vertex_1_2")]) model.testHaveNamingSubshapes(Fuse_1, model, Part_1_doc) model.do() diff --git a/src/FeaturesPlugin/Test/TestBooleanFuse_WireCompound_WireCompound.py b/src/FeaturesPlugin/Test/TestBooleanFuse_WireCompound_WireCompound.py index b7473f690..3a27c8a0c 100644 --- a/src/FeaturesPlugin/Test/TestBooleanFuse_WireCompound_WireCompound.py +++ b/src/FeaturesPlugin/Test/TestBooleanFuse_WireCompound_WireCompound.py @@ -18,6 +18,7 @@ ## email : webmaster.salome@opencascade.com ## +# -*- coding: utf-8 -*- from salome.shaper import model @@ -41,10 +42,10 @@ SketchLine_7 = Sketch_2.addLine(13.49417304964538, 51.08508368794326, 35.9844614 SketchLine_8 = Sketch_2.addLine(35.98446146572105, 27.95221560283687, 53.3341125295508, 47.87218534278959) SketchConstraintCoincidence_4 = Sketch_2.setCoincident(SketchLine_7.endPoint(), SketchLine_8.startPoint()) model.do() -Wire_1 = model.addWire(Part_1_doc, [model.selection("EDGE", "Sketch_1/Edge-SketchLine_1"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_2")]) -Wire_2 = model.addWire(Part_1_doc, [model.selection("EDGE", "Sketch_1/Edge-SketchLine_3"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_4")]) -Wire_3 = model.addWire(Part_1_doc, [model.selection("EDGE", "Sketch_2/Edge-SketchLine_5"), model.selection("EDGE", "Sketch_2/Edge-SketchLine_6")]) -Wire_4 = model.addWire(Part_1_doc, [model.selection("EDGE", "Sketch_2/Edge-SketchLine_7"), model.selection("EDGE", "Sketch_2/Edge-SketchLine_8")]) +Wire_1 = model.addWire(Part_1_doc, [model.selection("EDGE", "Sketch_1/SketchLine_1"), model.selection("EDGE", "Sketch_1/SketchLine_2")]) +Wire_2 = model.addWire(Part_1_doc, [model.selection("EDGE", "Sketch_1/SketchLine_3"), model.selection("EDGE", "Sketch_1/SketchLine_4")]) +Wire_3 = model.addWire(Part_1_doc, [model.selection("EDGE", "Sketch_2/SketchLine_5"), model.selection("EDGE", "Sketch_2/SketchLine_6")]) +Wire_4 = model.addWire(Part_1_doc, [model.selection("EDGE", "Sketch_2/SketchLine_7"), model.selection("EDGE", "Sketch_2/SketchLine_8")]) Compound_1 = model.addCompound(Part_1_doc, [model.selection("WIRE", "Wire_1_1"), model.selection("WIRE", "Wire_2_1")]) Compound_2 = model.addCompound(Part_1_doc, [model.selection("WIRE", "Wire_3_1"), model.selection("WIRE", "Wire_4_1")]) Fuse_1 = model.addFuse(Part_1_doc, [model.selection("COMPOUND", "Compound_1_1"), model.selection("COMPOUND", "Compound_2_1")]) diff --git a/src/FeaturesPlugin/Test/TestBooleanFuse_Wire_Wire.py b/src/FeaturesPlugin/Test/TestBooleanFuse_Wire_Wire.py index 0cb778f8e..c4261102f 100644 --- a/src/FeaturesPlugin/Test/TestBooleanFuse_Wire_Wire.py +++ b/src/FeaturesPlugin/Test/TestBooleanFuse_Wire_Wire.py @@ -18,6 +18,8 @@ ## email : webmaster.salome@opencascade.com ## +# -*- coding: utf-8 -*- + from salome.shaper import model model.begin() @@ -34,8 +36,8 @@ SketchLine_3 = Sketch_2.addLine(-23.92129524945932, 7.630068312327553, -4.124361 SketchLine_4 = Sketch_2.addLine(-4.124361249906777, 34.02598031173091, 14.43526437467373, 6.392759937355498) SketchConstraintCoincidence_2 = Sketch_2.setCoincident(SketchLine_3.endPoint(), SketchLine_4.startPoint()) model.do() -Wire_1 = model.addWire(Part_1_doc, [model.selection("EDGE", "Sketch_1/Edge-SketchLine_1"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_2")]) -Wire_2 = model.addWire(Part_1_doc, [model.selection("EDGE", "Sketch_2/Edge-SketchLine_3"), model.selection("EDGE", "Sketch_2/Edge-SketchLine_4")]) +Wire_1 = model.addWire(Part_1_doc, [model.selection("EDGE", "Sketch_1/SketchLine_1"), model.selection("EDGE", "Sketch_1/SketchLine_2")]) +Wire_2 = model.addWire(Part_1_doc, [model.selection("EDGE", "Sketch_2/SketchLine_3"), model.selection("EDGE", "Sketch_2/SketchLine_4")]) Fuse_1 = model.addFuse(Part_1_doc, [model.selection("WIRE", "Wire_1_1"), model.selection("WIRE", "Wire_2_1")]) model.testHaveNamingSubshapes(Fuse_1, model, Part_1_doc) model.do() diff --git a/src/FeaturesPlugin/Test/TestBooleanSmash_Face_Face.py b/src/FeaturesPlugin/Test/TestBooleanSmash_Face_Face.py index 06198375b..56c4b9a9f 100644 --- a/src/FeaturesPlugin/Test/TestBooleanSmash_Face_Face.py +++ b/src/FeaturesPlugin/Test/TestBooleanSmash_Face_Face.py @@ -18,6 +18,8 @@ ## email : webmaster.salome@opencascade.com ## +# -*- coding: utf-8 -*- + from salome.shaper import model model.begin() @@ -30,7 +32,7 @@ model.do() Sketch_2 = model.addSketch(Part_1_doc, model.defaultPlane("XOY")) SketchCircle_2 = Sketch_2.addCircle(12.30017152658664, 14.37907375643225, 29.61574408620473) model.do() -Face_1 = model.addFace(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchCircle_1_2f"), model.selection("FACE", "Sketch_2/Face-SketchCircle_2_2f")]) +Face_1 = model.addFace(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchCircle_1_2r"), model.selection("FACE", "Sketch_2/Face-SketchCircle_2_2r")]) Smash_1 = model.addSmash(Part_1_doc, [model.selection("FACE", "Face_1_1")], [model.selection("FACE", "Face_1_2")]) model.testHaveNamingSubshapes(Smash_1, model, Part_1_doc) model.do() diff --git a/src/FeaturesPlugin/Test/TestExtrusion.py b/src/FeaturesPlugin/Test/TestExtrusion.py index 5e44cac12..23494e923 100644 --- a/src/FeaturesPlugin/Test/TestExtrusion.py +++ b/src/FeaturesPlugin/Test/TestExtrusion.py @@ -250,9 +250,9 @@ anExtrusionFt.selectionList("base").append( anExtrusionFt.string("CreationMethod").setValue("ByPlanesAndOffsets") anExtrusionFt.real("to_size").setValue(0) #TODO: remove anExtrusionFt.real("from_size").setValue(0) #TODO: remove -anExtrusionFt.selection("to_object").selectSubShape("face", "Extrusion_3_1/Generated_Face_3") +anExtrusionFt.selection("to_object").selectSubShape("face", "Extrusion_3_1/Generated_Face&Sketch_2/SketchLine_3") anExtrusionFt.real("to_offset").setValue(0) -anExtrusionFt.selection("from_object").selectSubShape("face", "Extrusion_3_1/Generated_Face_4") +anExtrusionFt.selection("from_object").selectSubShape("face", "Extrusion_3_1/Generated_Face&Sketch_2/SketchLine_4") anExtrusionFt.real("from_offset").setValue(0) anExtrusionFt.execute() aSession.finishOperation() diff --git a/src/FeaturesPlugin/Test/TestExtrusionCut.py b/src/FeaturesPlugin/Test/TestExtrusionCut.py index af4c49179..2166e6474 100644 --- a/src/FeaturesPlugin/Test/TestExtrusionCut.py +++ b/src/FeaturesPlugin/Test/TestExtrusionCut.py @@ -108,7 +108,7 @@ dirx = geomDataAPI_Dir(aCircleSketchFeature.attribute("DirX")) dirx.setValue(1, 0, 0) norm = geomDataAPI_Dir(aCircleSketchFeature.attribute("Norm")) norm.setValue(0, 0, 1) -aCircleSketchFeature.selection("External").selectSubShape("face", "Extrusion_1/To_Face_1") +aCircleSketchFeature.selection("External").selectSubShape("face", "Extrusion_1/To_Face") aSession.startOperation() aSketchCircle = aCircleSketchFeature.addFeature("SketchCircle") anCircleCentr = geomDataAPI_Point2D(aSketchCircle.attribute("circle_center")) diff --git a/src/FeaturesPlugin/Test/TestExtrusionFuse.py b/src/FeaturesPlugin/Test/TestExtrusionFuse.py index a8c6cb8c3..4e6489054 100644 --- a/src/FeaturesPlugin/Test/TestExtrusionFuse.py +++ b/src/FeaturesPlugin/Test/TestExtrusionFuse.py @@ -108,7 +108,7 @@ dirx = geomDataAPI_Dir(aCircleSketchFeature.attribute("DirX")) dirx.setValue(1, 0, 0) norm = geomDataAPI_Dir(aCircleSketchFeature.attribute("Norm")) norm.setValue(0, 0, 1) -aCircleSketchFeature.selection("External").selectSubShape("face", "Extrusion_1/To_Face_1") +aCircleSketchFeature.selection("External").selectSubShape("face", "Extrusion_1/To_Face") aSession.startOperation() aSketchCircle = aCircleSketchFeature.addFeature("SketchCircle") anCircleCentr = geomDataAPI_Point2D(aSketchCircle.attribute("circle_center")) diff --git a/src/FeaturesPlugin/Test/TestFillCompFaceSolid.py b/src/FeaturesPlugin/Test/TestFillCompFaceSolid.py index 832475bb2..b5c42db80 100644 --- a/src/FeaturesPlugin/Test/TestFillCompFaceSolid.py +++ b/src/FeaturesPlugin/Test/TestFillCompFaceSolid.py @@ -1,4 +1,4 @@ -## Copyright (C) 2017 CEA/DEN, EDF R&D +## Copyright (C) 2014-2017 CEA/DEN, EDF R&D ## ## This library is free software; you can redistribute it and/or ## modify it under the terms of the GNU Lesser General Public @@ -18,6 +18,7 @@ ## email : webmaster.salome@opencascade.com ## +# -*- coding: utf-8 -*- from SketchAPI import * @@ -50,13 +51,13 @@ SketchConstraintDistanceVertical_1 = Sketch_1.setVerticalDistance(SketchAPI_Line 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) -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("FACE", "Face_1_1")], [model.selection("FACE", "Plane_2")]) -Boolean_2 = model.addFill(Part_1_doc, [model.selection("COMPOUND", "Fill_1_1")], [model.selection("SOLID", "Box_1_1")]) +Face_1 = model.addFace(Part_1_doc, [model.selection("WIRE", "[Sketch_1/SubEdge&Sketch_1/SketchArc_1_2][Sketch_1/SubEdge&Sketch_1/SketchLine_2][Sketch_1/SubEdge&Sketch_1/SketchLine_3]")]) +Fill_1 = model.addFill(Part_1_doc, [model.selection("FACE", "Face_1_1")], [model.selection("FACE", "Plane_2")]) +Fill_2 = model.addFill(Part_1_doc, [model.selection("COMPOUND", "Fill_1_1")], [model.selection("SOLID", "Box_1_1")]) model.do() -model.checkResult(Boolean_2, model, 1, [6], [0], [6], [22], [44]) -model.testHaveNamingSubshapes(Boolean_2, model, Part_1_doc) +model.checkResult(Fill_2, model, 1, [6], [0], [6], [22], [44]) +model.testHaveNamingSubshapes(Fill_2, model, Part_1_doc) model.end() diff --git a/src/FeaturesPlugin/Test/TestFillEdgeEdge.py b/src/FeaturesPlugin/Test/TestFillEdgeEdge.py index 0c92a1422..452a91aa1 100644 --- a/src/FeaturesPlugin/Test/TestFillEdgeEdge.py +++ b/src/FeaturesPlugin/Test/TestFillEdgeEdge.py @@ -1,4 +1,4 @@ -## Copyright (C) 2017 CEA/DEN, EDF R&D +## Copyright (C) 2014-2017 CEA/DEN, EDF R&D ## ## This library is free software; you can redistribute it and/or ## modify it under the terms of the GNU Lesser General Public @@ -18,6 +18,7 @@ ## email : webmaster.salome@opencascade.com ## +# -*- coding: utf-8 -*- from salome.shaper import model @@ -30,18 +31,18 @@ SketchLine_1 = Sketch_1.addLine(-43.24383164005806, 13.92597968069667, 63.179970 model.do() Sketch_2 = model.addSketch(Part_1_doc, model.defaultPlane("XOY")) SketchLine_2 = Sketch_2.addLine(-21.12944291883177, 24.09981691608177, 39.13933236574746, 51.82677414066782) -SketchProjection_1 = Sketch_2.addProjection(model.selection("EDGE", "Sketch_1/Edge-SketchLine_1"), False) +SketchProjection_1 = Sketch_2.addProjection(model.selection("EDGE", "Sketch_1/SketchLine_1"), False) SketchLine_3 = SketchProjection_1.createdFeature() SketchConstraintCoincidence_1 = Sketch_2.setCoincident(SketchLine_2.startPoint(), SketchLine_3.result()) SketchConstraintCoincidence_2 = Sketch_2.setCoincident(SketchLine_2.endPoint(), SketchLine_3.result()) model.do() -Edge_1 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_1/Edge-SketchLine_1")]) -Edge_2 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_2/Edge-SketchLine_2")]) -Boolean_1 = model.addFill(Part_1_doc, [model.selection("EDGE", "Edge_1_1")], [model.selection("EDGE", "Edge_2_1")]) +Edge_1 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_1/SketchLine_1")]) +Edge_2 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_2/SketchLine_2")]) +Fill_1 = model.addFill(Part_1_doc, [model.selection("EDGE", "Edge_1_1")], [model.selection("EDGE", "Edge_2_1")]) model.do() -model.checkResult(Boolean_1,model,1,[3],[0],[0],[3],[6]) -model.testHaveNamingSubshapes(Boolean_1,model,Part_1_doc) +model.checkResult(Fill_1,model,1,[3],[0],[0],[3],[6]) +model.testHaveNamingSubshapes(Fill_1,model,Part_1_doc) model.end() diff --git a/src/FeaturesPlugin/Test/TestFillEdgeEdgeIntersected.py b/src/FeaturesPlugin/Test/TestFillEdgeEdgeIntersected.py index 5b5ee1cc4..9e4c8dca7 100644 --- a/src/FeaturesPlugin/Test/TestFillEdgeEdgeIntersected.py +++ b/src/FeaturesPlugin/Test/TestFillEdgeEdgeIntersected.py @@ -1,4 +1,4 @@ -## Copyright (C) 2017 CEA/DEN, EDF R&D +## Copyright (C) 2014-2017 CEA/DEN, EDF R&D ## ## This library is free software; you can redistribute it and/or ## modify it under the terms of the GNU Lesser General Public @@ -18,6 +18,7 @@ ## email : webmaster.salome@opencascade.com ## +# -*- coding: utf-8 -*- from salome.shaper import model @@ -31,13 +32,13 @@ model.do() Sketch_2 = model.addSketch(Part_1_doc, model.defaultPlane("XOZ")) SketchLine_2 = Sketch_2.addLine(-42.46271611030479, 53.71965718432511, 14.83075791001449, -51.73354862119014) model.do() -Edge_1 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_1/Edge-SketchLine_1")]) -Edge_2 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_2/Edge-SketchLine_2")]) -Boolean_1 = model.addFill(Part_1_doc, [model.selection("EDGE", "Edge_1_1")], [model.selection("EDGE", "Edge_2_1")]) +Edge_1 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_1/SketchLine_1")]) +Edge_2 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_2/SketchLine_2")]) +Fill_1 = model.addFill(Part_1_doc, [model.selection("EDGE", "Edge_1_1")], [model.selection("EDGE", "Edge_2_1")]) model.do() -model.checkResult(Boolean_1,model,1,[2],[0],[0],[2],[4]) -model.testHaveNamingSubshapes(Boolean_1,model,Part_1_doc) +model.checkResult(Fill_1,model,1,[2],[0],[0],[2],[4]) +model.testHaveNamingSubshapes(Fill_1,model,Part_1_doc) model.end() diff --git a/src/FeaturesPlugin/Test/TestFillEdgeFace.py b/src/FeaturesPlugin/Test/TestFillEdgeFace.py index 49a082413..fda6db633 100644 --- a/src/FeaturesPlugin/Test/TestFillEdgeFace.py +++ b/src/FeaturesPlugin/Test/TestFillEdgeFace.py @@ -1,4 +1,4 @@ -## Copyright (C) 2017 CEA/DEN, EDF R&D +## Copyright (C) 2014-2017 CEA/DEN, EDF R&D ## ## This library is free software; you can redistribute it and/or ## modify it under the terms of the GNU Lesser General Public @@ -18,6 +18,7 @@ ## email : webmaster.salome@opencascade.com ## +# -*- coding: utf-8 -*- from salome.shaper import model @@ -35,16 +36,17 @@ SketchLine_4 = Sketch_1.addLine(13.30716777939044, -81.12733381712628, -65.15998 SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchLine_3.endPoint(), SketchLine_4.startPoint()) SketchConstraintCoincidence_4 = Sketch_1.setCoincident(SketchLine_1.startPoint(), SketchLine_4.endPoint()) model.do() -Face_1 = model.addFace(Part_1_doc, [model.selection("EDGE", "Sketch_1/Edge-SketchLine_1"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_2"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_3"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_4")]) -Sketch_2 = model.addSketch(Part_1_doc, model.selection("FACE", "Sketch_1/Face-SketchLine_1r-SketchLine_2r-SketchLine_3r-SketchLine_4r")) +Face_1_objects = [model.selection("EDGE", "Sketch_1/SketchLine_1"), model.selection("EDGE", "Sketch_1/SketchLine_2"), model.selection("EDGE", "Sketch_1/SketchLine_3"), model.selection("EDGE", "Sketch_1/SketchLine_4")] +Face_1 = model.addFace(Part_1_doc, Face_1_objects) +Sketch_2 = model.addSketch(Part_1_doc, model.selection("FACE", "Sketch_1/Face-SketchLine_4r-SketchLine_3r-SketchLine_2r-SketchLine_1r")) SketchLine_5 = Sketch_2.addLine(-53.77011318694006, -47.84888937635935, 60.89888292381829, 36.13719175945) model.do() -Edge_1 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_2/Edge-SketchLine_5")]) -Boolean_1 = model.addFill(Part_1_doc, [model.selection("EDGE", "Edge_1_1")], [model.selection("FACE", "Face_1_1")]) +Edge_1 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_2/SketchLine_5")]) +Fill_1 = model.addFill(Part_1_doc, [model.selection("EDGE", "Edge_1_1")], [model.selection("FACE", "Face_1_1")]) model.do() -model.checkResult(Boolean_1, model, 1, [3], [0], [0], [3], [6]) -model.testHaveNamingSubshapes(Boolean_1, model, Part_1_doc) +model.checkResult(Fill_1, model, 1, [3], [0], [0], [3], [6]) +model.testHaveNamingSubshapes(Fill_1, model, Part_1_doc) model.end() diff --git a/src/FeaturesPlugin/Test/TestFillEdgeShell.py b/src/FeaturesPlugin/Test/TestFillEdgeShell.py index cd7be482d..c0b99730a 100644 --- a/src/FeaturesPlugin/Test/TestFillEdgeShell.py +++ b/src/FeaturesPlugin/Test/TestFillEdgeShell.py @@ -1,4 +1,4 @@ -## Copyright (C) 2017 CEA/DEN, EDF R&D +## Copyright (C) 2014-2017 CEA/DEN, EDF R&D ## ## This library is free software; you can redistribute it and/or ## modify it under the terms of the GNU Lesser General Public @@ -18,6 +18,7 @@ ## email : webmaster.salome@opencascade.com ## +# -*- coding: utf-8 -*- from SketchAPI import * @@ -40,19 +41,19 @@ SketchArc_2 = Sketch_1.addArc(38.14157263904823, 16.22495851193372, 56.770542089 SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchArc_1.endPoint(), SketchArc_2.startPoint()) SketchConstraintTangent_1 = Sketch_1.setTangent(SketchArc_1.results()[1], SketchArc_2.results()[1]) model.do() -Wire_1 = model.addWire(Part_1_doc, [model.selection("EDGE", "Sketch_1/Edge-SketchArc_1_2"), model.selection("EDGE", "Sketch_1/Edge-SketchArc_2_2")]) +Wire_1 = model.addWire(Part_1_doc, [model.selection("EDGE", "Sketch_1/SketchArc_1_2"), model.selection("EDGE", "Sketch_1/SketchArc_2_2")]) Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("WIRE", "Wire_1_1")], model.selection(), 70, 0) Shell_1 = model.addShell(Part_1_doc, [model.selection("SHELL", "Extrusion_1_1")]) Plane_4 = model.addPlane(Part_1_doc, model.selection("FACE", "PartSet/YOZ"), 30, False) Sketch_2 = model.addSketch(Part_1_doc, model.selection("FACE", "Plane_1")) SketchLine_3 = Sketch_2.addLine(-64.49168769733997, 17.16789081864163, 146.7677170722727, 22.9901626941168) model.do() -Edge_1 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_2/Edge-SketchLine_3")]) -Boolean_1 = model.addFill(Part_1_doc, [model.selection("EDGE", "Edge_1_1")], [model.selection("SHELL", "Shell_1_1")]) +Edge_1 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_2/SketchLine_3")]) +Fill_1 = model.addFill(Part_1_doc, [model.selection("EDGE", "Edge_1_1")], [model.selection("SHELL", "Shell_1_1")]) model.do() -model.checkResult(Boolean_1, model, 1, [3], [0], [0], [3], [6]) -model.testHaveNamingSubshapes(Boolean_1, model, Part_1_doc) +model.checkResult(Fill_1, model, 1, [3], [0], [0], [3], [6]) +model.testHaveNamingSubshapes(Fill_1, model, Part_1_doc) model.end() diff --git a/src/FeaturesPlugin/Test/TestFillEdgeSolid.py b/src/FeaturesPlugin/Test/TestFillEdgeSolid.py index 943d4e5a7..9cc4c12e7 100644 --- a/src/FeaturesPlugin/Test/TestFillEdgeSolid.py +++ b/src/FeaturesPlugin/Test/TestFillEdgeSolid.py @@ -1,4 +1,4 @@ -## Copyright (C) 2017 CEA/DEN, EDF R&D +## Copyright (C) 2014-2017 CEA/DEN, EDF R&D ## ## This library is free software; you can redistribute it and/or ## modify it under the terms of the GNU Lesser General Public @@ -18,6 +18,7 @@ ## email : webmaster.salome@opencascade.com ## +# -*- coding: utf-8 -*- from salome.shaper import model @@ -28,19 +29,19 @@ Part_1_doc = Part_1.document() Box_1 = model.addBox(Part_1_doc, 10, 10, 10) Sketch_1 = model.addSketch(Part_1_doc, model.selection("FACE", "Box_1_1/Front")) SketchLine_1 = Sketch_1.addLine(4, 10, 7, 0) -SketchProjection_1 = Sketch_1.addProjection(model.selection("EDGE", "Box_1_1/Front&Box_1_1/Top"), False) +SketchProjection_1 = Sketch_1.addProjection(model.selection("EDGE", "[Box_1_1/Front][Box_1_1/Top]"), False) SketchLine_2 = SketchProjection_1.createdFeature() SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_1.startPoint(), SketchLine_2.result()) -SketchProjection_2 = Sketch_1.addProjection(model.selection("EDGE", "Box_1_1/Front&Box_1_1/Bottom"), False) +SketchProjection_2 = Sketch_1.addProjection(model.selection("EDGE", "[Box_1_1/Front][Box_1_1/Bottom]"), False) SketchLine_3 = SketchProjection_2.createdFeature() SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchLine_3.result()) model.do() -Edge_1 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_1/Edge-SketchLine_1")]) -Boolean_1 = model.addFill(Part_1_doc, [model.selection("EDGE", "Edge_1_1")], [model.selection("SOLID", "Box_1_1")]) +Edge_1 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_1/SketchLine_1")]) +Fill_1 = model.addFill(Part_1_doc, [model.selection("EDGE", "Edge_1_1")], [model.selection("SOLID", "Box_1_1")]) model.do() -model.checkResult(Boolean_1, model, 1, [0], [0], [0], [1], [2]) -model.testHaveNamingSubshapes(Boolean_1, model, Part_1_doc) +model.checkResult(Fill_1, model, 1, [0], [0], [0], [1], [2]) +model.testHaveNamingSubshapes(Fill_1, model, Part_1_doc) model.end() diff --git a/src/FeaturesPlugin/Test/TestFillEdgeSolidIntersected.py b/src/FeaturesPlugin/Test/TestFillEdgeSolidIntersected.py index 5756635e1..630317d66 100644 --- a/src/FeaturesPlugin/Test/TestFillEdgeSolidIntersected.py +++ b/src/FeaturesPlugin/Test/TestFillEdgeSolidIntersected.py @@ -1,4 +1,4 @@ -## Copyright (C) 2017 CEA/DEN, EDF R&D +## Copyright (C) 2014-2017 CEA/DEN, EDF R&D ## ## This library is free software; you can redistribute it and/or ## modify it under the terms of the GNU Lesser General Public @@ -18,6 +18,7 @@ ## email : webmaster.salome@opencascade.com ## +# -*- coding: utf-8 -*- from SketchAPI import * @@ -36,12 +37,12 @@ SketchPoint_1 = SketchProjection_1.createdFeature() SketchConstraintMiddle_1 = Sketch_1.setMiddlePoint(SketchAPI_Point(SketchPoint_1).coordinates(), SketchLine_1.result()) SketchConstraintLength_1 = Sketch_1.setLength(SketchLine_1.result(), 20) model.do() -Edge_1 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_1/Edge-SketchLine_1")]) -Boolean_1 = model.addFill(Part_1_doc, [model.selection("EDGE", "Edge_1_1")], [model.selection("SOLID", "Cone_1_1")]) +Edge_1 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_1/SketchLine_1")]) +Fill_1 = model.addFill(Part_1_doc, [model.selection("EDGE", "Edge_1_1")], [model.selection("SOLID", "Cone_1_1")]) model.do() -model.checkResult(Boolean_1, model, 1, [3], [0], [0], [3], [6]) -model.testHaveNamingSubshapes(Boolean_1, model, Part_1_doc) +model.checkResult(Fill_1, model, 1, [3], [0], [0], [3], [6]) +model.testHaveNamingSubshapes(Fill_1, model, Part_1_doc) model.end() diff --git a/src/FeaturesPlugin/Test/TestFillEdgeVertex.py b/src/FeaturesPlugin/Test/TestFillEdgeVertex.py index 33ba672dc..3ff610374 100644 --- a/src/FeaturesPlugin/Test/TestFillEdgeVertex.py +++ b/src/FeaturesPlugin/Test/TestFillEdgeVertex.py @@ -1,4 +1,4 @@ -## Copyright (C) 2017 CEA/DEN, EDF R&D +## Copyright (C) 2014-2017 CEA/DEN, EDF R&D ## ## This library is free software; you can redistribute it and/or ## modify it under the terms of the GNU Lesser General Public @@ -18,6 +18,7 @@ ## email : webmaster.salome@opencascade.com ## +# -*- coding: utf-8 -*- from SketchAPI import * @@ -27,7 +28,7 @@ model.begin() partSet = model.moduleDocument() Part_1 = model.addPart(partSet) Part_1_doc = Part_1.document() -Point_1 = model.addPoint(Part_1_doc, 10, 10, 0) +Point_2 = model.addPoint(Part_1_doc, 10, 10, 0) Vertex_1 = model.addVertex(Part_1_doc, [model.selection("VERTEX", "Point_1")]) Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY")) SketchLine_1 = Sketch_1.addLine(-27.61369370623992, 41.69872643310781, 64.30052615729069, -35.76145957046036) @@ -35,12 +36,12 @@ SketchProjection_1 = Sketch_1.addProjection(model.selection("VERTEX", "Point_1") SketchPoint_1 = SketchProjection_1.createdFeature() SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_1.result(), SketchAPI_Point(SketchPoint_1).coordinates()) model.do() -Edge_1 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_1/Edge-SketchLine_1")]) -Boolean_1 = model.addFill(Part_1_doc, [model.selection("EDGE", "Edge_1_1")], [model.selection("VERTEX", "Vertex_1_1")]) +Edge_1 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_1/SketchLine_1")]) +Fill_1 = model.addFill(Part_1_doc, [model.selection("EDGE", "Edge_1_1")], [model.selection("VERTEX", "Vertex_1_1")]) model.do() -model.checkResult(Boolean_1,model,1,[2],[0],[0],[2],[4]) -model.testHaveNamingSubshapes(Boolean_1,model,Part_1_doc) +model.checkResult(Fill_1,model,1,[2],[0],[0],[2],[4]) +model.testHaveNamingSubshapes(Fill_1,model,Part_1_doc) model.end() diff --git a/src/FeaturesPlugin/Test/TestFillEdgeWire.py b/src/FeaturesPlugin/Test/TestFillEdgeWire.py index ead4aeb88..d4ee8813f 100644 --- a/src/FeaturesPlugin/Test/TestFillEdgeWire.py +++ b/src/FeaturesPlugin/Test/TestFillEdgeWire.py @@ -1,4 +1,4 @@ -## Copyright (C) 2017 CEA/DEN, EDF R&D +## Copyright (C) 2014-2017 CEA/DEN, EDF R&D ## ## This library is free software; you can redistribute it and/or ## modify it under the terms of the GNU Lesser General Public @@ -18,6 +18,7 @@ ## email : webmaster.salome@opencascade.com ## +# -*- coding: utf-8 -*- from salome.shaper import model @@ -38,13 +39,14 @@ SketchLine_5 = Sketch_2.addLine(55.26415094339622, -34.15529753265602, -40.60522 SketchConstraintCoincidence_3 = Sketch_2.setCoincident(SketchLine_4.endPoint(), SketchLine_5.startPoint()) SketchConstraintCoincidence_4 = Sketch_2.setCoincident(SketchLine_5.endPoint(), SketchLine_2.startPoint()) model.do() -Edge_1 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_1/Edge-SketchLine_1")]) -Wire_1 = model.addWire(Part_1_doc, [model.selection("EDGE", "Sketch_2/Edge-SketchLine_5"), model.selection("EDGE", "Sketch_2/Edge-SketchLine_2"), model.selection("EDGE", "Sketch_2/Edge-SketchLine_3"), model.selection("EDGE", "Sketch_2/Edge-SketchLine_4")]) -Boolean_1 = model.addFill(Part_1_doc, [model.selection("EDGE", "Edge_1_1")], [model.selection("WIRE", "Wire_1_1")]) +Edge_1 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_1/SketchLine_1")]) +Wire_1_objects = [model.selection("EDGE", "Sketch_2/SketchLine_5"), model.selection("EDGE", "Sketch_2/SketchLine_2"), model.selection("EDGE", "Sketch_2/SketchLine_3"), model.selection("EDGE", "Sketch_2/SketchLine_4")] +Wire_1 = model.addWire(Part_1_doc, Wire_1_objects) +Fill_1 = model.addFill(Part_1_doc, [model.selection("EDGE", "Edge_1_1")], [model.selection("WIRE", "Wire_1_1")]) model.do() -model.checkResult(Boolean_1, model, 1, [3], [0], [0], [3], [6]) -model.testHaveNamingSubshapes(Boolean_1, model, Part_1_doc) +model.checkResult(Fill_1, model, 1, [3], [0], [0], [3], [6]) +model.testHaveNamingSubshapes(Fill_1, model, Part_1_doc) model.end() diff --git a/src/FeaturesPlugin/Test/TestFillFaceEdge.py b/src/FeaturesPlugin/Test/TestFillFaceEdge.py index 5bcc0602a..a16030c88 100644 --- a/src/FeaturesPlugin/Test/TestFillFaceEdge.py +++ b/src/FeaturesPlugin/Test/TestFillFaceEdge.py @@ -1,4 +1,4 @@ -## Copyright (C) 2017 CEA/DEN, EDF R&D +## Copyright (C) 2014-2017 CEA/DEN, EDF R&D ## ## This library is free software; you can redistribute it and/or ## modify it under the terms of the GNU Lesser General Public @@ -18,6 +18,7 @@ ## email : webmaster.salome@opencascade.com ## +# -*- coding: utf-8 -*- from salome.shaper import model @@ -35,16 +36,17 @@ SketchLine_4 = Sketch_1.addLine(13.30716777939044, -81.12733381712628, -65.15998 SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchLine_3.endPoint(), SketchLine_4.startPoint()) SketchConstraintCoincidence_4 = Sketch_1.setCoincident(SketchLine_1.startPoint(), SketchLine_4.endPoint()) model.do() -Face_1 = model.addFace(Part_1_doc, [model.selection("EDGE", "Sketch_1/Edge-SketchLine_1"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_2"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_3"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_4")]) -Sketch_2 = model.addSketch(Part_1_doc, model.selection("FACE", "Sketch_1/Face-SketchLine_1r-SketchLine_2r-SketchLine_3r-SketchLine_4r")) +Face_1_objects = [model.selection("EDGE", "Sketch_1/SketchLine_1"), model.selection("EDGE", "Sketch_1/SketchLine_2"), model.selection("EDGE", "Sketch_1/SketchLine_3"), model.selection("EDGE", "Sketch_1/SketchLine_4")] +Face_1 = model.addFace(Part_1_doc, Face_1_objects) +Sketch_2 = model.addSketch(Part_1_doc, model.selection("FACE", "Sketch_1/Face-SketchLine_4r-SketchLine_3r-SketchLine_2r-SketchLine_1r")) SketchLine_5 = Sketch_2.addLine(-53.77011318694006, -47.84888937635935, 60.89888292381829, 36.13719175945) model.do() -Edge_1 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_2/Edge-SketchLine_5")]) -Boolean_1 = model.addFill(Part_1_doc, [model.selection("FACE", "Face_1_1")], [model.selection("EDGE", "Edge_1_1")]) +Edge_1 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_2/SketchLine_5")]) +Fill_1 = model.addFill(Part_1_doc, [model.selection("FACE", "Face_1_1")], [model.selection("EDGE", "Edge_1_1")]) model.do() -model.checkResult(Boolean_1,model,1,[2],[0],[2],[8],[16]) -model.testHaveNamingSubshapes(Boolean_1,model,Part_1_doc) +model.checkResult(Fill_1,model,1,[2],[0],[2],[8],[16]) +model.testHaveNamingSubshapes(Fill_1,model,Part_1_doc) model.end() diff --git a/src/FeaturesPlugin/Test/TestFillFaceEdgeInside.py b/src/FeaturesPlugin/Test/TestFillFaceEdgeInside.py index 44bd6384a..e28c492c6 100644 --- a/src/FeaturesPlugin/Test/TestFillFaceEdgeInside.py +++ b/src/FeaturesPlugin/Test/TestFillFaceEdgeInside.py @@ -1,4 +1,4 @@ -## Copyright (C) 2017 CEA/DEN, EDF R&D +## Copyright (C) 2014-2017 CEA/DEN, EDF R&D ## ## This library is free software; you can redistribute it and/or ## modify it under the terms of the GNU Lesser General Public @@ -18,6 +18,7 @@ ## email : webmaster.salome@opencascade.com ## +# -*- coding: utf-8 -*- from salome.shaper import model @@ -35,19 +36,20 @@ SketchLine_3 = Sketch_1.addLine(-34.74165457184325, -28.87808417997097, -49.4005 SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchLine_2.endPoint(), SketchLine_3.startPoint()) SketchConstraintCoincidence_4 = Sketch_1.setCoincident(SketchArc_1.startPoint(), SketchLine_3.endPoint()) model.do() -Sketch_2 = model.addSketch(Part_1_doc, model.selection("FACE", "Sketch_1/Face-SketchArc_1_2f-SketchLine_1r-SketchLine_2r-SketchLine_3r")) +Sketch_2 = model.addSketch(Part_1_doc, model.selection("FACE", "Sketch_1/Face-SketchArc_1_2r-SketchLine_3r-SketchLine_2r-SketchLine_1r")) SketchLine_4 = Sketch_2.addLine(-17.59187701681758, -17.53169787967194, -23.97073271029336, 4.338664497959301) -SketchProjection_1 = Sketch_2.addProjection(model.selection("EDGE", "Sketch_1/Edge-SketchLine_2"), False) +SketchProjection_1 = Sketch_2.addProjection(model.selection("EDGE", "Sketch_1/SketchLine_2"), False) SketchLine_5 = SketchProjection_1.createdFeature() SketchConstraintPerpendicular_1 = Sketch_2.setPerpendicular(SketchLine_4.result(), SketchLine_5.result()) model.do() -Edge_1 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_2/Edge-SketchLine_4")]) -Face_1 = model.addFace(Part_1_doc, [model.selection("EDGE", "Sketch_1/Edge-SketchLine_2"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_3"), model.selection("EDGE", "Sketch_1/Edge-SketchArc_1_2"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_1")]) -Boolean_1 = model.addFill(Part_1_doc, [model.selection("FACE", "Face_1_1")], [model.selection("EDGE", "Edge_1_1")]) +Edge_1 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_2/SketchLine_4")]) +Face_1_objects = [model.selection("EDGE", "Sketch_1/SketchLine_2"), model.selection("EDGE", "Sketch_1/SketchLine_3"), model.selection("EDGE", "Sketch_1/SketchArc_1_2"), model.selection("EDGE", "Sketch_1/SketchLine_1")] +Face_1 = model.addFace(Part_1_doc, Face_1_objects) +Fill_1 = model.addFill(Part_1_doc, [model.selection("FACE", "Face_1_1")], [model.selection("EDGE", "Edge_1_1")]) model.do() -model.checkResult(Boolean_1,model,1,[0],[0],[1],[5],[10]) -model.testHaveNamingSubshapes(Boolean_1,model,Part_1_doc) +model.checkResult(Fill_1,model,1,[0],[0],[1],[5],[10]) +model.testHaveNamingSubshapes(Fill_1,model,Part_1_doc) model.end() diff --git a/src/FeaturesPlugin/Test/TestFillFaceEdgePerpendicular.py b/src/FeaturesPlugin/Test/TestFillFaceEdgePerpendicular.py index 2d5182fd2..e088a9137 100644 --- a/src/FeaturesPlugin/Test/TestFillFaceEdgePerpendicular.py +++ b/src/FeaturesPlugin/Test/TestFillFaceEdgePerpendicular.py @@ -1,4 +1,4 @@ -## Copyright (C) 2017 CEA/DEN, EDF R&D +## Copyright (C) 2014-2017 CEA/DEN, EDF R&D ## ## This library is free software; you can redistribute it and/or ## modify it under the terms of the GNU Lesser General Public @@ -18,6 +18,7 @@ ## email : webmaster.salome@opencascade.com ## +# -*- coding: utf-8 -*- from salome.shaper import model @@ -42,13 +43,14 @@ model.do() Sketch_2 = model.addSketch(Part_1_doc, model.defaultPlane("YOZ")) SketchLine_7 = Sketch_2.addLine(24.33758278426026, -52.48127186534471, 29.40566289183227, 59.45054433956496) model.do() -Edge_1 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_2/Edge-SketchLine_7")]) -Face_1 = model.addFace(Part_1_doc, [model.selection("EDGE", "Sketch_1/Edge-SketchLine_1"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_6"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_5"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_4"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_3"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_2")]) -Boolean_1 = model.addFill(Part_1_doc, [model.selection("FACE", "Face_1_1")], [model.selection("EDGE", "Edge_1_1")]) +Edge_1 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_2/SketchLine_7")]) +Face_1_objects = [model.selection("EDGE", "Sketch_1/SketchLine_1"), model.selection("EDGE", "Sketch_1/SketchLine_6"), model.selection("EDGE", "Sketch_1/SketchLine_5"), model.selection("EDGE", "Sketch_1/SketchLine_4"), model.selection("EDGE", "Sketch_1/SketchLine_3"), model.selection("EDGE", "Sketch_1/SketchLine_2")] +Face_1 = model.addFace(Part_1_doc, Face_1_objects) +Fill_1 = model.addFill(Part_1_doc, [model.selection("FACE", "Face_1_1")], [model.selection("EDGE", "Edge_1_1")]) model.do() -model.checkResult(Boolean_1,model,1,[0],[0],[1],[6],[13]) -model.testHaveNamingSubshapes(Boolean_1,model,Part_1_doc) +model.checkResult(Fill_1,model,1,[0],[0],[1],[6],[13]) +model.testHaveNamingSubshapes(Fill_1,model,Part_1_doc) model.end() diff --git a/src/FeaturesPlugin/Test/TestFillFaceFace.py b/src/FeaturesPlugin/Test/TestFillFaceFace.py index d7ce14972..87cf85524 100644 --- a/src/FeaturesPlugin/Test/TestFillFaceFace.py +++ b/src/FeaturesPlugin/Test/TestFillFaceFace.py @@ -1,4 +1,4 @@ -## Copyright (C) 2017 CEA/DEN, EDF R&D +## Copyright (C) 2014-2017 CEA/DEN, EDF R&D ## ## This library is free software; you can redistribute it and/or ## modify it under the terms of the GNU Lesser General Public @@ -18,9 +18,9 @@ ## email : webmaster.salome@opencascade.com ## +# -*- coding: utf-8 -*- from salome.shaper import model -from SketchAPI import * model.begin() partSet = model.moduleDocument() @@ -42,26 +42,26 @@ SketchConstraintRadius_1 = Sketch_1.setRadius(SketchArc_1.results()[1], "R") model.do() Sketch_2 = model.addSketch(Part_1_doc, model.defaultPlane("YOZ")) SketchLine_4 = Sketch_2.addLine(31.79164821526215, 49.99496405877289, 8.200436015051352, 0) -SketchProjection_2 = Sketch_2.addProjection(model.selection("VERTEX", "Sketch_1/Vertex-SketchLine_3s-SketchLine_1e"), False) +SketchProjection_2 = Sketch_2.addProjection(model.selection("VERTEX", "Sketch_1/SketchLine_1_EndVertex"), False) SketchPoint_1 = SketchProjection_2.createdFeature() SketchConstraintCoincidence_6 = Sketch_2.setCoincident(SketchLine_4.endPoint(), SketchPoint_1.result()) SketchLine_5 = Sketch_2.addLine(8.200436015051352, 0, 27.24680168984479, -49.85269382803262) SketchConstraintCoincidence_7 = Sketch_2.setCoincident(SketchLine_4.endPoint(), SketchLine_5.startPoint()) -SketchProjection_3 = Sketch_2.addProjection(model.selection("VERTEX", "Sketch_1/Vertex-SketchArc_1"), False) +SketchProjection_3 = Sketch_2.addProjection(model.selection("VERTEX", "Sketch_1/SketchArc_1"), False) SketchPoint_2 = SketchProjection_3.createdFeature() -SketchArc_2 = Sketch_2.addArc(31.08202242513997, 1.147024884467139e-021, 27.24680168984479, -49.85269382803262, 31.79164821526215, 49.99496405877289, False) +SketchArc_2 = Sketch_2.addArc(31.08202242513997, 1.147024884467139e-21, 27.24680168984479, -49.85269382803262, 31.79164821526215, 49.99496405877289, False) SketchConstraintCoincidence_8 = Sketch_2.setCoincident(SketchPoint_2.result(), SketchArc_2.center()) 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") 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")]) -Boolean_1 = model.addFill(Part_1_doc, [model.selection("FACE", "Face_1_1")], [model.selection("FACE", "Face_2_1")]) +Face_1 = model.addFace(Part_1_doc, [model.selection("WIRE", "[Sketch_1/SubEdge&Sketch_1/SketchLine_1][Sketch_1/SubEdge&Sketch_1/SketchLine_3][Sketch_1/SubEdge&Sketch_1/SketchArc_1_2]")]) +Face_2 = model.addFace(Part_1_doc, [model.selection("WIRE", "[Sketch_2/SubEdge&Sketch_2/SketchLine_4][Sketch_2/SubEdge&Sketch_2/SketchLine_5][Sketch_2/SubEdge&Sketch_2/SketchArc_2_2]")]) +Fill_1 = model.addFill(Part_1_doc, [model.selection("FACE", "Face_1_1")], [model.selection("FACE", "Face_2_1")]) model.do() -model.checkResult(Boolean_1, model, 1, [2], [0], [2], [6], [12]) -model.testHaveNamingSubshapes(Boolean_1, model, Part_1_doc) +model.checkResult(Fill_1, model, 1, [2], [0], [2], [6], [12]) +model.testHaveNamingSubshapes(Fill_1, model, Part_1_doc) model.end() diff --git a/src/FeaturesPlugin/Test/TestFillFaceShell.py b/src/FeaturesPlugin/Test/TestFillFaceShell.py index 068e4aebe..9882852fb 100644 --- a/src/FeaturesPlugin/Test/TestFillFaceShell.py +++ b/src/FeaturesPlugin/Test/TestFillFaceShell.py @@ -1,4 +1,4 @@ -## Copyright (C) 2017 CEA/DEN, EDF R&D +## Copyright (C) 2014-2017 CEA/DEN, EDF R&D ## ## This library is free software; you can redistribute it and/or ## modify it under the terms of the GNU Lesser General Public @@ -18,6 +18,7 @@ ## email : webmaster.salome@opencascade.com ## +# -*- coding: utf-8 -*- from SketchAPI import * @@ -97,15 +98,15 @@ SketchLine_15.result().setName("SketchLine_16") SketchConstraintCoincidence_13 = Sketch_2.setCoincident(SketchAPI_Line(SketchLine_12).startPoint(), SketchLine_15.startPoint()) SketchConstraintCoincidence_14 = Sketch_2.setCoincident(SketchLine_15.endPoint(), SketchLine_8.startPoint()) model.do() -Face_1 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_1/Wire-SketchLine_1f-SketchLine_5f-SketchLine_6r")]) -Face_2 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_1/Wire-SketchLine_3f-SketchLine_4f-SketchLine_6f")]) +Face_1 = model.addFace(Part_1_doc, [model.selection("WIRE", "[Sketch_1/SubEdge&Sketch_1/SketchLine_1][Sketch_1/SubEdge&Sketch_1/SketchLine_6][Sketch_1/SubEdge&Sketch_1/SketchLine_5]")]) +Face_2 = model.addFace(Part_1_doc, [model.selection("WIRE", "[Sketch_1/SubEdge&Sketch_1/SketchLine_3][Sketch_1/SubEdge&Sketch_1/SketchLine_4][Sketch_1/SubEdge&Sketch_1/SketchLine_6]")]) Shell_1 = model.addShell(Part_1_doc, [model.selection("FACE", "Face_1_1"), model.selection("FACE", "Face_2_1")]) -Face_3 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_2/Wire-SketchLine_9f-SketchLine_11f-SketchLine_12f-SketchLine_13r-SketchLine_14r-SketchLine_15r-SketchLine_16f")]) -Boolean_1 = model.addFill(Part_1_doc, [model.selection("FACE", "Face_3_1")], [model.selection("SHELL", "Shell_1_1")]) +Face_3 = model.addFace(Part_1_doc, [model.selection("WIRE", "[Sketch_2/SubEdge&Sketch_2/SketchLine_9][Sketch_2/SubEdge&Sketch_2/SketchLine_11][Sketch_2/SubEdge&Sketch_2/SketchLine_12][Sketch_2/SubEdge&Sketch_2/SketchLine_15][Sketch_2/SubEdge&Sketch_2/SketchLine_14][Sketch_2/SubEdge&Sketch_2/SketchLine_13][Sketch_2/SubEdge&Sketch_2/SketchLine_16]")]) +Fill_1 = model.addFill(Part_1_doc, [model.selection("FACE", "Face_3_1")], [model.selection("SHELL", "Shell_1_1")]) model.do() -model.checkResult(Boolean_1, model, 1, [3], [0], [3], [14], [28]) -model.testHaveNamingSubshapes(Boolean_1, model, Part_1_doc) +model.checkResult(Fill_1, model, 1, [3], [0], [3], [14], [28]) +model.testHaveNamingSubshapes(Fill_1, model, Part_1_doc) model.end() diff --git a/src/FeaturesPlugin/Test/TestFillFaceSolid.py b/src/FeaturesPlugin/Test/TestFillFaceSolid.py index a99fa556f..376405c61 100644 --- a/src/FeaturesPlugin/Test/TestFillFaceSolid.py +++ b/src/FeaturesPlugin/Test/TestFillFaceSolid.py @@ -1,4 +1,4 @@ -## Copyright (C) 2017 CEA/DEN, EDF R&D +## Copyright (C) 2014-2017 CEA/DEN, EDF R&D ## ## This library is free software; you can redistribute it and/or ## modify it under the terms of the GNU Lesser General Public @@ -18,6 +18,7 @@ ## email : webmaster.salome@opencascade.com ## +# -*- coding: utf-8 -*- from SketchAPI import * @@ -49,12 +50,12 @@ SketchConstraintRadius_1 = Sketch_1.setRadius(SketchArc_1.results()[1], "L+Shift 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")]) -Boolean_1 = model.addFill(Part_1_doc, [model.selection("FACE", "Face_1_1")], [model.selection("SOLID", "Box_1_1")]) +Face_1 = model.addFace(Part_1_doc, [model.selection("WIRE", "[Sketch_1/SubEdge&Sketch_1/SketchArc_1_2][Sketch_1/SubEdge&Sketch_1/SketchLine_2][Sketch_1/SubEdge&Sketch_1/SketchLine_3]")]) +Fill_1 = model.addFill(Part_1_doc, [model.selection("FACE", "Face_1_1")], [model.selection("SOLID", "Box_1_1")]) model.do() -model.checkResult(Boolean_1, model, 1, [4], [0], [4], [15], [30]) -model.testHaveNamingSubshapes(Boolean_1, model, Part_1_doc) +model.checkResult(Fill_1, model, 1, [4], [0], [4], [15], [30]) +model.testHaveNamingSubshapes(Fill_1, model, Part_1_doc) model.end() diff --git a/src/FeaturesPlugin/Test/TestFillFaceVertex.py b/src/FeaturesPlugin/Test/TestFillFaceVertex.py index 21b11a3d1..23a1a71db 100644 --- a/src/FeaturesPlugin/Test/TestFillFaceVertex.py +++ b/src/FeaturesPlugin/Test/TestFillFaceVertex.py @@ -1,4 +1,4 @@ -## Copyright (C) 2017 CEA/DEN, EDF R&D +## Copyright (C) 2014-2017 CEA/DEN, EDF R&D ## ## This library is free software; you can redistribute it and/or ## modify it under the terms of the GNU Lesser General Public @@ -18,6 +18,7 @@ ## email : webmaster.salome@opencascade.com ## +# -*- coding: utf-8 -*- from salome.shaper import model @@ -40,13 +41,14 @@ SketchConstraintVertical_1 = Sketch_1.setVertical(SketchLine_2.result()) SketchConstraintHorizontal_2 = Sketch_1.setHorizontal(SketchLine_3.result()) SketchConstraintVertical_2 = Sketch_1.setVertical(SketchLine_4.result()) model.do() -Face_1 = model.addFace(Part_1_doc, [model.selection("EDGE", "Sketch_1/Edge-SketchLine_1"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_4"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_3"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_2")]) +Face_1_objects = [model.selection("EDGE", "Sketch_1/SketchLine_1"), model.selection("EDGE", "Sketch_1/SketchLine_4"), model.selection("EDGE", "Sketch_1/SketchLine_3"), model.selection("EDGE", "Sketch_1/SketchLine_2")] +Face_1 = model.addFace(Part_1_doc, Face_1_objects) Vertex_1 = model.addVertex(Part_1_doc, [model.selection("VERTEX", "Point_1")]) -Boolean_1 = model.addFill(Part_1_doc, [model.selection("FACE", "Face_1_1")], [model.selection("VERTEX", "Vertex_1_1")]) +Fill_1 = model.addFill(Part_1_doc, [model.selection("FACE", "Face_1_1")], [model.selection("VERTEX", "Vertex_1_1")]) model.do() -model.checkResult(Boolean_1,model,1,[0],[0],[1],[4],[9]) -model.testHaveNamingSubshapes(Boolean_1,model,Part_1_doc) +model.checkResult(Fill_1,model,1,[0],[0],[1],[4],[9]) +model.testHaveNamingSubshapes(Fill_1,model,Part_1_doc) model.end() diff --git a/src/FeaturesPlugin/Test/TestFillFaceWire.py b/src/FeaturesPlugin/Test/TestFillFaceWire.py index b38a7a3de..f00e0f0aa 100644 --- a/src/FeaturesPlugin/Test/TestFillFaceWire.py +++ b/src/FeaturesPlugin/Test/TestFillFaceWire.py @@ -1,4 +1,4 @@ -## Copyright (C) 2017 CEA/DEN, EDF R&D +## Copyright (C) 2014-2017 CEA/DEN, EDF R&D ## ## This library is free software; you can redistribute it and/or ## modify it under the terms of the GNU Lesser General Public @@ -18,6 +18,7 @@ ## email : webmaster.salome@opencascade.com ## +# -*- coding: utf-8 -*- from salome.shaper import model @@ -45,19 +46,19 @@ SketchLine_5 = Sketch_2.addLine(-18.23994072168525, 7.835320880296757, 13.893416 SketchConstraintCoincidence_6 = Sketch_2.setCoincident(SketchLine_4.endPoint(), SketchLine_5.startPoint()) SketchLine_6 = Sketch_2.addLine(13.89341696052619, 27.33089138697832, 39.39985877388298, 9.747860956493145) SketchConstraintCoincidence_7 = Sketch_2.setCoincident(SketchLine_5.endPoint(), SketchLine_6.startPoint()) -SketchLine_7 = Sketch_2.addLine(39.39985877388298, 9.747860956493145, 38.20105433548567, 71.93732104572752) +SketchLine_7 = Sketch_2.addLine(39.39985877388298, 9.747860956493145, 38.20105433548567, 71.93732104572751) SketchConstraintCoincidence_8 = Sketch_2.setCoincident(SketchLine_6.endPoint(), SketchLine_7.startPoint()) -SketchLine_8 = Sketch_2.addLine(38.20105433548567, 71.93732104572752, -42.38833891077762, 73.71572760627062) +SketchLine_8 = Sketch_2.addLine(38.20105433548567, 71.93732104572751, -42.38833891077762, 73.71572760627062) SketchConstraintCoincidence_9 = Sketch_2.setCoincident(SketchLine_7.endPoint(), SketchLine_8.startPoint()) SketchConstraintCoincidence_10 = Sketch_2.setCoincident(SketchLine_4.startPoint(), SketchLine_8.endPoint()) model.do() -Face_1 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_1/Wire-SketchLine_1f-SketchLine_3f-SketchArc_1_2f")]) -Wire_1 = model.addWire(Part_1_doc, [model.selection("WIRE", "Sketch_2/Wire-SketchLine_4f-SketchLine_5f-SketchLine_6f-SketchLine_7f-SketchLine_8f")]) -Boolean_1 = model.addFill(Part_1_doc, [model.selection("FACE", "Face_1_1")], [model.selection("WIRE", "Wire_1_1")]) +Face_1 = model.addFace(Part_1_doc, [model.selection("WIRE", "[Sketch_1/SubEdge&Sketch_1/SketchLine_1][Sketch_1/SubEdge&Sketch_1/SketchLine_3][Sketch_1/SubEdge&Sketch_1/SketchArc_1_2]")]) +Wire_1 = model.addWire(Part_1_doc, [model.selection("WIRE", "[Sketch_2/SubEdge&Sketch_2/SketchLine_4][Sketch_2/SubEdge&Sketch_2/SketchLine_5][Sketch_2/SubEdge&Sketch_2/SketchLine_6][Sketch_2/SubEdge&Sketch_2/SketchLine_7][Sketch_2/SubEdge&Sketch_2/SketchLine_8]")]) +Fill_1 = model.addFill(Part_1_doc, [model.selection("FACE", "Face_1_1")], [model.selection("WIRE", "Wire_1_1")]) model.do() -model.checkResult(Boolean_1, model, 1, [5], [0], [5], [21], [42]) -model.testHaveNamingSubshapes(Boolean_1, model, Part_1_doc) +model.checkResult(Fill_1, model, 1, [5], [0], [5], [21], [42]) +model.testHaveNamingSubshapes(Fill_1, model, Part_1_doc) model.end() diff --git a/src/FeaturesPlugin/Test/TestFillShellConstrPlane.py b/src/FeaturesPlugin/Test/TestFillShellConstrPlane.py index a0bd627ba..a1e1043fd 100644 --- a/src/FeaturesPlugin/Test/TestFillShellConstrPlane.py +++ b/src/FeaturesPlugin/Test/TestFillShellConstrPlane.py @@ -1,4 +1,4 @@ -## Copyright (C) 2017 CEA/DEN, EDF R&D +## Copyright (C) 2014-2017 CEA/DEN, EDF R&D ## ## This library is free software; you can redistribute it and/or ## modify it under the terms of the GNU Lesser General Public @@ -18,6 +18,7 @@ ## email : webmaster.salome@opencascade.com ## +# -*- coding: utf-8 -*- from SketchAPI import * @@ -40,14 +41,14 @@ SketchArc_2 = Sketch_1.addArc(38.14157263904823, 16.22495851193372, 56.770542089 SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchArc_1.endPoint(), SketchArc_2.startPoint()) SketchConstraintTangent_1 = Sketch_1.setTangent(SketchArc_1.results()[1], SketchArc_2.results()[1]) model.do() -Wire_1 = model.addWire(Part_1_doc, [model.selection("EDGE", "Sketch_1/Edge-SketchArc_1_2"), model.selection("EDGE", "Sketch_1/Edge-SketchArc_2_2")]) +Wire_1 = model.addWire(Part_1_doc, [model.selection("EDGE", "Sketch_1/SketchArc_1_2"), model.selection("EDGE", "Sketch_1/SketchArc_2_2")]) Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("WIRE", "Wire_1_1")], model.selection(), 70, 0) Shell_1 = model.addShell(Part_1_doc, [model.selection("SHELL", "Extrusion_1_1")]) -Boolean_1 = model.addFill(Part_1_doc, [model.selection("SHELL", "Shell_1_1")], [model.selection("FACE", "PartSet/XOZ")]) +Fill_1 = model.addFill(Part_1_doc, [model.selection("SHELL", "Shell_1_1")], [model.selection("FACE", "PartSet/XOZ")]) model.do() -model.checkResult(Boolean_1,model,1,[0],[0],[3],[12],[24]) -model.testHaveNamingSubshapes(Boolean_1,model,Part_1_doc) +model.checkResult(Fill_1,model,1,[0],[0],[3],[12],[24]) +model.testHaveNamingSubshapes(Fill_1,model,Part_1_doc) model.end() diff --git a/src/FeaturesPlugin/Test/TestFillShellEdge.py b/src/FeaturesPlugin/Test/TestFillShellEdge.py index 20f0ed60f..a81a80960 100644 --- a/src/FeaturesPlugin/Test/TestFillShellEdge.py +++ b/src/FeaturesPlugin/Test/TestFillShellEdge.py @@ -1,4 +1,4 @@ -## Copyright (C) 2017 CEA/DEN, EDF R&D +## Copyright (C) 2014-2017 CEA/DEN, EDF R&D ## ## This library is free software; you can redistribute it and/or ## modify it under the terms of the GNU Lesser General Public @@ -18,6 +18,7 @@ ## email : webmaster.salome@opencascade.com ## +# -*- coding: utf-8 -*- from SketchAPI import * @@ -40,19 +41,19 @@ SketchArc_2 = Sketch_1.addArc(38.14157263904823, 16.22495851193372, 56.770542089 SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchArc_1.endPoint(), SketchArc_2.startPoint()) SketchConstraintTangent_1 = Sketch_1.setTangent(SketchArc_1.results()[1], SketchArc_2.results()[1]) model.do() -Wire_1 = model.addWire(Part_1_doc, [model.selection("EDGE", "Sketch_1/Edge-SketchArc_1_2"), model.selection("EDGE", "Sketch_1/Edge-SketchArc_2_2")]) +Wire_1 = model.addWire(Part_1_doc, [model.selection("EDGE", "Sketch_1/SketchArc_1_2"), model.selection("EDGE", "Sketch_1/SketchArc_2_2")]) Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("WIRE", "Wire_1_1")], model.selection(), 70, 0) Shell_1 = model.addShell(Part_1_doc, [model.selection("SHELL", "Extrusion_1_1")]) Plane_4 = model.addPlane(Part_1_doc, model.selection("FACE", "PartSet/YOZ"), 30, False) Sketch_2 = model.addSketch(Part_1_doc, model.selection("FACE", "Plane_1")) SketchLine_3 = Sketch_2.addLine(-64.49168769733997, 17.16789081864163, 146.7677170722727, 22.9901626941168) model.do() -Edge_1 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_2/Edge-SketchLine_3")]) -Boolean_1 = model.addFill(Part_1_doc, [model.selection("SHELL", "Shell_1_1")], [model.selection("EDGE", "Edge_1_1")]) +Edge_1 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_2/SketchLine_3")]) +Fill_1 = model.addFill(Part_1_doc, [model.selection("SHELL", "Shell_1_1")], [model.selection("EDGE", "Edge_1_1")]) model.do() -model.checkResult(Boolean_1,model,1,[0],[0],[2],[8],[18]) -model.testHaveNamingSubshapes(Boolean_1,model,Part_1_doc) +model.checkResult(Fill_1,model,1,[0],[0],[2],[8],[18]) +model.testHaveNamingSubshapes(Fill_1,model,Part_1_doc) model.end() diff --git a/src/FeaturesPlugin/Test/TestFillShellFace.py b/src/FeaturesPlugin/Test/TestFillShellFace.py index 0a7242dfc..22d9364e5 100644 --- a/src/FeaturesPlugin/Test/TestFillShellFace.py +++ b/src/FeaturesPlugin/Test/TestFillShellFace.py @@ -1,4 +1,4 @@ -## Copyright (C) 2017 CEA/DEN, EDF R&D +## Copyright (C) 2014-2017 CEA/DEN, EDF R&D ## ## This library is free software; you can redistribute it and/or ## modify it under the terms of the GNU Lesser General Public @@ -18,6 +18,7 @@ ## email : webmaster.salome@opencascade.com ## +# -*- coding: utf-8 -*- from SketchAPI import * @@ -73,7 +74,9 @@ SketchLine_10 = Sketch_2.addLine(64.99999999999999, 12.18920647716607, 50, 12.18 SketchLine_10.setName("SketchLine_12") SketchLine_10.result().setName("SketchLine_12") SketchConstraintCoincidence_9 = Sketch_2.setCoincident(SketchLine_9.endPoint(), SketchLine_10.startPoint()) +SketchConstraintCoincidence_9.setName("SketchConstraintCoincidence_10") SketchConstraintCoincidence_10 = Sketch_2.setCoincident(SketchLine_10.endPoint(), SketchLine_7.result()) +SketchConstraintCoincidence_10.setName("SketchConstraintCoincidence_11") SketchConstraintDistance_4 = Sketch_2.setDistance(SketchLine_8.endPoint(), SketchLine_7.result(), "L", True) SketchConstraintDistance_5 = Sketch_2.setDistance(SketchLine_9.endPoint(), SketchLine_7.result(), "L/2", True) SketchConstraintHorizontal_1 = Sketch_2.setHorizontal(SketchLine_10.result()) @@ -86,20 +89,22 @@ SketchLine_12.setName("SketchLine_14") SketchLine_12.result().setName("SketchLine_14") SketchLine_11.setName("SketchLine_13") SketchLine_11.result().setName("SketchLine_13") -SketchProjection_3 = Sketch_2.addProjection(model.selection("VERTEX", "Sketch_1/Vertex-SketchLine_4s-SketchLine_3e"), False) +SketchProjection_3 = Sketch_2.addProjection(model.selection("VERTEX", "Sketch_1/SketchLine_3_EndVertex"), False) SketchPoint_2 = SketchProjection_3.createdFeature() SketchConstraintCoincidence_11 = Sketch_2.setCoincident(SketchAPI_Point(SketchPoint_2).coordinates(), SketchLine_9.result()) +SketchConstraintCoincidence_11.setName("SketchConstraintCoincidence_12") SketchConstraintCoincidence_12 = Sketch_2.setCoincident(SketchLine_8.startPoint(), SketchLine_7.result()) +SketchConstraintCoincidence_12.setName("SketchConstraintCoincidence_13") model.do() -Face_1 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_1/Wire-SketchLine_1f-SketchLine_5f-SketchLine_6r")]) -Face_2 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_1/Wire-SketchLine_3f-SketchLine_4f-SketchLine_6f")]) +Face_1 = model.addFace(Part_1_doc, [model.selection("WIRE", "[Sketch_1/SubEdge&Sketch_1/SketchLine_1][Sketch_1/SubEdge&Sketch_1/SketchLine_6][Sketch_1/SubEdge&Sketch_1/SketchLine_5]")]) +Face_2 = model.addFace(Part_1_doc, [model.selection("WIRE", "[Sketch_1/SubEdge&Sketch_1/SketchLine_3][Sketch_1/SubEdge&Sketch_1/SketchLine_4][Sketch_1/SubEdge&Sketch_1/SketchLine_6]")]) Shell_1 = model.addShell(Part_1_doc, [model.selection("FACE", "Face_1_1"), model.selection("FACE", "Face_2_1")]) -Face_3 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_2/Wire-SketchLine_9f-SketchLine_11f-SketchLine_12f-SketchLine_13r-SketchLine_14r-SketchLine_15r")]) -Boolean_1 = model.addFill(Part_1_doc, [model.selection("SHELL", "Shell_1_1")], [model.selection("FACE", "Face_3_1")]) +Face_3 = model.addFace(Part_1_doc, [model.selection("WIRE", "[Sketch_2/SubEdge&Sketch_2/SketchLine_9][Sketch_2/SubEdge&Sketch_2/SketchLine_11][Sketch_2/SubEdge&Sketch_2/SketchLine_12][Sketch_2/SubEdge&Sketch_2/SketchLine_15][Sketch_2/SubEdge&Sketch_2/SketchLine_14][Sketch_2/SubEdge&Sketch_2/SketchLine_13]")]) +Fill_1 = model.addFill(Part_1_doc, [model.selection("SHELL", "Shell_1_1")], [model.selection("FACE", "Face_3_1")]) model.do() -model.checkResult(Boolean_1, model, 1, [0], [0], [4], [13], [26]) -model.testHaveNamingSubshapes(Boolean_1, model, Part_1_doc) +model.checkResult(Fill_1, model, 1, [0], [0], [4], [13], [26]) +model.testHaveNamingSubshapes(Fill_1, model, Part_1_doc) model.end() diff --git a/src/FeaturesPlugin/Test/TestFillShellShell.py b/src/FeaturesPlugin/Test/TestFillShellShell.py index 1363f2e95..084f0d0b7 100644 --- a/src/FeaturesPlugin/Test/TestFillShellShell.py +++ b/src/FeaturesPlugin/Test/TestFillShellShell.py @@ -1,4 +1,4 @@ -## Copyright (C) 2017 CEA/DEN, EDF R&D +## Copyright (C) 2014-2017 CEA/DEN, EDF R&D ## ## This library is free software; you can redistribute it and/or ## modify it under the terms of the GNU Lesser General Public @@ -18,6 +18,7 @@ ## email : webmaster.salome@opencascade.com ## +# -*- coding: utf-8 -*- from SketchAPI import * @@ -33,10 +34,10 @@ Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY")) SketchLine_1 = Sketch_1.addLine(-10, 32.04672553984553, 15.61552812808831, 47.66225366793383) SketchProjection_1 = Sketch_1.addProjection(model.selection("EDGE", "PartSet/OY"), False) SketchLine_2 = SketchProjection_1.createdFeature() -SketchLine_3 = Sketch_1.addLine(15.61552812808831, 47.66225366793383, -4.988916520257207e-021, 73.27778179602213) +SketchLine_3 = Sketch_1.addLine(15.61552812808831, 47.66225366793383, -4.988916520257207e-21, 73.27778179602213) SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchLine_3.startPoint()) SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchLine_3.endPoint(), SketchLine_2.result()) -SketchLine_4 = Sketch_1.addLine(-4.988916520257207e-021, 73.27778179602213, -25.61552812810082, 57.66225366792627) +SketchLine_4 = Sketch_1.addLine(-4.988916520257207e-21, 73.27778179602213, -25.61552812810082, 57.66225366792627) SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchLine_3.endPoint(), SketchLine_4.startPoint()) SketchLine_5 = Sketch_1.addLine(-25.61552812810082, 57.66225366792627, -10, 32.04672553984553) SketchConstraintCoincidence_4 = Sketch_1.setCoincident(SketchLine_4.endPoint(), SketchLine_5.startPoint()) @@ -64,7 +65,7 @@ SketchConstraintCoincidence_10 = Sketch_2.setCoincident(SketchLine_8.endPoint(), SketchConstraintCoincidence_11 = Sketch_2.setCoincident(SketchLine_7.startPoint(), SketchLine_10.endPoint()) SketchLine_11 = Sketch_2.addLine(50, 15.56025031353752, 73.27778179602213, 0) SketchConstraintCoincidence_12 = Sketch_2.setCoincident(SketchLine_7.startPoint(), SketchLine_11.startPoint()) -SketchProjection_3 = Sketch_2.addProjection(model.selection("VERTEX", "Sketch_1/Vertex-SketchLine_4s-SketchLine_3e"), False) +SketchProjection_3 = Sketch_2.addProjection(model.selection("VERTEX", "Sketch_1/SketchLine_3_EndVertex"), False) SketchPoint_1 = SketchProjection_3.createdFeature() SketchConstraintCoincidence_13 = Sketch_2.setCoincident(SketchLine_11.endPoint(), SketchPoint_1.result()) SketchLine_12 = Sketch_2.addLine(73.27778179602213, 0, 50, -15.54016280334104) @@ -73,17 +74,17 @@ SketchConstraintCoincidence_15 = Sketch_2.setCoincident(SketchLine_7.endPoint(), SketchConstraintDistance_3 = Sketch_2.setDistance(SketchAPI_Line(SketchLine_9).startPoint(), SketchLine_7.result(), "D", True) SketchConstraintVertical_1 = Sketch_2.setVertical(SketchLine_7.result()) model.do() -Face_1 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_1/Wire-SketchLine_1f-SketchLine_5f-SketchLine_6r")]) -Face_2 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_1/Wire-SketchLine_3f-SketchLine_4f-SketchLine_6f")]) -Face_3 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_2/Wire-SketchLine_7r-SketchLine_8r-SketchLine_10r")]) -Face_4 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_2/Wire-SketchLine_7f-SketchLine_11r-SketchLine_12r")]) +Face_1 = model.addFace(Part_1_doc, [model.selection("WIRE", "[Sketch_1/SubEdge&Sketch_1/SketchLine_1][Sketch_1/SubEdge&Sketch_1/SketchLine_6][Sketch_1/SubEdge&Sketch_1/SketchLine_5]")]) +Face_2 = model.addFace(Part_1_doc, [model.selection("WIRE", "[Sketch_1/SubEdge&Sketch_1/SketchLine_3][Sketch_1/SubEdge&Sketch_1/SketchLine_4][Sketch_1/SubEdge&Sketch_1/SketchLine_6]")]) +Face_3 = model.addFace(Part_1_doc, [model.selection("WIRE", "[Sketch_2/SubEdge&Sketch_2/SketchLine_10][Sketch_2/SubEdge&Sketch_2/SketchLine_8][Sketch_2/SubEdge&Sketch_2/SketchLine_7]")]) +Face_4 = model.addFace(Part_1_doc, [model.selection("WIRE", "[Sketch_2/SubEdge&Sketch_2/SketchLine_7][Sketch_2/SubEdge&Sketch_2/SketchLine_12][Sketch_2/SubEdge&Sketch_2/SketchLine_11]")]) Shell_1 = model.addShell(Part_1_doc, [model.selection("FACE", "Face_1_1"), model.selection("FACE", "Face_2_1")]) Shell_2 = model.addShell(Part_1_doc, [model.selection("FACE", "Face_3_1"), model.selection("FACE", "Face_4_1")]) -Boolean_1 = model.addFill(Part_1_doc, [model.selection("SHELL", "Shell_1_1")], [model.selection("SHELL", "Shell_2_1")]) +Fill_1 = model.addFill(Part_1_doc, [model.selection("SHELL", "Shell_1_1")], [model.selection("SHELL", "Shell_2_1")]) model.do() -model.checkResult(Boolean_1, model, 1, [0], [0], [4], [15], [30]) -model.testHaveNamingSubshapes(Boolean_1, model, Part_1_doc) +model.checkResult(Fill_1, model, 1, [0], [0], [4], [15], [30]) +model.testHaveNamingSubshapes(Fill_1, model, Part_1_doc) model.end() diff --git a/src/FeaturesPlugin/Test/TestFillShellSolid.py b/src/FeaturesPlugin/Test/TestFillShellSolid.py index 1b78fe4c1..bc1a4ffd5 100644 --- a/src/FeaturesPlugin/Test/TestFillShellSolid.py +++ b/src/FeaturesPlugin/Test/TestFillShellSolid.py @@ -1,4 +1,4 @@ -## Copyright (C) 2017 CEA/DEN, EDF R&D +## Copyright (C) 2014-2017 CEA/DEN, EDF R&D ## ## This library is free software; you can redistribute it and/or ## modify it under the terms of the GNU Lesser General Public @@ -18,6 +18,7 @@ ## email : webmaster.salome@opencascade.com ## +# -*- coding: utf-8 -*- from SketchAPI import * @@ -50,14 +51,14 @@ SketchConstraintDistanceVertical_1 = Sketch_1.setVerticalDistance(SketchAPI_Line 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) -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("FACE", "Face_1_1")], [model.selection("FACE", "Plane_2")]) +Face_1 = model.addFace(Part_1_doc, [model.selection("WIRE", "[Sketch_1/SubEdge&Sketch_1/SketchArc_1_2][Sketch_1/SubEdge&Sketch_1/SketchLine_2][Sketch_1/SubEdge&Sketch_1/SketchLine_3]")]) +Fill_1 = model.addFill(Part_1_doc, [model.selection("FACE", "Face_1_1")], [model.selection("FACE", "Plane_2")]) Shell_1 = model.addShell(Part_1_doc, [model.selection("FACE", "Fill_1_1_2"), model.selection("FACE", "Fill_1_1_1")]) -Boolean_2 = model.addFill(Part_1_doc, [model.selection("SHELL", "Shell_1_1")], [model.selection("SOLID", "Box_1_1")]) +Fill_2 = model.addFill(Part_1_doc, [model.selection("SHELL", "Shell_1_1")], [model.selection("SOLID", "Box_1_1")]) model.do() -model.checkResult(Boolean_2, model, 1, [0], [0], [6], [22], [44]) -model.testHaveNamingSubshapes(Boolean_2, model, Part_1_doc) +model.checkResult(Fill_2, model, 1, [0], [0], [6], [22], [44]) +model.testHaveNamingSubshapes(Fill_2, model, Part_1_doc) model.end() diff --git a/src/FeaturesPlugin/Test/TestFillShellVertex.py b/src/FeaturesPlugin/Test/TestFillShellVertex.py index 2fb840f5c..0303d771e 100644 --- a/src/FeaturesPlugin/Test/TestFillShellVertex.py +++ b/src/FeaturesPlugin/Test/TestFillShellVertex.py @@ -1,4 +1,4 @@ -## Copyright (C) 2017 CEA/DEN, EDF R&D +## Copyright (C) 2014-2017 CEA/DEN, EDF R&D ## ## This library is free software; you can redistribute it and/or ## modify it under the terms of the GNU Lesser General Public @@ -18,6 +18,7 @@ ## email : webmaster.salome@opencascade.com ## +# -*- coding: utf-8 -*- from SketchAPI import * @@ -36,16 +37,16 @@ SketchProjection_1 = Sketch_1.addProjection(model.selection("VERTEX", "PartSet/O SketchPoint_1 = SketchProjection_1.createdFeature() SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchArc_1.startPoint(), SketchAPI_Point(SketchPoint_1).coordinates()) model.do() -Wire_1 = model.addWire(Part_1_doc, [model.selection("EDGE", "Sketch_1/Edge-SketchArc_1_2"), model.selection("EDGE", "Sketch_1/Edge-SketchArc_2_2")]) +Wire_1 = model.addWire(Part_1_doc, [model.selection("EDGE", "Sketch_1/SketchArc_1_2"), model.selection("EDGE", "Sketch_1/SketchArc_2_2")]) Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("WIRE", "Wire_1_1")], model.selection(), 50, 0) Shell_1 = model.addShell(Part_1_doc, [model.selection("SHELL", "Extrusion_1_1")]) Point_2 = model.addPoint(Part_1_doc, 0, 0, 10) Vertex_1 = model.addVertex(Part_1_doc, [model.selection("VERTEX", "Point_1")]) -Boolean_1 = model.addFill(Part_1_doc, [model.selection("SHELL", "Shell_1_1")], [model.selection("VERTEX", "Vertex_1_1")]) +Fill_1 = model.addFill(Part_1_doc, [model.selection("SHELL", "Shell_1_1")], [model.selection("VERTEX", "Vertex_1_1")]) model.do() -model.checkResult(Boolean_1,model,1,[0],[0],[2],[9],[18]) -model.testHaveNamingSubshapes(Boolean_1,model,Part_1_doc) +model.checkResult(Fill_1,model,1,[0],[0],[2],[9],[18]) +model.testHaveNamingSubshapes(Fill_1,model,Part_1_doc) model.end() diff --git a/src/FeaturesPlugin/Test/TestFillShellWire.py b/src/FeaturesPlugin/Test/TestFillShellWire.py index 1dc51bd3d..23787a263 100644 --- a/src/FeaturesPlugin/Test/TestFillShellWire.py +++ b/src/FeaturesPlugin/Test/TestFillShellWire.py @@ -1,4 +1,4 @@ -## Copyright (C) 2017 CEA/DEN, EDF R&D +## Copyright (C) 2014-2017 CEA/DEN, EDF R&D ## ## This library is free software; you can redistribute it and/or ## modify it under the terms of the GNU Lesser General Public @@ -18,6 +18,7 @@ ## email : webmaster.salome@opencascade.com ## +# -*- coding: utf-8 -*- from SketchAPI import * @@ -71,15 +72,16 @@ SketchProjection_2 = Sketch_2.addProjection(model.selection("VERTEX", "PartSet/O SketchPoint_1 = SketchProjection_2.createdFeature() SketchConstraintDistance_2 = Sketch_2.setDistance(SketchAPI_Point(SketchPoint_1).coordinates(), SketchLine_9.result(), "L", True) model.do() -Face_1 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_1/Wire-SketchLine_1f-SketchLine_5f-SketchLine_6r")]) -Face_2 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_1/Wire-SketchLine_3f-SketchLine_4f-SketchLine_6f")]) +Face_1 = model.addFace(Part_1_doc, [model.selection("WIRE", "[Sketch_1/SubEdge&Sketch_1/SketchLine_1][Sketch_1/SubEdge&Sketch_1/SketchLine_6][Sketch_1/SubEdge&Sketch_1/SketchLine_5]")]) +Face_2 = model.addFace(Part_1_doc, [model.selection("WIRE", "[Sketch_1/SubEdge&Sketch_1/SketchLine_3][Sketch_1/SubEdge&Sketch_1/SketchLine_4][Sketch_1/SubEdge&Sketch_1/SketchLine_6]")]) Shell_1 = model.addShell(Part_1_doc, [model.selection("FACE", "Face_1_1"), model.selection("FACE", "Face_2_1")]) -Wire_1 = model.addWire(Part_1_doc, [model.selection("EDGE", "Sketch_2/Edge-SketchLine_7"), model.selection("EDGE", "Sketch_2/Edge-SketchLine_8"), model.selection("EDGE", "Sketch_2/Edge-SketchLine_9"), model.selection("EDGE", "Sketch_2/Edge-SketchLine_10")]) -Boolean_1 = model.addFill(Part_1_doc, [model.selection("SHELL", "Shell_1_1")], [model.selection("WIRE", "Wire_1_1")]) +Wire_1_objects = [model.selection("EDGE", "Sketch_2/SketchLine_7"), model.selection("EDGE", "Sketch_2/SketchLine_8"), model.selection("EDGE", "Sketch_2/SketchLine_9"), model.selection("EDGE", "Sketch_2/SketchLine_10")] +Wire_1 = model.addWire(Part_1_doc, Wire_1_objects) +Fill_1 = model.addFill(Part_1_doc, [model.selection("SHELL", "Shell_1_1")], [model.selection("WIRE", "Wire_1_1")]) model.do() -model.checkResult(Boolean_1, model, 1, [0], [0], [8], [30], [60]) -model.testHaveNamingSubshapes(Boolean_1, model, Part_1_doc) +model.checkResult(Fill_1, model, 1, [0], [0], [8], [30], [60]) +model.testHaveNamingSubshapes(Fill_1, model, Part_1_doc) model.end() diff --git a/src/FeaturesPlugin/Test/TestFillSolid2ConstructionPlanes.py b/src/FeaturesPlugin/Test/TestFillSolid2ConstructionPlanes.py index 981f18b9b..18507904d 100644 --- a/src/FeaturesPlugin/Test/TestFillSolid2ConstructionPlanes.py +++ b/src/FeaturesPlugin/Test/TestFillSolid2ConstructionPlanes.py @@ -1,4 +1,4 @@ -## Copyright (C) 2017 CEA/DEN, EDF R&D +## Copyright (C) 2014-2017 CEA/DEN, EDF R&D ## ## This library is free software; you can redistribute it and/or ## modify it under the terms of the GNU Lesser General Public @@ -18,6 +18,7 @@ ## email : webmaster.salome@opencascade.com ## +# -*- coding: utf-8 -*- from salome.shaper import model @@ -26,11 +27,11 @@ partSet = model.moduleDocument() Part_1 = model.addPart(partSet) Part_1_doc = Part_1.document() Cone_1 = model.addCone(Part_1_doc, model.selection("VERTEX", "PartSet/Origin"), model.selection("EDGE", "PartSet/OZ"), 10, 5, 10) -Boolean_1 = model.addFill(Part_1_doc, [model.selection("SOLID", "Cone_1_1")], [model.selection("FACE", "PartSet/YOZ"), model.selection("FACE", "PartSet/XOZ")]) +Fill_1 = model.addFill(Part_1_doc, [model.selection("SOLID", "Cone_1_1")], [model.selection("FACE", "PartSet/YOZ"), model.selection("FACE", "PartSet/XOZ")]) model.do() -model.checkResult(Boolean_1,model,1,[4],[4],[20],[72],[144]) -model.testHaveNamingSubshapes(Boolean_1,model,Part_1_doc) +model.checkResult(Fill_1,model,1,[4],[4],[20],[72],[144]) +model.testHaveNamingSubshapes(Fill_1,model,Part_1_doc) model.end() diff --git a/src/FeaturesPlugin/Test/TestFillSolidCompFace.py b/src/FeaturesPlugin/Test/TestFillSolidCompFace.py index d486e1856..8a5635b40 100644 --- a/src/FeaturesPlugin/Test/TestFillSolidCompFace.py +++ b/src/FeaturesPlugin/Test/TestFillSolidCompFace.py @@ -1,4 +1,4 @@ -## Copyright (C) 2017 CEA/DEN, EDF R&D +## Copyright (C) 2014-2017 CEA/DEN, EDF R&D ## ## This library is free software; you can redistribute it and/or ## modify it under the terms of the GNU Lesser General Public @@ -18,6 +18,7 @@ ## email : webmaster.salome@opencascade.com ## +# -*- coding: utf-8 -*- from SketchAPI import * @@ -34,14 +35,14 @@ Plane_4 = model.addPlane(Part_1_doc, model.selection("FACE", "Box_1_1/Bottom"), 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() -SketchArc_1 = Sketch_1.addArc(0, 0, 11.4564392373896, -5, 0, -12.5, True) +SketchArc_1 = Sketch_1.addArc(0, 0, 15.49193338482974, -4, 0, -16, True) SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchPoint_1.result(), SketchArc_1.center()) SketchProjection_2 = Sketch_1.addProjection(model.selection("EDGE", "PartSet/OY"), False) SketchLine_1 = SketchProjection_2.createdFeature() SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchArc_1.endPoint(), SketchLine_1.result()) -SketchLine_2 = Sketch_1.addLine(11.4564392373896, -5, 0, 5) +SketchLine_2 = Sketch_1.addLine(15.49193338482974, -4, 0, 12) SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchArc_1.startPoint(), SketchLine_2.startPoint()) -SketchLine_3 = Sketch_1.addLine(0, 5, 0, -12.5) +SketchLine_3 = Sketch_1.addLine(0, 12, 0, -16) SketchConstraintCoincidence_4 = Sketch_1.setCoincident(SketchLine_2.endPoint(), SketchLine_3.startPoint()) SketchConstraintCoincidence_5 = Sketch_1.setCoincident(SketchLine_3.endPoint(), SketchArc_1.endPoint()) SketchConstraintCoincidence_6 = Sketch_1.setCoincident(SketchLine_2.endPoint(), SketchLine_1.result()) @@ -50,13 +51,13 @@ SketchConstraintDistanceVertical_1 = Sketch_1.setVerticalDistance(SketchAPI_Line 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) -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("FACE", "Face_1_1")], [model.selection("FACE", "Plane_2")]) -Boolean_2 = model.addFill(Part_1_doc, [model.selection("SOLID", "Box_1_1")], [model.selection("COMPOUND", "Fill_1_1")]) +Face_1 = model.addFace(Part_1_doc, [model.selection("WIRE", "[Sketch_1/SubEdge&Sketch_1/SketchArc_1_2][Sketch_1/SubEdge&Sketch_1/SketchLine_2][Sketch_1/SubEdge&Sketch_1/SketchLine_3]")]) +Fill_1 = model.addFill(Part_1_doc, [model.selection("FACE", "Face_1_1")], [model.selection("FACE", "Plane_2")]) +Fill_2 = model.addFill(Part_1_doc, [model.selection("SOLID", "Box_1_1")], [model.selection("COMPOUND", "Fill_1_1")]) model.do() -model.checkResult(Boolean_2, model, 1, [2], [2], [14], [60], [120]) -model.testHaveNamingSubshapes(Boolean_2, model, Part_1_doc) +model.checkResult(Fill_2, model, 1, [2], [2], [14], [60], [120]) +model.testHaveNamingSubshapes(Fill_2, model, Part_1_doc) model.end() diff --git a/src/FeaturesPlugin/Test/TestFillSolidCompShell.py b/src/FeaturesPlugin/Test/TestFillSolidCompShell.py index d6de9e4cf..3dbe48473 100644 --- a/src/FeaturesPlugin/Test/TestFillSolidCompShell.py +++ b/src/FeaturesPlugin/Test/TestFillSolidCompShell.py @@ -1,4 +1,4 @@ -## Copyright (C) 2017 CEA/DEN, EDF R&D +## Copyright (C) 2014-2017 CEA/DEN, EDF R&D ## ## This library is free software; you can redistribute it and/or ## modify it under the terms of the GNU Lesser General Public @@ -18,6 +18,7 @@ ## email : webmaster.salome@opencascade.com ## +# -*- coding: utf-8 -*- from SketchAPI import * @@ -34,14 +35,14 @@ Plane_4 = model.addPlane(Part_1_doc, model.selection("FACE", "Box_1_1/Bottom"), 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() -SketchArc_1 = Sketch_1.addArc(0, 0, 11.4564392373896, -5, 0, -12.5, True) +SketchArc_1 = Sketch_1.addArc(0, 0, 15.49193338482974, -4, 0, -16, True) SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchPoint_1.result(), SketchArc_1.center()) SketchProjection_2 = Sketch_1.addProjection(model.selection("EDGE", "PartSet/OY"), False) SketchLine_1 = SketchProjection_2.createdFeature() SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchArc_1.endPoint(), SketchLine_1.result()) -SketchLine_2 = Sketch_1.addLine(11.4564392373896, -5, 0, 5) +SketchLine_2 = Sketch_1.addLine(15.49193338482974, -4, 0, 12) SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchArc_1.startPoint(), SketchLine_2.startPoint()) -SketchLine_3 = Sketch_1.addLine(0, 5, 0, -12.5) +SketchLine_3 = Sketch_1.addLine(0, 12, 0, -16) SketchConstraintCoincidence_4 = Sketch_1.setCoincident(SketchLine_2.endPoint(), SketchLine_3.startPoint()) SketchConstraintCoincidence_5 = Sketch_1.setCoincident(SketchLine_3.endPoint(), SketchArc_1.endPoint()) SketchConstraintCoincidence_6 = Sketch_1.setCoincident(SketchLine_2.endPoint(), SketchLine_1.result()) @@ -50,15 +51,15 @@ SketchConstraintDistanceVertical_1 = Sketch_1.setVerticalDistance(SketchAPI_Line 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) -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("FACE", "Face_1_1")], [model.selection("FACE", "Plane_2")]) +Face_1 = model.addFace(Part_1_doc, [model.selection("WIRE", "[Sketch_1/SubEdge&Sketch_1/SketchArc_1_2][Sketch_1/SubEdge&Sketch_1/SketchLine_2][Sketch_1/SubEdge&Sketch_1/SketchLine_3]")]) +Fill_1 = model.addFill(Part_1_doc, [model.selection("FACE", "Face_1_1")], [model.selection("FACE", "Plane_2")]) Shell_1 = model.addShell(Part_1_doc, [model.selection("FACE", "Fill_1_1_2"), model.selection("FACE", "Fill_1_1_1")]) -MultiTranslation_1 = model.addMultiTranslation(Part_1_doc, [model.selection("SHELL", "Shell_1_1")], model.selection("EDGE", "PartSet/OZ"), 1, 3) -Boolean_2 = model.addFill(Part_1_doc, [model.selection("SOLID", "Box_1_1")], [model.selection("COMPOUND", "LinearCopy_1_1")]) +LinearCopy_1 = model.addMultiTranslation(Part_1_doc, [model.selection("SHELL", "Shell_1_1")], model.selection("EDGE", "PartSet/OZ"), 1, 3) +Fill_2 = model.addFill(Part_1_doc, [model.selection("SOLID", "Box_1_1")], [model.selection("COMPOUND", "LinearCopy_1_1")]) model.do() -model.checkResult(Boolean_2, model, 1, [4], [4], [30], [132], [264]) -model.testHaveNamingSubshapes(Boolean_2, model, Part_1_doc) +model.checkResult(Fill_2, model, 1, [4], [4], [30], [132], [264]) +model.testHaveNamingSubshapes(Fill_2, model, Part_1_doc) model.end() diff --git a/src/FeaturesPlugin/Test/TestFillSolidEdge.py b/src/FeaturesPlugin/Test/TestFillSolidEdge.py index 25190b5fd..e7219affb 100644 --- a/src/FeaturesPlugin/Test/TestFillSolidEdge.py +++ b/src/FeaturesPlugin/Test/TestFillSolidEdge.py @@ -1,4 +1,4 @@ -## Copyright (C) 2017 CEA/DEN, EDF R&D +## Copyright (C) 2014-2017 CEA/DEN, EDF R&D ## ## This library is free software; you can redistribute it and/or ## modify it under the terms of the GNU Lesser General Public @@ -18,6 +18,7 @@ ## email : webmaster.salome@opencascade.com ## +# -*- coding: utf-8 -*- from salome.shaper import model @@ -28,19 +29,19 @@ Part_1_doc = Part_1.document() Box_1 = model.addBox(Part_1_doc, 10, 10, 10) Sketch_1 = model.addSketch(Part_1_doc, model.selection("FACE", "Box_1_1/Front")) SketchLine_1 = Sketch_1.addLine(4, 10, 7, 0) -SketchProjection_1 = Sketch_1.addProjection(model.selection("EDGE", "Box_1_1/Front&Box_1_1/Top"), False) +SketchProjection_1 = Sketch_1.addProjection(model.selection("EDGE", "[Box_1_1/Top][Box_1_1/Front]"), False) SketchLine_2 = SketchProjection_1.createdFeature() SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_1.startPoint(), SketchLine_2.result()) -SketchProjection_2 = Sketch_1.addProjection(model.selection("EDGE", "Box_1_1/Front&Box_1_1/Bottom"), False) +SketchProjection_2 = Sketch_1.addProjection(model.selection("EDGE", "[Box_1_1/Bottom][Box_1_1/Front]"), False) SketchLine_3 = SketchProjection_2.createdFeature() SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchLine_3.result()) model.do() -Edge_1 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_1/Edge-SketchLine_1")]) -Boolean_1 = model.addFill(Part_1_doc, [model.selection("SOLID", "Box_1_1")], [model.selection("EDGE", "Edge_1_1")]) +Edge_1 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_1/SketchLine_1")]) +Fill_1 = model.addFill(Part_1_doc, [model.selection("SOLID", "Box_1_1")], [model.selection("EDGE", "Edge_1_1")]) model.do() -model.checkResult(Boolean_1, model, 1, [0], [1], [7], [30], [60]) -model.testHaveNamingSubshapes(Boolean_1, model, Part_1_doc) +model.checkResult(Fill_1, model, 1, [0], [1], [7], [30], [60]) +model.testHaveNamingSubshapes(Fill_1, model, Part_1_doc) model.end() diff --git a/src/FeaturesPlugin/Test/TestFillSolidFace.py b/src/FeaturesPlugin/Test/TestFillSolidFace.py index 54e07fa92..802b0f2ae 100644 --- a/src/FeaturesPlugin/Test/TestFillSolidFace.py +++ b/src/FeaturesPlugin/Test/TestFillSolidFace.py @@ -1,4 +1,4 @@ -## Copyright (C) 2017 CEA/DEN, EDF R&D +## Copyright (C) 2014-2017 CEA/DEN, EDF R&D ## ## This library is free software; you can redistribute it and/or ## modify it under the terms of the GNU Lesser General Public @@ -18,6 +18,7 @@ ## email : webmaster.salome@opencascade.com ## +# -*- coding: utf-8 -*- from SketchAPI import * @@ -34,14 +35,14 @@ Plane_4 = model.addPlane(Part_1_doc, model.selection("FACE", "Box_1_1/Bottom"), 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() -SketchArc_1 = Sketch_1.addArc(0, 0, 11.4564392373896, -5, 0, -12.5, True) +SketchArc_1 = Sketch_1.addArc(0, 0, 15.49193338482974, -4, 0, -16, True) SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchPoint_1.result(), SketchArc_1.center()) SketchProjection_2 = Sketch_1.addProjection(model.selection("EDGE", "PartSet/OY"), False) SketchLine_1 = SketchProjection_2.createdFeature() SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchArc_1.endPoint(), SketchLine_1.result()) -SketchLine_2 = Sketch_1.addLine(11.4564392373896, -5, 0, 5) +SketchLine_2 = Sketch_1.addLine(15.49193338482974, -4, 0, 12) SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchArc_1.startPoint(), SketchLine_2.startPoint()) -SketchLine_3 = Sketch_1.addLine(0, 5, 0, -12.5) +SketchLine_3 = Sketch_1.addLine(0, 12, 0, -16) SketchConstraintCoincidence_4 = Sketch_1.setCoincident(SketchLine_2.endPoint(), SketchLine_3.startPoint()) SketchConstraintCoincidence_5 = Sketch_1.setCoincident(SketchLine_3.endPoint(), SketchArc_1.endPoint()) SketchConstraintCoincidence_6 = Sketch_1.setCoincident(SketchLine_2.endPoint(), SketchLine_1.result()) @@ -49,12 +50,12 @@ SketchConstraintRadius_1 = Sketch_1.setRadius(SketchArc_1.results()[1], "L+Shift 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")]) +Face_1 = model.addFace(Part_1_doc, [model.selection("WIRE", "[Sketch_1/SubEdge&Sketch_1/SketchArc_1_2][Sketch_1/SubEdge&Sketch_1/SketchLine_2][Sketch_1/SubEdge&Sketch_1/SketchLine_3]")]) +Fill_1 = model.addFill(Part_1_doc, [model.selection("SOLID", "Box_1_1")], [model.selection("FACE", "Face_1_1")]) model.do() -model.checkResult(Boolean_1, model, 1, [2], [2], [12], [48], [96]) -model.testHaveNamingSubshapes(Boolean_1, model, Part_1_doc) +model.checkResult(Fill_1, model, 1, [2], [2], [12], [48], [96]) +model.testHaveNamingSubshapes(Fill_1, model, Part_1_doc) model.end() diff --git a/src/FeaturesPlugin/Test/TestFillSolidShell.py b/src/FeaturesPlugin/Test/TestFillSolidShell.py index 174e8db41..9a396667d 100644 --- a/src/FeaturesPlugin/Test/TestFillSolidShell.py +++ b/src/FeaturesPlugin/Test/TestFillSolidShell.py @@ -1,4 +1,4 @@ -## Copyright (C) 2017 CEA/DEN, EDF R&D +## Copyright (C) 2014-2017 CEA/DEN, EDF R&D ## ## This library is free software; you can redistribute it and/or ## modify it under the terms of the GNU Lesser General Public @@ -18,6 +18,7 @@ ## email : webmaster.salome@opencascade.com ## +# -*- coding: utf-8 -*- from SketchAPI import * @@ -34,14 +35,14 @@ Plane_4 = model.addPlane(Part_1_doc, model.selection("FACE", "Box_1_1/Bottom"), 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() -SketchArc_1 = Sketch_1.addArc(0, 0, 11.4564392373896, -5, 0, -12.5, True) +SketchArc_1 = Sketch_1.addArc(0, 0, 15.49193338482974, -4, 0, -16, True) SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchPoint_1.result(), SketchArc_1.center()) SketchProjection_2 = Sketch_1.addProjection(model.selection("EDGE", "PartSet/OY"), False) SketchLine_1 = SketchProjection_2.createdFeature() SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchArc_1.endPoint(), SketchLine_1.result()) -SketchLine_2 = Sketch_1.addLine(11.4564392373896, -5, 0, 5) +SketchLine_2 = Sketch_1.addLine(15.49193338482974, -4, 0, 12) SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchArc_1.startPoint(), SketchLine_2.startPoint()) -SketchLine_3 = Sketch_1.addLine(0, 5, 0, -12.5) +SketchLine_3 = Sketch_1.addLine(0, 12, 0, -16) SketchConstraintCoincidence_4 = Sketch_1.setCoincident(SketchLine_2.endPoint(), SketchLine_3.startPoint()) SketchConstraintCoincidence_5 = Sketch_1.setCoincident(SketchLine_3.endPoint(), SketchArc_1.endPoint()) SketchConstraintCoincidence_6 = Sketch_1.setCoincident(SketchLine_2.endPoint(), SketchLine_1.result()) @@ -50,14 +51,14 @@ SketchConstraintDistanceVertical_1 = Sketch_1.setVerticalDistance(SketchAPI_Line 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) -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("FACE", "Face_1_1")], [model.selection("FACE", "Plane_2")]) +Face_1 = model.addFace(Part_1_doc, [model.selection("WIRE", "[Sketch_1/SubEdge&Sketch_1/SketchArc_1_2][Sketch_1/SubEdge&Sketch_1/SketchLine_2][Sketch_1/SubEdge&Sketch_1/SketchLine_3]")]) +Fill_1 = model.addFill(Part_1_doc, [model.selection("FACE", "Face_1_1")], [model.selection("FACE", "Plane_2")]) Shell_1 = model.addShell(Part_1_doc, [model.selection("FACE", "Fill_1_1_2"), model.selection("FACE", "Fill_1_1_1")]) -Boolean_2 = model.addFill(Part_1_doc, [model.selection("SOLID", "Box_1_1")], [model.selection("SHELL", "Shell_1_1")]) +Fill_2 = model.addFill(Part_1_doc, [model.selection("SOLID", "Box_1_1")], [model.selection("SHELL", "Shell_1_1")]) model.do() -model.checkResult(Boolean_2, model, 1, [2], [2], [14], [60], [120]) -model.testHaveNamingSubshapes(Boolean_2, model, Part_1_doc) +model.checkResult(Fill_2, model, 1, [2], [2], [14], [60], [120]) +model.testHaveNamingSubshapes(Fill_2, model, Part_1_doc) model.end() diff --git a/src/FeaturesPlugin/Test/TestFillWireEdge.py b/src/FeaturesPlugin/Test/TestFillWireEdge.py index eeda3945e..4305d7df3 100644 --- a/src/FeaturesPlugin/Test/TestFillWireEdge.py +++ b/src/FeaturesPlugin/Test/TestFillWireEdge.py @@ -1,4 +1,4 @@ -## Copyright (C) 2017 CEA/DEN, EDF R&D +## Copyright (C) 2014-2017 CEA/DEN, EDF R&D ## ## This library is free software; you can redistribute it and/or ## modify it under the terms of the GNU Lesser General Public @@ -18,6 +18,7 @@ ## email : webmaster.salome@opencascade.com ## +# -*- coding: utf-8 -*- from salome.shaper import model @@ -38,13 +39,14 @@ SketchLine_5 = Sketch_2.addLine(55.26415094339622, -34.15529753265602, -40.60522 SketchConstraintCoincidence_3 = Sketch_2.setCoincident(SketchLine_4.endPoint(), SketchLine_5.startPoint()) SketchConstraintCoincidence_4 = Sketch_2.setCoincident(SketchLine_5.endPoint(), SketchLine_2.startPoint()) model.do() -Edge_1 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_1/Edge-SketchLine_1")]) -Wire_1 = model.addWire(Part_1_doc, [model.selection("EDGE", "Sketch_2/Edge-SketchLine_5"), model.selection("EDGE", "Sketch_2/Edge-SketchLine_2"), model.selection("EDGE", "Sketch_2/Edge-SketchLine_3"), model.selection("EDGE", "Sketch_2/Edge-SketchLine_4")]) -Boolean_1 = model.addFill(Part_1_doc, [model.selection("WIRE", "Wire_1_1")], [model.selection("EDGE", "Edge_1_1")]) +Edge_1 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_1/SketchLine_1")]) +Wire_1_objects = [model.selection("EDGE", "Sketch_2/SketchLine_5"), model.selection("EDGE", "Sketch_2/SketchLine_2"), model.selection("EDGE", "Sketch_2/SketchLine_3"), model.selection("EDGE", "Sketch_2/SketchLine_4")] +Wire_1 = model.addWire(Part_1_doc, Wire_1_objects) +Fill_1 = model.addFill(Part_1_doc, [model.selection("WIRE", "Wire_1_1")], [model.selection("EDGE", "Edge_1_1")]) model.do() -model.checkResult(Boolean_1,model,1,[0],[0],[0],[6],[12]) -model.testHaveNamingSubshapes(Boolean_1,model,Part_1_doc) +model.checkResult(Fill_1,model,1,[0],[0],[0],[6],[12]) +model.testHaveNamingSubshapes(Fill_1,model,Part_1_doc) model.end() diff --git a/src/FeaturesPlugin/Test/TestFillWireFace.py b/src/FeaturesPlugin/Test/TestFillWireFace.py index e63cac9f5..eff31fc80 100644 --- a/src/FeaturesPlugin/Test/TestFillWireFace.py +++ b/src/FeaturesPlugin/Test/TestFillWireFace.py @@ -1,4 +1,4 @@ -## Copyright (C) 2017 CEA/DEN, EDF R&D +## Copyright (C) 2014-2017 CEA/DEN, EDF R&D ## ## This library is free software; you can redistribute it and/or ## modify it under the terms of the GNU Lesser General Public @@ -18,6 +18,7 @@ ## email : webmaster.salome@opencascade.com ## +# -*- coding: utf-8 -*- from salome.shaper import model @@ -41,7 +42,7 @@ SketchConstraintRadius_1 = Sketch_1.setRadius(SketchArc_1.results()[1], "R") model.do() Sketch_2 = model.addSketch(Part_1_doc, model.defaultPlane("YOZ")) SketchLine_4 = Sketch_2.addLine(29.74624907439609, 30.07487215963349, 31.08202242513997, 0) -SketchProjection_2 = Sketch_2.addProjection(model.selection("VERTEX", "Sketch_1/Vertex-SketchArc_1"), False) +SketchProjection_2 = Sketch_2.addProjection(model.selection("VERTEX", "Sketch_1/SketchArc_1"), False) SketchPoint_1 = SketchProjection_2.createdFeature() SketchConstraintCoincidence_6 = Sketch_2.setCoincident(SketchLine_4.endPoint(), SketchPoint_1.result()) SketchLine_5 = Sketch_2.addLine(31.08202242513997, 0, 45.45797599933665, 0) @@ -57,13 +58,13 @@ SketchLine_9 = Sketch_2.addLine(70.40999925541598, 30.039147749218, 29.746249074 SketchConstraintCoincidence_11 = Sketch_2.setCoincident(SketchLine_8.endPoint(), SketchLine_9.startPoint()) SketchConstraintCoincidence_12 = Sketch_2.setCoincident(SketchLine_4.startPoint(), SketchLine_9.endPoint()) model.do() -Face_1 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_1/Wire-SketchLine_1f-SketchLine_3f-SketchArc_1_2f")]) -Wire_1 = model.addWire(Part_1_doc, [model.selection("WIRE", "Sketch_2/Wire-SketchLine_4f-SketchLine_5f-SketchLine_7f-SketchLine_8f-SketchLine_9f")]) -Boolean_1 = model.addFill(Part_1_doc, [model.selection("WIRE", "Wire_1_1")], [model.selection("FACE", "Face_1_1")]) +Face_1 = model.addFace(Part_1_doc, [model.selection("WIRE", "[Sketch_1/SubEdge&Sketch_1/SketchLine_1][Sketch_1/SubEdge&Sketch_1/SketchLine_3][Sketch_1/SubEdge&Sketch_1/SketchArc_1_2]")]) +Wire_1 = model.addWire(Part_1_doc, [model.selection("WIRE", "[Sketch_2/SubEdge&Sketch_2/SketchLine_4][Sketch_2/SubEdge&Sketch_2/SketchLine_5][Sketch_2/SubEdge&Sketch_2/SketchLine_7][Sketch_2/SubEdge&Sketch_2/SketchLine_8][Sketch_2/SubEdge&Sketch_2/SketchLine_9]")]) +Fill_1 = model.addFill(Part_1_doc, [model.selection("WIRE", "Wire_1_1")], [model.selection("FACE", "Face_1_1")]) model.do() -model.checkResult(Boolean_1, model, 1, [0], [0], [0], [6], [12]) -model.testHaveNamingSubshapes(Boolean_1, model, Part_1_doc) +model.checkResult(Fill_1, model, 1, [0], [0], [0], [6], [12]) +model.testHaveNamingSubshapes(Fill_1, model, Part_1_doc) model.end() diff --git a/src/FeaturesPlugin/Test/TestFillWireShell.py b/src/FeaturesPlugin/Test/TestFillWireShell.py index d5b99ecdc..f7fcf79a8 100644 --- a/src/FeaturesPlugin/Test/TestFillWireShell.py +++ b/src/FeaturesPlugin/Test/TestFillWireShell.py @@ -1,4 +1,4 @@ -## Copyright (C) 2017 CEA/DEN, EDF R&D +## Copyright (C) 2014-2017 CEA/DEN, EDF R&D ## ## This library is free software; you can redistribute it and/or ## modify it under the terms of the GNU Lesser General Public @@ -18,6 +18,7 @@ ## email : webmaster.salome@opencascade.com ## +# -*- coding: utf-8 -*- from SketchAPI import * @@ -97,15 +98,15 @@ SketchLine_15.result().setName("SketchLine_16") SketchConstraintCoincidence_13 = Sketch_2.setCoincident(SketchAPI_Line(SketchLine_12).startPoint(), SketchLine_15.startPoint()) SketchConstraintCoincidence_14 = Sketch_2.setCoincident(SketchLine_15.endPoint(), SketchLine_8.startPoint()) model.do() -Face_1 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_1/Wire-SketchLine_1f-SketchLine_5f-SketchLine_6r")]) -Face_2 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_1/Wire-SketchLine_3f-SketchLine_4f-SketchLine_6f")]) +Face_1 = model.addFace(Part_1_doc, [model.selection("WIRE", "[Sketch_1/SubEdge&Sketch_1/SketchLine_1][Sketch_1/SubEdge&Sketch_1/SketchLine_6][Sketch_1/SubEdge&Sketch_1/SketchLine_5]")]) +Face_2 = model.addFace(Part_1_doc, [model.selection("WIRE", "[Sketch_1/SubEdge&Sketch_1/SketchLine_3][Sketch_1/SubEdge&Sketch_1/SketchLine_4][Sketch_1/SubEdge&Sketch_1/SketchLine_6]")]) Shell_1 = model.addShell(Part_1_doc, [model.selection("FACE", "Face_1_1"), model.selection("FACE", "Face_2_1")]) -Wire_1 = model.addWire(Part_1_doc, [model.selection("WIRE", "Sketch_2/Wire-SketchLine_9f-SketchLine_11f-SketchLine_12f-SketchLine_13r-SketchLine_14r-SketchLine_15r-SketchLine_16f")]) -Boolean_1 = model.addFill(Part_1_doc, [model.selection("WIRE", "Wire_1_1")], [model.selection("SHELL", "Shell_1_1")]) +Wire_1 = model.addWire(Part_1_doc, [model.selection("WIRE", "[Sketch_2/SubEdge&Sketch_2/SketchLine_9][Sketch_2/SubEdge&Sketch_2/SketchLine_11][Sketch_2/SubEdge&Sketch_2/SketchLine_12][Sketch_2/SubEdge&Sketch_2/SketchLine_15][Sketch_2/SubEdge&Sketch_2/SketchLine_14][Sketch_2/SubEdge&Sketch_2/SketchLine_13][Sketch_2/SubEdge&Sketch_2/SketchLine_16]")]) +Fill_1 = model.addFill(Part_1_doc, [model.selection("WIRE", "Wire_1_1")], [model.selection("SHELL", "Shell_1_1")]) model.do() -model.checkResult(Boolean_1, model, 1, [0], [0], [0], [10], [20]) -model.testHaveNamingSubshapes(Boolean_1, model, Part_1_doc) +model.checkResult(Fill_1, model, 1, [0], [0], [0], [10], [20]) +model.testHaveNamingSubshapes(Fill_1, model, Part_1_doc) model.end() diff --git a/src/FeaturesPlugin/Test/TestFillWireSolid.py b/src/FeaturesPlugin/Test/TestFillWireSolid.py index d0fd12e4e..8629f9df8 100644 --- a/src/FeaturesPlugin/Test/TestFillWireSolid.py +++ b/src/FeaturesPlugin/Test/TestFillWireSolid.py @@ -1,4 +1,4 @@ -## Copyright (C) 2017 CEA/DEN, EDF R&D +## Copyright (C) 2014-2017 CEA/DEN, EDF R&D ## ## This library is free software; you can redistribute it and/or ## modify it under the terms of the GNU Lesser General Public @@ -18,6 +18,7 @@ ## email : webmaster.salome@opencascade.com ## +# -*- coding: utf-8 -*- from SketchAPI import * @@ -49,12 +50,12 @@ SketchConstraintRadius_1 = Sketch_1.setRadius(SketchArc_1.results()[1], "L+Shift 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")]) -Boolean_1 = model.addFill(Part_1_doc, [model.selection("WIRE", "Wire_1_1")], [model.selection("SOLID", "Box_1_1")]) +Wire_1 = model.addWire(Part_1_doc, [model.selection("WIRE", "[Sketch_1/SubEdge&Sketch_1/SketchArc_1_2][Sketch_1/SubEdge&Sketch_1/SketchLine_2][Sketch_1/SubEdge&Sketch_1/SketchLine_3]")]) +Fill_1 = model.addFill(Part_1_doc, [model.selection("WIRE", "Wire_1_1")], [model.selection("SOLID", "Box_1_1")]) model.do() -model.checkResult(Boolean_1, model, 1, [0], [0], [0], [9], [18]) -model.testHaveNamingSubshapes(Boolean_1, model, Part_1_doc) +model.checkResult(Fill_1, model, 1, [0], [0], [0], [9], [18]) +model.testHaveNamingSubshapes(Fill_1, model, Part_1_doc) model.end() diff --git a/src/FeaturesPlugin/Test/TestFillWireVertex.py b/src/FeaturesPlugin/Test/TestFillWireVertex.py index 01c3c349a..677cd5b94 100644 --- a/src/FeaturesPlugin/Test/TestFillWireVertex.py +++ b/src/FeaturesPlugin/Test/TestFillWireVertex.py @@ -1,4 +1,4 @@ -## Copyright (C) 2017 CEA/DEN, EDF R&D +## Copyright (C) 2014-2017 CEA/DEN, EDF R&D ## ## This library is free software; you can redistribute it and/or ## modify it under the terms of the GNU Lesser General Public @@ -18,6 +18,7 @@ ## email : webmaster.salome@opencascade.com ## +# -*- coding: utf-8 -*- from SketchAPI import * @@ -40,12 +41,13 @@ SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchLine_2.endPoint(), SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchLine_3.endPoint(), SketchLine_1.result()) SketchConstraintCoincidence_4 = Sketch_1.setCoincident(SketchLine_1.startPoint(), SketchLine_3.endPoint()) model.do() -Wire_1 = model.addWire(Part_1_doc, [model.selection("EDGE", "Sketch_1/Edge-SketchLine_1"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_2"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_3")]) -Boolean_1 = model.addFill(Part_1_doc, [model.selection("WIRE", "Wire_1_1")], [model.selection("VERTEX", "Vertex_1_1")]) +Wire_1_objects = [model.selection("EDGE", "Sketch_1/SketchLine_1"), model.selection("EDGE", "Sketch_1/SketchLine_2"), model.selection("EDGE", "Sketch_1/SketchLine_3")] +Wire_1 = model.addWire(Part_1_doc, Wire_1_objects) +Fill_1 = model.addFill(Part_1_doc, [model.selection("WIRE", "Wire_1_1")], [model.selection("VERTEX", "Vertex_1_1")]) model.do() -model.checkResult(Boolean_1,model,1,[0],[0],[0],[4],[8]) -model.testHaveNamingSubshapes(Boolean_1,model,Part_1_doc) +model.checkResult(Fill_1,model,1,[0],[0],[0],[4],[8]) +model.testHaveNamingSubshapes(Fill_1,model,Part_1_doc) model.end() diff --git a/src/FeaturesPlugin/Test/TestFillWireWire.py b/src/FeaturesPlugin/Test/TestFillWireWire.py index 9540742cf..54492e257 100644 --- a/src/FeaturesPlugin/Test/TestFillWireWire.py +++ b/src/FeaturesPlugin/Test/TestFillWireWire.py @@ -1,4 +1,4 @@ -## Copyright (C) 2017 CEA/DEN, EDF R&D +## Copyright (C) 2014-2017 CEA/DEN, EDF R&D ## ## This library is free software; you can redistribute it and/or ## modify it under the terms of the GNU Lesser General Public @@ -18,6 +18,7 @@ ## email : webmaster.salome@opencascade.com ## +# -*- coding: utf-8 -*- from salome.shaper import model @@ -41,26 +42,26 @@ SketchConstraintRadius_1 = Sketch_1.setRadius(SketchArc_1.results()[1], "R") model.do() Sketch_2 = model.addSketch(Part_1_doc, model.defaultPlane("YOZ")) SketchLine_4 = Sketch_2.addLine(31.79164821526215, 49.99496405877289, 8.200436015051352, 0) -SketchProjection_2 = Sketch_2.addProjection(model.selection("VERTEX", "Sketch_1/Vertex-SketchLine_3s-SketchLine_1e"), False) +SketchProjection_2 = Sketch_2.addProjection(model.selection("VERTEX", "Sketch_1/SketchLine_1_EndVertex"), False) SketchPoint_1 = SketchProjection_2.createdFeature() SketchConstraintCoincidence_6 = Sketch_2.setCoincident(SketchLine_4.endPoint(), SketchPoint_1.result()) SketchLine_5 = Sketch_2.addLine(8.200436015051352, 0, 27.24680168984479, -49.85269382803262) SketchConstraintCoincidence_7 = Sketch_2.setCoincident(SketchLine_4.endPoint(), SketchLine_5.startPoint()) -SketchProjection_3 = Sketch_2.addProjection(model.selection("VERTEX", "Sketch_1/Vertex-SketchArc_1"), False) +SketchProjection_3 = Sketch_2.addProjection(model.selection("VERTEX", "Sketch_1/SketchArc_1"), False) SketchPoint_2 = SketchProjection_3.createdFeature() -SketchArc_2 = Sketch_2.addArc(31.08202242513997, 1.147024884467139e-021, 27.24680168984479, -49.85269382803262, 31.79164821526215, 49.99496405877289, False) +SketchArc_2 = Sketch_2.addArc(31.08202242513997, 1.147024884467139e-21, 27.24680168984479, -49.85269382803262, 31.79164821526215, 49.99496405877289, False) SketchConstraintCoincidence_8 = Sketch_2.setCoincident(SketchPoint_2.result(), SketchArc_2.center()) 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") model.do() -Wire_1 = model.addWire(Part_1_doc, [model.selection("WIRE", "Sketch_1/Wire-SketchLine_1f-SketchLine_3f-SketchArc_1_2f")]) -Wire_2 = model.addWire(Part_1_doc, [model.selection("WIRE", "Sketch_2/Wire-SketchLine_4f-SketchLine_5f-SketchArc_2_2f")]) -Boolean_1 = model.addFill(Part_1_doc, [model.selection("WIRE", "Wire_1_1")], [model.selection("WIRE", "Wire_2_1")]) +Wire_1 = model.addWire(Part_1_doc, [model.selection("WIRE", "[Sketch_1/SubEdge&Sketch_1/SketchLine_1][Sketch_1/SubEdge&Sketch_1/SketchLine_3][Sketch_1/SubEdge&Sketch_1/SketchArc_1_2]")]) +Wire_2 = model.addWire(Part_1_doc, [model.selection("WIRE", "[Sketch_2/SubEdge&Sketch_2/SketchLine_4][Sketch_2/SubEdge&Sketch_2/SketchLine_5][Sketch_2/SubEdge&Sketch_2/SketchArc_2_2]")]) +Fill_1 = model.addFill(Part_1_doc, [model.selection("WIRE", "Wire_1_1")], [model.selection("WIRE", "Wire_2_1")]) model.do() -model.checkResult(Boolean_1, model, 1, [0], [0], [0], [4], [8]) -model.testHaveNamingSubshapes(Boolean_1, model, Part_1_doc) +model.checkResult(Fill_1, model, 1, [0], [0], [0], [4], [8]) +model.testHaveNamingSubshapes(Fill_1, model, Part_1_doc) model.end() diff --git a/src/FeaturesPlugin/Test/TestFusionFaces.py b/src/FeaturesPlugin/Test/TestFusionFaces.py index 810d548db..84c6a3c45 100644 --- a/src/FeaturesPlugin/Test/TestFusionFaces.py +++ b/src/FeaturesPlugin/Test/TestFusionFaces.py @@ -18,6 +18,8 @@ ## email : webmaster.salome@opencascade.com ## +# -*- coding: utf-8 -*- + from salome.shaper import model # Create document @@ -33,7 +35,7 @@ Box_1 = model.addBox(Part_1_doc, 10, 10, 10) Box_2 = model.addBox(Part_1_doc, 10, 10, 10) Translation_1 = model.addTranslation(Part_1_doc, [model.selection("SOLID", "Box_2_1")], model.selection("EDGE", "PartSet/OX"), 10) -Shell_1 = model.addShell(Part_1_doc, [model.selection("FACE", "Box_1_1/Top"), model.selection("FACE", "Translation_1_1/Translated_Face_1")]) +Shell_1 = model.addShell(Part_1_doc, [model.selection("FACE", "Box_1_1/Top"), model.selection("FACE", "Translation_1_1/MF:Translated&Box_2_1/Top")]) model.do() model.checkResult(Shell_1, model, 1, [0], [0], [2], [8], [16]) diff --git a/src/FeaturesPlugin/Test/TestPartition2Faces.py b/src/FeaturesPlugin/Test/TestPartition2Faces.py index dc64bef78..ceee550fd 100644 --- a/src/FeaturesPlugin/Test/TestPartition2Faces.py +++ b/src/FeaturesPlugin/Test/TestPartition2Faces.py @@ -1,4 +1,4 @@ -## Copyright (C) 2017 CEA/DEN, EDF R&D +## Copyright (C) 2014-2017 CEA/DEN, EDF R&D ## ## This library is free software; you can redistribute it and/or ## modify it under the terms of the GNU Lesser General Public @@ -18,6 +18,7 @@ ## email : webmaster.salome@opencascade.com ## +# -*- coding: utf-8 -*- from salome.shaper import model @@ -42,8 +43,9 @@ model.do() Sketch_2 = model.addSketch(Part_1_doc, model.defaultPlane("XOY")) SketchCircle_1 = Sketch_2.addCircle(64.38749999999999, 45.44999999999999, 41.86298795836804) model.do() -Face_1 = model.addFace(Part_1_doc, [model.selection("EDGE", "Sketch_1/Edge-SketchLine_1"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_4"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_3"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_2")]) -Face_2 = model.addFace(Part_1_doc, [model.selection("EDGE", "Sketch_2/Edge-SketchCircle_1_2")]) +Face_1_objects = [model.selection("EDGE", "Sketch_1/SketchLine_1"), model.selection("EDGE", "Sketch_1/SketchLine_4"), model.selection("EDGE", "Sketch_1/SketchLine_3"), model.selection("EDGE", "Sketch_1/SketchLine_2")] +Face_1 = model.addFace(Part_1_doc, Face_1_objects) +Face_2 = model.addFace(Part_1_doc, [model.selection("EDGE", "Sketch_2/SketchCircle_1_2")]) Partition_1 = model.addPartition(Part_1_doc, [model.selection("FACE", "Face_1_1"), model.selection("FACE", "Face_2_1")]) model.do() diff --git a/src/FeaturesPlugin/Test/TestPartition2Solids.py b/src/FeaturesPlugin/Test/TestPartition2Solids.py index fac8630ee..d86d22d28 100644 --- a/src/FeaturesPlugin/Test/TestPartition2Solids.py +++ b/src/FeaturesPlugin/Test/TestPartition2Solids.py @@ -1,4 +1,4 @@ -## Copyright (C) 2017 CEA/DEN, EDF R&D +## Copyright (C) 2014-2017 CEA/DEN, EDF R&D ## ## This library is free software; you can redistribute it and/or ## modify it under the terms of the GNU Lesser General Public @@ -18,16 +18,14 @@ ## email : webmaster.salome@opencascade.com ## +# -*- coding: utf-8 -*- from salome.shaper import model -from GeomAPI import GeomAPI_Shape model.begin() -#Create part partSet = model.moduleDocument() Part_1 = model.addPart(partSet) Part_1_doc = Part_1.document() -#Create Sketch_1 - closed polyline from 5 segments Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("YOZ")) SketchLine_1 = Sketch_1.addLine(-43.90694444444443, 28.05555555555554, 19.21805555555554, 72.66388888888889) SketchLine_2 = Sketch_1.addLine(19.21805555555554, 72.66388888888889, 82.06249999999999, -36.19166666666666) @@ -40,10 +38,8 @@ SketchLine_5 = Sketch_1.addLine(-45.87083333333333, -45.44999999999999, -43.9069 SketchConstraintCoincidence_4 = Sketch_1.setCoincident(SketchLine_4.endPoint(), SketchLine_5.startPoint()) SketchConstraintCoincidence_5 = Sketch_1.setCoincident(SketchLine_1.startPoint(), SketchLine_5.endPoint()) model.do() -#Create Extrusion_1 on Sketch_1 -Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_1r-SketchLine_2r-SketchLine_3r-SketchLine_4r-SketchLine_5r")], model.selection(), 100, 0) -#Create Sketch_2 from 5 segments -Sketch_2 = model.addSketch(Part_1_doc, model.selection("FACE", "Extrusion_1_1/Generated_Face_3")) +Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_5r-SketchLine_4r-SketchLine_3r-SketchLine_2r-SketchLine_1r")], model.selection(), 100, 0) +Sketch_2 = model.addSketch(Part_1_doc, model.selection("FACE", "Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_3")) SketchLine_6 = Sketch_2.addLine(74.07000206783135, -18.10965884648514, 62.37497281453477, -31.70853007124862) SketchLine_7 = Sketch_2.addLine(62.37497281453477, -31.70853007124862, 37.35304976096997, -31.43655264675337) SketchConstraintCoincidence_6 = Sketch_2.setCoincident(SketchLine_6.endPoint(), SketchLine_7.startPoint()) @@ -55,9 +51,7 @@ SketchLine_10 = Sketch_2.addLine(69.44638585141178, 6.640286782584385, 74.070002 SketchConstraintCoincidence_9 = Sketch_2.setCoincident(SketchLine_9.endPoint(), SketchLine_10.startPoint()) SketchConstraintCoincidence_10 = Sketch_2.setCoincident(SketchLine_6.startPoint(), SketchLine_10.endPoint()) model.do() -#Create Extrusion_2 on Sketch_2 -Extrusion_2 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchLine_6r-SketchLine_7r-SketchLine_8r-SketchLine_9r-SketchLine_10r")], model.selection(), 10, 160) -#Create Partition on objects Extrusion_1 and Extrusion_2 +Extrusion_2 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchLine_10r-SketchLine_9r-SketchLine_8r-SketchLine_7r-SketchLine_6r")], model.selection(), 10, 160) Partition_1 = model.addPartition(Part_1_doc, [model.selection("SOLID", "Extrusion_1_1"), model.selection("SOLID", "Extrusion_2_1")]) model.do() diff --git a/src/FeaturesPlugin/Test/TestPartition2Wires.py b/src/FeaturesPlugin/Test/TestPartition2Wires.py index 01eb2c1e5..6de248887 100644 --- a/src/FeaturesPlugin/Test/TestPartition2Wires.py +++ b/src/FeaturesPlugin/Test/TestPartition2Wires.py @@ -1,4 +1,4 @@ -## Copyright (C) 2017 CEA/DEN, EDF R&D +## Copyright (C) 2014-2017 CEA/DEN, EDF R&D ## ## This library is free software; you can redistribute it and/or ## modify it under the terms of the GNU Lesser General Public @@ -18,6 +18,7 @@ ## email : webmaster.salome@opencascade.com ## +# -*- coding: utf-8 -*- from salome.shaper import model @@ -49,8 +50,10 @@ SketchLine_9 = Sketch_2.addLine(30.30743587791019, -67.62202818906478, 1.8947624 SketchConstraintCoincidence_9 = Sketch_2.setCoincident(SketchLine_8.endPoint(), SketchLine_9.startPoint()) SketchConstraintCoincidence_10 = Sketch_2.setCoincident(SketchArc_1.endPoint(), SketchLine_9.endPoint()) model.do() -Wire_1 = model.addWire(Part_1_doc, [model.selection("EDGE", "Sketch_2/Edge-SketchLine_7"), model.selection("EDGE", "Sketch_2/Edge-SketchLine_8"), model.selection("EDGE", "Sketch_2/Edge-SketchLine_9"), model.selection("EDGE", "Sketch_2/Edge-SketchArc_1_2")]) -Wire_2 = model.addWire(Part_1_doc, [model.selection("EDGE", "Sketch_1/Edge-SketchLine_1"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_2"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_3"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_4"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_5"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_6")]) +Wire_1_objects = [model.selection("EDGE", "Sketch_2/SketchLine_7"), model.selection("EDGE", "Sketch_2/SketchLine_8"), model.selection("EDGE", "Sketch_2/SketchLine_9"), model.selection("EDGE", "Sketch_2/SketchArc_1_2")] +Wire_1 = model.addWire(Part_1_doc, Wire_1_objects) +Wire_2_objects = [model.selection("EDGE", "Sketch_1/SketchLine_1"), model.selection("EDGE", "Sketch_1/SketchLine_2"), model.selection("EDGE", "Sketch_1/SketchLine_3"), model.selection("EDGE", "Sketch_1/SketchLine_4"), model.selection("EDGE", "Sketch_1/SketchLine_5"), model.selection("EDGE", "Sketch_1/SketchLine_6")] +Wire_2 = model.addWire(Part_1_doc, Wire_2_objects) Partition_1 = model.addPartition(Part_1_doc, [model.selection("WIRE", "Wire_2_1"), model.selection("WIRE", "Wire_1_1")]) model.do() diff --git a/src/FeaturesPlugin/Test/TestPartitionBox4Planes.py b/src/FeaturesPlugin/Test/TestPartitionBox4Planes.py index 7e2313a7f..a733842c5 100644 --- a/src/FeaturesPlugin/Test/TestPartitionBox4Planes.py +++ b/src/FeaturesPlugin/Test/TestPartitionBox4Planes.py @@ -1,4 +1,4 @@ -## Copyright (C) 2017 CEA/DEN, EDF R&D +## Copyright (C) 2014-2017 CEA/DEN, EDF R&D ## ## This library is free software; you can redistribute it and/or ## modify it under the terms of the GNU Lesser General Public @@ -18,6 +18,7 @@ ## email : webmaster.salome@opencascade.com ## +# -*- coding: utf-8 -*- from salome.shaper import model @@ -30,7 +31,8 @@ Plane_4 = model.addPlane(Part_1_doc, model.selection("FACE", "PartSet/XOY"), 100 Plane_5 = model.addPlane(Part_1_doc, model.selection("FACE", "Plane_1"), 100, False) Plane_6 = model.addPlane(Part_1_doc, model.selection("FACE", "Plane_2"), 100, False) Plane_7 = model.addPlane(Part_1_doc, model.selection("FACE", "PartSet/YOZ"), 50, False) -Partition_1 = model.addPartition(Part_1_doc, [model.selection("FACE", "Plane_1"), model.selection("FACE", "Plane_2"), model.selection("FACE", "Plane_3"), model.selection("FACE", "Plane_4"), model.selection("SOLID", "Box_1_1")]) +Partition_1_objects = [model.selection("FACE", "Plane_1"), model.selection("FACE", "Plane_2"), model.selection("FACE", "Plane_3"), model.selection("FACE", "Plane_4"), model.selection("SOLID", "Box_1_1")] +Partition_1 = model.addPartition(Part_1_doc, Partition_1_objects) model.do() model.checkResult(Partition_1,model,1,[8],[8],[48],[192],[384]) diff --git a/src/FeaturesPlugin/Test/TestPartitionEdgeSolid.py b/src/FeaturesPlugin/Test/TestPartitionEdgeSolid.py index c12eec4b3..26886c988 100644 --- a/src/FeaturesPlugin/Test/TestPartitionEdgeSolid.py +++ b/src/FeaturesPlugin/Test/TestPartitionEdgeSolid.py @@ -1,4 +1,4 @@ -## Copyright (C) 2017 CEA/DEN, EDF R&D +## Copyright (C) 2014-2017 CEA/DEN, EDF R&D ## ## This library is free software; you can redistribute it and/or ## modify it under the terms of the GNU Lesser General Public @@ -18,6 +18,7 @@ ## email : webmaster.salome@opencascade.com ## +# -*- coding: utf-8 -*- from salome.shaper import model @@ -26,12 +27,12 @@ partSet = model.moduleDocument() Part_1 = model.addPart(partSet) Part_1_doc = Part_1.document() Cone_1 = model.addCone(Part_1_doc, model.selection("VERTEX", "PartSet/Origin"), model.selection("EDGE", "PartSet/OZ"), 10, 5, 10) -Point_1 = model.addPoint(Part_1_doc, 4, 5, 11) +Point_2 = model.addPoint(Part_1_doc, 4, 5, 11) Plane_4 = model.addPlane(Part_1_doc, model.selection("EDGE", "PartSet/OX"), model.selection("VERTEX", "Point_1"), False) Sketch_1 = model.addSketch(Part_1_doc, model.selection("FACE", "Plane_1")) SketchLine_1 = Sketch_1.addLine(1.156555510724249, 12.03812858614785, 0.5812800089239156, -4.87167684997945) model.do() -Edge_1 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_1/Edge-SketchLine_1")]) +Edge_1 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_1/SketchLine_1")]) Partition_1 = model.addPartition(Part_1_doc, [model.selection("SOLID", "Cone_1_1"), model.selection("EDGE", "Edge_1_1")]) model.do() diff --git a/src/FeaturesPlugin/Test/TestPartitionFace2Solid.py b/src/FeaturesPlugin/Test/TestPartitionFace2Solid.py index 7750c0148..b1c837f27 100644 --- a/src/FeaturesPlugin/Test/TestPartitionFace2Solid.py +++ b/src/FeaturesPlugin/Test/TestPartitionFace2Solid.py @@ -1,4 +1,4 @@ -## Copyright (C) 2017 CEA/DEN, EDF R&D +## Copyright (C) 2014-2017 CEA/DEN, EDF R&D ## ## This library is free software; you can redistribute it and/or ## modify it under the terms of the GNU Lesser General Public @@ -18,10 +18,12 @@ ## email : webmaster.salome@opencascade.com ## +# -*- coding: utf-8 -*- -from salome.shaper import model from SketchAPI import * +from salome.shaper import model + model.begin() partSet = model.moduleDocument() Part_1 = model.addPart(partSet) @@ -48,8 +50,7 @@ SketchConstraintMirror_2 = Sketch_1.addMirror(SketchLine_1.result(), SketchConst [SketchArc_5, SketchArc_6, SketchArc_7, SketchArc_8] = SketchConstraintMirror_2.mirrored() model.do() Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("COMPOUND", "Sketch_1")], model.selection(), 12, 12) - -Sketch_2 = model.addSketch(Part_1_doc, model.selection("FACE", "Extrusion_1_1/To_Face_1")) +Sketch_2 = model.addSketch(Part_1_doc, model.selection("FACE", "Extrusion_1_1/To_Face")) SketchLine_3 = Sketch_2.addLine(7.498934040825037, 4.111344571723496, -7.530337532973568, 4.111344571723496) SketchLine_4 = Sketch_2.addLine(-7.530337532973568, 4.111344571723496, -7.530337532973568, -4.489390918751097) SketchLine_5 = Sketch_2.addLine(-7.530337532973568, -4.489390918751097, 7.498934040825037, -4.489390918751097) @@ -64,8 +65,7 @@ SketchConstraintHorizontal_2 = Sketch_2.setHorizontal(SketchLine_5.result()) SketchConstraintVertical_2 = Sketch_2.setVertical(SketchLine_6.result()) SketchCircle_1 = Sketch_2.addCircle(-0.133117930244568, 0.08984026389066591, 1.099112071963378) model.do() -Extrusion_2 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchLine_3f-SketchLine_4f-SketchLine_5f-SketchLine_6f-SketchCircle_1_2r")], model.selection(), model.selection(), 5, model.selection(), 10) - +Extrusion_2 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchLine_3r-SketchLine_4f-SketchLine_5f-SketchLine_6f-SketchCircle_1_2r")], model.selection(), model.selection(), 5, model.selection(), 10) Sketch_3 = model.addSketch(Part_1_doc, model.defaultPlane("XOY")) SketchLine_7 = Sketch_3.addLine(21.55890075100801, 30.21822825485694, -17.43219636481839, 31.63011070278906) SketchLine_8 = Sketch_3.addLine(-17.43219636481839, 31.63011070278906, -12.33809712604348, -45.93749869468675) @@ -76,9 +76,10 @@ SketchLine_10 = Sketch_3.addLine(30.10255255530162, -25.9120009302625, 21.558900 SketchConstraintCoincidence_12 = Sketch_3.setCoincident(SketchLine_9.endPoint(), SketchLine_10.startPoint()) SketchConstraintCoincidence_13 = Sketch_3.setCoincident(SketchLine_7.startPoint(), SketchLine_10.endPoint()) model.do() -Face_1 = model.addFace(Part_1_doc, [model.selection("EDGE", "Sketch_3/Edge-SketchLine_7"), model.selection("EDGE", "Sketch_3/Edge-SketchLine_8"), model.selection("EDGE", "Sketch_3/Edge-SketchLine_9"), model.selection("EDGE", "Sketch_3/Edge-SketchLine_10")]) - -Partition_1 = model.addPartition(Part_1_doc, [model.selection("FACE", "Face_1_1"), model.selection("SOLID", "Extrusion_2_1"), model.selection("SOLID", "Extrusion_1_1")]) +Face_1_objects = [model.selection("EDGE", "Sketch_3/SketchLine_7"), model.selection("EDGE", "Sketch_3/SketchLine_8"), model.selection("EDGE", "Sketch_3/SketchLine_9"), model.selection("EDGE", "Sketch_3/SketchLine_10")] +Face_1 = model.addFace(Part_1_doc, Face_1_objects) +Partition_1_objects = [model.selection("FACE", "Face_1_1"), model.selection("SOLID", "Extrusion_2_1"), model.selection("SOLID", "Extrusion_1_1")] +Partition_1 = model.addPartition(Part_1_doc, Partition_1_objects) model.do() model.checkResult(Partition_1,model,1,[2],[4],[42],[198],[396]) diff --git a/src/FeaturesPlugin/Test/TestPartitionFaceWire.py b/src/FeaturesPlugin/Test/TestPartitionFaceWire.py index 3a6a56b86..29ec0085a 100644 --- a/src/FeaturesPlugin/Test/TestPartitionFaceWire.py +++ b/src/FeaturesPlugin/Test/TestPartitionFaceWire.py @@ -1,4 +1,4 @@ -## Copyright (C) 2017 CEA/DEN, EDF R&D +## Copyright (C) 2014-2017 CEA/DEN, EDF R&D ## ## This library is free software; you can redistribute it and/or ## modify it under the terms of the GNU Lesser General Public @@ -18,6 +18,7 @@ ## email : webmaster.salome@opencascade.com ## +# -*- coding: utf-8 -*- from salome.shaper import model @@ -52,8 +53,10 @@ SketchLine_9 = Sketch_2.addLine(-36.0335881148175, -7.328477046301525, -31.39978 SketchConstraintCoincidence_10 = Sketch_2.setCoincident(SketchLine_8.endPoint(), SketchLine_9.startPoint()) SketchConstraintCoincidence_11 = Sketch_2.setCoincident(SketchArc_2.startPoint(), SketchLine_9.endPoint()) model.do() -Wire_1 = model.addWire(Part_1_doc, [model.selection("EDGE", "Sketch_1/Edge-SketchArc_1_2"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_1"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_2"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_3"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_4"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_5")]) -Face_1 = model.addFace(Part_1_doc, [model.selection("EDGE", "Sketch_2/Edge-SketchLine_9"), model.selection("EDGE", "Sketch_2/Edge-SketchArc_2_2"), model.selection("EDGE", "Sketch_2/Edge-SketchLine_6"), model.selection("EDGE", "Sketch_2/Edge-SketchLine_7"), model.selection("EDGE", "Sketch_2/Edge-SketchLine_8")]) +Wire_1_objects = [model.selection("EDGE", "Sketch_1/SketchArc_1_2"), model.selection("EDGE", "Sketch_1/SketchLine_1"), model.selection("EDGE", "Sketch_1/SketchLine_2"), model.selection("EDGE", "Sketch_1/SketchLine_3"), model.selection("EDGE", "Sketch_1/SketchLine_4"), model.selection("EDGE", "Sketch_1/SketchLine_5")] +Wire_1 = model.addWire(Part_1_doc, Wire_1_objects) +Face_1_objects = [model.selection("EDGE", "Sketch_2/SketchLine_9"), model.selection("EDGE", "Sketch_2/SketchArc_2_2"), model.selection("EDGE", "Sketch_2/SketchLine_6"), model.selection("EDGE", "Sketch_2/SketchLine_7"), model.selection("EDGE", "Sketch_2/SketchLine_8")] +Face_1 = model.addFace(Part_1_doc, Face_1_objects) Partition_1 = model.addPartition(Part_1_doc, [model.selection("FACE", "Face_1_1"), model.selection("WIRE", "Wire_1_1")]) model.do() diff --git a/src/FeaturesPlugin/Test/TestPartitionInclinedFaceSolid.py b/src/FeaturesPlugin/Test/TestPartitionInclinedFaceSolid.py index c7113bbc2..25fba0007 100644 --- a/src/FeaturesPlugin/Test/TestPartitionInclinedFaceSolid.py +++ b/src/FeaturesPlugin/Test/TestPartitionInclinedFaceSolid.py @@ -1,4 +1,4 @@ -## Copyright (C) 2017 CEA/DEN, EDF R&D +## Copyright (C) 2014-2017 CEA/DEN, EDF R&D ## ## This library is free software; you can redistribute it and/or ## modify it under the terms of the GNU Lesser General Public @@ -18,6 +18,7 @@ ## email : webmaster.salome@opencascade.com ## +# -*- coding: utf-8 -*- from salome.shaper import model @@ -30,7 +31,7 @@ SketchCircle_1 = Sketch_1.addCircle(-18.11540697674418, -21.53002906976744, 69.9 SketchCircle_2 = Sketch_1.addCircle(-18.11540697674418, -21.53002906976744, 31.60961705559024) SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchCircle_1.center(), SketchCircle_2.center()) model.do() -Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchCircle_1_2f-SketchCircle_2_2r")], model.selection(), 100, 0) +Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchCircle_1_2r-SketchCircle_2_2r")], model.selection(), 100, 0) Point_2 = model.addPoint(Part_1_doc, 100, 40, 80) Point_3 = model.addPoint(Part_1_doc, 100, -40, 80) Point_4 = model.addPoint(Part_1_doc, 20, 40, -80) @@ -45,7 +46,8 @@ SketchLine_4 = Sketch_2.addLine(-102.5665996005733, 115.6113578178721, 98.506500 SketchConstraintCoincidence_4 = Sketch_2.setCoincident(SketchLine_3.endPoint(), SketchLine_4.startPoint()) SketchConstraintCoincidence_5 = Sketch_2.setCoincident(SketchLine_1.startPoint(), SketchLine_4.endPoint()) model.do() -Face_1 = model.addFace(Part_1_doc, [model.selection("EDGE", "Sketch_2/Edge-SketchLine_4"), model.selection("EDGE", "Sketch_2/Edge-SketchLine_1"), model.selection("EDGE", "Sketch_2/Edge-SketchLine_2"), model.selection("EDGE", "Sketch_2/Edge-SketchLine_3")]) +Face_1_objects = [model.selection("EDGE", "Sketch_2/SketchLine_4"), model.selection("EDGE", "Sketch_2/SketchLine_1"), model.selection("EDGE", "Sketch_2/SketchLine_2"), model.selection("EDGE", "Sketch_2/SketchLine_3")] +Face_1 = model.addFace(Part_1_doc, Face_1_objects) Partition_1 = model.addPartition(Part_1_doc, [model.selection("SOLID", "Extrusion_1_1"), model.selection("FACE", "Face_1_1")]) model.do() diff --git a/src/FeaturesPlugin/Test/TestPartitionSubCompsolidWithCompSolid1.py b/src/FeaturesPlugin/Test/TestPartitionSubCompsolidWithCompSolid1.py index 689fdb07e..73cb83f81 100644 --- a/src/FeaturesPlugin/Test/TestPartitionSubCompsolidWithCompSolid1.py +++ b/src/FeaturesPlugin/Test/TestPartitionSubCompsolidWithCompSolid1.py @@ -1,4 +1,4 @@ -## Copyright (C) 2018-20xx CEA/DEN, EDF R&D +## Copyright (C) 2014-2017 CEA/DEN, EDF R&D ## ## This library is free software; you can redistribute it and/or ## modify it under the terms of the GNU Lesser General Public @@ -18,6 +18,8 @@ ## email : webmaster.salome@opencascade.com ## +# -*- coding: utf-8 -*- + from salome.shaper import model from GeomAPI import * diff --git a/src/FeaturesPlugin/Test/TestPartitionSubCompsolidWithCompSolid2.py b/src/FeaturesPlugin/Test/TestPartitionSubCompsolidWithCompSolid2.py index 48e09d554..09f9bee98 100644 --- a/src/FeaturesPlugin/Test/TestPartitionSubCompsolidWithCompSolid2.py +++ b/src/FeaturesPlugin/Test/TestPartitionSubCompsolidWithCompSolid2.py @@ -1,4 +1,4 @@ -## Copyright (C) 2018-20xx CEA/DEN, EDF R&D +## Copyright (C) 2014-2017 CEA/DEN, EDF R&D ## ## This library is free software; you can redistribute it and/or ## modify it under the terms of the GNU Lesser General Public @@ -18,6 +18,8 @@ ## email : webmaster.salome@opencascade.com ## +# -*- coding: utf-8 -*- + from salome.shaper import model from GeomAPI import * @@ -40,7 +42,8 @@ Plane_4 = model.addPlane(Part_1_doc, model.selection("FACE", "Box_1_1/Left"), mo Plane_5 = model.addPlane(Part_1_doc, model.selection("FACE", "Box_1_1/Back"), model.selection("FACE", "Box_1_1/Front")) Partition_1_objects = [model.selection("SOLID", "Box_1_1"), model.selection("FACE", "Plane_1"), model.selection("FACE", "Plane_2")] Partition_1 = model.addPartition(Part_1_doc, Partition_1_objects) -Partition_2 = model.addPartition(Part_1_doc, [model.selection("SOLID", "Extrusion_1_1_2"), model.selection("SOLID", "Partition_1_1_1"), model.selection("SOLID", "Partition_1_1_3")]) +Partition_2_objects = [model.selection("SOLID", "Extrusion_1_1_3"), model.selection("SOLID", "Partition_1_1_1"), model.selection("SOLID", "Partition_1_1_3")] +Partition_2 = model.addPartition(Part_1_doc, Partition_2_objects) model.do() # check partition diff --git a/src/FeaturesPlugin/Test/TestPartitionSubCompsolidWithCompSolid3.py b/src/FeaturesPlugin/Test/TestPartitionSubCompsolidWithCompSolid3.py index c6673117d..6508e2171 100644 --- a/src/FeaturesPlugin/Test/TestPartitionSubCompsolidWithCompSolid3.py +++ b/src/FeaturesPlugin/Test/TestPartitionSubCompsolidWithCompSolid3.py @@ -1,4 +1,4 @@ -## Copyright (C) 2018-20xx CEA/DEN, EDF R&D +## Copyright (C) 2014-2017 CEA/DEN, EDF R&D ## ## This library is free software; you can redistribute it and/or ## modify it under the terms of the GNU Lesser General Public @@ -18,6 +18,8 @@ ## email : webmaster.salome@opencascade.com ## +# -*- coding: utf-8 -*- + from salome.shaper import model from GeomAPI import * @@ -40,7 +42,8 @@ Plane_4 = model.addPlane(Part_1_doc, model.selection("FACE", "Box_1_1/Left"), mo Plane_5 = model.addPlane(Part_1_doc, model.selection("FACE", "Box_1_1/Back"), model.selection("FACE", "Box_1_1/Front")) Partition_1_objects = [model.selection("SOLID", "Box_1_1"), model.selection("FACE", "Plane_1"), model.selection("FACE", "Plane_2")] Partition_1 = model.addPartition(Part_1_doc, Partition_1_objects) -Partition_2 = model.addPartition(Part_1_doc, [model.selection("SOLID", "Extrusion_1_1_2"), model.selection("SOLID", "Partition_1_1_1"), model.selection("SOLID", "Extrusion_1_1_3"), model.selection("SOLID", "Partition_1_1_3")]) +Partition_2_objects = [model.selection("SOLID", "Extrusion_1_1_3"), model.selection("SOLID", "Partition_1_1_1"), model.selection("SOLID", "Extrusion_1_1_2"), model.selection("SOLID", "Partition_1_1_3")] +Partition_2 = model.addPartition(Part_1_doc, Partition_2_objects) model.do() # check partition diff --git a/src/FeaturesPlugin/Test/TestPartitionSubCompsolidWithFace1.py b/src/FeaturesPlugin/Test/TestPartitionSubCompsolidWithFace1.py index 086680d49..fc00daa1c 100644 --- a/src/FeaturesPlugin/Test/TestPartitionSubCompsolidWithFace1.py +++ b/src/FeaturesPlugin/Test/TestPartitionSubCompsolidWithFace1.py @@ -1,4 +1,4 @@ -## Copyright (C) 2018-20xx CEA/DEN, EDF R&D +## Copyright (C) 2014-2017 CEA/DEN, EDF R&D ## ## This library is free software; you can redistribute it and/or ## modify it under the terms of the GNU Lesser General Public @@ -18,6 +18,8 @@ ## email : webmaster.salome@opencascade.com ## +# -*- coding: utf-8 -*- + from salome.shaper import model from GeomAPI import * @@ -40,9 +42,9 @@ SketchLine_1 = Sketch_2.addLine(58.22303949051827, 32.8176179844255, 7.898114670 SketchConstraintCoincidence_1 = Sketch_2.setCoincident(SketchArc_1.endPoint(), SketchLine_1.startPoint()) SketchConstraintCoincidence_2 = Sketch_2.setCoincident(SketchArc_1.startPoint(), SketchLine_1.endPoint()) model.do() -Revolution_1 = model.addRevolution(Part_1_doc, [model.selection("COMPOUND", "Sketch_2")], model.selection("EDGE", "Sketch_2/Edge-SketchLine_1"), 90, 0) -Face_1 = model.addFace(Part_1_doc, [model.selection("FACE", "Revolution_1_1/Generated_Face_2")]) -Partition_1 = model.addPartition(Part_1_doc, [model.selection("SOLID", "Extrusion_1_1_1"), model.selection("FACE", "Face_1_1")]) +Revolution_1 = model.addRevolution(Part_1_doc, [model.selection("COMPOUND", "Sketch_2")], model.selection("EDGE", "Sketch_2/SketchLine_1"), 90, 0) +Face_1 = model.addFace(Part_1_doc, [model.selection("FACE", "Revolution_1_1/Generated_Face&Sketch_2/SketchArc_1_2")]) +Partition_1 = model.addPartition(Part_1_doc, [model.selection("SOLID", "Extrusion_1_1_2"), model.selection("FACE", "Face_1_1")]) model.do() # check partition diff --git a/src/FeaturesPlugin/Test/TestPartitionSubCompsolidWithFace2.py b/src/FeaturesPlugin/Test/TestPartitionSubCompsolidWithFace2.py index 3ed42aa9c..4fdfc8e39 100644 --- a/src/FeaturesPlugin/Test/TestPartitionSubCompsolidWithFace2.py +++ b/src/FeaturesPlugin/Test/TestPartitionSubCompsolidWithFace2.py @@ -1,4 +1,4 @@ -## Copyright (C) 2018-20xx CEA/DEN, EDF R&D +## Copyright (C) 2014-2017 CEA/DEN, EDF R&D ## ## This library is free software; you can redistribute it and/or ## modify it under the terms of the GNU Lesser General Public @@ -18,6 +18,8 @@ ## email : webmaster.salome@opencascade.com ## +# -*- coding: utf-8 -*- + from salome.shaper import model from GeomAPI import * @@ -40,8 +42,8 @@ SketchLine_1 = Sketch_2.addLine(58.22303949051827, 32.8176179844255, 7.898114670 SketchConstraintCoincidence_1 = Sketch_2.setCoincident(SketchArc_1.endPoint(), SketchLine_1.startPoint()) SketchConstraintCoincidence_2 = Sketch_2.setCoincident(SketchArc_1.startPoint(), SketchLine_1.endPoint()) model.do() -Revolution_1 = model.addRevolution(Part_1_doc, [model.selection("COMPOUND", "Sketch_2")], model.selection("EDGE", "Sketch_2/Edge-SketchLine_1"), 90, 0) -Face_1 = model.addFace(Part_1_doc, [model.selection("FACE", "Revolution_1_1/Generated_Face_2")]) +Revolution_1 = model.addRevolution(Part_1_doc, [model.selection("COMPOUND", "Sketch_2")], model.selection("EDGE", "Sketch_2/SketchLine_1"), 90, 0) +Face_1 = model.addFace(Part_1_doc, [model.selection("FACE", "Revolution_1_1/Generated_Face&Sketch_2/SketchArc_1_2")]) Partition_1 = model.addPartition(Part_1_doc, [model.selection("SOLID", "Extrusion_1_1_2"), model.selection("FACE", "Face_1_1")]) model.do() diff --git a/src/FeaturesPlugin/Test/TestPartitionSubCompsolidWithFace3.py b/src/FeaturesPlugin/Test/TestPartitionSubCompsolidWithFace3.py index 93b708ca6..767544192 100644 --- a/src/FeaturesPlugin/Test/TestPartitionSubCompsolidWithFace3.py +++ b/src/FeaturesPlugin/Test/TestPartitionSubCompsolidWithFace3.py @@ -1,4 +1,4 @@ -## Copyright (C) 2018-20xx CEA/DEN, EDF R&D +## Copyright (C) 2014-2017 CEA/DEN, EDF R&D ## ## This library is free software; you can redistribute it and/or ## modify it under the terms of the GNU Lesser General Public @@ -18,6 +18,8 @@ ## email : webmaster.salome@opencascade.com ## +# -*- coding: utf-8 -*- + from salome.shaper import model from GeomAPI import * @@ -40,9 +42,9 @@ SketchLine_1 = Sketch_2.addLine(58.22303949051827, 32.8176179844255, 7.898114670 SketchConstraintCoincidence_1 = Sketch_2.setCoincident(SketchArc_1.endPoint(), SketchLine_1.startPoint()) SketchConstraintCoincidence_2 = Sketch_2.setCoincident(SketchArc_1.startPoint(), SketchLine_1.endPoint()) model.do() -Revolution_1 = model.addRevolution(Part_1_doc, [model.selection("COMPOUND", "Sketch_2")], model.selection("EDGE", "Sketch_2/Edge-SketchLine_1"), 90, 0) -Face_1 = model.addFace(Part_1_doc, [model.selection("FACE", "Revolution_1_1/Generated_Face_2")]) -Partition_1 = model.addPartition(Part_1_doc, [model.selection("SOLID", "Extrusion_1_1_3"), model.selection("FACE", "Face_1_1")]) +Revolution_1 = model.addRevolution(Part_1_doc, [model.selection("COMPOUND", "Sketch_2")], model.selection("EDGE", "Sketch_2/SketchLine_1"), 90, 0) +Face_1 = model.addFace(Part_1_doc, [model.selection("FACE", "Revolution_1_1/Generated_Face&Sketch_2/SketchArc_1_2")]) +Partition_1 = model.addPartition(Part_1_doc, [model.selection("SOLID", "Extrusion_1_1_1"), model.selection("FACE", "Face_1_1")]) model.do() # check partition diff --git a/src/FeaturesPlugin/Test/TestPartitionSubCompsolidWithFace4.py b/src/FeaturesPlugin/Test/TestPartitionSubCompsolidWithFace4.py index c2e0b8045..c9587cbe9 100644 --- a/src/FeaturesPlugin/Test/TestPartitionSubCompsolidWithFace4.py +++ b/src/FeaturesPlugin/Test/TestPartitionSubCompsolidWithFace4.py @@ -1,4 +1,4 @@ -## Copyright (C) 2018-20xx CEA/DEN, EDF R&D +## Copyright (C) 2014-2017 CEA/DEN, EDF R&D ## ## This library is free software; you can redistribute it and/or ## modify it under the terms of the GNU Lesser General Public @@ -18,6 +18,8 @@ ## email : webmaster.salome@opencascade.com ## +# -*- coding: utf-8 -*- + from salome.shaper import model from GeomAPI import * @@ -40,9 +42,10 @@ SketchLine_1 = Sketch_2.addLine(58.22303949051827, 32.8176179844255, 7.898114670 SketchConstraintCoincidence_1 = Sketch_2.setCoincident(SketchArc_1.endPoint(), SketchLine_1.startPoint()) SketchConstraintCoincidence_2 = Sketch_2.setCoincident(SketchArc_1.startPoint(), SketchLine_1.endPoint()) model.do() -Revolution_1 = model.addRevolution(Part_1_doc, [model.selection("COMPOUND", "Sketch_2")], model.selection("EDGE", "Sketch_2/Edge-SketchLine_1"), 90, 0) -Face_1 = model.addFace(Part_1_doc, [model.selection("FACE", "Revolution_1_1/Generated_Face_2")]) -Partition_1 = model.addPartition(Part_1_doc, [model.selection("SOLID", "Extrusion_1_1_2"), model.selection("SOLID", "Extrusion_1_1_3"), model.selection("FACE", "Face_1_1")]) +Revolution_1 = model.addRevolution(Part_1_doc, [model.selection("COMPOUND", "Sketch_2")], model.selection("EDGE", "Sketch_2/SketchLine_1"), 90, 0) +Face_1 = model.addFace(Part_1_doc, [model.selection("FACE", "Revolution_1_1/Generated_Face&Sketch_2/SketchArc_1_2")]) +Partition_1_objects = [model.selection("SOLID", "Extrusion_1_1_1"), model.selection("SOLID", "Extrusion_1_1_2"), model.selection("FACE", "Face_1_1")] +Partition_1 = model.addPartition(Part_1_doc, Partition_1_objects) model.do() # check partition diff --git a/src/FeaturesPlugin/Test/TestPartitionSubCompsolidWithFace5.py b/src/FeaturesPlugin/Test/TestPartitionSubCompsolidWithFace5.py index d1bc8fa05..410c58649 100644 --- a/src/FeaturesPlugin/Test/TestPartitionSubCompsolidWithFace5.py +++ b/src/FeaturesPlugin/Test/TestPartitionSubCompsolidWithFace5.py @@ -1,4 +1,4 @@ -## Copyright (C) 2018-20xx CEA/DEN, EDF R&D +## Copyright (C) 2014-2017 CEA/DEN, EDF R&D ## ## This library is free software; you can redistribute it and/or ## modify it under the terms of the GNU Lesser General Public @@ -18,6 +18,8 @@ ## email : webmaster.salome@opencascade.com ## +# -*- coding: utf-8 -*- + from salome.shaper import model from GeomAPI import * @@ -40,9 +42,10 @@ SketchLine_1 = Sketch_2.addLine(58.22303949051827, 32.8176179844255, 7.898114670 SketchConstraintCoincidence_1 = Sketch_2.setCoincident(SketchArc_1.endPoint(), SketchLine_1.startPoint()) SketchConstraintCoincidence_2 = Sketch_2.setCoincident(SketchArc_1.startPoint(), SketchLine_1.endPoint()) model.do() -Revolution_1 = model.addRevolution(Part_1_doc, [model.selection("COMPOUND", "Sketch_2")], model.selection("EDGE", "Sketch_2/Edge-SketchLine_1"), 90, 0) -Face_1 = model.addFace(Part_1_doc, [model.selection("FACE", "Revolution_1_1/Generated_Face_2")]) -Partition_1 = model.addPartition(Part_1_doc, [model.selection("SOLID", "Extrusion_1_1_1"), model.selection("FACE", "Face_1_1"), model.selection("SOLID", "Extrusion_1_1_3")]) +Revolution_1 = model.addRevolution(Part_1_doc, [model.selection("COMPOUND", "Sketch_2")], model.selection("EDGE", "Sketch_2/SketchLine_1"), 90, 0) +Face_1 = model.addFace(Part_1_doc, [model.selection("FACE", "Revolution_1_1/Generated_Face&Sketch_2/SketchArc_1_2")]) +Partition_1_objects = [model.selection("SOLID", "Extrusion_1_1_2"), model.selection("FACE", "Face_1_1"), model.selection("SOLID", "Extrusion_1_1_3")] +Partition_1 = model.addPartition(Part_1_doc, Partition_1_objects) model.do() # check partition diff --git a/src/FeaturesPlugin/Test/TestPartitionSubCompsolidWithPlane1.py b/src/FeaturesPlugin/Test/TestPartitionSubCompsolidWithPlane1.py index 3e12bd028..a2c3723c0 100644 --- a/src/FeaturesPlugin/Test/TestPartitionSubCompsolidWithPlane1.py +++ b/src/FeaturesPlugin/Test/TestPartitionSubCompsolidWithPlane1.py @@ -1,4 +1,4 @@ -## Copyright (C) 2018-20xx CEA/DEN, EDF R&D +## Copyright (C) 2014-2017 CEA/DEN, EDF R&D ## ## This library is free software; you can redistribute it and/or ## modify it under the terms of the GNU Lesser General Public @@ -18,6 +18,8 @@ ## email : webmaster.salome@opencascade.com ## +# -*- coding: utf-8 -*- + from salome.shaper import model from GeomAPI import * @@ -34,7 +36,7 @@ SketchCircle_2 = Sketch_1.addCircle(55, 30, 40) SketchConstraintRadius_1 = Sketch_1.setRadius(SketchCircle_2.results()[1], "Radius") model.do() Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("COMPOUND", "Sketch_1")], model.selection(), "ExtrusionMax", "ExtrusionMin") -Partition_1 = model.addPartition(Part_1_doc, [model.selection("SOLID", "Extrusion_1_1_1"), model.selection("FACE", "PartSet/XOZ")]) +Partition_1 = model.addPartition(Part_1_doc, [model.selection("SOLID", "Extrusion_1_1_2"), model.selection("FACE", "PartSet/XOZ")]) model.do() # check partition diff --git a/src/FeaturesPlugin/Test/TestPartitionSubCompsolidWithPlane2.py b/src/FeaturesPlugin/Test/TestPartitionSubCompsolidWithPlane2.py index f64b01b7e..8cd4be4f7 100644 --- a/src/FeaturesPlugin/Test/TestPartitionSubCompsolidWithPlane2.py +++ b/src/FeaturesPlugin/Test/TestPartitionSubCompsolidWithPlane2.py @@ -1,4 +1,4 @@ -## Copyright (C) 2018-20xx CEA/DEN, EDF R&D +## Copyright (C) 2014-2017 CEA/DEN, EDF R&D ## ## This library is free software; you can redistribute it and/or ## modify it under the terms of the GNU Lesser General Public @@ -18,6 +18,8 @@ ## email : webmaster.salome@opencascade.com ## +# -*- coding: utf-8 -*- + from salome.shaper import model from GeomAPI import * @@ -34,7 +36,7 @@ SketchCircle_2 = Sketch_1.addCircle(55, 30, 40) SketchConstraintRadius_1 = Sketch_1.setRadius(SketchCircle_2.results()[1], "Radius") model.do() Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("COMPOUND", "Sketch_1")], model.selection(), "ExtrusionMax", "ExtrusionMin") -Partition_1 = model.addPartition(Part_1_doc, [model.selection("SOLID", "Extrusion_1_1_2"), model.selection("FACE", "PartSet/XOZ")]) +Partition_1 = model.addPartition(Part_1_doc, [model.selection("SOLID", "Extrusion_1_1_1"), model.selection("FACE", "PartSet/XOZ")]) model.do() # check partition diff --git a/src/FeaturesPlugin/Test/TestPartitionSubCompsolidWithPlane3.py b/src/FeaturesPlugin/Test/TestPartitionSubCompsolidWithPlane3.py index befdd8803..38551ef73 100644 --- a/src/FeaturesPlugin/Test/TestPartitionSubCompsolidWithPlane3.py +++ b/src/FeaturesPlugin/Test/TestPartitionSubCompsolidWithPlane3.py @@ -1,4 +1,4 @@ -## Copyright (C) 2018-20xx CEA/DEN, EDF R&D +## Copyright (C) 2014-2017 CEA/DEN, EDF R&D ## ## This library is free software; you can redistribute it and/or ## modify it under the terms of the GNU Lesser General Public @@ -18,6 +18,8 @@ ## email : webmaster.salome@opencascade.com ## +# -*- coding: utf-8 -*- + from salome.shaper import model from GeomAPI import * @@ -34,7 +36,7 @@ SketchCircle_2 = Sketch_1.addCircle(55, 30, 40) SketchConstraintRadius_1 = Sketch_1.setRadius(SketchCircle_2.results()[1], "Radius") model.do() Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("COMPOUND", "Sketch_1")], model.selection(), "ExtrusionMax", "ExtrusionMin") -Partition_1 = model.addPartition(Part_1_doc, [model.selection("SOLID", "Extrusion_1_1_3"), model.selection("FACE", "PartSet/XOZ")]) +Partition_1 = model.addPartition(Part_1_doc, [model.selection("SOLID", "Extrusion_1_1_1"), model.selection("FACE", "PartSet/XOZ")]) model.do() # check partition diff --git a/src/FeaturesPlugin/Test/TestPartitionSubCompsolidWithPlane4.py b/src/FeaturesPlugin/Test/TestPartitionSubCompsolidWithPlane4.py index a4e738ff3..e403909da 100644 --- a/src/FeaturesPlugin/Test/TestPartitionSubCompsolidWithPlane4.py +++ b/src/FeaturesPlugin/Test/TestPartitionSubCompsolidWithPlane4.py @@ -1,4 +1,4 @@ -## Copyright (C) 2018-20xx CEA/DEN, EDF R&D +## Copyright (C) 2014-2017 CEA/DEN, EDF R&D ## ## This library is free software; you can redistribute it and/or ## modify it under the terms of the GNU Lesser General Public @@ -18,6 +18,8 @@ ## email : webmaster.salome@opencascade.com ## +# -*- coding: utf-8 -*- + from salome.shaper import model from GeomAPI import * @@ -34,7 +36,8 @@ SketchCircle_2 = Sketch_1.addCircle(55, 30, 40) SketchConstraintRadius_1 = Sketch_1.setRadius(SketchCircle_2.results()[1], "Radius") model.do() Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("COMPOUND", "Sketch_1")], model.selection(), "ExtrusionMax", "ExtrusionMin") -Partition_1 = model.addPartition(Part_1_doc, [model.selection("SOLID", "Extrusion_1_1_1"), model.selection("SOLID", "Extrusion_1_1_2"), model.selection("FACE", "PartSet/XOZ")]) +Partition_1_objects = [model.selection("SOLID", "Extrusion_1_1_1"), model.selection("SOLID", "Extrusion_1_1_2"), model.selection("FACE", "PartSet/XOZ")] +Partition_1 = model.addPartition(Part_1_doc, Partition_1_objects) model.do() # check partition diff --git a/src/FeaturesPlugin/Test/TestPartitionSubCompsolidWithPlane5.py b/src/FeaturesPlugin/Test/TestPartitionSubCompsolidWithPlane5.py index 11f2e34c6..76d096236 100644 --- a/src/FeaturesPlugin/Test/TestPartitionSubCompsolidWithPlane5.py +++ b/src/FeaturesPlugin/Test/TestPartitionSubCompsolidWithPlane5.py @@ -1,4 +1,4 @@ -## Copyright (C) 2018-20xx CEA/DEN, EDF R&D +## Copyright (C) 2014-2017 CEA/DEN, EDF R&D ## ## This library is free software; you can redistribute it and/or ## modify it under the terms of the GNU Lesser General Public @@ -18,6 +18,8 @@ ## email : webmaster.salome@opencascade.com ## +# -*- coding: utf-8 -*- + from salome.shaper import model from GeomAPI import * @@ -34,7 +36,8 @@ SketchCircle_2 = Sketch_1.addCircle(55, 30, 40) SketchConstraintRadius_1 = Sketch_1.setRadius(SketchCircle_2.results()[1], "Radius") model.do() Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("COMPOUND", "Sketch_1")], model.selection(), "ExtrusionMax", "ExtrusionMin") -Partition_1 = model.addPartition(Part_1_doc, [model.selection("SOLID", "Extrusion_1_1_2"), model.selection("SOLID", "Extrusion_1_1_3"), model.selection("FACE", "PartSet/XOZ")]) +Partition_1_objects = [model.selection("SOLID", "Extrusion_1_1_1"), model.selection("SOLID", "Extrusion_1_1_3"), model.selection("FACE", "PartSet/XOZ")] +Partition_1 = model.addPartition(Part_1_doc, Partition_1_objects) model.do() # check partition diff --git a/src/FeaturesPlugin/Test/TestPartitionSubCompsolidWithSolid1.py b/src/FeaturesPlugin/Test/TestPartitionSubCompsolidWithSolid1.py index 02f669053..5eb28b156 100644 --- a/src/FeaturesPlugin/Test/TestPartitionSubCompsolidWithSolid1.py +++ b/src/FeaturesPlugin/Test/TestPartitionSubCompsolidWithSolid1.py @@ -1,4 +1,4 @@ -## Copyright (C) 2018-20xx CEA/DEN, EDF R&D +## Copyright (C) 2014-2017 CEA/DEN, EDF R&D ## ## This library is free software; you can redistribute it and/or ## modify it under the terms of the GNU Lesser General Public @@ -18,6 +18,8 @@ ## email : webmaster.salome@opencascade.com ## +# -*- coding: utf-8 -*- + from salome.shaper import model from GeomAPI import * @@ -36,7 +38,7 @@ SketchConstraintRadius_1 = Sketch_1.setRadius(SketchCircle_2.results()[1], "Radi model.do() Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("COMPOUND", "Sketch_1")], model.selection(), "ExtrusionMax", "ExtrusionMin") Box_1 = model.addBox(Part_1_doc, 50, 100, "BoxHeight") -Partition_1 = model.addPartition(Part_1_doc, [model.selection("SOLID", "Extrusion_1_1_2"), model.selection("SOLID", "Box_1_1")]) +Partition_1 = model.addPartition(Part_1_doc, [model.selection("SOLID", "Extrusion_1_1_1"), model.selection("SOLID", "Box_1_1")]) model.do() # check partition diff --git a/src/FeaturesPlugin/Test/TestPartitionSubCompsolidWithSolid2.py b/src/FeaturesPlugin/Test/TestPartitionSubCompsolidWithSolid2.py index d132dd368..75e447ae9 100644 --- a/src/FeaturesPlugin/Test/TestPartitionSubCompsolidWithSolid2.py +++ b/src/FeaturesPlugin/Test/TestPartitionSubCompsolidWithSolid2.py @@ -1,4 +1,4 @@ -## Copyright (C) 2018-20xx CEA/DEN, EDF R&D +## Copyright (C) 2014-2017 CEA/DEN, EDF R&D ## ## This library is free software; you can redistribute it and/or ## modify it under the terms of the GNU Lesser General Public @@ -18,6 +18,8 @@ ## email : webmaster.salome@opencascade.com ## +# -*- coding: utf-8 -*- + from salome.shaper import model from GeomAPI import * @@ -36,7 +38,8 @@ SketchConstraintRadius_1 = Sketch_1.setRadius(SketchCircle_2.results()[1], "Radi model.do() Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("COMPOUND", "Sketch_1")], model.selection(), "ExtrusionMax", "ExtrusionMin") Box_1 = model.addBox(Part_1_doc, 50, 100, "BoxHeight") -Partition_1 = model.addPartition(Part_1_doc, [model.selection("SOLID", "Extrusion_1_1_1"), model.selection("SOLID", "Extrusion_1_1_2"), model.selection("SOLID", "Box_1_1")]) +Partition_1_objects = [model.selection("SOLID", "Extrusion_1_1_1"), model.selection("SOLID", "Extrusion_1_1_3"), model.selection("SOLID", "Box_1_1")] +Partition_1 = model.addPartition(Part_1_doc, Partition_1_objects) model.do() # check partition diff --git a/src/FeaturesPlugin/Test/TestPartitionSubCompsolidWithSolid3.py b/src/FeaturesPlugin/Test/TestPartitionSubCompsolidWithSolid3.py index 736e688e0..670121b51 100644 --- a/src/FeaturesPlugin/Test/TestPartitionSubCompsolidWithSolid3.py +++ b/src/FeaturesPlugin/Test/TestPartitionSubCompsolidWithSolid3.py @@ -1,4 +1,4 @@ -## Copyright (C) 2018-20xx CEA/DEN, EDF R&D +## Copyright (C) 2014-2017 CEA/DEN, EDF R&D ## ## This library is free software; you can redistribute it and/or ## modify it under the terms of the GNU Lesser General Public @@ -18,6 +18,8 @@ ## email : webmaster.salome@opencascade.com ## +# -*- coding: utf-8 -*- + from salome.shaper import model from GeomAPI import * @@ -36,7 +38,8 @@ SketchConstraintRadius_1 = Sketch_1.setRadius(SketchCircle_2.results()[1], "Radi model.do() Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("COMPOUND", "Sketch_1")], model.selection(), "ExtrusionMax", "ExtrusionMin") Box_1 = model.addBox(Part_1_doc, 50, 100, "BoxHeight") -Partition_1 = model.addPartition(Part_1_doc, [model.selection("SOLID", "Extrusion_1_1_2"), model.selection("SOLID", "Extrusion_1_1_3"), model.selection("SOLID", "Box_1_1")]) +Partition_1_objects = [model.selection("SOLID", "Extrusion_1_1_2"), model.selection("SOLID", "Extrusion_1_1_3"), model.selection("SOLID", "Box_1_1")] +Partition_1 = model.addPartition(Part_1_doc, Partition_1_objects) model.do() # check partition diff --git a/src/FeaturesPlugin/Test/TestPartitionSubCompsolidWithSolid4.py b/src/FeaturesPlugin/Test/TestPartitionSubCompsolidWithSolid4.py index fef86e870..340689eef 100644 --- a/src/FeaturesPlugin/Test/TestPartitionSubCompsolidWithSolid4.py +++ b/src/FeaturesPlugin/Test/TestPartitionSubCompsolidWithSolid4.py @@ -1,4 +1,4 @@ -## Copyright (C) 2018-20xx CEA/DEN, EDF R&D +## Copyright (C) 2014-2017 CEA/DEN, EDF R&D ## ## This library is free software; you can redistribute it and/or ## modify it under the terms of the GNU Lesser General Public @@ -18,6 +18,8 @@ ## email : webmaster.salome@opencascade.com ## +# -*- coding: utf-8 -*- + from salome.shaper import model from GeomAPI import * @@ -36,7 +38,8 @@ SketchConstraintRadius_1 = Sketch_1.setRadius(SketchCircle_2.results()[1], "Radi model.do() Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("COMPOUND", "Sketch_1")], model.selection(), "ExtrusionMax", "ExtrusionMin") Box_1 = model.addBox(Part_1_doc, 50, 100, "BoxHeight") -Partition_1 = model.addPartition(Part_1_doc, [model.selection("SOLID", "Extrusion_1_1_2"), model.selection("SOLID", "Box_1_1"), model.selection("SOLID", "Extrusion_1_1_1")]) +Partition_1_objects = [model.selection("SOLID", "Extrusion_1_1_2"), model.selection("SOLID", "Box_1_1"), model.selection("SOLID", "Extrusion_1_1_3")] +Partition_1 = model.addPartition(Part_1_doc, Partition_1_objects) model.do() # check partition diff --git a/src/FeaturesPlugin/Test/TestPartitionSubCompsolidWithSolid5.py b/src/FeaturesPlugin/Test/TestPartitionSubCompsolidWithSolid5.py index df68837af..30333235d 100644 --- a/src/FeaturesPlugin/Test/TestPartitionSubCompsolidWithSolid5.py +++ b/src/FeaturesPlugin/Test/TestPartitionSubCompsolidWithSolid5.py @@ -1,4 +1,4 @@ -## Copyright (C) 2018-20xx CEA/DEN, EDF R&D +## Copyright (C) 2014-2017 CEA/DEN, EDF R&D ## ## This library is free software; you can redistribute it and/or ## modify it under the terms of the GNU Lesser General Public @@ -18,6 +18,8 @@ ## email : webmaster.salome@opencascade.com ## +# -*- coding: utf-8 -*- + from salome.shaper import model from GeomAPI import * @@ -36,7 +38,8 @@ SketchConstraintRadius_1 = Sketch_1.setRadius(SketchCircle_2.results()[1], "Radi model.do() Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("COMPOUND", "Sketch_1")], model.selection(), "ExtrusionMax", "ExtrusionMin") Box_1 = model.addBox(Part_1_doc, 50, 100, "BoxHeight") -Partition_1 = model.addPartition(Part_1_doc, [model.selection("SOLID", "Box_1_1"), model.selection("SOLID", "Extrusion_1_1_1"), model.selection("SOLID", "Extrusion_1_1_2")]) +Partition_1_objects = [model.selection("SOLID", "Box_1_1"), model.selection("SOLID", "Extrusion_1_1_2"), model.selection("SOLID", "Extrusion_1_1_3")] +Partition_1 = model.addPartition(Part_1_doc, Partition_1_objects) model.do() # check partition diff --git a/src/FeaturesPlugin/Test/TestPartitionWireFaceSolid.py b/src/FeaturesPlugin/Test/TestPartitionWireFaceSolid.py index 9573c9cc7..1c3cb4576 100644 --- a/src/FeaturesPlugin/Test/TestPartitionWireFaceSolid.py +++ b/src/FeaturesPlugin/Test/TestPartitionWireFaceSolid.py @@ -1,4 +1,4 @@ -## Copyright (C) 2017 CEA/DEN, EDF R&D +## Copyright (C) 2014-2017 CEA/DEN, EDF R&D ## ## This library is free software; you can redistribute it and/or ## modify it under the terms of the GNU Lesser General Public @@ -18,6 +18,7 @@ ## email : webmaster.salome@opencascade.com ## +# -*- coding: utf-8 -*- from salome.shaper import model @@ -37,7 +38,8 @@ SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchLine_3.endPoint(), SketchConstraintCoincidence_4 = Sketch_1.setCoincident(SketchLine_1.startPoint(), SketchLine_4.endPoint()) SketchCircle_1 = Sketch_1.addCircle(14.49765103937751, 9.678507230150521, 3.831444106492329) model.do() -Face_1 = model.addFace(Part_1_doc, [model.selection("EDGE", "Sketch_1/Edge-SketchLine_1"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_4"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_3"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_2"), model.selection("EDGE", "Sketch_1/Edge-SketchCircle_1_2")]) +Face_1_objects = [model.selection("EDGE", "Sketch_1/SketchLine_1"), model.selection("EDGE", "Sketch_1/SketchLine_4"), model.selection("EDGE", "Sketch_1/SketchLine_3"), model.selection("EDGE", "Sketch_1/SketchLine_2"), model.selection("EDGE", "Sketch_1/SketchCircle_1_2")] +Face_1 = model.addFace(Part_1_doc, Face_1_objects) Sketch_2 = model.addSketch(Part_1_doc, model.defaultPlane("XOZ")) SketchLine_5 = Sketch_2.addLine(-15.11211565655763, 11.99814589971457, -14.79635576556081, -11.77064279967296) SketchLine_6 = Sketch_2.addLine(-14.79635576556081, -11.77064279967296, -3.043616368139293, -11.46189011940212) @@ -48,8 +50,10 @@ SketchLine_8 = Sketch_2.addLine(-3.922197168000547, 15.83568871823551, -15.11211 SketchConstraintCoincidence_7 = Sketch_2.setCoincident(SketchLine_7.endPoint(), SketchLine_8.startPoint()) SketchConstraintCoincidence_8 = Sketch_2.setCoincident(SketchLine_5.startPoint(), SketchLine_8.endPoint()) model.do() -Wire_1 = model.addWire(Part_1_doc, [model.selection("EDGE", "Sketch_2/Edge-SketchLine_8"), model.selection("EDGE", "Sketch_2/Edge-SketchLine_5"), model.selection("EDGE", "Sketch_2/Edge-SketchLine_6"), model.selection("EDGE", "Sketch_2/Edge-SketchLine_7")]) -Partition_1 = model.addPartition(Part_1_doc, [model.selection("FACE", "Face_1_1"), model.selection("SOLID", "Torus_1_1"), model.selection("WIRE", "Wire_1_1")]) +Wire_1_objects = [model.selection("EDGE", "Sketch_2/SketchLine_8"), model.selection("EDGE", "Sketch_2/SketchLine_5"), model.selection("EDGE", "Sketch_2/SketchLine_6"), model.selection("EDGE", "Sketch_2/SketchLine_7")] +Wire_1 = model.addWire(Part_1_doc, Wire_1_objects) +Partition_1_objects = [model.selection("FACE", "Face_1_1"), model.selection("SOLID", "Torus_1_1"), model.selection("WIRE", "Wire_1_1")] +Partition_1 = model.addPartition(Part_1_doc, Partition_1_objects) model.do() model.checkResult(Partition_1,model,1,[3],[1],[4],[22],[46]) diff --git a/src/FeaturesPlugin/Test/TestRemoveSubShapes2.py b/src/FeaturesPlugin/Test/TestRemoveSubShapes2.py index f63005660..0bac973fc 100644 --- a/src/FeaturesPlugin/Test/TestRemoveSubShapes2.py +++ b/src/FeaturesPlugin/Test/TestRemoveSubShapes2.py @@ -18,6 +18,8 @@ ## email : webmaster.salome@opencascade.com ## +# -*- coding: utf-8 -*- + from salome.shaper import model model.begin() @@ -30,7 +32,7 @@ SketchCircle_2 = Sketch_1.addCircle(-117.8044596912521, -0.1732418524871385, 54. model.do() Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("COMPOUND", "Sketch_1")], model.selection(), 10, 0) Remove_SubShapes_1 = model.addRemoveSubShapes(Part_1_doc, model.selection("COMPSOLID", "Extrusion_1_1")) -Remove_SubShapes_1.setSubShapesToRemove([model.selection("SOLID", "Extrusion_1_1_3")]) +Remove_SubShapes_1.setSubShapesToRemove([model.selection("SOLID", "Extrusion_1_1_2")]) model.do() model.end() diff --git a/src/FeaturesPlugin/Test/TestRemoveSubShapes3.py b/src/FeaturesPlugin/Test/TestRemoveSubShapes3.py index c7f7d6384..a7531b72b 100644 --- a/src/FeaturesPlugin/Test/TestRemoveSubShapes3.py +++ b/src/FeaturesPlugin/Test/TestRemoveSubShapes3.py @@ -18,6 +18,8 @@ ## email : webmaster.salome@opencascade.com ## +# -*- coding: utf-8 -*- + from salome.shaper import model model.begin() @@ -36,7 +38,7 @@ Translation_1 = model.addTranslation(Part_1_doc, [model.selection("FACE", "Face_ Shell_1 = model.addShell(Part_1_doc, [model.selection("FACE", "Translation_1_1"), model.selection("FACE", "Face_1_1")]) Remove_SubShapes_1 = model.addRemoveSubShapes(Part_1_doc, model.selection("SHELL", "Shell_1_1")) -Remove_SubShapes_1.setSubShapesToRemove([model.selection("FACE", "Shell_1_1/Modified_Face_2")]) +Remove_SubShapes_1.setSubShapesToRemove([model.selection("FACE", "Shell_1_1/Modified_Face&Face_2_1/Face_2_1")]) model.do() model.checkResult(Remove_SubShapes_1, model, 1, [0], [0], [1], [4], [8]) diff --git a/src/FeaturesPlugin/Test/TestRemoveSubShapes4.py b/src/FeaturesPlugin/Test/TestRemoveSubShapes4.py index e594d3371..5d203c268 100644 --- a/src/FeaturesPlugin/Test/TestRemoveSubShapes4.py +++ b/src/FeaturesPlugin/Test/TestRemoveSubShapes4.py @@ -1,4 +1,4 @@ -## Copyright (C) 2018-20xx CEA/DEN, EDF R&D +## Copyright (C) 2014-2017 CEA/DEN, EDF R&D ## ## This library is free software; you can redistribute it and/or ## modify it under the terms of the GNU Lesser General Public @@ -18,6 +18,8 @@ ## email : webmaster.salome@opencascade.com ## +# -*- coding: utf-8 -*- + from salome.shaper import model from GeomAPI import * @@ -47,7 +49,7 @@ SketchConstraintVertical_2 = Sketch_1.setVertical(SketchLine_4.result()) SketchConstraintEqual_1 = Sketch_1.setEqual(SketchLine_1.result(), SketchLine_4.result()) SketchConstraintLength_1 = Sketch_1.setLength(SketchLine_1.result(), 20) model.do() -Face_1 = model.addFace(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_1f-SketchLine_2f-SketchLine_3f-SketchLine_4f")]) +Face_1 = model.addFace(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_1r-SketchLine_2f-SketchLine_3f-SketchLine_4f")]) LinearCopy_1 = model.addMultiTranslation(Part_1_doc, [model.selection("FACE", "Face_1_1")], model.selection("EDGE", "PartSet/OZ"), 2, 2) Partition_1_objects = [model.selection("SOLID", "Box_1_1"), model.selection("FACE", "LinearCopy_1_1_1"), model.selection("FACE", "LinearCopy_1_1_2")] Partition_1 = model.addPartition(Part_1_doc, Partition_1_objects) diff --git a/src/FeaturesPlugin/Test/TestRemoveSubShapes5.py b/src/FeaturesPlugin/Test/TestRemoveSubShapes5.py index ff3c8d804..8d24febe2 100644 --- a/src/FeaturesPlugin/Test/TestRemoveSubShapes5.py +++ b/src/FeaturesPlugin/Test/TestRemoveSubShapes5.py @@ -1,4 +1,4 @@ -## Copyright (C) 2018-20xx CEA/DEN, EDF R&D +## Copyright (C) 2014-2017 CEA/DEN, EDF R&D ## ## This library is free software; you can redistribute it and/or ## modify it under the terms of the GNU Lesser General Public @@ -18,6 +18,8 @@ ## email : webmaster.salome@opencascade.com ## +# -*- coding: utf-8 -*- + from salome.shaper import model from GeomAPI import * @@ -47,7 +49,7 @@ SketchConstraintVertical_2 = Sketch_1.setVertical(SketchLine_4.result()) SketchConstraintEqual_1 = Sketch_1.setEqual(SketchLine_1.result(), SketchLine_4.result()) SketchConstraintLength_1 = Sketch_1.setLength(SketchLine_1.result(), 20) model.do() -Face_1 = model.addFace(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_1f-SketchLine_2f-SketchLine_3f-SketchLine_4f")]) +Face_1 = model.addFace(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_1r-SketchLine_2f-SketchLine_3f-SketchLine_4f")]) LinearCopy_1 = model.addMultiTranslation(Part_1_doc, [model.selection("FACE", "Face_1_1")], model.selection("EDGE", "PartSet/OZ"), 2, 2) Partition_1_objects = [model.selection("SOLID", "Box_1_1"), model.selection("FACE", "LinearCopy_1_1_1"), model.selection("FACE", "LinearCopy_1_1_2")] Partition_1 = model.addPartition(Part_1_doc, Partition_1_objects) diff --git a/src/FeaturesPlugin/Test/TestRemoveSubShapes6.py b/src/FeaturesPlugin/Test/TestRemoveSubShapes6.py index ff61445e5..806869411 100644 --- a/src/FeaturesPlugin/Test/TestRemoveSubShapes6.py +++ b/src/FeaturesPlugin/Test/TestRemoveSubShapes6.py @@ -1,4 +1,4 @@ -## Copyright (C) 2018-20xx CEA/DEN, EDF R&D +## Copyright (C) 2014-2017 CEA/DEN, EDF R&D ## ## This library is free software; you can redistribute it and/or ## modify it under the terms of the GNU Lesser General Public @@ -18,6 +18,8 @@ ## email : webmaster.salome@opencascade.com ## +# -*- coding: utf-8 -*- + from salome.shaper import model from GeomAPI import * @@ -47,7 +49,7 @@ SketchConstraintVertical_2 = Sketch_1.setVertical(SketchLine_4.result()) SketchConstraintEqual_1 = Sketch_1.setEqual(SketchLine_1.result(), SketchLine_4.result()) SketchConstraintLength_1 = Sketch_1.setLength(SketchLine_1.result(), 20) model.do() -Face_1 = model.addFace(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_1f-SketchLine_2f-SketchLine_3f-SketchLine_4f")]) +Face_1 = model.addFace(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_1r-SketchLine_2f-SketchLine_3f-SketchLine_4f")]) LinearCopy_1 = model.addMultiTranslation(Part_1_doc, [model.selection("FACE", "Face_1_1")], model.selection("EDGE", "PartSet/OZ"), 2, 2) Partition_1_objects = [model.selection("SOLID", "Box_1_1"), model.selection("FACE", "LinearCopy_1_1_1"), model.selection("FACE", "LinearCopy_1_1_2")] Partition_1 = model.addPartition(Part_1_doc, Partition_1_objects) diff --git a/src/FeaturesPlugin/Test/TestRevolutionCut.py b/src/FeaturesPlugin/Test/TestRevolutionCut.py index 21bb4644b..79d6ca06c 100644 --- a/src/FeaturesPlugin/Test/TestRevolutionCut.py +++ b/src/FeaturesPlugin/Test/TestRevolutionCut.py @@ -104,7 +104,7 @@ dirx = geomDataAPI_Dir(aLineSketchFeature.attribute("DirX")) dirx.setValue(1, 0, 0) norm = geomDataAPI_Dir(aLineSketchFeature.attribute("Norm")) norm.setValue(0, 0, 1) -aLineSketchFeature.selection("External").selectSubShape("face", "Extrusion_1/TopFace_1") +aLineSketchFeature.selection("External").selectSubShape("face", "Extrusion_1/TopFace") aSketchLine = aLineSketchFeature.addFeature("SketchLine") aLineStartPoint = geomDataAPI_Point2D(aSketchLine.attribute("StartPoint")) @@ -134,7 +134,7 @@ dirx = geomDataAPI_Dir(aCircleSketchFeature.attribute("DirX")) dirx.setValue(1, 0, 0) norm = geomDataAPI_Dir(aCircleSketchFeature.attribute("Norm")) norm.setValue(0, 0, 1) -aCircleSketchFeature.selection("External").selectSubShape("face", "Extrusion_1/To_Face_1") +aCircleSketchFeature.selection("External").selectSubShape("face", "Extrusion_1/To_Face") aSession.startOperation() aSketchCircle = aCircleSketchFeature.addFeature("SketchCircle") anCircleCentr = geomDataAPI_Point2D(aSketchCircle.attribute("circle_center")) diff --git a/src/FeaturesPlugin/Test/TestRevolutionFuse.py b/src/FeaturesPlugin/Test/TestRevolutionFuse.py index 659cde9b8..963037690 100644 --- a/src/FeaturesPlugin/Test/TestRevolutionFuse.py +++ b/src/FeaturesPlugin/Test/TestRevolutionFuse.py @@ -132,7 +132,7 @@ dirx = geomDataAPI_Dir(aLineSketchFeature.attribute("DirX")) dirx.setValue(1, 0, 0) norm = geomDataAPI_Dir(aLineSketchFeature.attribute("Norm")) norm.setValue(0, 0, 1) -aLineSketchFeature.selection("External").selectSubShape("face", "Extrusion_1/TopFace_1") +aLineSketchFeature.selection("External").selectSubShape("face", "Extrusion_1/TopFace") aSketchLine = aLineSketchFeature.addFeature("SketchLine") aLineStartPoint = geomDataAPI_Point2D(aSketchLine.attribute("StartPoint")) @@ -162,7 +162,7 @@ dirx = geomDataAPI_Dir(aCircleSketchFeature.attribute("DirX")) dirx.setValue(1, 0, 0) norm = geomDataAPI_Dir(aCircleSketchFeature.attribute("Norm")) norm.setValue(0, 0, 1) -aCircleSketchFeature.selection("External").selectSubShape("face", "Extrusion_1/To_Face_1") +aCircleSketchFeature.selection("External").selectSubShape("face", "Extrusion_1/To_Face") aSession.startOperation() aSketchCircle = aCircleSketchFeature.addFeature("SketchCircle") anCircleCentr = geomDataAPI_Point2D(aSketchCircle.attribute("circle_center")) diff --git a/src/FeaturesPlugin/Test/TestSerialBoolean.py b/src/FeaturesPlugin/Test/TestSerialBoolean.py index ddbde4793..d81439775 100644 --- a/src/FeaturesPlugin/Test/TestSerialBoolean.py +++ b/src/FeaturesPlugin/Test/TestSerialBoolean.py @@ -18,15 +18,9 @@ ## email : webmaster.salome@opencascade.com ## -""" - TestExtrusion.py - Unit test of FeaturesPlugin_Boolean class: many Boolean operations performance - - class FeaturesPlugin_Extrusion : public ModelAPI_Feature - static const std::string MY_EXTRUSION_ID("Extrusion"); - static const std::string MY_FACE_ID("base"); - static const std::string MY_SIZE_ID("size"); - static const std::string MY_REVERSE_ID("reverse"); +# -*- coding: utf-8 -*- + +from salome.shaper import model data()->addAttribute(FeaturesPlugin_Extrusion::FACE_ID(), ModelAPI_AttributeSelection::typeId()); data()->addAttribute(FeaturesPlugin_Extrusion::SIZE_ID(), ModelAPI_AttributeDouble::typeId()); diff --git a/src/FeaturesPlugin/Test/TestUnion4CurvedFaces.py b/src/FeaturesPlugin/Test/TestUnion4CurvedFaces.py index 80665ef41..aff0c7b96 100644 --- a/src/FeaturesPlugin/Test/TestUnion4CurvedFaces.py +++ b/src/FeaturesPlugin/Test/TestUnion4CurvedFaces.py @@ -1,4 +1,4 @@ -## Copyright (C) 2017 CEA/DEN, EDF R&D +## Copyright (C) 2014-2017 CEA/DEN, EDF R&D ## ## This library is free software; you can redistribute it and/or ## modify it under the terms of the GNU Lesser General Public @@ -18,6 +18,7 @@ ## email : webmaster.salome@opencascade.com ## +# -*- coding: utf-8 -*- from salome.shaper import model @@ -36,7 +37,7 @@ SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchArc_1.startPoint(), SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchArc_1.endPoint(), SketchLine_1.endPoint()) SketchConstraintVertical_1 = Sketch_1.setVertical(SketchLine_1.result()) model.do() -Edge_1 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_1/Edge-SketchArc_1_2")]) +Edge_1 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_1/SketchArc_1_2")]) Revolution_1 = model.addRevolution(Part_1_doc, [model.selection("EDGE", "Edge_1_1")], model.selection("EDGE", "PartSet/OY"), 200, 0) Partition_1 = model.addPartition(Part_1_doc, [model.selection("FACE", "PartSet/XOZ"), model.selection("FACE", "Revolution_1_1")]) Union_1 = model.addUnion(Part_1_doc, [model.selection("FACE", "Partition_1_1_1"), model.selection("FACE", "Partition_1_1_2")]) diff --git a/src/FeaturesPlugin/Test/TestUnion4CurvedFaces_2.py b/src/FeaturesPlugin/Test/TestUnion4CurvedFaces_2.py index 2519dd469..52d67d340 100644 --- a/src/FeaturesPlugin/Test/TestUnion4CurvedFaces_2.py +++ b/src/FeaturesPlugin/Test/TestUnion4CurvedFaces_2.py @@ -1,3 +1,8 @@ +## Copyright (C) 2014-2017 CEA/DEN, EDF R&D +## +## This library is free software; you can redistribute it and/or +## modify it under the terms of the GNU Lesser General Public +## License as published by the Free Software Foundation; either ## version 2.1 of the License, or (at your option) any later version. ## ## This library is distributed in the hope that it will be useful, @@ -13,6 +18,8 @@ ## email : webmaster.salome@opencascade.com ## +# -*- coding: utf-8 -*- + from salome.shaper import model model.begin() @@ -30,10 +37,12 @@ SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchArc_1.startPoint(), SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchArc_1.endPoint(), SketchLine_1.endPoint()) SketchConstraintVertical_1 = Sketch_1.setVertical(SketchLine_1.result()) model.do() -Edge_1 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_1/Edge-SketchArc_1_2")]) +Edge_1 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_1/SketchArc_1_2")]) Revolution_1 = model.addRevolution(Part_1_doc, [model.selection("EDGE", "Edge_1_1")], model.selection("EDGE", "PartSet/OY"), 360, 0) -Partition_1 = model.addPartition(Part_1_doc, [model.selection("FACE", "PartSet/YOZ"), model.selection("FACE", "PartSet/XOZ"), model.selection("FACE", "PartSet/XOY"), model.selection("FACE", "Revolution_1_1")]) -Union_1 = model.addUnion(Part_1_doc, [model.selection("FACE", "Partition_1_1_1"), model.selection("FACE", "Partition_1_1_2"), model.selection("FACE", "Partition_1_1_3"), model.selection("FACE", "Partition_1_1_4")]) +Partition_1_objects = [model.selection("FACE", "PartSet/YOZ"), model.selection("FACE", "PartSet/XOZ"), model.selection("FACE", "PartSet/XOY"), model.selection("FACE", "Revolution_1_1")] +Partition_1 = model.addPartition(Part_1_doc, Partition_1_objects) +Union_1_objects = [model.selection("FACE", "Partition_1_1_1"), model.selection("FACE", "Partition_1_1_2"), model.selection("FACE", "Partition_1_1_3"), model.selection("FACE", "Partition_1_1_4")] +Union_1 = model.addUnion(Part_1_doc, Union_1_objects) model.testHaveNamingSubshapes(Union_1,model,Part_1_doc) model.do() model.end() diff --git a/src/FeaturesPlugin/Test/TestUnion4Faces.py b/src/FeaturesPlugin/Test/TestUnion4Faces.py index f5adc70c8..87b1617a8 100644 --- a/src/FeaturesPlugin/Test/TestUnion4Faces.py +++ b/src/FeaturesPlugin/Test/TestUnion4Faces.py @@ -1,4 +1,4 @@ -## Copyright (C) 2017 CEA/DEN, EDF R&D +## Copyright (C) 2014-2017 CEA/DEN, EDF R&D ## ## This library is free software; you can redistribute it and/or ## modify it under the terms of the GNU Lesser General Public @@ -18,6 +18,7 @@ ## email : webmaster.salome@opencascade.com ## +# -*- coding: utf-8 -*- from salome.shaper import model @@ -37,9 +38,9 @@ SketchLine_5 = Sketch_1.addLine(31.85610465116278, -38.16860465116279, -44.48110 SketchConstraintCoincidence_4 = Sketch_1.setCoincident(SketchLine_4.endPoint(), SketchLine_5.startPoint()) SketchConstraintCoincidence_5 = Sketch_1.setCoincident(SketchLine_5.endPoint(), SketchLine_1.startPoint()) model.do() -Sketch_2 = model.addSketch(Part_1_doc, model.selection("FACE", "Sketch_1/Face-SketchLine_1r-SketchLine_2r-SketchLine_3r-SketchLine_4r-SketchLine_5r")) +Sketch_2 = model.addSketch(Part_1_doc, model.selection("FACE", "Sketch_1/Face-SketchLine_5r-SketchLine_4r-SketchLine_3r-SketchLine_2r-SketchLine_1r")) SketchLine_6 = Sketch_2.addLine(31.85610465116278, -38.16860465116279, -40.43276493886778, -56.03425756438362) -SketchProjection_1 = Sketch_2.addProjection(model.selection("VERTEX", "Sketch_1/Vertex-SketchLine_5s-SketchLine_4e"), False) +SketchProjection_1 = Sketch_2.addProjection(model.selection("VERTEX", "Sketch_1/SketchLine_4_EndVertex"), False) SketchPoint_1 = SketchProjection_1.createdFeature() SketchConstraintCoincidence_6 = Sketch_2.setCoincident(SketchLine_6.startPoint(), SketchPoint_1.result()) SketchLine_7 = Sketch_2.addLine(-40.43276493886778, -56.03425756438362, -115.5003601973775, -26.06900348999911) @@ -48,14 +49,18 @@ SketchLine_8 = Sketch_2.addLine(-115.5003601973775, -26.06900348999911, -106.232 SketchConstraintCoincidence_8 = Sketch_2.setCoincident(SketchLine_7.endPoint(), SketchLine_8.startPoint()) SketchLine_9 = Sketch_2.addLine(-106.2327558444751, 34.47934494896344, -44.48110465116279, 12.33139534883721) SketchConstraintCoincidence_9 = Sketch_2.setCoincident(SketchLine_8.endPoint(), SketchLine_9.startPoint()) -SketchProjection_2 = Sketch_2.addProjection(model.selection("VERTEX", "Sketch_1/Vertex-SketchLine_1s-SketchLine_5e"), False) +SketchProjection_2 = Sketch_2.addProjection(model.selection("VERTEX", "Sketch_1/SketchLine_1_StartVertex"), False) SketchPoint_2 = SketchProjection_2.createdFeature() SketchConstraintCoincidence_10 = Sketch_2.setCoincident(SketchLine_9.endPoint(), SketchPoint_2.result()) model.do() -Face_1 = model.addFace(Part_1_doc, [model.selection("EDGE", "Sketch_1/Edge-SketchLine_1"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_2"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_3"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_4"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_5")]) -Face_2 = model.addFace(Part_1_doc, [model.selection("EDGE", "Sketch_2/Edge-SketchLine_9"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_5"), model.selection("EDGE", "Sketch_2/Edge-SketchLine_6"), model.selection("EDGE", "Sketch_2/Edge-SketchLine_7"), model.selection("EDGE", "Sketch_2/Edge-SketchLine_8")]) -Partition_1 = model.addPartition(Part_1_doc, [model.selection("FACE", "Face_2_1"), model.selection("FACE", "Face_1_1"), model.selection("FACE", "PartSet/YOZ")]) -Union_1 = model.addUnion(Part_1_doc, [model.selection("FACE", "Partition_1_1_1"), model.selection("FACE", "Partition_1_1_3"), model.selection("FACE", "Partition_1_1_4")]) +Face_1_objects = [model.selection("EDGE", "Sketch_1/SketchLine_1"), model.selection("EDGE", "Sketch_1/SketchLine_2"), model.selection("EDGE", "Sketch_1/SketchLine_3"), model.selection("EDGE", "Sketch_1/SketchLine_4"), model.selection("EDGE", "Sketch_1/SketchLine_5")] +Face_1 = model.addFace(Part_1_doc, Face_1_objects) +Face_2_objects = [model.selection("EDGE", "Sketch_2/SketchLine_9"), model.selection("EDGE", "Sketch_1/SketchLine_5"), model.selection("EDGE", "Sketch_2/SketchLine_6"), model.selection("EDGE", "Sketch_2/SketchLine_7"), model.selection("EDGE", "Sketch_2/SketchLine_8")] +Face_2 = model.addFace(Part_1_doc, Face_2_objects) +Partition_1_objects = [model.selection("FACE", "Face_2_1"), model.selection("FACE", "Face_1_1"), model.selection("FACE", "PartSet/YOZ")] +Partition_1 = model.addPartition(Part_1_doc, Partition_1_objects) +Union_1_objects = [model.selection("FACE", "Partition_1_1_1"), model.selection("FACE", "Partition_1_1_3"), model.selection("FACE", "Partition_1_1_4")] +Union_1 = model.addUnion(Part_1_doc, Union_1_objects) model.do() model.checkResult(Union_1,model,1,[2],[0],[2],[13],[26]) diff --git a/src/FeaturesPlugin/Test/TestUnionFaces.py b/src/FeaturesPlugin/Test/TestUnionFaces.py index ae80df8af..886da1df4 100644 --- a/src/FeaturesPlugin/Test/TestUnionFaces.py +++ b/src/FeaturesPlugin/Test/TestUnionFaces.py @@ -18,6 +18,8 @@ ## email : webmaster.salome@opencascade.com ## +# -*- coding: utf-8 -*- + from salome.shaper import model model.begin() @@ -27,8 +29,9 @@ Part_1_doc = Part_1.document() Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY")) SketchCircle_1 = Sketch_1.addCircle(-5.197255574614073, 0.1732418524871273, 67.586529314451) model.do() -Face_1 = model.addFace(Part_1_doc, [model.selection("EDGE", "Sketch_1/Edge-SketchCircle_1_2")]) -Partition_1 = model.addPartition(Part_1_doc, [model.selection("FACE", "Face_1_1"), model.selection("FACE", "PartSet/YOZ"), model.selection("FACE", "PartSet/XOZ")]) +Face_1 = model.addFace(Part_1_doc, [model.selection("EDGE", "Sketch_1/SketchCircle_1_2")]) +Partition_1_objects = [model.selection("FACE", "Face_1_1"), model.selection("FACE", "PartSet/YOZ"), model.selection("FACE", "PartSet/XOZ")] +Partition_1 = model.addPartition(Part_1_doc, Partition_1_objects) Union_1 = model.addUnion(Part_1_doc, [model.selection("FACE", "Partition_1_1_1"), model.selection("FACE", "Partition_1_1_2")]) model.do() model.end() diff --git a/src/FeaturesPlugin/Test/TestUnionOfUnion.py b/src/FeaturesPlugin/Test/TestUnionOfUnion.py index a681118ea..ba8e4c177 100644 --- a/src/FeaturesPlugin/Test/TestUnionOfUnion.py +++ b/src/FeaturesPlugin/Test/TestUnionOfUnion.py @@ -18,6 +18,8 @@ ## email : webmaster.salome@opencascade.com ## +# -*- coding: utf-8 -*- + from salome.shaper import model model.begin() @@ -30,7 +32,8 @@ Plane_5 = model.addPlane(Part_1_doc, model.selection("FACE", "Box_1_1/Front"), 5 Partition_1_objects = [model.selection("FACE", "Plane_1"), model.selection("FACE", "Plane_2"), model.selection("SOLID", "Box_1_1")] Partition_1 = model.addPartition(Part_1_doc, Partition_1_objects) Union_1 = model.addUnion(Part_1_doc, [model.selection("SOLID", "Partition_1_1_3"), model.selection("SOLID", "Partition_1_1_1")]) -Union_2 = model.addUnion(Part_1_doc, [model.selection("SOLID", "Partition_1_1_4/Partition_1_1_4"), model.selection("SOLID", "Partition_1_1_2/Partition_1_1_2")]) +Union_2 = model.addUnion(Part_1_doc, [model.selection("SOLID", "Union_1_1_2"), model.selection("SOLID", "Union_1_1_1")]) +model.do() model.end() from GeomAPI import GeomAPI_Shape