︠26bce40e-fd67-47ba-ac6f-d093771f93ccs︠ t = Tachyon(xres=1000, yres=800, camera_center=(2,7,4), look_at=(2,0,0), raydepth=4) t.light((10,3,2), 1, (1,1,1)) t.light((10,-3,2), 1, (1,1,1)) t.texture('black', color=(0,0,0)) t.texture('red', color=(1,0,0)) t.texture('grey', color=(.9,.9,.9)) t.plane((0,0,0),(0,0,1),'grey') t.cylinder((0,0,0),(1,0,0),.01,'black') t.cylinder((0,0,0),(0,1,0),.01,'black') E = EllipticCurve('37a') P = E([0,0]) Q = P n = 100 for i in range(n): Q = Q + P c = i/n + .1 t.texture('r%s'%i,color=(float(i/n),0,0)) t.sphere((Q[0], -Q[1], .01), .04, 'r%s'%i) show(t) ︡933548d3-3257-46b6-813d-259e05b1bfac︡{"file":{"filename":"/projects/4a5f0542-5873-4eed-a85c-a18c706e8bcd/.sage/temp/compute7-us/890/tmp_kOuAMM.png","show":true,"text":null,"uuid":"7e28704d-1f4c-43a1-8155-c2deac29cc07"},"once":false}︡{"done":true}︡ ︠20c7fec8-03d2-47d2-af2f-31b321a1bf5cs︠ Tachyon? ︡e216974a-4a68-497f-9d82-63af41a5b110︡{"code":{"filename":null,"lineno":-1,"mode":"text/x-rst","source":"File: /projects/sage/sage-7.5/local/lib/python2.7/site-packages/sage/plot/plot3d/tachyon.py\nDocstring :\nCreate a scene the can be rendered using the Tachyon ray tracer.\n\nINPUT:\n\n* \"xres\" - (default 350)\n\n* \"yres\" - (default 350)\n\n* \"zoom\" - (default 1.0)\n\n* \"antialiasing\" - (default \"False\")\n\n* \"aspectratio\" - (default 1.0)\n\n* \"raydepth\" - (default 5)\n\n* \"camera_center\" - (default (-3, 0, 0))\n\n* \"updir\" - (default (0, 0, 1))\n\n* \"look_at\" - (default (0,0,0))\n\n* \"viewdir\" - (default \"None\"), otherwise list of three numbers\n\n* \"projection\" - \"'PERSPECTIVE'\" (default), \"'perspective_dof'\"\n or \"'fisheye'\".\n\n* \"frustum\" - (default ''), otherwise list of four numbers. Only\n used with projection='fisheye'.\n\n* \"focallength\" - (default ''), otherwise a number. Only used\n with projection='perspective_dof'.\n\n* \"aperture\" - (default ''), otherwise a number. Only used with\n projection='perspective_dof'.\n\nOUTPUT: A Tachyon 3d scene.\n\nNote that the coordinates are by default such that z is up,\npositive y is to the {left} and x is toward you. This is not\noriented according to the right hand rule.\n\nEXAMPLES: Spheres along the twisted cubic.\n\n sage: t = Tachyon(xres=512,yres=512, camera_center=(3,0.3,0))\n sage: t.light((4,3,2), 0.2, (1,1,1))\n sage: t.texture('t0', ambient=0.1, diffuse=0.9, specular=0.5, opacity=1.0, color=(1.0,0,0))\n sage: t.texture('t1', ambient=0.1, diffuse=0.9, specular=0.3, opacity=1.0, color=(0,1.0,0))\n sage: t.texture('t2', ambient=0.2,diffuse=0.7, specular=0.5, opacity=0.7, color=(0,0,1.0))\n sage: k=0\n sage: for i in srange(-1,1,0.05):\n ....: k += 1\n ....: t.sphere((i,i^2-0.5,i^3), 0.1, 't%s'%(k%3))\n sage: t.show()\n\nAnother twisted cubic, but with a white background, got by putting\ninfinite planes around the scene.\n\n sage: t = Tachyon(xres=512,yres=512, camera_center=(3,0.3,0), raydepth=8)\n sage: t.light((4,3,2), 0.2, (1,1,1))\n sage: t.texture('t0', ambient=0.1, diffuse=0.9, specular=0.5, opacity=1.0, color=(1.0,0,0))\n sage: t.texture('t1', ambient=0.1, diffuse=0.9, specular=0.3, opacity=1.0, color=(0,1.0,0))\n sage: t.texture('t2', ambient=0.2,diffuse=0.7, specular=0.5, opacity=0.7, color=(0,0,1.0))\n sage: t.texture('white', color=(1,1,1))\n sage: t.plane((0,0,-1), (0,0,1), 'white')\n sage: t.plane((0,-20,0), (0,1,0), 'white')\n sage: t.plane((-20,0,0), (1,0,0), 'white')\n\n sage: k=0\n sage: for i in srange(-1,1,0.05):\n ....: k += 1\n ....: t.sphere((i,i^2 - 0.5,i^3), 0.1, 't%s'%(k%3))\n ....: t.cylinder((0,0,0), (0,0,1), 0.05,'t1')\n sage: t.show()\n\nMany random spheres:\n\n sage: t = Tachyon(xres=512,yres=512, camera_center=(2,0.5,0.5), look_at=(0.5,0.5,0.5), raydepth=4)\n sage: t.light((4,3,2), 0.2, (1,1,1))\n sage: t.texture('t0', ambient=0.1, diffuse=0.9, specular=0.5, opacity=1.0, color=(1.0,0,0))\n sage: t.texture('t1', ambient=0.1, diffuse=0.9, specular=0.3, opacity=1.0, color=(0,1.0,0))\n sage: t.texture('t2', ambient=0.2, diffuse=0.7, specular=0.5, opacity=0.7, color=(0,0,1.0))\n sage: k=0\n sage: for i in range(100):\n ....: k += 1\n ....: t.sphere((random(),random(), random()), random()/10, 't%s'%(k%3))\n sage: t.show()\n\nPoints on an elliptic curve, their height indicated by their height\nabove the axis:\n\n sage: t = Tachyon(camera_center=(5,2,2), look_at=(0,1,0))\n sage: t.light((10,3,2), 0.2, (1,1,1))\n sage: t.texture('t0', ambient=0.1, diffuse=0.9, specular=0.5, opacity=1.0, color=(1,0,0))\n sage: t.texture('t1', ambient=0.1, diffuse=0.9, specular=0.5, opacity=1.0, color=(0,1,0))\n sage: t.texture('t2', ambient=0.1, diffuse=0.9, specular=0.5, opacity=1.0, color=(0,0,1))\n sage: E = EllipticCurve('37a')\n sage: P = E([0,0])\n sage: Q = P\n sage: n = 100\n sage: for i in range(n): # increase 20 for a better plot\n ....: Q = Q + P\n ....: t.sphere((Q[1], Q[0], ZZ(i)/n), 0.1, 't%s'%(i%3))\n sage: t.show()\n\nA beautiful picture of rational points on a rank 1 elliptic curve.\n\n sage: t = Tachyon(xres=1000, yres=800, camera_center=(2,7,4), look_at=(2,0,0), raydepth=4)\n sage: t.light((10,3,2), 1, (1,1,1))\n sage: t.light((10,-3,2), 1, (1,1,1))\n sage: t.texture('black', color=(0,0,0))\n sage: t.texture('red', color=(1,0,0))\n sage: t.texture('grey', color=(.9,.9,.9))\n sage: t.plane((0,0,0),(0,0,1),'grey')\n sage: t.cylinder((0,0,0),(1,0,0),.01,'black')\n sage: t.cylinder((0,0,0),(0,1,0),.01,'black')\n sage: E = EllipticCurve('37a')\n sage: P = E([0,0])\n sage: Q = P\n sage: n = 100\n sage: for i in range(n):\n ....: Q = Q + P\n ....: c = i/n + .1\n ....: t.texture('r%s'%i,color=(float(i/n),0,0))\n ....: t.sphere((Q[0], -Q[1], .01), .04, 'r%s'%i)\n sage: t.show() # long time, e.g., 10-20 seconds\n\nA beautiful spiral.\n\n sage: t = Tachyon(xres=800,yres=800, camera_center=(2,5,2), look_at=(2.5,0,0))\n sage: t.light((0,0,100), 1, (1,1,1))\n sage: t.texture('r', ambient=0.1, diffuse=0.9, specular=0.5, opacity=1.0, color=(1,0,0))\n sage: for i in srange(0,50,0.1):\n ....: t.sphere((i/10,sin(i),cos(i)), 0.05, 'r')\n sage: t.texture('white', color=(1,1,1), opacity=1, specular=1, diffuse=1)\n sage: t.plane((0,0,-100), (0,0,-100), 'white')\n sage: t.show()\n\nIf the optional parameter \"viewdir\" is not set, the camera center\nshould not coincide with the point which is looked at (see\nhttps://trac.sagemath.org/7232):\n\n sage: t = Tachyon(xres=80,yres=80, camera_center=(2,5,2), look_at=(2,5,2))\n Traceback (most recent call last):\n ...\n ValueError: camera_center and look_at coincide\n\nUse of a fisheye lens perspective.\n\n sage: T = Tachyon(xres=800, yres=600, camera_center=(-1.5,-1.5,.3), projection='fisheye', frustum=(-1.0, 1.0, -1.0, 1.0))\n sage: T.texture('t1', color=(0,0,1))\n sage: cedges = [[[1, 1, 1], [-1, 1, 1]], [[1, 1, 1], [1, -1, 1]],\n ....: [[1, 1, 1], [1, 1, -1]], [[-1, 1, 1], [-1, -1, 1]], [[-1, 1, 1],\n ....: [-1, 1, -1]], [[1, -1, 1], [-1, -1, 1]], [[1, -1, 1],\n ....: [1, -1, -1]],\n ....: [[-1, -1, 1], [-1, -1, -1]], [[1, 1, -1], [-1, 1, -1]],\n ....: [[1, 1, -1], [1, -1, -1]], [[-1, 1, -1], [-1, -1, -1]],\n ....: [[1, -1, -1], [-1, -1, -1]]]\n sage: for ed in cedges:\n ....: T.fcylinder(ed[0], ed[1], .05, 't1')\n sage: T.light((-4,-4,4), .1, (1,1,1))\n sage: T.show()\n\nUse of the \"projection='perspective_dof'\" option. This may not be\nimplemented correctly.\n\n sage: T = Tachyon(xres=800,antialiasing=4, raydepth=10, projection='perspective_dof', focallength='1.0', aperture='.0025')\n sage: T.light((0,5,7), 1.0, (1,1,1))\n sage: T.texture('t1', opacity=1, specular=.3)\n sage: T.texture('t2', opacity=1, specular=.3, color=(0,0,1))\n sage: T.texture('t3', opacity=1, specular=1, color=(1,.8,1), diffuse=0.2)\n sage: T.plane((0,0,-1), (0,0,1), 't3')\n sage: ttlist = ['t1', 't2']\n sage: tt = 't1'\n sage: T.cylinder((0,0,.1), (1,1/3,0), .05, 't3')\n sage: for q in srange(-3, 100, .15):\n ....: if tt == 't1':\n ....: tt = 't2'\n ....: else:\n ....: tt = 't1'\n ....: T.sphere((q, q/3+.3*sin(3*q), .1+.3*cos(3*q)), .1, tt)\n sage: T.show()"}}︡{"done":true}︡ ︠0a75cb43-c1f0-447d-89b6-5e1608d7e3d7s︠ points = [(2,0,0), (0,2,0), (0,0,2), (-1,0,0), (0,-1,0), (0,0,-1)] show(LatticePolytope(points).plot3d(), viewer='tachyon') ︡8ac7a9c9-412d-4f53-805a-68985dfc4577︡{"file":{"filename":"/projects/4a5f0542-5873-4eed-a85c-a18c706e8bcd/.sage/temp/compute7-us/890/tmp_VbpBCM.png","show":true,"text":null,"uuid":"2fe2d2ae-552f-4d87-89cf-db5d87047aff"},"once":false}︡{"done":true}︡ ︠7e554bd7-3a6b-4f12-a8ba-c4e5d1fff946︠