帮助完成这个图形 tex/tikz

帮助完成这个图形 tex/tikz

我正在尝试对这幅图像进行编码(圆柱形二维宇宙中的孪生悖论)。我不知道如何包含文本、18 的提及以及穿过螺旋和垂直线的底部圆圈。感谢您的帮助!以下是我所取得的成果:

\documentclass{article}
\usepackage{tikz}

\begin{document}
\begin{tikzpicture}[
  x=10mm,
  y=cos(30)*10mm,
  z={(0, -sin(30)*10mm)},
]
  \def\cylrad{1}% radius
  \def\cylht{4}
  \draw
    (-\cylrad, \cylht) -- (-\cylrad, 0) --
    plot[smooth, samples=25, variable=\t, domain=180:360]
      ({cos(\t)*\cylrad}, 0, {-sin(\t)*\cylrad}) --
    (\cylrad, \cylht)
    plot[smooth cycle, samples=51, variable=\t, domain=0:360]
      ({cos(\t)*\cylrad}, \cylht, {-sin(\t)*\cylrad})
  ;
  

  \draw [] (-0.5,-0.45) --(-0.5,4.4);
  
    
  \draw[densely dashed]
    plot[smooth, samples=9, variable=\t, domain=0:180]
      ({cos(\t)*\cylrad}, 0, {-sin(\t)*\cylrad})
  ;
  \draw[semithick]
    \foreach \y in {0, \cylht/2} {
      plot[smooth, samples=25, variable=\t, domain=180:360]
        ({cos(\t)*\cylrad}, {\y + (\t-180)*\cylht/720}, {-sin(\t)*\cylrad})
    }
     
  ;  
  \draw[semithick, densely dashed]
    \foreach \y in {\cylht/4, 3*\cylht/4} {
      plot[smooth, samples=25, variable=\t, domain=0:180]
        ({cos(\t)*\cylrad}, {\y + \t*\cylht/720}, {-sin(\t)*\cylrad})
    }
  ;  
\end{tikzpicture}
\end{document}

在此处输入图片描述

代码生成的内容:

当前结果

答案1

使用 tikz-3dplot 的尝试有点笨拙。螺旋线通过参数图绘制,其中斜率由函数 f1 和 f2 给出。半径、高度和相位等各种参数都存储在常量中。我还添加了一些注释。

