I’m looking to create an API to control my axidraw through WebUSB (currently only working on Chrome) with p5. The communication works by sending simple serial messages. My idea is to have the usual functions like line
, ellipse
etc. behave normally, but in a certain state draw with the drawing machine instead of to the canvas.
I know this might be out of the scope of the general codebase, but I was wondering what would be a good entry point into the API as I would like to publish it as an optional addon/extensions to p5. I have thought of creating function decorators to the existing library with a global switch to toggle using the Axidraw.
I think ideally it would function something like a custom renderer class, that doesn’t actually render anything on the screen. But again, I don’t know how that would work, since I don’t know if that would work with the paradigm since drawing with the physical machine would mean taking a significant time for each action.
Do you have any ideas on the subject?