Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/supermerill/SuperSlicer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorbubnikv <bubnikv@gmail.com>2016-09-05 12:32:58 +0300
committerbubnikv <bubnikv@gmail.com>2016-09-05 12:32:58 +0300
commitca98e2655a4a5875947598f404791ea6c0313609 (patch)
treea7744b6090bbdb3f09b252cb38864465aaee3631 /lib
parentab357c75a5746cf21fe7cb531ff849e9843f775c (diff)
New command line option: --dont-arrange
Don't arrange the objects on the build plate. The model coordinates define the absolute positions on the build plate. The option --print-center will be ignored. Also there is a fix in the command line invocation of --duplicate-grid so it will run, but still there is something broken there and the results are not correct.
Diffstat (limited to 'lib')
-rw-r--r--lib/Slic3r/Print/Simple.pm11
1 files changed, 8 insertions, 3 deletions
diff --git a/lib/Slic3r/Print/Simple.pm b/lib/Slic3r/Print/Simple.pm
index 5618484fa..d84d1cb53 100644
--- a/lib/Slic3r/Print/Simple.pm
+++ b/lib/Slic3r/Print/Simple.pm
@@ -41,6 +41,11 @@ has 'print_center' => (
default => sub { Slic3r::Pointf->new(100,100) },
);
+has 'dont_arrange' => (
+ is => 'rw',
+ default => sub { 0 },
+);
+
has 'output_file' => (
is => 'rw',
);
@@ -52,7 +57,7 @@ sub set_model {
$self->_print->clear_objects;
# make sure all objects have at least one defined instance
- my $need_arrange = $model->add_default_instances;
+ my $need_arrange = $model->add_default_instances && ! $self->dont_arrange;
# apply scaling and rotation supplied from command line if any
foreach my $instance (map @{$_->instances}, @{$model->objects}) {
@@ -61,7 +66,7 @@ sub set_model {
}
if ($self->duplicate_grid->[X] > 1 || $self->duplicate_grid->[Y] > 1) {
- $model->duplicate_objects_grid($self->duplicate_grid, $self->_print->config->duplicate_distance);
+ $model->duplicate_objects_grid($self->duplicate_grid->[X], $self->duplicate_grid->[Y], $self->_print->config->duplicate_distance);
} elsif ($need_arrange) {
$model->duplicate_objects($self->duplicate, $self->_print->config->min_object_distance);
} elsif ($self->duplicate > 1) {
@@ -69,7 +74,7 @@ sub set_model {
$model->duplicate($self->duplicate, $self->_print->config->min_object_distance);
}
$_->translate(0,0,-$_->bounding_box->z_min) for @{$model->objects};
- $model->center_instances_around_point($self->print_center);
+ $model->center_instances_around_point($self->print_center) if (! $self->dont_arrange);
foreach my $model_object (@{$model->objects}) {
$self->_print->auto_assign_extruders($model_object);