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
diff options
context:
space:
mode:
authorLukas Matena <lukasmatena@seznam.cz>2020-01-17 18:01:49 +0300
committerLukas Matena <lukasmatena@seznam.cz>2020-01-17 18:02:23 +0300
commitd8f2c8cdab10247fe54421bc3aaf46f668ad81a3 (patch)
treeca96ca64ca0227f06a6d3d583a9afa49cdc0ff27 /src/libslic3r/SLA/Hollowing.cpp
parent49678fe418c8bbdfcd60cc0996a0e2c4f9b44033 (diff)
Fixed a bug in the hole-aware raycaster
Diffstat (limited to 'src/libslic3r/SLA/Hollowing.cpp')
-rw-r--r--src/libslic3r/SLA/Hollowing.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/libslic3r/SLA/Hollowing.cpp b/src/libslic3r/SLA/Hollowing.cpp
index 8dc2d3092..5ab85c1cc 100644
--- a/src/libslic3r/SLA/Hollowing.cpp
+++ b/src/libslic3r/SLA/Hollowing.cpp
@@ -223,7 +223,10 @@ bool DrainHole::get_intersections(const Vec3f& s, const Vec3f& dir,
// they are on the cylinder and not past it:
for (int i=-1; i<=1 && found !=2; i+=2) {
Vec3f isect = closest + i*dist * projected_ray.direction();
- float par = (isect-proj_origin).norm() / par_scale;
+ Vec3f to_isect = isect-proj_origin;
+ float par = to_isect.norm() / par_scale;
+ if (to_isect.normalized().dot(proj_dir.normalized()) < 0.f)
+ par *= -1.f;
Vec3d hit_normal = (pos-isect).normalized().cast<double>();
isect = ray.pointAt(par);
// check that the intersection is between the base planes: