Пример #1
0
def plot(bzs):
    tocubic.plot_prolog()
    print('/ss 1.5 def')
    print(
        '/circle { ss 0 moveto currentpoint exch ss sub exch ss 0 360 arc } bind def'
    )
    fromcubic.plot_bzs(bzs, (100, 100), 0.25, fancy=True)
    print('showpage')
Пример #2
0
def simple_bez():
    eps_prologue(95, 126, 552, 508, 0)
    tocubic.plot_prolog()
    print '/ss 1.5 def'
    print '/circle { ss 0 moveto currentpoint exch ss sub exch ss 0 360 arc } bind def'
    bz, score = cornu_to_cubic(.5, 1.1, 2)
    fromcubic.plot_bzs([[bz]], (-400, 100), 1000, True)
    print 'stroke'
    print '/Times-Roman 12 selectfont'
    print '95 130 moveto ((x0, y0)) show'
    print '360 200 moveto ((x1, y1)) show'
    print '480 340 moveto ((x2, y2)) show'
    print '505 495 moveto ((x3, y3)) show'
    print 'showpage'
    eps_trailer()
Пример #3
0
def simple_bez():
    eps_prologue(95, 126, 552, 508, 0)
    tocubic.plot_prolog()
    print '/ss 1.5 def'
    print '/circle { ss 0 moveto currentpoint exch ss sub exch ss 0 360 arc } bind def'
    bz, score = cornu_to_cubic(.5, 1.1, 2)
    fromcubic.plot_bzs([[bz]], (-400, 100), 1000, True)
    print 'stroke'
    print '/Times-Roman 12 selectfont'
    print '95 130 moveto ((x0, y0)) show'
    print '360 200 moveto ((x1, y1)) show'
    print '480 340 moveto ((x2, y2)) show'
    print '505 495 moveto ((x3, y3)) show'
    print 'showpage'
    eps_trailer()
Пример #4
0
def fast_bez(figno):
    if figno == 3:
        y1 = 520
    else:
        y1 = 550
    eps_prologue(95, 140, 552, y1, 0)
    tocubic.plot_prolog()
    print '/ss 1.5 def'
    print '/circle { ss 0 moveto currentpoint exch ss sub exch ss 0 360 arc } bind def'
    bz, score = cornu_to_cubic(.5, 1.1, figno)
    fromcubic.plot_bzs([[bz]], (-400, 100), 1000, True)
    print 'stroke'
    plot_k_nominal(.5, 1.1)
    plot_k_of_bz(bz)
    print 'showpage'
    eps_trailer()
Пример #5
0
def plot_tt_raw(bzs, fancy = True):
	x0 = 100
	y0 = 100
	scale = 0.25
	fromcubic.plot_bzs(raise_to_cubic(bzs), (x0, y0), scale)
	if fancy:
		for sp in bzs:
			for i in range(len(sp)):
				lastbz = sp[i - 1]
				bz = sp[i]
				if len(bz) != 3 or len(lastbz) != 3 or lerppt(0.5, lastbz[1], bz[1]) != bz[0]:
					x, y = bz[0]
					print 'gsave %f %f translate circle fill grestore' % (x * scale + x0, y * scale + y0)
				if len(bz) == 3:
					x, y = bz[1]
					print 'gsave %f %f translate circle stroke grestore' % (x * scale + x0, y * scale + y0)
Пример #6
0
def fast_bez(figno):
    if figno == 3:
        y1 = 520
    else:
        y1 = 550
    eps_prologue(95, 140, 552, y1, 0)
    tocubic.plot_prolog()
    print '/ss 1.5 def'
    print '/circle { ss 0 moveto currentpoint exch ss sub exch ss 0 360 arc } bind def'
    bz, score = cornu_to_cubic(.5, 1.1, figno)
    fromcubic.plot_bzs([[bz]], (-400, 100), 1000, True)
    print 'stroke'
    plot_k_nominal(.5, 1.1)
    plot_k_of_bz(bz)
    print 'showpage'
    eps_trailer()
Пример #7
0
def plot_tt_raw(bzs, fancy = True):
	x0 = 100
	y0 = 100
	scale = 0.25
	fromcubic.plot_bzs(raise_to_cubic(bzs), (x0, y0), scale)
	if fancy:
		for sp in bzs:
			for i in range(len(sp)):
				lastbz = sp[i - 1]
				bz = sp[i]
				if len(bz) != 3 or len(lastbz) != 3 or lerppt(0.5, lastbz[1], bz[1]) != bz[0]:
					x, y = bz[0]
					print 'gsave %f %f translate circle fill grestore' % (x * scale + x0, y * scale + y0)
				if len(bz) == 3:
					x, y = bz[1]
					print 'gsave %f %f translate circle stroke grestore' % (x * scale + x0, y * scale + y0)
Пример #8
0
def bezfig(s1):
    eps_prologue(95, 38, 510, 550, 0)
    #print '0.5 0.5 scale 500 100 translate'
    tocubic.plot_prolog()
    print '/ss 1.5 def'
    print '/circle { ss 0 moveto currentpoint exch ss sub exch ss 0 360 arc } bind def'
    bz, score = cornu_to_cubic(.5, 0.85, 1)
    fromcubic.plot_bzs([[bz]], (-400, 0), 1000, True)
    print 'stroke'
    plot_k_nominal(.5, 0.85)
    plot_k_of_bz(bz)
    bz, score = cornu_to_cubic(.5, 0.85, 2)
    fromcubic.plot_bzs([[bz]], (-400, 100), 1000, True)
    print 'stroke'
    print 'gsave 0 50 translate'
    plot_k_nominal(.5, .85)
    plot_k_of_bz(bz)
    print 'grestore'
    print 'showpage'
Пример #9
0
def bezfig(s1):
    eps_prologue(95, 38, 510, 550, 0)
    #print '0.5 0.5 scale 500 100 translate'
    tocubic.plot_prolog()
    print '/ss 1.5 def'
    print '/circle { ss 0 moveto currentpoint exch ss sub exch ss 0 360 arc } bind def'
    bz, score = cornu_to_cubic(.5, 0.85, 1)
    fromcubic.plot_bzs([[bz]], (-400, 0), 1000, True)
    print 'stroke'
    plot_k_nominal(.5, 0.85)
    plot_k_of_bz(bz)
    bz, score = cornu_to_cubic(.5, 0.85, 2)
    fromcubic.plot_bzs([[bz]], (-400, 100), 1000, True)
    print 'stroke'
    print 'gsave 0 50 translate'
    plot_k_nominal(.5, .85)
    plot_k_of_bz(bz)
    print 'grestore'
    print 'showpage'
Пример #10
0
def plot(bzs):
	tocubic.plot_prolog()
	print '/ss 1.5 def'
	print '/circle { ss 0 moveto currentpoint exch ss sub exch ss 0 360 arc } bind def'
	fromcubic.plot_bzs(bzs, (100, 100), 0.25, fancy = True)
	print 'showpage'