如何绘制此壳旋转盘的方法?

如何绘制此壳旋转盘的方法?

这是我的问题 -> 如何绘制它:

美好往日

我有这个MWE它是一个磁盘,只需要变成一个圆柱形的壳:

\documentclass[12pt]{article}
\usepackage{tikz}
\begin{document}
    \begin{tikzpicture}[scale=1,>=latex,x=1.5cm,y=0.8cm]
        \fill[fill=white,opacity=0.5] (1,0) -- plot[domain=1:4] (\x,{sqrt(2*(\x)+1))}) -- (4,0);
        \fill[fill=white,opacity=0.5] (1,0) -- plot[domain=1:4] (\x,{-sqrt(2*(\x)+1))}) -- (4,0);
        \draw[-,thick,domain=-.2:4.5,samples=100] plot (\x,\x) node[right] {\footnotesize $y=f(x)$};
        \draw[-,thick,domain=-.2:4.5,samples=100] plot (\x,-\x);
        \draw[fill=blue!40] (2.3,0) circle [x radius =.2 , y radius =2.449489743];
        \fill[blue!40] (2.3,-2.449489743) rectangle (2.7,2.449489743);
        \draw[fill=blue!40] (2.7,0) circle [x radius =.2 , y radius =2.449489743];
        \draw (2.3,2.449489743) -- (2.7,2.449489743);
        \draw (2.3,-2.449489743) -- (2.7,-2.449489743);
        \draw[<->] (2.3,-2.6) -- (2.7,-2.6) node[below, midway] {\footnotesize $\Delta x$};
        \draw[<->] (2.9,0) -- (2.9,2.449489743) node[right, midway]  {\footnotesize $R$};
        \draw[->,thick] (-1,0) -- (5,0) node[above] {\footnotesize $x$};
        \draw[->,thick] (0,-5) -- (0,5) node[below right]{\footnotesize $y$};
        \draw[-] (1,3pt) -- (1,-3pt) node[below] {\footnotesize $a$};
        \draw[-] (4,3pt) -- (4,-3pt) node[below] {\footnotesize $b$};
    \end{tikzpicture}
\end{document}

是的

答案1

为此,我将选择 2d,唯一的问题就是找到圆锥母线和其底面(透视图中的椭圆)之间的切点。要找到这些点,我们需要一点三角学知识(见下文)。

现在,我的例子:

\documentclass[border=2mm,tikz]{standalone}

\newcommand{\ellipsebaratio}{3} % b/a ratio for the ellipse

\tikzset
{% styles
   cylinder inner/.style={thick,draw=blue,top color=blue!40,bottom color=cyan!20},
   cylinder outer/.style={thick,draw=blue,top color=cyan!20,bottom color=blue!40},
   cylinder side/.style={thick,draw=blue,fill=cyan!40},
   cone outer/.style={thick,red!60,top color=red,bottom color=gray,fill opacity=0.25},
   cone inner/.style={thick,red!60,top color=gray!40,bottom color=red!40},
   axis/.style={ultra thick,line cap=butt},
   dimension/.style={latex-latex}
}

\begin{document}
\begin{tikzpicture}[line cap=round,line join=round,scale=0.3,
                    yscale=\ellipsebaratio
                   ]
% dimensions
\def\ca{10}   % cone angle
\def\cr{4}    % cone radius
\def\co{2}    % cylinder outer radius
\def\ci{1.5}  % cylinder inner radius
\pgfmathsetmacro\ch{\cr/sin(\ca)}     % cone height
\pgfmathsetmacro\gn{\cr/tan(\ca)}     % cone generatrix
\pgfmathsetmacro\cy{\ch-\co/sin(\ca)} % cylinder height
% cone and axis (first part)
\draw[cone inner] (0,0) -- (\ca:\gn) arc (90+\ca:-90-\ca:\cr) -- cycle;
\draw[axis]      (-2,0) -- (\ch-\cy,0);
% cylinder
\fill[cylinder side,even odd rule] (\ch,0) circle (\co) (\ch,0) circle (\ci);
\draw[cylinder outer] (\ch,0) ++ (0,\co) -- (\cy,\co) arc (90:270:\co) -- (\ch,-\co) arc (270:90:\co);
\draw[cylinder inner] (\ch,0) circle (\ci);
% cone and axis (second part)
\draw[cone outer] (0,0) -- (\ca:\gn) arc (90+\ca:270-\ca:\cr) -- cycle;
\draw[axis] (\ch-\ci,0) -- (\ch+10,0);
% annotations
\foreach\i in {0,\cy}
  \draw (\ch-\i,-\co) --++ (0,-3);
