mirror of
https://github.com/Doodle3D/Doodle3D-Slicer.git
synced 2024-11-26 07:24:57 +01:00
update read me
This commit is contained in:
parent
bf9d98611a
commit
4c42bd8147
22
README.md
22
README.md
@ -4,21 +4,19 @@ JavaScript gcode slicer, Intended to use with the Doodle3D WiFi-Box
|
|||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
import THREE from 'three.js';
|
import THREE from 'three.js';
|
||||||
import PRINTER_SETTINGS from 'settings/printer_settings.json!';
|
import * as SLICER from 'doodle3d-slicer';
|
||||||
import USER_SETTINGS from 'settings/user_settings.json!';
|
|
||||||
import * as SLICER from 'Doodle3D/Doodle3d-Slicer';
|
|
||||||
|
|
||||||
var settings = new SLICER.Settings();
|
const settings = new SLICER.Settings({
|
||||||
settings.updateConfig(PRINTER_SETTINGS['ultimaker2go']);
|
...SLICER.printerSettings['ultimaker2go'],
|
||||||
settings.updateConfig(USER_SETTINGS);
|
...SLICER.userSettings
|
||||||
|
});
|
||||||
|
|
||||||
var geometry = new THREE.TorusGeometry(20, 10, 30, 30);
|
const geometry = new THREE.TorusGeometry(20, 10, 30, 30);
|
||||||
|
|
||||||
var slicer = new SLICER.Slicer();
|
const slicer = new SLICER.Slicer();
|
||||||
|
|
||||||
slicer.setGeometry(geometry);
|
slicer.setGeometry(geometry);
|
||||||
slicer.onfinish = function (gCode) {
|
slicer.slice(settings, false).then(gcode => {
|
||||||
document.write(gCode.replace(/(?:\r\n|\r|\n)/g, '<br />'));
|
document.getElementById('gcode').innerHTML = gcode.replace(/(?:\r\n|\r|\n)/g, '<br />');
|
||||||
};
|
});
|
||||||
slicer.slice(settings);
|
|
||||||
```
|
```
|
||||||
|
Loading…
Reference in New Issue
Block a user