Example #1
0
def to_ipe(*args):
    #global num, r0, dr

    for num in xrange(-9, 1):
        drawipe.clear()
        pln = n.to_plane(r0 + num * dr)
        drawipe.setup_plane(pln, 10)

        for p in pln.touch(vhex.has(ds1)):
            drawipe(p, r=0.02, color=(0, 1, 0))

        for p in pln.touch(vhex.has(ds2)):
            drawipe(p, r=0.04, color=(1, 0, 0))

        drawipe(vhex)
        #drawipe( vo21 )
        #drawipe( vo22 )
        drawipe.save('/tmp/%s.ipe' % abs(num))

    drawipe.clear()
    drawipe.setup_plane(pln, 10)
    import math
    drawipe.th -= math.pi / 2
    drawipe(vhex)
    for p in vhex.has(ds1):
        drawipe(p, r=0.02, color=(0, 1, 0))

    for p in vhex.has(ds2):
        drawipe(p, r=0.04, color=(1, 0, 0))
    drawipe.save('/tmp/sheme.ipe')
Example #2
0
def to_ipe( *args ):
    #global num, r0, dr

    for num in xrange( -9, 1 ):
        drawipe.clear()
        pln = n.to_plane( r0 + num * dr )
        drawipe.setup_plane( pln, 10 )

        for p in pln.touch( vhex.has( ds1 ) ):
            drawipe( p, r=0.02, color = (0,1,0) )

        for p in pln.touch( vhex.has( ds2 ) ):
            drawipe( p, r=0.04, color = (1,0,0) )

        drawipe( vhex )
        #drawipe( vo21 )
        #drawipe( vo22 )
        drawipe.save( '/tmp/%s.ipe' % abs( num ) )

    drawipe.clear()
    drawipe.setup_plane( pln, 10 )
    import math
    drawipe.th -= math.pi / 2
    drawipe( vhex )
    for p in vhex.has( ds1 ):
        drawipe( p, r=0.02, color = (0,1,0) )

    for p in vhex.has( ds2 ):
        drawipe( p, r=0.04, color = (1,0,0) )
    drawipe.save( '/tmp/sheme.ipe' )
Example #3
0
def to_ipe( *args, **kargs ):
    #from math import *
    #al, th = drawgl.gl.alpha * pi / 180, drawgl.gl.theta * pi / 180
    #als = ( al, -al, al + pi / 2, al - pi / 2 )
    #ths = ( th, -th, th + pi / 2, th - pi / 2 )
    #for ai, al in enumerate( als ):
    #    for ti, th in enumerate( ths ):
    #        drawipe.setup( al, th, drawgl.gl.dist )
    #        drawipe.clear()
    #        drawipe.group()
    #        drawipe( v1, style = 'line' )
    #        drawipe( v2, style = 'line' )
    #        drawipe( v3, style = 'line' )
    #        drawipe.save( '/tmp/out_%s_%s.ipe' % ( ai, ti ) )
            
    #for i in xrange( 1,9 ):
    #    getattr( drawipe, 'setup_drawgl' + str( i ) )( drawgl )
    #    drawipe.clear()
    #    drawipe.group()
    #    drawipe( vo )
    #    drawipe.save( '/tmp/out%s.ipe' % i )

    drawipe.setup_drawgl( drawgl )
    drawipe.clear()
    drawipe.group()
    drawipe( vo )
    drawipe.save( '/tmp/out.ipe' )
Example #4
0
 def save2ipe(*args):
     from draw_ipe import drawipe
     i = 0
     fname = '/tmp/out_%s.ipe'
     while os.path.exists(fname % i):
         i += 1
     fname = fname % i
     print 'saving to %s...' % fname
     drawipe.setup_drawgl(drawgl)
     draw_with(drawipe)
     drawipe.save(fname)
Example #5
0
File: uctool.py Project: ont/cbox
 def save2ipe( *args ):
     from draw_ipe import drawipe
     i = 0
     fname = '/tmp/out_%s.ipe'
     while os.path.exists( fname % i ):
         i += 1
     fname = fname % i
     print 'saving to %s...' % fname
     drawipe.setup_drawgl( drawgl )
     draw_with( drawipe )
     drawipe.save( fname )
Example #6
0
def view2ipe(*args):
    import math
    drawipe.clear()

    for v in ucm.atoms['A']:
        drawipe(v)

    for v in ucm.atoms['B']:
        drawipe(v, r=0.1, color=(1, 0, 0))

    for v in ucm.rep:
        drawipe(v, style='line', color=(0, 1, 0))

    drawipe.ortho = True
    drawipe.th = drawgl.gl.theta * math.pi / 180
    drawipe.al = drawgl.gl.alpha * math.pi / 180
    drawipe.dist = drawgl.gl.dist
    drawipe.save('/tmp/sheme.ipe')
