如何让这个数字变得更好?

如何让这个数字变得更好?

我正在尝试绘制下图所示的图形: 在此处输入图片描述 这是我的 MWE:

\documentclass[tikz, border=2mm]{standalone}
\usepackage{cmap}
\usepackage{amsmath, amssymb, latexsym, mathtext}
\usepackage[T2A]{fontenc}
\usepackage[utf8]{inputenc}
%\usepackage{pscyr}
\usepackage[english]{babel}
%
\usepackage{tikz}
\usepackage{tikz-3dplot}
\usepackage{wasysym}
\usetikzlibrary{calc,3d}

\newcommand{\drawgas}[2]
{
\foreach \a in {0,60,...,360} {%
            \path (#1) ++ (\a:{0.25}) coordinate (r1);            
            \path (#1) ++ (\a:{#2 - 0.25}) coordinate (r2);
            \draw[line width=0.5pt, latex-] (r1) -- (r2);
}
}
\begin{document}
%%%%%%%%%%%%%%%%%
\begin{tikzpicture}
[x={(-0.6cm,-0.4cm)}, y={(1cm,0cm)}, z={(0cm,1cm)}, scale=1.0]
\def\sizeX{16}
\def\sizeY{16}
\def\sizeZ{7}
\def\sizecircleI{4.5}
\def\sizecircleII{3.5}
\def\sizecircleIII{2}
\begin{scope}[line width=1pt, ->]
    \draw (0,0,0) -- (\sizeX+1,0,0) node[below] {$x$};
    \draw (0,0,0) -- (0,\sizeY+1,0) node[right] {$y$};
    \draw (0,0,0) -- (0,0,\sizeZ+1) node[above] {$z$};
\end{scope}
\begin{scope}[canvas is zy plane at x=0]
    \draw [black!30] (0,0) grid (\sizeZ,\sizeY);
\end{scope}
\begin{scope}[canvas is zx plane at y=0]
    \draw [black!30] (0,0) grid (\sizeZ,\sizeX);
\end{scope}
\begin{scope}[canvas is yx plane at z=0]
    \draw [black!30] (0,0) grid (\sizeY,\sizeX);
\end{scope}
%                                               %
\begin{scope}[green, line width=0.5pt]
    \coordinate (p1) at (0,0,0);
    \coordinate (p2) at (0,0,\sizeZ);
    \coordinate (p3) at (0,\sizeY,\sizeZ);
    \coordinate (p4) at (0,\sizeY,0);
    %
    \coordinate (pp1) at (\sizeX,0,0);
    \coordinate (pp2) at (\sizeX,0,\sizeZ);
    \coordinate (pp3) at (\sizeX,\sizeY,\sizeZ);
    \coordinate (pp4) at (\sizeX,\sizeY,0);
    
    \draw (p2) -- (p3) -- (p4)  (pp1) -- (pp2) -- (pp3) -- (pp4) -- (pp1)  (p2) -- (pp2) (p3) -- (pp3) (p4) -- (pp4);
    \draw[dashed] (p1) -- (p2) (p1) -- (p4) (p1) -- (pp1);
\end{scope}
%                                 %
\begin{scope}[blue, line width=2pt]
    \coordinate (b1) at ($(p2)!.5!(p3) + (0,0,0)$);
    \coordinate (b2) at ($(b1) + (2,0,0)$);
    \coordinate (b3) at ($(b2) + (4,0,0)$);
    \coordinate (b4) at ($(b3) + (0,-3,0)$);%скв
    \coordinate (b5) at ($(b3) + (4,0,0)$);
    \coordinate (b6) at ($(b5) + (0,3,0)$);%скв
    \coordinate (b7) at ($(b5) + (2,0,0)$);%скв
    \fill[black] (b1) circle (6pt);
%   \draw (b1) -- (b2) (b2) -- (b3) (b3) -- (b4) (b3) -- (b5) (b5) -- (b6) (b5) -- (b7);
    \draw (b1) -- (b2) node [font=\footnotesize, midway, anchor=center, sloped, above=-1pt]{\diameter\,100\,mm};
    \draw (b1) -- (b2) node [font=\footnotesize, midway, anchor=center, sloped, below=-1pt]{500\,m}; 
%
    \draw (b2) -- (b3) node [font=\footnotesize, midway, anchor=center, sloped, above=-1pt]{\diameter\,140\,mm};
    \draw (b2) -- (b3) node [font=\footnotesize, midway, anchor=center, sloped, below=-1pt]{1000\,m}; 
%
    \draw (b3) -- (b4) node [font=\footnotesize, midway, anchor=center, sloped, above=-1pt]{\diameter\,140\,mm};
    \draw (b3) -- (b4) node [font=\footnotesize, midway, anchor=center, sloped, below=-1pt]{750\,m}; 
%
    \draw (b3) -- (b5) node [font=\footnotesize, midway, anchor=center, sloped, above=-1pt]{\diameter\,140\,mm};
    \draw (b3) -- (b5) node [font=\footnotesize, midway, anchor=center, sloped, below=-1pt]{1000\,m}; 
%
    \draw (b5) -- (b6) node [font=\footnotesize, midway, anchor=center, sloped, above=-1pt]{\diameter\,140\,mm};
    \draw (b5) -- (b6) node [font=\footnotesize, midway, anchor=center, sloped, below=-1pt]{750\,m}; 
%
    \draw (b5) -- (b7) node [font=\footnotesize, midway, anchor=center, sloped, above=-1pt]{\diameter\,140\,mm};
    \draw (b5) -- (b7) node [font=\footnotesize, midway, anchor=center, sloped, below=-1pt]{500\,m}; 
%
    \fill[red] (b1) circle (2pt);
    \fill[red] (b2) circle (2pt);
    \fill[red] (b3) circle (2pt);
    \fill[red] (b4) circle (2pt);
    \fill[red] (b5) circle (2pt);
    \fill[red] (b6) circle (2pt);
    \fill[red] (b7) circle (2pt);
\end{scope}
%             %
\coordinate (z1) at ($(b4) + (0,0,-7.2)$);
\coordinate (z2) at ($(b6) + (0,0,-7.2)$);
\coordinate (z3) at ($(b7) + (0,0,-7.2)$);
%                     %
\begin{scope}
    \clip (z1) circle (\sizecircleI);
    \fill[red!30] (z2) circle (\sizecircleII);
\end{scope}
\begin{scope}
    \clip (z2) circle (\sizecircleII);
    \fill[red!30] (z3) circle (\sizecircleIII);
\end{scope}
\begin{scope}[red, dashed, line width=0.5pt]
    \draw (z1) circle (\sizecircleI);
    \draw (z2) circle (\sizecircleII);
    \draw (z3) circle (\sizecircleIII);
    
    \drawgas{z1}{\sizecircleI}
    \drawgas{z2}{\sizecircleII}
    \drawgas{z3}{\sizecircleIII}
\end{scope}
%                                 %
\begin{scope}[line width=1.5pt]
%   \draw (b4) -- (z1) (b6) -- (z2) (b7) -- (z3);
    \draw (z1) -- (b4) node [font=\footnotesize, midway, anchor=center, sloped, above=-1pt]{\diameter\,100\,mm};
    \draw (z1) -- (b4) node [font=\footnotesize, midway, anchor=center, sloped, below=-1pt]{1800\,m}; 
%
    \draw (z2) -- (b6) node [font=\footnotesize, midway, anchor=center, sloped, above=-1pt]{\diameter\,100\,mm};
    \draw (z2) -- (b6) node [font=\footnotesize, midway, anchor=center, sloped, below=-1pt]{1800\,m}; 
%
    \draw (z3) -- (b7) node [font=\footnotesize, midway, anchor=center, sloped, above=-1pt]{\diameter\,100\,mm};
    \draw (z3) -- (b7) node [font=\footnotesize, midway, anchor=center, sloped, below=-1pt]{1800\,m}; 
%
\end{scope}
%                                 %
\begin{scope}[black, line width=1.0pt]
    \node[above] at ($(b1) + (0,0,0.3)$) {ITB};
    \draw[latex-] ($(b1) + (0,0.11,0.11)$) -- ++ (0,1,0.5) node[right] {$p_{ITB}$};
    %
    \coordinate (pl_text) at (0,14,7.5);
    \node[above] at (pl_text) {Field};
    \draw[-latex] (pl_text) -- ++ (1,0,-0.5);
    %
    \draw[latex-] ($(b2)!.95!(b3)$) -- ++ (0,-1,1.5) node[left] {Pipeline};
    %
    \draw[latex-] (z3) -- ++ (2,0,1.5) node[left] {$p_{bh}$};
    %
    \draw[latex-] (b7) -- ++ (0,-0.6,0) node[left] {$p_{wh}$};
    %
    \node[above] at (15,2,0) {$p_{rp}$};
    %
    \draw[latex-] ($(b7)!.15!(z3)$) -- ++ (0,-0.6,0) node[left] {Tubing};
    %
    \path (z3) ++ (30:{\sizecircleIII}) coordinate (rpoint);
    \draw[latex-] (rpoint) -- ++ (2,2,0) node[below] {Wells influence contours};
    %
\end{scope}
\end{tikzpicture}
\end{document}
  1. 如何才能使这个数字更加简单且有效?
  2. 如何正确标记管道的直径和长度?在我的 MWE 中,管道被绘制了两次。

答案1

也许可以\pics?无论如何,这是我的建议。

您可以创建多个styles\pics避免重复代码:轴,网格,管道和xy平面中带有箭头的圆圈。

除此之外,我还使用了siunitx单位包,稍微清理了一下代码,改变了一些路径的顺序,以获得更好的可见性,仅此而已。

这是我的代码:

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

\tikzset
{
  axes/.style={line width=1pt,->,shorten >= -1cm},
  green line/.style={green,line width=0.5pt},
  tubing/.style={black, line width=1pt},
  pipeline/.style={blue, line width=2pt},
  pics/my grid/.style 2 args={% (#1,#2) = vertex
      /tikz/transform shape,
      code={%
          \draw[black!30] (0,0) grid (#1,#2);
          \draw[green line] (#1,0) |- (0,#2);
        }},
  pics/axis/.style={% #1 = length
      code={%
        \draw[line width=1pt,->] (O) -- ($(O#1)!-1cm!(O)$);
        \draw[green line,dashed] (O) -- (O#1);
        \node at ($(O#1)!-1.25cm!(O)$) {$\i$};
      }},
  pics/dimension/.style n args={3}{% #1 = second point, #2 diameter, #3 = length
        code={%
          \draw (0,0,0) -- (#1) node[midway,above=-1pt,sloped,font=\footnotesize] {\diameter\,\qty{#2}{\milli\meter}}
                                node[midway,below=-1pt,sloped,font=\footnotesize] {\qty{#3}{\meter}};
        }},
    pics/drawgas/.style={% #1 = radius
        code={%
            \draw[red,dashed,line width=0.5pt] (0,0) circle [radius=#1];
            \foreach \a in {0,60,...,300} 
                \draw[red,dashed,line width=0.5pt, latex-] (\a:0.25) -- (\a:#1-0.25);
        }},
}

\begin{document}
\begin{tikzpicture}[x={(-0.6cm,-0.4cm)}, y={(1cm,0cm)}, z={(0cm,1cm)}]
% dimensions
\def\sizeX{16}
\def\sizeY{16}
\def\sizeZ{7}
\def\sizecircleI{4.5}
\def\sizecircleII{3.5}
\def\sizecircleIII{2}
% coordinates
\coordinate (O)    at (0,0,0);
\coordinate (Ox)   at (\sizeX,0,0);
\coordinate (Oy)   at (0,\sizeY,0);
\coordinate (Oz)   at (0,0,\sizeZ);
\coordinate (Oxy)  at (\sizeX,\sizeY,0);
\coordinate (Oyz)  at (0,\sizeY,\sizeZ);
\coordinate (Oxz)  at (\sizeX,0,\sizeZ);
\coordinate (Oxyz) at (\sizeX,\sizeY,\sizeZ);
\coordinate (b1)   at (0,0.5*\sizeY,\sizeZ);
\coordinate (b2)   at ($(b1) + (2,0,0)$);
\coordinate (b3)   at ($(b2) + (4,0,0)$);
\coordinate (b4)   at ($(b3) + (0,-3,0)$);
\coordinate (b5)   at ($(b3) + (4,0,0)$);
\coordinate (b6)   at ($(b5) + (0,3,0)$);
\coordinate (b7)   at ($(b5) + (2,0,0)$);
\coordinate (z1)   at ($(b4) + (0,0,-7.2)$);
\coordinate (z2)   at ($(b6) + (0,0,-7.2)$);
\coordinate (z3)   at ($(b7) + (0,0,-7.2)$);
% grids
\pic[canvas is xy plane at z=0] {my grid={\sizeX}{\sizeY}};
\pic[canvas is xz plane at y=0] {my grid={\sizeX}{\sizeZ}};
\pic[canvas is yz plane at x=0] {my grid={\sizeY}{\sizeZ}};
% axes
\foreach\i in {x,y,z}
    \pic {axis={\i}};
% circles intersection
\begin{scope}
    \clip         (z2) circle [radius=\sizecircleII];
    \fill[red!30] (z1) circle [radius=\sizecircleI];
    \fill[red!30] (z3) circle [radius=\sizecircleIII];
\end{scope}
% ITB
\fill[black] (b1) circle (6pt);
% black tubing                              %
\begin{scope}[tubing]
    \pic at (z1) {dimension={b4}{100}{1800}};
    \pic at (z2) {dimension={b6}{100}{1800}};
    \pic at (z3) {dimension={b7}{100}{1800}};
\end{scope}
% blue pipelines
\begin{scope}[pipeline]
    \pic at (b1) {dimension={b2}{100}{500}};
    \pic at (b2) {dimension={b3}{140}{1000}};
    \pic at (b3) {dimension={b4}{140}{750}};
    \pic at (b3) {dimension={b5}{140}{1000}};
    \pic at (b5) {dimension={b6}{140}{750}};
    \pic at (b5) {dimension={b7}{140}{500}};
\end{scope}
% red cricles with arrows
\foreach[count=\ii]\i in {\sizecircleI,\sizecircleII,\sizecircleIII}
   \pic at (z\ii) {drawgas={\i}};
% labels (unchanged)                                %
\begin{scope}[black, line width=1.0pt]
    \node[above] at ($(b1) + (0,0,0.3)$) {ITB};
    \draw[latex-] ($(b1) + (0,0.11,0.11)$) -- ++ (0,1,0.5) node[right] {$p_{ITB}$};
    \coordinate (pl_text) at (0,14,7.5);
    \node[above] at (pl_text) {Field};
    \draw[-latex] (pl_text) -- ++ (1,0,-0.5);
    \draw[latex-] ($(b2)!.95!(b3)$) -- ++ (0,-1,1.5) node[left] {Pipeline};
    \draw[latex-] (z3) -- ++ (2,0,1.5) node[left] {$p_{bh}$};
    \draw[latex-] (b7) -- ++ (0,-0.6,0) node[left] {$p_{wh}$};
    \node[above] at (15,2,0) {$p_{rp}$};
    \draw[latex-] ($(b7)!.15!(z3)$) -- ++ (0,-0.6,0) node[left] {Tubing};
    \path (z3) ++ (30:{\sizecircleIII}) coordinate (rpoint);
    \draw[latex-] (rpoint) -- ++ (2,2,0) node[below] {Wells influence contours};
\end{scope}
% points
\foreach\i in {1,...,7}
    \fill[red] (b\i) circle (2pt);
% more green lines
\foreach\i in {xy,xz,yz}
    \draw[green line] (Oxyz) -- (O\i);
\end{tikzpicture}
\end{document}

我没有发布图片,因为它与 OP 中的基本上相同。

相关内容