Polygon height and orientation issues


Is there a bug with the height of the triangle? Why the height of the triangle is not 2 as specified?

digraph D {
node[pos=“0,0!” label="" width=3 height=2 ]

rectangle1 [shape=rect color=“blue” fillcolor=“grey” style=filled ]
rectangle2 [shape=polygon sides=4 color=“red” orientation=90 ]
// why the triangle does not have 2 as height ??
triangle1 [shape=polygon sides=3 height=2 orientation=0 color=“cyan” ]
//triangle2 [shape=polygon sides=3 height=2 orientation=45 color=“purple” ]
triangle3 [shape=polygon sides=3 height=2 orientation=90 color=“yellow” ]
//triangle4 [shape=polygon sides=3 height=2 orientation=180 color=“orange” ]
//triangle5 [shape=polygon sides=3 height=2 orientation=270 color=“red” ]
center[shape=point width=0.05 label="" ]


web editor

Also, I don’t understand the orientation attribute behavior. On the orientation attribute page it’s specified : When used on nodes: Angle, in degrees, to rotate polygon node shapes
so why this :

digraph {
  layout=neato       # Render in a circular layout
  node [shape=house] # Make all nodes have 'house' shape

    0 [orientation=0]
   45 [orientation=45]
   90 [orientation=90]
  135 [orientation=135]
  180 [orientation=180]
  225 [orientation=225]
  270 [orientation=270]
  315 [orientation=315]
  0 -> 45 -> 90 -> 135 -> 180 -> 225 -> 270 -> 315 -> 0

gives that?

it seems that other transformations than simple rotations are applied here no?

thank you for your clarifications

Bug(s) or funky features. (I think bugs or really deficient documentation)

I suggest adding this example to the issues list.

That’s a little odd, but why talk about it like it’s a mystery? The code is, er, readable.

I’m just guessing now (I’m pretty sure this code was written by John Ellson and maybe rewritten by Emden Gansner) but it is clear that if a shape fit a given bounding box (which is definitely a constraint in Graphviz dot) and then the shape was rotated, it very well might not fit that bounding box, so, apparently we do something more. Note that it is also important to maintain the interior or inscribed label box as this does not rotate with the shape.

The 0, 90, 180, 270 rotations of “house” look kind of ok. Curious.