Fix of its_collect_mesh_projection_points_above()

Fix of perl integration tests after introduction of not using the mesh
below the print bed.
This commit is contained in:
Vojtech Bubnik 2021-05-20 13:58:27 +02:00
parent 7ad482f63c
commit ef9004cee4
2 changed files with 3 additions and 3 deletions

View File

@ -192,12 +192,12 @@ sub init_print {
if (defined $params{duplicate} && $params{duplicate} > 1) { if (defined $params{duplicate} && $params{duplicate} > 1) {
$model->duplicate($params{duplicate} // 1, $config->min_object_distance); $model->duplicate($params{duplicate} // 1, $config->min_object_distance);
} }
$model->arrange_objects($config->min_object_distance);
$model->center_instances_around_point($params{print_center} ? Slic3r::Pointf->new(@{$params{print_center}}) : Slic3r::Pointf->new(100,100));
foreach my $model_object (@{$model->objects}) { foreach my $model_object (@{$model->objects}) {
$model_object->ensure_on_bed; $model_object->ensure_on_bed;
$print->auto_assign_extruders($model_object); $print->auto_assign_extruders($model_object);
} }
$model->arrange_objects($config->min_object_distance);
$model->center_instances_around_point($params{print_center} ? Slic3r::Pointf->new(@{$params{print_center}}) : Slic3r::Pointf->new(100,100));
$print->apply($model, $config); $print->apply($model, $config);
$print->validate; $print->validate;

View File

@ -914,7 +914,7 @@ void its_collect_mesh_projection_points_above(const indexed_triangle_set &its, c
float t = (z - p1.z()) / (p2.z() - p1.z()); float t = (z - p1.z()) / (p2.z() - p1.z());
all_pts.emplace_back(scaled<coord_t>(p1.x() + (p2.x() - p1.x()) * t), scaled<coord_t>(p1.y() + (p2.y() - p1.y()) * t)); all_pts.emplace_back(scaled<coord_t>(p1.x() + (p2.x() - p1.x()) * t), scaled<coord_t>(p1.y() + (p2.y() - p1.y()) * t));
} }
if (p2.z() > z) if (p2.z() >= z)
all_pts.emplace_back(scaled<coord_t>(p2.x()), scaled<coord_t>(p2.y())); all_pts.emplace_back(scaled<coord_t>(p2.x()), scaled<coord_t>(p2.y()));
iprev = iedge; iprev = iedge;
} }