I currently have the Maths expressions addon installed in blender.
I know it has a hexagon preset already, but it comes up with this:

1) How do I fix this?
2) How do I make a hexagon?
I currently have the Maths expressions addon installed in blender.
I know it has a hexagon preset already, but it comes up with this:

1) How do I fix this?
2) How do I make a hexagon?
This tree will produce distance-function along the 'spokes' perpendicular to the edges of an Ngon centered on the 0 of a given UV space.
It works by splitting the radial angle into (sides) angular regions, each region with shading-point values from (-pi/sides) to (pi/sides), and multiplying the cosine of those values with the distance from the texture space origin. If the result is put through a threshold (the color ramp), it produces a polygon with sides sides.
For the sake of illustration, I've plugged the Pass Index of the plane objects into the sides input. That's where you would enter 6 for a hexagon.