Salome HOME
Renaming Fill in Split : Read old HDF
[modules/shaper.git] / src / FeaturesPlugin / Test / TestFillShellWire.py
index d7d5ea09745bc1af066ec9de2394b4a61ecf423c..998cd655e6e20618b379e58fe81b79c83aeb4961 100644 (file)
@@ -1,23 +1,23 @@
-## Copyright (C) 2017  CEA/DEN, EDF R&D
-##
-## This library is free software; you can redistribute it and/or
-## modify it under the terms of the GNU Lesser General Public
-## License as published by the Free Software Foundation; either
-## version 2.1 of the License, or (at your option) any later version.
-##
-## This library is distributed in the hope that it will be useful,
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# 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 *
 
@@ -52,60 +52,35 @@ SketchConstraintEqual_2 = Sketch_1.setEqual(SketchLine_3.result(), SketchLine_4.
 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"))
+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()
-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())
+SketchConstraintDistance_2 = Sketch_2.setDistance(SketchAPI_Point(SketchPoint_1).coordinates(), SketchLine_9.result(), "L", True)
 model.do()
-Face_1 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_1/Wire-SketchLine_1f-SketchLine_5f-SketchLine_6r")])
-Face_2 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_1/Wire-SketchLine_3f-SketchLine_4f-SketchLine_6f")])
+Face_1 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_1/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/Wire-SketchLine_9f-SketchLine_11f-SketchLine_12f-SketchLine_13r-SketchLine_14r-SketchLine_15r-SketchLine_16f")])
-Boolean_1 = model.addFill(Part_1_doc, [model.selection("SHELL", "Shell_1_1")], [model.selection("WIRE", "Wire_1_1")])
+Wire_1_objects = [model.selection("EDGE", "Sketch_2/SketchLine_7"), model.selection("EDGE", "Sketch_2/SketchLine_8"), model.selection("EDGE", "Sketch_2/SketchLine_9"), model.selection("EDGE", "Sketch_2/SketchLine_10")]
+Wire_1 = model.addWire(Part_1_doc, Wire_1_objects)
+Fill_1 = model.addFill(Part_1_doc, [model.selection("SHELL", "Shell_1_1")], [model.selection("WIRE", "Wire_1_1")])
 model.do()
 
-model.checkBooleansResult(Boolean_1, model, 1, [0], [0], [2], [10], [22])
-model.testHaveNamingSubshapes(Boolean_1, model, Part_1_doc)
+model.checkResult(Fill_1, model, 1, [0], [0], [8], [30], [60])
+model.testHaveNamingSubshapes(Fill_1, model, Part_1_doc)
 
 model.end()