[Dot] Triangle dimensions incorrect
Ported Issue from Mantis Original ID: 2141 Reported By: ianamason
SEVERITY: IMPORTANT Submitted: 2011-09-28 17:21:46
DESCRIPTION
I'm reporting the situation just for triangles, but on the forum thread:
http://www.graphviz.org/content/dots-triangles
erg says:
"This is a bug in the shape-handling code that occurs when the [shape is] bilaterally symmetric both horizontally and vertically. In particular, it occurs if the node has an odd number of sides."
STEPS TO REPRODUCE
In particular when dot lays out a triangle
input.dot
digraph temp {
graph [rankdir=TB];
node [label="\N"];
node1 [label=" ", shape=triangle, style=filled, fillcolor="0.75 0.8 1.0", color="0.0 0.0 0.0"];
}
using the command
dot -Tdot input.dot -o output.dot
it claims the dimensions are:
width="0.75", height="0.68889"
which is a width/height ratio of roughly 1.09.
output.dot
digraph temp {
graph [rankdir=TB];
node [label="\N"];
graph [bb="0,0,54,50"];
node1 [label=" ", shape=triangle, style=filled, fillcolor="0.75 0.8 1.0", color="0.0 0.0 0.0", pos="27,25", width="0.75", height="0.68889"];
}
When we ask dot to draw this triangle
dot -Tpng output.dot -o output.png
We see a triangle (output.png) that is 74 x 51, i.e. has a width to height ratio of roughly 1.45.
How are we to interpret dot's width and height measurements so that when we draw by dot's numbers, our shapes coincide? This is particularly crucial when we draw edges from triangles.