I think picovector (at least as implemented on Presto in the current presto-v2.0.0-micropython.uf2) has a limit of sixteen primitives per shape.
This came to light because I was trying to draw a bar chart with one bar per hour of a day, and I can only get 16 bars.
minimal demonstration:
import presto
from picovector import PicoVector, Polygon
# initialise screen
presto = presto.Presto(ambient_light=False, full_res=True)
display = presto.display
vector = PicoVector(display)
# initialise some colours
wht_pen = display.create_pen(255,255,255) # white
blu_pen = display.create_pen(0,0,200) # blue
# clear the screen
display.set_pen(wht_pen)
display.clear()
# draw graph blocks
shape = Polygon()
for col in range(24):
shape.rectangle(col*20+1,300,19,40,2)
display.set_pen(blu_pen)
vector.draw(shape)
presto.update()
this only draws the last 16 blocks, and some fine lines (looks like it’s drawn the anti-aliased pixels but not the full solid pixels). If the range line is anything no larger than 16 (e.g. for col in range(15):) it works perfectly fine, for any value over 16, only the last 16 blocks are drawn.
I’ve found similar with lines - a loop that tries to draw 24 lines (like, the tick marks on the axis of my day graph), I get only the last 16.
Has anyone come across this, is it a general limit?
My workaround is to draw the graph in multiple shapes:
shape = Polygon()
for col in range(12):
shape.rectangle(col*20+1,300,19,40,2)
display.set_pen(blu_pen)
vector.draw(shape)
shape = Polygon()
for col in range(12,24):
shape.rectangle(col*20+1,300,19,40,2)
display.set_pen(blu_pen)
vector.draw(shape)
(the rest of the script being the same).
(Incidentally, really liking Presto, though I wish it had at least one exposed GPIO - I could put an interface expander on the QW/ST socket but I’d want an interrupt pin. I think GPIO0 is unused to a test pad, and I might use that, but soldering to it is a faff (my hand-eye coordination is not what it was).)