mirror of
https://github.com/Doodle3D/Doodle3D-Slicer.git
synced 2024-11-19 04:27:55 +01:00
wrap progress in object
So data could be extended in the future
This commit is contained in:
parent
83f543b62b
commit
73f0433e00
@ -18,7 +18,7 @@ const geometry = new THREE.TorusGeometry(20, 10, 30, 30);
|
||||
const slicer = new SLICER.Slicer();
|
||||
slicer.setGeometry(geometry);
|
||||
const gcode = await slicer.slice(settings)
|
||||
.progress(({ done, total, action }) => {
|
||||
.progress(({ progress: { done, total, action } }) => {
|
||||
const percentage = `${(done / total * 100).toFixed()}%`
|
||||
console.log(action, percentage);
|
||||
});
|
||||
|
@ -17,7 +17,7 @@ jsonLoader.load('models/airplane.json', async geometry => {
|
||||
|
||||
const slicer = new Slicer().setGeometry(geometry);
|
||||
const gcode = await slicer.slice(settings)
|
||||
.progress(({ done, total, action }) => {
|
||||
.progress(({ progress: { done, total, action } }) => {
|
||||
const percentage = `${(done / total * 100).toFixed()}%`
|
||||
document.write(`<p>${action}, ${percentage}</p>`);
|
||||
});
|
||||
|
@ -6,7 +6,7 @@ const loader = new THREE.JSONLoader();
|
||||
const onProgress = progress => {
|
||||
self.postMessage({
|
||||
message: 'PROGRESS',
|
||||
data: progress
|
||||
data: { progress }
|
||||
});
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user