date_text = datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S") poly_text = "{0} vertices".format(N) t.SetText("CGAL::random_polygon_2\n" + date_text + "\n" + poly_text) myscreen.addActor(t) def drawGithub(myscreen): gittext = ovdvtk.Text() gittext.SetPos((50, 50)) gittext_text = "github.com/aewallin" gittext.SetText(gittext_text) myscreen.addActor(gittext) if __name__ == "__main__": print rpg.version() myscreen = ovdvtk.VTKScreen(width=1024, height=720) #(width=1920, height=1080) drawGithub(myscreen) # for screenshot writing: #w2if = vtk.vtkWindowToImageFilter() #w2if.SetInput(myscreen.renWin) #lwr = vtk.vtkPNGWriter() #lwr.SetInput( w2if.GetOutput() ) myscreen.render() camPos = 100 zmult = 0.1 # position the camera myscreen.camera.SetPosition(0, -camPos / float(1000), zmult * camPos) myscreen.camera.SetClippingRange(-(zmult + 1) * camPos,
import randompolygon as rpg print "This is randompolygon version ", rpg.version() #N = 2000 N=100 poly = rpg.rpg(N) print "generated random polygon with",N,"vertices" print "The vertices are:" n=0 for p in poly: print n," ",p n=n+1
import randompolygon as rpg print rpg.version() #N = 2000 N=100 poly = rpg.rpg(N) print "generated random polygon with",N,"vertices" print "The vertices are:" n=0 for p in poly: print n," ",p n=n+1
#import sys import randompolygon as rpg def timeRPG(N): t_before = time.time() polygon = rpg.rpg(N) t_after = time.time() times = [] times.append(t_after - t_before) return times if __name__ == "__main__": print "RPG version: ", rpg.version() Nmax_exp_start = 5 Nmax_exp_end = 20 # 10 -> 32 linesites # 14 -> 128 # 18 -> 512 # 20 -> 1024 # 24 -> 4096 # 28 -> 16384 # 32 -> 65536 # 33 -> 92681 # 34 -> 131072 # 35 -> 185363 # 36 -> 262144 exp_list = [0.5 * x for x in range(Nmax_exp_start, Nmax_exp_end + 1)]
#import os import csv #import sys import randompolygon as rpg def timeRPG(N): t_before = time.time() polygon= rpg.rpg(N) t_after = time.time() times=[] times.append(t_after-t_before) return times if __name__ == "__main__": print "RPG version: ",rpg.version() Nmax_exp_start = 5 Nmax_exp_end = 20 # 10 -> 32 linesites # 14 -> 128 # 18 -> 512 # 20 -> 1024 # 24 -> 4096 # 28 -> 16384 # 32 -> 65536 # 33 -> 92681 # 34 -> 131072 # 35 -> 185363 # 36 -> 262144