I am using cgal's intersection method to find the intersection between line and a triangle.
double tolerance = 1e-6;
auto result = intersection(segment1, triangle1);
Now I want to add tolerance in the triangle (similar to dilating the triangle by given tolerance amount).
So, How do I add tolerance to my triangle1?
ps : I saw that Bbox_3.h has dialte functionality.
Update :
Earlier I had
typedef CGAL::Simple_cartesian<double> IK;
IK::Triangle_3 first_triangle(IK::Point_3(0, 0, 0), IK::Point_3(2, 0, 0),
IK::Point_3(1, 1, 0));
Now I made it :
typedef CGAL::Simple_cartesian<CGAL::Interval_nt<false>> IK;
IK::Triangle_3 first_triangle(IK::Point_3(0, 0, 0), IK::Point_3(2, 0, 0),
IK::Point_3(1, 1, 0));
I still cannot figure out how to add interval (my tolerance) to those points. It would be great if there was some example regarding this.
There is no such tolerance in CGAL. What you can do is to use a kernel with intervals (say CGAL::Simple_cartesian<CGAL::Interval_nt<> >
) and have the coordinates of the points of your triangles being intervals rather than a single value. Then all predicates with return Uncertain
objects that you can query using free functions (like is_certain()
). There is also some pseudo code on that page.