Example #7
0
def view2ipe( *args ):
    import math
    drawipe.clear()

    for v in ucm.atoms['A']:
        drawipe( v )

    for v in ucm.atoms['B']:
        drawipe( v, r = 0.1, color = (1,0,0) )

    for v in ucm.rep:
        drawipe( v, style = 'line', color = (0,1,0) )

    drawipe.ortho = True
    drawipe.th   = drawgl.gl.theta * math.pi / 180
    drawipe.al   = drawgl.gl.alpha * math.pi / 180
    drawipe.dist = drawgl.gl.dist
    drawipe.save( '/tmp/sheme.ipe' )
Example #8
0
print 'translateional matrix:', m.inv()
print 'invert translateional matrix:', m
print 'lattice reper', r
print 'sublattice reper', sr
vo = Voron(*r)
vos = Voron(*sr)
drawgl(vo)
drawgl(vos)
drawipe(vo)
drawipe(vos)

drawgl(sr[0], style='line')
drawgl(sr[1], style='line')
drawgl(sr[2], style='line')


## button for output camera angles and distance
def pinfo(some):
    print drawgl.gl.alpha, drawgl.gl.theta, drawgl.gl.dist


drawgl.button('camera info', pinfo)

## save picture to ipe file
import math
drawipe.setup(24.0 * math.pi / 180, 128.0 * math.pi / 180, 27.207602388)
#drawipe.setup( -13.0 * math.pi / 180, +65.0 * math.pi / 180, 15.559717968 )
drawipe.save('/tmp/test4.ipe')

drawgl.start()
Example #9
0
def ipe2file(*args):
    drawipe.save('/tmp/test.ipe')
    drawipe.clear()
Example #10
0
def ipe2file( *args ):
    drawipe.save( '/tmp/test.ipe' )
    drawipe.clear()
Example #11
0
drawgl( vo )
drawgl( vos )
drawipe( vo )
drawipe( vos )

drawgl( sr[ 0 ], style = 'line' )
drawgl( sr[ 1 ], style = 'line' )
drawgl( sr[ 2 ], style = 'line' )

## additional testing for conversion of cubic sublattice to volume-centered...
m_vc = Mat( 1.0, 0.0, 0.0,
            0.0, 1.0, 0.0,
            0.5, 0.5, 0.5 )

print mv * m_vc.inv()


## button for output camera angles and distance
def pinfo( some ):
    print drawgl.gl.alpha, drawgl.gl.theta, drawgl.gl.dist
drawgl.button( 'camera info', pinfo )

import math
drawipe.setup( -13.0 * math.pi / 180, +65.0 * math.pi / 180, 15.559717968 )
drawipe.save( '/tmp/test3.ipe' )

drawgl.gl.alpha, drawgl.gl.theta, drawgl.gl.dist = -65.0, 13.0, 15.559717968   ## beauty parameters
drawgl.start()


Example #12
0
from vec import *
from mat import *
from zell import *
from voron import *
from reper import *

import zell2reper

## drawing
import vec_gl
import voron_gl
from draw_gl import drawgl
from draw_ipe import drawipe

r = Zell(-1, -0, -1, -1, -2, -1).to_reper()
print r
vo = Voron(*r)
drawgl(vo)
drawgl.start()

drawipe.setup(0, 0.2, 30)

for x in xrange(5 + 1):
    r = Zell(-1, -0, -1, -1, -2 + 0.4 * x, -1).to_reper()
    print r
    vo = Voron(*r)
    drawipe.group()  ## add each dirichlet cell to new group
    drawipe(vo)

drawipe.save('/tmp/Q2_to_K3.ipe')
Example #13
0
from zell  import *
from voron import *
from reper import *

import zell2reper

## drawing
import vec_gl
import voron_gl
from draw_gl import drawgl
from draw_ipe import drawipe


r = Zell( -1, -0, -1, -1, -2, -1 ).to_reper()
print r
vo = Voron( *r )
drawgl( vo )
drawgl.start()


drawipe.setup( 0, 0.2, 30 )

for x in xrange( 5 + 1 ):
    r = Zell( -1, -0, -1, -1, -2 + 0.4 * x, -1 ).to_reper()
    print r
    vo = Voron( *r )
    drawipe.group()   ## add each dirichlet cell to new group
    drawipe( vo )

drawipe.save( '/tmp/Q2_to_K3.ipe' )