Support Forum

What is NodeSize in the context of Hexagon?

Hello everyone!

I have been trying to calculate the size of side of the hexagon from nodeSize field. While UI does give you an option to specify width, or diameter, but in code only NodeSize is exposed. What formula is used to calculate it for the hexagon?

Thank you!

Found answer to my own question.

For anyone facing same issue here is the code:

if (mode == InspectorGridHexagonNodeSize.Diameter) value *= 1.5f/(float)System.Math.Sqrt(2.0f);
if (mode == InspectorGridHexagonNodeSize.Width) value *= (float)System.Math.Sqrt(3.0f/2.0f);
1 Like

I see you already found the answer. For anyone else, if you are using the beta version there are these two handy methods (in the GridGraph class):