Filled Arc?
Monkey Forums/Monkey Programming/Filled Arc?
| ||
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? |
| ||
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. |
| ||
this might help: http://www.monkeycoder.co.nz/Community/posts.php?topic=2462 |
| ||
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 |
| ||
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. |