From: azv Date: Thu, 12 Dec 2019 12:52:00 +0000 (+0300) Subject: Issue #18451: Error in dump by coordinates X-Git-Tag: V9_5_0a1~101 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=7a56425e50582b34ad233c2865e7da87a2e23406;p=modules%2Fshaper.git Issue #18451: Error in dump by coordinates Close transaction after changing the order of faces in a sketch. --- diff --git a/src/ModelHighAPI/CMakeLists.txt b/src/ModelHighAPI/CMakeLists.txt index 04786ff11..41a55586c 100644 --- a/src/ModelHighAPI/CMakeLists.txt +++ b/src/ModelHighAPI/CMakeLists.txt @@ -122,4 +122,5 @@ ADD_UNIT_TESTS( TestDeflectionDump.py TestUndoRedo.py Test2488.py + Test18451.py ) diff --git a/src/ModelHighAPI/Test/Test18451.py b/src/ModelHighAPI/Test/Test18451.py new file mode 100644 index 000000000..14b1a2ba5 --- /dev/null +++ b/src/ModelHighAPI/Test/Test18451.py @@ -0,0 +1,500 @@ +# Copyright (C) 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 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, "ep", "0.5875") +model.addParameter(Part_1_doc, "ep2", "0.35") +Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOZ")) +SketchLine_1 = Sketch_1.addLine(-4.81482486096809e-34, 0.6, -0.08939999999999999, 0.6) +SketchProjection_1 = Sketch_1.addProjection(model.selection("EDGE", "PartSet/OZ"), False) +SketchLine_2 = SketchProjection_1.createdFeature() +SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_1.startPoint(), SketchLine_2.result()) +SketchConstraintHorizontal_1 = Sketch_1.setHorizontal(SketchLine_1.result()) +SketchLine_3 = Sketch_1.addLine(-0.08939999999999999, 0.6, -0.08939999999999999, 0.46) +SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchLine_3.startPoint()) +SketchConstraintVertical_1 = Sketch_1.setVertical(SketchLine_3.result()) +SketchLine_4 = Sketch_1.addLine(-0.08939999999999999, 0.46, -0.2894, 0.46) +SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchLine_3.endPoint(), SketchLine_4.startPoint()) +SketchConstraintHorizontal_2 = Sketch_1.setHorizontal(SketchLine_4.result()) +SketchLine_5 = Sketch_1.addLine(-0.2894, 0.46, -0.2894, 0.36) +SketchConstraintCoincidence_4 = Sketch_1.setCoincident(SketchLine_4.endPoint(), SketchLine_5.startPoint()) +SketchConstraintVertical_2 = Sketch_1.setVertical(SketchLine_5.result()) +SketchLine_6 = Sketch_1.addLine(-0.2894, 0.36, -0.08940000000000001, 0.36) +SketchConstraintCoincidence_5 = Sketch_1.setCoincident(SketchLine_5.endPoint(), SketchLine_6.startPoint()) +SketchConstraintHorizontal_3 = Sketch_1.setHorizontal(SketchLine_6.result()) +SketchLine_7 = Sketch_1.addLine(-0.08940000000000001, 0.36, -0.08940000000000001, -0.5600000000000001) +SketchConstraintCoincidence_6 = Sketch_1.setCoincident(SketchLine_6.endPoint(), SketchLine_7.startPoint()) +SketchConstraintVertical_3 = Sketch_1.setVertical(SketchLine_7.result()) +SketchLine_8 = Sketch_1.addLine(-0.08852125812784814, -0.571165474137811, -0.07285119438446976, -0.5729508523825384) +SketchLine_9 = Sketch_1.addLine(-0.07285119438446976, -0.5729508523825384, -0.0654, -0.6028359607518391) +SketchConstraintCoincidence_7 = Sketch_1.setCoincident(SketchLine_8.endPoint(), SketchLine_9.startPoint()) +SketchConstraintCoincidence_7.setName("SketchConstraintCoincidence_8") +SketchLine_10 = Sketch_1.addLine(-0.0654, -0.6028359607518391, -0.0654, -1.285035960751839) +SketchConstraintCoincidence_8 = Sketch_1.setCoincident(SketchLine_9.endPoint(), SketchLine_10.startPoint()) +SketchConstraintCoincidence_8.setName("SketchConstraintCoincidence_9") +SketchConstraintVertical_4 = Sketch_1.setVertical(SketchLine_10.result()) +SketchLine_11 = Sketch_1.addLine(-0.0654, -1.285035960751839, 0.3076, -1.285035960751839) +SketchConstraintCoincidence_9 = Sketch_1.setCoincident(SketchLine_10.endPoint(), SketchLine_11.startPoint()) +SketchConstraintCoincidence_9.setName("SketchConstraintCoincidence_10") +SketchConstraintHorizontal_4 = Sketch_1.setHorizontal(SketchLine_11.result()) +SketchLine_12 = Sketch_1.addLine(0.3076, -1.285035960751839, 0.3076, -1.045635960751839) +SketchConstraintCoincidence_10 = Sketch_1.setCoincident(SketchLine_11.endPoint(), SketchLine_12.startPoint()) +SketchConstraintCoincidence_10.setName("SketchConstraintCoincidence_11") +SketchConstraintVertical_5 = Sketch_1.setVertical(SketchLine_12.result()) +SketchLine_13 = Sketch_1.addLine(0.3076, -1.045635960751839, 0.007599999999999971, -1.045635960751839) +SketchConstraintCoincidence_11 = Sketch_1.setCoincident(SketchLine_12.endPoint(), SketchLine_13.startPoint()) +SketchConstraintCoincidence_11.setName("SketchConstraintCoincidence_12") +SketchConstraintHorizontal_5 = Sketch_1.setHorizontal(SketchLine_13.result()) +SketchLine_14 = Sketch_1.addLine(0.007599999999999971, -1.045635960751839, 0.007599999999999971, -0.3926359607518392) +SketchConstraintCoincidence_12 = Sketch_1.setCoincident(SketchLine_13.endPoint(), SketchLine_14.startPoint()) +SketchConstraintCoincidence_12.setName("SketchConstraintCoincidence_13") +SketchConstraintVertical_6 = Sketch_1.setVertical(SketchLine_14.result()) +SketchLine_15 = Sketch_1.addLine(0.007599999999999971, -0.3926359607518392, 0, -0.3307389278992326) +SketchConstraintCoincidence_13 = Sketch_1.setCoincident(SketchLine_14.endPoint(), SketchLine_15.startPoint()) +SketchConstraintCoincidence_13.setName("SketchConstraintCoincidence_14") +SketchConstraintCoincidence_14 = Sketch_1.setCoincident(SketchLine_15.endPoint(), SketchLine_2.result()) +SketchConstraintCoincidence_14.setName("SketchConstraintCoincidence_21") +SketchLine_16 = Sketch_1.addLine(-4.235164485203422e-23, 0.6, 0, -0.3307389278992326) +SketchLine_16.setName("SketchLine_20") +SketchLine_16.result().setName("SketchLine_20") +SketchConstraintCoincidence_15 = Sketch_1.setCoincident(SketchLine_15.endPoint(), SketchLine_16.endPoint()) +SketchConstraintCoincidence_15.setName("SketchConstraintCoincidence_23") +SketchConstraintLength_1 = Sketch_1.setLength(SketchLine_1.result(), 0.08939999999999999) +SketchConstraintLength_2 = Sketch_1.setLength(SketchLine_3.result(), 0.14) +SketchConstraintLength_2.setName("SketchConstraintLength_5") +SketchConstraintLength_3 = Sketch_1.setLength(SketchLine_4.result(), 0.2) +SketchConstraintLength_3.setName("SketchConstraintLength_6") +SketchConstraintLength_4 = Sketch_1.setLength(SketchLine_5.result(), 0.1) +SketchConstraintLength_4.setName("SketchConstraintLength_7") +SketchConstraintCoincidence_16 = Sketch_1.setCoincident(SketchLine_7.startPoint(), SketchLine_3.result()) +SketchConstraintCoincidence_16.setName("SketchConstraintCoincidence_24") +SketchConstraintLength_5 = Sketch_1.setLength(SketchLine_7.result(), 0.92) +SketchConstraintLength_5.setName("SketchConstraintLength_8") +SketchConstraintLength_6 = Sketch_1.setLength(SketchLine_10.result(), 0.6822) +SketchConstraintLength_6.setName("SketchConstraintLength_9") +SketchConstraintLength_7 = Sketch_1.setLength(SketchLine_11.result(), 0.373) +SketchConstraintLength_7.setName("SketchConstraintLength_10") +SketchConstraintLength_8 = Sketch_1.setLength(SketchLine_12.result(), 0.2394) +SketchConstraintLength_8.setName("SketchConstraintLength_11") +SketchConstraintLength_9 = Sketch_1.setLength(SketchLine_13.result(), 0.3) +SketchConstraintLength_9.setName("SketchConstraintLength_12") +SketchConstraintDistance_1 = Sketch_1.setDistance(SketchLine_10.startPoint(), SketchLine_7.result(), 0.024, True) +SketchPoint_1 = Sketch_1.addPoint(-0.08852125812784814, -0.571165474137811) +SketchLine_17 = Sketch_1.addLine(-0.08940000000000001, -0.5600000000000001, -0.08852125812784814, -0.571165474137811) +SketchLine_17.setName("SketchLine_21") +SketchLine_17.result().setName("SketchLine_21") +SketchConstraintCoincidence_17 = Sketch_1.setCoincident(SketchLine_7.endPoint(), SketchLine_17.startPoint()) +SketchConstraintCoincidence_17.setName("SketchConstraintCoincidence_7") +SketchConstraintCoincidence_18 = Sketch_1.setCoincident(SketchLine_17.endPoint(), SketchLine_8.startPoint()) +SketchConstraintCoincidence_18.setName("SketchConstraintCoincidence_26") +SketchConstraintCoincidence_19 = Sketch_1.setCoincident(SketchLine_8.startPoint(), SketchPoint_1.coordinates()) +SketchConstraintCoincidence_19.setName("SketchConstraintCoincidence_27") +SketchConstraintCoincidence_20 = Sketch_1.setCoincident(SketchLine_17.endPoint(), SketchLine_8.startPoint()) +SketchConstraintCoincidence_20.setName("SketchConstraintCoincidence_28") +SketchConstraintAngle_1 = Sketch_1.setAngleBackward(SketchLine_10.result(), SketchLine_9.result(), 166) +SketchConstraintAngle_2 = Sketch_1.setAngleBackward(SketchLine_17.result(), SketchLine_8.result(), 101) +SketchConstraintAngle_3 = Sketch_1.setAngleBackward(SketchLine_7.result(), SketchLine_17.result(), 175.5) +SketchConstraintLength_10 = Sketch_1.setLength(SketchLine_17.result(), 0.0112) +SketchConstraintLength_10.setName("SketchConstraintLength_13") +SketchConstraintLength_11 = Sketch_1.setLength(SketchLine_9.result(), 0.0308) +SketchConstraintLength_11.setName("SketchConstraintLength_14") +SketchConstraintLength_12 = Sketch_1.setLength(SketchLine_14.result(), 0.653) +SketchConstraintLength_12.setName("SketchConstraintLength_15") +SketchConstraintAngle_4 = Sketch_1.setAngleBackward(SketchLine_14.result(), SketchLine_15.result(), 173) +SketchProjection_2 = Sketch_1.addProjection(model.selection("EDGE", "PartSet/OX"), False) +SketchLine_18 = SketchProjection_2.createdFeature() +SketchLine_18.setName("SketchLine_22") +SketchLine_18.result().setName("SketchLine_22") +SketchConstraintDistance_2 = Sketch_1.setDistance(SketchLine_1.startPoint(), SketchLine_18.result(), 0.6, True) +SketchLine_19 = Sketch_1.addLine(-0.08939999999999999, 0.46, -0.08940000000000001, 0.36) +SketchLine_19.setName("SketchLine_23") +SketchLine_19.result().setName("SketchLine_23") +SketchConstraintCoincidence_21 = Sketch_1.setCoincident(SketchLine_3.endPoint(), SketchLine_19.startPoint()) +SketchConstraintCoincidence_21.setName("SketchConstraintCoincidence_29") +SketchConstraintCoincidence_22 = Sketch_1.setCoincident(SketchLine_6.endPoint(), SketchLine_19.endPoint()) +SketchConstraintCoincidence_22.setName("SketchConstraintCoincidence_30") +SketchConstraintCoincidence_23 = Sketch_1.setCoincident(SketchLine_16.startPoint(), SketchLine_1.startPoint()) +SketchConstraintCoincidence_23.setName("SketchConstraintCoincidence_25") +model.do() +Sketch_1.changeFacesOrder([[SketchLine_4.result(), SketchLine_5.result(), SketchLine_6.result(), SketchLine_19.result()], + [SketchLine_1.result(), SketchLine_3.result(), SketchLine_19.result(), SketchLine_7.result(), SketchLine_17.result(), SketchLine_8.result(), SketchLine_9.result(), SketchLine_10.result(), SketchLine_11.result(), SketchLine_12.result(), SketchLine_13.result(), SketchLine_14.result(), SketchLine_15.result(), SketchLine_16.result()] + ]) +Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_1r-SketchLine_3f-SketchLine_23f-SketchLine_7f-SketchLine_21f-SketchLine_8f-SketchLine_9f-SketchLine_10f-SketchLine_11f-SketchLine_12f-SketchLine_13f-SketchLine_14f-SketchLine_15f-SketchLine_20r")], model.selection(), "ep", "ep") +Extrusion_2 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_4f-SketchLine_5f-SketchLine_6f-SketchLine_23r")], model.selection(), "ep2", "ep2") +Sketch_2 = model.addSketch(Part_1_doc, model.standardPlane("YOZ")) +SketchLine_20 = Sketch_2.addLine(-3.021110559767089e-34, 0.6, -0.5875, 0.5401656539390112) +SketchLine_20.setName("SketchLine_24") +SketchLine_20.result().setName("SketchLine_24") +SketchProjection_3 = Sketch_2.addProjection(model.selection("VERTEX", "Sketch_1/SketchLine_1_StartVertex"), False) +SketchPoint_2 = SketchProjection_3.createdFeature() +SketchConstraintCoincidence_24 = Sketch_2.setCoincident(SketchLine_20.startPoint(), SketchPoint_2.result()) +SketchConstraintCoincidence_24.setName("SketchConstraintCoincidence_31") +SketchProjection_4 = Sketch_2.addProjection(model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_20][Extrusion_1_1/To_Face]"), False) +SketchLine_21 = SketchProjection_4.createdFeature() +SketchLine_21.setName("SketchLine_25") +SketchLine_21.result().setName("SketchLine_25") +SketchConstraintCoincidence_25 = Sketch_2.setCoincident(SketchLine_20.endPoint(), SketchLine_21.result()) +SketchConstraintCoincidence_25.setName("SketchConstraintCoincidence_32") +SketchLine_22 = Sketch_2.addLine(-0.5875, 0.5401656539390112, -0.5875, 0.6) +SketchLine_22.setName("SketchLine_26") +SketchLine_22.result().setName("SketchLine_26") +SketchConstraintCoincidence_26 = Sketch_2.setCoincident(SketchLine_20.endPoint(), SketchLine_22.startPoint()) +SketchConstraintCoincidence_26.setName("SketchConstraintCoincidence_33") +SketchConstraintCoincidence_27 = Sketch_2.setCoincident(SketchAPI_Line(SketchLine_21).startPoint(), SketchLine_22.endPoint()) +SketchConstraintCoincidence_27.setName("SketchConstraintCoincidence_34") +SketchProjection_5 = Sketch_2.addProjection(model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_1][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_20]"), True) +SketchLine_23 = SketchProjection_5.createdFeature() +SketchLine_23.setName("SketchLine_27") +SketchLine_23.result().setName("SketchLine_27") +SketchProjection_6 = Sketch_2.addProjection(model.selection("EDGE", "PartSet/OZ"), False) +SketchLine_24 = SketchProjection_6.createdFeature() +SketchLine_24.setName("SketchLine_28") +SketchLine_24.result().setName("SketchLine_28") +SketchConstraintMirror_1 = Sketch_2.addMirror(SketchLine_24.result(), [SketchLine_20.result(), SketchLine_22.result()]) +[SketchLine_25, SketchLine_26] = SketchConstraintMirror_1.mirrored() +SketchLine_26.setName("SketchLine_30") +SketchLine_26.result().setName("SketchLine_30") +SketchLine_25.setName("SketchLine_29") +SketchLine_25.result().setName("SketchLine_29") +model.do() +ExtrusionCut_1 = model.addExtrusionCut(Part_1_doc, [model.selection("COMPOUND", "all-in-Sketch_2")], model.selection(), model.selection("FACE", "Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_7"), 0, model.selection(), 0, [model.selection("SOLID", "Extrusion_1_1")]) +Sketch_3 = model.addSketch(Part_1_doc, model.standardPlane("XOZ")) +SketchLine_27 = Sketch_3.addLine(-2.319541823598068e-23, 0.1790140882246268, 0.375, 0.1396) +SketchLine_27.setName("SketchLine_31") +SketchLine_27.result().setName("SketchLine_31") +SketchProjection_7 = Sketch_3.addProjection(model.selection("EDGE", "Sketch_1/SketchLine_20"), False) +SketchLine_28 = SketchProjection_7.createdFeature() +SketchLine_28.setName("SketchLine_32") +SketchLine_28.result().setName("SketchLine_32") +SketchConstraintCoincidence_28 = Sketch_3.setCoincident(SketchLine_27.startPoint(), SketchLine_28.result()) +SketchConstraintCoincidence_28.setName("SketchConstraintCoincidence_35") +SketchLine_29 = Sketch_3.addLine(0.375, 0.1396, 3.347, 0.1396) +SketchLine_29.setName("SketchLine_33") +SketchLine_29.result().setName("SketchLine_33") +SketchConstraintCoincidence_29 = Sketch_3.setCoincident(SketchLine_27.endPoint(), SketchLine_29.startPoint()) +SketchConstraintCoincidence_29.setName("SketchConstraintCoincidence_36") +SketchConstraintHorizontal_6 = Sketch_3.setHorizontal(SketchLine_29.result()) +SketchLine_30 = Sketch_3.addLine(3.347, 0.1396, 3.347, 0) +SketchLine_30.setName("SketchLine_34") +SketchLine_30.result().setName("SketchLine_34") +SketchConstraintCoincidence_30 = Sketch_3.setCoincident(SketchLine_29.endPoint(), SketchLine_30.startPoint()) +SketchConstraintCoincidence_30.setName("SketchConstraintCoincidence_37") +SketchProjection_8 = Sketch_3.addProjection(model.selection("EDGE", "PartSet/OX"), False) +SketchLine_31 = SketchProjection_8.createdFeature() +SketchLine_31.setName("SketchLine_35") +SketchLine_31.result().setName("SketchLine_35") +SketchConstraintCoincidence_31 = Sketch_3.setCoincident(SketchLine_30.endPoint(), SketchLine_31.result()) +SketchConstraintCoincidence_31.setName("SketchConstraintCoincidence_38") +SketchConstraintVertical_7 = Sketch_3.setVertical(SketchLine_30.result()) +SketchLine_32 = Sketch_3.addLine(3.347, 0, 0, 0) +SketchLine_32.setName("SketchLine_36") +SketchLine_32.result().setName("SketchLine_36") +SketchConstraintCoincidence_32 = Sketch_3.setCoincident(SketchLine_30.endPoint(), SketchLine_32.startPoint()) +SketchConstraintCoincidence_32.setName("SketchConstraintCoincidence_39") +SketchConstraintCoincidence_33 = Sketch_3.setCoincident(SketchAPI_Line(SketchLine_31).startPoint(), SketchLine_32.endPoint()) +SketchConstraintCoincidence_33.setName("SketchConstraintCoincidence_40") +SketchLine_33 = Sketch_3.addLine(-2.319541823598068e-23, 0.1790140882246268, 0, 0) +SketchLine_33.setName("SketchLine_37") +SketchLine_33.result().setName("SketchLine_37") +SketchConstraintCoincidence_34 = Sketch_3.setCoincident(SketchLine_27.startPoint(), SketchLine_33.startPoint()) +SketchConstraintCoincidence_34.setName("SketchConstraintCoincidence_41") +SketchConstraintCoincidence_35 = Sketch_3.setCoincident(SketchAPI_Line(SketchLine_31).startPoint(), SketchLine_33.endPoint()) +SketchConstraintCoincidence_35.setName("SketchConstraintCoincidence_42") +SketchConstraintLength_13 = Sketch_3.setLength(SketchLine_32.result(), 3.347) +SketchConstraintLength_13.setName("SketchConstraintLength_16") +SketchProjection_9 = Sketch_3.addProjection(model.selection("EDGE", "PartSet/OZ"), False) +SketchLine_34 = SketchProjection_9.createdFeature() +SketchLine_34.setName("SketchLine_38") +SketchLine_34.result().setName("SketchLine_38") +SketchConstraintDistance_3 = Sketch_3.setDistance(SketchLine_27.endPoint(), SketchLine_34.result(), 0.375, True) +SketchConstraintDistance_4 = Sketch_3.setDistance(SketchLine_27.endPoint(), SketchLine_32.result(), 0.1396, True) +SketchConstraintAngle_5 = Sketch_3.setAngle(SketchLine_29.result(), SketchLine_27.result(), 174) +model.do() +Revolution_1 = model.addRevolution(Part_1_doc, [model.selection("COMPOUND", "Sketch_3")], model.selection("EDGE", "PartSet/OX"), 360, 0) +Fuse_1_objects_1 = [model.selection("SOLID", "Extrusion_2_1"), model.selection("SOLID", "ExtrusionCut_1_1"), model.selection("SOLID", "Revolution_1_1")] +Fuse_1 = model.addFuse(Part_1_doc, Fuse_1_objects_1, False) +Fillet_1 = model.addFillet(Part_1_doc, [model.selection("EDGE", "[Fuse_1_1/Modified_Face&Sketch_1/SketchLine_20][Revolution_1_1/Generated_Face&Sketch_3/SketchLine_31]")], 0.05) +Sketch_4 = model.addSketch(Part_1_doc, model.standardPlane("XOZ")) +SketchLine_35 = Sketch_4.addLine(3.347, 0.183, 3.347, -0.344869487384476) +SketchLine_35.setName("SketchLine_39") +SketchLine_35.result().setName("SketchLine_39") +SketchConstraintVertical_8 = Sketch_4.setVertical(SketchLine_35.result()) +SketchProjection_10 = Sketch_4.addProjection(model.selection("VERTEX", "[Revolution_1_1/Generated_Face&Sketch_3/SketchLine_33][Revolution_1_1/Generated_Face&Sketch_3/SketchLine_34]"), False) +SketchPoint_3 = SketchProjection_10.createdFeature() +SketchConstraintCoincidence_36 = Sketch_4.setCoincident(SketchAPI_Point(SketchPoint_3).coordinates(), SketchLine_35.result()) +SketchConstraintCoincidence_36.setName("SketchConstraintCoincidence_43") +SketchLine_36 = Sketch_4.addLine(3.347, 0.183, 3.744000000000001, 0.183) +SketchLine_36.setName("SketchLine_40") +SketchLine_36.result().setName("SketchLine_40") +SketchConstraintCoincidence_37 = Sketch_4.setCoincident(SketchLine_35.startPoint(), SketchLine_36.startPoint()) +SketchConstraintCoincidence_37.setName("SketchConstraintCoincidence_44") +SketchConstraintHorizontal_7 = Sketch_4.setHorizontal(SketchLine_36.result()) +SketchLine_37 = Sketch_4.addLine(3.744000000000001, 0.183, 3.744000000000001, -0.192) +SketchLine_37.setName("SketchLine_41") +SketchLine_37.result().setName("SketchLine_41") +SketchConstraintCoincidence_38 = Sketch_4.setCoincident(SketchLine_36.endPoint(), SketchLine_37.startPoint()) +SketchConstraintCoincidence_38.setName("SketchConstraintCoincidence_45") +SketchConstraintVertical_9 = Sketch_4.setVertical(SketchLine_37.result()) +SketchConstraintLength_14 = Sketch_4.setLength(SketchLine_36.result(), 0.397) +SketchConstraintLength_14.setName("SketchConstraintLength_17") +SketchConstraintLength_15 = Sketch_4.setLength(SketchLine_37.result(), 0.375) +SketchConstraintLength_15.setName("SketchConstraintLength_18") +SketchArc_1 = Sketch_4.addArc(3.665500000000001, -0.192, 3.744000000000001, -0.192, 3.700263973859845, -0.2623826407679625, True) +SketchConstraintCoincidence_39 = Sketch_4.setCoincident(SketchLine_37.endPoint(), SketchArc_1.startPoint()) +SketchConstraintCoincidence_39.setName("SketchConstraintCoincidence_46") +SketchConstraintTangent_1 = Sketch_4.setTangent(SketchLine_37.result(), SketchArc_1.results()[1]) +SketchArc_2 = Sketch_4.addArc(3.347, 0.452830512615524, 3.700263973859845, -0.2623826407679625, 3.347, -0.344869487384476, True) +SketchConstraintCoincidence_40 = Sketch_4.setCoincident(SketchArc_1.endPoint(), SketchArc_2.startPoint()) +SketchConstraintCoincidence_40.setName("SketchConstraintCoincidence_47") +SketchConstraintTangent_2 = Sketch_4.setTangent(SketchArc_1.results()[1], SketchArc_2.results()[1]) +SketchConstraintCoincidence_41 = Sketch_4.setCoincident(SketchArc_2.endPoint(), SketchLine_35.endPoint()) +SketchConstraintCoincidence_41.setName("SketchConstraintCoincidence_48") +SketchConstraintRadius_1 = Sketch_4.setRadius(SketchArc_1.results()[1], 0.0785) +SketchProjection_11 = Sketch_4.addProjection(model.selection("EDGE", "PartSet/OX"), False) +SketchLine_38 = SketchProjection_11.createdFeature() +SketchLine_38.setName("SketchLine_42") +SketchLine_38.result().setName("SketchLine_42") +SketchConstraintDistance_5 = Sketch_4.setDistance(SketchLine_35.startPoint(), SketchLine_38.result(), 0.183, True) +SketchConstraintCoincidence_42 = Sketch_4.setCoincident(SketchArc_2.center(), SketchLine_35.result()) +SketchConstraintCoincidence_42.setName("SketchConstraintCoincidence_49") +SketchConstraintRadius_2 = Sketch_4.setRadius(SketchArc_2.results()[1], 0.7977) +model.do() +Revolution_2 = model.addRevolution(Part_1_doc, [model.selection("FACE", "Sketch_4/Face-SketchLine_39r-SketchArc_2_2f-SketchArc_1_2f-SketchLine_41r-SketchLine_40r")], model.selection("EDGE", "Sketch_4/SketchLine_39"), 360, 0) +Fuse_2 = model.addFuse(Part_1_doc, [model.selection("SOLID", "Fillet_1_1"), model.selection("SOLID", "Revolution_2_1")], False) +Sketch_5 = model.addSketch(Part_1_doc, model.selection("FACE", "Revolution_2_1/Generated_Face&Sketch_4/SketchLine_40")) +SketchProjection_12 = Sketch_5.addProjection(model.selection("EDGE", "Sketch_4/SketchLine_40"), False) +SketchLine_39 = SketchProjection_12.createdFeature() +SketchLine_39.setName("SketchLine_43") +SketchLine_39.result().setName("SketchLine_43") +SketchCircle_1 = Sketch_5.addCircle(3.447, 0, 0.02725) +SketchConstraintCoincidence_43 = Sketch_5.setCoincident(SketchLine_39.result(), SketchCircle_1.center()) +SketchConstraintCoincidence_43.setName("SketchConstraintCoincidence_50") +SketchConstraintRadius_3 = Sketch_5.setRadius(SketchCircle_1.results()[1], 0.02725) +SketchConstraintDistance_6 = Sketch_5.setDistance(SketchAPI_Line(SketchLine_39).startPoint(), SketchCircle_1.center(), 0.1, True) +model.do() +ExtrusionFuse_1 = model.addExtrusionFuse(Part_1_doc, [model.selection("COMPOUND", "Sketch_5")], model.selection(), 0.1123, 0, [model.selection("SOLID", "Fuse_2_1")]) +Sketch_6 = model.addSketch(Part_1_doc, model.standardPlane("XOY")) +SketchProjection_13 = Sketch_6.addProjection(model.selection("EDGE", "PartSet/OX"), False) +SketchLine_40 = SketchProjection_13.createdFeature() +SketchLine_40.setName("SketchLine_44") +SketchLine_40.result().setName("SketchLine_44") +SketchCircle_2 = Sketch_6.addCircle(3.347, 0, 0.0535464) +SketchConstraintRadius_4 = Sketch_6.setRadius(SketchCircle_2.results()[1], 0.0535464) +SketchIntersectionPoint_1 = Sketch_6.addIntersectionPoint(model.selection("EDGE", "Sketch_4/SketchLine_39"), False) +[SketchPoint_4] = SketchIntersectionPoint_1.intersectionPoints() +SketchConstraintCoincidence_44 = Sketch_6.setCoincident(SketchCircle_2.center(), SketchAPI_Point(SketchPoint_4).coordinates()) +SketchConstraintCoincidence_44.setName("SketchConstraintCoincidence_51") +model.do() +Extrusion_3 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_6/Face-SketchCircle_2_2f")], model.selection(), 0, 0.5586) +Fuse_3 = model.addFuse(Part_1_doc, [model.selection("SOLID", "ExtrusionFuse_1_1"), model.selection("SOLID", "Extrusion_3_1")], False) +Plane_4 = model.addPlane(Part_1_doc, model.selection("FACE", "PartSet/YOZ"), 1.2912, False) +Sketch_7 = model.addSketch(Part_1_doc, model.selection("FACE", "Plane_1")) +SketchLine_41 = Sketch_7.addLine(-0.80851, 0.003178, -0.80851, 0.253178) +SketchLine_41.setName("SketchLine_45") +SketchLine_41.result().setName("SketchLine_45") +SketchConstraintVertical_10 = Sketch_7.setVertical(SketchLine_41.result()) +SketchLine_42 = Sketch_7.addLine(-0.80851, 0.253178, -0.80851, 0.003178) +SketchLine_42.setName("SketchLine_46") +SketchLine_42.result().setName("SketchLine_46") +SketchConstraintCoincidence_45 = Sketch_7.setCoincident(SketchLine_41.endPoint(), SketchLine_42.startPoint()) +SketchConstraintCoincidence_45.setName("SketchConstraintCoincidence_52") +SketchConstraintCoincidence_46 = Sketch_7.setCoincident(SketchLine_41.startPoint(), SketchLine_42.endPoint()) +SketchConstraintCoincidence_46.setName("SketchConstraintCoincidence_53") +SketchProjection_14 = Sketch_7.addProjection(model.selection("EDGE", "PartSet/OZ"), False) +SketchLine_43 = SketchProjection_14.createdFeature() +SketchLine_43.setName("SketchLine_47") +SketchLine_43.result().setName("SketchLine_47") +SketchProjection_15 = Sketch_7.addProjection(model.selection("EDGE", "PartSet/OY"), False) +SketchLine_44 = SketchProjection_15.createdFeature() +SketchLine_44.setName("SketchLine_48") +SketchLine_44.result().setName("SketchLine_48") +SketchConstraintDistance_7 = Sketch_7.setDistance(SketchLine_41.startPoint(), SketchLine_43.result(), 0.80851, True) +SketchConstraintDistance_7.setName("SketchConstraintDistance_8") +SketchConstraintLength_16 = Sketch_7.setLength(SketchLine_41.result(), 0.25) +SketchConstraintLength_16.setName("SketchConstraintLength_19") +SketchArc_3 = Sketch_7.addArc(-0.7325, 0.253178, -0.80851, 0.253178, -0.7325, 0.3291879999999999, True) +SketchConstraintCoincidence_47 = Sketch_7.setCoincident(SketchLine_41.endPoint(), SketchArc_3.startPoint()) +SketchConstraintCoincidence_47.setName("SketchConstraintCoincidence_54") +SketchConstraintTangent_3 = Sketch_7.setTangent(SketchLine_41.result(), SketchArc_3.results()[1]) +SketchLine_45 = Sketch_7.addLine(-0.7325, 0.253178, -0.7325, 0.3291879999999999) +SketchLine_45.setName("SketchLine_49") +SketchLine_45.result().setName("SketchLine_49") +SketchLine_45.setAuxiliary(True) +SketchConstraintCoincidence_48 = Sketch_7.setCoincident(SketchArc_3.center(), SketchLine_45.startPoint()) +SketchConstraintCoincidence_48.setName("SketchConstraintCoincidence_55") +SketchConstraintCoincidence_49 = Sketch_7.setCoincident(SketchArc_3.endPoint(), SketchLine_45.endPoint()) +SketchConstraintCoincidence_49.setName("SketchConstraintCoincidence_56") +SketchConstraintVertical_11 = Sketch_7.setVertical(SketchLine_45.result()) +SketchLine_46 = Sketch_7.addLine(-0.7325, 0.3291879999999999, -0.6591320000000001, 0.3291879999999999) +SketchLine_46.setName("SketchLine_50") +SketchLine_46.result().setName("SketchLine_50") +SketchConstraintCoincidence_50 = Sketch_7.setCoincident(SketchArc_3.endPoint(), SketchLine_46.startPoint()) +SketchConstraintCoincidence_50.setName("SketchConstraintCoincidence_57") +SketchConstraintHorizontal_8 = Sketch_7.setHorizontal(SketchLine_46.result()) +SketchConstraintLength_17 = Sketch_7.setLength(SketchLine_46.result(), 0.073368) +SketchConstraintLength_17.setName("SketchConstraintLength_20") +SketchLine_47 = Sketch_7.addLine(-0.4815101245041479, 0.278, 0, -1.355252715606881e-20) +SketchLine_47.setName("SketchLine_51") +SketchLine_47.result().setName("SketchLine_51") +SketchLine_48 = Sketch_7.addLine(0, -1.355252715606881e-20, -0.3375518398718391, -1.355252715606881e-20) +SketchLine_48.setName("SketchLine_52") +SketchLine_48.result().setName("SketchLine_52") +SketchLine_48.setAuxiliary(True) +SketchConstraintCoincidence_51 = Sketch_7.setCoincident(SketchLine_47.endPoint(), SketchLine_48.startPoint()) +SketchConstraintCoincidence_51.setName("SketchConstraintCoincidence_58") +SketchConstraintHorizontal_9 = Sketch_7.setHorizontal(SketchLine_48.result()) +SketchConstraintAngle_6 = Sketch_7.setAngle(SketchLine_47.result(), SketchLine_48.result(), 30) +SketchConstraintCoincidence_52 = Sketch_7.setCoincident(SketchLine_47.endPoint(), SketchAPI_Line(SketchLine_44).startPoint()) +SketchConstraintCoincidence_52.setName("SketchConstraintCoincidence_59") +SketchConstraintDistance_8 = Sketch_7.setDistance(SketchLine_47.startPoint(), SketchLine_44.result(), 0.278, True) +SketchConstraintDistance_8.setName("SketchConstraintDistance_9") +SketchConstraintDistance_9 = Sketch_7.setDistance(SketchLine_45.startPoint(), SketchLine_43.result(), 0.7325, True) +SketchConstraintDistance_9.setName("SketchConstraintDistance_10") +SketchArc_4 = Sketch_7.addArc(-0.6591320000000001, -0.004579113372898896, -0.6591320000000001, 0.3291879999999999, -0.4815101245041478, 0.278, True) +SketchConstraintCoincidence_53 = Sketch_7.setCoincident(SketchLine_46.endPoint(), SketchArc_4.startPoint()) +SketchConstraintCoincidence_53.setName("SketchConstraintCoincidence_60") +SketchConstraintTangent_4 = Sketch_7.setTangent(SketchLine_46.result(), SketchArc_4.results()[1]) +SketchConstraintCoincidence_54 = Sketch_7.setCoincident(SketchArc_4.endPoint(), SketchLine_47.startPoint()) +SketchConstraintCoincidence_54.setName("SketchConstraintCoincidence_61") +SketchConstraintDistance_10 = Sketch_7.setDistance(SketchLine_41.startPoint(), SketchLine_48.result(), 0.003178, True) +SketchConstraintDistance_10.setName("SketchConstraintDistance_13") +model.do() +Plane_5 = model.addPlane(Part_1_doc, model.selection("EDGE", "PartSet/OZ"), model.selection("VERTEX", "Sketch_7/SketchLine_45_StartVertex"), True) +Sketch_8 = model.addSketch(Part_1_doc, model.selection("FACE", "Plane_2")) +SketchProjection_16 = Sketch_8.addProjection(model.selection("VERTEX", "Sketch_7/SketchLine_45_StartVertex"), False) +SketchPoint_5 = SketchProjection_16.createdFeature() +SketchCircle_3 = Sketch_8.addCircle(1.2912, -0.80851, 0.02655) +SketchConstraintCoincidence_55 = Sketch_8.setCoincident(SketchPoint_5.result(), SketchCircle_3.center()) +SketchConstraintCoincidence_55.setName("SketchConstraintCoincidence_62") +SketchConstraintRadius_5 = Sketch_8.setRadius(SketchCircle_3.results()[1], 0.02655) +model.do() +Face_1 = model.addFace(Part_1_doc, [model.selection("FACE", "Sketch_8/Face-SketchCircle_3_2f")]) +Wire_1_objects = [model.selection("EDGE", "Sketch_7/SketchLine_45"), model.selection("EDGE", "Sketch_7/SketchArc_3_2"), model.selection("EDGE", "Sketch_7/SketchLine_50"), model.selection("EDGE", "Sketch_7/SketchArc_4_2"), model.selection("EDGE", "Sketch_7/SketchLine_51")] +Wire_1 = model.addWire(Part_1_doc, Wire_1_objects) +Pipe_1 = model.addPipe(Part_1_doc, [model.selection("FACE", "Face_1_1")], model.selection("WIRE", "Wire_1_1")) +Fuse_4 = model.addFuse(Part_1_doc, [model.selection("SOLID", "Pipe_1_1"), model.selection("SOLID", "Fuse_3_1")], False) +Plane_6 = model.addPlane(Part_1_doc, model.selection("FACE", "PartSet/XOY"), 1.1407, True) +Sketch_9 = model.addSketch(Part_1_doc, model.selection("FACE", "Plane_3")) +SketchLine_49 = Sketch_9.addLine(0.5219, -0.3643, 0.5219, -0.1143) +SketchLine_49.setName("SketchLine_53") +SketchLine_49.result().setName("SketchLine_53") +SketchConstraintVertical_12 = Sketch_9.setVertical(SketchLine_49.result()) +SketchProjection_17 = Sketch_9.addProjection(model.selection("EDGE", "PartSet/OY"), False) +SketchLine_50 = SketchProjection_17.createdFeature() +SketchLine_50.setName("SketchLine_54") +SketchLine_50.result().setName("SketchLine_54") +SketchProjection_18 = Sketch_9.addProjection(model.selection("EDGE", "PartSet/OX"), False) +SketchLine_51 = SketchProjection_18.createdFeature() +SketchLine_51.setName("SketchLine_55") +SketchLine_51.result().setName("SketchLine_55") +SketchConstraintDistance_11 = Sketch_9.setDistance(SketchLine_49.endPoint(), SketchLine_50.result(), 0.5219, True) +SketchConstraintDistance_11.setName("SketchConstraintDistance_11") +SketchConstraintDistance_12 = Sketch_9.setDistance(SketchLine_49.startPoint(), SketchLine_51.result(), 0.3643, True) +SketchConstraintDistance_12.setName("SketchConstraintDistance_12") +SketchConstraintLength_18 = Sketch_9.setLength(SketchLine_49.result(), 0.25) +SketchConstraintLength_18.setName("SketchConstraintLength_21") +SketchArc_5 = Sketch_9.addArc(0.4075999999999999, -0.1143, 0.5219, -0.1143, 0.4075999999999999, 2.344010062074957e-33, False) +SketchConstraintCoincidence_56 = Sketch_9.setCoincident(SketchLine_49.endPoint(), SketchArc_5.startPoint()) +SketchConstraintCoincidence_56.setName("SketchConstraintCoincidence_63") +SketchConstraintTangent_5 = Sketch_9.setTangent(SketchLine_49.result(), SketchArc_5.results()[1]) +SketchLine_52 = Sketch_9.addLine(0.4075999999999999, 2.344010062074957e-33, 0, -1.207680510878222e-22) +SketchLine_52.setName("SketchLine_56") +SketchLine_52.result().setName("SketchLine_56") +SketchConstraintCoincidence_57 = Sketch_9.setCoincident(SketchArc_5.endPoint(), SketchLine_52.startPoint()) +SketchConstraintCoincidence_57.setName("SketchConstraintCoincidence_64") +SketchConstraintHorizontal_10 = Sketch_9.setHorizontal(SketchLine_52.result()) +SketchConstraintCoincidence_58 = Sketch_9.setCoincident(SketchLine_52.endPoint(), SketchAPI_Line(SketchLine_50).startPoint()) +SketchConstraintCoincidence_58.setName("SketchConstraintCoincidence_65") +SketchLine_53 = Sketch_9.addLine(0.4075999999999999, 2.344010062074957e-33, 0.4075999999999999, -0.1143) +SketchLine_53.setName("SketchLine_57") +SketchLine_53.result().setName("SketchLine_57") +SketchLine_53.setAuxiliary(True) +SketchConstraintCoincidence_59 = Sketch_9.setCoincident(SketchArc_5.endPoint(), SketchLine_53.startPoint()) +SketchConstraintCoincidence_59.setName("SketchConstraintCoincidence_66") +SketchConstraintCoincidence_60 = Sketch_9.setCoincident(SketchArc_5.center(), SketchLine_53.endPoint()) +SketchConstraintCoincidence_60.setName("SketchConstraintCoincidence_67") +SketchConstraintVertical_13 = Sketch_9.setVertical(SketchLine_53.result()) +model.do() +Plane_7 = model.addPlane(Part_1_doc, model.selection("EDGE", "PartSet/OY"), model.selection("VERTEX", "Sketch_9/SketchLine_53_StartVertex"), True) +Sketch_10 = model.addSketch(Part_1_doc, model.selection("FACE", "Plane_4")) +SketchProjection_19 = Sketch_10.addProjection(model.selection("VERTEX", "Sketch_9/SketchLine_53_StartVertex"), False) +SketchPoint_6 = SketchProjection_19.createdFeature() +SketchCircle_4 = Sketch_10.addCircle(0.5219, 1.1407, 0.05355) +SketchConstraintCoincidence_61 = Sketch_10.setCoincident(SketchPoint_6.result(), SketchCircle_4.center()) +SketchConstraintCoincidence_61.setName("SketchConstraintCoincidence_68") +SketchConstraintRadius_6 = Sketch_10.setRadius(SketchCircle_4.results()[1], 0.05355) +model.do() +Face_2 = model.addFace(Part_1_doc, [model.selection("EDGE", "Sketch_10/SketchCircle_4_2")]) +Wire_2_objects = [model.selection("EDGE", "Sketch_9/SketchLine_53"), model.selection("EDGE", "Sketch_9/SketchArc_5_2"), model.selection("EDGE", "Sketch_9/SketchLine_56")] +Wire_2 = model.addWire(Part_1_doc, Wire_2_objects) +Pipe_2 = model.addPipe(Part_1_doc, [model.selection("FACE", "Face_2_1")], model.selection("WIRE", "Wire_2_1")) +Fuse_5 = model.addFuse(Part_1_doc, [model.selection("SOLID", "Pipe_2_1"), model.selection("SOLID", "Fuse_4_1")], False) +Symmetry_1 = model.addSymmetry(Part_1_doc, [model.selection("SOLID", "Fuse_5_1")], model.selection("FACE", "PartSet/YOZ"), False) +Symmetry_2 = model.addSymmetry(Part_1_doc, [model.selection("SOLID", "Symmetry_1_1")], model.selection("FACE", "PartSet/XOZ"), False) +Group_1 = model.addGroup(Part_1_doc, "Faces", [model.selection("FACE", "Symmetry_2_1/MF:Symmetried&Pipe_2_1/From_Face_1")]) +Group_1.setName("Outlet_1") +Group_1.result().setName("Outlet_1") +Group_2 = model.addGroup(Part_1_doc, "Faces", [model.selection("FACE", "Symmetry_2_1/MF:Symmetried&Pipe_1_1/From_Face_1")]) +Group_2.setName("Inlet_1") +Group_2.result().setName("Inlet_1") +Group_3 = model.addGroup(Part_1_doc, "Faces", [model.selection("FACE", "Symmetry_2_1/MF:Symmetried&Extrusion_3_1/From_Face")]) +Group_3.setName("Outlet_2") +Group_3.result().setName("Outlet_2") +Group_4 = model.addGroup(Part_1_doc, "Faces", [model.selection("FACE", "Symmetry_2_1/MF:Symmetried&ExtrusionFuse_1_1/To_Face")]) +Group_4.setName("Inlet_2") +Group_4.result().setName("Inlet_2") +Group_5 = model.addGroup(Part_1_doc, "Faces", [model.selection("SOLID", "Symmetry_2_1")]) +Group_5.setName("Group_faces") +Group_5.result().setName("Group_faces") +GroupSubstraction_1_objects_2 = [model.selection("COMPOUND", "Outlet_1"), model.selection("COMPOUND", "Inlet_1"), model.selection("COMPOUND", "Outlet_2"), model.selection("COMPOUND", "Inlet_2")] +GroupSubstraction_1 = model.addGroupSubstraction(Part_1_doc, [model.selection("COMPOUND", "Group_faces")], GroupSubstraction_1_objects_2) +GroupSubstraction_1.result().setName("Wall") +model.end() + +from GeomAPI import GeomAPI_Shape + +model.testNbResults(Symmetry_2, 1) +model.testNbSubResults(Symmetry_2, [0]) +model.testNbSubShapes(Symmetry_2, GeomAPI_Shape.SOLID, [1]) +model.testNbSubShapes(Symmetry_2, GeomAPI_Shape.FACE, [44]) +model.testNbSubShapes(Symmetry_2, GeomAPI_Shape.EDGE, [192]) +model.testNbSubShapes(Symmetry_2, GeomAPI_Shape.VERTEX, [384]) +model.testResultsVolumes(Symmetry_2, [0.714262940088946862715602037]) + +from ModelAPI import * +aFactory = ModelAPI_Session.get().validators() + +# Check that the features are not in error +for i in range(Part_1_doc.size("Features")): + feature = objectToFeature(Part_1_doc.object("Features", i)) + name = feature.name() + error = feature.error() + assert(error == ''), "The feature {0} is in error: {1}".format(name, error) + assert(aFactory.validate(feature)), "The feature {0} is in error: {1}".format(name, error) + +assert(Part_1_doc.size("Groups") == 6) + +assert(model.checkPythonDump()) diff --git a/src/SketchAPI/SketchAPI_Sketch.cpp b/src/SketchAPI/SketchAPI_Sketch.cpp index 6b4548cc0..25cac9e71 100644 --- a/src/SketchAPI/SketchAPI_Sketch.cpp +++ b/src/SketchAPI/SketchAPI_Sketch.cpp @@ -1423,5 +1423,7 @@ void SketchAPI_Sketch::dump(ModelHighAPI_Dumper& theDumper) const theDumper << *aFIt; } theDumper << "\n" << aSpaceShift << " ])" << std::endl; + // call model.do() for correct update of the document's labels related to the changed faces + theDumper << "model.do()" << std::endl; } }