1

How to generate in LaTeX (TikZ or something similar) the following image:

1-IRS (a planner surface that is gridded)

IRS (a planner surface that is gridded)

I wrote This code but I don't know how to tilt it;

\begin{center}
%\fbox{
\begin{tikzpicture}
    \begin{scope}[
        box1/.style={draw=black, thick, rectangle,rounded corners, minimum height=0.75cm, minimum width=0.75cm}]
\draw[black,dashed,fill=red!30] (-.5,-3.2) rectangle (3.2,.5);
\node[box1, fill=green!30] (c1) {};
\node[box1, fill=green!30, right=.125cm of c1] (c2) {};
\node[box1, fill=green!30, right=.125cm of c2] (c3) {};
\node[box1, fill=green!30, right=.125cm of c3] (c4) {};
\node[box1, fill=green!30, below=.125cm of c4] (c5) {};
\node[box1, fill=green!30, left=.125cm of c5] (c6) {};
\node[box1, fill=green!30, left=.125cm of c6] (c7) {};
\node[box1, fill=green!30, left=.125cm of c7] (c8) {};
\node[box1, fill=green!30, below=.125cm of c8] (c9) {};
\node[box1, fill=green!30, right=.125cm of c9] (c10) {};
\node[box1, fill=green!30, right=.125cm of c10] (c11) {};
\node[box1, fill=green!30, right=.125cm of c11] (c12) {};
\node[box1, fill=green!30, below=.125cm of c12] (c13) {};
\node[box1, fill=green!30, left=.125cm of c13] (c14) {};
\node[box1, fill=green!30, left=.125cm of c14] (c15) {};
\node[box1, fill=green!30, left=.125cm of c15] (c15) {};
        \end{scope}
\end{tikzpicture}
%}
\end{center}

enter image description here

2-micro controller (a simple circuit-like icon

micro controller (a simple circuit-like icon )

6
  • 1
    Welcome to TSE. What did you try? Commented Mar 27, 2022 at 11:36
  • Mer30, I use \draw and rotate option Commented Mar 27, 2022 at 12:43
  • 3
    Welcome to TeX.SX! 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. Commented Mar 27, 2022 at 14:41
  • Somewhat related: tex.stackexchange.com/questions/170244/… Commented Mar 27, 2022 at 15:05
  • @StefanPinnow Ok, Thanks Commented Mar 27, 2022 at 18:15

1 Answer 1

0

For your first problem (you can also use a foreach loop to simplify it, but...) you can use yslant and tranform shape (to apply the slant to also nodes in the picture).

For the second part, the best option is to just use an \includegraphics maybe in a node... or in a circuitikz's twoport (to give meaning to the tag, really, you can do it easily in pure TikZ).

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage{graphicx}
\usepackage{circuitikz}
\usetikzlibrary{positioning}
\begin{document}
\begin{tikzpicture}
    \begin{scope}[
        box1/.style={draw=black, thick, rectangle,rounded corners, minimum height=0.75cm, minimum width=0.75cm},
        yslant=-0.3, transform shape]
        \draw[black,dashed,fill=red!30] (-.5,-3.2) rectangle (3.2,.5);
        \node[box1, fill=green!30] (c1) {};
        \node[box1, fill=green!30, right=.125cm of c1] (c2) {};
        \node[box1, fill=green!30, right=.125cm of c2] (c3) {};
        \node[box1, fill=green!30, right=.125cm of c3] (c4) {};
        \node[box1, fill=green!30, below=.125cm of c4] (c5) {};
        \node[box1, fill=green!30, left=.125cm of c5] (c6) {};
        \node[box1, fill=green!30, left=.125cm of c6] (c7) {};
        \node[box1, fill=green!30, left=.125cm of c7] (c8) {};
        \node[box1, fill=green!30, below=.125cm of c8] (c9) {};
        \node[box1, fill=green!30, right=.125cm of c9] (c10) {};
        \node[box1, fill=green!30, right=.125cm of c10] (c11) {};
        \node[box1, fill=green!30, right=.125cm of c11] (c12) {};
        \node[box1, fill=green!30, below=.125cm of c12] (c13) {};
        \node[box1, fill=green!30, left=.125cm of c13] (c14) {};
        \node[box1, fill=green!30, left=.125cm of c14] (c15) {};
        \node[box1, fill=green!30, left=.125cm of c15] (c15) {};
    \end{scope}
\end{tikzpicture}

\begin{tikzpicture}[]
        \draw (0,0) to[twoport, t={\includegraphics[width=1.8cm]{example-image-duck}}, >, blocks/scale=2] ++(3,0) node[inputarrow]{};
\end{tikzpicture}

\end{document}

output from the above snippet

1
  • 1
    Thanks a lot and wish you the best :) Commented Mar 28, 2022 at 8:21

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .