我需要绘制一个围绕倒置截头圆锥的螺旋线,起点和终点都在两个底面的中心。像这样:
我搜索并找到了类似的解决方案,但仅适用于气缸:圆柱上的螺旋线
我无法使其适应我所讨论的几何形状,因此如果能提供任何帮助我将不胜感激。
仅限锥体的代码:
\documentclass[border=0.125cm]{standalone}
\usepackage{tikz}
\usetikzlibrary{3d,calc}
\begin{document}
\begin{tikzpicture}
\draw (-1,0) arc (180:370:2cm and 1cm);
\draw (-1,0) arc (180:10:2cm and 1cm);
\draw (0,-3) arc (180:360:1cm and 0.5cm);
\draw[dashed] (0,-3) arc (180:0:1cm and 0.5cm);
\draw(0,-3) -- (-0.97,-0.18);
\draw(2,-3) -- (2.97,-0.18);
\shade[left color=blue!5!white,right color=blue!60!white,opacity=0.3] (-0.97,-0.18) arc (190:350:2 and 1) -- (2,-3) arc (360:180:1cm and 0.5cm) -- cycle;
\shade[left color=blue!5!white,right color=blue!60!white,opacity=0.3] (1,0) ellipse (2cm and 1cm);
\draw[dashed] (0.7,-3) arc (180:0:0.3cm and 0.15cm);
\draw[dashed] (0.7,-3) arc (180:360:0.3cm and 0.15cm);
\end{tikzpicture}
\end{document}
提前致谢,
迪尼斯·努内斯
编辑:
按照 Ignasi 的建议,我添加了螺旋功能,但我的目标是使线条紧贴锥壁。
代码:
\node[xshift=1cm,yshift=-3cm] (dummy) {};
\draw[densely dotted,scale=0.09,variable=\x,shift=(dummy)] plot[domain = 0:10*pi, samples = 400] ({\x*0.6*sin(0.3*pi*deg(\x))},{\x},{\x*0.6*cos(0.3*pi*deg(\x)});
答案1
这是一种使用的可能性pgfplots
;先画出螺旋,再用来绘制截断的代码:
代码:
\documentclass[dvipsnames,border=5pt]{standalone}
\usepackage{pgfplots}
\usetikzlibrary{calc}
\pgfplotsset{compat=newest}
\colorlet{myblue}{blue!30}
\def\Pointi{42.67}
\def\Pointii{12.6}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
view={-10}{-10},
axis lines=none,
zmax=60,
clip=false,
height=16cm,
width=15cm,
xtick=\empty,
ytick=\empty,
ztick=\empty
]
\addplot3+[
draw=none,
no marks,
domain=10.3:14.405*pi,
samples=400,
samples y=0,
]
({5*x*sin(0.20*pi*deg(x))},{5*x*cos(0.20*pi*deg(x)},{x});
\coordinate (br)
at ({5*\Pointii*sin(0.20*pi*deg(\Pointii))},{5*\Pointii*cos(0.20*pi*deg(\Pointii)},{\Pointii});
\coordinate (ur)
at ({5*\Pointi*sin(0.20*pi*deg(\Pointi))},{5*\Pointi*cos(0.20*pi*deg(\Pointi)},{\Pointi});
\coordinate (BR) at ( $(ur)!1.113!(br) $ );
\coordinate (UR) at ( $(br)!1.24!(ur) $ );
\path
(BR)
arc [start angle=0,end angle=360,x radius=38pt,y radius=10pt]
coordinate[midway] (BL);
\filldraw[ball color=MidnightBlue!20,fill opacity=0.7,draw=black]
(UR)
arc [start angle=0,end angle=360,x radius=204pt,y radius=20pt]
coordinate[midway] (UL);
\filldraw[ball color=MidnightBlue!20]
(UR) --
(BR) arc [start angle=360,end angle=180,x radius=38pt,y radius=10pt] --
(BL) --
(UL)
arc [start angle=180,end angle=360,x radius=204pt,y radius=20pt];
\draw[dashed]
(BR)
arc [start angle=0,end angle=180,x radius=38pt,y radius=10pt];
\draw[dashed]
([xshift=-19pt]BR)
arc [start angle=0,end angle=360,x radius=19pt,y radius=4pt];
\addplot3+[
mark=none,
ultra thick,
BrickRed,
domain=10.3:14.405*pi,
samples=400,
samples y=0,
]
({5*x*sin(0.20*pi*deg(x))},{5*x*cos(0.20*pi*deg(x)},{x});
\end{axis}
\end{tikzpicture}
\end{document}