A good news is that the bug seems to be fixed. I think the bug derives from the dual polyhedron. In the present polyhedral code, once we find a point in the intersection, we move the origin to the point. The problem is that there may be a plane which is very closed to the new origin, so the dual point of this plane will be far away from the new origin. This dual point is not a good input of convex_hull_3. A available workaround, I think, is scaling the potential intersection manually. We can scale the real intersection back to its real size after getting the intersection. So I added several lines as follows:
//after translating the polyhedra to the new coordinate system
Transformation scale(CGAL::SCALING, 10);//scale 10 times
Transformation scale_back(CGAL::SCALING,0.1);
//scaling A,B
std::transforms(..., scale);
...
std::transforms(...,scale_back);//before translate the new origin to the old origin.
-----------------------------------------------------------------------------------
This method can avoid the crash for me even if I adopt a high stiffness like 1e16.
Hello Jan and Bruno,
A good news is that the bug seems to be fixed. I think the bug derives from the dual polyhedron. In the present polyhedral code, once we find a point in the intersection, we move the origin to the point. The problem is that there may be a plane which is very closed to the new origin, so the dual point of this plane will be far away from the new origin. This dual point is not a good input of convex_hull_3. A available workaround, I think, is scaling the potential intersection manually. We can scale the real intersection back to its real size after getting the intersection. So I added several lines as follows:
//after translating the polyhedra to the new coordinate system :SCALING, 10);//scale 10 times CGAL::SCALING, 0.1);
Transformation scale(CGAL:
Transformation scale_back(
//scaling A,B (..., scale); (...,scale_ back);/ /before translate the new origin to the old origin.
std::transforms
...
std::transforms
------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------
This method can avoid the crash for me even if I adopt a high stiffness like 1e16.
Thanks!
Best,
Sway