如何从 \tdplotsphericalsurfaceplot 中的 3D 表面移除背线

如何从 \tdplotsphericalsurfaceplot 中的 3D 表面移除背线

我正在尝试使用\tdplotsphericalsurfaceplottikz-3dplot 包绘制 3D 曲面。但是,即使设置了参数,我也得到了沿表面的线条\pgfsetlinewidth{0pt}。我想知道是否有任何方法可以删除这些线条。

\documentclass{standalone}
\usepackage{tikz}
\usepackage{tikz-3dplot}
\begin{document}
\tdplotsetmaincoords{70}{135}
\begin{tikzpicture}[scale=5,line join=bevel,tdplot_main_coords, fill opacity=0.9]
\pgfsetlinewidth{0pt}
\tdplotsphericalsurfaceplot[]{70}{40}%
{0.5*cos(\tdplottheta)}{black}{red!50}%
{\draw[color=black,thick,->] (0,0,0) -- (1,0,0) node[anchor=north east]{$x$};}%
{\draw[color=black,thick,->] (0,0,0) -- (0,1,0) node[anchor=north west]{$y$};}%
{\draw[color=black,thick,->] (0,0,0) -- (0,0,1) node[anchor=south]{$z$};}%
\end{tikzpicture}
\end{document}

在此处输入图片描述

答案1

欢迎来到 TeX.SE!!

对于这个表面(球体)来说,在普通的 Ti 中更容易做到Z. 我使用perspective带有选项的库isometric view,但这些不是必须的。

例如:

\documentclass[tikz,border=1.616mm]{standalone}
\usetikzlibrary{perspective}

\tikzset{my ball/.style={shading=ball,ball color=#1,fill opacity=0.8}}

\begin{document}
\begin{tikzpicture}[isometric view,rotate around z=180,scale=4,line cap=round]
\draw[my ball=blue] (0,0,-0.5) circle (0.5cm);
\draw[-latex] (0,0,0) -- (1,0,0)   node[left]  {\strut$x$};
\draw[-latex] (0,0,0) -- (0,1,0)   node[right] {\strut$y$};
\draw         (0,0,0) -- (0,0,1);
\draw[my ball=red] (0,0,0.5) circle (0.5cm);
\draw[-latex] (0,0,1) -- (0,0,1.5) node[above] {$z$};
\end{tikzpicture}
\end{document}

在此处输入图片描述

答案2

这是另一个想法。

来自tikz-3dplot 文档第 3.6.2 节,我引用:

Syntax: \tdplotsphericalsurfaceplot[fill color style]{theta steps}{phi steps}{function} {line color}{fill color}{x axis}{y axis}{z axis}

如果线条颜色与填充颜色相同或足够接近会怎样?

{0.5*cos(\tdplottheta)}{red!75}{red!50}%

在此处输入图片描述

没有线条,就会失去深度感。

这是预期的结果吗?

相关内容