Axidraw p5 clean webusb interface

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?

@TiborUdvari : did you start some code on this subject ? I am planning on working with an axidraw soon I intend to do it with p5js.

I was thinking about using a serial communication with : https://github.com/p5-serial/p5.serialcontrol
and https://github.com/p5-serial/p5.serialport

Anyhow if you have started something I would love to see how it works, and probably try to contribute.

Cheers