2

Could someone please help me to produce a pair of the following pair of objects: on the left hand side we have a rectangular cuboid (2x3x3 ''cube'') with nodes on both sides connected by dashed lines and on the right hand side the cuboid is sliced into two parts (and nodes are also connected with dashed lines) enter image description here

  • Questions about how to draw specific graphics that just post an image of the desired result are really not reasonable questions to ask on the site. Please post a minimal compilable document showing that you've tried to produce the image and then people will be happy to help you with any specific problems you may have. See minimal working example (MWE) for what needs to go into such a document. – darthbith Nov 28 '14 at 20:28
5
\documentclass[tikz]{standalone}
\begin{document}
\begin{tikzpicture}
\def\a#1{\begin{scope}[yslant=0.7]
\draw[dotted] (0,0) grid[step=1cm] (2,2);
\draw (0,0) rectangle (2,2);
\foreach \x in {0,1,2}{\foreach \y in {0,1,2}{
\node[circle,fill,inner sep=2pt] (n-#1\x\y)at (\x,\y){};}}
\end{scope}}\a{a}\begin{scope}[shift={(2.5cm,0)}]\a{b}\end{scope}
\foreach \x in {0,2}{\foreach \y in {0,2}{\draw (n-a\x\y) --(n-b\x\y);}}
\begin{scope}[xshift=5cm]\a{c}\end{scope}
\begin{scope}[xshift=7.5cm]\a{d}\end{scope}
\end{tikzpicture}
\end{document}

enter image description here

3

This is more verbose (just for comparison):

\documentclass[12pt,a4paper]{article}
\usepackage{tikz}
\tikzset{mynode/.style={inner sep=1pt,fill,outer sep=0,circle}}

\begin{document}

\begin{tikzpicture}[scale=2,line width=0.5pt,x=2cm,baseline={(current bounding box.center)}]
  \foreach \x/\y/\z/\a in {0/0/0/1,0/1/0/2,1/1/0/3,1/0/0/4,0/0/1/5,0/1/1/6,1/1/1/7,1/0/1/8} {
    \coordinate (\a) at (\x,\y,\z);
    }

   \foreach \x/\y/\z/\a in  {0/0/0.5/11,0/1/0.5/21,0/0.5/0/31,0/0.5/1/41,
                     0/0.5/0.5/51,1/0/0.5/61,1/1/0.5/71,1/0.5/0/81, 1/0.5/1/91,1/0.5/0.5/101} {
    \coordinate (\a) at (\x,\y,\z);
    }


 \draw  (2) -- (3) -- (4);
 \draw (5) -- (6) -- (7) -- (8) -- cycle;
 \draw   (2) -- (6) (3) -- (7) (4) -- (8);

 \foreach \x in {1,2,...,8}{
     \node[mynode] at (\x) {};
 }

 \draw[dashed]  (1) -- (2)
        (1) -- (4)
        (1) -- (5);


 \draw[dashed] (11) -- (21)
                (31)--(41)
                (61) -- (71)
                (81) -- (91);


 \foreach \x in {11,21,...,101}{
     \node[mynode] at (\x) {};
 }

\end{tikzpicture}
\tikz\draw[thick,-latex] (0,0) -- (3,0);
\begin{tikzpicture}[scale=2,line width=0.5pt,x=2cm,baseline={(current bounding box.center)}]
  \foreach \x/\y/\z/\a in {0/0/0/1,0/1/0/2,1/1/0/3,1/0/0/4,0/0/1/5,0/1/1/6,1/1/1/7,1/0/1/8} {
    \coordinate (\a) at (\x,\y,\z);
    }

   \foreach \x/\y/\z/\a in  {0/0/0.5/11,0/1/0.5/21,0/0.5/0/31,0/0.5/1/41,
                     0/0.5/0.5/51,1/0/0.5/61,1/1/0.5/71,1/0.5/0/81, 1/0.5/1/91,1/0.5/0.5/101} {
    \coordinate (\a) at (\x,\y,\z);
    }


 \draw  (1) -- (5) -- (6) -- (2) -- cycle;
 \draw (4) -- (8) -- (7) -- (3) -- cycle;

 \foreach \x in {1,2,...,8}{
     \node[mynode] at (\x) {};
 }

 \draw[dashed] (11) -- (21)
                (31)--(41)
                (61) -- (71)
                (81) -- (91);


 \foreach \x in {11,21,...,101}{
     \node[mynode] at (\x) {};
 }

\end{tikzpicture}

\end{document}

enter image description here

1

Just another option which uses percusse's code adapted to pics.

\documentclass[tikz]{standalone}
\begin{document}

\tikzset{plane/.pic={
    \begin{scope}[yslant=0.7]
        \draw[dotted] (-1,-1) grid[step=1cm] (1,1);
        \draw (-1,-1) rectangle (1,1);
        \foreach \x in {-1,0,1}{
            \foreach \y in {-1,0,1}{
                \node[circle,fill,inner sep=2pt] (\x\y)at (\x,\y){};
            }
        }
    \end{scope}
    }
    }

\begin{tikzpicture}

\draw pic (a) {plane};
\draw pic (b) at (3,0) {plane};
\draw pic (c) at (7.5,0) {plane};
\draw pic (d) at (10.5,0) {plane};

\draw (a-1-1)--(b-1-1) (a-11)--(b-11) (a1-1)--(b1-1) (a11)--(b11);

\draw[-latex, shorten >=1cm,shorten <=1cm] (b00)--(c00);
\end{tikzpicture}
\end{document}

enter image description here

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.