Hans Petter Langtangen před 10 roky
rodič
revize
19d6a9500c

+ 1 - 1
examples/ForwardEuler.py

@@ -85,4 +85,4 @@ comic = 'comic' if xkcd else 'non_comic'
 os.system('doconce combine_images pdf -2 tmp1 tmp2 FE_%s_strip' % comic)
 os.system('doconce combine_images png -2 tmp1 tmp2 FE_%s_strip' % comic)
 
-raw_input()
+input()

+ 1 - 1
examples/beam1.py

@@ -29,4 +29,4 @@ drawing_tool.display()
 
 #test_Dashpot(xpos+2*W)
 
-raw_input()
+input()

+ 6 - 5
examples/beam2.py

@@ -25,7 +25,7 @@ clamped = Rectangle(A - point(h,0) - point(0,2*h), h,
 
 load = ConstantBeamLoad(A + point(0,H), L, H)
 load.set_linewidth(1).set_linecolor('black')
-load_text = Text('$w$', load.mid_top + point(0,h/2.))
+load_text = Text('$w$', load.geometric_features()['mid_top'] + point(0,h/2.))
 
 B = A + point(a, 0)
 C = B + point(b, 0)
@@ -35,7 +35,7 @@ support = SimplySupportedBeam(B, h)  # pt B is simply supported
 
 R1 = Force(A-point(0,2*H), A, '$R_1$', text_spacing=1./20)
 R1.set_linewidth(3).set_linecolor('black')
-R2 = Force(B-point(0,2*H), support.mid_support,
+R2 = Force(B-point(0,2*H), support.geometric_features()['mid_support'],
            '$R_2$', text_spacing=1./20)
 R2.set_linewidth(3).set_linecolor('black')
 M1 = Moment('$M_1$', center=A + point(-H, H/2), radius=H/2,
@@ -49,12 +49,13 @@ dims = Composition({'a': a_dim, 'b': b_dim})
 symbols = Composition({'R1': R1, 'R2': R2, 'M1': M1,
                        'w': load, 'w text': load_text,
                        'A': Text('$A$', A+point(0.7*h,-0.9*h)),
-                       'B': Text('$B$', support.mid_support-point(h,0)),
+                       'B': Text('$B$', support.geometric_features()['mid_support']-point(h,0)),
                        'C': Text('$C$', C+point(h/2,-h/2))})
 
 x_axis = Axis(A + point(L+h, H/2), 2*H, '$x$',).set_linecolor('black')
 y_axis = Axis(A + point(0,H/2), 3.5*H, '$y$',
-              below=False, rotation_angle=90).set_linecolor('black')
+              label_alignment='left',
+              rotation_angle=90).set_linecolor('black')
 axes = Composition({'x axis': x_axis, 'y axis': y_axis})
 
 annotations = Composition({'dims': dims, 'symbols': symbols,
@@ -97,4 +98,4 @@ drawing_tool.savefig('tmp_beam2_3.png')
 
 #test_Dashpot(xpos+2*W)
 
-raw_input()
+input()

+ 1 - 1
examples/finite_differences.py

@@ -131,5 +131,5 @@ mesh_cn.draw()
 drawing_tool.display()
 drawing_tool.savefig('fd_centered_CN')
 
-raw_input()
+input()
 

+ 1 - 1
examples/flow_over_gaussian.py

@@ -57,4 +57,4 @@ symbols.draw()
 drawing_tool.display()
 drawing_tool.savefig('tmp1')
 
-raw_input()
+input()

+ 2 - 2
examples/integral.py

@@ -36,7 +36,7 @@ fig.draw()
 drawing_tool.display()
 drawing_tool.savefig('tmp1')
 
-#raw_input()
+#input()
 
 # Draw piecewise curve for midpoint rule
 def piecewise_curve_for_midpoint_rule(N):
@@ -84,4 +84,4 @@ comic = 'comic' if xkcd else 'non_comic'
 os.system('doconce combine_images pdf -3 tmp1 tmp2 tmp3 integral_%s_strip' % comic)
 os.system('doconce combine_images png -3 tmp1 tmp2 tmp3 integral_%s_strip' % comic)
 
-raw_input()
+input()

+ 1 - 1
examples/layered_medium_2.py

@@ -27,4 +27,4 @@ fig.draw()
 drawing_tool.display()
 drawing_tool.savefig('tmp2')
 
-raw_input()
+input()

+ 1 - 1
examples/layered_medium_3xi.py

@@ -27,4 +27,4 @@ fig.draw()
 drawing_tool.display()
 drawing_tool.savefig('tmp2')
 
-raw_input()
+input()

+ 1 - 1
examples/layered_medium_general.py

@@ -29,4 +29,4 @@ fig.draw()
 drawing_tool.display()
 drawing_tool.savefig('tmp1')
 
-raw_input()
+input()

+ 1 - 1
examples/mesh_function.py

@@ -82,5 +82,5 @@ interpolant.draw()
 drawing_tool.display()
 drawing_tool.savefig('%s_ui' % illustration.get_name())
 
-raw_input()
+input()
 

+ 1 - 1
examples/osc1.py

@@ -79,4 +79,4 @@ fig['F_force'] = F_force
 fig.draw()
 drawing_tool.savefig('tmp_oscillator_general')
 
-raw_input()
+input()

+ 1 - 1
examples/osc2.py

@@ -70,4 +70,4 @@ fig['F_force'] = F_force
 fig.draw()
 drawing_tool.savefig('tmp_oscillator2_force')
 
-raw_input()
+input()

+ 2 - 2
examples/pendulum.py

@@ -53,7 +53,7 @@ drawing_tool.display()
 drawing_tool.savefig('tmp_pendulum1')
 
 # Draw body diagram
-raw_input('Press Return to make body diagram: ')
+input('Press Return to make body diagram: ')
 #import time; time.sleep(3)
 drawing_tool.erase()
 
@@ -110,4 +110,4 @@ body_diagram.draw()
 #drawing_tool.display('Body diagram')
 drawing_tool.savefig('tmp_pendulum5')
 
-raw_input()
+input()

+ 1 - 1
examples/staggered_mesh_function.py

@@ -78,5 +78,5 @@ v_exact.draw()
 drawing_tool.display()
 drawing_tool.savefig('%s_uve' % illustration.get_name())
 
-raw_input()
+input()
 

+ 1 - 1
examples/wheel_on_inclined_plane.py

@@ -97,4 +97,4 @@ def inclined_plane():
     print(repr(fig))
 
 inclined_plane()
-raw_input()
+input()

+ 2 - 2
pysketcher/shapes.py

@@ -1584,7 +1584,7 @@ class SimplySupportedBeam(Shape):
     def geometric_features(self):
         t = self.shapes['triangle']
         r = self.shapes['rectangle']
-        d = {'pos': point(t.x[2], t.y[2]),  # "p2"/pos
+        d = {'pos': t.geometric_features()['p2'],
              'mid_support': r.geometric_features()['lower_mid']}
         return d
 
@@ -1600,7 +1600,7 @@ class ConstantBeamLoad(Shape):
     ==================== =============================================
     Attribute            Description
     ==================== =============================================
-    mid_point            Middle point at the top of the row of
+    mid_top              Middle point at the top of the row of
                          arrows (often used for positioning a text).
     ==================== =============================================
     """