g.drawPoly/fillPoly have a limit of 64 nodes

Posted on
  • 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

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

g.drawPoly/fillPoly have a limit of 64 nodes

Posted by Avatar for Andreas_Rozek @Andreas_Rozek

Actions