How to produce regular polygon?


I expected this graph to produce a regular haxagon

digraph {
    "hexa"  [shape=hexagon  label="" regular=true  pos="0,0!" ];
     circle [shape=circle   label=""   pos="0,0!"];


from regular attribute If true, force polygon to be regular, i.e., the vertices of the polygon will lie on a circle whose center is the center of the node.

But it’s not the case.
Should I return to school or what ? :slight_smile:


Seems to be a bug - clearly not symmetric.
I suggest opening an Issue: Issues · graphviz / graphviz · GitLab

I have to calculate myself the height of the hexagon :

digraph {
hexa [shape=“polygon” sides=6 label="" pos=“0,0!” width=1 height=0.86];
circle [shape=“circle” label="" regular=true pos=“0,0!” width=1 ];
center [shape=point pos=“0,0!” ]
with height = (Math.sqrt(3)/2) * width.

It produce this

and If I add the regular attribute set to true I encounter the problem

I thought that If the regular attribute was set to true the computation will be done automatically but it’s not the case.

I will open the issue.