Tenho uma imagem em minha tese onde discuto as semelhanças entre conceitos básicos de cores e uma bússola. A imagem original é algo que juntei mal no Paint, mas pensei que poderia torná-la um pouco melhor juntando algo mal junto com tikz
. Esta é a imagem original:
Meu plano é ter no final algo parecido com isso, mas no momento estou preso porque a área que estou tentando preencher com preto não preenche e não consigo descobrir o que estou fazendo de errado. É assim que parece no momento:
Eu queria que a área entre as duas linhas norte fosse colorida de preto. E este é o meu código:
\documentclass{book}
\usepackage{tikz}
\usetikzlibrary {decorations.pathmorphing}
\begin{document}
\begin{tikzpicture}[inner sep=0,outer sep=0,]
% circles (from centre)
\node[thick,draw=black,circle,
minimum size=1cm,
decorate,
decoration={random steps,segment length=1.5pt,amplitude=0.2pt}] (centre) at (0,0) {};
\node[thick,draw=black,circle,
minimum size=4.5cm,
decorate,
decoration={random steps,segment length=1.5pt,amplitude=0.2pt}] (inedge) at (0,0) {};
\node[thick,draw=black,circle,
minimum size=5cm,
decorate,
decoration={random steps,segment length=1.5pt,amplitude=0.2pt}] (outedge) at (0,0) {};
% main direction nodes
\begin{scope}[label distance=0.5cm]
% North
\node[thick,draw=black,circle,
minimum size=0.3cm,
label=above:\Large{$\mathcal{N}$}] (N) at (0,3.5) {};
\node[circle,draw=black,fill=black,
minimum size=1.5mm] (n) at (0,3.5) {};
% East
\node[thick,draw=black,circle,
minimum size=0.3cm,
label=right:\Large{$\mathcal{E}$}] (E) at (3.5,0) {};
\node[circle,draw=black,fill=black,
minimum size=1.5mm] (e) at (3.5,0) {};
% South
\node[thick,draw=black,circle,
minimum size=0.3cm,
label=below:\Large{$\mathcal{S}$}] (S) at (0,-3.5) {};
\node[circle,draw=black,fill=black,
minimum size=1.5mm] (s) at (0,-3.5) {};
% West
\node[thick,draw=black,circle,
minimum size=0.3cm,
label=left:\Large{$\mathcal{W}$}] (W) at (-3.5,0) {};
\node[circle,draw=black,fill=black,
minimum size=1.5mm] (w) at (-3.5,0) {};
\end{scope}
% mainlines
\draw[thick,
decorate,
decoration={random steps,segment length=3pt,amplitude=0.1pt}]
(centre) -- (N);
\draw[thick,
decorate,
decoration={random steps,segment length=3pt,amplitude=0.1pt}]
(centre) -- (E);
\draw[thick,
decorate,
decoration={random steps,segment length=3pt,amplitude=0.1pt}]
(centre) -- (S);
\draw[thick,
decorate,
decoration={random steps,segment length=3pt,amplitude=0.1pt}]
(centre) -- (W);
% Main points
\filldraw[black] (-0.35cm,0.35cm) -- (N) -- (centre) -- cycle; % why u no fill?!!
\end{tikzpicture}
\end{document}
Eu percebo que meu código é muito repetitivo, mas tentei definir os aspectos do tikzpicture
e criar um /.style
, mas não tive sucesso, então decidi fazer desta forma para que funcione e limpá-lo mais tarde, quando tiver todos os detalhes descobertos.
Responder1
você deve usar coordenadas em vez de nós:
\documentclass{book}
\usepackage{tikz}
\usetikzlibrary {decorations.pathmorphing}
\begin{document}
\begin{tikzpicture}[inner sep=0,outer sep=0,]
% circles (from centre)
\node[thick,draw=black,circle,
minimum size=1cm,
decorate,
decoration={random steps,segment length=1.5pt,amplitude=0.2pt}] (centre) at (0,0) {};
\node[thick,draw=black,circle,
minimum size=4.5cm,
decorate,
decoration={random steps,segment length=1.5pt,amplitude=0.2pt}] (inedge) at (0,0) {};
\node[thick,draw=black,circle,
minimum size=5cm,
decorate,
decoration={random steps,segment length=1.5pt,amplitude=0.2pt}] (outedge) at (0,0) {};
% main direction nodes
\begin{scope}[label distance=0.5cm]
% North
\node[thick,draw=black,circle,
minimum size=0.3cm,
label=above:\Large{$\mathcal{N}$}] (N) at (0,3.5) {};
\node[circle,draw=black,fill=black,
minimum size=1.5mm] (n) at (0,3.5) {};
% East
\node[thick,draw=black,circle,
minimum size=0.3cm,
label=right:\Large{$\mathcal{E}$}] (E) at (3.5,0) {};
\node[circle,draw=black,fill=black,
minimum size=1.5mm] (e) at (3.5,0) {};
% South
\node[thick,draw=black,circle,
minimum size=0.3cm,
label=below:\Large{$\mathcal{S}$}] (S) at (0,-3.5) {};
\node[circle,draw=black,fill=black,
minimum size=1.5mm] (s) at (0,-3.5) {};
% West
\node[thick,draw=black,circle,
minimum size=0.3cm,
label=left:\Large{$\mathcal{W}$}] (W) at (-3.5,0) {};
\node[circle,draw=black,fill=black,
minimum size=1.5mm] (w) at (-3.5,0) {};
\end{scope}
% mainlines
\draw[thick,
decorate,
decoration={random steps,segment length=3pt,amplitude=0.1pt}]
(centre) -- (N);
\draw[thick,
decorate,
decoration={random steps,segment length=3pt,amplitude=0.1pt}]
(centre) -- (E);
\draw[thick,
decorate,
decoration={random steps,segment length=3pt,amplitude=0.1pt}]
(centre) -- (S);
\draw[thick,
decorate,
decoration={random steps,segment length=3pt,amplitude=0.1pt}]
(centre) -- (W);
% Main points
\filldraw[draw=red,fill=blue] (-0.35cm,0.35cm) -- (N.north) -- (centre.center) -- cycle; % why u no fill?!!
\end{tikzpicture}
\end{document}