4

I draw this picture with Asymptote (the first time). My code

    import three; import graph3; import math; import patterns;
size(5cm); dotfactor =3.5;
defaultpen(fontsize(9pt));
currentprojection =
orthographic((5,2,3));
triple A, B, C, D, S, E, F, G;
D = O; A = X; B = X+Y; C = Y; S=Z; E=0.5(A+B); F=0.5(B+C); G=0.5(S+D);
pen dashed=linetype(new real[] {5,5}); // set up dashed pattern
pen visLine=darkblue+0.8pt;
pen hidLine=lightblue+dashed+0.8pt;

//pen linePen=darkblue+1.3bp; pen dotPen= darkblue+3bp; //pen dashPen=1bp+linetype(new real[]{4,3})+linecap(0);

draw(A--B--C,visLine); draw(S--B^^S--C^^S--A,visLine); draw(S--D^^A--D--C,hidLine); real k= intersect(S,A, cross(G-E, G-F),G); triple M=(1-k)S+kA; triple N=(1-k)S+kC; dot("$S$",S,dir(90),dotPen); dot("$A$",A,dir(-90),dotPen); dot("$B$",B,dir(-90),dotPen); dot("$C$",C,dir(-90),dotPen); dot("$D$",D,dir(-90),dotPen); dot("$E$",E,dir(-90),dotPen); dot("$F$",F,dir(-90),dotPen); dot("$G$",G,dir(0),dotPen); dot("$M$",M,dir(120),dotPen); dot("$N$",N,dir(30),dotPen); draw(M--G--N^^ E -- F,hidLine); draw(M--E^^ N -- F,visLine); //filldraw(G--M--E--F--N--cycle,pattern(" hatch" ));

enter image description here

Now I want to rotate the above picture like this

enter image description here

(The above picture is drawn with TikZ, see here)

Thank to marmot let me using this gif.

enter image description here

How can I rotate the figure (in Asymptote) and hidden parts dashed is changed automatically?

0 Answers0