## Kiri:Moto Frame Message API

code
output
frame

## Frame Message API

- load(url) - where URL points to an STL
- clear() - clear workspace
- parse(data,type) - data is string or binary. type is "stl" or "svg"
- setFrame(id_obj, target_origin) - id or object of iframe with Kiri:Moto loaded
- setMode(mode) - FDM, CAM, LASER, SLA
- setDevice(options) - change default object parameters
- setProcess(options) - change default process parameters
- slice() - async slice loaded object. event upon completion
- prepare() - async path routing of slice data. event upon completion
- export(callback) - async gcode generation. opens export dialog or event callback with gcode
- onmessage = fn - function to receive all messages
- onevent(event, fn) - function to receive named messages
- emit(event, data) - send named event with data
- alert(msg, time) - show alert message with optional time in seconds
- progress(pct, msg) - set progress bar (0-1) with optional message