我正在尝试将图案应用于弯曲的三角形,但效果并不理想,而且似乎比我预期的要复杂得多。这是代码:
\begin{center}
\begin{asy}[width=\textwidth]
settings.render=0;
settings.prc=false;
import three;
import graph3;
import grid3;
currentprojection=obliqueX;
pen thickblack = black+0.75;
real axislength = 1.0;
draw(L=Label("$x$", position=Relative(1.1), align=SW), O--axislength*X,thickblack, Arrow3);
draw(L=Label("$y$", position=Relative(1.1), align=E), O--axislength*Y,thickblack, Arrow3);
draw(L=Label("$z$", position=Relative(1.1), align=N), O--axislength*Z,thickblack, Arrow3);
real a=0.5;
label("$a$", (a,0,0), align=NW);
label("$a$", (0,a,0), align=NE);
label("$a$", (0,0,a), align=NW);
draw(O--expi(pi/2,pi/4),black+0.25);
draw(arc(c=O, a*Y, a*Z), blue);
draw(arc(c=O, a*X, a*Z), red);
dot((a,a,0));
draw((0,a,0)--(a,a,0),blue);
draw((a,a,0)--(a,0,0),red);
draw((0,0,a)--(0,0.9,a),red);
draw((a,0,0)--(a,0.9,0),red);
draw(arc(c=(0,0.8,0),(a,0.8,0), (0,0.8,a)), red);
draw((a,a,0)--(0.9,a,0),blue);
draw((0,0,a)--(0.9,0,a),blue);
triple f(real t) {
return (a*cos(t),a*cos(t),a*sin(t));
}
path3 ellarc = graph(f, 0, pi/2, operator ..,n=101);
path3 ellarcp = graph(f, pi/2,0, operator ..,n=101);
path3 t1=((0,0,0) -- (0,a,0) -- (a,a,0) -- cycle);
surface s1=surface(t1);
draw(s1,red+opacity(.6),light=nolight);
path3 t2=((0,0,0) -- (a,0,0) -- (a,a,0) -- cycle);
surface s2=surface(t2);
draw(s2,blue+opacity(.6),light=nolight);
path3 ec1 = ( arc(c=O, a*Y, a*Z) -- (ellarcp) -- cycle);
surface sec1=surface(ec1);
draw(sec1,magenta+opacity(.5),light=nolight);
path3 ec2 = ( (ellarc) .. arc(c=O, a*Z, a*X)-- cycle);
surface sec2=surface(ec2);
draw(sec2,yellow+opacity(.5),light=nolight);
draw(ellarc,black+1.3);
\end{asy}
\end{center}
我不知道发生了什么。如果我注释掉此代码中的“path3 ec1”或“path3 ec2”行,所附图像将显示每个曲线三角形的问题。如果这是基础问题,抱歉,我对渐近线一窍不通。
答案1
如果我理解你的问题,那么构造参数化表面就足够了。请找到代码
//settings.render=0;
//settings.prc=false;
import three;
import graph3;
import grid3;
currentprojection=obliqueX;
size3(10cm);
pen thickblack = black+0.75;
real axislength = 1.0;
draw(L=Label("$x$", position=Relative(1.1), align=SW), O--axislength*X,thickblack, Arrow3);
draw(L=Label("$y$", position=Relative(1.1), align=E), O--axislength*Y,thickblack, Arrow3);
draw(L=Label("$z$", position=Relative(1.1), align=N), O--axislength*Z,thickblack, Arrow3);
real a=0.5;
label("$a$", (a,0,0), align=NW);
label("$a$", (0,a,0), align=NE);
label("$a$", (0,0,a), align=NW);
draw(O--expi(pi/2,pi/4),black+0.25);
draw(arc(c=O, a*Y, a*Z), blue);
draw(arc(c=O, a*X, a*Z), red);
dot((a,a,0));
draw((0,a,0)--(a,a,0),blue);
draw((a,a,0)--(a,0,0),red);
draw((0,0,a)--(0,0.9,a),red);
draw((a,0,0)--(a,0.9,0),red);
draw(arc(c=(0,0.8,0),(a,0.8,0), (0,0.8,a)), red);
draw((a,a,0)--(0.9,a,0),blue);
draw((0,0,a)--(0.9,0,a),blue);
triple f(real t) {
return (a*cos(t),a*cos(t),a*sin(t));
}
path3 ellarc = graph(f, 0, pi/2, operator ..,n=101);
path3 ellarcp = graph(f, pi/2,0, operator ..,n=101);
path3 t1=((0,0,0) -- (0,a,0) -- (a,a,0) -- cycle);
surface s1=surface(t1);
draw(s1,red+opacity(.6),light=nolight);
path3 t2=((0,0,0) -- (a,0,0) -- (a,a,0) -- cycle);
surface s2=surface(t2);
draw(s2,blue+opacity(.6),light=nolight);
triple g( pair z)
{
return (z.y*a*cos(z.x),a*cos(z.x),a*sin(z.x));
}
//path3 ec1 = ( arc(c=O, a*Y, a*Z) -- (ellarcp) -- cycle);
//surface sec1=surface(ec1);
draw(surface(g,(0,0),(pi/2,1),Spline),magenta+opacity(.5)+4bp,light=nolight);
triple h( pair z)
{
return (a*cos(z.x),z.y*a*cos(z.x),a*sin(z.x));
}
//path3 ec2 = ( (ellarc) .. arc(c=O, a*Z, a*X)-- cycle);
//surface sec2=surface(ec2);
draw(surface(h,(0,0),(pi/2,1),Spline),yellow+opacity(.5),light=nolight);
draw(ellarc,black+1.3);
由于我遇到了一些透明度问题,render=0
并且render=0
3D 功能非常有限,因此我使用了真正的 3D GL 渲染。