方法:具有法向向量的表面元素的 3D 绘图

方法:具有法向向量的表面元素的 3D 绘图

我是 tikz 的新手,我正在尝试可视化一个表面元素,比如

体积和表面元素

与上面的示例图(我从网上引用的)相比,我想详细绘制表面元素,即看起来像实体壳元素的表面元素,从大表面切出。此外,我希望有一个表面法向量、表面元素的标签,以及表面顶部的一些参数化 u、v 曲线。

我知道,只要我找到好看的草图,我就可以绘制一些 2D 样条线、弧线、矢量等,并进行反复试验。好吧,但我正在寻找一种将其绘制为 3D 图的方法,以便可以从不同的角度查看它。这可能吗(以某种方式,让 tikz 初学者可以处理它 ;))?

请提供任何帮助!

提前致谢,乔

答案1

我找到了一种将其形象化的方法,但它并不是很舒服......无论如何,至少......它完成了工作;)

\tikzset{thin_line/.style={      thin,               solid, color=black}}
\tikzset{dash_line/.style={      thin,              dashed, color=darkgray}}
\tikzset{vect_line/.style={very thick, ->, >=latex,  solid, color=black}}

\begin{tikzpicture}[scale=2]
 \coordinate (a)  at ( 0.00, 0.2);
 \coordinate (am) at (-0.05, 0.1);
 \coordinate (an) at ( 0.45, 0.8);

 \coordinate (b)  at ( 1.00, 1.0);
 \coordinate (bm) at ( 0.95, 0.9);

 \coordinate (c)  at ( 0.00, 2.0);
 \coordinate (cm) at (-0.05, 1.9);

 \coordinate (d)  at (-1.10, 1.3);
 \coordinate (dm) at (-1.15, 1.2);

 \draw[thin_line] (a) to[out= 25, in=200] (b);    
 \draw[thin_line] (b) to[out=115, in=-30] (c);    
 \draw[thin_line] (c) to[out=185, in= 60] (d);    
 \draw[thin_line] (d) to[out=-25, in=110] (a);    

 \draw[fill=gray!30] (a) to[out= 25, in=200] 
                     (b) to[out=115, in=-30] 
                     (c) to[out=185, in= 60] 
                     (d) to[out=-25, in=110] (a);    

 \draw[thin_line] (am) to[out= 25, in=200] (bm);    
 \draw[dash_line] (bm) to[out=115, in=-30] (cm);    
 \draw[dash_line] (cm) to[out=185, in= 60] (dm);    
 \draw[thin_line] (dm) to[out=-25, in=110] (am);    

 \draw[thin_line] (am) -- (a);
 \draw[thin_line] (bm) -- (b);
 \draw[dash_line] (cm) -- (c);
 \draw[thin_line] (dm) -- (d);

 \draw[fill=gray!90] (a)  to[out= 25, in=200] 
                     (b)  -- 
                     (bm) to[out=200, in=25]
                     (am) -- (a);

 \draw[fill=gray!90] (am) --
                     (a)  to[out=110, in=-25]
                     (d)  --
                     (dm) to[out=-25, in=110] (am);

 \coordinate (O)   at ( 0.00, 1.25);
 \coordinate (O1)  at ( 0.16, 1.10);
 \coordinate (O2)  at (-0.10, 1.18);
 \coordinate (P)   at ( 0.80, 2.10);
 \coordinate (h1)  at (-0.80, 2.00);
 \coordinate (h2)  at (-0.30, 1.60);

 \draw[vect_line] (P)  node[above left] {\large $\diff{F}$} -- (O);
 \draw[thin_line] (h1) node[above left] {\large $\diff{A}$} -- (h2);


 \draw[thin_line] (O) to[out=-32, in=134] (O1);
 \draw[thin_line] (O) to[out=205, in=40]  (O2);
 \draw (O1) arc[radius=2.mm, start angle=-45, end angle=54];
 \draw (O2) arc[radius=4.mm, start angle=158, end angle=110];

\end{tikzpicture}

看起来…… 在此处输入图片描述 无论如何,如果有人找到更好的方法来解决这个问题,请告诉我!你的,乔治

答案2

只是为了好玩:更接近地再现图像。

\documentclass[margin=3.14mm,tikz]{standalone}
\begin{document}
\begin{tikzpicture}[font=\large]
\shadedraw[ball color=gray!40,opacity=0.5] plot[smooth cycle] coordinates {(-2,1) (-0.8,2.2) (0.5,1.3) (1,0.8) (1.8,0)
(2,-1) (1.4,-2) (0,-2.1) (-1,-1.7) (-1.8,-1)};
\draw[fill=gray!40] (0.8,0) to[bend right=10] (1.3,0.3) to[bend left=15] (1.6,-0.3)
to[bend left=10] (1.2,-0.6) to[bend right=10] cycle;
\draw[blue,very thick,-latex] (1.2,-0.1) -- ++(38:1) node[above] {$\vec n$};
\draw[red,very thick,-latex] (1.2,-0.1) -- ++(10:1.6) node[below left] {$\vec g$};
\node[anchor=north] at (1.3,-0.6) {d$S$}; 
\draw[fill=gray!40] (-0.8,-0.8) rectangle (-0.3,-1.3) node[below right=0pt,
inner sep=0pt]{d$V$};
\draw[fill=gray!50] (-0.8,-0.8) -- ++ (0.2,0.2) -- ++ (0.5,0) -- (-0.3,-0.8);
\draw (-0.3,-1.3) -- ++ (0.2,0.2) -- ++ (0,0.5);
\end{tikzpicture}
\end{document}

在此处输入图片描述

相关内容