How to draw this picture in 3D (TikZ)?
\documentclass[tikz,border=2mm]{standalone}
\usepackage{tikz}
\usetikzlibrary{calc,3d}
\begin{document}
%%%%%%%%%%%%%%%%%
\begin{tikzpicture}
[x={(-0.6cm,-0.4cm)}, y={(1cm,0cm)}, z={(0cm,1cm)}, scale=1.0]
\def\sizeX{12}
\def\sizeY{12}
\def\sizeZ{5}
% Рисуем пласт %
\begin{scope}[dashed, line width=1.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 (p1) -- (p2) -- (p3) -- (p4) -- (p1) (pp1) -- (pp2) -- (pp3) -- (pp4) -- (pp1) (p1) -- (pp1) (p2) -- (pp2) (p3) -- (pp3) (p4) -- (pp4);
\end{scope}
% Рисуем трупопровод %
\begin{scope}[blue, line width=2.5pt]
\coordinate (b1) at ($(p2)!.5!(p3) + (0,0,1)$);
\coordinate (b2) at ($(b1) + (5,0,0)$);
\coordinate (b3) at ($(b2) + (0,-2,0)$);%скв
\coordinate (b4) at ($(b2) + (4,0,0)$);
\coordinate (b5) at ($(b4) + (0,2,0)$);%скв
\coordinate (b6) at ($(b4) + (3,0,0)$);%скв
\fill[black] (b1) circle (4pt);
\draw (b1) -- (b2) (b2) -- (b3) (b2) -- (b4) (b4) -- (b5) (b4) -- (b6);
\end{scope}
% Рисуем скважины %
\begin{scope}[line width=2.5pt]
\coordinate (z1) at ($(b3) + (0,0,-3)$);
\coordinate (z2) at ($(b5) + (0,0,-3)$);
\coordinate (z3) at ($(b6) + (0,0,-3)$);
\draw (b3) -- (z1) (b5) -- (z2) (b6) -- (z3);
\end{scope}
% Рисуем контуры влияния %
\begin{scope}
\clip (z1) circle (4);
\fill[red] (z2) circle (2.5);
\end{scope}
\begin{scope}
\clip (z2) circle (2.5);
\fill[red] (z3) circle (3);
\end{scope}
\begin{scope}[dashed, line width=1pt]
\draw (z1) circle (4);
\draw (z2) circle (2.5);
\draw (z3) circle (3);
\end{scope}
\end{tikzpicture}
%%%%%%%%%%%%%%%%%
\end{document}
How to get the coordinates x,y,z from 3D points?
How to move the shape to the front?
How to get a point on the circle?
Best Answer
When I did something like this, I put all the draw commands in a separate command. Then I used them in 2 pictures, one top view (to have an overview) and one 3D view (the final picture). As TikZ is not really 3D capable you'll have to work around certain things, curved things like cylinders are mean but can be approximated (look at
(x) -- ++ (y)
,(x) ++ (y)
and stuff the calc library cna do). Here's the given picture, I tried to comment everything. If anything remains unclear, please don't hesitate to ask.Code
Output