download: ==> omino staragon 32 <== a pixel bender filter Just recently, Dale Bradshaw posted a rounded-rect pixel bender plugin. Pretty nifty!
It got me thinking, What about other rounded-corner polygons? It was a bit of a puzzle. As with all Pixel Bender plugins, the question is, What color is this pixel? How does a given pixel know if it’s inside a rounded-corner pentagon or not?
I stuck to regular and stellated polygons to start. One solution goes like so:
- Divide the plane into pie-slices, one for each edge of the polygon.
- For each point, decide which slice you’re in.
- Decide if you’re inside or outside the edge.
- For the rounding… decide which corner you’re nearest
- Are you in the arc of that corner? If so, decide if you’re inside the rounding-radius.
Well, that was a bit of obsessive fun. Here’s a screen shot, including the parameter controls:
And here’s a little demo of it.
download: ==> omino staragon 32 <== a pixel bender filter