\documentclass[tikz,border=10pt]{standalone}
\usepackage{tikz-3dplot}
\begin{document}
\begin{tikzpicture}[>=latex,font=\sffamily]
 \tdplotsetmaincoords{70}{0}
 \begin{scope}[tdplot_main_coords,declare function={R=1.5;H=5;Phase=60;h=-0.25;
     f1(\t)=2.25*(\t-60)/180;
     f2(\t)=0.8*(\t-60)/180;
     },set t to/.code={\edef\t{#1}},
     variable=\t,smooth,samples=51]
  \draw[dashed] (-R,0,h) arc[start angle=180,end angle=0,radius=R];
  \draw (-R,0,h) arc[start angle=-180,end angle=0,radius=R] 
    (0,0,H) circle[radius=R]
   (-R,0,h) -- (-R,0,H) (R,0,h) -- (R,0,H);
  \draw[thick,dashed] 
   (-R,0,0) arc[start angle=180,end angle=0,radius=R]
   ({-R*cos(Phase)},{-R*sin(Phase)},0)
   -- coordinate[midway] (pV) ({-R*cos(Phase)},{-R*sin(Phase)},H)
   foreach \tmin/\tmax in {180/360}   
   {plot[domain=\tmin:\tmax] ({-R*cos(\t)},{-R*sin(\t)},{f1(\t)})};
  \draw[thick] 
   (-R,0,0) arc[start angle=-180,end angle=0,radius=R]
   ({-R*cos(Phase)},{-R*sin(Phase)},h)
   -- ({-R*cos(Phase)},{-R*sin(Phase)},H)
   foreach \tmin/\tmax in {60/180,360/420}    
   {plot[domain=\tmin:\tmax] ({-R*cos(\t)},{-R*sin(\t)},{f1(\t)})};
  \draw[dashed] 
   ({-R*cos(Phase)},{-R*sin(Phase)},0)
   -- ({-R*cos(Phase)},{-R*sin(Phase)},H)
   foreach \tmin/\tmax in {180/360,540/720}   
   {plot[domain=\tmin:\tmax] ({-R*cos(\t)},{-R*sin(\t)},{f2(\t)})};
  \draw 
   ({-R*cos(Phase)},{-R*sin(Phase)},0)
   -- ({-R*cos(Phase)},{-R*sin(Phase)},H)
   foreach \tmin/\tmax in {60/180,360/540,720/900}    
   {plot[domain=\tmin:\tmax] ({-R*cos(\t)},{-R*sin(\t)},{f2(\t)})};
  \path 
      (-R,0,0) coordinate (p0)
     [set t to=180] ({-R*cos(\t)},{-R*sin(\t)},{f1(\t)}) coordinate (p1)
     [set t to=540] ({-R*cos(\t)},{-R*sin(\t)},{f2(\t)}) coordinate (p2);
 \end{scope}
 \begin{scope}[<-,text width=2cm]
  \draw (p0)-- ++ (-160:1) node[left,align=right]{Circles of constant \dots};
  \draw (pV)-- ++ (160:1) node[left,align=right]{Line of \dots};
  \draw (p1)-- ++ (-20:1) node[right,align=left]{Universe B};
  \draw (p2)-- ++ (20:1) node[right,align=left]{Helix of constant \dots};
 \end{scope}
\end{tikzpicture}
\end{document}

在此处输入图片描述

答案2

谢谢你的帮助。我设法加入了“18”的提及。以下是代码:

\documentclass[tikz,border=10pt]{standalone}
\usepackage{tikz-3dplot}
\begin{document}
\begin{tikzpicture}[>=latex,font=\sffamily]
\tdplotsetmaincoords{70}{0}
\begin{scope}[tdplot_main_coords,declare function={R=1.5;H=5;Phase=60;h=-0.25;
 f1(\t)=2.25*(\t-60)/180;
 f2(\t)=0.8*(\t-60)/180;
 },set t to/.code={\edef\t{#1}},
 variable=\t,smooth,samples=51]

\draw[dashed] (-R,0,h) arc[start angle=180,end angle=0,radius=R];
\draw (-R,0,h) arc[start angle=-180,end angle=0,radius=R] 
(0,0,H) circle[radius=R]
(-R,0,h) -- (-R,0,H) (R,0,h) -- (R,0,H);
\draw[thick,dashed] 
(-R,0,0) arc[start angle=180,end angle=0,radius=R]
 ({-R*cos(Phase)},{-R*sin(Phase)},0)
-- coordinate[midway] (pV) ({-R*cos(Phase)},{-R*sin(Phase)},H)
foreach \tmin/\tmax in {180/360}   
{plot[domain=\tmin:\tmax] ({-R*cos(\t)},{-R*sin(\t)},{f1(\t)})};
\draw[thick] 
(-R,0,0) arc[start angle=-180,end angle=0,radius=R]
({-R*cos(Phase)},{-R*sin(Phase)},h)
-- ({-R*cos(Phase)},{-R*sin(Phase)},H)
foreach \tmin/\tmax in {60/180,360/420}    
{plot[domain=\tmin:\tmax] ({-R*cos(\t)},{-R*sin(\t)},{f1(\t)})};
\draw[dashed] 
 ({-R*cos(Phase)},{-R*sin(Phase)},0)
 -- ({-R*cos(Phase)},{-R*sin(Phase)},H)
 foreach \tmin/\tmax in {180/360,540/720}   
 {plot[domain=\tmin:\tmax] ({-R*cos(\t)},{-R*sin(\t)},{f2(\t)})};
\draw 
 ({-R*cos(Phase)},{-R*sin(Phase)},0)
 -- ({-R*cos(Phase)},{-R*sin(Phase)},H)
 foreach \tmin/\tmax in {60/180,360/540,720/900}    
 {plot[domain=\tmin:\tmax] ({-R*cos(\t)},{-R*sin(\t)},{f2(\t)})};
\path 
  (-R,0,0) coordinate (p0)
 [set t to=180] ({-R*cos(\t)},{-R*sin(\t)},{f1(\t)}) coordinate (p1)
 [set t to=540] ({-R*cos(\t)},{-R*sin(\t)},{f2(\t)}) coordinate (p2);
\end{scope}
\begin{scope}[<-,text width=2cm]
\draw (p0)-- ++ (-160:1) node[left,align=right]{Cercle de temps constant de A };
\draw (pV)-- ++ (160:1) node[left,align=right]{Ligne d'univers de A};
\draw (p1)-- ++ (-20:1) node[right,align=left]{Ligne d'univers de B};
\draw (p2)-- ++ (20:1) node[right,align=left]{Hélice de temps constant de B};


\draw [<->,purple, very thick](-0.75,-0.45) -- (-0.75,1.05) node [below right]{18} ;

  
\end{scope}
\end{tikzpicture}
\end{document}  `

在此处输入图片描述

相关内容