First, the straighforward answer to your question whether it is possible to draw connections between the two green rectangles: It is. You can assign names to the coordinates of the first rectangle's corners using \coordinate
, which creates nodes at the given coordinates. These can then be referenced in the second scope:
\documentclass[12pt]{article}
\usepackage{tikz}
\usetikzlibrary{positioning}
\begin{document}
\pagestyle{empty}
\begin{tikzpicture}[scale=.9,every node/.style={minimum size=1cm},on grid]
\begin{scope}[ % Upper layer
yshift=90,every node/.append style={
yslant=0.5,xslant=-1},yslant=0.5,xslant=-1
]
\fill[white,fill opacity=.9] (0,0) rectangle (5,5);
\draw[step=10mm, green] (1,1) grid (4,4);
\draw[green,very thick] (1,1) rectangle (4,4);
\draw[black,dashed] (0,0) rectangle (5,5);
\coordinate (A) at (1,1); \coordinate (B) at (1,4); \coordinate (C) at (4,1); \coordinate (D) at (4,4);
\end{scope}
\begin{scope}[ % Lower layer
yshift=170,every node/.append style={
yslant=0.5,xslant=-1},yslant=0.5,xslant=-1
]
\draw (A) -- (2.05,2.05) (B) -- (2.05,3) (C) -- (3,2.05) (D) -- (3,3);
\fill[white,fill opacity=0.6] (0,0) rectangle (5,5);
\draw[step=10mm, black] (2,2) grid (5,5);
\draw[step=3.33mm, green] (2,2) grid (3,3);
\draw[black,very thick] (2,2) rectangle (5,5);
\draw[black,dashed] (0,0) rectangle (5,5);
\draw[green,very thick] (2.05,2.05) rectangle (3,3);
\end{scope}
\end{tikzpicture}
\end{document}
Concerning "other ideas": You could also use rectangle nodes instead of paths, which saves you the hassle of having to enter the coordinates manually. In order for the connection lines to be behind the top rectangle, you can use layers. I would furthermore put the zoomed in rectangle above the small scale one, rotate everything a little bit, and make the black grid a bit lighter:
\documentclass[12pt]{article}
\usepackage{tikz}
\usetikzlibrary{positioning}
\begin{document}
\pagestyle{empty}
\pgfdeclarelayer{bottom} \pgfdeclarelayer{top}
\pgfsetlayers{bottom,main,top}
\begin{tikzpicture}[scale=.9,every node/.style={minimum size=1cm},on grid]
\begin{pgfonlayer}{bottom}
\begin{scope}[ % Lower layer
yshift=0,every node/.append style={
yslant=0.5,xslant=-1,rotate=-10},yslant=0.5,xslant=-1,rotate=-10
]
\fill[white,fill opacity=0.9] (0,0) rectangle (5,5);
\draw[step=10mm, gray!70] (2,2) grid (5,5);
\draw[step=3.33mm, green] (2,2) grid (3,3);
\draw[gray,very thick] (2,2) rectangle (5,5);
\draw[black,dashed] (0,0) rectangle (5,5);
\node[name=B,draw,scale=0.9,green,very thick,text width=0.95,text height=0.95,inner sep=0pt,] at (2.525,2.525) {};
\end{scope}
\end{pgfonlayer}
\begin{scope}[ % Upper layer
yshift=105,every node/.append style={
yslant=0.5,xslant=-1,rotate=-10},yslant=0.5,xslant=-1,rotate=-10
]
\fill[white,fill opacity=.6] (0,0) rectangle (5,5);
\draw[step=10mm, green] (1,1) grid (4,4);
\node[scale=.9,draw,green,very thick,name=A,text width=3cm,text height=3cm,inner sep=0pt] at (2.5,2.5) {};
\draw[black,dashed] (0,0) rectangle (5,5);
\begin{pgfonlayer}{bottom}
\foreach \i in {north east,north west,south west,south east}
\draw (A.\i) -- (B.\i);
\end{pgfonlayer}
\end{scope}
\end{tikzpicture}
\end{document}