5

I'd like to mark angles in a 3D-pstricks-graphic. I tried to use the solution seen in this question:

Right angle in 3D-pstricks

Unfortunately, it doesn't work. Here's my code:

\documentclass{standalone}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[ngerman]{babel}
\usepackage{pst-all}
\usepackage{pst-3dplot}

\begin{document}

\psset{coorType=2,Alpha=90}
\begin{pspicture}[showgrid=false](-1.5,-1.5)(5.5,3.1)
\pstThreeDLine[linewidth=0.5pt,linecolor=black,linestyle=dashed](2,0,0)(0,0,0)(0,0,3)
\pstThreeDLine[linewidth=0.5pt,linecolor=black,linestyle=dashed](0,0,0)(0,5,0)
   \pstThreeDTriangle[fillstyle=solid,fillcolor=red!40,linewidth=0.2pt,linecolor=red,opacity=0.6](2,0,0)(0,0,1.5)(0,5,0)
\pstThreeDLine[linewidth=0.8pt,linecolor=black,linestyle=solid](2,0,0)(2,5,0)(0,5,0)(0,5,3)(2,5,3)(2,0,3)(2,0,0)
\pstThreeDLine[linewidth=0.8pt,linecolor=black,linestyle=solid](2,5,0)(2,5,3)
\pstThreeDLine[linewidth=0.8pt,linecolor=black,linestyle=solid](2,0,3)(0,0,3)(0,5,3)
\uput{0.1cm}[225](-1,-1){$A$}
\uput{0.1cm}[180](0,1.5){$B$}
\uput{0.1cm}[0](5,0){$C$}
\rput[c](1.5,-1.2){$a$}
\rput[l](4.6,-0.6){$b$}
\rput[l](5.1,1.5){$c$}
\ThreeDput[normal=7.5 3 10](0,0,1.5){
\psarc{-}(0,0){0.4}{0}{80}
}
\end{pspicture}

\end{document}


It should look like this:

enter image description here

If possible, the symbol of each angle should be put in the same plain as the triangle. Thank you very much for your help!

1
  • That's a good question. What is disturbing me most is that the outcome depends on whether I compile with xelatex or with latex -> dvi -> ps -> pdf, see also this post.
    – user121799
    Apr 22, 2018 at 18:40

2 Answers 2

1

Use \pstThreeDEllipse for marking the angle:

 \pstThreeDEllipse[beginAngle=0,endAngle=90,
     linecolor=green](0,0,1.5)(0.2,0,-0.15)(0,0.25,-0.075)

(0,0,1.5) is the origin (center) of the circle and (0.2,0,-0.15)(0,0.25,-0.075) the two radii of the ellipse (circle).

enter image description here

1

This is a way with Asymptote for comparison. A mark angle ABC is an arc centered at B, from BA to BC, counter-clockwise by default. So we can draw, fill, or both, and add label/arrow as desired.

For mark of right angle, see here.

enter image description here

unitsize(1cm);
import three;
currentprojection=orthographic(dir(70,20),zoom=.95);

draw(Label("$x$",EndPoint),O--5X,Arrow3);
draw(Label("$y$",EndPoint,S),O--7Y,Arrow3);
draw(Label("$z$",EndPoint,W),O--4.5Z,Arrow3);

triple A=(3,0,0), B=(0,5,0), C=(0,0,3);
path3 tri=A--B--C--cycle;
draw(tri,blue);
draw(surface(tri),yellow+opacity(.5));

dot("$A$",A,NW);
dot("$B$",B,NE);
dot("$C$",C,NW);


// mark angle ABC in 3D
// as an arc centered at B, from BA to BC, for arrow if any)
// so we can draw, fill, or both, as desired
path3 Nmark(triple A, triple B, triple C, real size=.5,bool direction=CCW){
triple Ba=B+size*unit(A-B);
triple Bc=B+size*unit(C-B);
triple Bt=Ba+Bc-B;
return arc(B,Ba,Bc,normal=cross(A-B,C-B),direction);
};

draw(Nmark(A,B,C,1),red,Arrow3);
draw(Nmark(B,C,A,.6));
draw(Label("$\gamma$",Relative(.5),align=S),Nmark(B,C,A,.7));
draw(surface(A--Nmark(C,A,B)--cycle),green);

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .