4

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

1) How do I fix this?

2) How do I make a hexagon?

  • 2
    It looks as though, somewhere, your/the generated expression is trying to access the 4th element of a list of size 3. In the mean time, there's a hand-rolled version here – Robin Betts Mar 01 '20 at 04:57

1 Answers1

7

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.

enter image description here

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.

Robin Betts
  • 76,260
  • 8
  • 77
  • 190