
pgf/tikz: Estou tentando criar um hexágono com altura fixa. Usando o retângulo chanfrado. Posso transformar o retângulo em um hexágono, mas quando tento aplicar a opção de altura mínima parece interferir na configuração do xsep.
Alguém sabe uma maneira de contornar isso?
Esta é a macro que estou tentando fazer.
\documentclass[a4paper, 12pt]{report}
\usepackage{tikz}
\usetikzlibrary{arrows}
\usetikzlibrary{shapes.geometric}
\usetikzlibrary{shapes.symbols}
\usetikzlibrary{shapes.multipart}
\usetikzlibrary{shapes.misc}
\usetikzlibrary{shapes.arrows}
\usetikzlibrary{positioning}
\usetikzlibrary{matrix}
\newcommand{\Task}[2]{|[chamfered rectangle, chamfered rectangle angle=50, thick, draw, text centered, text width=1.5cm, minimum width=3cm, minimum height=1.3cm, chamfered rectangle xsep=5cm, scale=0.5](#1)|{#2}}
\begin{document}
\begin{figure}
\centering
\begin{tikzpicture}
\matrix (grlplay) [matrix of nodes, row sep = 0mm] %grlFlow-row-column
{
&\Task{label}{name} & \\
};
\end{tikzpicture}
\end{figure}
\end{document}
Obrigado.
Responder1
Se eu entendi o que você gostaria de ter como forma final, então é mais fácil obter isso por signal
forma do que com chamfered rectangle
. Ele fornece hexágono independente da altura de texto desejada:
Para a imagem acima eu expando sua matriz e mudo a forma de definir suas células:
\documentclass[a4paper, 12pt]{report}
\usepackage{tikz}
\usetikzlibrary{arrows,matrix,shapes.symbols}
% for show only figure
\usepackage[active,floats,tightpage]{preview}
\setlength\PreviewBorder{1em}
\begin{document}
\begin{figure}[h]
\centering
\begin{tikzpicture}[
task/.style = {signal, draw, thick,
signal to=west and east,
text width=22mm, minimum height=9mm, align=center}
]
\matrix (grlplay) [matrix of nodes, row sep = 1mm] %grlFlow-row-column
{
left & \node[task] {name}; & right \\
left & \node[task] {name}; & right \\
};
%\draw[red,->] (grlplay-1-1) -- (grlplay-1-3);
\end{tikzpicture}
\end{figure}
\end{document}