Based on how I've seen you guys using the GCode viewer, I'd like to make a change to it. Currently it's really a standalone web-application (including file management, UI controls, etc).
But really, it's more useful embedded in other applications. I'd like to refactor the codebase to support this. Ideally the code on
gcode.joewalnes.com, will then just become a demo showing how to use the embedded widget.
Things that the embeddable library should do:
* Provide an API for sending pushing GCode into it.
* Render the model.
* Provide API for zooming, panning, rotating, etc.
* Expose a model of all the GCode paths. Applications can inspect this and manipulate certain paths (e.g. show/hide, change the color, etc).
* Provide a default set of controls to allow the user to zoom/pan/rotate using mouse/keyboard. However these can be disabled if you want to control it through another mechanism.
* Optionally, expose the entire three.js scene, to support manipulation such as adding other objects to the scene, changing textures, etc.
Things that are not in the library, and should be left to the specific web-app:
* Loading/saving of GCode files.
* UI buttons.
* Help, follow me on twitter, etc.
* Size of the control (e.g. full screen, fixed size, etc).
Thoughts? Yay? Nay? Would this provide enough hooks for what you need, without having to fork the internal code?
cheers
-Joe