我想以 3D 形式重现手动的(第 3.5 节,路径)
size(0,100);
path unitcircle=E..N..W..S..cycle;
path g=scale(2)*unitcircle;
filldraw(unitcircle^^g,evenodd+yellow,black);
我试过这个
import three;
path3 p = (0,-2,-2)-- (0,2,-2) -- (0,2,2) -- (0,-2,2) -- (0,-2,-2) -- cycle;
path3 q = (0,-.25,-1.1) -- (0,.25,-1.1) -- (0,.25,1.1) -- (0,-.25,1.1) -- cycle;
filldraw(q^^p,evenodd+yellow,black);
但我得到了
no matching function 'filldraw(path3[], pen)'
错误
有任何想法吗?
答案1
有一个从单个循环路径生成表面的例程。
代码如下:
settings.outformat="pdf";
settings.render=0;
import three;
size(5cm);
path3 p = (0,-2,-2)-- (0,2,-2) -- (0,2,2) -- (0,-2,2) -- (0,-2,-2) -- (0,-2,-2);
path3 q = (0,-.25,-1.1) -- (0,.25,-1.1) -- (0,.25,1.1) -- (0,-.25,1.1) -- (0,-.25,-1.1);
draw(surface(p -- reverse(q) -- cycle), emissive(yellow));
draw(p ^^ q, black);