1

I have a image constructed by this way:

\usepackage{tkz-euclide}
\usetikzlibrary{intersections,arrows.meta}
\usetkzobj{all}
\usetikzlibrary{patterns}
\pgfdeclarepatternformonly{my north east lines}{\pgfqpoint{-1pt}{-1pt}}{%
\pgfqpoint{8pt}{8pt}}{\pgfqpoint{7pt}{7pt}}%
{
  \pgfsetlinewidth{0.4pt}
  \pgfpathmoveto{\pgfqpoint{0pt}{0pt}}
  \pgfpathlineto{\pgfqpoint{7.1pt}{7.1pt}}
  \pgfusepath{stroke}
}        

\begin{figure}[t!]
    \centering
    %--------------------------
    \begin{tikzpicture}[>= {Stealth[scale=2.2,inset=0pt,angle'=20]}]  
      %Definindo os vertices
      %Chao2
      \tkzDefPoint (0,0){A}
      \tkzDefPoint (6,2.25){B}
      %Eixo horizontal
      \tkzDefPoint (0,0){C}
      \tkzDefPoint (6,0){D}
      %Eixo y
      \coordinate (E) at ($ (B)!1!(A) $);
          \coordinate (F) at ($ (E)!3.2cm!90:(B) $);
          \draw[->] (E) -- (F);
          %Chao1
          \coordinate (G) at ($ (E)!0.86!(F) $);
          \coordinate (H) at ($ (G)!6cm!90:(E) $);
          \draw (G) -- (H);
          %Linha interface
          \coordinate (I) at ($ (E)!0.35!(F) $);
          \coordinate (J) at ($ (I)!6cm!90:(E) $);
          \draw[dashed] (I) -- (J);
      %Desenhando as retas/setas
      \draw (A) -- (B); 
      \draw[dashed] (C) -- (D);
      %Arco ângulo e legenda
      \tkzDrawArc[R with nodes, color=black](A,1cm)(D,B)
      \tkzLabelAngle[pos = 1.25](D,A,B){$\theta$}
    \end{tikzpicture}
      \end{figure}

The result:

enter image description here

How can I draw these line like this next image:

enter image description here

Mateus
  • 451
  • Have a look at this answer. All the patterns you need is probably in \usetikzlibrary{patterns}. – Ruixi Zhang Sep 05 '18 at 20:30
  • 1
    @RuixiZhang Not quite. Patterns cannot be rescaled or transformed in another way. So if the OP wants to adjust the distance, angle or line width of the lines, (s)he has to define a new pattern or copy if from somewhere else. –  Sep 05 '18 at 20:37

1 Answers1

1

Assuming that you want to use your pattern for this, you could do

\documentclass[tikz,border=3.14mm]{standalone}
\usepackage{tkz-euclide}
\usetikzlibrary{intersections,arrows.meta}
\usetkzobj{all}
\usetikzlibrary{patterns}
\pgfdeclarepatternformonly{my north east lines}{\pgfqpoint{-1pt}{-1pt}}{%
\pgfqpoint{8pt}{8pt}}{\pgfqpoint{7pt}{7pt}}%
{
  \pgfsetlinewidth{0.4pt}
  \pgfpathmoveto{\pgfqpoint{0pt}{0pt}}
  \pgfpathlineto{\pgfqpoint{7.1pt}{7.1pt}}
  \pgfusepath{stroke}
}

\begin{document}
    \centering
    %--------------------------
    \begin{tikzpicture}[>= {Stealth[scale=2.2,inset=0pt,angle'=20]}]  
      %Definindo os vertices
      %Chao2
      \tkzDefPoint (0,0){A}
      \tkzDefPoint (6,2.25){B}
      %Eixo horizontal
      \tkzDefPoint (0,0){C}
      \tkzDefPoint (6,0){D}
      %Eixo y
      \coordinate (E) at ($ (B)!1!(A) $);
          \coordinate (F) at ($ (E)!3.2cm!90:(B) $);
          \draw[->] (E) -- (F);
          %Chao1
          \coordinate (G) at ($ (E)!0.86!(F) $);
          \coordinate (H) at ($ (G)!6cm!90:(E) $);
          \draw (G) -- (H);
          \path[pattern=my north east lines] (G) -- (H) -- ($(H)!4mm!270:(G)$)
          --($(G)!4mm!90:(H)$) -- cycle;
          %Linha interface
          \coordinate (I) at ($ (E)!0.35!(F) $);
          \coordinate (J) at ($ (I)!6cm!90:(E) $);
          \draw[dashed] (I) -- (J);
      %Desenhando as retas/setas
      \draw (A) -- (B); 
      \coordinate (A') at ($(A)!0.25!(B)$);
      \path[pattern=my north east lines] (A') -- (B) -- ($(B)!4mm!90:(A)$)
          --($(A')!4mm!270:(B)$) -- cycle;
      \draw[dashed] (C) -- (D);
      %Arco ângulo e legenda
      \tkzDrawArc[R with nodes, color=black](A,1cm)(D,B)
      \tkzLabelAngle[pos = 1.25](D,A,B){$\theta$}
    \end{tikzpicture}
\end{document}

enter image description here