
Eu desenhei essa foto, mas não assim
\documentclass[10pt]{article}
\usepackage[utf8]{inputenc}
\usepackage{pgf,tikz}
\usepackage{mathrsfs}
\usepackage{xepersian}
\settextfont{Yas}
\usetikzlibrary{arrows}
\pagestyle{empty}
\begin{document}
%\definecolor{qqqqff}{rgb}{0.,0.,1.}
%\definecolor{zzttqq}{rgb}{0.6,0.2,0.}
% \definecolor{myaqua}{rgb}{1,1,1}
\definecolor{qqqqff}{HTML}{21bdbe}
\definecolor{zzttqq}{HTML}{19bfe0}
\begin{tikzpicture}[line cap=round,line join=round,>=triangle 45,x=1.0cm,y=1.0cm]
\clip(3.2557266494472623,-1.6520962393119207) rectangle (12.29163742054479,5.813639873201507);
\fill[color=zzttqq,fill=zzttqq,fill opacity=0.10000000149011612] (3.6,-1.2) -- (11.6,-1.2) -- (8.,5.8) -- cycle;
\fill[color=zzttqq,fill=zzttqq,fill opacity=0.10000000149011612] (7.2,3.6) -- (7.2,4.4) -- (11.6,4.4) -- (11.6,3.6) -- cycle;
\fill[color=zzttqq,fill=zzttqq,fill opacity=0.10000000149011612] (7.,3.) -- (7.,2.2) -- (11.6,2.2) -- (11.584597952190476,2.9736025163350672) -- cycle;
\fill[color=zzttqq,fill=zzttqq,fill opacity=0.10000000149011612] (11.6,1.6) -- (11.6,0.8) -- (6.8,0.8) -- (6.8,1.6) -- cycle;
\fill[color=zzttqq,fill=zzttqq,fill opacity=0.10000000149011612] (11.6,0.2) -- (11.6,-0.6) -- (6.6,-0.6) -- (6.6,0.2) -- cycle;
\fill[color=zzttqq,fill=zzttqq,fill opacity=0.10000000149011612] (7.972370141039504,5.756043406199211) -- (7.832933908904861,-1.2) -- (11.6,-1.2) -- cycle;
\draw [color=zzttqq] (3.6,-1.2)-- (11.6,-1.2);
\draw [color=zzttqq] (11.6,-1.2)-- (8.,5.8);
\draw [color=zzttqq] (8.,5.8)-- (3.6,-1.2);
\draw [color=zzttqq,line width=3pt] (7.2,3.6)-- (7.2,4.4);
\draw [color=zzttqq,line width=3pt] (7.2,4.4)-- (11.6,4.4);
\draw [color=zzttqq,line width=3pt] (11.6,4.4)-- (11.6,3.6);
\draw [color=zzttqq,line width=3pt] (11.6,3.6)-- (7.2,3.6);
\draw [color=zzttqq,line width=3pt] (7.,3.)-- (7.,2.2);
\draw [color=zzttqq,line width=3pt] (7.,2.2)-- (11.6,2.2);
\draw [color=zzttqq,line width=3pt] (11.6,2.2)-- (11.584597952190476,2.9736025163350672);
\draw [color=zzttqq,line width=3pt] (11.584597952190476,2.9736025163350672)-- (7.,3.);
\draw [color=zzttqq,line width=3pt] (11.6,1.6)-- (11.6,0.8);
\draw [color=zzttqq,line width=3pt] (11.6,0.8)-- (6.8,0.8);
\draw [color=zzttqq,line width=3pt] (6.8,0.8)-- (6.8,1.6);
\draw [color=zzttqq,line width=3pt] (6.8,1.6)-- (11.6,1.6);
\draw [color=zzttqq,line width=3pt] (11.6,0.2)-- (11.6,-0.6);
\draw [color=zzttqq,line width=3pt] (11.6,-0.6)-- (6.6,-0.6);
\draw [color=zzttqq,line width=3pt] (6.6,-0.6)-- (6.6,0.2);
\draw [color=zzttqq,line width=3pt] (6.6,0.2)-- (11.6,0.2);
\draw(9.566051220738322,4.243465214617333) node[anchor=north west] {hi};
\draw (-0.003126415538731179,0.18471185186201763) node[anchor=north west] {test};
\draw (9.343856693580186,2.8658591462368794) node[anchor=north west] {test};
\draw (9.180914040330887,1.354936361561543) node[anchor=north west] {test};
\draw (8.766150922969032,-0.12636048615937515) node[anchor=north west] {test};
\end{tikzpicture}
\end{document}
Responder1
Acho que a questão é como desenhar isso de forma mais eficiente ou melhor. A imagem é na verdade apenas dois triângulos com algum texto espalhado no topo. Para facilitar a personalização, defini coordenadas (A)
e (B)
para (C)
os vértices do triângulo, começando de cima e lendo no sentido horário, e depois desenhei tudo em relação a essas coordenadas.
O texto nas caixas dos triângulos aparece como uma lista separada por vírgulas dentro do \foreach
loop. Aqui está a saída:
... e aqui está o código:
\documentclass[10pt]{article}
\usepackage{tikz}
\usetikzlibrary{calc}
\definecolor{leftcolour}{HTML}{21bdbe}
\definecolor{rightcolour}{HTML}{19bfe0}
\begin{document}
\begin{tikzpicture}[
nodetext/.style={draw=leftcolour, very thick, rectangle, anchor=south west,
fill=white,minimum height=2em},
lefttriangle/.style={draw=leftcolour,fill=leftcolour},
righttriangle/.style={draw=rightcolour,fill=rightcolour!50}
]
\coordinate (A) at (0,8.5); % top - formerly (8,5.8);
\coordinate (B) at (6,0); % bottom right - formerly(11.6, -1.2);
\coordinate (C) at (-6,0); % bottom left - (3.6,-1.2);
\draw[lefttriangle] (A) -- ($ (C)!0.5!(B) $) --(C) -- cycle;
\draw[righttriangle] (A) -- ($ (C)!0.5!(B) $) --(B) -- cycle;
\foreach \word [count=\c, evaluate=c as \y using \c/5,]
in {Test 1, Test 2, Test 3, Test 4} {
\node[nodetext, minimum width=\c*26mm] at ($ (A)!\y!(C)+(-0.3,-0.42) $){\word};
}
\end{tikzpicture}
\end{document}
Os dois fatores de correção a seguir podem precisar ser ajustados:
- as caixas de texto têm um deslocamento de
(-0.3,-0.42)
, já que a raiz quadrada de 2 vezes 0,3 é cerca de 0,42 - a largura mínima do número da caixa de texto
\c
é definida como\c*26mm
Finalmente, o número de caixas de texto pode ser alterado substituindo \c/5
na linha
\foreach \word [count=\c, evaluate=c as \y using \c/5,]
para \c/6
etc. Claro, para fazer isso corretamente, você provavelmente precisará ajustar as coordenadas (A)
e . É claro que, em princípio, isto também poderia ser automatizado.(B)
(C)
EDITAR
Aqui está a melhoria de centralização do sgmoye a partir dos comentários. Alterei a largura "offset" do nó para \c*25mm
:
e o MWE modificado:
\documentclass[10pt]{article}
\usepackage{tikz}
\usetikzlibrary{calc}
\definecolor{leftcolour}{HTML}{21bdbe}
\definecolor{rightcolour}{HTML}{19bfe0}
\begin{document}
\begin{tikzpicture}[
nodetext/.style={draw=leftcolour, very thick, rectangle, anchor=south,
fill=white,minimum height=2em},
lefttriangle/.style={draw=leftcolour,fill=leftcolour},
righttriangle/.style={draw=rightcolour,fill=rightcolour!50}
]
\coordinate (A) at (0,8.5); % top - formerly (8,5.8);
\coordinate (B) at (6,0); % bottom right - formerly(11.6, -1.2);
\coordinate (C) at (-6,0); % bottom left - (3.6,-1.2);
\draw[lefttriangle] (A) -- ($ (C)!0.5!(B) $) --(C) -- cycle;
\draw[righttriangle] (A) -- ($ (C)!0.5!(B) $) --(B) -- cycle;
\foreach \word [count=\c] in {Test 1, Test 2, Test 3, Test 4} {
\node[nodetext, minimum width=\c*25mm] at (0, 8.5-1.85*\c){\word};
}
\end{tikzpicture}
\end{document}