2

I have a Triangular grid on LaTeX, and I want to draw a shape on top of the triangular grid. To be more specific I want to draw the Koch Snowflake with exactly 3 iterations. How would I draw on top of the triangular grid?

This is the code for the triangular grid:

\begin{figure}
  \includegraphics[width=\textwidth,height=\textheight,keepaspectratio]{TriangularGrid}
\end{figure}

enter image description here

You may have also realized that I drew a triangle at the end of the triangular grid and it appeared on the first page. why did that happen, shouldn't it create an extra page???

Any help would be greatly appreciated.

1 Answers1

1

The general way of drawing on a picture can be seen in Werner's link. This is specifically for the question on how to draw a Koch flake. Rather than using picture-mode, as the question is tagged with, I recommend TikZ, because it has the Koch snowflake in the decorations.fractals library (and generally makes this task simpler). (I obviously do not have your image, so I use a generic one.)

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{decorations.fractals}
\begin{document}
\begin{figure}[htb]
\centering
\begin{tikzpicture}
 \node{\includegraphics[width=\textwidth,height=\textheight,keepaspectratio]{example-image-duck}};
 \begin{scope}[decoration=Koch snowflake,draw=blue,fill=blue!20,thick]
  \filldraw decorate {decorate {(-150:1/2) -- ++ (60:1) 
   -- ++ (-60:1) -- cycle}};
 \end{scope}
\end{tikzpicture}
\end{figure}
\end{document}

enter image description here

  • I am convinced that the choice of the [tag:picture-mode] tag is purely coincidental. New users don't know of or attribute the same context we do to tags. As another example, new users who post a question related to LaTeX often tag the question with [tag:latex3], because there is no [tag:latex] tag. They choose whatever is most convenient for them, not necessarily the site. – Werner Nov 13 '19 at 01:47
  • @Werner This will be most reliably decided by the user, not by a third party. –  Nov 13 '19 at 01:54
  • Thanks you so much!!!! – Mani Singal Nov 13 '19 at 06:53
  • I had another question, for the Koch Snowflake I need to have exactly 3 iterations. The picture above only has 2, so how do I add an extra iteration??? – Mani Singal Nov 13 '19 at 06:55
  • @Schrödinger's cat I'm so sorry, but I had another question. Is it not possible to get the triangular grid to cover the entire page in the document class article. Cause I can do it Document class{tikz}{standalone} – Mani Singal Nov 13 '19 at 08:08