From fea247f261961f4276d0db0fb6315fe77f6db0ad Mon Sep 17 00:00:00 2001 From: PavelMikus Date: Fri, 28 Jan 2022 14:17:09 +0100 Subject: [PATCH] Fixed bug - the rays had opposite directions, so all of them flown away from the object; also fixed compilation bug - missing import of timer.h --- src/libslic3r/GCode/SeamPlacerNG.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libslic3r/GCode/SeamPlacerNG.cpp b/src/libslic3r/GCode/SeamPlacerNG.cpp index 098de2574..0b179797f 100644 --- a/src/libslic3r/GCode/SeamPlacerNG.cpp +++ b/src/libslic3r/GCode/SeamPlacerNG.cpp @@ -130,7 +130,7 @@ void raycast_visibility( for (size_t index = r.begin(); index < r.end(); ++index) { Vec3d global_ray_dir = sample_sphere_uniform( global_dir_random_samples[index]); - Vec3d ray_origin = (vision_sphere_center + + Vec3d ray_origin = (vision_sphere_center - global_ray_dir * vision_sphere_raidus); Vec3d local_dir = sample_power_cosine_hemisphere( local_dir_random_samples[index], 1.0); @@ -259,7 +259,7 @@ void SeamPlacer::init(const Print &print) BOOST_LOG_TRIVIAL(debug) << "PM: gather and build KD tree with seam candidates: end"; - raycast_visibility(1000000, raycasting_tree, triangle_set, + raycast_visibility(100000, raycasting_tree, triangle_set, perimeter_points_tree, seam_candidates); } }