Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

layer height broken in 'Refactoring: initialize all layers at once...' #637

Closed
markspace opened this Issue Aug 26, 2012 · 1 comment

Comments

Projects
None yet
2 participants

In git version 0827002 - 'Refactoring: initialize all layers at once ...'

When the layers table is built in Print/Object.pm, the config is still using defaults when an object is loaded onto the platter, so the layer size is 0.4 - this gives very squashed prints if layer size is not 0.4.

I put some debug in _build_slice_z in Layer.pm:

# Z used for slicing
sub _build_slice_z {
    my $self = shift;

    if ($self->id == 0) {
        return $Slic3r::Config->get_value('first_layer_height') / 2 / &Slic3r::SCALING_FACTOR;
    }
        Slic3r::debugf " %d layer z = %d flh= %f lh= %f \n", $self->id, ($Slic3r::Config->get_value('first_layer_height') + (($self->id-1) * $Slic3r::Config->layer_height) + ($Slic3r::Config->layer_height/2)) / &Slic3r::SCALING_FACTOR, $Slic3r::Config->get_value('first_layer_height'), $Slic3r::Config->layer_height;
    return ($Slic3r::Config->get_value('first_layer_height') + (($self->id-1) * $Slic3r::Config->layer_height) + ($Slic3r::Config->layer_height/2))
        / &Slic3r::SCALING_FACTOR;  #/
}

Which gave the following output when vertex.stl was loaded and layer height set to 0.3.

$ ./slic3r.pl --debug
wxWidgets version wxWidgets 2.8.12, Wx version 0.9903
Data directory: /home/markd/.Slic3r
Default flow width = 0.525 (spacing = 0.522317477042468)
Building to Z=12900000
 1 layer z = 600000 flh= 0.400000 lh= 0.400000 
 2 layer z = 1000000 flh= 0.400000 lh= 0.400000 
 3 layer z = 1400000 flh= 0.400000 lh= 0.400000 
 4 layer z = 1800000 flh= 0.400000 lh= 0.400000 
 5 layer z = 2200000 flh= 0.400000 lh= 0.400000 
 6 layer z = 2600000 flh= 0.400000 lh= 0.400000 
 7 layer z = 3000000 flh= 0.400000 lh= 0.400000 
 8 layer z = 3400000 flh= 0.400000 lh= 0.400000 
 9 layer z = 3800000 flh= 0.400000 lh= 0.400000 
 10 layer z = 4200000 flh= 0.400000 lh= 0.400000 
 11 layer z = 4600000 flh= 0.400000 lh= 0.400000 
 12 layer z = 5000000 flh= 0.400000 lh= 0.400000 
 13 layer z = 5400000 flh= 0.400000 lh= 0.400000 
 14 layer z = 5800000 flh= 0.400000 lh= 0.400000 
 15 layer z = 6200000 flh= 0.400000 lh= 0.400000 
 16 layer z = 6600000 flh= 0.400000 lh= 0.400000 
 17 layer z = 7000000 flh= 0.400000 lh= 0.400000 
 18 layer z = 7400000 flh= 0.400000 lh= 0.400000 
 19 layer z = 7800000 flh= 0.400000 lh= 0.400000 
 20 layer z = 8200000 flh= 0.400000 lh= 0.400000 
 21 layer z = 8600000 flh= 0.400000 lh= 0.400000 
 22 layer z = 9000000 flh= 0.400000 lh= 0.400000 
 23 layer z = 9400000 flh= 0.400000 lh= 0.400000 
 24 layer z = 9800000 flh= 0.400000 lh= 0.400000 
 25 layer z = 10200000 flh= 0.400000 lh= 0.400000 
 26 layer z = 10600000 flh= 0.400000 lh= 0.400000 
 27 layer z = 11000000 flh= 0.400000 lh= 0.400000 
 28 layer z = 11400000 flh= 0.400000 lh= 0.400000 
 29 layer z = 11800000 flh= 0.400000 lh= 0.400000 
 30 layer z = 12200000 flh= 0.400000 lh= 0.400000 
 31 layer z = 12600000 flh= 0.400000 lh= 0.400000 
 32 layer z = 13000000 flh= 0.400000 lh= 0.400000 

It should have had 43 layers

Either the config has to be set up earlier, or the layers done later

alexrj added a commit that referenced this issue Aug 26, 2012

Revert "Refactoring: initialize all layers at once and avoid duplicat…
…ion of slicing height math". #637

This reverts commit 0827002.
Owner

alexrj commented Aug 26, 2012

You're right, I reverted the commit for now. Thank you!

alexrj added a commit that referenced this issue Jan 1, 2013

@alexrj alexrj closed this Jan 1, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment