3

I'm looking for a way to concat a segmental regions into one region that overlap each other like this one: enter image description here

For the gray region on the left picture, i have generated a pentagon from this question answer: Creating random patterns in TikZ. But how can i concat those region into one region like the right picture and still keep the distance? This is from BLICHFELD's theorem in https://cims.nyu.edu/~regev/teaching/lattices_fall_2004/ln/introduction.pdf

\begin{tikzpicture}[scale=0.45]
        \coordinate (Origin)   at (0,0);
        \coordinate (XAxisMin) at (-3,0);
        \coordinate (XAxisMax) at (10,0);
        \coordinate (YAxisMin) at (0,-2);
        \coordinate (YAxisMax) at (0,10);
    \draw [thin, black,-latex] (XAxisMin) -- (XAxisMax);% Draw x axis
    \draw [thin, black,-latex] (YAxisMin) -- (YAxisMax);% Draw y axis

    \clip (0, 0) rectangle (8cm,4cm);
    \coordinate (Bone) at (0,2);
    \coordinate (Btwo) at (4,2);
    %\coordinate (Bthree) at (2, 4);
    \draw[style=help lines,dashed] (-14,-14) grid[step=2cm] (14,14);

   \foreach \x in {-7,-6,...,7}{% Two indices running over each
        \foreach \y in {-7,-6,...,7}{% node on the grid we have drawn 
            \node[draw,circle,inner sep=2pt,fill] at (4*\x, 4*\x + 2*\y) {};
                % Places a dot at those points
        }
    }

    %\draw [ultra thick,-latex,red] (Origin)
    %    -- (Bthree) node [above, right] {$b_3$};
    \fill[fill=gray, fill opacity=0.3, draw=black] (4,2) ellipse (3cm and 1.75cm);

\end{tikzpicture}

haxerl
  • 133
  • 4
  • 2
    Welcome to TeX.SX! Could you maybe provide the code for this drawing? It will be easier to help you then. – Jasper Habicht Dec 16 '21 at 16:35
  • @JasperHabicht I have edit the post so it include my image on the left but i can't find the code for the drawing of the pdf because it is in a paper and i want to recreate it. – haxerl Dec 16 '21 at 17:03
  • I would do this by drawing the region times shifted so that different quadrants overlap as desired and then use \clip to keep only the quadrant with the overlap. – Willoughby Dec 16 '21 at 17:05

1 Answers1

3

This probably needs some refinement, but you could maybe make use of the spy library:

\documentclass[border=1mm, tikz]{standalone}
\usetikzlibrary{spy}

\begin{document}

\begin{tikzpicture}[scale=0.45, spy using overlays={black!0, height={0.452cm}, width={0.454cm}, anchor=south west}] \coordinate (Origin) at (0,0); \coordinate (XAxisMin) at (-3,0); \coordinate (XAxisMax) at (10,0); \coordinate (YAxisMin) at (0,-2); \coordinate (YAxisMax) at (0,10);

\draw [thin, black,-latex] (XAxisMin) -- (XAxisMax);% Draw x axis
\draw [thin, black,-latex] (YAxisMin) -- (YAxisMax);% Draw y axis

\begin{scope}
\clip (0, 0) rectangle (8cm,4cm);
\coordinate (Bone) at (0,2);
\coordinate (Btwo) at (4,2);
%\coordinate (Bthree) at (2, 4);
\draw[style=help lines,dashed] (-14,-14) grid[step=2cm] (14,14);

\foreach \x in {-7,-6,...,7}{% Two indices running over each
    \foreach \y in {-7,-6,...,7}{% node on the grid we have drawn 
        \node[draw,circle,inner sep=2pt,fill] at (4*\x, 4*\x + 2*\y) {};
            % Places a dot at those points
    }
}

%\draw [ultra thick,-latex,red] (Origin)
%    -- (Bthree) node [above, right] {$b_3$};
\fill[fill=gray, fill opacity=0.3, draw=black] (4,2) ellipse (3cm and 1.75cm);
\end{scope}

\spy on (0,0) in node at (2,6);
\spy on ({.45*4},0) in node at (2,6);
\spy on (0,{.45*2}) in node at (2,6);
\spy on ({.45*4},{.45*2}) in node at (2,6);

\end{tikzpicture} \end{document}

enter image description here


To make the spy image larger, you can use the option magnification. But note that since you are not spying with a regular circle or square, you need to state the height and width of the spy image explicitly:

\documentclass[border=1mm, tikz]{standalone}
\usetikzlibrary{spy}

\begin{document}

\begin{tikzpicture}[scale=0.45, spy using overlays={black!0, height={20.454cm}, width={20.458cm}, anchor=south west, magnification=2}] \coordinate (Origin) at (0,0); \coordinate (XAxisMin) at (-3,0); \coordinate (XAxisMax) at (10,0); \coordinate (YAxisMin) at (0,-2); \coordinate (YAxisMax) at (0,10);

\draw [thin, black,-latex] (XAxisMin) -- (XAxisMax);% Draw x axis
\draw [thin, black,-latex] (YAxisMin) -- (YAxisMax);% Draw y axis

\begin{scope}
\clip (0, 0) rectangle (8cm,4cm);
\coordinate (Bone) at (0,2);
\coordinate (Btwo) at (4,2);
%\coordinate (Bthree) at (2, 4);
\draw[style=help lines,dashed] (-14,-14) grid[step=2cm] (14,14);

\foreach \x in {-7,-6,...,7}{% Two indices running over each
    \foreach \y in {-7,-6,...,7}{% node on the grid we have drawn 
        \node[draw,circle,inner sep=2pt,fill] at (4*\x, 4*\x + 2*\y) {};
            % Places a dot at those points
    }
}

%\draw [ultra thick,-latex,red] (Origin)
%    -- (Bthree) node [above, right] {$b_3$};
\fill[fill=gray, fill opacity=0.3, draw=black] (4,2) ellipse (3cm and 1.75cm);
\end{scope}

\spy on (0,0) in node at (2,6);
\spy on ({.45*4},0) in node at (2,6);
\spy on (0,{.45*2}) in node at (2,6);
\spy on ({.45*4},{.45*2}) in node at (2,6);

\end{tikzpicture} \end{document}

enter image description here