Anonymous 1123
I often see difficult when I try to draw dashed lines automatically. This picture drew bisector plane of two planes. How to draw it?

![phan_giac.png](/image?hash=d9796d1e8216d2589edb1e10a777c49ac39d743a3c35c74217cf49665b740268)
user 3.14159
There is a new feature in [3dtools](https://github.com/marmotghost/tikz-3dtools): 3d/draw ordered paths. It draws paths, which the user has to save with save named path, in a given order but uses clips and inverted clips to distinguish between hidden and visible stretches. It is designed to work for (plane) polygons and, more generally, closed curves, but since a clip along a single straight line does not do anything it can also be used for single straight lines. It draws the object in the order it is given them, i.e. does *not* attempt to do any automatic 3d ordering. But it allows one to avoid some repetition.

In this example we use the planes and some lines for these paths.

\documentclass[tikz,border=3mm]{standalone}
\usetikzlibrary{3dtools}% https://github.com/marmotghost/tikz-3dtools
\begin{document}
\begin{tikzpicture}[3d/install view={phi=50,theta=70},
line join=round, line cap=round,
declare function={a=3;b=2.7;alpha=20;},same bounding box=A]
\path
(0,0,0) coordinate[label=left:{$O$}] (P_0)
(-a/2,0,0) coordinate (P_1)
(a/2,0,0) coordinate (P_2)
(0,a,0) coordinate (A_0)
(-a/2,a,0) coordinate (A_1)
(a/2,a,0) coordinate (A_2)
(0,{a*cos(alpha/2)},{a*sin(alpha/2)}) coordinate (B_0)
(-a/2,{a*cos(alpha/2)},{a*sin(alpha/2)}) coordinate (B_1)
(a/2,{a*cos(alpha/2)},{a*sin(alpha/2)}) coordinate (B_2)
(0,{b*cos(alpha/2)},{b*sin(alpha/2)}) coordinate (B)
(0,{a*cos(alpha)},{a*sin(alpha)}) coordinate (C_0)
(-a/2,{a*cos(alpha)},{a*sin(alpha)}) coordinate (C_1)
(a/2,{a*cos(alpha)},{a*sin(alpha)}) coordinate (C_2);
\foreach \X in {A,B,C}
{\path[save named path=p\X] (P_1) -- (P_2) -- (\X_2) -- (\X_1) -- cycle;
\path[save named path=l\X] (P_0) -- (\X_0);}
\foreach \X in {A,C}
{\tikzset{3d/plane through={(P_1) and (P_2) and (\X_1) named p\X}}
\path[/tikz/3d/project={(B) on p\X}] coordinate (B_\X);
\path[save named path=lB\X] (B) -- (B_\X);}
\pgfmathsetmacro{\nA}{TDunit("(A_1)-(P_1)x(P_2)-(P_1)")}
\pgfmathsetmacro{\nC}{TDunit("(C_1)-(P_1)x(P_1)-(P_2)")}
\pgfmathtruncatemacro{\itest}{screendepth(\nA)>screendepth(\nC)?1:0}
\ifnum\itest=1
\tikzset{3d/draw ordered paths={pC,lC,lBC,pB,lB,lBA,pA,lA}}
\else
\tikzset{3d/draw ordered paths={pA,lA,lBA,pB,lB,lBC,pC,lC}}
\fi
\end{tikzpicture}
\end{document}

![Screen Shot 2021-04-25 at 8.03.38 PM.png](/image?hash=844d0154ccec49062712eb841a349e154d894ed7761579dcd0c2f4198473d153)