EigenMesh3D raycaster should now be able to pick a correct intersection on the object or inside a hole

This commit is contained in:
Lukas Matena 2019-11-19 14:27:05 +01:00
parent 9dd18a8d6d
commit 2c1d256b0c
5 changed files with 147 additions and 57 deletions

View file

@ -83,8 +83,8 @@ void SupportPointGenerator::project_onto_mesh(std::vector<sla::SupportPoint>& po
sla::EigenMesh3D::hit_result hit_up = m_emesh.query_ray_hit(p.cast<double>(), Vec3d(0., 0., 1.));
sla::EigenMesh3D::hit_result hit_down = m_emesh.query_ray_hit(p.cast<double>(), Vec3d(0., 0., -1.));
bool up = hit_up.face() != -1;
bool down = hit_down.face() != -1;
bool up = hit_up.is_hit();
bool down = hit_down.is_hit();
if (!up && !down)
continue;