如何绘制 3D 标记图

如何绘制 3D 标记图

所以我目前正在研究几个机械问题,如果可能的话,我并不想直接将我磨损的图纸粘贴到我的文档中。我尝试使用 Tikz,但说实话,我不知道我在做什么。有人知道我该怎么做吗? 3D 磁盘

答案1

可以使用几个 tikz 命令绘制图形。您只需要绘制\draw线条、圆形、弧线,并\node在此处放置标签。此外,calc3d库可以用于\scopes暂时更改参考框架。像这样:

\documentclass[border=2mm]{standalone}
\usepackage    {tikz}
\usetikzlibrary{3d}
\usetikzlibrary{calc}

\begin{document}
\begin{tikzpicture}[line cap=round,line join=round,
  x={(-0.5cm,-0.5cm)},y={(1cm,0cm)},z={(0cm,1cm)},        % cavalier axes 
%  x={(-0.86cm,-0.5cm)},y={(0.86cm,-0.5cm)},z={(0cm,1cm)}  % isometric axes
  ]
  \def\ha{2.5}  % A height
  \def\hc{0.8}  % circle height
  \def\rc{1.5}  % circle radius
  \def\am{75}   % angle for m and B
  \coordinate (O) at (0,0,0);
  \coordinate (A) at (0,0,\ha);
  \coordinate (C) at (0,0,\hc); % circle center
  \coordinate (m) at ($(C)+(\am:\rc)$);
  \coordinate (B) at ($(A)!1.4!(m)$);
  % AXES
  \draw[-latex] (O) -- (1.5*\ha,0,0) node [left]  {$x$};
  \draw[-latex] (O) -- (0,1.5*\ha,0) node [right] {$y$};
  \draw         (O) -- (C);
  % circle (filled and not)
  \draw[thick,blue,canvas is xy plane at z=\hc,fill=blue!20,fill opacity=0.9] (0,0) circle (\rc);
%  \draw[thick,blue,canvas is xy plane at z=\hc] (0,0) circle (\rc);
  % angles
  \begin{scope}[rotate around z=\am, canvas is xz plane at y=0]
    \draw[red]    ($(C)+(0.2,0)$)  |- ($(C)+(0,0.2)$);
    \node[red] at ($(A)+(0,-0.4)$) [left] {$\alpha$};
    \clip (O) -- (A) -- (B) -- cycle;
    \draw[red]   (A) circle (0.4);
    \draw[red,dashed] (m) -- (C);
  \end{scope}
  \begin{scope}[canvas is xy plane at z=1.25*\ha]
    \draw[red,canvas is xy plane at z=1.25*\ha,->] (0,-0.4) arc (-90:180:0.4);
    \node[red] at (0,0.4) [right] {$\omega$};
  \end{scope}
  % line AB and points
  \draw[-latex] (C) -- (0,0,1.5*\ha) node [above] {$z$}; % top part of z axis
  \draw[thick,gray] (A) node [black,left] {$A$} -- (B) node [black,below] {$B$};
  \fill (m) circle (2pt) node [right] {$(x,y,z)$};
  \node at (m) [below] {$m$};
  \node at ($(A)!0.4!(m)$) [right] {$r$};
\end{tikzpicture}
\end{document}

我个人更喜欢等距透视图,而不是散焦图。我包括了两个图,您只需评论一组轴即可在其中一个或另一个之间切换x=..., y=..., z=...在此处输入图片描述

编辑:我按照@projetmbc 的建议,在圆盘上添加了填充物。我不得不更改一些元素的顺序,但唯一真正的变化是填充物。 在此处输入图片描述

相关内容