#else: # print '---', s, 'no' #def symmup( *args ): # global nelem # nelem += 1 # if nelem >= len( s ): # nelem -= 1 # symmdraw() # #def symmdown( *args ): # global nelem # nelem -= 1 # if nelem < 0: # nelem += 1 # symmdraw() drawgl.button('up', up) drawgl.button('down', down) drawgl.button('fill', fill_hex) drawgl.button('2ipe', to_ipe) drawgl.button('symm', symm) drawgl.button('symmtest', symmtest) drawgl.button('view2ipe', view2ipe) #drawgl.button( 'symmup', symmup ) #drawgl.button( 'symmdown', symmdown ) drawgl.select(sel) drawgl.start()
drawipe(x, r=0.04, color=(1, 0, 0)) for x in vo_h.has(ds2_h): drawipe(x, color=(0, 1, 0)) def ipe2file(*args): drawipe.save('/tmp/test.ipe') drawipe.clear() def bnext(*args): global pos pos += 1 redraw() def bprev(*args): global pos pos -= 1 redraw() drawgl.button("next", bnext) drawgl.button("prev", bprev) drawgl.button("toipe", to_ipe) drawgl.button("toipe2", to_ipe2) drawgl.button("ipe2file", ipe2file) drawgl.select(select) drawgl.start()
if type( obj ) is Vec: print obj def w_zn( *args ): drawgl.clear() drawgl( vo ) for v in zn: drawgl( v ) for vv in o: if abs( (v - vv).vlen() - d1 ) < 0.1: drawgl( Vec( *vv ), style='line', start=v ) drawgl( Vec( *vv ), r=0.1, color=(0,0,1) ) def w_si( *args ): drawgl.clear() drawgl( vo ) for v in si: drawgl( v ) for vv in o: if abs( (v - vv).vlen() - d2 ) < 0.1: drawgl( Vec( *vv ), style='line', start=v ) drawgl( Vec( *vv ), r=0.1, color=(0,0,1) ) drawgl.select( sel ) drawgl.button( 'w_zn', w_zn ) drawgl.button( 'w_si', w_si ) drawgl.start()
print 'len( basisA ) = ', len( basisA ) print 'len( basisB ) = ', len( basisB ) f.write( "rprim %s %s %s\n %s %s %s\n %s %s %s\n" % ( tuple( r[0] ) + tuple( r[1] ) + tuple( r[2] ) ) ) f.write( '-----------\n' ) for v in basisA: f.write( "%s %s %s\n" % tuple( v ) ) drawgl( r.frac2dec( v ), r=0.05, color = (0,0,1) ) f.write( '-----------\n' ) for v in basisB: f.write( "%s %s %s\n" % tuple( v ) ) drawgl( r.frac2dec( v ), r=0.05, color = (0,1,1) ) f.close() drawgl.button( "up" , up ) drawgl.button( "down", down ) drawgl.button( "toipe", to_ipe ) drawgl.button( "toipe2", to_ipe2 ) drawgl.button( "ipe2file", ipe2file ) drawgl.button( "mincell", min_cell ) drawgl.button( "cubic", cubic ) drawgl.select( select ) drawgl.start()