From c7504723a537aa0dc94d50e50fcb2a41b7615973 Mon Sep 17 00:00:00 2001 From: azv Date: Thu, 2 Mar 2017 15:38:42 +0300 Subject: [PATCH] Update 'bearing_puller' model according to redesigned sketcher (use the Mirror constraint in convenient places) --- test.models/bearing_puller.py | 189 +++++++++++----------------------- 1 file changed, 60 insertions(+), 129 deletions(-) diff --git a/test.models/bearing_puller.py b/test.models/bearing_puller.py index 3f2537e39..05c20e231 100644 --- a/test.models/bearing_puller.py +++ b/test.models/bearing_puller.py @@ -343,52 +343,29 @@ SketchConstraintCoincidence_61 = Sketch_4.setCoincident(SketchArc_13.endPoint(), SketchConstraintCoincidence_61.setName("SketchConstraintCoincidence_49") SketchConstraintCoincidence_62 = Sketch_4.setCoincident(SketchArc_13.center(), SketchLine_32.result()) SketchConstraintCoincidence_62.setName("SketchConstraintCoincidence_50") -SketchConstraintMirror_1 = Sketch_4.addMirror(SketchLine_39.result(), [SketchArc_13.results()[1]]) -[SketchArc_14] = SketchConstraintMirror_1.mirrored() -SketchArc_14.setName("SketchArc_5") -SketchArc_14.result().setName("SketchArc_5") -SketchArc_14.results()[1].setName("SketchArc_5_2") -SketchConstraintMirror_2 = Sketch_4.addMirror(SketchLine_40.result(), [SketchArc_12.results()[1]]) -[SketchArc_15] = SketchConstraintMirror_2.mirrored() +SketchConstraintMirror_1 = Sketch_4.addMirror(SketchLine_40.result(), [SketchArc_13.results()[1], SketchArc_12.results()[1]]) +[SketchArc_14, SketchArc_15] = SketchConstraintMirror_1.mirrored() SketchArc_15.setName("SketchArc_6") SketchArc_15.result().setName("SketchArc_6") SketchArc_15.results()[1].setName("SketchArc_6_2") -SketchArc_16 = Sketch_4.addArc(0, -5.762896622852197, 0, 3.75, -4.894344934278309, 2.394344934278312, False) -SketchArc_16.setName("SketchArc_7") -SketchArc_16.result().setName("SketchArc_7") -SketchArc_16.results()[1].setName("SketchArc_7_2") -SketchConstraintCoincidence_63 = Sketch_4.setCoincident(SketchArc_16.startPoint(), SketchArc_12.startPoint()) -SketchConstraintCoincidence_63.setName("SketchConstraintCoincidence_51") -SketchConstraintCoincidence_64 = Sketch_4.setCoincident(SketchArc_16.endPoint(), SketchAPI_Arc(SketchArc_14).endPoint()) -SketchConstraintCoincidence_64.setName("SketchConstraintCoincidence_52") -SketchConstraintCoincidence_65 = Sketch_4.setCoincident(SketchArc_16.center(), SketchLine_30.result()) -SketchConstraintCoincidence_65.setName("SketchConstraintCoincidence_53") -SketchArc_17 = Sketch_4.addArc(-3.457737973711317, -7.36102368218484e-015, -6.25, -1.033423289663963e-025, -4.894355280416407, -2.394338726595456, False) -SketchArc_17.setName("SketchArc_8") -SketchArc_17.result().setName("SketchArc_8") -SketchArc_17.results()[1].setName("SketchArc_8_2") -SketchConstraintCoincidence_66 = Sketch_4.setCoincident(SketchArc_17.startPoint(), SketchAPI_Arc(SketchArc_14).startPoint()) -SketchConstraintCoincidence_66.setName("SketchConstraintCoincidence_54") -SketchConstraintCoincidence_67 = Sketch_4.setCoincident(SketchArc_17.center(), SketchAPI_Arc(SketchArc_14).center()) -SketchConstraintCoincidence_67.setName("SketchConstraintCoincidence_55") -SketchArc_18 = Sketch_4.addArc(-4.74373017345514e-021, 5.762896622852203, 3.086813683229417e-021, -3.75, -4.894355280416407, -2.394338726595456, True) -SketchArc_18.setName("SketchArc_9") -SketchArc_18.result().setName("SketchArc_9") -SketchArc_18.results()[1].setName("SketchArc_9_2") -SketchConstraintCoincidence_68 = Sketch_4.setCoincident(SketchArc_18.startPoint(), SketchAPI_Arc(SketchArc_15).startPoint()) -SketchConstraintCoincidence_68.setName("SketchConstraintCoincidence_56") -SketchConstraintCoincidence_69 = Sketch_4.setCoincident(SketchArc_18.center(), SketchAPI_Arc(SketchArc_15).center()) -SketchConstraintCoincidence_69.setName("SketchConstraintCoincidence_57") -SketchConstraintCoincidence_70 = Sketch_4.setCoincident(SketchArc_18.endPoint(), SketchArc_17.endPoint()) -SketchConstraintCoincidence_70.setName("SketchConstraintCoincidence_58") -SketchArc_19 = Sketch_4.addArc(2.702425115181704, 0.4276508736110897, 6.25, 0, 4.894344934278309, -2.394344934278312, True) +SketchArc_14.setName("SketchArc_5") +SketchArc_14.result().setName("SketchArc_5") +SketchArc_14.results()[1].setName("SketchArc_5_2") +SketchConstraintMirror_2_objects = [SketchArc_12.results()[1], SketchArc_13.results()[1], SketchArc_14.results()[1], SketchArc_15.results()[1]] +SketchConstraintMirror_2 = Sketch_4.addMirror(SketchLine_39.result(), SketchConstraintMirror_2_objects) +[SketchArc_16, SketchArc_17, SketchArc_18, SketchArc_19] = SketchConstraintMirror_2.mirrored() SketchArc_19.setName("SketchArc_10") SketchArc_19.result().setName("SketchArc_10") SketchArc_19.results()[1].setName("SketchArc_10_2") -SketchConstraintCoincidence_71 = Sketch_4.setCoincident(SketchArc_19.startPoint(), SketchArc_13.startPoint()) -SketchConstraintCoincidence_71.setName("SketchConstraintCoincidence_59") -SketchConstraintCoincidence_72 = Sketch_4.setCoincident(SketchArc_19.endPoint(), SketchAPI_Arc(SketchArc_15).endPoint()) -SketchConstraintCoincidence_72.setName("SketchConstraintCoincidence_60") +SketchArc_18.setName("SketchArc_9") +SketchArc_18.result().setName("SketchArc_9") +SketchArc_18.results()[1].setName("SketchArc_9_2") +SketchArc_17.setName("SketchArc_8") +SketchArc_17.result().setName("SketchArc_8") +SketchArc_17.results()[1].setName("SketchArc_8_2") +SketchArc_16.setName("SketchArc_7") +SketchArc_16.result().setName("SketchArc_7") +SketchArc_16.results()[1].setName("SketchArc_7_2") model.do() Sketch_5 = model.addSketch(Part_2_doc, model.defaultPlane("XOZ")) SketchArc_20 = Sketch_5.addArc(75, 0, 21.9522369740045, 53.01825004597796, 20.93617039352901, -51.98174995402206, False) @@ -605,58 +582,35 @@ SketchArc_22 = Sketch_6.addArc(3.457737973711348, 3.788069295318559e-014, 6.25, SketchArc_22.setName("SketchArc_4") SketchArc_22.result().setName("SketchArc_4") SketchArc_22.results()[1].setName("SketchArc_4_2") -SketchConstraintCoincidence_127 = Sketch_6.setCoincident(SketchArc_22.startPoint(), SketchLine_56.startPoint()) -SketchConstraintCoincidence_127.setName("SketchConstraintCoincidence_48") -SketchConstraintCoincidence_128 = Sketch_6.setCoincident(SketchArc_22.endPoint(), SketchArc_21.endPoint()) -SketchConstraintCoincidence_128.setName("SketchConstraintCoincidence_49") -SketchConstraintCoincidence_129 = Sketch_6.setCoincident(SketchArc_22.center(), SketchLine_53.result()) -SketchConstraintCoincidence_129.setName("SketchConstraintCoincidence_50") -SketchConstraintMirror_3 = Sketch_6.addMirror(SketchLine_60.result(), [SketchArc_22.results()[1]]) -[SketchArc_23] = SketchConstraintMirror_3.mirrored() -SketchArc_23.setName("SketchArc_5") -SketchArc_23.result().setName("SketchArc_5") -SketchArc_23.results()[1].setName("SketchArc_5_2") -SketchConstraintMirror_4 = Sketch_6.addMirror(SketchLine_61.result(), [SketchArc_21.results()[1]]) -[SketchArc_24] = SketchConstraintMirror_4.mirrored() +SketchConstraintCoincidence_117 = Sketch_6.setCoincident(SketchArc_22.startPoint(), SketchLine_56.startPoint()) +SketchConstraintCoincidence_117.setName("SketchConstraintCoincidence_48") +SketchConstraintCoincidence_118 = Sketch_6.setCoincident(SketchArc_22.endPoint(), SketchArc_21.endPoint()) +SketchConstraintCoincidence_118.setName("SketchConstraintCoincidence_49") +SketchConstraintCoincidence_119 = Sketch_6.setCoincident(SketchArc_22.center(), SketchLine_53.result()) +SketchConstraintCoincidence_119.setName("SketchConstraintCoincidence_50") +SketchConstraintMirror_3 = Sketch_6.addMirror(SketchLine_61.result(), [SketchArc_22.results()[1], SketchArc_21.results()[1]]) +[SketchArc_23, SketchArc_24] = SketchConstraintMirror_3.mirrored() SketchArc_24.setName("SketchArc_6") SketchArc_24.result().setName("SketchArc_6") SketchArc_24.results()[1].setName("SketchArc_6_2") -SketchArc_25 = Sketch_6.addArc(0, -5.762896622852197, 0, 3.75, -4.894344934278309, 2.394344934278312, False) -SketchArc_25.setName("SketchArc_7") -SketchArc_25.result().setName("SketchArc_7") -SketchArc_25.results()[1].setName("SketchArc_7_2") -SketchConstraintCoincidence_130 = Sketch_6.setCoincident(SketchArc_25.startPoint(), SketchArc_21.startPoint()) -SketchConstraintCoincidence_130.setName("SketchConstraintCoincidence_51") -SketchConstraintCoincidence_131 = Sketch_6.setCoincident(SketchArc_25.endPoint(), SketchAPI_Arc(SketchArc_23).endPoint()) -SketchConstraintCoincidence_131.setName("SketchConstraintCoincidence_52") -SketchConstraintCoincidence_132 = Sketch_6.setCoincident(SketchArc_25.center(), SketchLine_51.result()) -SketchConstraintCoincidence_132.setName("SketchConstraintCoincidence_53") -SketchArc_26 = Sketch_6.addArc(-3.457737973711317, -7.36102368218484e-015, -6.25, -1.033423289663963e-025, -4.894346087140616, -2.39434424257408, False) -SketchArc_26.setName("SketchArc_8") -SketchArc_26.result().setName("SketchArc_8") -SketchArc_26.results()[1].setName("SketchArc_8_2") -SketchConstraintCoincidence_133 = Sketch_6.setCoincident(SketchArc_26.startPoint(), SketchAPI_Arc(SketchArc_23).startPoint()) -SketchConstraintCoincidence_133.setName("SketchConstraintCoincidence_54") -SketchConstraintCoincidence_134 = Sketch_6.setCoincident(SketchArc_26.center(), SketchAPI_Arc(SketchArc_23).center()) -SketchConstraintCoincidence_134.setName("SketchConstraintCoincidence_55") -SketchArc_27 = Sketch_6.addArc(-4.74373017345514e-021, 5.762896622852203, 3.086813683229417e-021, -3.75, -4.894346087140616, -2.39434424257408, True) -SketchArc_27.setName("SketchArc_9") -SketchArc_27.result().setName("SketchArc_9") -SketchArc_27.results()[1].setName("SketchArc_9_2") -SketchConstraintCoincidence_135 = Sketch_6.setCoincident(SketchArc_27.startPoint(), SketchAPI_Arc(SketchArc_24).startPoint()) -SketchConstraintCoincidence_135.setName("SketchConstraintCoincidence_56") -SketchConstraintCoincidence_136 = Sketch_6.setCoincident(SketchArc_27.center(), SketchAPI_Arc(SketchArc_24).center()) -SketchConstraintCoincidence_136.setName("SketchConstraintCoincidence_57") -SketchConstraintCoincidence_137 = Sketch_6.setCoincident(SketchArc_27.endPoint(), SketchArc_26.endPoint()) -SketchConstraintCoincidence_137.setName("SketchConstraintCoincidence_58") -SketchArc_28 = Sketch_6.addArc(2.702093420313011, 0.4278386760279786, 6.25, 0, 4.894344934278309, -2.394344934278312, True) +SketchArc_23.setName("SketchArc_5") +SketchArc_23.result().setName("SketchArc_5") +SketchArc_23.results()[1].setName("SketchArc_5_2") +SketchConstraintMirror_4_objects = [SketchArc_21.results()[1], SketchArc_22.results()[1], SketchArc_23.results()[1], SketchArc_24.results()[1]] +SketchConstraintMirror_4 = Sketch_6.addMirror(SketchLine_60.result(), SketchConstraintMirror_4_objects) +[SketchArc_25, SketchArc_26, SketchArc_27, SketchArc_28] = SketchConstraintMirror_4.mirrored() SketchArc_28.setName("SketchArc_10") SketchArc_28.result().setName("SketchArc_10") SketchArc_28.results()[1].setName("SketchArc_10_2") -SketchConstraintCoincidence_138 = Sketch_6.setCoincident(SketchArc_28.startPoint(), SketchArc_22.startPoint()) -SketchConstraintCoincidence_138.setName("SketchConstraintCoincidence_59") -SketchConstraintCoincidence_139 = Sketch_6.setCoincident(SketchArc_28.endPoint(), SketchAPI_Arc(SketchArc_24).endPoint()) -SketchConstraintCoincidence_139.setName("SketchConstraintCoincidence_60") +SketchArc_27.setName("SketchArc_9") +SketchArc_27.result().setName("SketchArc_9") +SketchArc_27.results()[1].setName("SketchArc_9_2") +SketchArc_26.setName("SketchArc_8") +SketchArc_26.result().setName("SketchArc_8") +SketchArc_26.results()[1].setName("SketchArc_8_2") +SketchArc_25.setName("SketchArc_7") +SketchArc_25.result().setName("SketchArc_7") +SketchArc_25.results()[1].setName("SketchArc_7_2") model.do() Sketch_7 = model.addSketch(Part_3_doc, model.defaultPlane("XOZ")) SketchArc_29 = Sketch_7.addArc(75, 0, 21.9522369740045, 53.01825004597796, 20.93617039352901, -51.98174995402206, False) @@ -879,52 +833,29 @@ SketchConstraintCoincidence_195 = Sketch_8.setCoincident(SketchArc_31.endPoint() SketchConstraintCoincidence_195.setName("SketchConstraintCoincidence_49") SketchConstraintCoincidence_196 = Sketch_8.setCoincident(SketchArc_31.center(), SketchLine_74.result()) SketchConstraintCoincidence_196.setName("SketchConstraintCoincidence_50") -SketchConstraintMirror_5 = Sketch_8.addMirror(SketchLine_81.result(), [SketchArc_31.results()[1]]) -[SketchArc_32] = SketchConstraintMirror_5.mirrored() -SketchArc_32.setName("SketchArc_5") -SketchArc_32.result().setName("SketchArc_5") -SketchArc_32.results()[1].setName("SketchArc_5_2") -SketchConstraintMirror_6 = Sketch_8.addMirror(SketchLine_82.result(), [SketchArc_30.results()[1]]) -[SketchArc_33] = SketchConstraintMirror_6.mirrored() +SketchConstraintMirror_5 = Sketch_8.addMirror(SketchLine_82.result(), [SketchArc_31.results()[1], SketchArc_30.results()[1]]) +[SketchArc_32, SketchArc_33] = SketchConstraintMirror_5.mirrored() SketchArc_33.setName("SketchArc_6") SketchArc_33.result().setName("SketchArc_6") SketchArc_33.results()[1].setName("SketchArc_6_2") -SketchArc_34 = Sketch_8.addArc(0, -5.762896622852197, 0, 3.75, -4.894344934278309, 2.394344934278312, False) -SketchArc_34.setName("SketchArc_7") -SketchArc_34.result().setName("SketchArc_7") -SketchArc_34.results()[1].setName("SketchArc_7_2") -SketchConstraintCoincidence_197 = Sketch_8.setCoincident(SketchArc_34.startPoint(), SketchArc_30.startPoint()) -SketchConstraintCoincidence_197.setName("SketchConstraintCoincidence_51") -SketchConstraintCoincidence_198 = Sketch_8.setCoincident(SketchArc_34.endPoint(), SketchAPI_Arc(SketchArc_32).endPoint()) -SketchConstraintCoincidence_198.setName("SketchConstraintCoincidence_52") -SketchConstraintCoincidence_199 = Sketch_8.setCoincident(SketchArc_34.center(), SketchLine_72.result()) -SketchConstraintCoincidence_199.setName("SketchConstraintCoincidence_53") -SketchArc_35 = Sketch_8.addArc(-3.457737973711317, -7.36102368218484e-015, -6.25, -1.033423289663963e-025, -4.894328381528049, -2.394354865905634, False) -SketchArc_35.setName("SketchArc_8") -SketchArc_35.result().setName("SketchArc_8") -SketchArc_35.results()[1].setName("SketchArc_8_2") -SketchConstraintCoincidence_200 = Sketch_8.setCoincident(SketchArc_35.startPoint(), SketchAPI_Arc(SketchArc_32).startPoint()) -SketchConstraintCoincidence_200.setName("SketchConstraintCoincidence_54") -SketchConstraintCoincidence_201 = Sketch_8.setCoincident(SketchArc_35.center(), SketchAPI_Arc(SketchArc_32).center()) -SketchConstraintCoincidence_201.setName("SketchConstraintCoincidence_55") -SketchArc_36 = Sketch_8.addArc(-4.74373017345514e-021, 5.762896622852203, 3.086813683229417e-021, -3.75, -4.894328381528049, -2.394354865905634, True) -SketchArc_36.setName("SketchArc_9") -SketchArc_36.result().setName("SketchArc_9") -SketchArc_36.results()[1].setName("SketchArc_9_2") -SketchConstraintCoincidence_202 = Sketch_8.setCoincident(SketchArc_36.startPoint(), SketchAPI_Arc(SketchArc_33).startPoint()) -SketchConstraintCoincidence_202.setName("SketchConstraintCoincidence_56") -SketchConstraintCoincidence_203 = Sketch_8.setCoincident(SketchArc_36.center(), SketchAPI_Arc(SketchArc_33).center()) -SketchConstraintCoincidence_203.setName("SketchConstraintCoincidence_57") -SketchConstraintCoincidence_204 = Sketch_8.setCoincident(SketchArc_36.endPoint(), SketchArc_35.endPoint()) -SketchConstraintCoincidence_204.setName("SketchConstraintCoincidence_58") -SketchArc_37 = Sketch_8.addArc(2.701932032626286, 0.4279300522100024, 6.25, 0, 4.894344934278309, -2.394344934278312, True) +SketchArc_32.setName("SketchArc_5") +SketchArc_32.result().setName("SketchArc_5") +SketchArc_32.results()[1].setName("SketchArc_5_2") +SketchConstraintMirror_6_objects = [SketchArc_30.results()[1], SketchArc_31.results()[1], SketchArc_32.results()[1], SketchArc_33.results()[1]] +SketchConstraintMirror_6 = Sketch_8.addMirror(SketchLine_81.result(), SketchConstraintMirror_6_objects) +[SketchArc_34, SketchArc_35, SketchArc_36, SketchArc_37] = SketchConstraintMirror_6.mirrored() SketchArc_37.setName("SketchArc_10") SketchArc_37.result().setName("SketchArc_10") SketchArc_37.results()[1].setName("SketchArc_10_2") -SketchConstraintCoincidence_205 = Sketch_8.setCoincident(SketchArc_37.startPoint(), SketchArc_31.startPoint()) -SketchConstraintCoincidence_205.setName("SketchConstraintCoincidence_59") -SketchConstraintCoincidence_206 = Sketch_8.setCoincident(SketchArc_37.endPoint(), SketchAPI_Arc(SketchArc_33).endPoint()) -SketchConstraintCoincidence_206.setName("SketchConstraintCoincidence_60") +SketchArc_36.setName("SketchArc_9") +SketchArc_36.result().setName("SketchArc_9") +SketchArc_36.results()[1].setName("SketchArc_9_2") +SketchArc_35.setName("SketchArc_8") +SketchArc_35.result().setName("SketchArc_8") +SketchArc_35.results()[1].setName("SketchArc_8_2") +SketchArc_34.setName("SketchArc_7") +SketchArc_34.result().setName("SketchArc_7") +SketchArc_34.results()[1].setName("SketchArc_7_2") model.do() Sketch_9 = model.addSketch(Part_4_doc, model.defaultPlane("XOZ")) SketchArc_38 = Sketch_9.addArc(75, 0, 21.9522369740045, 53.01825004597796, 20.93617039352901, -51.98174995402206, False) @@ -1151,7 +1082,7 @@ model.testNbSubShapes(Translation_4, GeomAPI_Shape.SOLID, [1, 1, 1]) model.testNbSubShapes(Translation_4, GeomAPI_Shape.FACE, [19, 19, 19]) model.testNbSubShapes(Translation_4, GeomAPI_Shape.EDGE, [102, 102, 102]) model.testNbSubShapes(Translation_4, GeomAPI_Shape.VERTEX, [204, 204, 204]) -model.testResultsVolumes(Translation_4, [11001.773459236308553954586386681, 11001.767903866752021713182330132, 11001.765201230666207266040146351]) +model.testResultsVolumes(Translation_4, [11018.354015402081131469458341599, 11018.354015402081131469458341599, 11018.354015402081131469458341599]) model.testNbResults(Rotation_6, 1) model.testNbSubResults(Rotation_6, [0]) @@ -1159,7 +1090,7 @@ model.testNbSubShapes(Rotation_6, GeomAPI_Shape.SOLID, [1]) model.testNbSubShapes(Rotation_6, GeomAPI_Shape.FACE, [19]) model.testNbSubShapes(Rotation_6, GeomAPI_Shape.EDGE, [102]) model.testNbSubShapes(Rotation_6, GeomAPI_Shape.VERTEX, [204]) -model.testResultsVolumes(Rotation_6, [11001.767903866750202723778784275]) +model.testResultsVolumes(Rotation_6, [11018.354015402079312480054795742]) model.testNbResults(Rotation_7, 1) model.testNbSubResults(Rotation_7, [0]) @@ -1167,7 +1098,7 @@ model.testNbSubShapes(Rotation_7, GeomAPI_Shape.SOLID, [1]) model.testNbSubShapes(Rotation_7, GeomAPI_Shape.FACE, [19]) model.testNbSubShapes(Rotation_7, GeomAPI_Shape.EDGE, [102]) model.testNbSubShapes(Rotation_7, GeomAPI_Shape.VERTEX, [204]) -model.testResultsVolumes(Rotation_7, [11001.765201230671664234250783920]) +model.testResultsVolumes(Rotation_7, [11018.354015402079312480054795742]) model.testNbResults(Part_5, 1) model.testNbSubResults(Part_5, [0]) -- 2.39.2