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

This commit is contained in:
PavelMikus 2022-01-28 14:17:09 +01:00
parent fdfe19ef49
commit fea247f261

View File

@ -130,7 +130,7 @@ void raycast_visibility(
for (size_t index = r.begin(); index < r.end(); ++index) { for (size_t index = r.begin(); index < r.end(); ++index) {
Vec3d global_ray_dir = sample_sphere_uniform( Vec3d global_ray_dir = sample_sphere_uniform(
global_dir_random_samples[index]); global_dir_random_samples[index]);
Vec3d ray_origin = (vision_sphere_center + Vec3d ray_origin = (vision_sphere_center -
global_ray_dir * vision_sphere_raidus); global_ray_dir * vision_sphere_raidus);
Vec3d local_dir = sample_power_cosine_hemisphere( Vec3d local_dir = sample_power_cosine_hemisphere(
local_dir_random_samples[index], 1.0); local_dir_random_samples[index], 1.0);
@ -259,7 +259,7 @@ void SeamPlacer::init(const Print &print)
BOOST_LOG_TRIVIAL(debug) BOOST_LOG_TRIVIAL(debug)
<< "PM: gather and build KD tree with seam candidates: end"; << "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); perimeter_points_tree, seam_candidates);
} }
} }