当我在此代码中使用 3dtools 绘制圆形 SBD 时哪里出了错误?

当我在此代码中使用 3dtools 绘制圆形 SBD 时哪里出了错误?

我想画一个经过三个点的圆,S, B, D就像这张图片 在此处输入图片描述

我尝试使用3dtools,但无法获得结果。我的代码

\documentclass[tikz,border=1 mm,12pt]{standalone}
\usepackage{fouriernc}
\usepackage{tikz-3dplot-circleofsphere}
\usetikzlibrary{backgrounds,3dtools}
\begin{document}
\tdplotsetmaincoords{70}{73}
    \begin{tikzpicture}[scale=1,tdplot_main_coords,declare function={R=25*sqrt(78)*(1/52);r=7*sqrt(3)*(1/3);Angle=acos(r/R);%
    }]
    \path (0,0,0) coordinate (O)
    (-3/2, {-13*sqrt(3)*(1/6)}, 0) coordinate (A) 
    (3/2, {-13*sqrt(3)*(1/6)}, 0) coordinate (B) 
    (4, {(1/3)*sqrt(3)}, 0) coordinate (C) 
    (0, 0, {(1/3)*sqrt(78)}) coordinate (S) 
    (0, 0, {-23*sqrt(78)*(1/156)}) coordinate (T)
    (-3/2, {13*sqrt(3)*(1/6)}, 0) coordinate (D)
    ;
    \begin{scope}[tdplot_screen_coords]
    \draw[thick] (T) circle (R);
    \end{scope}
    \begin{scope}[shift={(T)}]
    \tdplotCsDrawLatCircle[tdplotCsFront/.style={thick}]{R}{{Angle}}
    \end{scope}
    \foreach \p in {A,B,C,D,S,O,T}
    \draw[fill=black] (\p) circle (1.5pt);
    \foreach \p/\g in {A/155,C/-90,B/-60,D/45,S/160,O/-90,T/-90}
    \path (\p)+(\g:3mm) node{$\p$};
    \foreach \X in {A,B,C,O,D} \draw[dashed] (\X) -- (S); 
    \draw[dashed] (A) -- (B) -- (C) -- cycle (B) -- (D);
    \path[overlay,3d coordinate={(nSBD)=(S)-(B)x(S)-(D)}];
    \pgfmathsetmacro{\myangle}{atan(TDy("nSBD")/TDx("nSBD"))}
    \begin{scope}[shift={(T)}]
    \tdplotCsDrawGreatCircle[tdplotCsFront/.style={thick,blue}]{R}{90}{\myangle}
    \end{scope}
    \end{tikzpicture}
\end{document}

我有

在此处输入图片描述

我怎样才能得到正确的结果?

答案1

我不确定是否有很多人能理解这个讨论。这个包tikz-3dplot-circleofsphere可以找到这里3dtools图书馆这里。问题是你改变了参数的顺序。90必须放在最后:

\tdplotCsDrawGreatCircle[tdplotCsFront/.style={thick,blue}]{R}{\myangle}{90} 

\documentclass[tikz,border=1 mm,12pt]{standalone}
\usepackage{fouriernc}
\usepackage{tikz-3dplot-circleofsphere}
\usetikzlibrary{backgrounds,3dtools}
\begin{document}
\tdplotsetmaincoords{70}{73}
    \begin{tikzpicture}[scale=1,tdplot_main_coords,declare function={R=25*sqrt(78)*(1/52);r=7*sqrt(3)*(1/3);Angle=acos(r/R);%
    }]
    \path (0,0,0) coordinate (O)
    (-3/2, {-13*sqrt(3)*(1/6)}, 0) coordinate (A) 
    (3/2, {-13*sqrt(3)*(1/6)}, 0) coordinate (B) 
    (4, {(1/3)*sqrt(3)}, 0) coordinate (C) 
    (0, 0, {(1/3)*sqrt(78)}) coordinate (S) 
    (0, 0, {-23*sqrt(78)*(1/156)}) coordinate (T)
    (-3/2, {13*sqrt(3)*(1/6)}, 0) coordinate (D)
    ;
    \begin{scope}[tdplot_screen_coords]
    \draw[thick] (T) circle (R);
    \end{scope}
    \begin{scope}[shift={(T)}]
    \tdplotCsDrawLatCircle[tdplotCsFront/.style={thick}]{R}{{Angle}}
    \end{scope}
    \foreach \p in {A,B,C,D,S,O,T}
    \draw[fill=black] (\p) circle (1.5pt);
    \foreach \p/\g in {A/155,C/-90,B/-60,D/45,S/160,O/-90,T/-90}
    \path (\p)+(\g:3mm) node{$\p$};
    \foreach \X in {A,B,C,O,D} \draw[dashed] (\X) -- (S); 
    \draw[dashed] (A) -- (B) -- (C) -- cycle (B) -- (D);
    \path[overlay,3d coordinate={(nSBD)=(S)-(B)x(S)-(D)}];
    \pgfmathsetmacro{\myangle}{atan(TDy("nSBD")/TDx("nSBD"))}

    %\node{\pgfmathparse{TD("(nSBD)")}\pgfmathprintvector\pgfmathresult};
    \begin{scope}[shift={(T)}]
    \tdplotCsDrawGreatCircle[tdplotCsFront/.style={thick,blue}]{R}{\myangle}{90}
    \end{scope}
    \end{tikzpicture}
\end{document}

在此处输入图片描述

相关内容