我正在尝试绘制一个像这样的互锁圆环:
为此,我一直在网上寻找类似的图片,然后尝试修改代码。到目前为止,我得到了以下结果:
def torus {
def n_segs 60
sweep [draw=none, fill=cyan, fill opacity=0.75] {n_segs, rotate(360/n_segs, (0,0,0), [0,1,0])}
sweep {n_segs, rotate(360/n_segs, (1.5,0,0), [0,0,1])}
(2,0,0)
}
def torus2 {
def n_segs 60
sweep [draw=none, fill=orange, fill opacity=0.75] {n_segs, rotate(360/n_segs, (1.5,0,0), [0,0,1]) }
sweep {n_segs, rotate(360/n_segs, (0,0,0), [0,1,0])}
(2,0,0)
}
put { view((10,4,2)) } {{torus2} {torus}}
global { language tikz }
这torus
是原始代码,我torus2
模仿原始代码编写。然而,我得到了这个丑陋的东西:
我想请求帮助修复,torus2
以便完整的图像看起来像第一个。圆环的方向、它们的颜色和这些东西目前没有意义。
答案1
我相信这样的事情应该有效:
def torus {
def n_segs 60
sweep [draw=none, fill=cyan, fill opacity=0.75] {n_segs, rotate(360/n_segs, (0,0,0), [0,1,0])}
sweep {n_segs, rotate(360/n_segs, (1.5,0,0), [0,0,1])}
(2,0,0)
}
def torus2 {
def n_segs 60
sweep [draw=none, fill=orange, fill opacity=0.75] {n_segs, rotate(360/n_segs, (0,0,0), [0,0,0.5]) }
sweep {n_segs, rotate(360/n_segs, (0,0.75,0), [0.5,0,0])}
(1,0,0)
}
put { view((10,4,2)) } {{torus2} {torus}}
global { language tikz }