*included with pyprocessing*) from jEdit. Get my jEdit macro and commando files here. See screenshot here. I've just found a simple way to do it by using pyglet calls directly in your sketch in the draw loop:-

pyglet.image.get_buffer_managerdid the trick for me.().get_color_buffer().save('screenshot.png')

frompyprocessingimport*frommathimportsin, cos, tan, exp, pi A=0.8 B=1.4 pvect=[]defgetX(theta):returnA*cos(theta)*exp(theta/tan(B))defgetY(theta):returnA*sin(theta)*exp(theta/tan(B))defsetup():size(400, 400)background(255)translate(width/2, height/3)rotate(0.75*pi)foriinrange(0, 41):x=getX(i*A)y=getY(i*A)pvect.append(PVector(x, y))forzinrange(8,len(pvect)):tmp0=pvect[z] tmp1=pvect[z-1] tmp2=pvect[z-8] tmp3=pvect[z-7] x0=tmp0.x y0=tmp0.y x1=tmp1.x # we would have negative increments otherwise y1=tmp1.y x2=tmp2.x y2=tmp2.y x3=tmp3.x # we would have negative increments otherwise y3=tmp3.y curveTightness(-0.8)curve(x0, y0, x1, y1, x2, y2, x3, y3)# draw the radial lines strokeWeight(4)stroke(255, 0, 0)noFill()curveTightness(0.0)beginShape()# begin spiral 'shell' shapeforvinrange(0,len(pvect)):tmp=pvect[v] curveVertex(tmp.x, tmp.y)# successive calls to curveVertex a variation on curve? endShape()run()

## No comments:

## Post a Comment