Filled Arc?

Monkey Forums/Monkey Programming/Filled Arc?

zoqfotpik(Posted 2012) [#1]
Does monkey have a facility to render filled pie wedges and arcs? Should I just write my own or is there a primitive for it?


DruggedBunny(Posted 2012) [#2]
There are no built-in primitives for this so it will be a roll-your-own job.

I wondered how you'd do this, so consulted the Blitz Code Archives... I found this code by ImaginaryHuman to manually draw fast filled circles, so I'd probably base it off that, limiting the drawing to within the two angles of the wedge in question, or within a triangle that encloses the arc.

The same author also provides a non-filled version that could probably used in similar fashion for the arcs, assuming you want to avoid any gaps you might get from a Sin/Cos approach.


Jesse(Posted 2012) [#3]
this might help:
http://www.monkeycoder.co.nz/Community/posts.php?topic=2462


NoOdle(Posted 2012) [#4]
I hacked together some functions to draw some additional shapes for a rainy day. Jesse provided the link above, hope they prove useful. Any errors please let me know.. I've not really used them yet


zoqfotpik(Posted 2012) [#5]
I will probably write my own and just use sin/cos extended points along N radii fed into the polygon draw routine and drawn with thicker radial lines to avoid gaps. I try to roll my own whenever possible, for simple things like this.