File tree 1 file changed +4
-5
lines changed
1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change 130
130
var type ;
131
131
var printTimeAdd = 0 ;
132
132
// var moveTime=0;
133
+ // Clean up data from previous model
134
+ speedsByLayer = { extrude : { } , retract : { } , move : { } } ;
135
+ volSpeedsByLayer = { } ;
136
+ extrusionSpeedsByLayer = { } ;
133
137
134
138
for ( i = 0 ; i < model . length ; i ++ ) {
135
139
cmds = model [ i ] ;
241
245
extrusionSpeedsByLayer [ cmds [ j ] . prevZ ] = [ ] ;
242
246
}
243
247
if ( extrusionSpeedsByLayer [ cmds [ j ] . prevZ ] . indexOf ( extrusionSpeed ) === - 1 ) {
244
- // Array elements will NOT necessarily be set to undefined when
245
- // assigning beyond the current array length, so do it explicitly.
246
- for ( var k = extrusionSpeedsByLayer [ cmds [ j ] . prevZ ] . length ; k < volIndex ; k ++ ) {
247
- extrusionSpeedsByLayer [ cmds [ j ] . prevZ ] . push ( undefined ) ;
248
- }
249
248
extrusionSpeedsByLayer [ cmds [ j ] . prevZ ] [ volIndex ] = extrusionSpeed ;
250
249
}
251
250
}
You can’t perform that action at this time.
0 commit comments