如何在 Asymptote 中使管子变得平滑?

如何在 Asymptote 中使管子变得平滑?

这个管道是围绕一条有 1200 个点的路径构建的:

在此处输入图片描述

它的渲染有点慢(我想生成几个这样的管子来制作动画),而且管子不够平滑(如果放大到一定程度)。有没有办法在不添加更多点的情况下使其平滑?

settings.render = 4;
settings.outformat = "eps";
import tube;
import graph3;
size(200,0);

currentprojection = orthographic(4,4,4);
currentlight = light((100,100,100));
currentlight.background = rgb("363940ff");

real f(real x, real t) {
    return x + 7.0*sin(x/12.0 + t) - 7.0*t;
}

triple g(real u, real t) {
    real fu = f(u, t);
    real h = (7.0 + 2.0*cos(fu));
    real x = h * cos(u/12.0);
    real y = h * sin(u/12.0);
    real z = 2.0*sin(fu);
    return (x, y, z);
}

path3 rotoidePath(real t, int n) {
    path3 out;
    for(int i = 0; i <= n; ++i) {
        real u = 24*pi * i/n;
        out = out .. g(u, t);
    }
    return out;
}


draw(
    tube(rotoidePath(1.0, 1200), scale(0.3)*unitcircle), 
    rgb(139, 0, 139), render(compression = Low, merge = true)
);

相关内容