mirror of
https://github.com/Doodle3D/Doodle3D-Slicer.git
synced 2024-12-23 11:33:49 +01:00
3ae51e056d
cloned outline so pointers get lost |
||
---|---|---|
example | ||
settings | ||
src | ||
.gitignore | ||
config.js | ||
package.json | ||
README.md |
Doodle3D-Slicer
JavaScript gcode slicer, Intended to use with the Doodle3D WiFi-Box
Usage
import THREE from 'three.js';
import PRINTER_SETTINGS from 'settings/printer_settings.json!';
import USER_SETTINGS from 'settings/user_settings.json!';
import * as SLICER from 'Doodle3D/Doodle3d-Slicer';
var settings = new SLICER.Settings();
settings.updateConfig(PRINTER_SETTINGS['ultimaker2go']);
settings.updateConfig(USER_SETTINGS);
var geometry = new THREE.TorusGeometry(20, 10, 30, 30);
var slicer = new SLICER.Slicer();
slicer.setGeometry(geometry);
slicer.onfinish = function (gCode) {
document.write(gCode.replace(/(?:\r\n|\r|\n)/g, '<br />'));
};
slicer.slice(settings);