Tikz 表面图

Tikz 表面图

有人知道如何复制这个吗数学在 tikz 中绘图?(如果可能的话:我想使用“pattern=crosshatched dots”来填充阴影区域。

以下是数学代码:

Show[(*Arrows- Top*) Graphics3D[{Black,Arrowheads[0.05],Arrow[Tube[{{0,.5,1},{1.1,.5,1}},.01]],Text[Style["\!\(\*SuperscriptBox[\(\[Epsilon]\), \(+\)]\)",Medium],{0,.5,1.1}]},Boxed->False,Axes->False,Background->None,Lighting->"Neutral",Ticks->None],Graphics3D[{Black,Arrowheads[0.05],Arrow[Tube[{{0,.25,1},{1.1,.25,1}},.01]], Text[Style["\!\(\*SuperscriptBox[\(\[Epsilon]\), \(-\)]\)",Medium],{0,.25,1.1}]}], (*Arrows-Bottom*) Graphics3D[{Black,Arrowheads[0.05],Arrow[Tube[{{0,.25,0},{1.1,.25,0}},.01]], Text[Style["\!\(\*SuperscriptBox[\(\[Epsilon]\), \(-\)]\)",Medium],{1.2,.25,0}]}],Graphics3D[{Black,Arrowheads[0.05],Arrow[Tube[{{0,.5,0},{1.1,.5,0}},.01]],Text[Style["\!\(\*SuperscriptBox[\(\[Epsilon]\), \(+\)]\)",Medium],{1.2,.5,0}]}],(*x-Axes*) Graphics3D[{Black,Arrowheads[0.07],Arrow[Tube[{{0,1,0},{1.3,1,0}},.01]], Text[Style["x",Medium],{1.35,1,0}]}],(*y-Axes*) Graphics3D[{Black,Arrowheads[0.07],Arrow[Tube[{{0,1,0},{0,-.35,0}},.01]],Text[Style["y",Medium],{0,-.5,0}]}], (*y-Axes*) Graphics3D[{Black,Arrowheads[0.07],Arrow[Tube[{{0,1,0},{0,1,1.3}},.01]],Text[Style["n",Medium],{0,1,1.35}]}],(*Surface*) Plot3D[Sqrt[1-x^2],{x,0,1},{y,0,1},Axes->True,AxesLabel->{"x","y","n"},Boxed->False,PlotStyle->Directive[Gray,Opacity[0.5]],Mesh->None,Background->None,Lighting->"Neutral"], (*Epsilon above surface*) RegionPlot3D[Sqrt[1-x^2]<= z,{x,0,1},{y,.25,.5},{z,0,1},PlotStyle->None],RegionPlot3D[ .25<= y<=.5,{x,0,1},{y,.25,.5},{z,-.01,.01},PlotStyle->None]]

在 *Mathematica* 中渲染的图像

红色代表要用点填充的体积

答案1

\documentclass[tikz]{standalone}

\usetikzlibrary{patterns}

\begin{document}
\begin{tikzpicture}
\draw[->] (0,0,0)--++(5,0,0) node[right]{$x$};
\draw[->] (0,0,0)--++(0,5,0) node[above]{$n$};
\draw[->] (0,0,0)--++(0,0,5) node[below left]{$y$};
\draw (0,4,0) arc[start angle=90, end angle=0, radius=4] -- ++(0,0,4.5)
arc[start angle=0, end angle=90, radius=4]--cycle;
\draw[thick, pattern=crosshatch dots] (0,4,1.5) arc[start angle=90, end angle=0, radius=4] -- ++(0,0,1.5)
arc[start angle=0, end angle=90, radius=4]--cycle;
\draw[->, thick] (0,0,1.5)--++(4.5,0,0) node[right]{$\epsilon^+$};
\draw[->, thick] (0,0,3)--++(4.5,0,0) node[right]{$\epsilon^-$};
\draw[->, thick] (0,4,1.5)--++(4.5,0,0) node[right]{$\epsilon^+$};
\draw[->, thick] (0,4,3)--++(4.5,0,0) node[right]{$\epsilon^-$};
\draw[thick, pattern=crosshatch dots] (0,4,1.5)--++(4,0,0)--++(0,0,1.5)--++(-4,0,0)--cycle;
\draw[thick, pattern=crosshatch dots] (4,0,1.5)--++(0,4,0)--++(0,0,1.5)--++(0,-4,0)--cycle;
\draw[thick, pattern=crosshatch dots] (0,0,1.5)--++(4,0,0)--++(0,0,1.5)--++(-4,0,0)--cycle;
\draw[thick, pattern=crosshatch dots] (0,0,1.5)--++(0,4,0)--++(0,0,1.5)--++(0,-4,0)--cycle;
\end{tikzpicture}
\end{document}

在此处输入图片描述

让我们再试一次:

\documentclass[tikz]{standalone}

\usetikzlibrary{patterns}

\begin{document}
\begin{tikzpicture}
%axis
\draw[->] (0,0,0)--++(5,0,0) node[right]{$x$};
\draw[->] (0,0,0)--++(0,5,0) node[above]{$n$};
\draw[->] (0,0,0)--++(0,0,5) node[below left]{$y$};

%curved surface
\draw (0,4,0) arc[start angle=90, end angle=0, radius=4] -- 
    ++(0,0,4.5) arc[start angle=0, end angle=90, radius=4]--cycle;

%internal curved surface        
\draw[thick] (0,4,1.5) arc[start angle=90, end angle=0, radius=4] -- 
           ++(0,0,1.5) arc[start angle=0, end angle=90, radius=4]--cycle;

%Epsilon arrows
\draw[->, thick] (0,0,1.5)--++(4.5,0,0) node[right]{$\epsilon^+$};
\draw[->, thick] (0,0,3)--++(4.5,0,0) node[right]{$\epsilon^-$};
\draw[->, thick] (0,4,1.5)--++(4.5,0,0) node[right]{$\epsilon^+$};
\draw[->, thick] (0,4,3)--++(4.5,0,0) node[right]{$\epsilon^-$};

%vertical epsilon delimited area
\draw[thick] (4,0,1.5)--++(0,4,0)--++(0,0,1.5)--++(0,-4,0)--cycle;

%horizontal hatched rectangle
\draw[thick, pattern=crosshatch dots] (0,0,1.5)--++(4,0,0)--++(0,0,1.5)--++(-4,0,0)--cycle;

%hatched volume
\draw[thick, pattern=crosshatch dots] (0,4,1.5)--++(0,0,1.5) 
     arc[start angle=90, end angle=0, radius=4] --++(0,0,-1.5)--++(0,4,0)--++(-4,0,0);
\end{tikzpicture}
\end{document}

在此处输入图片描述

相关内容