it may be useful to mention in the docs of g.drawPoly and g.fillPoly, that there is a hard-coded limit of the number of polygon nodes - namely 64!
It would have saved me some time I spent developing code which turned out to be principally unable to run because of this restriction!
Funnily enough I hit the same limit just last night. In my case, though, what I was doing was a bad idea anyway and I knew it. Still, would have been nice to know in advance.
Thanks - yes, I'll update the docs.
Hit that limit a while ago... if your algorithm can handle a detection and cut-up in multiple 'touching' polys / segments, it is easy to live with the limitation.
I had build a circular multi dial... and on a certain size with close to 360 degrees and expectation of decent smoothness of the 'bent bar'/bow, you run quickly into the limit. Luckily for me, I calculate max 30 points of a segment, note the angel and finish calculating the rest of the segment, draw it, and move on to the next segment until the desired angle is covered. Somewhere in the (difficult to search) forum you can find the code...
...here it is... it is in someone elses conversation New to Bangle.js and Espruino. Need help with graphics... Nov 2020
Don't worry about formatting, just type in the text and we'll take care of making sense of it. We will auto-convert links, and if you put asterisks around words we will make them bold.
For a full reference visit the Markdown syntax.
© Espruino, powered by microcosm.
Report a problem