\draw   (\ch,\co)     --++ (3*\ellipsebaratio,0);
\draw[dimension]          (\ch-\cy,-\co-2.75) --++ (\cy,0) node[midway,below] {$\Delta x$};
\draw[dimension] (\ch+2.75*\ellipsebaratio,0) --++ (0,\co) node[midway,right] {$R$};
\end{tikzpicture}
\end{document}

在此处输入图片描述

数学

假设我们将圆锥底部看作一个圆,在这种情况下我们需要找到切点。更准确地说,我们知道半径r和角度alpha,我们想计算高度h和母线g。这很容易,如下图所示。

在此处输入图片描述

但是,你会说,这个图中的透视图完全错了。是的,但现在这个问题很容易解决。我们只需要改变其中一个轴的比例。例如 y 轴。这是在代码中的行

yscale=\ellipsebaratio

如果您注释掉该行,您将得到一个错误的透视图,与第二幅图中看到的透视图没有太大区别。但新的 y 比例会变形圆并将其变成椭圆。这正是我们所需要的。

答案2

用我的双手创造的马查

%% Compile and read me!
\documentclass[a4paper,12pt]{article}
\usepackage{tikz}


\begin{document}
\tikzset {_iowdg6aaj/.code = {\pgfsetadditionalshadetransform{ \pgftransformshift{\pgfpoint{-198 bp } { 158.4 bp }  }  \pgftransformscale{1.32 }  }}}
\pgfdeclareradialshading{_il0gy1303}{\pgfpoint{160bp}{-128bp}}{rgb(0bp)=(1,1,1);
rgb(0bp)=(1,1,1);
rgb(25bp)=(0.41,0.82,0.97);
rgb(400bp)=(0.41,0.82,0.97)}
\tikzset{every picture/.style={line width=0.75pt}} %set default line width to 0.75pt        

\begin{tikzpicture}[x=0.75pt,y=0.75pt,yscale=-1,xscale=1]
%uncomment if require: \path (0,416); %set diagram left start at 0, and has height of 416

%Shape: Can [id:dp7658281586952849] 
\path  [shading=_il0gy1303,_iowdg6aaj] (312.3,238) -- (189.03,238) .. controls (173.29,238) and (160.53,203.26) .. (160.53,160.4) .. controls (160.53,117.54) and (173.29,82.8) .. (189.03,82.8) -- (312.3,82.8) .. controls (328.04,82.8) and (340.8,117.54) .. (340.8,160.4) .. controls (340.8,203.26) and (328.04,238) .. (312.3,238) .. controls (296.56,238) and (283.8,203.26) .. (283.8,160.4) .. controls (283.8,117.54) and (296.56,82.8) .. (312.3,82.8) ; % for fading 
 \draw   (312.3,238) -- (189.03,238) .. controls (173.29,238) and (160.53,203.26) .. (160.53,160.4) .. controls (160.53,117.54) and (173.29,82.8) .. (189.03,82.8) -- (312.3,82.8) .. controls (328.04,82.8) and (340.8,117.54) .. (340.8,160.4) .. controls (340.8,203.26) and (328.04,238) .. (312.3,238) .. controls (296.56,238) and (283.8,203.26) .. (283.8,160.4) .. controls (283.8,117.54) and (296.56,82.8) .. (312.3,82.8) ; % for border 

