mirror of
https://github.com/Doodle3D/Doodle3D-Slicer.git
synced 2024-11-26 07:24:57 +01:00
17 lines
439 B
JavaScript
17 lines
439 B
JavaScript
import THREE from 'three.js';
|
|
import * as SLICER from 'src/index';
|
|
|
|
const settings = new SLICER.Settings({
|
|
...SLICER.printerSettings['ultimaker2go'],
|
|
...SLICER.userSettings
|
|
});
|
|
|
|
const geometry = new THREE.TorusGeometry(20, 10, 30, 30);
|
|
|
|
const slicer = new SLICER.Slicer();
|
|
|
|
slicer.setGeometry(geometry);
|
|
slicer.slice(settings).then(gcode => {
|
|
document.getElementById('gcode').innerHTML = gcode.replace(/(?:\r\n|\r|\n)/g, '<br />');
|
|
});
|