绘制此图的简单方法

绘制此图的简单方法

我正在使用 tikz 并想获得这张图片:

在此处输入图片描述

我的尝试:

\documentclass[a4paper,12pt]{book}
\usepackage{tikz}
\usepackage{tikz-cd}
\usetikzlibrary{arrows,patterns,snakes,fit,shapes.geometric,arrows.meta,decorations.markings,positioning,shapes,backgrounds}

\begin{document}
    \begin{tikzpicture}
    \pic {cuboid} node[left]{\simeq} (1,0,0)
    \simeq \draw[dashed] (0,0,0) circle (1);
    \draw[dashed] (-1,0,0) arc (180:360:1 and 0.6);
    \draw[dashed] (1,0,0) arc (0:180:1 and 0.6);
    \caption{Sample}
    \end{tikzpicture}
\end{document}

真诚地感谢大家。

答案1

这是一个临时完成的。

\documentclass[tikz,border=3pt 3pt 3pt 3pt]{standalone}
\usetikzlibrary{calc}
\begin{document}
\begin{tikzpicture}

  \def\Erad{2}
  \def\Eang{20}
  \def\Econ{1}
  \coordinate (O) at (0,0);
  \coordinate (A) at (0:\Erad);
  \coordinate (B) at (180:\Erad);

  \draw (O) circle (\Erad);
  \draw (B) .. controls ++(-\Eang:\Econ) and ++(180+\Eang:\Econ) .. (A);
  \draw[dashed] (B) .. controls ++(\Eang:\Econ) and ++(180-\Eang:\Econ) .. (A);

  \coordinate (T1) at ($(O)+(3.5,-1.5)$);
  \coordinate (T2) at ($(T1)+(2,0)$);
  \coordinate (T3) at ($(T1)+(0,2)$);
  \coordinate (T4) at ($(T1)+(2,2)$);
  \coordinate (C) at ($(A)!0.5!(A -| T1)$);

%  \fill[red] (C) circle (2pt);
  
  \def\Cang{35}
  \def\Clen{1.3}

  \coordinate (T11) at ($(T1)+(\Cang:\Clen)$);
  \coordinate (T12) at ($(T2)+(\Cang:\Clen)$);
  \coordinate (T13) at ($(T3)+(\Cang:\Clen)$);
  \coordinate (T14) at ($(T4)+(\Cang:\Clen)$);

  \draw[dashed] (T1) -- (T11) -- (T12);
  \draw[dashed] (T11) -- (T13);
  \draw (T4) -- (T14) -- (T13) -- (T3)
  -- (T1) -- (T2) -- (T12) -- (T14)
  (T3) -- (T4) -- (T2)
  ;

  \node at (C) {$\simeq$};
   
  % \fill (T1) circle (2pt);
  % \fill (T2) circle (2pt);
  % \fill (T3) circle (2pt);
  % \fill (T4) circle (2pt);
  % \fill (T11) circle (2pt);
  % \fill (T12) circle (2pt);
  % \fill (T13) circle (2pt);
  % \fill (T14) circle (2pt);

  
\end{tikzpicture}
\end{document}

答案2

再试一次,使用立方体的 3d 库:

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{3d}

\begin{document}
\begin{figure}
\centering
\begin{tikzpicture}[scale=1.5]
    \draw (0,0) circle (1cm);
    \draw (-1,0) arc (180:360:1 and 0.3);
    \draw[dashed] (1,0) arc (0:180:1 and 0.3);
    
    \node[font=\huge] at (1.7,0) {$\simeq$};

    \begin{scope}[shift={(3,-0.4)}, scale=1.5]
        \draw[dashed] (0,1,0) -- (0,0,0) -- (1,0,0);
        \draw[dashed] (0,0,0) -- (0,0,1);
        \draw (1,0,1) -- (1,0,0) -- (1,1,0) -- (0,1,0) -- (0,1,1) -- (0,0,1) -- cycle;
        \draw (1,0,1) -- (1,1,1) -- (0,1,1);
        \draw (1,1,0) -- (1,1,1);
    \end{scope}
\end{tikzpicture}
\caption{This is a caption.}
\end{figure}
\end{document}

球体模拟立方体

答案3

我认为 TikZ 对于这个图形来说已经足够了(球体和立方体是同胚的)。

这是一个有趣的渐近线解决方案。

在此处输入图片描述

// http://asymptote.ualberta.ca/
size(8cm);
usepackage("amssymb");
import three;
currentprojection=orthographic(4,1,-1,zoom=.8);
pen p=yellow+opacity(.5);
pen q=red;
triple A=1.5Y;

draw(shift(-A)*unitsphere,p);
draw(shift(-A)*unitcircle3,q);

draw(shift(A-(1,1,1))*scale3(2)*unitcube,p);
draw(shift(A-(1,1,0))*scale3(2)*unitsquare3,q);

label("$\simeq$",O);

相关内容