跳至内容

渐近线/命令/实体/圆柱

来自维基教科书,一个开放的世界中的开放书籍

此示例沿 x 轴绘制一个圆柱。

import solids;

// Set page size
size(0,150);

// Lighting
currentlight=Viewport;

// Draw axis
draw(Label("$y$",1),(0,0,0)--(0,1,0),red,Arrow3);
draw(Label("$x$",1),(0,0,0)--(1,0,0),red,Arrow3);
draw(Label("$z$",1),(0,0,0)--(0,0,1),red,Arrow3);

// Draw cylinder
// cylinder(startpoint3d, radius, length, along_this_axis)
triple start = (1,1,1);
real length = 1;
real radius = 0.5;
triple ax = (1,0,0);
revolution r = cylinder(start,radius,length,ax);
draw(r,black);
华夏公益教科书