# How to create polygon procedural shape?

I want to create alternative to Agama Materials polygon procedural shape in Blender.

It should have any number of side and explode, and it should be able to explode. I tried a lot of technics, radial shape works, but I can't straighten sides of a figure, unfortunately. Thank you for your attention.

• @MartyFouts I belive you didn't understand, I want it as a procedural texture Oct 15 '21 at 16:59

The maths in this answer is a combination of this answer, and this remark. Those examples demonstrate: a) how to make a polygon-shader, and b) how to make a stripe of constant thickness about a vector.

Here, the angle theta for any given shading point is given by a radial gradient, Ping-Ponged to divide it into spokes.

In this case, a spoke-stripe is made using sin(theta)*radius > a constant: half the stripe's thickness. The remaining bit of trig. in the tree increases the size of the polygon by just the right amount, so, when it's masked by stripes of a given thickness, the segments remain the same size, and it appears to explode. That section is coloured green.

The input parameters are:

• Sides, the number of sides of the polygon
• Size, the distance from the centre to a flat side of the polygon
• Explode, the half-thickness of the stripe mask across the polygon: half the radial gap between the segments.

You could add some nodes to tweak the inputs before grouping the tree, to suit your purposes. Rotation could be done in the Mapping node. I'm not sure what your reference's 'Gradient' means.. if you need that, call back.

• You are amazing, Thank you a lot Oct 16 '21 at 17:37