%Straight Lines [id:da2688155304234523] 
\draw [color={rgb, 255:red, 105; green, 208; blue, 248 }  ,draw opacity=1 ][line width=1.5]    (311.75,300.8) -- (33.8,163) ;
%Shape: Donut [id:dp4325332399123063] 
\draw  [fill={rgb, 255:red, 105; green, 208; blue, 248 }  ,fill opacity=1 ,even odd rule] (293.8,160.4) .. controls (293.8,123.34) and (301.97,93.3) .. (312.05,93.3) .. controls (322.13,93.3) and (330.3,123.34) .. (330.3,160.4) .. controls (330.3,197.46) and (322.13,227.5) .. (312.05,227.5) .. controls (301.97,227.5) and (293.8,197.46) .. (293.8,160.4)(283.3,160.4) .. controls (283.3,117.54) and (296.17,82.8) .. (312.05,82.8) .. controls (327.93,82.8) and (340.8,117.54) .. (340.8,160.4) .. controls (340.8,203.26) and (327.93,238) .. (312.05,238) .. controls (296.17,238) and (283.3,203.26) .. (283.3,160.4) ;
%Straight Lines [id:da22040826951195158] 
\draw    (312.05,162.4) -- (417.1,163) ;
%Straight Lines [id:da8600072710761881] 
\draw    (33.8,163) -- (160.53,162.4) ;
%Straight Lines [id:da4150513426865641] 
\draw [color={rgb, 255:red, 105; green, 208; blue, 248 }  ,draw opacity=1 ][line width=1.5]    (33.8,163) -- (309.8,17.8) ;
%Shape: Ellipse [id:dp8521303793758079] 
\draw  [color={rgb, 255:red, 105; green, 208; blue, 248 }  ,draw opacity=1 ][line width=1.5]  (311.75,17.8) .. controls (336.02,17.8) and (355.7,81.15) .. (355.7,159.3) .. controls (355.7,237.45) and (336.02,300.8) .. (311.75,300.8) .. controls (287.48,300.8) and (267.8,237.45) .. (267.8,159.3) .. controls (267.8,81.15) and (287.48,17.8) .. (311.75,17.8) -- cycle ;
%Straight Lines [id:da4880586858406528] 
\draw    (185.03,344.8) -- (307.53,344.8) ;
\draw [shift={(309.53,344.8)}, rotate = 180] [fill={rgb, 255:red, 0; green, 0; blue, 0 }  ][line width=0.08]  [draw opacity=0] (12,-3) -- (0,0) -- (12,3) -- cycle    ;
\draw [shift={(183.03,344.8)}, rotate = 0] [fill={rgb, 255:red, 0; green, 0; blue, 0 }  ][line width=0.08]  [draw opacity=0] (12,-3) -- (0,0) -- (12,3) -- cycle    ;
%Straight Lines [id:da23822019387639726] 
\draw    (417.1,161) -- (417.1,85.8) ;
\draw [shift={(417.1,83.8)}, rotate = 90] [fill={rgb, 255:red, 0; green, 0; blue, 0 }  ][line width=0.08]  [draw opacity=0] (12,-3) -- (0,0) -- (12,3) -- cycle    ;
\draw [shift={(417.1,163)}, rotate = 270] [fill={rgb, 255:red, 0; green, 0; blue, 0 }  ][line width=0.08]  [draw opacity=0] (12,-3) -- (0,0) -- (12,3) -- cycle    ;
%Straight Lines [id:da3635008874540595] 
\draw    (312.05,82.8) -- (417.1,82.8) ;
%Straight Lines [id:da11606673988810434] 
\draw    (183.03,238) -- (183.03,344.8) ;
%Straight Lines [id:da8461071359270795] 
\draw    (312.05,162.4) -- (312.05,347.8) ;

% Text Node
\draw (231,323.4) node [anchor=north west][inner sep=0.75pt]    {$\Delta x$};
% Text Node
\draw (424,115.4) node [anchor=north west][inner sep=0.75pt]    {$R$};


\end{tikzpicture}


\end{document}

在此处输入图片描述

相关内容