2

I want to create this:

1

I have created this code / MWE:

\documentclass[12pt]{article}
\usepackage{tikz}
\usetikzlibrary{decorations.pathreplacing}

\begin{document}
    \begin{tikzpicture}[scale=1,>=latex,x=1cm,y=0.8cm]
        \coordinate (v0) at (4,0);
        \coordinate (v1) at (6,1.8);
        \coordinate (v2) at (4.8,2.5);
        
        \draw (-4,0) -- (4,0) -- (4,2) -- (-4,2) --cycle;
        \draw (-4,2) -- (4,2) -- (4.8,2.5) -- (-3,2.5) --cycle;
        \draw (4,0) -- (4,2) -- (4.8,2.5) -- (6,1.8) --cycle;
        \draw[fill=blue!37] (4.8,2.5) -- (6,1.8) -- (7,2.7) -- (7,4) --cycle;
        \draw[fill=blue!37] (4.8,2.5) -- (7,4) -- (0,4) -- (-3,2.5) --cycle;
        
        \pic [draw, -, "$60^{0}$", angle eccentricity=1.5] {angle = v0--v1--v2};
        
        \draw[<->] (-4,-1) -- (4,-1) node[below, midway]  {\footnotesize $200 \ ft$};
        \draw[<->] (6.2,2) -- (5.2,2.5) node[right]  {\footnotesize $100 \ ft$};
    \end{tikzpicture}
\end{document}

2tikz

the questions are:

  1. I can't make drawing angle with \pic works..
  2. How to create the water shape better? Mine is just plain rectangle..
0

1 Answer 1

3

To answer your questions:

  1. You need these TikZ libraries:
\usetikzlibrary{angles,quotes}

However I suggest you another option, use the one you like more. Both need a new axes system, that you can get with canvas is ... options from 3d library.

  1. With the random steps decoration, from decorations.pathmorphing library.

Now, and unrelated, I suggest you siunitx package to write the length units. And works for angles too.

A complete example could be:

\documentclass[tikz,border=2mm]{standalone}
\usepackage{siunitx} % SI units (or any other unit)
\usetikzlibrary{3d,decorations.pathmorphing}
\usetikzlibrary{angles,quotes} % <-- only for the second option for the angle

\tikzset
{% decoration for the water lines
   ragged line/.style={decoration={random steps,segment length=2mm,amplitude=0.7mm},
                       decorate,rounded corners=0.4mm},
   right plane/.style={canvas is yz plane at x=3}
}

\begin{document}
\begin{tikzpicture}[line cap=round,line join=round,scale=2]

\coordinate (C0) at (3,0,0);
\coordinate (A1) at (0,1,-1.5);
\coordinate (B1) at (3,1,-1.5);
\coordinate (C1) at (3,0,{-1.5-1/tan(60)});
\coordinate (A2) at (0,1,-4);
\coordinate (B2) at (3,1,-4);
\coordinate (C2) at (3,0,-4);
% water
\fill[cyan!30] (A2) decorate[ragged line] {-- (B2) -- (C2)} -- (C1) -- (B1) -- (A1) -- cycle;
% lines
\draw (0,0,0) rectangle (3,1,0);
\draw (A1) -- (B1) -- (C1);
\foreach\i in {A,B,C}
  \draw (\i2) --++ (0,0,4);
% first option for the angle
\draw[right plane] (C1) ++ (0,0.5) arc (90:30:0.5) node[midway,left] {\ang{60}};
% second option for the angle
%\coordinate (C0) at (3,0,0);
%\pic[red,right plane,draw,angle radius=1cm,angle eccentricity=1.7,"\ang{60}"] {angle = B1--C1--C0};
% dimensions
\foreach\i in {0,3}
  \draw[very thin] (\i,-0.1,0) --++ (0,-0.5,0);
\draw[latex-latex] (0,-0.5,0)  --++ (3,0,0) node[midway,above] {\qty{200}{ft}};
\draw[latex-latex,right plane] (B1) ++ (0,-0.2) --++ (-1,{-1/tan(60)}) 
      node[midway,above right] {\qty{100}{ft}};
\end{tikzpicture}
\end{document}

enter image description here

5
  • 2
    Spectacular :-)
    – Sebastiano
    Jan 22 at 10:40
  • 1
    @Sebastiano, thanks!! :D Jan 22 at 10:47
  • 1
    It's amazing, thanks a lot! Jan 23 at 6:55
  • 1
    I'll try to create with scope, canvas is... etc from your suggestions. It will take time, more flight time.. Jan 23 at 6:56
  • @FreyatheGoddess, you're welcome!! Jan 23 at 7:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.