From: Clarisse GENRAULT - DEN/DANS/DM2S/STMF/LGLS - 2012/10/01 Date: Thu, 14 Mar 2019 14:20:36 +0000 (+0100) Subject: Renaming Fill in Split : Unit tests X-Git-Tag: V9_3_0b1~1 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=ebce006a9ba80eab34d5b9e16fab6979fc091a02;p=modules%2Fshaper.git Renaming Fill in Split : Unit tests --- diff --git a/src/CollectionPlugin/Test/TestGroupMove06.py b/src/CollectionPlugin/Test/TestGroupMove06.py index c3f79ffb8..362876a21 100644 --- a/src/CollectionPlugin/Test/TestGroupMove06.py +++ b/src/CollectionPlugin/Test/TestGroupMove06.py @@ -18,7 +18,7 @@ # # Test of deep nested results history. -# Copied boxes are involved to Fill operation. +# Copied boxes are involved to Split operation. # Check the groups of initial boxes moved to the end contain the corresponding # results, but divided. @@ -42,10 +42,10 @@ Group_5 = model.addGroup(Part_1_doc, Group_5_objects) Group_6_objects = [model.selection("EDGE", "[LinearCopy_1_1_2/MF:Translated&Box_1_1/Back][LinearCopy_1_1_2/MF:Translated&Box_1_1/Bottom]"), model.selection("EDGE", "[LinearCopy_1_1_2/MF:Translated&Box_1_1/Back][LinearCopy_1_1_2/MF:Translated&Box_1_1/Right]"), model.selection("EDGE", "[LinearCopy_1_1_2/MF:Translated&Box_1_1/Back][LinearCopy_1_1_2/MF:Translated&Box_1_1/Left]"), model.selection("EDGE", "[LinearCopy_1_1_2/MF:Translated&Box_1_1/Back][LinearCopy_1_1_2/MF:Translated&Box_1_1/Top]"), model.selection("EDGE", "[LinearCopy_1_1_2/MF:Translated&Box_1_1/Right][LinearCopy_1_1_2/MF:Translated&Box_1_1/Bottom]"), model.selection("EDGE", "[LinearCopy_1_1_2/MF:Translated&Box_1_1/Left][LinearCopy_1_1_2/MF:Translated&Box_1_1/Top]"), model.selection("EDGE", "[LinearCopy_1_1_2/MF:Translated&Box_1_1/Left][LinearCopy_1_1_2/MF:Translated&Box_1_1/Bottom]"), model.selection("EDGE", "[LinearCopy_1_1_2/MF:Translated&Box_1_1/Right][LinearCopy_1_1_2/MF:Translated&Box_1_1/Top]"), model.selection("EDGE", "[LinearCopy_1_1_2/MF:Translated&Box_1_1/Front][LinearCopy_1_1_2/MF:Translated&Box_1_1/Bottom]"), model.selection("EDGE", "[LinearCopy_1_1_2/MF:Translated&Box_1_1/Front][LinearCopy_1_1_2/MF:Translated&Box_1_1/Left]"), model.selection("EDGE", "[LinearCopy_1_1_2/MF:Translated&Box_1_1/Front][LinearCopy_1_1_2/MF:Translated&Box_1_1/Right]"), model.selection("EDGE", "[LinearCopy_1_1_2/MF:Translated&Box_1_1/Front][LinearCopy_1_1_2/MF:Translated&Box_1_1/Top]")] Group_6 = model.addGroup(Part_1_doc, Group_6_objects) Plane_4 = model.addPlane(Part_1_doc, model.selection("FACE", "LinearCopy_1_1_1/MF:Translated&Box_1_1/Left"), model.selection("FACE", "LinearCopy_1_1_1/MF:Translated&Box_1_1/Right")) -Fill_1 = model.addFill(Part_1_doc, [model.selection("SOLID", "LinearCopy_1_1_1")], [model.selection("SOLID", "LinearCopy_1_1_2"), model.selection("FACE", "Plane_1")]) +Split_1 = model.addSplit(Part_1_doc, [model.selection("SOLID", "LinearCopy_1_1_1")], [model.selection("SOLID", "LinearCopy_1_1_2"), model.selection("FACE", "Plane_1")]) model.do() # move groups to the end -Part_1_doc.moveFeature(Group_1.feature(), Fill_1.feature()) +Part_1_doc.moveFeature(Group_1.feature(), Split_1.feature()) Part_1_doc.moveFeature(Group_2.feature(), Group_1.feature()) Part_1_doc.moveFeature(Group_3.feature(), Group_2.feature()) Part_1_doc.moveFeature(Group_4.feature(), Group_3.feature()) @@ -85,11 +85,11 @@ assert(aFactory.validate(Group_6.feature())) model.begin() -Filling_1 = model.addFilling(Part_1_doc, [model.selection("EDGE", "Fill_1_1_2/Generated_Edge&Plane_1/Plane_1&Box_1_1/Top"), model.selection("EDGE", "[Fill_1_1_2/Modified_Face&Box_1_1/Right][(Fill_1_1_2/Modified_Face&Box_1_1/Right)(Fill_1_1_2/Modified_Face&Plane_1/Plane_1)(Fill_1_1_2/Modified_Face&Box_1_1/Front)(Fill_1_1_2/Modified_Face&Box_1_1/Top)2(Fill_1_1_2/Modified_Face&Box_1_1/Left)2]")]) -Fill_2 = model.addFill(Part_1_doc, [model.selection("SOLID", "Fill_1_1_2")], [model.selection("FACE", "Filling_1_1")]) +Filling_1 = model.addFilling(Part_1_doc, [model.selection("EDGE", "Split_1_1_2/Generated_Edge&Plane_1/Plane_1&Box_1_1/Top"), model.selection("EDGE", "[Split_1_1_2/Modified_Face&Box_1_1/Right][(Split_1_1_2/Modified_Face&Box_1_1/Right)(Split_1_1_2/Modified_Face&Plane_1/Plane_1)(Split_1_1_2/Modified_Face&Box_1_1/Front)(Split_1_1_2/Modified_Face&Box_1_1/Top)2(Split_1_1_2/Modified_Face&Box_1_1/Left)2]")]) +Split_2 = model.addSplit(Part_1_doc, [model.selection("SOLID", "Split_1_1_2")], [model.selection("FACE", "Filling_1_1")]) model.do() # move groups to the end once again -Part_1_doc.moveFeature(Group_1.feature(), Fill_2.feature()) +Part_1_doc.moveFeature(Group_1.feature(), Split_2.feature()) Part_1_doc.moveFeature(Group_2.feature(), Group_1.feature()) Part_1_doc.moveFeature(Group_3.feature(), Group_2.feature()) Part_1_doc.moveFeature(Group_4.feature(), Group_3.feature()) diff --git a/src/CollectionPlugin/Test/TestGroupMove20.py b/src/CollectionPlugin/Test/TestGroupMove20.py index 9726cd6b4..46982ef00 100644 --- a/src/CollectionPlugin/Test/TestGroupMove20.py +++ b/src/CollectionPlugin/Test/TestGroupMove20.py @@ -18,7 +18,7 @@ # # Test based on DBC mail 04.03.2019. If the selected solid was not modified by -# the following Fill operation, this selection disappears after movement to the end. +# the following Split operation, this selection disappears after movement to the end. from GeomAPI import * from ModelAPI import * @@ -31,13 +31,13 @@ Part_1_doc = Part_1.document() Box_1 = model.addBox(Part_1_doc, 10, 10, 10) Plane_4 = model.addPlane(Part_1_doc, model.selection("FACE", "Box_1_1/Front"), 2, True) Plane_5 = model.addPlane(Part_1_doc, model.selection("FACE", "Box_1_1/Front"), 7, True) -Fill_1 = model.addFill(Part_1_doc, [model.selection("SOLID", "Box_1_1")], [model.selection("FACE", "Plane_2")]) -Group_1 = model.addGroup(Part_1_doc, [model.selection("SOLID", "Fill_1_1_1")]) -Fill_2 = model.addFill(Part_1_doc, [model.selection("COMPSOLID", "Fill_1_1")], [model.selection("FACE", "Plane_1")]) +Split_1 = model.addSplit(Part_1_doc, [model.selection("SOLID", "Box_1_1")], [model.selection("FACE", "Plane_2")]) +Group_1 = model.addGroup(Part_1_doc, [model.selection("SOLID", "Split_1_1_1")]) +Split_2 = model.addSplit(Part_1_doc, [model.selection("COMPSOLID", "Split_1_1")], [model.selection("FACE", "Plane_1")]) model.do() # move group -Part_1_doc.moveFeature(Group_1.feature(), Fill_2.feature()) +Part_1_doc.moveFeature(Group_1.feature(), Split_2.feature()) model.end() # Check group: result must be four faces diff --git a/src/FeaturesPlugin/CMakeLists.txt b/src/FeaturesPlugin/CMakeLists.txt index 27115310a..e2f94dca0 100644 --- a/src/FeaturesPlugin/CMakeLists.txt +++ b/src/FeaturesPlugin/CMakeLists.txt @@ -217,9 +217,9 @@ ADD_UNIT_TESTS(TestExtrusion.py TestBoolean3.py TestBooleanCompSolids.py TestBooleanSmash.py - TestBooleanFill.py - TestBooleanFillWithPlane.py - TestBooleanFill_ErrorMsg.py + TestBooleanSplit.py + TestBooleanSplitWithPlane.py + TestBooleanSplit_ErrorMsg.py TestMultiBoolean.py TestSerialBoolean.py TestBoolean_ErrorMsg.py @@ -241,43 +241,43 @@ ADD_UNIT_TESTS(TestExtrusion.py TestPipe_ErrorMsg.py TestRecover.py TestRecover1798.py - TestFillEdgeVertex.py - TestFillEdgeEdge.py - TestFillEdgeEdgeIntersected.py - TestFillEdgeWire.py - TestFillEdgeFace.py - TestFillEdgeShell.py - TestFillEdgeSolid.py - TestFillEdgeSolidIntersected.py - TestFillWireVertex.py - TestFillWireEdge.py - TestFillWireWire.py - TestFillWireFace.py - TestFillWireShell.py - TestFillWireSolid.py - TestFillFaceVertex.py - TestFillFaceEdge.py - TestFillFaceEdgeInside.py - TestFillFaceEdgePerpendicular.py - TestFillFaceWire.py - TestFillFaceFace.py - TestFillFaceShell.py - TestFillFaceSolid.py - TestFillCompFaceSolid.py - TestFillShellVertex.py - TestFillShellEdge.py - TestFillShellConstrPlane.py - TestFillShellWire.py - TestFillShellFace.py - TestFillShellShell.py - TestFillShellSolid.py - TestFillSolid2ConstructionPlanes.py - TestFillSolidEdge.py - TestFillSolidFace.py - TestFillSolidCompFace.py - TestFillSolidShell.py - TestFillSolidCompShell.py - TestFillCompsolidPlane.py + TestSplitEdgeVertex.py + TestSplitEdgeEdge.py + TestSplitEdgeEdgeIntersected.py + TestSplitEdgeWire.py + TestSplitEdgeFace.py + TestSplitEdgeShell.py + TestSplitEdgeSolid.py + TestSplitEdgeSolidIntersected.py + TestSplitWireVertex.py + TestSplitWireEdge.py + TestSplitWireWire.py + TestSplitWireFace.py + TestSplitWireShell.py + TestSplitWireSolid.py + TestSplitFaceVertex.py + TestSplitFaceEdge.py + TestSplitFaceEdgeInside.py + TestSplitFaceEdgePerpendicular.py + TestSplitFaceWire.py + TestSplitFaceFace.py + TestSplitFaceShell.py + TestSplitFaceSolid.py + TestSplitCompFaceSolid.py + TestSplitShellVertex.py + TestSplitShellEdge.py + TestSplitShellConstrPlane.py + TestSplitShellWire.py + TestSplitShellFace.py + TestSplitShellShell.py + TestSplitShellSolid.py + TestSplitSolid2ConstructionPlanes.py + TestSplitSolidEdge.py + TestSplitSolidFace.py + TestSplitSolidCompFace.py + TestSplitSolidShell.py + TestSplitSolidCompShell.py + TestSplitCompsolidPlane.py TestPartition2Faces.py TestPartition2Solids.py TestPartition2Wires.py @@ -299,7 +299,7 @@ ADD_UNIT_TESTS(TestExtrusion.py TestMeasurementAngle3Points.py TestMeasurementPresentation.py TestFusionFaces.py - TestFusionFaces2697.py + TestFusionFaces2697.py Test1379.py Test1922.py Test1942.py diff --git a/src/FeaturesPlugin/Test/Test2394.py b/src/FeaturesPlugin/Test/Test2394.py index 8c4def393..1aeafcd3a 100644 --- a/src/FeaturesPlugin/Test/Test2394.py +++ b/src/FeaturesPlugin/Test/Test2394.py @@ -80,25 +80,25 @@ SketchProjection_4 = Sketch_2.addProjection(model.selection("EDGE", "[Revolution 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")]) +Split_1 = model.addSplit(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&Sketch_2/SketchLine_5&Revolution_1_1/To_Face][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]")) +Axis_4 = model.addAxis(Part_1_doc, model.selection("VERTEX", "Point_1"), model.selection("VERTEX", "[Split_1_1_2/Modified_Face&Sketch_2/SketchLine_5&Revolution_1_1/To_Face][Split_1_1_2/Modified_Face&Sketch_2/SketchLine_4&Revolution_1_1/From_Face][Split_1_1_2/Modified_Face&Extrusion_1_1/To_Face&Sketch_1/SketchLine_3]")) 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&Sketch_2/SketchLine_6"), model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_2/SketchLine_6][Extrusion_1_1/From_Face]"), 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_6][Extrusion_1_1/Generated_Face&Sketch_2/SketchLine_7]"), "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")]) -Fill_4.result().setColor(102, 51, 51) -Fill_4.result().subResult(0).setColor(153, 153, 76) -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")]) +Split_2 = model.addSplit(Part_1_doc, [model.selection("SOLID", "Split_1_1_1")], [model.selection("FACE", "Plane_5")]) +Split_3 = model.addSplit(Part_1_doc, [model.selection("SOLID", "Split_2_1_2")], [model.selection("FACE", "Plane_3")]) +Split_4 = model.addSplit(Part_1_doc, [model.selection("SOLID", "Split_3_1_2")], [model.selection("FACE", "Plane_4")]) +Split_4.result().setColor(102, 51, 51) +Split_4.result().subResult(0).setColor(153, 153, 76) +Split_4.result().subResult(1).setColor(0, 204, 204) +Split_4.result().subResult(2).setColor(51, 51, 102) +Split_4.result().subResult(3).setColor(102, 204, 102) +Split_4.result().subResult(4).setColor(204, 204, 0) +Union_1 = model.addUnion(Part_1_doc, [model.selection("SOLID", "Split_4_1_4"), model.selection("SOLID", "Split_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) @@ -167,25 +167,25 @@ Plane_13 = model.addPlane(Part_1_doc, model.selection("FACE", "Recover_1_1/Modif Plane_14 = model.addPlane(Part_1_doc, model.selection("FACE", "Recover_1_1/Modified_Face&Sketch_3/SketchLine_13"), model.selection("EDGE", "[Recover_1_1/Modified_Face&Sketch_3/SketchLine_13][Recover_1_1/Modified_Face&Extrusion_3_1/To_Face]"), "90+45") Plane_15 = model.addPlane(Part_1_doc, model.selection("FACE", "Recover_1_1/Modified_Face&Sketch_3/SketchLine_12"), model.selection("EDGE", "[Recover_1_1/Modified_Face&Sketch_3/SketchLine_12][Recover_1_1/Modified_Face&Extrusion_3_1/To_Face]"), "90+45") Plane_16 = model.addPlane(Part_1_doc, model.selection("FACE", "Recover_1_1/Modified_Face&Extrusion_3_1/To_Face"), model.selection("EDGE", "[Recover_1_1/Modified_Face&Sketch_3/SketchLine_11][Recover_1_1/Modified_Face&Extrusion_3_1/To_Face]"), 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")] +Split_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")] +Split_5 = model.addSplit(Part_1_doc, [model.selection("SOLID", "demi-sphere")], Split_5_objects_2) +Split_5.result().subResult(0).setName("Split_5_1_1") +Split_5.result().subResult(1).setName("Split_5_1_2") +Split_5.result().subResult(2).setName("Split_5_1_3") +Split_5.result().subResult(3).setName("Split_5_1_4") +Split_5.result().subResult(4).setName("Split_5_1_5") +Split_5.result().subResult(5).setName("Split_5_1_6") +Split_5.result().subResult(6).setName("Split_5_1_7") +Split_5.result().subResult(7).setName("Split_5_1_8") +Split_5.result().subResult(8).setName("Split_5_1_9") +Split_5.result().subResult(9).setName("Split_5_1_10") +Split_5.result().subResult(10).setName("Split_5_1_11") +Split_5.result().subResult(11).setName("Split_5_1_12") +Split_5.result().subResult(12).setName("Split_5_1_13") +Split_5.result().subResult(13).setName("Split_5_1_14") +Split_5.result().subResult(14).setName("Split_5_1_15") +Split_5.result().subResult(15).setName("Split_5_1_16") +Union_2_objects = [model.selection("SOLID", "Split_5_1_14"), model.selection("SOLID", "Split_5_1_15"), model.selection("SOLID", "Split_5_1_16")] Union_2 = model.addUnion(Part_1_doc, Union_2_objects) Union_2.result().subResult(0).setName("Union_2_1_1") Union_2.result().subResult(1).setName("Union_2_1_2") diff --git a/src/FeaturesPlugin/Test/Test2419_1.py b/src/FeaturesPlugin/Test/Test2419_1.py index f65834577..4e95e9f40 100644 --- a/src/FeaturesPlugin/Test/Test2419_1.py +++ b/src/FeaturesPlugin/Test/Test2419_1.py @@ -110,17 +110,17 @@ 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/SketchLine_9"), 10, 2) LinearCopy_1.result().setName("LinearCopy") -Fill_1 = model.addFill(Part_1_doc, [model.selection("FACE", "Face_1_1")], [model.selection("COMPOUND", "LinearCopy")]) +Split_1 = model.addSplit(Part_1_doc, [model.selection("FACE", "Face_1_1")], [model.selection("COMPOUND", "LinearCopy")]) model.do() model.end() from GeomAPI import GeomAPI_Shape -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]) +model.testNbResults(Split_1, 1) +model.testNbSubResults(Split_1, [3]) +model.testNbSubShapes(Split_1, GeomAPI_Shape.SOLID, [0]) +model.testNbSubShapes(Split_1, GeomAPI_Shape.FACE, [3]) +model.testNbSubShapes(Split_1, GeomAPI_Shape.EDGE, [20]) +model.testNbSubShapes(Split_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 4aa76fd6e..e474db6fa 100644 --- a/src/FeaturesPlugin/Test/Test2419_2.py +++ b/src/FeaturesPlugin/Test/Test2419_2.py @@ -148,18 +148,18 @@ 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_1 = model.addPartition(Part_1_doc, [model.selection("FACE", "Face_1_1"), model.selection("FACE", "Face_2_1")]) -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) +Split_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")] +Split_1 = model.addSplit(Part_1_doc, [model.selection("COMPOUND", "Partition_1_1")], Split_1_objects_2) model.do() model.end() from GeomAPI import GeomAPI_Shape -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]) +model.testNbResults(Split_1, 1) +model.testNbSubResults(Split_1, [60]) +model.testNbSubShapes(Split_1, GeomAPI_Shape.SOLID, [0]) +model.testNbSubShapes(Split_1, GeomAPI_Shape.FACE, [60]) +model.testNbSubShapes(Split_1, GeomAPI_Shape.EDGE, [273]) +model.testNbSubShapes(Split_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 9ddfe5e97..c26b78c5e 100644 --- a/src/FeaturesPlugin/Test/Test2419_3.py +++ b/src/FeaturesPlugin/Test/Test2419_3.py @@ -148,18 +148,18 @@ 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) Shell_1 = model.addShell(Part_1_doc, [model.selection("FACE", "Face_1_1"), model.selection("FACE", "Face_2_1")]) -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) +Split_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")] +Split_1 = model.addSplit(Part_1_doc, [model.selection("SHELL", "Shell_1_1")], Split_1_objects_2) model.do() model.end() from GeomAPI import GeomAPI_Shape -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]) +model.testNbResults(Split_1, 1) +model.testNbSubResults(Split_1, [0]) +model.testNbSubShapes(Split_1, GeomAPI_Shape.SOLID, [0]) +model.testNbSubShapes(Split_1, GeomAPI_Shape.FACE, [60]) +model.testNbSubShapes(Split_1, GeomAPI_Shape.EDGE, [273]) +model.testNbSubShapes(Split_1, GeomAPI_Shape.VERTEX, [546]) assert(model.checkPythonDump()) diff --git a/src/FeaturesPlugin/Test/Test2636.py b/src/FeaturesPlugin/Test/Test2636.py index 8ad1eea3a..2c762767a 100644 --- a/src/FeaturesPlugin/Test/Test2636.py +++ b/src/FeaturesPlugin/Test/Test2636.py @@ -367,44 +367,44 @@ Edge_1_objects = [model.selection("EDGE", "Sketch_2/SketchLine_27"), model.selec Edge_1 = model.addEdge(Part_2_doc, Edge_1_objects) Extrusion_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"), model.selection("EDGE", "Edge_1_8"), model.selection("EDGE", "Edge_1_9"), model.selection("EDGE", "Edge_1_10"), model.selection("EDGE", "Edge_1_11"), model.selection("EDGE", "Edge_1_12"), model.selection("EDGE", "Edge_1_13"), model.selection("EDGE", "Edge_1_14")] Extrusion_1 = model.addExtrusion(Part_2_doc, Extrusion_1_objects, model.selection("EDGE", "PartSet/OX"), 300, 0) -Fill_1_objects_2 = [model.selection("FACE", "Extrusion_1_1"), model.selection("FACE", "Extrusion_1_2"), model.selection("FACE", "Extrusion_1_3"), model.selection("FACE", "Extrusion_1_4"), model.selection("FACE", "Extrusion_1_5"), model.selection("FACE", "Extrusion_1_6"), model.selection("FACE", "Extrusion_1_7"), model.selection("FACE", "Extrusion_1_8"), model.selection("FACE", "Extrusion_1_9"), model.selection("FACE", "Extrusion_1_10"), model.selection("FACE", "Extrusion_1_11"), model.selection("FACE", "Extrusion_1_12"), model.selection("FACE", "Extrusion_1_13"), model.selection("FACE", "Extrusion_1_14")] -Fill_1 = model.addFill(Part_2_doc, [model.selection("COMPSOLID", "Revolution_1_1")], Fill_1_objects_2) -Group_1_objects = [model.selection("SOLID", "Fill_1_1_25"), model.selection("SOLID", "Fill_1_1_28"), model.selection("SOLID", "Fill_1_1_26"), model.selection("SOLID", "Fill_1_1_27"), model.selection("SOLID", "Fill_1_1_31"), model.selection("SOLID", "Fill_1_1_35"), model.selection("SOLID", "Fill_1_1_36"), model.selection("SOLID", "Fill_1_1_32"), model.selection("SOLID", "Fill_1_1_34"), model.selection("SOLID", "Fill_1_1_30"), model.selection("SOLID", "Fill_1_1_33"), model.selection("SOLID", "Fill_1_1_29")] +Split_1_objects_2 = [model.selection("FACE", "Extrusion_1_1"), model.selection("FACE", "Extrusion_1_2"), model.selection("FACE", "Extrusion_1_3"), model.selection("FACE", "Extrusion_1_4"), model.selection("FACE", "Extrusion_1_5"), model.selection("FACE", "Extrusion_1_6"), model.selection("FACE", "Extrusion_1_7"), model.selection("FACE", "Extrusion_1_8"), model.selection("FACE", "Extrusion_1_9"), model.selection("FACE", "Extrusion_1_10"), model.selection("FACE", "Extrusion_1_11"), model.selection("FACE", "Extrusion_1_12"), model.selection("FACE", "Extrusion_1_13"), model.selection("FACE", "Extrusion_1_14")] +Split_1 = model.addSplit(Part_2_doc, [model.selection("COMPSOLID", "Revolution_1_1")], Split_1_objects_2) +Group_1_objects = [model.selection("SOLID", "Split_1_1_25"), model.selection("SOLID", "Split_1_1_28"), model.selection("SOLID", "Split_1_1_26"), model.selection("SOLID", "Split_1_1_27"), model.selection("SOLID", "Split_1_1_31"), model.selection("SOLID", "Split_1_1_35"), model.selection("SOLID", "Split_1_1_36"), model.selection("SOLID", "Split_1_1_32"), model.selection("SOLID", "Split_1_1_34"), model.selection("SOLID", "Split_1_1_30"), model.selection("SOLID", "Split_1_1_33"), model.selection("SOLID", "Split_1_1_29")] Group_1 = model.addGroup(Part_2_doc, Group_1_objects) Group_1.setName("CORPS") Group_1.result().setName("CORPS") -Group_2_objects = [model.selection("SOLID", "Fill_1_1_41"), model.selection("SOLID", "Fill_1_1_49"), model.selection("SOLID", "Fill_1_1_69"), model.selection("SOLID", "Fill_1_1_71"), model.selection("SOLID", "Fill_1_1_51"), model.selection("SOLID", "Fill_1_1_43"), model.selection("SOLID", "Fill_1_1_44"), model.selection("SOLID", "Fill_1_1_67"), model.selection("SOLID", "Fill_1_1_39"), model.selection("SOLID", "Fill_1_1_47"), model.selection("SOLID", "Fill_1_1_45"), model.selection("SOLID", "Fill_1_1_37"), model.selection("SOLID", "Fill_1_1_65"), model.selection("SOLID", "Fill_1_1_66"), model.selection("SOLID", "Fill_1_1_38"), model.selection("SOLID", "Fill_1_1_46"), model.selection("SOLID", "Fill_1_1_48"), model.selection("SOLID", "Fill_1_1_40"), model.selection("SOLID", "Fill_1_1_68"), model.selection("SOLID", "Fill_1_1_42"), model.selection("SOLID", "Fill_1_1_70"), model.selection("SOLID", "Fill_1_1_50"), model.selection("SOLID", "Fill_1_1_52"), model.selection("SOLID", "Fill_1_1_72"), model.selection("SOLID", "Fill_1_1_63"), model.selection("SOLID", "Fill_1_1_64"), model.selection("SOLID", "Fill_1_1_61"), model.selection("SOLID", "Fill_1_1_62"), model.selection("SOLID", "Fill_1_1_58"), model.selection("SOLID", "Fill_1_1_57"), model.selection("SOLID", "Fill_1_1_54"), model.selection("SOLID", "Fill_1_1_53"), model.selection("SOLID", "Fill_1_1_55"), model.selection("SOLID", "Fill_1_1_56"), model.selection("SOLID", "Fill_1_1_60"), model.selection("SOLID", "Fill_1_1_59")] +Group_2_objects = [model.selection("SOLID", "Split_1_1_41"), model.selection("SOLID", "Split_1_1_49"), model.selection("SOLID", "Split_1_1_69"), model.selection("SOLID", "Split_1_1_71"), model.selection("SOLID", "Split_1_1_51"), model.selection("SOLID", "Split_1_1_43"), model.selection("SOLID", "Split_1_1_44"), model.selection("SOLID", "Split_1_1_67"), model.selection("SOLID", "Split_1_1_39"), model.selection("SOLID", "Split_1_1_47"), model.selection("SOLID", "Split_1_1_45"), model.selection("SOLID", "Split_1_1_37"), model.selection("SOLID", "Split_1_1_65"), model.selection("SOLID", "Split_1_1_66"), model.selection("SOLID", "Split_1_1_38"), model.selection("SOLID", "Split_1_1_46"), model.selection("SOLID", "Split_1_1_48"), model.selection("SOLID", "Split_1_1_40"), model.selection("SOLID", "Split_1_1_68"), model.selection("SOLID", "Split_1_1_42"), model.selection("SOLID", "Split_1_1_70"), model.selection("SOLID", "Split_1_1_50"), model.selection("SOLID", "Split_1_1_52"), model.selection("SOLID", "Split_1_1_72"), model.selection("SOLID", "Split_1_1_63"), model.selection("SOLID", "Split_1_1_64"), model.selection("SOLID", "Split_1_1_61"), model.selection("SOLID", "Split_1_1_62"), model.selection("SOLID", "Split_1_1_58"), model.selection("SOLID", "Split_1_1_57"), model.selection("SOLID", "Split_1_1_54"), model.selection("SOLID", "Split_1_1_53"), model.selection("SOLID", "Split_1_1_55"), model.selection("SOLID", "Split_1_1_56"), model.selection("SOLID", "Split_1_1_60"), model.selection("SOLID", "Split_1_1_59")] Group_2 = model.addGroup(Part_2_doc, Group_2_objects) Group_2.setName("TETE") Group_2.result().setName("TETE") -Group_3_objects = [model.selection("SOLID", "Fill_1_1_2"), model.selection("SOLID", "Fill_1_1_1"), model.selection("SOLID", "Fill_1_1_5"), model.selection("SOLID", "Fill_1_1_9"), model.selection("SOLID", "Fill_1_1_13"), model.selection("SOLID", "Fill_1_1_14"), model.selection("SOLID", "Fill_1_1_15"), model.selection("SOLID", "Fill_1_1_19"), model.selection("SOLID", "Fill_1_1_11"), model.selection("SOLID", "Fill_1_1_12"), model.selection("SOLID", "Fill_1_1_24"), model.selection("SOLID", "Fill_1_1_23"), model.selection("SOLID", "Fill_1_1_16"), model.selection("SOLID", "Fill_1_1_8"), model.selection("SOLID", "Fill_1_1_20"), model.selection("SOLID", "Fill_1_1_4"), model.selection("SOLID", "Fill_1_1_3"), model.selection("SOLID", "Fill_1_1_7"), model.selection("SOLID", "Fill_1_1_10"), model.selection("SOLID", "Fill_1_1_6")] +Group_3_objects = [model.selection("SOLID", "Split_1_1_2"), model.selection("SOLID", "Split_1_1_1"), model.selection("SOLID", "Split_1_1_5"), model.selection("SOLID", "Split_1_1_9"), model.selection("SOLID", "Split_1_1_13"), model.selection("SOLID", "Split_1_1_14"), model.selection("SOLID", "Split_1_1_15"), model.selection("SOLID", "Split_1_1_19"), model.selection("SOLID", "Split_1_1_11"), model.selection("SOLID", "Split_1_1_12"), model.selection("SOLID", "Split_1_1_24"), model.selection("SOLID", "Split_1_1_23"), model.selection("SOLID", "Split_1_1_16"), model.selection("SOLID", "Split_1_1_8"), model.selection("SOLID", "Split_1_1_20"), model.selection("SOLID", "Split_1_1_4"), model.selection("SOLID", "Split_1_1_3"), model.selection("SOLID", "Split_1_1_7"), model.selection("SOLID", "Split_1_1_10"), model.selection("SOLID", "Split_1_1_6")] Group_3 = model.addGroup(Part_2_doc, Group_3_objects) Group_3.setName("PIED") Group_3.result().setName("PIED") -Group_4 = model.addGroup(Part_2_doc, [model.selection("EDGE", "Fill_1_1_36/Generated_Edge&Sketch_2/SketchLine_31&Sketch_1/SketchLine_7")]) +Group_4 = model.addGroup(Part_2_doc, [model.selection("EDGE", "Split_1_1_36/Generated_Edge&Sketch_2/SketchLine_31&Sketch_1/SketchLine_7")]) Group_4.setName("corps_hauteur") Group_4.result().setName("corps_hauteur") -Group_5 = model.addGroup(Part_2_doc, [model.selection("EDGE", "Fill_1_1_11/Generated_Edge&Sketch_2/SketchLine_31&Sketch_1/SketchLine_5")]) +Group_5 = model.addGroup(Part_2_doc, [model.selection("EDGE", "Split_1_1_11/Generated_Edge&Sketch_2/SketchLine_31&Sketch_1/SketchLine_5")]) Group_5.setName("pied_hauteur") Group_5.result().setName("pied_hauteur") -Group_6 = model.addGroup(Part_2_doc, [model.selection("EDGE", "Fill_1_1_24/Generated_Edge&Sketch_2/SketchLine_31&Sketch_1/SketchLine_6")]) +Group_6 = model.addGroup(Part_2_doc, [model.selection("EDGE", "Split_1_1_24/Generated_Edge&Sketch_2/SketchLine_31&Sketch_1/SketchLine_6")]) Group_6.setName("chanfrein") Group_6.result().setName("chanfrein") -Group_7 = model.addGroup(Part_2_doc, [model.selection("EDGE", "Fill_1_1_72/Generated_Edge&Sketch_2/SketchLine_31&Sketch_1/SketchArc_1_2")]) +Group_7 = model.addGroup(Part_2_doc, [model.selection("EDGE", "Split_1_1_72/Generated_Edge&Sketch_2/SketchLine_31&Sketch_1/SketchArc_1_2")]) Group_7.setName("filet") Group_7.result().setName("filet") -Group_8 = model.addGroup(Part_2_doc, [model.selection("EDGE", "Fill_1_1_42/Generated_Edge&Sketch_2/SketchLine_31&Sketch_1/SketchLine_9")]) +Group_8 = model.addGroup(Part_2_doc, [model.selection("EDGE", "Split_1_1_42/Generated_Edge&Sketch_2/SketchLine_31&Sketch_1/SketchLine_9")]) Group_8.setName("tete_bas") Group_8.result().setName("tete_bas") -Group_9_objects = [model.selection("FACE", "Fill_1_1_12/Modified_Face&Sketch_1/SketchLine_5"), model.selection("FACE", "Fill_1_1_11/Modified_Face&Sketch_1/SketchLine_5"), model.selection("FACE", "Fill_1_1_9/Modified_Face&Sketch_1/SketchLine_5"), model.selection("FACE", "Fill_1_1_8/Modified_Face&Sketch_1/SketchLine_5"), model.selection("FACE", "Fill_1_1_4/Modified_Face&Sketch_1/SketchLine_5"), model.selection("FACE", "Fill_1_1_1/Modified_Face&Sketch_1/SketchLine_5"), model.selection("FACE", "Fill_1_1_2/Modified_Face&Sketch_1/SketchLine_5"), model.selection("FACE", "Fill_1_1_5/Modified_Face&Sketch_1/SketchLine_5")] +Group_9_objects = [model.selection("FACE", "Split_1_1_12/Modified_Face&Sketch_1/SketchLine_5"), model.selection("FACE", "Split_1_1_11/Modified_Face&Sketch_1/SketchLine_5"), model.selection("FACE", "Split_1_1_9/Modified_Face&Sketch_1/SketchLine_5"), model.selection("FACE", "Split_1_1_8/Modified_Face&Sketch_1/SketchLine_5"), model.selection("FACE", "Split_1_1_4/Modified_Face&Sketch_1/SketchLine_5"), model.selection("FACE", "Split_1_1_1/Modified_Face&Sketch_1/SketchLine_5"), model.selection("FACE", "Split_1_1_2/Modified_Face&Sketch_1/SketchLine_5"), model.selection("FACE", "Split_1_1_5/Modified_Face&Sketch_1/SketchLine_5")] Group_9 = model.addGroup(Part_2_doc, Group_9_objects) Group_9.setName("ADH_PIEDS") Group_9.result().setName("ADH_PIEDS") -Group_10_objects = [model.selection("FACE", "Fill_1_1_13/Modified_Face&Sketch_1/SketchLine_6"), model.selection("FACE", "Fill_1_1_14/Modified_Face&Sketch_1/SketchLine_6"), model.selection("FACE", "Fill_1_1_25/Modified_Face&Sketch_1/SketchLine_7"), model.selection("FACE", "Fill_1_1_26/Modified_Face&Sketch_1/SketchLine_7"), model.selection("FACE", "Fill_1_1_15/Modified_Face&Sketch_1/SketchLine_6"), model.selection("FACE", "Fill_1_1_27/Modified_Face&Sketch_1/SketchLine_7"), model.selection("FACE", "Fill_1_1_19/Modified_Face&Sketch_1/SketchLine_6"), model.selection("FACE", "Fill_1_1_31/Modified_Face&Sketch_1/SketchLine_7"), model.selection("FACE", "Fill_1_1_23/Modified_Face&Sketch_1/SketchLine_6"), model.selection("FACE", "Fill_1_1_35/Modified_Face&Sketch_1/SketchLine_7"), model.selection("FACE", "Fill_1_1_24/Modified_Face&Sketch_1/SketchLine_6"), model.selection("FACE", "Fill_1_1_36/Modified_Face&Sketch_1/SketchLine_7"), model.selection("FACE", "Fill_1_1_32/Modified_Face&Sketch_1/SketchLine_7"), model.selection("FACE", "Fill_1_1_20/Modified_Face&Sketch_1/SketchLine_6"), model.selection("FACE", "Fill_1_1_16/Modified_Face&Sketch_1/SketchLine_6"), model.selection("FACE", "Fill_1_1_28/Modified_Face&Sketch_1/SketchLine_7"), model.selection("FACE", "Fill_1_1_70/Modified_Face&Sketch_1/SketchArc_1_2"), model.selection("FACE", "Fill_1_1_42/Modified_Face&Sketch_1/SketchLine_8"), model.selection("FACE", "Fill_1_1_68/Modified_Face&Sketch_1/SketchArc_1_2"), model.selection("FACE", "Fill_1_1_40/Modified_Face&Sketch_1/SketchLine_8"), model.selection("FACE", "Fill_1_1_66/Modified_Face&Sketch_1/SketchArc_1_2"), model.selection("FACE", "Fill_1_1_38/Modified_Face&Sketch_1/SketchLine_8"), model.selection("FACE", "Fill_1_1_37/Modified_Face&Sketch_1/SketchLine_8"), model.selection("FACE", "Fill_1_1_65/Modified_Face&Sketch_1/SketchArc_1_2"), model.selection("FACE", "Fill_1_1_39/Modified_Face&Sketch_1/SketchLine_8"), model.selection("FACE", "Fill_1_1_67/Modified_Face&Sketch_1/SketchArc_1_2"), model.selection("FACE", "Fill_1_1_69/Modified_Face&Sketch_1/SketchArc_1_2"), model.selection("FACE", "Fill_1_1_41/Modified_Face&Sketch_1/SketchLine_8"), model.selection("FACE", "Fill_1_1_43/Modified_Face&Sketch_1/SketchLine_8"), model.selection("FACE", "Fill_1_1_71/Modified_Face&Sketch_1/SketchArc_1_2"), model.selection("FACE", "Fill_1_1_44/Modified_Face&Sketch_1/SketchLine_8"), model.selection("FACE", "Fill_1_1_72/Modified_Face&Sketch_1/SketchArc_1_2"), model.selection("FACE", "Fill_1_1_52/Modified_Face&Sketch_1/SketchLine_9"), model.selection("FACE", "Fill_1_1_44/Modified_Face&Sketch_1/SketchLine_9"), model.selection("FACE", "Fill_1_1_43/Modified_Face&Sketch_1/SketchLine_9"), model.selection("FACE", "Fill_1_1_51/Modified_Face&Sketch_1/SketchLine_9"), model.selection("FACE", "Fill_1_1_50/Modified_Face&Sketch_1/SketchLine_9"), model.selection("FACE", "Fill_1_1_42/Modified_Face&Sketch_1/SketchLine_9"), model.selection("FACE", "Fill_1_1_40/Modified_Face&Sketch_1/SketchLine_9"), model.selection("FACE", "Fill_1_1_48/Modified_Face&Sketch_1/SketchLine_9"), model.selection("FACE", "Fill_1_1_46/Modified_Face&Sketch_1/SketchLine_9"), model.selection("FACE", "Fill_1_1_38/Modified_Face&Sketch_1/SketchLine_9"), model.selection("FACE", "Fill_1_1_37/Modified_Face&Sketch_1/SketchLine_9"), model.selection("FACE", "Fill_1_1_45/Modified_Face&Sketch_1/SketchLine_9"), model.selection("FACE", "Fill_1_1_39/Modified_Face&Sketch_1/SketchLine_9"), model.selection("FACE", "Fill_1_1_47/Modified_Face&Sketch_1/SketchLine_9"), model.selection("FACE", "Fill_1_1_49/Modified_Face&Sketch_1/SketchLine_9"), model.selection("FACE", "Fill_1_1_41/Modified_Face&Sketch_1/SketchLine_9")] +Group_10_objects = [model.selection("FACE", "Split_1_1_13/Modified_Face&Sketch_1/SketchLine_6"), model.selection("FACE", "Split_1_1_14/Modified_Face&Sketch_1/SketchLine_6"), model.selection("FACE", "Split_1_1_25/Modified_Face&Sketch_1/SketchLine_7"), model.selection("FACE", "Split_1_1_26/Modified_Face&Sketch_1/SketchLine_7"), model.selection("FACE", "Split_1_1_15/Modified_Face&Sketch_1/SketchLine_6"), model.selection("FACE", "Split_1_1_27/Modified_Face&Sketch_1/SketchLine_7"), model.selection("FACE", "Split_1_1_19/Modified_Face&Sketch_1/SketchLine_6"), model.selection("FACE", "Split_1_1_31/Modified_Face&Sketch_1/SketchLine_7"), model.selection("FACE", "Split_1_1_23/Modified_Face&Sketch_1/SketchLine_6"), model.selection("FACE", "Split_1_1_35/Modified_Face&Sketch_1/SketchLine_7"), model.selection("FACE", "Split_1_1_24/Modified_Face&Sketch_1/SketchLine_6"), model.selection("FACE", "Split_1_1_36/Modified_Face&Sketch_1/SketchLine_7"), model.selection("FACE", "Split_1_1_32/Modified_Face&Sketch_1/SketchLine_7"), model.selection("FACE", "Split_1_1_20/Modified_Face&Sketch_1/SketchLine_6"), model.selection("FACE", "Split_1_1_16/Modified_Face&Sketch_1/SketchLine_6"), model.selection("FACE", "Split_1_1_28/Modified_Face&Sketch_1/SketchLine_7"), model.selection("FACE", "Split_1_1_70/Modified_Face&Sketch_1/SketchArc_1_2"), model.selection("FACE", "Split_1_1_42/Modified_Face&Sketch_1/SketchLine_8"), model.selection("FACE", "Split_1_1_68/Modified_Face&Sketch_1/SketchArc_1_2"), model.selection("FACE", "Split_1_1_40/Modified_Face&Sketch_1/SketchLine_8"), model.selection("FACE", "Split_1_1_66/Modified_Face&Sketch_1/SketchArc_1_2"), model.selection("FACE", "Split_1_1_38/Modified_Face&Sketch_1/SketchLine_8"), model.selection("FACE", "Split_1_1_37/Modified_Face&Sketch_1/SketchLine_8"), model.selection("FACE", "Split_1_1_65/Modified_Face&Sketch_1/SketchArc_1_2"), model.selection("FACE", "Split_1_1_39/Modified_Face&Sketch_1/SketchLine_8"), model.selection("FACE", "Split_1_1_67/Modified_Face&Sketch_1/SketchArc_1_2"), model.selection("FACE", "Split_1_1_69/Modified_Face&Sketch_1/SketchArc_1_2"), model.selection("FACE", "Split_1_1_41/Modified_Face&Sketch_1/SketchLine_8"), model.selection("FACE", "Split_1_1_43/Modified_Face&Sketch_1/SketchLine_8"), model.selection("FACE", "Split_1_1_71/Modified_Face&Sketch_1/SketchArc_1_2"), model.selection("FACE", "Split_1_1_44/Modified_Face&Sketch_1/SketchLine_8"), model.selection("FACE", "Split_1_1_72/Modified_Face&Sketch_1/SketchArc_1_2"), model.selection("FACE", "Split_1_1_52/Modified_Face&Sketch_1/SketchLine_9"), model.selection("FACE", "Split_1_1_44/Modified_Face&Sketch_1/SketchLine_9"), model.selection("FACE", "Split_1_1_43/Modified_Face&Sketch_1/SketchLine_9"), model.selection("FACE", "Split_1_1_51/Modified_Face&Sketch_1/SketchLine_9"), model.selection("FACE", "Split_1_1_50/Modified_Face&Sketch_1/SketchLine_9"), model.selection("FACE", "Split_1_1_42/Modified_Face&Sketch_1/SketchLine_9"), model.selection("FACE", "Split_1_1_40/Modified_Face&Sketch_1/SketchLine_9"), model.selection("FACE", "Split_1_1_48/Modified_Face&Sketch_1/SketchLine_9"), model.selection("FACE", "Split_1_1_46/Modified_Face&Sketch_1/SketchLine_9"), model.selection("FACE", "Split_1_1_38/Modified_Face&Sketch_1/SketchLine_9"), model.selection("FACE", "Split_1_1_37/Modified_Face&Sketch_1/SketchLine_9"), model.selection("FACE", "Split_1_1_45/Modified_Face&Sketch_1/SketchLine_9"), model.selection("FACE", "Split_1_1_39/Modified_Face&Sketch_1/SketchLine_9"), model.selection("FACE", "Split_1_1_47/Modified_Face&Sketch_1/SketchLine_9"), model.selection("FACE", "Split_1_1_49/Modified_Face&Sketch_1/SketchLine_9"), model.selection("FACE", "Split_1_1_41/Modified_Face&Sketch_1/SketchLine_9")] Group_10 = model.addGroup(Part_2_doc, Group_10_objects) Group_10.setName("CONTACT_VIS") Group_10.result().setName("CONTACT_VIS") -Translation_1 = model.addTranslation(Part_2_doc, [model.selection("COMPSOLID", "Fill_1_1")], 0, 100, 0) +Translation_1 = model.addTranslation(Part_2_doc, [model.selection("COMPSOLID", "Split_1_1")], 0, 100, 0) AngularCopy_1 = model.addMultiRotation(Part_2_doc, [model.selection("COMPSOLID", "Translation_1_1")], model.selection("EDGE", "PartSet/OX"), 4) model.do() diff --git a/src/FeaturesPlugin/Test/Test2751.py b/src/FeaturesPlugin/Test/Test2751.py index debebb1b0..647854b43 100644 --- a/src/FeaturesPlugin/Test/Test2751.py +++ b/src/FeaturesPlugin/Test/Test2751.py @@ -86,7 +86,7 @@ SketchConstraintDistance_1 = Sketch_2.setDistance(SketchPoint_3.coordinates(), S model.do() Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("COMPOUND", "all-in-Sketch_2")], model.selection(), 10, 0) AngularCopy_1 = model.addMultiRotation(Part_1_doc, [model.selection("COMPOUND", "all-in-Extrusion_1")], model.selection("EDGE", "PartSet/OZ"), "(90-2*a)/(n-1)", "n") -Fill_1 = model.addFill(Part_1_doc, [model.selection("FACE", (30, 30, 0))], [model.selection("COMPOUND", (29.25281542867235, 29.25281542867235, 5))]) +Split_1 = model.addSplit(Part_1_doc, [model.selection("FACE", (30, 30, 0))], [model.selection("COMPOUND", (29.25281542867235, 29.25281542867235, 5))]) model.end() assert(model.checkPythonDump()) diff --git a/src/FeaturesPlugin/Test/TestBooleanFill.py b/src/FeaturesPlugin/Test/TestBooleanFill.py deleted file mode 100644 index c0ae6b123..000000000 --- a/src/FeaturesPlugin/Test/TestBooleanFill.py +++ /dev/null @@ -1,41 +0,0 @@ -# Copyright (C) 2014-2019 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, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this library; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# -# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -# - -# -*- coding: utf-8 -*- - -from salome.shaper import model - -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 deleted file mode 100644 index 9a38e4dae..000000000 --- a/src/FeaturesPlugin/Test/TestBooleanFillWithPlane.py +++ /dev/null @@ -1,72 +0,0 @@ -# Copyright (C) 2014-2019 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, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this library; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# -# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -# - -# -*- coding: utf-8 -*- - -from GeomAPI import GeomAPI_Pnt - -from salome.shaper import model - -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")) -SketchLine_1 = Sketch_1.addLine(50.45430931454487, 141.3050678403047, -211.8625790259634, 141.3050678403047) -SketchLine_2 = Sketch_1.addLine(-211.8625790259634, 141.3050678403047, -211.8625790259634, -163.3288837233227) -SketchLine_3 = Sketch_1.addLine(-211.8625790259634, -163.3288837233227, 50.45430931454487, -163.3288837233227) -SketchLine_4 = Sketch_1.addLine(50.45430931454487, -163.3288837233227, 50.45430931454487, 141.3050678403047) -SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_4.endPoint(), SketchLine_1.startPoint()) -SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchLine_2.startPoint()) -SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchLine_2.endPoint(), SketchLine_3.startPoint()) -SketchConstraintCoincidence_4 = Sketch_1.setCoincident(SketchLine_3.endPoint(), SketchLine_4.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()) -SketchConstraintVertical_2 = Sketch_1.setVertical(SketchLine_4.result()) -SketchLine_5 = Sketch_1.addLine(246.5736143115653, 48.78197815871301, -51.09047583637312, 48.78197815871301) -SketchLine_6 = Sketch_1.addLine(-51.09047583637312, 48.78197815871301, -51.09047583637312, -104.8260668928192) -SketchLine_7 = Sketch_1.addLine(-51.09047583637312, -104.8260668928192, 246.5736143115653, -104.8260668928192) -SketchLine_8 = Sketch_1.addLine(246.5736143115653, -104.8260668928192, 246.5736143115653, 48.78197815871301) -SketchConstraintCoincidence_5 = Sketch_1.setCoincident(SketchLine_8.endPoint(), SketchLine_5.startPoint()) -SketchConstraintCoincidence_6 = Sketch_1.setCoincident(SketchLine_5.endPoint(), SketchLine_6.startPoint()) -SketchConstraintCoincidence_7 = Sketch_1.setCoincident(SketchLine_6.endPoint(), SketchLine_7.startPoint()) -SketchConstraintCoincidence_8 = Sketch_1.setCoincident(SketchLine_7.endPoint(), SketchLine_8.startPoint()) -SketchConstraintHorizontal_3 = Sketch_1.setHorizontal(SketchLine_5.result()) -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", 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(Fill_1, model, Part_1_doc) -model.end() - -from GeomAPI import GeomAPI_Shape - -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/TestBooleanFill_ErrorMsg.py b/src/FeaturesPlugin/Test/TestBooleanFill_ErrorMsg.py deleted file mode 100644 index 2c933bf98..000000000 --- a/src/FeaturesPlugin/Test/TestBooleanFill_ErrorMsg.py +++ /dev/null @@ -1,35 +0,0 @@ -# Copyright (C) 2018-2019 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, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this library; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# -# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -# - -from ModelAPI import * -aSession = ModelAPI_Session.get() -aDocument = aSession.moduleDocument() - -# Create a part -aSession.startOperation() -aPartFeature = aDocument.addFeature("Part") -aSession.finishOperation() -aPartResult = modelAPI_ResultPart(aPartFeature.firstResult()) -aPart = aPartResult.partDoc() - -aSession.startOperation() -Fill_1 = aPart.addFeature("Fill") -Fill_1.execute() -assert(Fill_1.error() != "") -aSession.finishOperation() diff --git a/src/FeaturesPlugin/Test/TestBooleanSplit.py b/src/FeaturesPlugin/Test/TestBooleanSplit.py new file mode 100644 index 000000000..8a65fb465 --- /dev/null +++ b/src/FeaturesPlugin/Test/TestBooleanSplit.py @@ -0,0 +1,41 @@ +# Copyright (C) 2014-2019 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, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# + +# -*- coding: utf-8 -*- + +from salome.shaper import model + +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) +Split_1 = model.addSplit(Part_1_doc, [model.selection("SOLID", "Extrusion_1_1")], [model.selection("SOLID", "Extrusion_1_2")]) +model.do() +model.end() +assert (len(Split_1.results()) > 0) +assert(model.checkPythonDump()) diff --git a/src/FeaturesPlugin/Test/TestBooleanSplitWithPlane.py b/src/FeaturesPlugin/Test/TestBooleanSplitWithPlane.py new file mode 100644 index 000000000..4a1f91674 --- /dev/null +++ b/src/FeaturesPlugin/Test/TestBooleanSplitWithPlane.py @@ -0,0 +1,72 @@ +# Copyright (C) 2014-2019 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, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# + +# -*- coding: utf-8 -*- + +from GeomAPI import GeomAPI_Pnt + +from salome.shaper import model + +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")) +SketchLine_1 = Sketch_1.addLine(50.45430931454487, 141.3050678403047, -211.8625790259634, 141.3050678403047) +SketchLine_2 = Sketch_1.addLine(-211.8625790259634, 141.3050678403047, -211.8625790259634, -163.3288837233227) +SketchLine_3 = Sketch_1.addLine(-211.8625790259634, -163.3288837233227, 50.45430931454487, -163.3288837233227) +SketchLine_4 = Sketch_1.addLine(50.45430931454487, -163.3288837233227, 50.45430931454487, 141.3050678403047) +SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_4.endPoint(), SketchLine_1.startPoint()) +SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchLine_2.startPoint()) +SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchLine_2.endPoint(), SketchLine_3.startPoint()) +SketchConstraintCoincidence_4 = Sketch_1.setCoincident(SketchLine_3.endPoint(), SketchLine_4.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()) +SketchConstraintVertical_2 = Sketch_1.setVertical(SketchLine_4.result()) +SketchLine_5 = Sketch_1.addLine(246.5736143115653, 48.78197815871301, -51.09047583637312, 48.78197815871301) +SketchLine_6 = Sketch_1.addLine(-51.09047583637312, 48.78197815871301, -51.09047583637312, -104.8260668928192) +SketchLine_7 = Sketch_1.addLine(-51.09047583637312, -104.8260668928192, 246.5736143115653, -104.8260668928192) +SketchLine_8 = Sketch_1.addLine(246.5736143115653, -104.8260668928192, 246.5736143115653, 48.78197815871301) +SketchConstraintCoincidence_5 = Sketch_1.setCoincident(SketchLine_8.endPoint(), SketchLine_5.startPoint()) +SketchConstraintCoincidence_6 = Sketch_1.setCoincident(SketchLine_5.endPoint(), SketchLine_6.startPoint()) +SketchConstraintCoincidence_7 = Sketch_1.setCoincident(SketchLine_6.endPoint(), SketchLine_7.startPoint()) +SketchConstraintCoincidence_8 = Sketch_1.setCoincident(SketchLine_7.endPoint(), SketchLine_8.startPoint()) +SketchConstraintHorizontal_3 = Sketch_1.setHorizontal(SketchLine_5.result()) +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", GeomAPI_Pnt(17.35551764280096, -11.01190794150899, 0))], model.selection(), 100, 0) +Split_1 = model.addSplit(Part_1_doc, [model.selection("SOLID", GeomAPI_Pnt(-0.3180832609141306, -28.0220443670531, 50.00000000000001))], [model.selection("FACE", "PartSet/YOZ")]) +model.do() +model.testHaveNamingSubshapes(Split_1, model, Part_1_doc) +model.end() + +from GeomAPI import GeomAPI_Shape + +model.testNbResults(Split_1, 1) +model.testNbSubResults(Split_1, [4]) +model.testNbSubShapes(Split_1, GeomAPI_Shape.SOLID, [4]) +model.testNbSubShapes(Split_1, GeomAPI_Shape.FACE, [30]) +model.testNbSubShapes(Split_1, GeomAPI_Shape.EDGE, [132]) +model.testNbSubShapes(Split_1, GeomAPI_Shape.VERTEX, [264]) +model.testResultsVolumes(Split_1, [11003613.329450136050581932067871094]) + +assert(model.checkPythonDump()) diff --git a/src/FeaturesPlugin/Test/TestBooleanSplit_ErrorMsg.py b/src/FeaturesPlugin/Test/TestBooleanSplit_ErrorMsg.py new file mode 100644 index 000000000..31059ee17 --- /dev/null +++ b/src/FeaturesPlugin/Test/TestBooleanSplit_ErrorMsg.py @@ -0,0 +1,35 @@ +# Copyright (C) 2018-2019 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, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# + +from ModelAPI import * +aSession = ModelAPI_Session.get() +aDocument = aSession.moduleDocument() + +# Create a part +aSession.startOperation() +aPartFeature = aDocument.addFeature("Part") +aSession.finishOperation() +aPartResult = modelAPI_ResultPart(aPartFeature.firstResult()) +aPart = aPartResult.partDoc() + +aSession.startOperation() +Split_1 = aPart.addFeature("Split") +Split_1.execute() +assert(Split_1.error() != "") +aSession.finishOperation() diff --git a/src/FeaturesPlugin/Test/TestFillCompFaceSolid.py b/src/FeaturesPlugin/Test/TestFillCompFaceSolid.py deleted file mode 100644 index 54926d025..000000000 --- a/src/FeaturesPlugin/Test/TestFillCompFaceSolid.py +++ /dev/null @@ -1,63 +0,0 @@ -# Copyright (C) 2014-2019 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, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this library; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# -# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -# - -# -*- coding: utf-8 -*- - -from SketchAPI import * - -from salome.shaper import model - -model.begin() -partSet = model.moduleDocument() -Part_1 = model.addPart(partSet) -Part_1_doc = Part_1.document() -model.addParameter(Part_1_doc, "L", "10") -model.addParameter(Part_1_doc, "Shift", "5") -Box_1 = model.addBox(Part_1_doc, "L", "L", "L") -Plane_4 = model.addPlane(Part_1_doc, model.selection("FACE", "Box_1_1/Bottom"), "Shift", True) -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) -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) -SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchArc_1.startPoint(), SketchLine_2.startPoint()) -SketchLine_3 = Sketch_1.addLine(0, 5, 0, -12.5) -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()) -SketchConstraintRadius_1 = Sketch_1.setRadius(SketchArc_1.results()[1], "L+Shift/2") -SketchConstraintDistanceVertical_1 = Sketch_1.setVerticalDistance(SketchAPI_Line(SketchLine_1).startPoint(), SketchLine_2.startPoint(), 5) -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/Face-SketchArc_1_2f-SketchLine_2f-SketchLine_3f_wire")]) -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(Fill_2, model, 1, [6], [0], [6], [22], [44]) -model.testHaveNamingSubshapes(Fill_2, model, Part_1_doc) - -model.end() - -assert(model.checkPythonDump()) diff --git a/src/FeaturesPlugin/Test/TestFillCompsolidPlane.py b/src/FeaturesPlugin/Test/TestFillCompsolidPlane.py deleted file mode 100644 index a8abbd78e..000000000 --- a/src/FeaturesPlugin/Test/TestFillCompsolidPlane.py +++ /dev/null @@ -1,47 +0,0 @@ -# Copyright (C) 2018-2019 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, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this library; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# -# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -# - -from salome.shaper import model - -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")) -SketchProjection_1 = Sketch_1.addProjection(model.selection("EDGE", "PartSet/OX"), False) -SketchLine_1 = SketchProjection_1.createdFeature() -SketchCircle_1 = Sketch_1.addCircle(11.92861402549826, 0, 16.05621803603458) -SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_1.result(), SketchCircle_1.center()) -SketchCircle_2 = Sketch_1.addCircle(37.8779560884558, 0, 17.74637067763095) -SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchLine_1.result(), SketchCircle_2.center()) -model.do() -Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("COMPOUND", "Sketch_1")], model.selection(), 10, 0) -Fill_1 = model.addFill(Part_1_doc, [model.selection("SOLID", "Extrusion_1_1_1"), model.selection("SOLID", "Extrusion_1_1_2")], [model.selection("FACE", "PartSet/XOZ")]) -model.do() -model.end() - -from GeomAPI import GeomAPI_Shape - -model.testNbResults(Fill_1, 1) -model.testNbSubResults(Fill_1, [5]) -model.testNbSubShapes(Fill_1, GeomAPI_Shape.SOLID, [5]) -model.testNbSubShapes(Fill_1, GeomAPI_Shape.FACE, [25]) -model.testNbSubShapes(Fill_1, GeomAPI_Shape.EDGE, [90]) -model.testNbSubShapes(Fill_1, GeomAPI_Shape.VERTEX, [180]) -model.testResultsVolumes(Fill_1, [16831.622023411000554915517568588]) diff --git a/src/FeaturesPlugin/Test/TestFillEdgeEdge.py b/src/FeaturesPlugin/Test/TestFillEdgeEdge.py deleted file mode 100644 index 71d79a876..000000000 --- a/src/FeaturesPlugin/Test/TestFillEdgeEdge.py +++ /dev/null @@ -1,48 +0,0 @@ -# Copyright (C) 2014-2019 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, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this library; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# -# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -# - -# -*- coding: utf-8 -*- - -from salome.shaper import model - -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")) -SketchLine_1 = Sketch_1.addLine(-43.24383164005806, 13.92597968069667, 63.17997097242381, 62.8867924528302) -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/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/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(Fill_1,model,1,[3],[0],[0],[3],[6]) -model.testHaveNamingSubshapes(Fill_1,model,Part_1_doc) - -model.end() - -assert(model.checkPythonDump()) diff --git a/src/FeaturesPlugin/Test/TestFillEdgeEdgeIntersected.py b/src/FeaturesPlugin/Test/TestFillEdgeEdgeIntersected.py deleted file mode 100644 index 11dac36f0..000000000 --- a/src/FeaturesPlugin/Test/TestFillEdgeEdgeIntersected.py +++ /dev/null @@ -1,44 +0,0 @@ -# Copyright (C) 2014-2019 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, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this library; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# -# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -# - -# -*- coding: utf-8 -*- - -from salome.shaper import model - -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("XOZ")) -SketchLine_1 = Sketch_1.addLine(-54.08747895500726, -7.310347750362856, 54.27191756168357, 63.68373962264153) -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/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(Fill_1,model,1,[2],[0],[0],[2],[4]) -model.testHaveNamingSubshapes(Fill_1,model,Part_1_doc) - -model.end() - -assert(model.checkPythonDump()) diff --git a/src/FeaturesPlugin/Test/TestFillEdgeFace.py b/src/FeaturesPlugin/Test/TestFillEdgeFace.py deleted file mode 100644 index b887f137f..000000000 --- a/src/FeaturesPlugin/Test/TestFillEdgeFace.py +++ /dev/null @@ -1,52 +0,0 @@ -# Copyright (C) 2014-2019 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, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this library; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# -# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -# - -# -*- coding: utf-8 -*- - -from salome.shaper import model - -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("XOZ")) -SketchLine_1 = Sketch_1.addLine(-65.15998142235124, 15.60729985486212, 25.76227082728593, 71.65526357039188) -SketchLine_2 = Sketch_1.addLine(25.76227082728593, 71.65526357039188, 74.75234281567489, -47.08338548621191) -SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchLine_2.startPoint()) -SketchLine_3 = Sketch_1.addLine(74.75234281567489, -47.08338548621191, 13.30716777939044, -81.12733381712628) -SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchLine_2.endPoint(), SketchLine_3.startPoint()) -SketchLine_4 = Sketch_1.addLine(13.30716777939044, -81.12733381712628, -65.15998142235124, 15.60729985486212) -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_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/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(Fill_1, model, 1, [3], [0], [0], [3], [6]) -model.testHaveNamingSubshapes(Fill_1, model, Part_1_doc) - -model.end() - -assert(model.checkPythonDump()) diff --git a/src/FeaturesPlugin/Test/TestFillEdgeShell.py b/src/FeaturesPlugin/Test/TestFillEdgeShell.py deleted file mode 100644 index dc8557db1..000000000 --- a/src/FeaturesPlugin/Test/TestFillEdgeShell.py +++ /dev/null @@ -1,59 +0,0 @@ -# Copyright (C) 2014-2019 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, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this library; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# -# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -# - -# -*- coding: utf-8 -*- - -from SketchAPI import * - -from salome.shaper import model - -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("YOZ")) -SketchArc_1 = Sketch_1.addArc(28.24683132290313, 24.84281403912743, 0, 50, 56.77054208906745, 0, False) -SketchProjection_1 = Sketch_1.addProjection(model.selection("EDGE", "PartSet/OY"), False) -SketchLine_1 = SketchProjection_1.createdFeature() -SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_1.result(), SketchArc_1.endPoint()) -SketchProjection_2 = Sketch_1.addProjection(model.selection("EDGE", "PartSet/OZ"), False) -SketchLine_2 = SketchProjection_2.createdFeature() -SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchArc_1.startPoint(), SketchLine_2.result()) -SketchConstraintDistanceVertical_1 = Sketch_1.setVerticalDistance(SketchArc_1.startPoint(), SketchAPI_Line(SketchLine_1).startPoint(), 50) -SketchArc_2 = Sketch_1.addArc(38.14157263904823, 16.22495851193372, 56.77054208906745, 0, 34.15529753265601, 40.60522496371553, False) -SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchArc_1.endPoint(), SketchArc_2.startPoint()) -SketchConstraintTangent_1 = Sketch_1.setTangent(SketchArc_1.results()[1], SketchArc_2.results()[1]) -model.do() -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/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(Fill_1, model, 1, [3], [0], [0], [3], [6]) -model.testHaveNamingSubshapes(Fill_1, model, Part_1_doc) - -model.end() - -assert(model.checkPythonDump()) diff --git a/src/FeaturesPlugin/Test/TestFillEdgeSolid.py b/src/FeaturesPlugin/Test/TestFillEdgeSolid.py deleted file mode 100644 index 11f88c260..000000000 --- a/src/FeaturesPlugin/Test/TestFillEdgeSolid.py +++ /dev/null @@ -1,47 +0,0 @@ -# Copyright (C) 2014-2019 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, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this library; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# -# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -# - -# -*- coding: utf-8 -*- - -from salome.shaper import model - -model.begin() -partSet = model.moduleDocument() -Part_1 = model.addPart(partSet) -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) -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) -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/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(Fill_1, model, 1, [0], [0], [0], [1], [2]) -model.testHaveNamingSubshapes(Fill_1, model, Part_1_doc) - -model.end() - -assert(model.checkPythonDump()) diff --git a/src/FeaturesPlugin/Test/TestFillEdgeSolidIntersected.py b/src/FeaturesPlugin/Test/TestFillEdgeSolidIntersected.py deleted file mode 100644 index 73bf80681..000000000 --- a/src/FeaturesPlugin/Test/TestFillEdgeSolidIntersected.py +++ /dev/null @@ -1,48 +0,0 @@ -# Copyright (C) 2014-2019 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, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this library; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# -# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -# - -# -*- coding: utf-8 -*- - -from SketchAPI import * - -from salome.shaper import model - -model.begin() -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) -Plane_4 = model.addPlane(Part_1_doc, model.selection("FACE", "Cone_1_1/Face_3"), 5, True) -Sketch_1 = model.addSketch(Part_1_doc, model.selection("FACE", "Plane_1")) -SketchLine_1 = Sketch_1.addLine(-8.679188755740876, 4.967059748203267, 8.679188755740878, -4.967059748203268) -SketchProjection_1 = Sketch_1.addProjection(model.selection("VERTEX", "PartSet/Origin"), False) -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/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(Fill_1, model, 1, [3], [0], [0], [3], [6]) -model.testHaveNamingSubshapes(Fill_1, model, Part_1_doc) - -model.end() - -assert(model.checkPythonDump()) diff --git a/src/FeaturesPlugin/Test/TestFillEdgeVertex.py b/src/FeaturesPlugin/Test/TestFillEdgeVertex.py deleted file mode 100644 index 1ddc71865..000000000 --- a/src/FeaturesPlugin/Test/TestFillEdgeVertex.py +++ /dev/null @@ -1,46 +0,0 @@ -# Copyright (C) 2014-2019 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, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this library; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# -# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -# - -# -*- coding: utf-8 -*- - -from SketchAPI import * - -from salome.shaper import model - -model.begin() -partSet = model.moduleDocument() -Part_1 = model.addPart(partSet) -Part_1_doc = Part_1.document() -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) -SketchProjection_1 = Sketch_1.addProjection(model.selection("VERTEX", "Point_1"), False) -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/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(Fill_1,model,1,[2],[0],[0],[2],[4]) -model.testHaveNamingSubshapes(Fill_1,model,Part_1_doc) - -model.end() - -assert(model.checkPythonDump()) diff --git a/src/FeaturesPlugin/Test/TestFillEdgeWire.py b/src/FeaturesPlugin/Test/TestFillEdgeWire.py deleted file mode 100644 index 02520267a..000000000 --- a/src/FeaturesPlugin/Test/TestFillEdgeWire.py +++ /dev/null @@ -1,52 +0,0 @@ -# Copyright (C) 2014-2019 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, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this library; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# -# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -# - -# -*- coding: utf-8 -*- - -from salome.shaper import model - -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("YOZ")) -SketchLine_1 = Sketch_1.addLine(-67.57764876632801, 2.198838896952097, 88.39332365747461, 44.12336719883891) -model.do() -Sketch_2 = model.addSketch(Part_1_doc, model.defaultPlane("YOZ")) -SketchLine_2 = Sketch_2.addLine(-40.60522496371553, -29.75761973875181, -38.84615384615385, 66.99129172714079) -SketchLine_3 = Sketch_2.addLine(-38.84615384615385, 66.99129172714079, 50.86647314949202, 73.4412191582003) -SketchConstraintCoincidence_1 = Sketch_2.setCoincident(SketchLine_2.endPoint(), SketchLine_3.startPoint()) -SketchLine_4 = Sketch_2.addLine(50.86647314949202, 73.4412191582003, 55.26415094339622, -34.15529753265602) -SketchConstraintCoincidence_2 = Sketch_2.setCoincident(SketchLine_3.endPoint(), SketchLine_4.startPoint()) -SketchLine_5 = Sketch_2.addLine(55.26415094339622, -34.15529753265602, -40.60522496371553, -29.75761973875181) -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/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(Fill_1, model, 1, [3], [0], [0], [3], [6]) -model.testHaveNamingSubshapes(Fill_1, model, Part_1_doc) - -model.end() - -assert(model.checkPythonDump()) diff --git a/src/FeaturesPlugin/Test/TestFillFaceEdge.py b/src/FeaturesPlugin/Test/TestFillFaceEdge.py deleted file mode 100644 index 555d6e869..000000000 --- a/src/FeaturesPlugin/Test/TestFillFaceEdge.py +++ /dev/null @@ -1,52 +0,0 @@ -# Copyright (C) 2014-2019 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, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this library; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# -# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -# - -# -*- coding: utf-8 -*- - -from salome.shaper import model - -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("XOZ")) -SketchLine_1 = Sketch_1.addLine(-65.15998142235124, 15.60729985486212, 25.76227082728593, 71.65526357039188) -SketchLine_2 = Sketch_1.addLine(25.76227082728593, 71.65526357039188, 74.75234281567489, -47.08338548621191) -SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchLine_2.startPoint()) -SketchLine_3 = Sketch_1.addLine(74.75234281567489, -47.08338548621191, 13.30716777939044, -81.12733381712628) -SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchLine_2.endPoint(), SketchLine_3.startPoint()) -SketchLine_4 = Sketch_1.addLine(13.30716777939044, -81.12733381712628, -65.15998142235124, 15.60729985486212) -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_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/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(Fill_1,model,1,[2],[0],[2],[8],[16]) -model.testHaveNamingSubshapes(Fill_1,model,Part_1_doc) - -model.end() - -assert(model.checkPythonDump()) diff --git a/src/FeaturesPlugin/Test/TestFillFaceEdgeInside.py b/src/FeaturesPlugin/Test/TestFillFaceEdgeInside.py deleted file mode 100644 index a069f8829..000000000 --- a/src/FeaturesPlugin/Test/TestFillFaceEdgeInside.py +++ /dev/null @@ -1,55 +0,0 @@ -# Copyright (C) 2014-2019 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, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this library; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# -# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -# - -# -*- coding: utf-8 -*- - -from salome.shaper import model - -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")) -SketchArc_1 = Sketch_1.addArc(-31.22351233671988, 15.68505079825835, -49.40058055152394, 17.44412191582002, -17.30100145268062, 27.5029960835475, True) -SketchLine_1 = Sketch_1.addLine(-17.30100145268062, 27.5029960835475, -6.596516690856308, -20.66908563134978) -SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchArc_1.endPoint(), SketchLine_1.startPoint()) -SketchLine_2 = Sketch_1.addLine(-6.596516690856308, -20.66908563134978, -34.74165457184325, -28.87808417997097) -SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchLine_2.startPoint()) -SketchLine_3 = Sketch_1.addLine(-34.74165457184325, -28.87808417997097, -49.40058055152394, 17.44412191582002) -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_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/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/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(Fill_1,model,1,[0],[0],[1],[5],[10]) -model.testHaveNamingSubshapes(Fill_1,model,Part_1_doc) - -model.end() - -assert(model.checkPythonDump()) diff --git a/src/FeaturesPlugin/Test/TestFillFaceEdgePerpendicular.py b/src/FeaturesPlugin/Test/TestFillFaceEdgePerpendicular.py deleted file mode 100644 index 388522bfa..000000000 --- a/src/FeaturesPlugin/Test/TestFillFaceEdgePerpendicular.py +++ /dev/null @@ -1,56 +0,0 @@ -# Copyright (C) 2014-2019 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, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this library; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# -# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -# - -# -*- coding: utf-8 -*- - -from salome.shaper import model - -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")) -SketchLine_1 = Sketch_1.addLine(-27.76647174128943, 72.31029012920524, 42.2686420251427, 59.94944420697596) -SketchLine_2 = Sketch_1.addLine(42.2686420251427, 59.94944420697596, 59.0507718766223, 21.43074552356853) -SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchLine_2.startPoint()) -SketchLine_3 = Sketch_1.addLine(59.0507718766223, 21.43074552356853, 56.1909608273397, -69.919416180974) -SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchLine_2.endPoint(), SketchLine_3.startPoint()) -SketchLine_4 = Sketch_1.addLine(56.1909608273397, -69.919416180974, -29.91225626113892, -65.09334567012574) -SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchLine_3.endPoint(), SketchLine_4.startPoint()) -SketchLine_5 = Sketch_1.addLine(-29.91225626113892, -65.09334567012574, -57.18321726979322, -2.500460309588558) -SketchConstraintCoincidence_4 = Sketch_1.setCoincident(SketchLine_4.endPoint(), SketchLine_5.startPoint()) -SketchLine_6 = Sketch_1.addLine(-57.18321726979322, -2.500460309588558, -27.76647174128943, 72.31029012920524) -SketchConstraintCoincidence_5 = Sketch_1.setCoincident(SketchLine_5.endPoint(), SketchLine_6.startPoint()) -SketchConstraintCoincidence_6 = Sketch_1.setCoincident(SketchLine_6.endPoint(), SketchLine_1.startPoint()) -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/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(Fill_1,model,1,[0],[0],[1],[6],[13]) -model.testHaveNamingSubshapes(Fill_1,model,Part_1_doc) - -model.end() - -assert(model.checkPythonDump()) diff --git a/src/FeaturesPlugin/Test/TestFillFaceFace.py b/src/FeaturesPlugin/Test/TestFillFaceFace.py deleted file mode 100644 index 07d47a4f9..000000000 --- a/src/FeaturesPlugin/Test/TestFillFaceFace.py +++ /dev/null @@ -1,67 +0,0 @@ -# Copyright (C) 2014-2019 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, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this library; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# -# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -# - -# -*- coding: utf-8 -*- - -from salome.shaper import model - -model.begin() -partSet = model.moduleDocument() -Part_1 = model.addPart(partSet) -Part_1_doc = Part_1.document() -model.addParameter(Part_1_doc, "R", "50") -Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY")) -SketchLine_1 = Sketch_1.addLine(-49.81325699578132, 35.39936274902501, 0, 8.200436015051352) -SketchProjection_1 = Sketch_1.addProjection(model.selection("EDGE", "PartSet/OY"), False) -SketchLine_2 = SketchProjection_1.createdFeature() -SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchLine_2.result()) -SketchLine_3 = Sketch_1.addLine(0, 8.200436015051352, 49.94978427678259, 33.32234621934526) -SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchLine_3.startPoint()) -SketchArc_1 = Sketch_1.addArc(0, 31.08202242513997, 49.94978427678259, 33.32234621934526, -49.81325699578132, 35.39936274902501, False) -SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchLine_3.endPoint(), SketchArc_1.startPoint()) -SketchConstraintCoincidence_4 = Sketch_1.setCoincident(SketchLine_1.startPoint(), SketchArc_1.endPoint()) -SketchConstraintCoincidence_5 = Sketch_1.setCoincident(SketchArc_1.center(), SketchLine_2.result()) -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/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/SketchArc_1"), False) -SketchPoint_2 = SketchProjection_3.createdFeature() -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/Face-SketchLine_1r-SketchLine_3f-SketchArc_1_2f_wire")]) -Face_2 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_2/Face-SketchLine_4r-SketchLine_5f-SketchArc_2_2f_wire")]) -Fill_1 = model.addFill(Part_1_doc, [model.selection("FACE", "Face_1_1")], [model.selection("FACE", "Face_2_1")]) -model.do() - -model.checkResult(Fill_1, model, 1, [2], [0], [2], [6], [12]) -model.testHaveNamingSubshapes(Fill_1, model, Part_1_doc) - -model.end() - -assert(model.checkPythonDump()) diff --git a/src/FeaturesPlugin/Test/TestFillFaceShell.py b/src/FeaturesPlugin/Test/TestFillFaceShell.py deleted file mode 100644 index 548b3c4d2..000000000 --- a/src/FeaturesPlugin/Test/TestFillFaceShell.py +++ /dev/null @@ -1,112 +0,0 @@ -# Copyright (C) 2014-2019 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, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this library; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# -# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -# - -# -*- coding: utf-8 -*- - -from SketchAPI import * - -from salome.shaper import model - -model.begin() -partSet = model.moduleDocument() -Part_1 = model.addPart(partSet) -Part_1_doc = Part_1.document() -model.addParameter(Part_1_doc, "D", "50") -model.addParameter(Part_1_doc, "L", "30") -Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY")) -SketchLine_1 = Sketch_1.addLine(0, 28.78679656440358, 21.21320343559643, 50) -SketchProjection_1 = Sketch_1.addProjection(model.selection("EDGE", "PartSet/OY"), False) -SketchLine_2 = SketchProjection_1.createdFeature() -SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_1.startPoint(), SketchLine_2.result()) -SketchLine_3 = Sketch_1.addLine(21.21320343559643, 50, 0, 71.21320343559643) -SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchLine_3.startPoint()) -SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchLine_3.endPoint(), SketchLine_2.result()) -SketchLine_4 = Sketch_1.addLine(0, 71.21320343559643, -21.21320343559642, 50) -SketchConstraintCoincidence_4 = Sketch_1.setCoincident(SketchLine_3.endPoint(), SketchLine_4.startPoint()) -SketchLine_5 = Sketch_1.addLine(-21.21320343559642, 50, 0, 28.78679656440358) -SketchConstraintCoincidence_5 = Sketch_1.setCoincident(SketchLine_4.endPoint(), SketchLine_5.startPoint()) -SketchConstraintCoincidence_6 = Sketch_1.setCoincident(SketchLine_1.startPoint(), SketchLine_5.endPoint()) -SketchLine_6 = Sketch_1.addLine(-21.21320343559642, 50, 21.21320343559643, 50) -SketchConstraintCoincidence_7 = Sketch_1.setCoincident(SketchLine_4.endPoint(), SketchLine_6.startPoint()) -SketchConstraintCoincidence_8 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchLine_6.endPoint()) -SketchConstraintDistance_1 = Sketch_1.setDistance(SketchAPI_Line(SketchLine_2).startPoint(), SketchLine_6.result(), "D", True) -SketchConstraintLength_1 = Sketch_1.setLength(SketchLine_1.result(), "L") -SketchConstraintEqual_1 = Sketch_1.setEqual(SketchLine_1.result(), SketchLine_3.result()) -SketchConstraintEqual_2 = Sketch_1.setEqual(SketchLine_3.result(), SketchLine_4.result()) -SketchConstraintEqual_3 = Sketch_1.setEqual(SketchLine_4.result(), SketchLine_5.result()) -SketchConstraintPerpendicular_1 = Sketch_1.setPerpendicular(SketchLine_1.result(), SketchLine_3.result()) -model.do() -Sketch_2 = model.addSketch(Part_1_doc, model.defaultPlane("YOZ")) -SketchProjection_2 = Sketch_2.addProjection(model.selection("VERTEX", "PartSet/Origin"), False) -SketchPoint_1 = SketchProjection_2.createdFeature() -SketchLine_7 = Sketch_2.addLine(50, -39.61510263929618, 50, 43.87280058651025) -SketchLine_7.setName("SketchLine_8") -SketchLine_7.result().setName("SketchLine_8") -SketchLine_7.setAuxiliary(True) -SketchConstraintVertical_1 = Sketch_2.setVertical(SketchLine_7.result()) -SketchConstraintDistance_2 = Sketch_2.setDistance(SketchAPI_Point(SketchPoint_1).coordinates(), SketchLine_7.result(), "D", True) -SketchLine_8 = Sketch_2.addLine(57.5, 0, 65, -10.81485284151855) -SketchLine_8.setName("SketchLine_9") -SketchLine_8.result().setName("SketchLine_9") -SketchProjection_3 = Sketch_2.addProjection(model.selection("EDGE", "PartSet/OY"), False) -SketchLine_9 = SketchProjection_3.createdFeature() -SketchLine_9.setName("SketchLine_10") -SketchLine_9.result().setName("SketchLine_10") -SketchConstraintCoincidence_9 = Sketch_2.setCoincident(SketchLine_8.startPoint(), SketchLine_9.result()) -SketchLine_10 = Sketch_2.addLine(65, -10.81485284151855, 65, 11.50710132369052) -SketchLine_10.setName("SketchLine_11") -SketchLine_10.result().setName("SketchLine_11") -SketchConstraintCoincidence_10 = Sketch_2.setCoincident(SketchLine_8.endPoint(), SketchLine_10.startPoint()) -SketchLine_11 = Sketch_2.addLine(65, 11.50710132369052, 50, 11.50710132369052) -SketchLine_11.setName("SketchLine_12") -SketchLine_11.result().setName("SketchLine_12") -SketchConstraintCoincidence_11 = Sketch_2.setCoincident(SketchLine_10.endPoint(), SketchLine_11.startPoint()) -SketchConstraintCoincidence_12 = Sketch_2.setCoincident(SketchLine_11.endPoint(), SketchLine_7.result()) -SketchConstraintDistance_3 = Sketch_2.setDistance(SketchLine_8.startPoint(), SketchLine_7.result(), "L/4", True) -SketchConstraintDistance_4 = Sketch_2.setDistance(SketchLine_8.endPoint(), SketchLine_7.result(), "L/2", True) -SketchConstraintDistance_5 = Sketch_2.setDistance(SketchLine_10.endPoint(), SketchLine_7.result(), "L/2", True) -SketchConstraintHorizontal_1 = Sketch_2.setHorizontal(SketchLine_11.result()) -SketchConstraintMirror_1_objects = [SketchLine_8.result(), SketchLine_10.result(), SketchLine_11.result()] -SketchConstraintMirror_1 = Sketch_2.addMirror(SketchLine_7.result(), SketchConstraintMirror_1_objects) -[SketchLine_12, SketchLine_13, SketchLine_14] = SketchConstraintMirror_1.mirrored() -SketchLine_14.setName("SketchLine_15") -SketchLine_14.result().setName("SketchLine_15") -SketchLine_13.setName("SketchLine_14") -SketchLine_13.result().setName("SketchLine_14") -SketchLine_12.setName("SketchLine_13") -SketchLine_12.result().setName("SketchLine_13") -SketchLine_15 = Sketch_2.addLine(42.5, 0, 57.5, 0) -SketchLine_15.setName("SketchLine_16") -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/Face-SketchLine_1r-SketchLine_6r-SketchLine_5f_wire")]) -Face_2 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_1/Face-SketchLine_3f-SketchLine_4f-SketchLine_6f_wire")]) -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/Face-SketchLine_9f-SketchLine_11f-SketchLine_12f-SketchLine_15r-SketchLine_14r-SketchLine_13r-SketchLine_16f_wire")]) -Fill_1 = model.addFill(Part_1_doc, [model.selection("FACE", "Face_3_1")], [model.selection("SHELL", "Shell_1_1")]) -model.do() - -model.checkResult(Fill_1, model, 1, [3], [0], [3], [14], [28]) -model.testHaveNamingSubshapes(Fill_1, model, Part_1_doc) - -model.end() - -assert(model.checkPythonDump()) diff --git a/src/FeaturesPlugin/Test/TestFillFaceSolid.py b/src/FeaturesPlugin/Test/TestFillFaceSolid.py deleted file mode 100644 index 55ad8491c..000000000 --- a/src/FeaturesPlugin/Test/TestFillFaceSolid.py +++ /dev/null @@ -1,61 +0,0 @@ -# Copyright (C) 2014-2019 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, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this library; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# -# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -# - -# -*- coding: utf-8 -*- - -from SketchAPI import * - -from salome.shaper import model - -model.begin() -partSet = model.moduleDocument() -Part_1 = model.addPart(partSet) -Part_1_doc = Part_1.document() -model.addParameter(Part_1_doc, "L", "10") -model.addParameter(Part_1_doc, "Shift", "5") -Box_1 = model.addBox(Part_1_doc, "L", "L", "L") -Plane_4 = model.addPlane(Part_1_doc, model.selection("FACE", "Box_1_1/Bottom"), "Shift", True) -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) -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) -SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchArc_1.startPoint(), SketchLine_2.startPoint()) -SketchLine_3 = Sketch_1.addLine(0, 5, 0, -12.5) -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()) -SketchConstraintRadius_1 = Sketch_1.setRadius(SketchArc_1.results()[1], "L+Shift/2") -SketchConstraintDistanceVertical_1 = Sketch_1.setVerticalDistance(SketchAPI_Line(SketchLine_1).startPoint(), SketchLine_2.startPoint(), 5) -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/Face-SketchArc_1_2f-SketchLine_2f-SketchLine_3f_wire")]) -Fill_1 = model.addFill(Part_1_doc, [model.selection("FACE", "Face_1_1")], [model.selection("SOLID", "Box_1_1")]) -model.do() - -model.checkResult(Fill_1, model, 1, [4], [0], [4], [15], [30]) -model.testHaveNamingSubshapes(Fill_1, model, Part_1_doc) - -model.end() - -assert(model.checkPythonDump()) diff --git a/src/FeaturesPlugin/Test/TestFillFaceVertex.py b/src/FeaturesPlugin/Test/TestFillFaceVertex.py deleted file mode 100644 index 6893a60b0..000000000 --- a/src/FeaturesPlugin/Test/TestFillFaceVertex.py +++ /dev/null @@ -1,54 +0,0 @@ -# Copyright (C) 2014-2019 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, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this library; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# -# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -# - -# -*- coding: utf-8 -*- - -from salome.shaper import model - -model.begin() -partSet = model.moduleDocument() -Part_1 = model.addPart(partSet) -Part_1_doc = Part_1.document() -Point_2 = model.addPoint(Part_1_doc, 22, 33, 0) -Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY")) -SketchLine_1 = Sketch_1.addLine(80.77068214804063, 60.54136429608128, -35.9143686502177, 60.54136429608128) -SketchLine_2 = Sketch_1.addLine(-35.9143686502177, 60.54136429608128, -35.9143686502177, -37.67343976777939) -SketchLine_3 = Sketch_1.addLine(-35.9143686502177, -37.67343976777939, 80.77068214804063, -37.67343976777939) -SketchLine_4 = Sketch_1.addLine(80.77068214804063, -37.67343976777939, 80.77068214804063, 60.54136429608128) -SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_4.endPoint(), SketchLine_1.startPoint()) -SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchLine_2.startPoint()) -SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchLine_2.endPoint(), SketchLine_3.startPoint()) -SketchConstraintCoincidence_4 = Sketch_1.setCoincident(SketchLine_3.endPoint(), SketchLine_4.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()) -SketchConstraintVertical_2 = Sketch_1.setVertical(SketchLine_4.result()) -model.do() -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")]) -Fill_1 = model.addFill(Part_1_doc, [model.selection("FACE", "Face_1_1")], [model.selection("VERTEX", "Vertex_1_1")]) -model.do() - -model.checkResult(Fill_1,model,1,[0],[0],[1],[4],[9]) -model.testHaveNamingSubshapes(Fill_1,model,Part_1_doc) - -model.end() - -assert(model.checkPythonDump()) diff --git a/src/FeaturesPlugin/Test/TestFillFaceWire.py b/src/FeaturesPlugin/Test/TestFillFaceWire.py deleted file mode 100644 index 6245b2933..000000000 --- a/src/FeaturesPlugin/Test/TestFillFaceWire.py +++ /dev/null @@ -1,64 +0,0 @@ -# Copyright (C) 2014-2019 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, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this library; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# -# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -# - -# -*- coding: utf-8 -*- - -from salome.shaper import model - -model.begin() -partSet = model.moduleDocument() -Part_1 = model.addPart(partSet) -Part_1_doc = Part_1.document() -model.addParameter(Part_1_doc, "R", "50") -Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY")) -SketchLine_1 = Sketch_1.addLine(-49.81325699578132, 35.39936274902501, 0, 8.200436015051352) -SketchProjection_1 = Sketch_1.addProjection(model.selection("EDGE", "PartSet/OY"), False) -SketchLine_2 = SketchProjection_1.createdFeature() -SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchLine_2.result()) -SketchLine_3 = Sketch_1.addLine(0, 8.200436015051352, 49.94978427678259, 33.32234621934526) -SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchLine_3.startPoint()) -SketchArc_1 = Sketch_1.addArc(0, 31.08202242513997, 49.94978427678259, 33.32234621934526, -49.81325699578132, 35.39936274902501, False) -SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchLine_3.endPoint(), SketchArc_1.startPoint()) -SketchConstraintCoincidence_4 = Sketch_1.setCoincident(SketchLine_1.startPoint(), SketchArc_1.endPoint()) -SketchConstraintCoincidence_5 = Sketch_1.setCoincident(SketchArc_1.center(), SketchLine_2.result()) -SketchConstraintRadius_1 = Sketch_1.setRadius(SketchArc_1.results()[1], "R") -model.do() -Sketch_2 = model.addSketch(Part_1_doc, model.defaultPlane("XOY")) -SketchLine_4 = Sketch_2.addLine(-42.38833891077762, 73.71572760627062, -18.23994072168525, 7.835320880296757) -SketchLine_5 = Sketch_2.addLine(-18.23994072168525, 7.835320880296757, 13.89341696052619, 27.33089138697832) -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.93732104572751) -SketchConstraintCoincidence_8 = Sketch_2.setCoincident(SketchLine_6.endPoint(), SketchLine_7.startPoint()) -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/Face-SketchLine_1r-SketchLine_3f-SketchArc_1_2f_wire")]) -Wire_1 = model.addWire(Part_1_doc, [model.selection("WIRE", "Sketch_2/Face-SketchLine_4r-SketchLine_5f-SketchLine_6f-SketchLine_7f-SketchLine_8f_wire")]) -Fill_1 = model.addFill(Part_1_doc, [model.selection("FACE", "Face_1_1")], [model.selection("WIRE", "Wire_1_1")]) -model.do() - -model.checkResult(Fill_1, model, 1, [5], [0], [5], [21], [42]) -model.testHaveNamingSubshapes(Fill_1, model, Part_1_doc) - -model.end() - -assert(model.checkPythonDump()) diff --git a/src/FeaturesPlugin/Test/TestFillShellConstrPlane.py b/src/FeaturesPlugin/Test/TestFillShellConstrPlane.py deleted file mode 100644 index 6600f67b2..000000000 --- a/src/FeaturesPlugin/Test/TestFillShellConstrPlane.py +++ /dev/null @@ -1,54 +0,0 @@ -# Copyright (C) 2014-2019 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, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this library; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# -# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -# - -# -*- coding: utf-8 -*- - -from SketchAPI import * - -from salome.shaper import model - -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("YOZ")) -SketchArc_1 = Sketch_1.addArc(28.24683132290313, 24.84281403912743, 0, 50, 56.77054208906745, 0, False) -SketchProjection_1 = Sketch_1.addProjection(model.selection("EDGE", "PartSet/OY"), False) -SketchLine_1 = SketchProjection_1.createdFeature() -SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_1.result(), SketchArc_1.endPoint()) -SketchProjection_2 = Sketch_1.addProjection(model.selection("EDGE", "PartSet/OZ"), False) -SketchLine_2 = SketchProjection_2.createdFeature() -SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchArc_1.startPoint(), SketchLine_2.result()) -SketchConstraintDistanceVertical_1 = Sketch_1.setVerticalDistance(SketchArc_1.startPoint(), SketchAPI_Line(SketchLine_1).startPoint(), 50) -SketchArc_2 = Sketch_1.addArc(38.14157263904823, 16.22495851193372, 56.77054208906745, 0, 34.15529753265601, 40.60522496371553, False) -SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchArc_1.endPoint(), SketchArc_2.startPoint()) -SketchConstraintTangent_1 = Sketch_1.setTangent(SketchArc_1.results()[1], SketchArc_2.results()[1]) -model.do() -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")]) -Fill_1 = model.addFill(Part_1_doc, [model.selection("SHELL", "Shell_1_1")], [model.selection("FACE", "PartSet/XOZ")]) -model.do() - -model.checkResult(Fill_1,model,1,[0],[0],[3],[12],[24]) -model.testHaveNamingSubshapes(Fill_1,model,Part_1_doc) - -model.end() - -assert(model.checkPythonDump()) diff --git a/src/FeaturesPlugin/Test/TestFillShellEdge.py b/src/FeaturesPlugin/Test/TestFillShellEdge.py deleted file mode 100644 index 8ee5cca39..000000000 --- a/src/FeaturesPlugin/Test/TestFillShellEdge.py +++ /dev/null @@ -1,59 +0,0 @@ -# Copyright (C) 2014-2019 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, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this library; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# -# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -# - -# -*- coding: utf-8 -*- - -from SketchAPI import * - -from salome.shaper import model - -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("YOZ")) -SketchArc_1 = Sketch_1.addArc(28.24683132290313, 24.84281403912743, 0, 50, 56.77054208906745, 0, False) -SketchProjection_1 = Sketch_1.addProjection(model.selection("EDGE", "PartSet/OY"), False) -SketchLine_1 = SketchProjection_1.createdFeature() -SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_1.result(), SketchArc_1.endPoint()) -SketchProjection_2 = Sketch_1.addProjection(model.selection("EDGE", "PartSet/OZ"), False) -SketchLine_2 = SketchProjection_2.createdFeature() -SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchArc_1.startPoint(), SketchLine_2.result()) -SketchConstraintDistanceVertical_1 = Sketch_1.setVerticalDistance(SketchArc_1.startPoint(), SketchAPI_Line(SketchLine_1).startPoint(), 50) -SketchArc_2 = Sketch_1.addArc(38.14157263904823, 16.22495851193372, 56.77054208906745, 0, 34.15529753265601, 40.60522496371553, False) -SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchArc_1.endPoint(), SketchArc_2.startPoint()) -SketchConstraintTangent_1 = Sketch_1.setTangent(SketchArc_1.results()[1], SketchArc_2.results()[1]) -model.do() -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/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(Fill_1,model,1,[0],[0],[2],[8],[18]) -model.testHaveNamingSubshapes(Fill_1,model,Part_1_doc) - -model.end() - -assert(model.checkPythonDump()) diff --git a/src/FeaturesPlugin/Test/TestFillShellFace.py b/src/FeaturesPlugin/Test/TestFillShellFace.py deleted file mode 100644 index 8e2cf0d14..000000000 --- a/src/FeaturesPlugin/Test/TestFillShellFace.py +++ /dev/null @@ -1,110 +0,0 @@ -# Copyright (C) 2014-2019 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, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this library; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# -# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -# - -# -*- coding: utf-8 -*- - -from SketchAPI import * - -from salome.shaper import model - -model.begin() -partSet = model.moduleDocument() -Part_1 = model.addPart(partSet) -Part_1_doc = Part_1.document() -model.addParameter(Part_1_doc, "D", "50") -model.addParameter(Part_1_doc, "L", "30") -Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY")) -SketchLine_1 = Sketch_1.addLine(-6, 29.93619865618197, 18, 47.93619865618197) -SketchProjection_1 = Sketch_1.addProjection(model.selection("EDGE", "PartSet/OY"), False) -SketchLine_2 = SketchProjection_1.createdFeature() -SketchLine_3 = Sketch_1.addLine(18, 47.93619865618197, 0, 71.93619865618197) -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(0, 71.93619865618197, -24, 53.93619865618197) -SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchLine_3.endPoint(), SketchLine_4.startPoint()) -SketchLine_5 = Sketch_1.addLine(-24, 53.93619865618197, -6, 29.93619865618197) -SketchConstraintCoincidence_4 = Sketch_1.setCoincident(SketchLine_4.endPoint(), SketchLine_5.startPoint()) -SketchConstraintCoincidence_5 = Sketch_1.setCoincident(SketchLine_1.startPoint(), SketchLine_5.endPoint()) -SketchLine_6 = Sketch_1.addLine(-24, 53.93619865618197, 18, 47.93619865618197) -SketchConstraintCoincidence_6 = Sketch_1.setCoincident(SketchLine_4.endPoint(), SketchLine_6.startPoint()) -SketchConstraintCoincidence_7 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchLine_6.endPoint()) -SketchConstraintDistance_1 = Sketch_1.setDistance(SketchAPI_Line(SketchLine_2).startPoint(), SketchLine_6.result(), "D", True) -SketchConstraintLength_1 = Sketch_1.setLength(SketchLine_1.result(), "L") -SketchConstraintEqual_1 = Sketch_1.setEqual(SketchLine_1.result(), SketchLine_3.result()) -SketchConstraintEqual_2 = Sketch_1.setEqual(SketchLine_3.result(), SketchLine_4.result()) -SketchConstraintEqual_3 = Sketch_1.setEqual(SketchLine_4.result(), SketchLine_5.result()) -SketchConstraintPerpendicular_1 = Sketch_1.setPerpendicular(SketchLine_1.result(), SketchLine_3.result()) -SketchConstraintDistance_2 = Sketch_1.setDistance(SketchLine_5.endPoint(), SketchLine_2.result(), "L/5", True) -model.do() -Sketch_2 = model.addSketch(Part_1_doc, model.defaultPlane("YOZ")) -SketchProjection_2 = Sketch_2.addProjection(model.selection("VERTEX", "PartSet/Origin"), False) -SketchPoint_1 = SketchProjection_2.createdFeature() -SketchLine_7 = Sketch_2.addLine(50, -39.61510263929618, 50, 43.87280058651025) -SketchLine_7.setName("SketchLine_8") -SketchLine_7.result().setName("SketchLine_8") -SketchLine_7.setAuxiliary(True) -SketchConstraintVertical_1 = Sketch_2.setVertical(SketchLine_7.result()) -SketchConstraintDistance_3 = Sketch_2.setDistance(SketchAPI_Point(SketchPoint_1).coordinates(), SketchLine_7.result(), "D", True) -SketchLine_8 = Sketch_2.addLine(50, -3.170182618622045, 80, -14.17077918941143) -SketchLine_8.setName("SketchLine_9") -SketchLine_8.result().setName("SketchLine_9") -SketchLine_9 = Sketch_2.addLine(80, -14.17077918941143, 64.99999999999999, 12.18920647716607) -SketchLine_9.setName("SketchLine_11") -SketchLine_9.result().setName("SketchLine_11") -SketchConstraintCoincidence_8 = Sketch_2.setCoincident(SketchLine_8.endPoint(), SketchLine_9.startPoint()) -SketchConstraintCoincidence_8.setName("SketchConstraintCoincidence_9") -SketchLine_10 = Sketch_2.addLine(64.99999999999999, 12.18920647716607, 50, 12.18920647716607) -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()) -SketchConstraintMirror_1_objects = [SketchLine_8.result(), SketchLine_9.result(), SketchLine_10.result()] -SketchConstraintMirror_1 = Sketch_2.addMirror(SketchLine_7.result(), SketchConstraintMirror_1_objects) -[SketchLine_11, SketchLine_12, SketchLine_13] = SketchConstraintMirror_1.mirrored() -SketchLine_13.setName("SketchLine_15") -SketchLine_13.result().setName("SketchLine_15") -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/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/Face-SketchLine_1r-SketchLine_6r-SketchLine_5f_wire")]) -Face_2 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_1/Face-SketchLine_3f-SketchLine_4f-SketchLine_6f_wire")]) -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/Face-SketchLine_9f-SketchLine_11f-SketchLine_12f-SketchLine_15r-SketchLine_14r-SketchLine_13r_wire")]) -Fill_1 = model.addFill(Part_1_doc, [model.selection("SHELL", "Shell_1_1")], [model.selection("FACE", "Face_3_1")]) -model.do() - -model.checkResult(Fill_1, model, 1, [0], [0], [4], [13], [26]) -model.testHaveNamingSubshapes(Fill_1, model, Part_1_doc) - -model.end() - -assert(model.checkPythonDump()) diff --git a/src/FeaturesPlugin/Test/TestFillShellShell.py b/src/FeaturesPlugin/Test/TestFillShellShell.py deleted file mode 100644 index 670a89748..000000000 --- a/src/FeaturesPlugin/Test/TestFillShellShell.py +++ /dev/null @@ -1,90 +0,0 @@ -# Copyright (C) 2014-2019 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, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this library; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# -# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -# - -# -*- coding: utf-8 -*- - -from SketchAPI import * - -from salome.shaper import model - -model.begin() -partSet = model.moduleDocument() -Part_1 = model.addPart(partSet) -Part_1_doc = Part_1.document() -model.addParameter(Part_1_doc, "D", "50") -model.addParameter(Part_1_doc, "L", "30") -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-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-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()) -SketchConstraintCoincidence_5 = Sketch_1.setCoincident(SketchLine_1.startPoint(), SketchLine_5.endPoint()) -SketchLine_6 = Sketch_1.addLine(-25.61552812810082, 57.66225366792627, 15.61552812808831, 47.66225366793383) -SketchConstraintCoincidence_6 = Sketch_1.setCoincident(SketchLine_4.endPoint(), SketchLine_6.startPoint()) -SketchConstraintCoincidence_7 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchLine_6.endPoint()) -SketchConstraintDistance_1 = Sketch_1.setDistance(SketchAPI_Line(SketchLine_2).startPoint(), SketchLine_6.result(), "D", True) -SketchConstraintLength_1 = Sketch_1.setLength(SketchLine_1.result(), "L") -SketchConstraintEqual_1 = Sketch_1.setEqual(SketchLine_1.result(), SketchLine_3.result()) -SketchConstraintEqual_2 = Sketch_1.setEqual(SketchLine_3.result(), SketchLine_4.result()) -SketchConstraintEqual_3 = Sketch_1.setEqual(SketchLine_4.result(), SketchLine_5.result()) -SketchConstraintPerpendicular_1 = Sketch_1.setPerpendicular(SketchLine_1.result(), SketchLine_3.result()) -SketchConstraintDistance_2 = Sketch_1.setDistance(SketchLine_5.endPoint(), SketchLine_2.result(), "L/3", True) -model.do() -Sketch_2 = model.addSketch(Part_1_doc, model.defaultPlane("YOZ")) -SketchLine_7 = Sketch_2.addLine(50, 15.56025031353752, 50, -15.54016280334104) -SketchLine_8 = Sketch_2.addLine(50, -15.54016280334104, 36.52981427174974, 0) -SketchConstraintCoincidence_8 = Sketch_2.setCoincident(SketchLine_7.endPoint(), SketchLine_8.startPoint()) -SketchProjection_2 = Sketch_2.addProjection(model.selection("EDGE", "PartSet/OY"), False) -SketchLine_9 = SketchProjection_2.createdFeature() -SketchConstraintCoincidence_9 = Sketch_2.setCoincident(SketchLine_8.endPoint(), SketchLine_9.result()) -SketchLine_10 = Sketch_2.addLine(36.52981427174974, 0, 50, 15.56025031353752) -SketchConstraintCoincidence_10 = Sketch_2.setCoincident(SketchLine_8.endPoint(), SketchLine_10.startPoint()) -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/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) -SketchConstraintCoincidence_14 = Sketch_2.setCoincident(SketchLine_11.endPoint(), SketchLine_12.startPoint()) -SketchConstraintCoincidence_15 = Sketch_2.setCoincident(SketchLine_7.endPoint(), SketchLine_12.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/Face-SketchLine_1r-SketchLine_6r-SketchLine_5f_wire")]) -Face_2 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_1/Face-SketchLine_3f-SketchLine_4f-SketchLine_6f_wire")]) -Face_3 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_2/Face-SketchLine_10r-SketchLine_8r-SketchLine_7r_wire")]) -Face_4 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_2/Face-SketchLine_7r-SketchLine_12r-SketchLine_11r_wire")]) -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")]) -Fill_1 = model.addFill(Part_1_doc, [model.selection("SHELL", "Shell_1_1")], [model.selection("SHELL", "Shell_2_1")]) -model.do() - -model.checkResult(Fill_1, model, 1, [0], [0], [4], [15], [30]) -model.testHaveNamingSubshapes(Fill_1, model, Part_1_doc) - -model.end() - -assert(model.checkPythonDump()) diff --git a/src/FeaturesPlugin/Test/TestFillShellSolid.py b/src/FeaturesPlugin/Test/TestFillShellSolid.py deleted file mode 100644 index 08f10b53f..000000000 --- a/src/FeaturesPlugin/Test/TestFillShellSolid.py +++ /dev/null @@ -1,64 +0,0 @@ -# Copyright (C) 2014-2019 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, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this library; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# -# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -# - -# -*- coding: utf-8 -*- - -from SketchAPI import * - -from salome.shaper import model - -model.begin() -partSet = model.moduleDocument() -Part_1 = model.addPart(partSet) -Part_1_doc = Part_1.document() -model.addParameter(Part_1_doc, "L", "10") -model.addParameter(Part_1_doc, "Shift", "5") -Box_1 = model.addBox(Part_1_doc, "L", "L", "L") -Plane_4 = model.addPlane(Part_1_doc, model.selection("FACE", "Box_1_1/Bottom"), "Shift", True) -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) -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) -SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchArc_1.startPoint(), SketchLine_2.startPoint()) -SketchLine_3 = Sketch_1.addLine(0, 5, 0, -12.5) -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()) -SketchConstraintRadius_1 = Sketch_1.setRadius(SketchArc_1.results()[1], "L+Shift/2") -SketchConstraintDistanceVertical_1 = Sketch_1.setVerticalDistance(SketchAPI_Line(SketchLine_1).startPoint(), SketchLine_2.startPoint(), 5) -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/Face-SketchArc_1_2f-SketchLine_2f-SketchLine_3f_wire")]) -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")]) -Fill_2 = model.addFill(Part_1_doc, [model.selection("SHELL", "Shell_1_1")], [model.selection("SOLID", "Box_1_1")]) -model.do() - -model.checkResult(Fill_2, model, 1, [0], [0], [6], [22], [44]) -model.testHaveNamingSubshapes(Fill_2, model, Part_1_doc) - -model.end() - -assert(model.checkPythonDump()) diff --git a/src/FeaturesPlugin/Test/TestFillShellVertex.py b/src/FeaturesPlugin/Test/TestFillShellVertex.py deleted file mode 100644 index a3062224c..000000000 --- a/src/FeaturesPlugin/Test/TestFillShellVertex.py +++ /dev/null @@ -1,52 +0,0 @@ -# Copyright (C) 2014-2019 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, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this library; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# -# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -# - -# -*- coding: utf-8 -*- - -from SketchAPI import * - -from salome.shaper import model - -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")) -SketchArc_1 = Sketch_1.addArc(9.761379814097372, -58.25586643592183, 0, 0, -48.40807467084933, -47.99209154562215, False) -SketchArc_2 = Sketch_1.addArc(-12.6706171814691, -54.29782746957817, -48.40807467084933, -47.99209154562215, 12.46009047944227, -80.47750863283412, False) -SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchArc_1.endPoint(), SketchArc_2.startPoint()) -SketchConstraintTangent_1 = Sketch_1.setTangent(SketchArc_1.results()[1], SketchArc_2.results()[1]) -SketchProjection_1 = Sketch_1.addProjection(model.selection("VERTEX", "PartSet/Origin"), False) -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/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")]) -Fill_1 = model.addFill(Part_1_doc, [model.selection("SHELL", "Shell_1_1")], [model.selection("VERTEX", "Vertex_1_1")]) -model.do() - -model.checkResult(Fill_1,model,1,[0],[0],[2],[9],[18]) -model.testHaveNamingSubshapes(Fill_1,model,Part_1_doc) - -model.end() - -assert(model.checkPythonDump()) diff --git a/src/FeaturesPlugin/Test/TestFillShellWire.py b/src/FeaturesPlugin/Test/TestFillShellWire.py deleted file mode 100644 index 998cd655e..000000000 --- a/src/FeaturesPlugin/Test/TestFillShellWire.py +++ /dev/null @@ -1,87 +0,0 @@ -# Copyright (C) 2014-2019 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, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this library; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# -# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -# - -# -*- coding: utf-8 -*- - -from SketchAPI import * - -from salome.shaper import model - -model.begin() -partSet = model.moduleDocument() -Part_1 = model.addPart(partSet) -Part_1_doc = Part_1.document() -model.addParameter(Part_1_doc, "D", "50") -model.addParameter(Part_1_doc, "L", "30") -Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY")) -SketchLine_1 = Sketch_1.addLine(0, 28.78679656440358, 21.21320343559643, 50) -SketchProjection_1 = Sketch_1.addProjection(model.selection("EDGE", "PartSet/OY"), False) -SketchLine_2 = SketchProjection_1.createdFeature() -SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_1.startPoint(), SketchLine_2.result()) -SketchLine_3 = Sketch_1.addLine(21.21320343559643, 50, 0, 71.21320343559643) -SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchLine_3.startPoint()) -SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchLine_3.endPoint(), SketchLine_2.result()) -SketchLine_4 = Sketch_1.addLine(0, 71.21320343559643, -21.21320343559642, 50) -SketchConstraintCoincidence_4 = Sketch_1.setCoincident(SketchLine_3.endPoint(), SketchLine_4.startPoint()) -SketchLine_5 = Sketch_1.addLine(-21.21320343559642, 50, 0, 28.78679656440358) -SketchConstraintCoincidence_5 = Sketch_1.setCoincident(SketchLine_4.endPoint(), SketchLine_5.startPoint()) -SketchConstraintCoincidence_6 = Sketch_1.setCoincident(SketchLine_1.startPoint(), SketchLine_5.endPoint()) -SketchLine_6 = Sketch_1.addLine(-21.21320343559642, 50, 21.21320343559643, 50) -SketchConstraintCoincidence_7 = Sketch_1.setCoincident(SketchLine_4.endPoint(), SketchLine_6.startPoint()) -SketchConstraintCoincidence_8 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchLine_6.endPoint()) -SketchConstraintDistance_1 = Sketch_1.setDistance(SketchAPI_Line(SketchLine_2).startPoint(), SketchLine_6.result(), "D", True) -SketchConstraintLength_1 = Sketch_1.setLength(SketchLine_1.result(), "L") -SketchConstraintEqual_1 = Sketch_1.setEqual(SketchLine_1.result(), SketchLine_3.result()) -SketchConstraintEqual_2 = Sketch_1.setEqual(SketchLine_3.result(), SketchLine_4.result()) -SketchConstraintEqual_3 = Sketch_1.setEqual(SketchLine_4.result(), SketchLine_5.result()) -SketchConstraintPerpendicular_1 = Sketch_1.setPerpendicular(SketchLine_1.result(), SketchLine_3.result()) -model.do() -Sketch_2 = model.addSketch(Part_1_doc, model.defaultPlane("XOY")) -SketchLine_7 = Sketch_2.addLine(-14.33356820392057, 60, 15.66643179607943, 60) -SketchLine_8 = Sketch_2.addLine(15.66643179607943, 60, 15.66643179607943, 30) -SketchLine_9 = Sketch_2.addLine(15.66643179607943, 30, -14.33356820392057, 30) -SketchLine_10 = Sketch_2.addLine(-14.33356820392057, 30, -14.33356820392057, 60) -SketchConstraintCoincidence_9 = Sketch_2.setCoincident(SketchLine_10.endPoint(), SketchLine_7.startPoint()) -SketchConstraintCoincidence_10 = Sketch_2.setCoincident(SketchLine_7.endPoint(), SketchLine_8.startPoint()) -SketchConstraintCoincidence_11 = Sketch_2.setCoincident(SketchLine_8.endPoint(), SketchLine_9.startPoint()) -SketchConstraintCoincidence_12 = Sketch_2.setCoincident(SketchLine_9.endPoint(), SketchLine_10.startPoint()) -SketchConstraintHorizontal_1 = Sketch_2.setHorizontal(SketchLine_7.result()) -SketchConstraintVertical_1 = Sketch_2.setVertical(SketchLine_8.result()) -SketchConstraintHorizontal_2 = Sketch_2.setHorizontal(SketchLine_9.result()) -SketchConstraintVertical_2 = Sketch_2.setVertical(SketchLine_10.result()) -SketchConstraintLength_2 = Sketch_2.setLength(SketchLine_9.result(), "L") -SketchConstraintLength_3 = Sketch_2.setLength(SketchLine_8.result(), "L") -SketchProjection_2 = Sketch_2.addProjection(model.selection("VERTEX", "PartSet/Origin"), False) -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/Face-SketchLine_1r-SketchLine_6r-SketchLine_5f_wire")]) -Face_2 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_1/Face-SketchLine_3f-SketchLine_4f-SketchLine_6f_wire")]) -Shell_1 = model.addShell(Part_1_doc, [model.selection("FACE", "Face_1_1"), model.selection("FACE", "Face_2_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(Fill_1, model, 1, [0], [0], [8], [30], [60]) -model.testHaveNamingSubshapes(Fill_1, model, Part_1_doc) - -model.end() - -assert(model.checkPythonDump()) diff --git a/src/FeaturesPlugin/Test/TestFillSolid2ConstructionPlanes.py b/src/FeaturesPlugin/Test/TestFillSolid2ConstructionPlanes.py deleted file mode 100644 index 86b3d0548..000000000 --- a/src/FeaturesPlugin/Test/TestFillSolid2ConstructionPlanes.py +++ /dev/null @@ -1,37 +0,0 @@ -# Copyright (C) 2014-2019 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, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this library; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# -# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -# - -# -*- coding: utf-8 -*- - -from salome.shaper import model - -model.begin() -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) -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(Fill_1,model,1,[4],[4],[20],[72],[144]) -model.testHaveNamingSubshapes(Fill_1,model,Part_1_doc) - -model.end() - -assert(model.checkPythonDump()) diff --git a/src/FeaturesPlugin/Test/TestFillSolidCompFace.py b/src/FeaturesPlugin/Test/TestFillSolidCompFace.py deleted file mode 100644 index 5e137fdc7..000000000 --- a/src/FeaturesPlugin/Test/TestFillSolidCompFace.py +++ /dev/null @@ -1,63 +0,0 @@ -# Copyright (C) 2014-2019 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, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this library; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# -# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -# - -# -*- coding: utf-8 -*- - -from SketchAPI import * - -from salome.shaper import model - -model.begin() -partSet = model.moduleDocument() -Part_1 = model.addPart(partSet) -Part_1_doc = Part_1.document() -model.addParameter(Part_1_doc, "L", "10") -model.addParameter(Part_1_doc, "Shift", "12") -Box_1 = model.addBox(Part_1_doc, "L", "L", "L") -Plane_4 = model.addPlane(Part_1_doc, model.selection("FACE", "Box_1_1/Bottom"), "L/2", True) -Sketch_1 = model.addSketch(Part_1_doc, model.selection("FACE", "Plane_1")) -SketchProjection_1 = Sketch_1.addProjection(model.selection("VERTEX", "PartSet/Origin"), False) -SketchPoint_1 = SketchProjection_1.createdFeature() -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(15.49193338482974, -4, 0, 12) -SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchArc_1.startPoint(), SketchLine_2.startPoint()) -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()) -SketchConstraintRadius_1 = Sketch_1.setRadius(SketchArc_1.results()[1], "L+Shift/2") -SketchConstraintDistanceVertical_1 = Sketch_1.setVerticalDistance(SketchAPI_Line(SketchLine_1).startPoint(), SketchLine_2.startPoint(), "Shift/3") -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/Face-SketchArc_1_2f-SketchLine_2f-SketchLine_3f_wire")]) -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(Fill_2, model, 1, [2], [2], [14], [60], [120]) -model.testHaveNamingSubshapes(Fill_2, model, Part_1_doc) - -model.end() - -assert(model.checkPythonDump()) diff --git a/src/FeaturesPlugin/Test/TestFillSolidCompShell.py b/src/FeaturesPlugin/Test/TestFillSolidCompShell.py deleted file mode 100644 index bd641f1fd..000000000 --- a/src/FeaturesPlugin/Test/TestFillSolidCompShell.py +++ /dev/null @@ -1,65 +0,0 @@ -# Copyright (C) 2014-2019 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, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this library; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# -# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -# - -# -*- coding: utf-8 -*- - -from SketchAPI import * - -from salome.shaper import model - -model.begin() -partSet = model.moduleDocument() -Part_1 = model.addPart(partSet) -Part_1_doc = Part_1.document() -model.addParameter(Part_1_doc, "L", "10") -model.addParameter(Part_1_doc, "Shift", "12") -Box_1 = model.addBox(Part_1_doc, "L", "L", "L") -Plane_4 = model.addPlane(Part_1_doc, model.selection("FACE", "Box_1_1/Bottom"), "L/2", True) -Sketch_1 = model.addSketch(Part_1_doc, model.selection("FACE", "Plane_1")) -SketchProjection_1 = Sketch_1.addProjection(model.selection("VERTEX", "PartSet/Origin"), False) -SketchPoint_1 = SketchProjection_1.createdFeature() -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(15.49193338482974, -4, 0, 12) -SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchArc_1.startPoint(), SketchLine_2.startPoint()) -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()) -SketchConstraintRadius_1 = Sketch_1.setRadius(SketchArc_1.results()[1], "L+Shift/2") -SketchConstraintDistanceVertical_1 = Sketch_1.setVerticalDistance(SketchAPI_Line(SketchLine_1).startPoint(), SketchLine_2.startPoint(), "Shift/3") -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/Face-SketchArc_1_2f-SketchLine_2f-SketchLine_3f_wire")]) -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")]) -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(Fill_2, model, 1, [4], [4], [30], [132], [264]) -model.testHaveNamingSubshapes(Fill_2, model, Part_1_doc) - -model.end() - -assert(model.checkPythonDump()) diff --git a/src/FeaturesPlugin/Test/TestFillSolidEdge.py b/src/FeaturesPlugin/Test/TestFillSolidEdge.py deleted file mode 100644 index 2eb143b60..000000000 --- a/src/FeaturesPlugin/Test/TestFillSolidEdge.py +++ /dev/null @@ -1,47 +0,0 @@ -# Copyright (C) 2014-2019 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, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this library; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# -# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -# - -# -*- coding: utf-8 -*- - -from salome.shaper import model - -model.begin() -partSet = model.moduleDocument() -Part_1 = model.addPart(partSet) -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) -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) -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/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(Fill_1, model, 1, [0], [1], [7], [30], [60]) -model.testHaveNamingSubshapes(Fill_1, model, Part_1_doc) - -model.end() - -assert(model.checkPythonDump()) diff --git a/src/FeaturesPlugin/Test/TestFillSolidFace.py b/src/FeaturesPlugin/Test/TestFillSolidFace.py deleted file mode 100644 index 5ad553c8b..000000000 --- a/src/FeaturesPlugin/Test/TestFillSolidFace.py +++ /dev/null @@ -1,61 +0,0 @@ -# Copyright (C) 2014-2019 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, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this library; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# -# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -# - -# -*- coding: utf-8 -*- - -from SketchAPI import * - -from salome.shaper import model - -model.begin() -partSet = model.moduleDocument() -Part_1 = model.addPart(partSet) -Part_1_doc = Part_1.document() -model.addParameter(Part_1_doc, "L", "10") -model.addParameter(Part_1_doc, "Shift", "12") -Box_1 = model.addBox(Part_1_doc, "L", "L", "L") -Plane_4 = model.addPlane(Part_1_doc, model.selection("FACE", "Box_1_1/Bottom"), "L/2", True) -Sketch_1 = model.addSketch(Part_1_doc, model.selection("FACE", "Plane_1")) -SketchProjection_1 = Sketch_1.addProjection(model.selection("VERTEX", "PartSet/Origin"), False) -SketchPoint_1 = SketchProjection_1.createdFeature() -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(15.49193338482974, -4, 0, 12) -SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchArc_1.startPoint(), SketchLine_2.startPoint()) -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()) -SketchConstraintRadius_1 = Sketch_1.setRadius(SketchArc_1.results()[1], "L+Shift/2") -SketchConstraintDistanceVertical_1 = Sketch_1.setVerticalDistance(SketchAPI_Line(SketchLine_1).startPoint(), SketchLine_2.startPoint(), "Shift/3") -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/Face-SketchArc_1_2f-SketchLine_2f-SketchLine_3f_wire")]) -Fill_1 = model.addFill(Part_1_doc, [model.selection("SOLID", "Box_1_1")], [model.selection("FACE", "Face_1_1")]) -model.do() - -model.checkResult(Fill_1, model, 1, [2], [2], [12], [48], [96]) -model.testHaveNamingSubshapes(Fill_1, model, Part_1_doc) - -model.end() - -assert(model.checkPythonDump()) diff --git a/src/FeaturesPlugin/Test/TestFillSolidShell.py b/src/FeaturesPlugin/Test/TestFillSolidShell.py deleted file mode 100644 index 5264d051c..000000000 --- a/src/FeaturesPlugin/Test/TestFillSolidShell.py +++ /dev/null @@ -1,64 +0,0 @@ -# Copyright (C) 2014-2019 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, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this library; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# -# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -# - -# -*- coding: utf-8 -*- - -from SketchAPI import * - -from salome.shaper import model - -model.begin() -partSet = model.moduleDocument() -Part_1 = model.addPart(partSet) -Part_1_doc = Part_1.document() -model.addParameter(Part_1_doc, "L", "10") -model.addParameter(Part_1_doc, "Shift", "12") -Box_1 = model.addBox(Part_1_doc, "L", "L", "L") -Plane_4 = model.addPlane(Part_1_doc, model.selection("FACE", "Box_1_1/Bottom"), "L/2", True) -Sketch_1 = model.addSketch(Part_1_doc, model.selection("FACE", "Plane_1")) -SketchProjection_1 = Sketch_1.addProjection(model.selection("VERTEX", "PartSet/Origin"), False) -SketchPoint_1 = SketchProjection_1.createdFeature() -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(15.49193338482974, -4, 0, 12) -SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchArc_1.startPoint(), SketchLine_2.startPoint()) -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()) -SketchConstraintRadius_1 = Sketch_1.setRadius(SketchArc_1.results()[1], "L+Shift/2") -SketchConstraintDistanceVertical_1 = Sketch_1.setVerticalDistance(SketchAPI_Line(SketchLine_1).startPoint(), SketchLine_2.startPoint(), "Shift/3") -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/Face-SketchArc_1_2f-SketchLine_2f-SketchLine_3f_wire")]) -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")]) -Fill_2 = model.addFill(Part_1_doc, [model.selection("SOLID", "Box_1_1")], [model.selection("SHELL", "Shell_1_1")]) -model.do() - -model.checkResult(Fill_2, model, 1, [2], [2], [14], [60], [120]) -model.testHaveNamingSubshapes(Fill_2, model, Part_1_doc) - -model.end() - -assert(model.checkPythonDump()) diff --git a/src/FeaturesPlugin/Test/TestFillWireEdge.py b/src/FeaturesPlugin/Test/TestFillWireEdge.py deleted file mode 100644 index c97e89302..000000000 --- a/src/FeaturesPlugin/Test/TestFillWireEdge.py +++ /dev/null @@ -1,52 +0,0 @@ -# Copyright (C) 2014-2019 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, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this library; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# -# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -# - -# -*- coding: utf-8 -*- - -from salome.shaper import model - -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("YOZ")) -SketchLine_1 = Sketch_1.addLine(-67.57764876632801, 2.198838896952097, 88.39332365747461, 44.12336719883891) -model.do() -Sketch_2 = model.addSketch(Part_1_doc, model.defaultPlane("YOZ")) -SketchLine_2 = Sketch_2.addLine(-40.60522496371553, -29.75761973875181, -38.84615384615385, 66.99129172714079) -SketchLine_3 = Sketch_2.addLine(-38.84615384615385, 66.99129172714079, 50.86647314949202, 73.4412191582003) -SketchConstraintCoincidence_1 = Sketch_2.setCoincident(SketchLine_2.endPoint(), SketchLine_3.startPoint()) -SketchLine_4 = Sketch_2.addLine(50.86647314949202, 73.4412191582003, 55.26415094339622, -34.15529753265602) -SketchConstraintCoincidence_2 = Sketch_2.setCoincident(SketchLine_3.endPoint(), SketchLine_4.startPoint()) -SketchLine_5 = Sketch_2.addLine(55.26415094339622, -34.15529753265602, -40.60522496371553, -29.75761973875181) -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/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(Fill_1,model,1,[0],[0],[0],[6],[12]) -model.testHaveNamingSubshapes(Fill_1,model,Part_1_doc) - -model.end() - -assert(model.checkPythonDump()) diff --git a/src/FeaturesPlugin/Test/TestFillWireFace.py b/src/FeaturesPlugin/Test/TestFillWireFace.py deleted file mode 100644 index c6c4d2881..000000000 --- a/src/FeaturesPlugin/Test/TestFillWireFace.py +++ /dev/null @@ -1,70 +0,0 @@ -# Copyright (C) 2014-2019 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, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this library; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# -# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -# - -# -*- coding: utf-8 -*- - -from salome.shaper import model - -model.begin() -partSet = model.moduleDocument() -Part_1 = model.addPart(partSet) -Part_1_doc = Part_1.document() -model.addParameter(Part_1_doc, "R", "50") -Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY")) -SketchLine_1 = Sketch_1.addLine(-49.81325699578132, 35.39936274902501, 0, 8.200436015051352) -SketchProjection_1 = Sketch_1.addProjection(model.selection("EDGE", "PartSet/OY"), False) -SketchLine_2 = SketchProjection_1.createdFeature() -SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchLine_2.result()) -SketchLine_3 = Sketch_1.addLine(0, 8.200436015051352, 49.94978427678259, 33.32234621934526) -SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchLine_3.startPoint()) -SketchArc_1 = Sketch_1.addArc(0, 31.08202242513997, 49.94978427678259, 33.32234621934526, -49.81325699578132, 35.39936274902501, False) -SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchLine_3.endPoint(), SketchArc_1.startPoint()) -SketchConstraintCoincidence_4 = Sketch_1.setCoincident(SketchLine_1.startPoint(), SketchArc_1.endPoint()) -SketchConstraintCoincidence_5 = Sketch_1.setCoincident(SketchArc_1.center(), SketchLine_2.result()) -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/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) -SketchConstraintCoincidence_7 = Sketch_2.setCoincident(SketchLine_4.endPoint(), SketchLine_5.startPoint()) -SketchProjection_3 = Sketch_2.addProjection(model.selection("EDGE", "PartSet/OY"), False) -SketchLine_6 = SketchProjection_3.createdFeature() -SketchConstraintCoincidence_8 = Sketch_2.setCoincident(SketchLine_5.endPoint(), SketchLine_6.result()) -SketchLine_7 = Sketch_2.addLine(45.45797599933665, 0, 45.83553599350717, -22.747645239555) -SketchConstraintCoincidence_9 = Sketch_2.setCoincident(SketchLine_5.endPoint(), SketchLine_7.startPoint()) -SketchLine_8 = Sketch_2.addLine(45.83553599350717, -22.747645239555, 70.40999925541598, 30.039147749218) -SketchConstraintCoincidence_10 = Sketch_2.setCoincident(SketchLine_7.endPoint(), SketchLine_8.startPoint()) -SketchLine_9 = Sketch_2.addLine(70.40999925541598, 30.039147749218, 29.74624907439609, 30.07487215963349) -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/Face-SketchLine_1r-SketchLine_3f-SketchArc_1_2f_wire")]) -Wire_1 = model.addWire(Part_1_doc, [model.selection("WIRE", "Sketch_2/Face-SketchLine_4r-SketchLine_5f-SketchLine_7f-SketchLine_8f-SketchLine_9f_wire")]) -Fill_1 = model.addFill(Part_1_doc, [model.selection("WIRE", "Wire_1_1")], [model.selection("FACE", "Face_1_1")]) -model.do() - -model.checkResult(Fill_1, model, 1, [0], [0], [0], [6], [12]) -model.testHaveNamingSubshapes(Fill_1, model, Part_1_doc) - -model.end() - -assert(model.checkPythonDump()) diff --git a/src/FeaturesPlugin/Test/TestFillWireShell.py b/src/FeaturesPlugin/Test/TestFillWireShell.py deleted file mode 100644 index 8b9006137..000000000 --- a/src/FeaturesPlugin/Test/TestFillWireShell.py +++ /dev/null @@ -1,112 +0,0 @@ -# Copyright (C) 2014-2019 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, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this library; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# -# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -# - -# -*- coding: utf-8 -*- - -from SketchAPI import * - -from salome.shaper import model - -model.begin() -partSet = model.moduleDocument() -Part_1 = model.addPart(partSet) -Part_1_doc = Part_1.document() -model.addParameter(Part_1_doc, "D", "50") -model.addParameter(Part_1_doc, "L", "30") -Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY")) -SketchLine_1 = Sketch_1.addLine(0, 28.78679656440358, 21.21320343559643, 50) -SketchProjection_1 = Sketch_1.addProjection(model.selection("EDGE", "PartSet/OY"), False) -SketchLine_2 = SketchProjection_1.createdFeature() -SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_1.startPoint(), SketchLine_2.result()) -SketchLine_3 = Sketch_1.addLine(21.21320343559643, 50, 0, 71.21320343559643) -SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchLine_3.startPoint()) -SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchLine_3.endPoint(), SketchLine_2.result()) -SketchLine_4 = Sketch_1.addLine(0, 71.21320343559643, -21.21320343559642, 50) -SketchConstraintCoincidence_4 = Sketch_1.setCoincident(SketchLine_3.endPoint(), SketchLine_4.startPoint()) -SketchLine_5 = Sketch_1.addLine(-21.21320343559642, 50, 0, 28.78679656440358) -SketchConstraintCoincidence_5 = Sketch_1.setCoincident(SketchLine_4.endPoint(), SketchLine_5.startPoint()) -SketchConstraintCoincidence_6 = Sketch_1.setCoincident(SketchLine_1.startPoint(), SketchLine_5.endPoint()) -SketchLine_6 = Sketch_1.addLine(-21.21320343559642, 50, 21.21320343559643, 50) -SketchConstraintCoincidence_7 = Sketch_1.setCoincident(SketchLine_4.endPoint(), SketchLine_6.startPoint()) -SketchConstraintCoincidence_8 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchLine_6.endPoint()) -SketchConstraintDistance_1 = Sketch_1.setDistance(SketchAPI_Line(SketchLine_2).startPoint(), SketchLine_6.result(), "D", True) -SketchConstraintLength_1 = Sketch_1.setLength(SketchLine_1.result(), "L") -SketchConstraintEqual_1 = Sketch_1.setEqual(SketchLine_1.result(), SketchLine_3.result()) -SketchConstraintEqual_2 = Sketch_1.setEqual(SketchLine_3.result(), SketchLine_4.result()) -SketchConstraintEqual_3 = Sketch_1.setEqual(SketchLine_4.result(), SketchLine_5.result()) -SketchConstraintPerpendicular_1 = Sketch_1.setPerpendicular(SketchLine_1.result(), SketchLine_3.result()) -model.do() -Sketch_2 = model.addSketch(Part_1_doc, model.defaultPlane("YOZ")) -SketchProjection_2 = Sketch_2.addProjection(model.selection("VERTEX", "PartSet/Origin"), False) -SketchPoint_1 = SketchProjection_2.createdFeature() -SketchLine_7 = Sketch_2.addLine(50, -39.61510263929618, 50, 43.87280058651025) -SketchLine_7.setName("SketchLine_8") -SketchLine_7.result().setName("SketchLine_8") -SketchLine_7.setAuxiliary(True) -SketchConstraintVertical_1 = Sketch_2.setVertical(SketchLine_7.result()) -SketchConstraintDistance_2 = Sketch_2.setDistance(SketchAPI_Point(SketchPoint_1).coordinates(), SketchLine_7.result(), "D", True) -SketchLine_8 = Sketch_2.addLine(57.5, 0, 65, -10.81485284151855) -SketchLine_8.setName("SketchLine_9") -SketchLine_8.result().setName("SketchLine_9") -SketchProjection_3 = Sketch_2.addProjection(model.selection("EDGE", "PartSet/OY"), False) -SketchLine_9 = SketchProjection_3.createdFeature() -SketchLine_9.setName("SketchLine_10") -SketchLine_9.result().setName("SketchLine_10") -SketchConstraintCoincidence_9 = Sketch_2.setCoincident(SketchLine_8.startPoint(), SketchLine_9.result()) -SketchLine_10 = Sketch_2.addLine(65, -10.81485284151855, 65, 11.50710132369052) -SketchLine_10.setName("SketchLine_11") -SketchLine_10.result().setName("SketchLine_11") -SketchConstraintCoincidence_10 = Sketch_2.setCoincident(SketchLine_8.endPoint(), SketchLine_10.startPoint()) -SketchLine_11 = Sketch_2.addLine(65, 11.50710132369052, 50, 11.50710132369052) -SketchLine_11.setName("SketchLine_12") -SketchLine_11.result().setName("SketchLine_12") -SketchConstraintCoincidence_11 = Sketch_2.setCoincident(SketchLine_10.endPoint(), SketchLine_11.startPoint()) -SketchConstraintCoincidence_12 = Sketch_2.setCoincident(SketchLine_11.endPoint(), SketchLine_7.result()) -SketchConstraintDistance_3 = Sketch_2.setDistance(SketchLine_8.startPoint(), SketchLine_7.result(), "L/4", True) -SketchConstraintDistance_4 = Sketch_2.setDistance(SketchLine_8.endPoint(), SketchLine_7.result(), "L/2", True) -SketchConstraintDistance_5 = Sketch_2.setDistance(SketchLine_10.endPoint(), SketchLine_7.result(), "L/2", True) -SketchConstraintHorizontal_1 = Sketch_2.setHorizontal(SketchLine_11.result()) -SketchConstraintMirror_1_objects = [SketchLine_8.result(), SketchLine_10.result(), SketchLine_11.result()] -SketchConstraintMirror_1 = Sketch_2.addMirror(SketchLine_7.result(), SketchConstraintMirror_1_objects) -[SketchLine_12, SketchLine_13, SketchLine_14] = SketchConstraintMirror_1.mirrored() -SketchLine_14.setName("SketchLine_15") -SketchLine_14.result().setName("SketchLine_15") -SketchLine_13.setName("SketchLine_14") -SketchLine_13.result().setName("SketchLine_14") -SketchLine_12.setName("SketchLine_13") -SketchLine_12.result().setName("SketchLine_13") -SketchLine_15 = Sketch_2.addLine(42.5, 0, 57.5, 0) -SketchLine_15.setName("SketchLine_16") -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/Face-SketchLine_1r-SketchLine_6r-SketchLine_5f_wire")]) -Face_2 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_1/Face-SketchLine_3f-SketchLine_4f-SketchLine_6f_wire")]) -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/Face-SketchLine_9f-SketchLine_11f-SketchLine_12f-SketchLine_15r-SketchLine_14r-SketchLine_13r-SketchLine_16f_wire")]) -Fill_1 = model.addFill(Part_1_doc, [model.selection("WIRE", "Wire_1_1")], [model.selection("SHELL", "Shell_1_1")]) -model.do() - -model.checkResult(Fill_1, model, 1, [0], [0], [0], [10], [20]) -model.testHaveNamingSubshapes(Fill_1, model, Part_1_doc) - -model.end() - -assert(model.checkPythonDump()) diff --git a/src/FeaturesPlugin/Test/TestFillWireSolid.py b/src/FeaturesPlugin/Test/TestFillWireSolid.py deleted file mode 100644 index 590420a21..000000000 --- a/src/FeaturesPlugin/Test/TestFillWireSolid.py +++ /dev/null @@ -1,61 +0,0 @@ -# Copyright (C) 2014-2019 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, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this library; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# -# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -# - -# -*- coding: utf-8 -*- - -from SketchAPI import * - -from salome.shaper import model - -model.begin() -partSet = model.moduleDocument() -Part_1 = model.addPart(partSet) -Part_1_doc = Part_1.document() -model.addParameter(Part_1_doc, "L", "10") -model.addParameter(Part_1_doc, "Shift", "5") -Box_1 = model.addBox(Part_1_doc, "L", "L", "L") -Plane_4 = model.addPlane(Part_1_doc, model.selection("FACE", "Box_1_1/Bottom"), "Shift", True) -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) -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) -SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchArc_1.startPoint(), SketchLine_2.startPoint()) -SketchLine_3 = Sketch_1.addLine(0, 5, 0, -12.5) -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()) -SketchConstraintRadius_1 = Sketch_1.setRadius(SketchArc_1.results()[1], "L+Shift/2") -SketchConstraintDistanceVertical_1 = Sketch_1.setVerticalDistance(SketchAPI_Line(SketchLine_1).startPoint(), SketchLine_2.startPoint(), 5) -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/Face-SketchArc_1_2f-SketchLine_2f-SketchLine_3f_wire")]) -Fill_1 = model.addFill(Part_1_doc, [model.selection("WIRE", "Wire_1_1")], [model.selection("SOLID", "Box_1_1")]) -model.do() - -model.checkResult(Fill_1, model, 1, [0], [0], [0], [9], [18]) -model.testHaveNamingSubshapes(Fill_1, model, Part_1_doc) - -model.end() - -assert(model.checkPythonDump()) diff --git a/src/FeaturesPlugin/Test/TestFillWireVertex.py b/src/FeaturesPlugin/Test/TestFillWireVertex.py deleted file mode 100644 index f6d405d49..000000000 --- a/src/FeaturesPlugin/Test/TestFillWireVertex.py +++ /dev/null @@ -1,53 +0,0 @@ -# Copyright (C) 2014-2019 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, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this library; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# -# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -# - -# -*- coding: utf-8 -*- - -from SketchAPI import * - -from salome.shaper import model - -model.begin() -partSet = model.moduleDocument() -Part_1 = model.addPart(partSet) -Part_1_doc = Part_1.document() -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.43492861072797, 41.55044273324706, 64.29883100829633, -35.76346801736826) -SketchProjection_1 = Sketch_1.addProjection(model.selection("VERTEX", "Point_1"), False) -SketchPoint_1 = SketchProjection_1.createdFeature() -SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_1.result(), SketchAPI_Point(SketchPoint_1).coordinates()) -SketchLine_2 = Sketch_1.addLine(64.5972559141328, -34.82170453629492, 63.39686648861513, 69.37209759863701) -SketchLine_3 = Sketch_1.addLine(63.39686648861513, 69.37209759863701, -27.43492861072797, 41.55044273324706) -SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchLine_2.endPoint(), SketchLine_3.startPoint()) -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_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(Fill_1,model,1,[0],[0],[0],[4],[8]) -model.testHaveNamingSubshapes(Fill_1,model,Part_1_doc) - -model.end() - -assert(model.checkPythonDump()) diff --git a/src/FeaturesPlugin/Test/TestFillWireWire.py b/src/FeaturesPlugin/Test/TestFillWireWire.py deleted file mode 100644 index 8daed1bbe..000000000 --- a/src/FeaturesPlugin/Test/TestFillWireWire.py +++ /dev/null @@ -1,67 +0,0 @@ -# Copyright (C) 2014-2019 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, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this library; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# -# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -# - -# -*- coding: utf-8 -*- - -from salome.shaper import model - -model.begin() -partSet = model.moduleDocument() -Part_1 = model.addPart(partSet) -Part_1_doc = Part_1.document() -model.addParameter(Part_1_doc, "R", "50") -Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY")) -SketchLine_1 = Sketch_1.addLine(-49.81325699578132, 35.39936274902501, 0, 8.200436015051352) -SketchProjection_1 = Sketch_1.addProjection(model.selection("EDGE", "PartSet/OY"), False) -SketchLine_2 = SketchProjection_1.createdFeature() -SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchLine_2.result()) -SketchLine_3 = Sketch_1.addLine(0, 8.200436015051352, 49.94978427678259, 33.32234621934526) -SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchLine_3.startPoint()) -SketchArc_1 = Sketch_1.addArc(0, 31.08202242513997, 49.94978427678259, 33.32234621934526, -49.81325699578132, 35.39936274902501, False) -SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchLine_3.endPoint(), SketchArc_1.startPoint()) -SketchConstraintCoincidence_4 = Sketch_1.setCoincident(SketchLine_1.startPoint(), SketchArc_1.endPoint()) -SketchConstraintCoincidence_5 = Sketch_1.setCoincident(SketchArc_1.center(), SketchLine_2.result()) -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/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/SketchArc_1"), False) -SketchPoint_2 = SketchProjection_3.createdFeature() -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/Face-SketchLine_1r-SketchLine_3f-SketchArc_1_2f_wire")]) -Wire_2 = model.addWire(Part_1_doc, [model.selection("WIRE", "Sketch_2/Face-SketchLine_4r-SketchLine_5f-SketchArc_2_2f_wire")]) -Fill_1 = model.addFill(Part_1_doc, [model.selection("WIRE", "Wire_1_1")], [model.selection("WIRE", "Wire_2_1")]) -model.do() - -model.checkResult(Fill_1, model, 1, [0], [0], [0], [4], [8]) -model.testHaveNamingSubshapes(Fill_1, model, Part_1_doc) - -model.end() - -assert(model.checkPythonDump()) diff --git a/src/FeaturesPlugin/Test/TestScriptSolidEdge.py b/src/FeaturesPlugin/Test/TestScriptSolidEdge.py new file mode 100644 index 000000000..6f9e0e90e --- /dev/null +++ b/src/FeaturesPlugin/Test/TestScriptSolidEdge.py @@ -0,0 +1,47 @@ +# Copyright (C) 2014-2019 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, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# + +# -*- coding: utf-8 -*- + +from salome.shaper import model + +model.begin() +partSet = model.moduleDocument() +Part_1 = model.addPart(partSet) +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) +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) +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/SketchLine_1")]) +Split_1 = model.addSplit(Part_1_doc, [model.selection("SOLID", "Box_1_1")], [model.selection("EDGE", "Edge_1_1")]) +model.do() + +model.checkResult(Split_1, model, 1, [0], [1], [7], [30], [60]) +model.testHaveNamingSubshapes(Split_1, model, Part_1_doc) + +model.end() + +assert(model.checkPythonDump()) diff --git a/src/FeaturesPlugin/Test/TestSplitCompFaceSolid.py b/src/FeaturesPlugin/Test/TestSplitCompFaceSolid.py new file mode 100644 index 000000000..cc87ae9bc --- /dev/null +++ b/src/FeaturesPlugin/Test/TestSplitCompFaceSolid.py @@ -0,0 +1,63 @@ +# Copyright (C) 2014-2019 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, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# + +# -*- coding: utf-8 -*- + +from SketchAPI import * + +from salome.shaper import model + +model.begin() +partSet = model.moduleDocument() +Part_1 = model.addPart(partSet) +Part_1_doc = Part_1.document() +model.addParameter(Part_1_doc, "L", "10") +model.addParameter(Part_1_doc, "Shift", "5") +Box_1 = model.addBox(Part_1_doc, "L", "L", "L") +Plane_4 = model.addPlane(Part_1_doc, model.selection("FACE", "Box_1_1/Bottom"), "Shift", True) +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) +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) +SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchArc_1.startPoint(), SketchLine_2.startPoint()) +SketchLine_3 = Sketch_1.addLine(0, 5, 0, -12.5) +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()) +SketchConstraintRadius_1 = Sketch_1.setRadius(SketchArc_1.results()[1], "L+Shift/2") +SketchConstraintDistanceVertical_1 = Sketch_1.setVerticalDistance(SketchAPI_Line(SketchLine_1).startPoint(), SketchLine_2.startPoint(), 5) +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/Face-SketchArc_1_2f-SketchLine_2f-SketchLine_3f_wire")]) +Split_1 = model.addSplit(Part_1_doc, [model.selection("FACE", "Face_1_1")], [model.selection("FACE", "Plane_2")]) +Split_2 = model.addSplit(Part_1_doc, [model.selection("COMPOUND", "Split_1_1")], [model.selection("SOLID", "Box_1_1")]) +model.do() + +model.checkResult(Split_2, model, 1, [6], [0], [6], [22], [44]) +model.testHaveNamingSubshapes(Split_2, model, Part_1_doc) + +model.end() + +assert(model.checkPythonDump()) diff --git a/src/FeaturesPlugin/Test/TestSplitCompsolidPlane.py b/src/FeaturesPlugin/Test/TestSplitCompsolidPlane.py new file mode 100644 index 000000000..dd2ead462 --- /dev/null +++ b/src/FeaturesPlugin/Test/TestSplitCompsolidPlane.py @@ -0,0 +1,47 @@ +# Copyright (C) 2018-2019 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, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# + +from salome.shaper import model + +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")) +SketchProjection_1 = Sketch_1.addProjection(model.selection("EDGE", "PartSet/OX"), False) +SketchLine_1 = SketchProjection_1.createdFeature() +SketchCircle_1 = Sketch_1.addCircle(11.92861402549826, 0, 16.05621803603458) +SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_1.result(), SketchCircle_1.center()) +SketchCircle_2 = Sketch_1.addCircle(37.8779560884558, 0, 17.74637067763095) +SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchLine_1.result(), SketchCircle_2.center()) +model.do() +Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("COMPOUND", "Sketch_1")], model.selection(), 10, 0) +Split_1 = model.addSplit(Part_1_doc, [model.selection("SOLID", "Extrusion_1_1_1"), model.selection("SOLID", "Extrusion_1_1_2")], [model.selection("FACE", "PartSet/XOZ")]) +model.do() +model.end() + +from GeomAPI import GeomAPI_Shape + +model.testNbResults(Split_1, 1) +model.testNbSubResults(Split_1, [5]) +model.testNbSubShapes(Split_1, GeomAPI_Shape.SOLID, [5]) +model.testNbSubShapes(Split_1, GeomAPI_Shape.FACE, [25]) +model.testNbSubShapes(Split_1, GeomAPI_Shape.EDGE, [90]) +model.testNbSubShapes(Split_1, GeomAPI_Shape.VERTEX, [180]) +model.testResultsVolumes(Split_1, [16831.622023411000554915517568588]) diff --git a/src/FeaturesPlugin/Test/TestSplitEdgeEdge.py b/src/FeaturesPlugin/Test/TestSplitEdgeEdge.py new file mode 100644 index 000000000..ffd475172 --- /dev/null +++ b/src/FeaturesPlugin/Test/TestSplitEdgeEdge.py @@ -0,0 +1,48 @@ +# Copyright (C) 2014-2019 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, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# + +# -*- coding: utf-8 -*- + +from salome.shaper import model + +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")) +SketchLine_1 = Sketch_1.addLine(-43.24383164005806, 13.92597968069667, 63.17997097242381, 62.8867924528302) +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/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/SketchLine_1")]) +Edge_2 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_2/SketchLine_2")]) +Split_1 = model.addSplit(Part_1_doc, [model.selection("EDGE", "Edge_1_1")], [model.selection("EDGE", "Edge_2_1")]) +model.do() + +model.checkResult(Split_1,model,1,[3],[0],[0],[3],[6]) +model.testHaveNamingSubshapes(Split_1,model,Part_1_doc) + +model.end() + +assert(model.checkPythonDump()) diff --git a/src/FeaturesPlugin/Test/TestSplitEdgeEdgeIntersected.py b/src/FeaturesPlugin/Test/TestSplitEdgeEdgeIntersected.py new file mode 100644 index 000000000..51128802c --- /dev/null +++ b/src/FeaturesPlugin/Test/TestSplitEdgeEdgeIntersected.py @@ -0,0 +1,44 @@ +# Copyright (C) 2014-2019 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, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# + +# -*- coding: utf-8 -*- + +from salome.shaper import model + +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("XOZ")) +SketchLine_1 = Sketch_1.addLine(-54.08747895500726, -7.310347750362856, 54.27191756168357, 63.68373962264153) +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/SketchLine_1")]) +Edge_2 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_2/SketchLine_2")]) +Split_1 = model.addSplit(Part_1_doc, [model.selection("EDGE", "Edge_1_1")], [model.selection("EDGE", "Edge_2_1")]) +model.do() + +model.checkResult(Split_1,model,1,[2],[0],[0],[2],[4]) +model.testHaveNamingSubshapes(Split_1,model,Part_1_doc) + +model.end() + +assert(model.checkPythonDump()) diff --git a/src/FeaturesPlugin/Test/TestSplitEdgeFace.py b/src/FeaturesPlugin/Test/TestSplitEdgeFace.py new file mode 100644 index 000000000..29b1edc4c --- /dev/null +++ b/src/FeaturesPlugin/Test/TestSplitEdgeFace.py @@ -0,0 +1,52 @@ +# Copyright (C) 2014-2019 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, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# + +# -*- coding: utf-8 -*- + +from salome.shaper import model + +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("XOZ")) +SketchLine_1 = Sketch_1.addLine(-65.15998142235124, 15.60729985486212, 25.76227082728593, 71.65526357039188) +SketchLine_2 = Sketch_1.addLine(25.76227082728593, 71.65526357039188, 74.75234281567489, -47.08338548621191) +SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchLine_2.startPoint()) +SketchLine_3 = Sketch_1.addLine(74.75234281567489, -47.08338548621191, 13.30716777939044, -81.12733381712628) +SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchLine_2.endPoint(), SketchLine_3.startPoint()) +SketchLine_4 = Sketch_1.addLine(13.30716777939044, -81.12733381712628, -65.15998142235124, 15.60729985486212) +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_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/SketchLine_5")]) +Split_1 = model.addSplit(Part_1_doc, [model.selection("EDGE", "Edge_1_1")], [model.selection("FACE", "Face_1_1")]) +model.do() + +model.checkResult(Split_1, model, 1, [3], [0], [0], [3], [6]) +model.testHaveNamingSubshapes(Split_1, model, Part_1_doc) + +model.end() + +assert(model.checkPythonDump()) diff --git a/src/FeaturesPlugin/Test/TestSplitEdgeShell.py b/src/FeaturesPlugin/Test/TestSplitEdgeShell.py new file mode 100644 index 000000000..95f35922d --- /dev/null +++ b/src/FeaturesPlugin/Test/TestSplitEdgeShell.py @@ -0,0 +1,59 @@ +# Copyright (C) 2014-2019 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, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# + +# -*- coding: utf-8 -*- + +from SketchAPI import * + +from salome.shaper import model + +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("YOZ")) +SketchArc_1 = Sketch_1.addArc(28.24683132290313, 24.84281403912743, 0, 50, 56.77054208906745, 0, False) +SketchProjection_1 = Sketch_1.addProjection(model.selection("EDGE", "PartSet/OY"), False) +SketchLine_1 = SketchProjection_1.createdFeature() +SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_1.result(), SketchArc_1.endPoint()) +SketchProjection_2 = Sketch_1.addProjection(model.selection("EDGE", "PartSet/OZ"), False) +SketchLine_2 = SketchProjection_2.createdFeature() +SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchArc_1.startPoint(), SketchLine_2.result()) +SketchConstraintDistanceVertical_1 = Sketch_1.setVerticalDistance(SketchArc_1.startPoint(), SketchAPI_Line(SketchLine_1).startPoint(), 50) +SketchArc_2 = Sketch_1.addArc(38.14157263904823, 16.22495851193372, 56.77054208906745, 0, 34.15529753265601, 40.60522496371553, False) +SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchArc_1.endPoint(), SketchArc_2.startPoint()) +SketchConstraintTangent_1 = Sketch_1.setTangent(SketchArc_1.results()[1], SketchArc_2.results()[1]) +model.do() +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/SketchLine_3")]) +Split_1 = model.addSplit(Part_1_doc, [model.selection("EDGE", "Edge_1_1")], [model.selection("SHELL", "Shell_1_1")]) +model.do() + +model.checkResult(Split_1, model, 1, [3], [0], [0], [3], [6]) +model.testHaveNamingSubshapes(Split_1, model, Part_1_doc) + +model.end() + +assert(model.checkPythonDump()) diff --git a/src/FeaturesPlugin/Test/TestSplitEdgeSolid.py b/src/FeaturesPlugin/Test/TestSplitEdgeSolid.py new file mode 100644 index 000000000..62f071176 --- /dev/null +++ b/src/FeaturesPlugin/Test/TestSplitEdgeSolid.py @@ -0,0 +1,47 @@ +# Copyright (C) 2014-2019 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, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# + +# -*- coding: utf-8 -*- + +from salome.shaper import model + +model.begin() +partSet = model.moduleDocument() +Part_1 = model.addPart(partSet) +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) +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) +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/SketchLine_1")]) +Split_1 = model.addSplit(Part_1_doc, [model.selection("EDGE", "Edge_1_1")], [model.selection("SOLID", "Box_1_1")]) +model.do() + +model.checkResult(Split_1, model, 1, [0], [0], [0], [1], [2]) +model.testHaveNamingSubshapes(Split_1, model, Part_1_doc) + +model.end() + +assert(model.checkPythonDump()) diff --git a/src/FeaturesPlugin/Test/TestSplitEdgeSolidIntersected.py b/src/FeaturesPlugin/Test/TestSplitEdgeSolidIntersected.py new file mode 100644 index 000000000..8a208f26a --- /dev/null +++ b/src/FeaturesPlugin/Test/TestSplitEdgeSolidIntersected.py @@ -0,0 +1,48 @@ +# Copyright (C) 2014-2019 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, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# + +# -*- coding: utf-8 -*- + +from SketchAPI import * + +from salome.shaper import model + +model.begin() +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) +Plane_4 = model.addPlane(Part_1_doc, model.selection("FACE", "Cone_1_1/Face_3"), 5, True) +Sketch_1 = model.addSketch(Part_1_doc, model.selection("FACE", "Plane_1")) +SketchLine_1 = Sketch_1.addLine(-8.679188755740876, 4.967059748203267, 8.679188755740878, -4.967059748203268) +SketchProjection_1 = Sketch_1.addProjection(model.selection("VERTEX", "PartSet/Origin"), False) +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/SketchLine_1")]) +Split_1 = model.addSplit(Part_1_doc, [model.selection("EDGE", "Edge_1_1")], [model.selection("SOLID", "Cone_1_1")]) +model.do() + +model.checkResult(Split_1, model, 1, [3], [0], [0], [3], [6]) +model.testHaveNamingSubshapes(Split_1, model, Part_1_doc) + +model.end() + +assert(model.checkPythonDump()) diff --git a/src/FeaturesPlugin/Test/TestSplitEdgeVertex.py b/src/FeaturesPlugin/Test/TestSplitEdgeVertex.py new file mode 100644 index 000000000..df39f8d16 --- /dev/null +++ b/src/FeaturesPlugin/Test/TestSplitEdgeVertex.py @@ -0,0 +1,46 @@ +# Copyright (C) 2014-2019 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, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# + +# -*- coding: utf-8 -*- + +from SketchAPI import * + +from salome.shaper import model + +model.begin() +partSet = model.moduleDocument() +Part_1 = model.addPart(partSet) +Part_1_doc = Part_1.document() +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) +SketchProjection_1 = Sketch_1.addProjection(model.selection("VERTEX", "Point_1"), False) +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/SketchLine_1")]) +Split_1 = model.addSplit(Part_1_doc, [model.selection("EDGE", "Edge_1_1")], [model.selection("VERTEX", "Vertex_1_1")]) +model.do() +model.checkResult(Split_1,model,1,[2],[0],[0],[2],[4]) +model.testHaveNamingSubshapes(Split_1,model,Part_1_doc) + +model.end() + +assert(model.checkPythonDump()) diff --git a/src/FeaturesPlugin/Test/TestSplitEdgeWire.py b/src/FeaturesPlugin/Test/TestSplitEdgeWire.py new file mode 100644 index 000000000..d72dc816a --- /dev/null +++ b/src/FeaturesPlugin/Test/TestSplitEdgeWire.py @@ -0,0 +1,52 @@ +# Copyright (C) 2014-2019 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, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# + +# -*- coding: utf-8 -*- + +from salome.shaper import model + +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("YOZ")) +SketchLine_1 = Sketch_1.addLine(-67.57764876632801, 2.198838896952097, 88.39332365747461, 44.12336719883891) +model.do() +Sketch_2 = model.addSketch(Part_1_doc, model.defaultPlane("YOZ")) +SketchLine_2 = Sketch_2.addLine(-40.60522496371553, -29.75761973875181, -38.84615384615385, 66.99129172714079) +SketchLine_3 = Sketch_2.addLine(-38.84615384615385, 66.99129172714079, 50.86647314949202, 73.4412191582003) +SketchConstraintCoincidence_1 = Sketch_2.setCoincident(SketchLine_2.endPoint(), SketchLine_3.startPoint()) +SketchLine_4 = Sketch_2.addLine(50.86647314949202, 73.4412191582003, 55.26415094339622, -34.15529753265602) +SketchConstraintCoincidence_2 = Sketch_2.setCoincident(SketchLine_3.endPoint(), SketchLine_4.startPoint()) +SketchLine_5 = Sketch_2.addLine(55.26415094339622, -34.15529753265602, -40.60522496371553, -29.75761973875181) +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/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) +Split_1 = model.addSplit(Part_1_doc, [model.selection("EDGE", "Edge_1_1")], [model.selection("WIRE", "Wire_1_1")]) +model.do() + +model.checkResult(Split_1, model, 1, [3], [0], [0], [3], [6]) +model.testHaveNamingSubshapes(Split_1, model, Part_1_doc) + +model.end() + +assert(model.checkPythonDump()) diff --git a/src/FeaturesPlugin/Test/TestSplitFaceEdge.py b/src/FeaturesPlugin/Test/TestSplitFaceEdge.py new file mode 100644 index 000000000..d0dfa6913 --- /dev/null +++ b/src/FeaturesPlugin/Test/TestSplitFaceEdge.py @@ -0,0 +1,52 @@ +# Copyright (C) 2014-2019 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, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# + +# -*- coding: utf-8 -*- + +from salome.shaper import model + +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("XOZ")) +SketchLine_1 = Sketch_1.addLine(-65.15998142235124, 15.60729985486212, 25.76227082728593, 71.65526357039188) +SketchLine_2 = Sketch_1.addLine(25.76227082728593, 71.65526357039188, 74.75234281567489, -47.08338548621191) +SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchLine_2.startPoint()) +SketchLine_3 = Sketch_1.addLine(74.75234281567489, -47.08338548621191, 13.30716777939044, -81.12733381712628) +SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchLine_2.endPoint(), SketchLine_3.startPoint()) +SketchLine_4 = Sketch_1.addLine(13.30716777939044, -81.12733381712628, -65.15998142235124, 15.60729985486212) +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_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/SketchLine_5")]) +Split_1 = model.addSplit(Part_1_doc, [model.selection("FACE", "Face_1_1")], [model.selection("EDGE", "Edge_1_1")]) +model.do() + +model.checkResult(Split_1,model,1,[2],[0],[2],[8],[16]) +model.testHaveNamingSubshapes(Split_1,model,Part_1_doc) + +model.end() + +assert(model.checkPythonDump()) diff --git a/src/FeaturesPlugin/Test/TestSplitFaceEdgeInside.py b/src/FeaturesPlugin/Test/TestSplitFaceEdgeInside.py new file mode 100644 index 000000000..8e6a64f83 --- /dev/null +++ b/src/FeaturesPlugin/Test/TestSplitFaceEdgeInside.py @@ -0,0 +1,55 @@ +# Copyright (C) 2014-2019 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, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# + +# -*- coding: utf-8 -*- + +from salome.shaper import model + +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")) +SketchArc_1 = Sketch_1.addArc(-31.22351233671988, 15.68505079825835, -49.40058055152394, 17.44412191582002, -17.30100145268062, 27.5029960835475, True) +SketchLine_1 = Sketch_1.addLine(-17.30100145268062, 27.5029960835475, -6.596516690856308, -20.66908563134978) +SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchArc_1.endPoint(), SketchLine_1.startPoint()) +SketchLine_2 = Sketch_1.addLine(-6.596516690856308, -20.66908563134978, -34.74165457184325, -28.87808417997097) +SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchLine_2.startPoint()) +SketchLine_3 = Sketch_1.addLine(-34.74165457184325, -28.87808417997097, -49.40058055152394, 17.44412191582002) +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_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/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/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) +Split_1 = model.addSplit(Part_1_doc, [model.selection("FACE", "Face_1_1")], [model.selection("EDGE", "Edge_1_1")]) +model.do() + +model.checkResult(Split_1,model,1,[0],[0],[1],[5],[10]) +model.testHaveNamingSubshapes(Split_1,model,Part_1_doc) + +model.end() + +assert(model.checkPythonDump()) diff --git a/src/FeaturesPlugin/Test/TestSplitFaceEdgePerpendicular.py b/src/FeaturesPlugin/Test/TestSplitFaceEdgePerpendicular.py new file mode 100644 index 000000000..ab3c668e4 --- /dev/null +++ b/src/FeaturesPlugin/Test/TestSplitFaceEdgePerpendicular.py @@ -0,0 +1,56 @@ +# Copyright (C) 2014-2019 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, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# + +# -*- coding: utf-8 -*- + +from salome.shaper import model + +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")) +SketchLine_1 = Sketch_1.addLine(-27.76647174128943, 72.31029012920524, 42.2686420251427, 59.94944420697596) +SketchLine_2 = Sketch_1.addLine(42.2686420251427, 59.94944420697596, 59.0507718766223, 21.43074552356853) +SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchLine_2.startPoint()) +SketchLine_3 = Sketch_1.addLine(59.0507718766223, 21.43074552356853, 56.1909608273397, -69.919416180974) +SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchLine_2.endPoint(), SketchLine_3.startPoint()) +SketchLine_4 = Sketch_1.addLine(56.1909608273397, -69.919416180974, -29.91225626113892, -65.09334567012574) +SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchLine_3.endPoint(), SketchLine_4.startPoint()) +SketchLine_5 = Sketch_1.addLine(-29.91225626113892, -65.09334567012574, -57.18321726979322, -2.500460309588558) +SketchConstraintCoincidence_4 = Sketch_1.setCoincident(SketchLine_4.endPoint(), SketchLine_5.startPoint()) +SketchLine_6 = Sketch_1.addLine(-57.18321726979322, -2.500460309588558, -27.76647174128943, 72.31029012920524) +SketchConstraintCoincidence_5 = Sketch_1.setCoincident(SketchLine_5.endPoint(), SketchLine_6.startPoint()) +SketchConstraintCoincidence_6 = Sketch_1.setCoincident(SketchLine_6.endPoint(), SketchLine_1.startPoint()) +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/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) +Split_1 = model.addSplit(Part_1_doc, [model.selection("FACE", "Face_1_1")], [model.selection("EDGE", "Edge_1_1")]) +model.do() + +model.checkResult(Split_1,model,1,[0],[0],[1],[6],[13]) +model.testHaveNamingSubshapes(Split_1,model,Part_1_doc) + +model.end() + +assert(model.checkPythonDump()) diff --git a/src/FeaturesPlugin/Test/TestSplitFaceFace.py b/src/FeaturesPlugin/Test/TestSplitFaceFace.py new file mode 100644 index 000000000..63246d207 --- /dev/null +++ b/src/FeaturesPlugin/Test/TestSplitFaceFace.py @@ -0,0 +1,67 @@ +# Copyright (C) 2014-2019 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, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# + +# -*- coding: utf-8 -*- + +from salome.shaper import model + +model.begin() +partSet = model.moduleDocument() +Part_1 = model.addPart(partSet) +Part_1_doc = Part_1.document() +model.addParameter(Part_1_doc, "R", "50") +Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY")) +SketchLine_1 = Sketch_1.addLine(-49.81325699578132, 35.39936274902501, 0, 8.200436015051352) +SketchProjection_1 = Sketch_1.addProjection(model.selection("EDGE", "PartSet/OY"), False) +SketchLine_2 = SketchProjection_1.createdFeature() +SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchLine_2.result()) +SketchLine_3 = Sketch_1.addLine(0, 8.200436015051352, 49.94978427678259, 33.32234621934526) +SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchLine_3.startPoint()) +SketchArc_1 = Sketch_1.addArc(0, 31.08202242513997, 49.94978427678259, 33.32234621934526, -49.81325699578132, 35.39936274902501, False) +SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchLine_3.endPoint(), SketchArc_1.startPoint()) +SketchConstraintCoincidence_4 = Sketch_1.setCoincident(SketchLine_1.startPoint(), SketchArc_1.endPoint()) +SketchConstraintCoincidence_5 = Sketch_1.setCoincident(SketchArc_1.center(), SketchLine_2.result()) +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/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/SketchArc_1"), False) +SketchPoint_2 = SketchProjection_3.createdFeature() +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/Face-SketchLine_1r-SketchLine_3f-SketchArc_1_2f_wire")]) +Face_2 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_2/Face-SketchLine_4r-SketchLine_5f-SketchArc_2_2f_wire")]) +Split_1 = model.addSplit(Part_1_doc, [model.selection("FACE", "Face_1_1")], [model.selection("FACE", "Face_2_1")]) +model.do() + +model.checkResult(Split_1, model, 1, [2], [0], [2], [6], [12]) +model.testHaveNamingSubshapes(Split_1, model, Part_1_doc) + +model.end() + +assert(model.checkPythonDump()) diff --git a/src/FeaturesPlugin/Test/TestSplitFaceShell.py b/src/FeaturesPlugin/Test/TestSplitFaceShell.py new file mode 100644 index 000000000..958986077 --- /dev/null +++ b/src/FeaturesPlugin/Test/TestSplitFaceShell.py @@ -0,0 +1,112 @@ +# Copyright (C) 2014-2019 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, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# + +# -*- coding: utf-8 -*- + +from SketchAPI import * + +from salome.shaper import model + +model.begin() +partSet = model.moduleDocument() +Part_1 = model.addPart(partSet) +Part_1_doc = Part_1.document() +model.addParameter(Part_1_doc, "D", "50") +model.addParameter(Part_1_doc, "L", "30") +Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY")) +SketchLine_1 = Sketch_1.addLine(0, 28.78679656440358, 21.21320343559643, 50) +SketchProjection_1 = Sketch_1.addProjection(model.selection("EDGE", "PartSet/OY"), False) +SketchLine_2 = SketchProjection_1.createdFeature() +SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_1.startPoint(), SketchLine_2.result()) +SketchLine_3 = Sketch_1.addLine(21.21320343559643, 50, 0, 71.21320343559643) +SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchLine_3.startPoint()) +SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchLine_3.endPoint(), SketchLine_2.result()) +SketchLine_4 = Sketch_1.addLine(0, 71.21320343559643, -21.21320343559642, 50) +SketchConstraintCoincidence_4 = Sketch_1.setCoincident(SketchLine_3.endPoint(), SketchLine_4.startPoint()) +SketchLine_5 = Sketch_1.addLine(-21.21320343559642, 50, 0, 28.78679656440358) +SketchConstraintCoincidence_5 = Sketch_1.setCoincident(SketchLine_4.endPoint(), SketchLine_5.startPoint()) +SketchConstraintCoincidence_6 = Sketch_1.setCoincident(SketchLine_1.startPoint(), SketchLine_5.endPoint()) +SketchLine_6 = Sketch_1.addLine(-21.21320343559642, 50, 21.21320343559643, 50) +SketchConstraintCoincidence_7 = Sketch_1.setCoincident(SketchLine_4.endPoint(), SketchLine_6.startPoint()) +SketchConstraintCoincidence_8 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchLine_6.endPoint()) +SketchConstraintDistance_1 = Sketch_1.setDistance(SketchAPI_Line(SketchLine_2).startPoint(), SketchLine_6.result(), "D", True) +SketchConstraintLength_1 = Sketch_1.setLength(SketchLine_1.result(), "L") +SketchConstraintEqual_1 = Sketch_1.setEqual(SketchLine_1.result(), SketchLine_3.result()) +SketchConstraintEqual_2 = Sketch_1.setEqual(SketchLine_3.result(), SketchLine_4.result()) +SketchConstraintEqual_3 = Sketch_1.setEqual(SketchLine_4.result(), SketchLine_5.result()) +SketchConstraintPerpendicular_1 = Sketch_1.setPerpendicular(SketchLine_1.result(), SketchLine_3.result()) +model.do() +Sketch_2 = model.addSketch(Part_1_doc, model.defaultPlane("YOZ")) +SketchProjection_2 = Sketch_2.addProjection(model.selection("VERTEX", "PartSet/Origin"), False) +SketchPoint_1 = SketchProjection_2.createdFeature() +SketchLine_7 = Sketch_2.addLine(50, -39.61510263929618, 50, 43.87280058651025) +SketchLine_7.setName("SketchLine_8") +SketchLine_7.result().setName("SketchLine_8") +SketchLine_7.setAuxiliary(True) +SketchConstraintVertical_1 = Sketch_2.setVertical(SketchLine_7.result()) +SketchConstraintDistance_2 = Sketch_2.setDistance(SketchAPI_Point(SketchPoint_1).coordinates(), SketchLine_7.result(), "D", True) +SketchLine_8 = Sketch_2.addLine(57.5, 0, 65, -10.81485284151855) +SketchLine_8.setName("SketchLine_9") +SketchLine_8.result().setName("SketchLine_9") +SketchProjection_3 = Sketch_2.addProjection(model.selection("EDGE", "PartSet/OY"), False) +SketchLine_9 = SketchProjection_3.createdFeature() +SketchLine_9.setName("SketchLine_10") +SketchLine_9.result().setName("SketchLine_10") +SketchConstraintCoincidence_9 = Sketch_2.setCoincident(SketchLine_8.startPoint(), SketchLine_9.result()) +SketchLine_10 = Sketch_2.addLine(65, -10.81485284151855, 65, 11.50710132369052) +SketchLine_10.setName("SketchLine_11") +SketchLine_10.result().setName("SketchLine_11") +SketchConstraintCoincidence_10 = Sketch_2.setCoincident(SketchLine_8.endPoint(), SketchLine_10.startPoint()) +SketchLine_11 = Sketch_2.addLine(65, 11.50710132369052, 50, 11.50710132369052) +SketchLine_11.setName("SketchLine_12") +SketchLine_11.result().setName("SketchLine_12") +SketchConstraintCoincidence_11 = Sketch_2.setCoincident(SketchLine_10.endPoint(), SketchLine_11.startPoint()) +SketchConstraintCoincidence_12 = Sketch_2.setCoincident(SketchLine_11.endPoint(), SketchLine_7.result()) +SketchConstraintDistance_3 = Sketch_2.setDistance(SketchLine_8.startPoint(), SketchLine_7.result(), "L/4", True) +SketchConstraintDistance_4 = Sketch_2.setDistance(SketchLine_8.endPoint(), SketchLine_7.result(), "L/2", True) +SketchConstraintDistance_5 = Sketch_2.setDistance(SketchLine_10.endPoint(), SketchLine_7.result(), "L/2", True) +SketchConstraintHorizontal_1 = Sketch_2.setHorizontal(SketchLine_11.result()) +SketchConstraintMirror_1_objects = [SketchLine_8.result(), SketchLine_10.result(), SketchLine_11.result()] +SketchConstraintMirror_1 = Sketch_2.addMirror(SketchLine_7.result(), SketchConstraintMirror_1_objects) +[SketchLine_12, SketchLine_13, SketchLine_14] = SketchConstraintMirror_1.mirrored() +SketchLine_14.setName("SketchLine_15") +SketchLine_14.result().setName("SketchLine_15") +SketchLine_13.setName("SketchLine_14") +SketchLine_13.result().setName("SketchLine_14") +SketchLine_12.setName("SketchLine_13") +SketchLine_12.result().setName("SketchLine_13") +SketchLine_15 = Sketch_2.addLine(42.5, 0, 57.5, 0) +SketchLine_15.setName("SketchLine_16") +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/Face-SketchLine_1r-SketchLine_6r-SketchLine_5f_wire")]) +Face_2 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_1/Face-SketchLine_3f-SketchLine_4f-SketchLine_6f_wire")]) +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/Face-SketchLine_9f-SketchLine_11f-SketchLine_12f-SketchLine_15r-SketchLine_14r-SketchLine_13r-SketchLine_16f_wire")]) +Split_1 = model.addSplit(Part_1_doc, [model.selection("FACE", "Face_3_1")], [model.selection("SHELL", "Shell_1_1")]) +model.do() + +model.checkResult(Split_1, model, 1, [3], [0], [3], [14], [28]) +model.testHaveNamingSubshapes(Split_1, model, Part_1_doc) + +model.end() + +assert(model.checkPythonDump()) diff --git a/src/FeaturesPlugin/Test/TestSplitFaceSolid.py b/src/FeaturesPlugin/Test/TestSplitFaceSolid.py new file mode 100644 index 000000000..11b61e8ff --- /dev/null +++ b/src/FeaturesPlugin/Test/TestSplitFaceSolid.py @@ -0,0 +1,61 @@ +# Copyright (C) 2014-2019 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, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# + +# -*- coding: utf-8 -*- + +from SketchAPI import * + +from salome.shaper import model + +model.begin() +partSet = model.moduleDocument() +Part_1 = model.addPart(partSet) +Part_1_doc = Part_1.document() +model.addParameter(Part_1_doc, "L", "10") +model.addParameter(Part_1_doc, "Shift", "5") +Box_1 = model.addBox(Part_1_doc, "L", "L", "L") +Plane_4 = model.addPlane(Part_1_doc, model.selection("FACE", "Box_1_1/Bottom"), "Shift", True) +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) +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) +SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchArc_1.startPoint(), SketchLine_2.startPoint()) +SketchLine_3 = Sketch_1.addLine(0, 5, 0, -12.5) +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()) +SketchConstraintRadius_1 = Sketch_1.setRadius(SketchArc_1.results()[1], "L+Shift/2") +SketchConstraintDistanceVertical_1 = Sketch_1.setVerticalDistance(SketchAPI_Line(SketchLine_1).startPoint(), SketchLine_2.startPoint(), 5) +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/Face-SketchArc_1_2f-SketchLine_2f-SketchLine_3f_wire")]) +Split_1 = model.addSplit(Part_1_doc, [model.selection("FACE", "Face_1_1")], [model.selection("SOLID", "Box_1_1")]) +model.do() + +model.checkResult(Split_1, model, 1, [4], [0], [4], [15], [30]) +model.testHaveNamingSubshapes(Split_1, model, Part_1_doc) + +model.end() + +assert(model.checkPythonDump()) diff --git a/src/FeaturesPlugin/Test/TestSplitFaceVertex.py b/src/FeaturesPlugin/Test/TestSplitFaceVertex.py new file mode 100644 index 000000000..f18749d27 --- /dev/null +++ b/src/FeaturesPlugin/Test/TestSplitFaceVertex.py @@ -0,0 +1,54 @@ +# Copyright (C) 2014-2019 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, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# + +# -*- coding: utf-8 -*- + +from salome.shaper import model + +model.begin() +partSet = model.moduleDocument() +Part_1 = model.addPart(partSet) +Part_1_doc = Part_1.document() +Point_2 = model.addPoint(Part_1_doc, 22, 33, 0) +Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY")) +SketchLine_1 = Sketch_1.addLine(80.77068214804063, 60.54136429608128, -35.9143686502177, 60.54136429608128) +SketchLine_2 = Sketch_1.addLine(-35.9143686502177, 60.54136429608128, -35.9143686502177, -37.67343976777939) +SketchLine_3 = Sketch_1.addLine(-35.9143686502177, -37.67343976777939, 80.77068214804063, -37.67343976777939) +SketchLine_4 = Sketch_1.addLine(80.77068214804063, -37.67343976777939, 80.77068214804063, 60.54136429608128) +SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_4.endPoint(), SketchLine_1.startPoint()) +SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchLine_2.startPoint()) +SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchLine_2.endPoint(), SketchLine_3.startPoint()) +SketchConstraintCoincidence_4 = Sketch_1.setCoincident(SketchLine_3.endPoint(), SketchLine_4.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()) +SketchConstraintVertical_2 = Sketch_1.setVertical(SketchLine_4.result()) +model.do() +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")]) +Split_1 = model.addSplit(Part_1_doc, [model.selection("FACE", "Face_1_1")], [model.selection("VERTEX", "Vertex_1_1")]) +model.do() + +model.checkResult(Split_1,model,1,[0],[0],[1],[4],[9]) +model.testHaveNamingSubshapes(Split_1,model,Part_1_doc) + +model.end() + +assert(model.checkPythonDump()) diff --git a/src/FeaturesPlugin/Test/TestSplitFaceWire.py b/src/FeaturesPlugin/Test/TestSplitFaceWire.py new file mode 100644 index 000000000..8470e912b --- /dev/null +++ b/src/FeaturesPlugin/Test/TestSplitFaceWire.py @@ -0,0 +1,64 @@ +# Copyright (C) 2014-2019 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, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# + +# -*- coding: utf-8 -*- + +from salome.shaper import model + +model.begin() +partSet = model.moduleDocument() +Part_1 = model.addPart(partSet) +Part_1_doc = Part_1.document() +model.addParameter(Part_1_doc, "R", "50") +Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY")) +SketchLine_1 = Sketch_1.addLine(-49.81325699578132, 35.39936274902501, 0, 8.200436015051352) +SketchProjection_1 = Sketch_1.addProjection(model.selection("EDGE", "PartSet/OY"), False) +SketchLine_2 = SketchProjection_1.createdFeature() +SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchLine_2.result()) +SketchLine_3 = Sketch_1.addLine(0, 8.200436015051352, 49.94978427678259, 33.32234621934526) +SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchLine_3.startPoint()) +SketchArc_1 = Sketch_1.addArc(0, 31.08202242513997, 49.94978427678259, 33.32234621934526, -49.81325699578132, 35.39936274902501, False) +SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchLine_3.endPoint(), SketchArc_1.startPoint()) +SketchConstraintCoincidence_4 = Sketch_1.setCoincident(SketchLine_1.startPoint(), SketchArc_1.endPoint()) +SketchConstraintCoincidence_5 = Sketch_1.setCoincident(SketchArc_1.center(), SketchLine_2.result()) +SketchConstraintRadius_1 = Sketch_1.setRadius(SketchArc_1.results()[1], "R") +model.do() +Sketch_2 = model.addSketch(Part_1_doc, model.defaultPlane("XOY")) +SketchLine_4 = Sketch_2.addLine(-42.38833891077762, 73.71572760627062, -18.23994072168525, 7.835320880296757) +SketchLine_5 = Sketch_2.addLine(-18.23994072168525, 7.835320880296757, 13.89341696052619, 27.33089138697832) +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.93732104572751) +SketchConstraintCoincidence_8 = Sketch_2.setCoincident(SketchLine_6.endPoint(), SketchLine_7.startPoint()) +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/Face-SketchLine_1r-SketchLine_3f-SketchArc_1_2f_wire")]) +Wire_1 = model.addWire(Part_1_doc, [model.selection("WIRE", "Sketch_2/Face-SketchLine_4r-SketchLine_5f-SketchLine_6f-SketchLine_7f-SketchLine_8f_wire")]) +Split_1 = model.addSplit(Part_1_doc, [model.selection("FACE", "Face_1_1")], [model.selection("WIRE", "Wire_1_1")]) +model.do() + +model.checkResult(Split_1, model, 1, [5], [0], [5], [21], [42]) +model.testHaveNamingSubshapes(Split_1, model, Part_1_doc) + +model.end() + +assert(model.checkPythonDump()) diff --git a/src/FeaturesPlugin/Test/TestSplitShellConstrPlane.py b/src/FeaturesPlugin/Test/TestSplitShellConstrPlane.py new file mode 100644 index 000000000..fff13d49b --- /dev/null +++ b/src/FeaturesPlugin/Test/TestSplitShellConstrPlane.py @@ -0,0 +1,54 @@ +# Copyright (C) 2014-2019 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, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# + +# -*- coding: utf-8 -*- + +from SketchAPI import * + +from salome.shaper import model + +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("YOZ")) +SketchArc_1 = Sketch_1.addArc(28.24683132290313, 24.84281403912743, 0, 50, 56.77054208906745, 0, False) +SketchProjection_1 = Sketch_1.addProjection(model.selection("EDGE", "PartSet/OY"), False) +SketchLine_1 = SketchProjection_1.createdFeature() +SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_1.result(), SketchArc_1.endPoint()) +SketchProjection_2 = Sketch_1.addProjection(model.selection("EDGE", "PartSet/OZ"), False) +SketchLine_2 = SketchProjection_2.createdFeature() +SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchArc_1.startPoint(), SketchLine_2.result()) +SketchConstraintDistanceVertical_1 = Sketch_1.setVerticalDistance(SketchArc_1.startPoint(), SketchAPI_Line(SketchLine_1).startPoint(), 50) +SketchArc_2 = Sketch_1.addArc(38.14157263904823, 16.22495851193372, 56.77054208906745, 0, 34.15529753265601, 40.60522496371553, False) +SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchArc_1.endPoint(), SketchArc_2.startPoint()) +SketchConstraintTangent_1 = Sketch_1.setTangent(SketchArc_1.results()[1], SketchArc_2.results()[1]) +model.do() +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")]) +Split_1 = model.addSplit(Part_1_doc, [model.selection("SHELL", "Shell_1_1")], [model.selection("FACE", "PartSet/XOZ")]) +model.do() + +model.checkResult(Split_1,model,1,[0],[0],[3],[12],[24]) +model.testHaveNamingSubshapes(Split_1,model,Part_1_doc) + +model.end() + +assert(model.checkPythonDump()) diff --git a/src/FeaturesPlugin/Test/TestSplitShellEdge.py b/src/FeaturesPlugin/Test/TestSplitShellEdge.py new file mode 100644 index 000000000..0cbf86955 --- /dev/null +++ b/src/FeaturesPlugin/Test/TestSplitShellEdge.py @@ -0,0 +1,59 @@ +# Copyright (C) 2014-2019 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, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# + +# -*- coding: utf-8 -*- + +from SketchAPI import * + +from salome.shaper import model + +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("YOZ")) +SketchArc_1 = Sketch_1.addArc(28.24683132290313, 24.84281403912743, 0, 50, 56.77054208906745, 0, False) +SketchProjection_1 = Sketch_1.addProjection(model.selection("EDGE", "PartSet/OY"), False) +SketchLine_1 = SketchProjection_1.createdFeature() +SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_1.result(), SketchArc_1.endPoint()) +SketchProjection_2 = Sketch_1.addProjection(model.selection("EDGE", "PartSet/OZ"), False) +SketchLine_2 = SketchProjection_2.createdFeature() +SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchArc_1.startPoint(), SketchLine_2.result()) +SketchConstraintDistanceVertical_1 = Sketch_1.setVerticalDistance(SketchArc_1.startPoint(), SketchAPI_Line(SketchLine_1).startPoint(), 50) +SketchArc_2 = Sketch_1.addArc(38.14157263904823, 16.22495851193372, 56.77054208906745, 0, 34.15529753265601, 40.60522496371553, False) +SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchArc_1.endPoint(), SketchArc_2.startPoint()) +SketchConstraintTangent_1 = Sketch_1.setTangent(SketchArc_1.results()[1], SketchArc_2.results()[1]) +model.do() +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/SketchLine_3")]) +Split_1 = model.addSplit(Part_1_doc, [model.selection("SHELL", "Shell_1_1")], [model.selection("EDGE", "Edge_1_1")]) +model.do() + +model.checkResult(Split_1,model,1,[0],[0],[2],[8],[18]) +model.testHaveNamingSubshapes(Split_1,model,Part_1_doc) + +model.end() + +assert(model.checkPythonDump()) diff --git a/src/FeaturesPlugin/Test/TestSplitShellFace.py b/src/FeaturesPlugin/Test/TestSplitShellFace.py new file mode 100644 index 000000000..9591f5269 --- /dev/null +++ b/src/FeaturesPlugin/Test/TestSplitShellFace.py @@ -0,0 +1,110 @@ +# Copyright (C) 2014-2019 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, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# + +# -*- coding: utf-8 -*- + +from SketchAPI import * + +from salome.shaper import model + +model.begin() +partSet = model.moduleDocument() +Part_1 = model.addPart(partSet) +Part_1_doc = Part_1.document() +model.addParameter(Part_1_doc, "D", "50") +model.addParameter(Part_1_doc, "L", "30") +Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY")) +SketchLine_1 = Sketch_1.addLine(-6, 29.93619865618197, 18, 47.93619865618197) +SketchProjection_1 = Sketch_1.addProjection(model.selection("EDGE", "PartSet/OY"), False) +SketchLine_2 = SketchProjection_1.createdFeature() +SketchLine_3 = Sketch_1.addLine(18, 47.93619865618197, 0, 71.93619865618197) +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(0, 71.93619865618197, -24, 53.93619865618197) +SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchLine_3.endPoint(), SketchLine_4.startPoint()) +SketchLine_5 = Sketch_1.addLine(-24, 53.93619865618197, -6, 29.93619865618197) +SketchConstraintCoincidence_4 = Sketch_1.setCoincident(SketchLine_4.endPoint(), SketchLine_5.startPoint()) +SketchConstraintCoincidence_5 = Sketch_1.setCoincident(SketchLine_1.startPoint(), SketchLine_5.endPoint()) +SketchLine_6 = Sketch_1.addLine(-24, 53.93619865618197, 18, 47.93619865618197) +SketchConstraintCoincidence_6 = Sketch_1.setCoincident(SketchLine_4.endPoint(), SketchLine_6.startPoint()) +SketchConstraintCoincidence_7 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchLine_6.endPoint()) +SketchConstraintDistance_1 = Sketch_1.setDistance(SketchAPI_Line(SketchLine_2).startPoint(), SketchLine_6.result(), "D", True) +SketchConstraintLength_1 = Sketch_1.setLength(SketchLine_1.result(), "L") +SketchConstraintEqual_1 = Sketch_1.setEqual(SketchLine_1.result(), SketchLine_3.result()) +SketchConstraintEqual_2 = Sketch_1.setEqual(SketchLine_3.result(), SketchLine_4.result()) +SketchConstraintEqual_3 = Sketch_1.setEqual(SketchLine_4.result(), SketchLine_5.result()) +SketchConstraintPerpendicular_1 = Sketch_1.setPerpendicular(SketchLine_1.result(), SketchLine_3.result()) +SketchConstraintDistance_2 = Sketch_1.setDistance(SketchLine_5.endPoint(), SketchLine_2.result(), "L/5", True) +model.do() +Sketch_2 = model.addSketch(Part_1_doc, model.defaultPlane("YOZ")) +SketchProjection_2 = Sketch_2.addProjection(model.selection("VERTEX", "PartSet/Origin"), False) +SketchPoint_1 = SketchProjection_2.createdFeature() +SketchLine_7 = Sketch_2.addLine(50, -39.61510263929618, 50, 43.87280058651025) +SketchLine_7.setName("SketchLine_8") +SketchLine_7.result().setName("SketchLine_8") +SketchLine_7.setAuxiliary(True) +SketchConstraintVertical_1 = Sketch_2.setVertical(SketchLine_7.result()) +SketchConstraintDistance_3 = Sketch_2.setDistance(SketchAPI_Point(SketchPoint_1).coordinates(), SketchLine_7.result(), "D", True) +SketchLine_8 = Sketch_2.addLine(50, -3.170182618622045, 80, -14.17077918941143) +SketchLine_8.setName("SketchLine_9") +SketchLine_8.result().setName("SketchLine_9") +SketchLine_9 = Sketch_2.addLine(80, -14.17077918941143, 64.99999999999999, 12.18920647716607) +SketchLine_9.setName("SketchLine_11") +SketchLine_9.result().setName("SketchLine_11") +SketchConstraintCoincidence_8 = Sketch_2.setCoincident(SketchLine_8.endPoint(), SketchLine_9.startPoint()) +SketchConstraintCoincidence_8.setName("SketchConstraintCoincidence_9") +SketchLine_10 = Sketch_2.addLine(64.99999999999999, 12.18920647716607, 50, 12.18920647716607) +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()) +SketchConstraintMirror_1_objects = [SketchLine_8.result(), SketchLine_9.result(), SketchLine_10.result()] +SketchConstraintMirror_1 = Sketch_2.addMirror(SketchLine_7.result(), SketchConstraintMirror_1_objects) +[SketchLine_11, SketchLine_12, SketchLine_13] = SketchConstraintMirror_1.mirrored() +SketchLine_13.setName("SketchLine_15") +SketchLine_13.result().setName("SketchLine_15") +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/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/Face-SketchLine_1r-SketchLine_6r-SketchLine_5f_wire")]) +Face_2 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_1/Face-SketchLine_3f-SketchLine_4f-SketchLine_6f_wire")]) +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/Face-SketchLine_9f-SketchLine_11f-SketchLine_12f-SketchLine_15r-SketchLine_14r-SketchLine_13r_wire")]) +Split_1 = model.addSplit(Part_1_doc, [model.selection("SHELL", "Shell_1_1")], [model.selection("FACE", "Face_3_1")]) +model.do() + +model.checkResult(Split_1, model, 1, [0], [0], [4], [13], [26]) +model.testHaveNamingSubshapes(Split_1, model, Part_1_doc) + +model.end() + +assert(model.checkPythonDump()) diff --git a/src/FeaturesPlugin/Test/TestSplitShellShell.py b/src/FeaturesPlugin/Test/TestSplitShellShell.py new file mode 100644 index 000000000..e9f7aae53 --- /dev/null +++ b/src/FeaturesPlugin/Test/TestSplitShellShell.py @@ -0,0 +1,90 @@ +# Copyright (C) 2014-2019 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, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# + +# -*- coding: utf-8 -*- + +from SketchAPI import * + +from salome.shaper import model + +model.begin() +partSet = model.moduleDocument() +Part_1 = model.addPart(partSet) +Part_1_doc = Part_1.document() +model.addParameter(Part_1_doc, "D", "50") +model.addParameter(Part_1_doc, "L", "30") +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-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-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()) +SketchConstraintCoincidence_5 = Sketch_1.setCoincident(SketchLine_1.startPoint(), SketchLine_5.endPoint()) +SketchLine_6 = Sketch_1.addLine(-25.61552812810082, 57.66225366792627, 15.61552812808831, 47.66225366793383) +SketchConstraintCoincidence_6 = Sketch_1.setCoincident(SketchLine_4.endPoint(), SketchLine_6.startPoint()) +SketchConstraintCoincidence_7 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchLine_6.endPoint()) +SketchConstraintDistance_1 = Sketch_1.setDistance(SketchAPI_Line(SketchLine_2).startPoint(), SketchLine_6.result(), "D", True) +SketchConstraintLength_1 = Sketch_1.setLength(SketchLine_1.result(), "L") +SketchConstraintEqual_1 = Sketch_1.setEqual(SketchLine_1.result(), SketchLine_3.result()) +SketchConstraintEqual_2 = Sketch_1.setEqual(SketchLine_3.result(), SketchLine_4.result()) +SketchConstraintEqual_3 = Sketch_1.setEqual(SketchLine_4.result(), SketchLine_5.result()) +SketchConstraintPerpendicular_1 = Sketch_1.setPerpendicular(SketchLine_1.result(), SketchLine_3.result()) +SketchConstraintDistance_2 = Sketch_1.setDistance(SketchLine_5.endPoint(), SketchLine_2.result(), "L/3", True) +model.do() +Sketch_2 = model.addSketch(Part_1_doc, model.defaultPlane("YOZ")) +SketchLine_7 = Sketch_2.addLine(50, 15.56025031353752, 50, -15.54016280334104) +SketchLine_8 = Sketch_2.addLine(50, -15.54016280334104, 36.52981427174974, 0) +SketchConstraintCoincidence_8 = Sketch_2.setCoincident(SketchLine_7.endPoint(), SketchLine_8.startPoint()) +SketchProjection_2 = Sketch_2.addProjection(model.selection("EDGE", "PartSet/OY"), False) +SketchLine_9 = SketchProjection_2.createdFeature() +SketchConstraintCoincidence_9 = Sketch_2.setCoincident(SketchLine_8.endPoint(), SketchLine_9.result()) +SketchLine_10 = Sketch_2.addLine(36.52981427174974, 0, 50, 15.56025031353752) +SketchConstraintCoincidence_10 = Sketch_2.setCoincident(SketchLine_8.endPoint(), SketchLine_10.startPoint()) +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/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) +SketchConstraintCoincidence_14 = Sketch_2.setCoincident(SketchLine_11.endPoint(), SketchLine_12.startPoint()) +SketchConstraintCoincidence_15 = Sketch_2.setCoincident(SketchLine_7.endPoint(), SketchLine_12.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/Face-SketchLine_1r-SketchLine_6r-SketchLine_5f_wire")]) +Face_2 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_1/Face-SketchLine_3f-SketchLine_4f-SketchLine_6f_wire")]) +Face_3 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_2/Face-SketchLine_10r-SketchLine_8r-SketchLine_7r_wire")]) +Face_4 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_2/Face-SketchLine_7r-SketchLine_12r-SketchLine_11r_wire")]) +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")]) +Split_1 = model.addSplit(Part_1_doc, [model.selection("SHELL", "Shell_1_1")], [model.selection("SHELL", "Shell_2_1")]) +model.do() + +model.checkResult(Split_1, model, 1, [0], [0], [4], [15], [30]) +model.testHaveNamingSubshapes(Split_1, model, Part_1_doc) + +model.end() + +assert(model.checkPythonDump()) diff --git a/src/FeaturesPlugin/Test/TestSplitShellSolid.py b/src/FeaturesPlugin/Test/TestSplitShellSolid.py new file mode 100644 index 000000000..7170826b9 --- /dev/null +++ b/src/FeaturesPlugin/Test/TestSplitShellSolid.py @@ -0,0 +1,64 @@ +# Copyright (C) 2014-2019 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, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# + +# -*- coding: utf-8 -*- + +from SketchAPI import * + +from salome.shaper import model + +model.begin() +partSet = model.moduleDocument() +Part_1 = model.addPart(partSet) +Part_1_doc = Part_1.document() +model.addParameter(Part_1_doc, "L", "10") +model.addParameter(Part_1_doc, "Shift", "5") +Box_1 = model.addBox(Part_1_doc, "L", "L", "L") +Plane_4 = model.addPlane(Part_1_doc, model.selection("FACE", "Box_1_1/Bottom"), "Shift", True) +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) +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) +SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchArc_1.startPoint(), SketchLine_2.startPoint()) +SketchLine_3 = Sketch_1.addLine(0, 5, 0, -12.5) +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()) +SketchConstraintRadius_1 = Sketch_1.setRadius(SketchArc_1.results()[1], "L+Shift/2") +SketchConstraintDistanceVertical_1 = Sketch_1.setVerticalDistance(SketchAPI_Line(SketchLine_1).startPoint(), SketchLine_2.startPoint(), 5) +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/Face-SketchArc_1_2f-SketchLine_2f-SketchLine_3f_wire")]) +Split_1 = model.addSplit(Part_1_doc, [model.selection("FACE", "Face_1_1")], [model.selection("FACE", "Plane_2")]) +Shell_1 = model.addShell(Part_1_doc, [model.selection("FACE", "Split_1_1_2"), model.selection("FACE", "Split_1_1_1")]) +Split_2 = model.addSplit(Part_1_doc, [model.selection("SHELL", "Shell_1_1")], [model.selection("SOLID", "Box_1_1")]) +model.do() + +model.checkResult(Split_2, model, 1, [0], [0], [6], [22], [44]) +model.testHaveNamingSubshapes(Split_2, model, Part_1_doc) + +model.end() + +assert(model.checkPythonDump()) diff --git a/src/FeaturesPlugin/Test/TestSplitShellVertex.py b/src/FeaturesPlugin/Test/TestSplitShellVertex.py new file mode 100644 index 000000000..962661df8 --- /dev/null +++ b/src/FeaturesPlugin/Test/TestSplitShellVertex.py @@ -0,0 +1,52 @@ +# Copyright (C) 2014-2019 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, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# + +# -*- coding: utf-8 -*- + +from SketchAPI import * + +from salome.shaper import model + +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")) +SketchArc_1 = Sketch_1.addArc(9.761379814097372, -58.25586643592183, 0, 0, -48.40807467084933, -47.99209154562215, False) +SketchArc_2 = Sketch_1.addArc(-12.6706171814691, -54.29782746957817, -48.40807467084933, -47.99209154562215, 12.46009047944227, -80.47750863283412, False) +SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchArc_1.endPoint(), SketchArc_2.startPoint()) +SketchConstraintTangent_1 = Sketch_1.setTangent(SketchArc_1.results()[1], SketchArc_2.results()[1]) +SketchProjection_1 = Sketch_1.addProjection(model.selection("VERTEX", "PartSet/Origin"), False) +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/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")]) +Split_1 = model.addSplit(Part_1_doc, [model.selection("SHELL", "Shell_1_1")], [model.selection("VERTEX", "Vertex_1_1")]) +model.do() + +model.checkResult(Split_1,model,1,[0],[0],[2],[9],[18]) +model.testHaveNamingSubshapes(Split_1,model,Part_1_doc) + +model.end() + +assert(model.checkPythonDump()) diff --git a/src/FeaturesPlugin/Test/TestSplitShellWire.py b/src/FeaturesPlugin/Test/TestSplitShellWire.py new file mode 100644 index 000000000..9f0783234 --- /dev/null +++ b/src/FeaturesPlugin/Test/TestSplitShellWire.py @@ -0,0 +1,87 @@ +# Copyright (C) 2014-2019 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, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# + +# -*- coding: utf-8 -*- + +from SketchAPI import * + +from salome.shaper import model + +model.begin() +partSet = model.moduleDocument() +Part_1 = model.addPart(partSet) +Part_1_doc = Part_1.document() +model.addParameter(Part_1_doc, "D", "50") +model.addParameter(Part_1_doc, "L", "30") +Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY")) +SketchLine_1 = Sketch_1.addLine(0, 28.78679656440358, 21.21320343559643, 50) +SketchProjection_1 = Sketch_1.addProjection(model.selection("EDGE", "PartSet/OY"), False) +SketchLine_2 = SketchProjection_1.createdFeature() +SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_1.startPoint(), SketchLine_2.result()) +SketchLine_3 = Sketch_1.addLine(21.21320343559643, 50, 0, 71.21320343559643) +SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchLine_3.startPoint()) +SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchLine_3.endPoint(), SketchLine_2.result()) +SketchLine_4 = Sketch_1.addLine(0, 71.21320343559643, -21.21320343559642, 50) +SketchConstraintCoincidence_4 = Sketch_1.setCoincident(SketchLine_3.endPoint(), SketchLine_4.startPoint()) +SketchLine_5 = Sketch_1.addLine(-21.21320343559642, 50, 0, 28.78679656440358) +SketchConstraintCoincidence_5 = Sketch_1.setCoincident(SketchLine_4.endPoint(), SketchLine_5.startPoint()) +SketchConstraintCoincidence_6 = Sketch_1.setCoincident(SketchLine_1.startPoint(), SketchLine_5.endPoint()) +SketchLine_6 = Sketch_1.addLine(-21.21320343559642, 50, 21.21320343559643, 50) +SketchConstraintCoincidence_7 = Sketch_1.setCoincident(SketchLine_4.endPoint(), SketchLine_6.startPoint()) +SketchConstraintCoincidence_8 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchLine_6.endPoint()) +SketchConstraintDistance_1 = Sketch_1.setDistance(SketchAPI_Line(SketchLine_2).startPoint(), SketchLine_6.result(), "D", True) +SketchConstraintLength_1 = Sketch_1.setLength(SketchLine_1.result(), "L") +SketchConstraintEqual_1 = Sketch_1.setEqual(SketchLine_1.result(), SketchLine_3.result()) +SketchConstraintEqual_2 = Sketch_1.setEqual(SketchLine_3.result(), SketchLine_4.result()) +SketchConstraintEqual_3 = Sketch_1.setEqual(SketchLine_4.result(), SketchLine_5.result()) +SketchConstraintPerpendicular_1 = Sketch_1.setPerpendicular(SketchLine_1.result(), SketchLine_3.result()) +model.do() +Sketch_2 = model.addSketch(Part_1_doc, model.defaultPlane("XOY")) +SketchLine_7 = Sketch_2.addLine(-14.33356820392057, 60, 15.66643179607943, 60) +SketchLine_8 = Sketch_2.addLine(15.66643179607943, 60, 15.66643179607943, 30) +SketchLine_9 = Sketch_2.addLine(15.66643179607943, 30, -14.33356820392057, 30) +SketchLine_10 = Sketch_2.addLine(-14.33356820392057, 30, -14.33356820392057, 60) +SketchConstraintCoincidence_9 = Sketch_2.setCoincident(SketchLine_10.endPoint(), SketchLine_7.startPoint()) +SketchConstraintCoincidence_10 = Sketch_2.setCoincident(SketchLine_7.endPoint(), SketchLine_8.startPoint()) +SketchConstraintCoincidence_11 = Sketch_2.setCoincident(SketchLine_8.endPoint(), SketchLine_9.startPoint()) +SketchConstraintCoincidence_12 = Sketch_2.setCoincident(SketchLine_9.endPoint(), SketchLine_10.startPoint()) +SketchConstraintHorizontal_1 = Sketch_2.setHorizontal(SketchLine_7.result()) +SketchConstraintVertical_1 = Sketch_2.setVertical(SketchLine_8.result()) +SketchConstraintHorizontal_2 = Sketch_2.setHorizontal(SketchLine_9.result()) +SketchConstraintVertical_2 = Sketch_2.setVertical(SketchLine_10.result()) +SketchConstraintLength_2 = Sketch_2.setLength(SketchLine_9.result(), "L") +SketchConstraintLength_3 = Sketch_2.setLength(SketchLine_8.result(), "L") +SketchProjection_2 = Sketch_2.addProjection(model.selection("VERTEX", "PartSet/Origin"), False) +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/Face-SketchLine_1r-SketchLine_6r-SketchLine_5f_wire")]) +Face_2 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_1/Face-SketchLine_3f-SketchLine_4f-SketchLine_6f_wire")]) +Shell_1 = model.addShell(Part_1_doc, [model.selection("FACE", "Face_1_1"), model.selection("FACE", "Face_2_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) +Split_1 = model.addSplit(Part_1_doc, [model.selection("SHELL", "Shell_1_1")], [model.selection("WIRE", "Wire_1_1")]) +model.do() + +model.checkResult(Split_1, model, 1, [0], [0], [8], [30], [60]) +model.testHaveNamingSubshapes(Split_1, model, Part_1_doc) + +model.end() + +assert(model.checkPythonDump()) diff --git a/src/FeaturesPlugin/Test/TestSplitSolid2ConstructionPlanes.py b/src/FeaturesPlugin/Test/TestSplitSolid2ConstructionPlanes.py new file mode 100644 index 000000000..d542ae0fb --- /dev/null +++ b/src/FeaturesPlugin/Test/TestSplitSolid2ConstructionPlanes.py @@ -0,0 +1,37 @@ +# Copyright (C) 2014-2019 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, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# + +# -*- coding: utf-8 -*- + +from salome.shaper import model + +model.begin() +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) +Split_1 = model.addSplit(Part_1_doc, [model.selection("SOLID", "Cone_1_1")], [model.selection("FACE", "PartSet/YOZ"), model.selection("FACE", "PartSet/XOZ")]) +model.do() + +model.checkResult(Split_1,model,1,[4],[4],[20],[72],[144]) +model.testHaveNamingSubshapes(Split_1,model,Part_1_doc) + +model.end() + +assert(model.checkPythonDump()) diff --git a/src/FeaturesPlugin/Test/TestSplitSolidCompFace.py b/src/FeaturesPlugin/Test/TestSplitSolidCompFace.py new file mode 100644 index 000000000..d4fb49d9d --- /dev/null +++ b/src/FeaturesPlugin/Test/TestSplitSolidCompFace.py @@ -0,0 +1,63 @@ +# Copyright (C) 2014-2019 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, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# + +# -*- coding: utf-8 -*- + +from SketchAPI import * + +from salome.shaper import model + +model.begin() +partSet = model.moduleDocument() +Part_1 = model.addPart(partSet) +Part_1_doc = Part_1.document() +model.addParameter(Part_1_doc, "L", "10") +model.addParameter(Part_1_doc, "Shift", "12") +Box_1 = model.addBox(Part_1_doc, "L", "L", "L") +Plane_4 = model.addPlane(Part_1_doc, model.selection("FACE", "Box_1_1/Bottom"), "L/2", True) +Sketch_1 = model.addSketch(Part_1_doc, model.selection("FACE", "Plane_1")) +SketchProjection_1 = Sketch_1.addProjection(model.selection("VERTEX", "PartSet/Origin"), False) +SketchPoint_1 = SketchProjection_1.createdFeature() +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(15.49193338482974, -4, 0, 12) +SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchArc_1.startPoint(), SketchLine_2.startPoint()) +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()) +SketchConstraintRadius_1 = Sketch_1.setRadius(SketchArc_1.results()[1], "L+Shift/2") +SketchConstraintDistanceVertical_1 = Sketch_1.setVerticalDistance(SketchAPI_Line(SketchLine_1).startPoint(), SketchLine_2.startPoint(), "Shift/3") +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/Face-SketchArc_1_2f-SketchLine_2f-SketchLine_3f_wire")]) +Split_1 = model.addSplit(Part_1_doc, [model.selection("FACE", "Face_1_1")], [model.selection("FACE", "Plane_2")]) +Split_2 = model.addSplit(Part_1_doc, [model.selection("SOLID", "Box_1_1")], [model.selection("COMPOUND", "Split_1_1")]) +model.do() + +model.checkResult(Split_2, model, 1, [2], [2], [14], [60], [120]) +model.testHaveNamingSubshapes(Split_2, model, Part_1_doc) + +model.end() + +assert(model.checkPythonDump()) diff --git a/src/FeaturesPlugin/Test/TestSplitSolidCompShell.py b/src/FeaturesPlugin/Test/TestSplitSolidCompShell.py new file mode 100644 index 000000000..cbfcf0aaa --- /dev/null +++ b/src/FeaturesPlugin/Test/TestSplitSolidCompShell.py @@ -0,0 +1,65 @@ +# Copyright (C) 2014-2019 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, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# + +# -*- coding: utf-8 -*- + +from SketchAPI import * + +from salome.shaper import model + +model.begin() +partSet = model.moduleDocument() +Part_1 = model.addPart(partSet) +Part_1_doc = Part_1.document() +model.addParameter(Part_1_doc, "L", "10") +model.addParameter(Part_1_doc, "Shift", "12") +Box_1 = model.addBox(Part_1_doc, "L", "L", "L") +Plane_4 = model.addPlane(Part_1_doc, model.selection("FACE", "Box_1_1/Bottom"), "L/2", True) +Sketch_1 = model.addSketch(Part_1_doc, model.selection("FACE", "Plane_1")) +SketchProjection_1 = Sketch_1.addProjection(model.selection("VERTEX", "PartSet/Origin"), False) +SketchPoint_1 = SketchProjection_1.createdFeature() +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(15.49193338482974, -4, 0, 12) +SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchArc_1.startPoint(), SketchLine_2.startPoint()) +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()) +SketchConstraintRadius_1 = Sketch_1.setRadius(SketchArc_1.results()[1], "L+Shift/2") +SketchConstraintDistanceVertical_1 = Sketch_1.setVerticalDistance(SketchAPI_Line(SketchLine_1).startPoint(), SketchLine_2.startPoint(), "Shift/3") +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/Face-SketchArc_1_2f-SketchLine_2f-SketchLine_3f_wire")]) +Split_1 = model.addSplit(Part_1_doc, [model.selection("FACE", "Face_1_1")], [model.selection("FACE", "Plane_2")]) +Shell_1 = model.addShell(Part_1_doc, [model.selection("FACE", "Split_1_1_2"), model.selection("FACE", "Split_1_1_1")]) +LinearCopy_1 = model.addMultiTranslation(Part_1_doc, [model.selection("SHELL", "Shell_1_1")], model.selection("EDGE", "PartSet/OZ"), 1, 3) +Split_2 = model.addSplit(Part_1_doc, [model.selection("SOLID", "Box_1_1")], [model.selection("COMPOUND", "LinearCopy_1_1")]) +model.do() + +model.checkResult(Split_2, model, 1, [4], [4], [30], [132], [264]) +model.testHaveNamingSubshapes(Split_2, model, Part_1_doc) + +model.end() + +assert(model.checkPythonDump()) diff --git a/src/FeaturesPlugin/Test/TestSplitSolidFace.py b/src/FeaturesPlugin/Test/TestSplitSolidFace.py new file mode 100644 index 000000000..5bddf0679 --- /dev/null +++ b/src/FeaturesPlugin/Test/TestSplitSolidFace.py @@ -0,0 +1,61 @@ +# Copyright (C) 2014-2019 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, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# + +# -*- coding: utf-8 -*- + +from SketchAPI import * + +from salome.shaper import model + +model.begin() +partSet = model.moduleDocument() +Part_1 = model.addPart(partSet) +Part_1_doc = Part_1.document() +model.addParameter(Part_1_doc, "L", "10") +model.addParameter(Part_1_doc, "Shift", "12") +Box_1 = model.addBox(Part_1_doc, "L", "L", "L") +Plane_4 = model.addPlane(Part_1_doc, model.selection("FACE", "Box_1_1/Bottom"), "L/2", True) +Sketch_1 = model.addSketch(Part_1_doc, model.selection("FACE", "Plane_1")) +SketchProjection_1 = Sketch_1.addProjection(model.selection("VERTEX", "PartSet/Origin"), False) +SketchPoint_1 = SketchProjection_1.createdFeature() +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(15.49193338482974, -4, 0, 12) +SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchArc_1.startPoint(), SketchLine_2.startPoint()) +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()) +SketchConstraintRadius_1 = Sketch_1.setRadius(SketchArc_1.results()[1], "L+Shift/2") +SketchConstraintDistanceVertical_1 = Sketch_1.setVerticalDistance(SketchAPI_Line(SketchLine_1).startPoint(), SketchLine_2.startPoint(), "Shift/3") +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/Face-SketchArc_1_2f-SketchLine_2f-SketchLine_3f_wire")]) +Split_1 = model.addSplit(Part_1_doc, [model.selection("SOLID", "Box_1_1")], [model.selection("FACE", "Face_1_1")]) +model.do() + +model.checkResult(Split_1, model, 1, [2], [2], [12], [48], [96]) +model.testHaveNamingSubshapes(Split_1, model, Part_1_doc) + +model.end() + +assert(model.checkPythonDump()) diff --git a/src/FeaturesPlugin/Test/TestSplitSolidShell.py b/src/FeaturesPlugin/Test/TestSplitSolidShell.py new file mode 100644 index 000000000..2a45ab6e9 --- /dev/null +++ b/src/FeaturesPlugin/Test/TestSplitSolidShell.py @@ -0,0 +1,64 @@ +# Copyright (C) 2014-2019 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, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# + +# -*- coding: utf-8 -*- + +from SketchAPI import * + +from salome.shaper import model + +model.begin() +partSet = model.moduleDocument() +Part_1 = model.addPart(partSet) +Part_1_doc = Part_1.document() +model.addParameter(Part_1_doc, "L", "10") +model.addParameter(Part_1_doc, "Shift", "12") +Box_1 = model.addBox(Part_1_doc, "L", "L", "L") +Plane_4 = model.addPlane(Part_1_doc, model.selection("FACE", "Box_1_1/Bottom"), "L/2", True) +Sketch_1 = model.addSketch(Part_1_doc, model.selection("FACE", "Plane_1")) +SketchProjection_1 = Sketch_1.addProjection(model.selection("VERTEX", "PartSet/Origin"), False) +SketchPoint_1 = SketchProjection_1.createdFeature() +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(15.49193338482974, -4, 0, 12) +SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchArc_1.startPoint(), SketchLine_2.startPoint()) +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()) +SketchConstraintRadius_1 = Sketch_1.setRadius(SketchArc_1.results()[1], "L+Shift/2") +SketchConstraintDistanceVertical_1 = Sketch_1.setVerticalDistance(SketchAPI_Line(SketchLine_1).startPoint(), SketchLine_2.startPoint(), "Shift/3") +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/Face-SketchArc_1_2f-SketchLine_2f-SketchLine_3f_wire")]) +Split_1 = model.addSplit(Part_1_doc, [model.selection("FACE", "Face_1_1")], [model.selection("FACE", "Plane_2")]) +Shell_1 = model.addShell(Part_1_doc, [model.selection("FACE", "Split_1_1_2"), model.selection("FACE", "Split_1_1_1")]) +Split_2 = model.addSplit(Part_1_doc, [model.selection("SOLID", "Box_1_1")], [model.selection("SHELL", "Shell_1_1")]) +model.do() + +model.checkResult(Split_2, model, 1, [2], [2], [14], [60], [120]) +model.testHaveNamingSubshapes(Split_2, model, Part_1_doc) + +model.end() + +assert(model.checkPythonDump()) diff --git a/src/FeaturesPlugin/Test/TestSplitWireEdge.py b/src/FeaturesPlugin/Test/TestSplitWireEdge.py new file mode 100644 index 000000000..d7fa3d998 --- /dev/null +++ b/src/FeaturesPlugin/Test/TestSplitWireEdge.py @@ -0,0 +1,52 @@ +# Copyright (C) 2014-2019 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, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# + +# -*- coding: utf-8 -*- + +from salome.shaper import model + +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("YOZ")) +SketchLine_1 = Sketch_1.addLine(-67.57764876632801, 2.198838896952097, 88.39332365747461, 44.12336719883891) +model.do() +Sketch_2 = model.addSketch(Part_1_doc, model.defaultPlane("YOZ")) +SketchLine_2 = Sketch_2.addLine(-40.60522496371553, -29.75761973875181, -38.84615384615385, 66.99129172714079) +SketchLine_3 = Sketch_2.addLine(-38.84615384615385, 66.99129172714079, 50.86647314949202, 73.4412191582003) +SketchConstraintCoincidence_1 = Sketch_2.setCoincident(SketchLine_2.endPoint(), SketchLine_3.startPoint()) +SketchLine_4 = Sketch_2.addLine(50.86647314949202, 73.4412191582003, 55.26415094339622, -34.15529753265602) +SketchConstraintCoincidence_2 = Sketch_2.setCoincident(SketchLine_3.endPoint(), SketchLine_4.startPoint()) +SketchLine_5 = Sketch_2.addLine(55.26415094339622, -34.15529753265602, -40.60522496371553, -29.75761973875181) +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/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) +Split_1 = model.addSplit(Part_1_doc, [model.selection("WIRE", "Wire_1_1")], [model.selection("EDGE", "Edge_1_1")]) +model.do() + +model.checkResult(Split_1,model,1,[0],[0],[0],[6],[12]) +model.testHaveNamingSubshapes(Split_1,model,Part_1_doc) + +model.end() + +assert(model.checkPythonDump()) diff --git a/src/FeaturesPlugin/Test/TestSplitWireFace.py b/src/FeaturesPlugin/Test/TestSplitWireFace.py new file mode 100644 index 000000000..fc2588bdb --- /dev/null +++ b/src/FeaturesPlugin/Test/TestSplitWireFace.py @@ -0,0 +1,70 @@ +# Copyright (C) 2014-2019 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, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# + +# -*- coding: utf-8 -*- + +from salome.shaper import model + +model.begin() +partSet = model.moduleDocument() +Part_1 = model.addPart(partSet) +Part_1_doc = Part_1.document() +model.addParameter(Part_1_doc, "R", "50") +Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY")) +SketchLine_1 = Sketch_1.addLine(-49.81325699578132, 35.39936274902501, 0, 8.200436015051352) +SketchProjection_1 = Sketch_1.addProjection(model.selection("EDGE", "PartSet/OY"), False) +SketchLine_2 = SketchProjection_1.createdFeature() +SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchLine_2.result()) +SketchLine_3 = Sketch_1.addLine(0, 8.200436015051352, 49.94978427678259, 33.32234621934526) +SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchLine_3.startPoint()) +SketchArc_1 = Sketch_1.addArc(0, 31.08202242513997, 49.94978427678259, 33.32234621934526, -49.81325699578132, 35.39936274902501, False) +SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchLine_3.endPoint(), SketchArc_1.startPoint()) +SketchConstraintCoincidence_4 = Sketch_1.setCoincident(SketchLine_1.startPoint(), SketchArc_1.endPoint()) +SketchConstraintCoincidence_5 = Sketch_1.setCoincident(SketchArc_1.center(), SketchLine_2.result()) +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/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) +SketchConstraintCoincidence_7 = Sketch_2.setCoincident(SketchLine_4.endPoint(), SketchLine_5.startPoint()) +SketchProjection_3 = Sketch_2.addProjection(model.selection("EDGE", "PartSet/OY"), False) +SketchLine_6 = SketchProjection_3.createdFeature() +SketchConstraintCoincidence_8 = Sketch_2.setCoincident(SketchLine_5.endPoint(), SketchLine_6.result()) +SketchLine_7 = Sketch_2.addLine(45.45797599933665, 0, 45.83553599350717, -22.747645239555) +SketchConstraintCoincidence_9 = Sketch_2.setCoincident(SketchLine_5.endPoint(), SketchLine_7.startPoint()) +SketchLine_8 = Sketch_2.addLine(45.83553599350717, -22.747645239555, 70.40999925541598, 30.039147749218) +SketchConstraintCoincidence_10 = Sketch_2.setCoincident(SketchLine_7.endPoint(), SketchLine_8.startPoint()) +SketchLine_9 = Sketch_2.addLine(70.40999925541598, 30.039147749218, 29.74624907439609, 30.07487215963349) +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/Face-SketchLine_1r-SketchLine_3f-SketchArc_1_2f_wire")]) +Wire_1 = model.addWire(Part_1_doc, [model.selection("WIRE", "Sketch_2/Face-SketchLine_4r-SketchLine_5f-SketchLine_7f-SketchLine_8f-SketchLine_9f_wire")]) +Split_1 = model.addSplit(Part_1_doc, [model.selection("WIRE", "Wire_1_1")], [model.selection("FACE", "Face_1_1")]) +model.do() + +model.checkResult(Split_1, model, 1, [0], [0], [0], [6], [12]) +model.testHaveNamingSubshapes(Split_1, model, Part_1_doc) + +model.end() + +assert(model.checkPythonDump()) diff --git a/src/FeaturesPlugin/Test/TestSplitWireShell.py b/src/FeaturesPlugin/Test/TestSplitWireShell.py new file mode 100644 index 000000000..fc6b66e60 --- /dev/null +++ b/src/FeaturesPlugin/Test/TestSplitWireShell.py @@ -0,0 +1,112 @@ +# Copyright (C) 2014-2019 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, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# + +# -*- coding: utf-8 -*- + +from SketchAPI import * + +from salome.shaper import model + +model.begin() +partSet = model.moduleDocument() +Part_1 = model.addPart(partSet) +Part_1_doc = Part_1.document() +model.addParameter(Part_1_doc, "D", "50") +model.addParameter(Part_1_doc, "L", "30") +Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY")) +SketchLine_1 = Sketch_1.addLine(0, 28.78679656440358, 21.21320343559643, 50) +SketchProjection_1 = Sketch_1.addProjection(model.selection("EDGE", "PartSet/OY"), False) +SketchLine_2 = SketchProjection_1.createdFeature() +SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_1.startPoint(), SketchLine_2.result()) +SketchLine_3 = Sketch_1.addLine(21.21320343559643, 50, 0, 71.21320343559643) +SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchLine_3.startPoint()) +SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchLine_3.endPoint(), SketchLine_2.result()) +SketchLine_4 = Sketch_1.addLine(0, 71.21320343559643, -21.21320343559642, 50) +SketchConstraintCoincidence_4 = Sketch_1.setCoincident(SketchLine_3.endPoint(), SketchLine_4.startPoint()) +SketchLine_5 = Sketch_1.addLine(-21.21320343559642, 50, 0, 28.78679656440358) +SketchConstraintCoincidence_5 = Sketch_1.setCoincident(SketchLine_4.endPoint(), SketchLine_5.startPoint()) +SketchConstraintCoincidence_6 = Sketch_1.setCoincident(SketchLine_1.startPoint(), SketchLine_5.endPoint()) +SketchLine_6 = Sketch_1.addLine(-21.21320343559642, 50, 21.21320343559643, 50) +SketchConstraintCoincidence_7 = Sketch_1.setCoincident(SketchLine_4.endPoint(), SketchLine_6.startPoint()) +SketchConstraintCoincidence_8 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchLine_6.endPoint()) +SketchConstraintDistance_1 = Sketch_1.setDistance(SketchAPI_Line(SketchLine_2).startPoint(), SketchLine_6.result(), "D", True) +SketchConstraintLength_1 = Sketch_1.setLength(SketchLine_1.result(), "L") +SketchConstraintEqual_1 = Sketch_1.setEqual(SketchLine_1.result(), SketchLine_3.result()) +SketchConstraintEqual_2 = Sketch_1.setEqual(SketchLine_3.result(), SketchLine_4.result()) +SketchConstraintEqual_3 = Sketch_1.setEqual(SketchLine_4.result(), SketchLine_5.result()) +SketchConstraintPerpendicular_1 = Sketch_1.setPerpendicular(SketchLine_1.result(), SketchLine_3.result()) +model.do() +Sketch_2 = model.addSketch(Part_1_doc, model.defaultPlane("YOZ")) +SketchProjection_2 = Sketch_2.addProjection(model.selection("VERTEX", "PartSet/Origin"), False) +SketchPoint_1 = SketchProjection_2.createdFeature() +SketchLine_7 = Sketch_2.addLine(50, -39.61510263929618, 50, 43.87280058651025) +SketchLine_7.setName("SketchLine_8") +SketchLine_7.result().setName("SketchLine_8") +SketchLine_7.setAuxiliary(True) +SketchConstraintVertical_1 = Sketch_2.setVertical(SketchLine_7.result()) +SketchConstraintDistance_2 = Sketch_2.setDistance(SketchAPI_Point(SketchPoint_1).coordinates(), SketchLine_7.result(), "D", True) +SketchLine_8 = Sketch_2.addLine(57.5, 0, 65, -10.81485284151855) +SketchLine_8.setName("SketchLine_9") +SketchLine_8.result().setName("SketchLine_9") +SketchProjection_3 = Sketch_2.addProjection(model.selection("EDGE", "PartSet/OY"), False) +SketchLine_9 = SketchProjection_3.createdFeature() +SketchLine_9.setName("SketchLine_10") +SketchLine_9.result().setName("SketchLine_10") +SketchConstraintCoincidence_9 = Sketch_2.setCoincident(SketchLine_8.startPoint(), SketchLine_9.result()) +SketchLine_10 = Sketch_2.addLine(65, -10.81485284151855, 65, 11.50710132369052) +SketchLine_10.setName("SketchLine_11") +SketchLine_10.result().setName("SketchLine_11") +SketchConstraintCoincidence_10 = Sketch_2.setCoincident(SketchLine_8.endPoint(), SketchLine_10.startPoint()) +SketchLine_11 = Sketch_2.addLine(65, 11.50710132369052, 50, 11.50710132369052) +SketchLine_11.setName("SketchLine_12") +SketchLine_11.result().setName("SketchLine_12") +SketchConstraintCoincidence_11 = Sketch_2.setCoincident(SketchLine_10.endPoint(), SketchLine_11.startPoint()) +SketchConstraintCoincidence_12 = Sketch_2.setCoincident(SketchLine_11.endPoint(), SketchLine_7.result()) +SketchConstraintDistance_3 = Sketch_2.setDistance(SketchLine_8.startPoint(), SketchLine_7.result(), "L/4", True) +SketchConstraintDistance_4 = Sketch_2.setDistance(SketchLine_8.endPoint(), SketchLine_7.result(), "L/2", True) +SketchConstraintDistance_5 = Sketch_2.setDistance(SketchLine_10.endPoint(), SketchLine_7.result(), "L/2", True) +SketchConstraintHorizontal_1 = Sketch_2.setHorizontal(SketchLine_11.result()) +SketchConstraintMirror_1_objects = [SketchLine_8.result(), SketchLine_10.result(), SketchLine_11.result()] +SketchConstraintMirror_1 = Sketch_2.addMirror(SketchLine_7.result(), SketchConstraintMirror_1_objects) +[SketchLine_12, SketchLine_13, SketchLine_14] = SketchConstraintMirror_1.mirrored() +SketchLine_14.setName("SketchLine_15") +SketchLine_14.result().setName("SketchLine_15") +SketchLine_13.setName("SketchLine_14") +SketchLine_13.result().setName("SketchLine_14") +SketchLine_12.setName("SketchLine_13") +SketchLine_12.result().setName("SketchLine_13") +SketchLine_15 = Sketch_2.addLine(42.5, 0, 57.5, 0) +SketchLine_15.setName("SketchLine_16") +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/Face-SketchLine_1r-SketchLine_6r-SketchLine_5f_wire")]) +Face_2 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_1/Face-SketchLine_3f-SketchLine_4f-SketchLine_6f_wire")]) +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/Face-SketchLine_9f-SketchLine_11f-SketchLine_12f-SketchLine_15r-SketchLine_14r-SketchLine_13r-SketchLine_16f_wire")]) +Split_1 = model.addSplit(Part_1_doc, [model.selection("WIRE", "Wire_1_1")], [model.selection("SHELL", "Shell_1_1")]) +model.do() + +model.checkResult(Split_1, model, 1, [0], [0], [0], [10], [20]) +model.testHaveNamingSubshapes(Split_1, model, Part_1_doc) + +model.end() + +assert(model.checkPythonDump()) diff --git a/src/FeaturesPlugin/Test/TestSplitWireSolid.py b/src/FeaturesPlugin/Test/TestSplitWireSolid.py new file mode 100644 index 000000000..35d870139 --- /dev/null +++ b/src/FeaturesPlugin/Test/TestSplitWireSolid.py @@ -0,0 +1,61 @@ +# Copyright (C) 2014-2019 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, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# + +# -*- coding: utf-8 -*- + +from SketchAPI import * + +from salome.shaper import model + +model.begin() +partSet = model.moduleDocument() +Part_1 = model.addPart(partSet) +Part_1_doc = Part_1.document() +model.addParameter(Part_1_doc, "L", "10") +model.addParameter(Part_1_doc, "Shift", "5") +Box_1 = model.addBox(Part_1_doc, "L", "L", "L") +Plane_4 = model.addPlane(Part_1_doc, model.selection("FACE", "Box_1_1/Bottom"), "Shift", True) +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) +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) +SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchArc_1.startPoint(), SketchLine_2.startPoint()) +SketchLine_3 = Sketch_1.addLine(0, 5, 0, -12.5) +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()) +SketchConstraintRadius_1 = Sketch_1.setRadius(SketchArc_1.results()[1], "L+Shift/2") +SketchConstraintDistanceVertical_1 = Sketch_1.setVerticalDistance(SketchAPI_Line(SketchLine_1).startPoint(), SketchLine_2.startPoint(), 5) +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/Face-SketchArc_1_2f-SketchLine_2f-SketchLine_3f_wire")]) +Split_1 = model.addSplit(Part_1_doc, [model.selection("WIRE", "Wire_1_1")], [model.selection("SOLID", "Box_1_1")]) +model.do() + +model.checkResult(Split_1, model, 1, [0], [0], [0], [9], [18]) +model.testHaveNamingSubshapes(Split_1, model, Part_1_doc) + +model.end() + +assert(model.checkPythonDump()) diff --git a/src/FeaturesPlugin/Test/TestSplitWireVertex.py b/src/FeaturesPlugin/Test/TestSplitWireVertex.py new file mode 100644 index 000000000..5129c27c3 --- /dev/null +++ b/src/FeaturesPlugin/Test/TestSplitWireVertex.py @@ -0,0 +1,53 @@ +# Copyright (C) 2014-2019 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, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# + +# -*- coding: utf-8 -*- + +from SketchAPI import * + +from salome.shaper import model + +model.begin() +partSet = model.moduleDocument() +Part_1 = model.addPart(partSet) +Part_1_doc = Part_1.document() +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.43492861072797, 41.55044273324706, 64.29883100829633, -35.76346801736826) +SketchProjection_1 = Sketch_1.addProjection(model.selection("VERTEX", "Point_1"), False) +SketchPoint_1 = SketchProjection_1.createdFeature() +SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_1.result(), SketchAPI_Point(SketchPoint_1).coordinates()) +SketchLine_2 = Sketch_1.addLine(64.5972559141328, -34.82170453629492, 63.39686648861513, 69.37209759863701) +SketchLine_3 = Sketch_1.addLine(63.39686648861513, 69.37209759863701, -27.43492861072797, 41.55044273324706) +SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchLine_2.endPoint(), SketchLine_3.startPoint()) +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_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) +Split_1 = model.addSplit(Part_1_doc, [model.selection("WIRE", "Wire_1_1")], [model.selection("VERTEX", "Vertex_1_1")]) +model.do() + +model.checkResult(Split_1,model,1,[0],[0],[0],[4],[8]) +model.testHaveNamingSubshapes(Split_1,model,Part_1_doc) + +model.end() + +assert(model.checkPythonDump()) diff --git a/src/FeaturesPlugin/Test/TestSplitWireWire.py b/src/FeaturesPlugin/Test/TestSplitWireWire.py new file mode 100644 index 000000000..5b93720bb --- /dev/null +++ b/src/FeaturesPlugin/Test/TestSplitWireWire.py @@ -0,0 +1,67 @@ +# Copyright (C) 2014-2019 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, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# + +# -*- coding: utf-8 -*- + +from salome.shaper import model + +model.begin() +partSet = model.moduleDocument() +Part_1 = model.addPart(partSet) +Part_1_doc = Part_1.document() +model.addParameter(Part_1_doc, "R", "50") +Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY")) +SketchLine_1 = Sketch_1.addLine(-49.81325699578132, 35.39936274902501, 0, 8.200436015051352) +SketchProjection_1 = Sketch_1.addProjection(model.selection("EDGE", "PartSet/OY"), False) +SketchLine_2 = SketchProjection_1.createdFeature() +SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchLine_2.result()) +SketchLine_3 = Sketch_1.addLine(0, 8.200436015051352, 49.94978427678259, 33.32234621934526) +SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchLine_3.startPoint()) +SketchArc_1 = Sketch_1.addArc(0, 31.08202242513997, 49.94978427678259, 33.32234621934526, -49.81325699578132, 35.39936274902501, False) +SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchLine_3.endPoint(), SketchArc_1.startPoint()) +SketchConstraintCoincidence_4 = Sketch_1.setCoincident(SketchLine_1.startPoint(), SketchArc_1.endPoint()) +SketchConstraintCoincidence_5 = Sketch_1.setCoincident(SketchArc_1.center(), SketchLine_2.result()) +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/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/SketchArc_1"), False) +SketchPoint_2 = SketchProjection_3.createdFeature() +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/Face-SketchLine_1r-SketchLine_3f-SketchArc_1_2f_wire")]) +Wire_2 = model.addWire(Part_1_doc, [model.selection("WIRE", "Sketch_2/Face-SketchLine_4r-SketchLine_5f-SketchArc_2_2f_wire")]) +Split_1 = model.addSplit(Part_1_doc, [model.selection("WIRE", "Wire_1_1")], [model.selection("WIRE", "Wire_2_1")]) +model.do() + +model.checkResult(Split_1, model, 1, [0], [0], [0], [4], [8]) +model.testHaveNamingSubshapes(Split_1, model, Part_1_doc) + +model.end() + +assert(model.checkPythonDump()) diff --git a/src/ModelAPI/Test/Test2401.py b/src/ModelAPI/Test/Test2401.py index 57125b4fd..ac2c1e6b2 100644 --- a/src/ModelAPI/Test/Test2401.py +++ b/src/ModelAPI/Test/Test2401.py @@ -69,7 +69,7 @@ SketchConstraintHorizontal_2 = Sketch_2.setHorizontal(SketchLine_10.result()) SketchConstraintVertical_3 = Sketch_2.setVertical(SketchLine_11.result()) model.do() Face_1 = model.addFace(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchLine_8r-SketchLine_9f-SketchLine_10f-SketchLine_11f")]) -Fill_1 = model.addFill(Part_1_doc, [model.selection("SOLID", "Extrusion_1_1")], [model.selection("FACE", "Face_1_1")]) +Split_1 = model.addSplit(Part_1_doc, [model.selection("SOLID", "Extrusion_1_1")], [model.selection("FACE", "Face_1_1")]) model.do() # now add an additional edge to the first sketch as it is described in the issue @@ -79,6 +79,6 @@ SketchConstraintCoincidence_10 = Sketch_1.setCoincident(SketchLine_4.endPoint(), model.end() # check that the plane is located as previously -model.testNbSubResults(Fill_1, [2]) -model.testResultsVolumes(Fill_1, [120]) +model.testNbSubResults(Split_1, [2]) +model.testResultsVolumes(Split_1, [120]) assert(model.checkPythonDump())