Doodle3D-Slicer/README.md

25 lines
728 B
Markdown
Raw Normal View History

2015-07-26 15:34:57 +02:00
# Doodle3D-Slicer
JavaScript gcode slicer, Intended to use with the Doodle3D WiFi-Box
# Usage
```javascript
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';
2015-07-26 15:37:10 +02:00
var settings = new SLICER.Settings();
2015-07-26 15:37:44 +02:00
settings.updateConfig(PRINTER_SETTINGS['ultimaker2go']);
2015-07-26 15:37:10 +02:00
settings.updateConfig(USER_SETTINGS);
2015-07-26 15:34:57 +02:00
2015-07-26 15:37:10 +02:00
var geometry = new THREE.TorusGeometry(20, 10, 30, 30);
2015-07-26 15:34:57 +02:00
2015-07-26 15:37:10 +02:00
var slicer = new SLICER.Slicer();
2015-07-26 15:34:57 +02:00
2015-07-26 15:37:10 +02:00
slicer.setGeometry(geometry);
slicer.onfinish = function (gCode) {
document.getElementById('gcode').innerHTML = gCode.replace(/(?:\r\n|\r|\n)/g, '<br />');
};
slicer.slice(settings);
2015-07-26 15:34:57 +02:00
```