- Questo topic ha 7 risposte, 3 partecipanti ed è stato aggiornato l'ultima volta 13 anni, 2 mesi fa da .
-
Topic
-
Ho provato a compilare un codice trovato su un sito straniero e scritto da un membro di questo forum:
`\usetikzlibrary{backgrounds,calc,decorations.markings}
\begin{document}\begin{tikzpicture}[scale=1,thick,dot/.style={draw,circle,minimum size=4pt,inner sep=0pt,},
put coord sys/.style={
decoration={markings,
mark= at position 0.5
with
{
\draw[-latex,ultra thin,blue!80!black] (2pt,2pt) — ++(5mm,0) node[above right,rotate=\pgfdecoratedangle] {$\scriptstyle x$};
\draw[-latex,ultra thin,green!80!black] (2pt,2pt) — ++(0,5mm) node[above right,rotate=\pgfdecoratedangle] {$\scriptstyle y$};
}
},
postaction=decorate}]\draw [help lines] (0,0) grid (3,4);
\node[dot] (2) at (0,0) [label={[label distance=1mm]270:2}] {};
\node[dot] (3) at (0,2) [label={[label distance=1mm]180:3}] {};
\node[dot] (1) at (0,4) [label={[label distance=1mm]90:1}] {};
\node[dot] (4) at (3,2) [label={[label distance=1mm]0:4}] {};
\node[dot] (5) at (2.5,4) [label={[label distance=1mm]45:5}] {};\node[draw,hinge,grounded=270,scale=0.85,transform shape] (hinge-1) at (0,4){};
\node[draw,hinge,grounded=270,scale=0.85,transform shape] (hinge-2) at (0,0){};% with a loop is easier
\foreach \source/\dest in {2/3,3/4,2/4,1/3,1/5,4/5,3/5}
\draw[put coord sys] (\source) — (\dest);% background addition
\begin{scope}[on background layer]
\fill[green!70!lime!15 ]
($(hinge-1.south west)+(-0.5,1)$)–
($(hinge-1.south west)+(4.5,1)$)coordinate (x)–
($(x)+(0,-3)$)coordinate (y)–
($(y-|hinge-1.south east)-(0.5,0)$)–
cycle;
\draw[green!70!lime!50]($(hinge-1.south west)+(-0.5,1)$)–
($(hinge-1.south west)+(4.5,1)$)coordinate (x)–
($(x)+(0,-3)$)coordinate (y)
($(hinge-1.south west)+(-0.5,1)$)–($(hinge-1.south west)-(0.5,2)$);
\end{scope}\end{tikzpicture}
\end{document}`
Purtroppo però ottengo un errore. Sembra che non venga trovata la libreria mecCiao
Marco
- Devi essere connesso per rispondere a questo topic.