3692 {
3693 size_t hit = 0;
3696 pos, hit, foot);
3697 if (d2 < 0.f || d2 > tol * tol || hit >=
patch.indices.size())
3698 return false;
3699 const stl_triangle_vertex_indices &t =
patch.indices[hit];
3700 float w1 = 0.f, w2 = 0.f;
3702 foot, w1, w2);
3704 uv = (1.f - w1 - w2) * c3[0] + w1 * c3[1] + w2 * c3[2];
3705 return true;
3706 }
VectorType::Scalar squared_distance_to_indexed_triangle_set(const std::vector< VertexType > &vertices, const std::vector< IndexedFaceType > &faces, const TreeType &tree, const VectorType &point, size_t &hit_idx_out, Eigen::PlainObjectBase< VectorType > &hit_point_out)
Definition AABBTreeIndirect.hpp:801
Eigen::Matrix< float, 3, 1, Eigen::DontAlign > Vec3f
Definition Point.hpp:65
static void barycentric_weights(const Vec3f &a, const Vec3f &b, const Vec3f &c, const Vec3f &p, float &w1, float &w2)
Definition TextureDisplacement.cpp:2063
Eigen::Matrix< float, 2, 1, Eigen::DontAlign > Vec2f
Definition Point.hpp:64
indexed_triangle_set patch
Definition TextureDisplacement.cpp:3684
AABBTreeIndirect::Tree3f tree
Definition TextureDisplacement.cpp:3685
std::vector< Vec2f > corner
Definition TextureDisplacement.cpp:3687