11 {
12 std::vector<igl::Hit> hits;
13 Vec3f dir = (point - origin).normalized();
14 static constexpr const auto eps_angle = 89.99f;
18 Vec3d(origin.cast<
double>()),
19 Vec3d(dir.cast<
double>()),
20 hits)) {
21 for (int hit_idx = hits.size() - 1; hit_idx >= 0; --hit_idx) {
25 if ((point - pos).norm() < radius &&
face_normal.dot(dir) < 0) {
26 std::unique_ptr<TriangleSelector::Cursor> cursor = std::make_unique<TriangleSelector::Sphere>(
27 pos, origin, radius, this->
mesh_transform, TriangleSelector::ClippingPlane { });
29 true, eps_angle);
30 break;
31 }
32 }
33 } else {
34 size_t hit_idx_out;
38 if (dist < radius) {
39 std::unique_ptr<TriangleSelector::Cursor> cursor = std::make_unique<TriangleSelector::Sphere>(
40 point, origin, radius, this->
mesh_transform, TriangleSelector::ClippingPlane { });
42 trafo_no_translate,
43 true, eps_angle);
44 }
45 }
46}
void select_patch(int facet_start, std::unique_ptr< Cursor > &&cursor, EnforcerBlockerType new_state, const Transform3d &trafo_no_translate, bool triangle_splitting, float highlight_by_angle_deg=0.f)
Definition TriangleSelector.cpp:233
EIGEN_DEVICE_FUNC ConstTranslationPart translation() const
Definition Transform.h:410
bool intersect_ray_all_hits(const std::vector< VertexType > &vertices, const std::vector< IndexedFaceType > &faces, const TreeType &tree, const VectorType &origin, const VectorType &dir, std::vector< igl::Hit > &hits, const double eps=0.000001)
Definition AABBTreeIndirect.hpp:755
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:796
T dist(const boost::polygon::point_data< T > &p1, const boost::polygon::point_data< T > &p2)
Definition Geometry.cpp:280
Vec3d pos(const Pt &p)
Definition ReprojectPointsOnMesh.hpp:14
Eigen::Transform< double, 3, Eigen::Affine, Eigen::DontAlign > Transform3d
Definition Point.hpp:81
Eigen::Matrix< float, 3, 1, Eigen::DontAlign > Vec3f
Definition Point.hpp:49
Vec3f face_normal(const stl_vertex vertex[3])
Definition TriangleMesh.hpp:309
Eigen::Matrix< double, 3, 1, Eigen::DontAlign > Vec3d
Definition Point.hpp:52
Vec3f its_face_normal(const indexed_triangle_set &its, const stl_triangle_vertex_indices face)
Definition TriangleMesh.hpp:311
float t
Definition Hit.h:22
int id
Definition Hit.h:19