Comment 10 for bug 1380103

Revision history for this message
Sway (zhswee) wrote :

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
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.

Thanks!
Best,
Sway