VasileiosBouzas / MeshPolygonization

68 stars 17 forks source link

Simplification step with different kernels #1

Closed egorovahelene closed 3 years ago

egorovahelene commented 4 years ago

Hi, Vasileios! Thanks for the open source code and your great work. I'm trying to use your code to do mesh simplification, but I encountered the following problem while trying to use your program. All steps are working well (after few corrections) except for the simplification. More precisely, at the step of creation of candidate face where the arrangement type of object is used. The program crashes with the message CGAL error: precondition violation! Expression : (m_traits.compare_y_at_x_2_object()(p, cv1) == EQUAL) && (m_traits.compare_y_at_x_2_object()(p, cv2) == EQUAL) File : C:\dev\CGAL-5.0.2\include\CGAL\Arr_segment_traits_2.h Line : 579

I reproduce the example in a separate program, i.e., took the points, constructed the segments and tried to make an arrangement. It turned out that the problem disappear when I use exact predicates exact constructions kernel, but with simple cartesian or exact predicates inexact constructions it doesn't work. So, I wonder if you ever encountered the same problem. Changing the kernel from simple cartesian to exact predicates exact constructions kernel doesn't help since the first steps don't work with it ( no definition of sin cos atan abs and sqrt for lazy_exact type of values which are needed for example for planarity scores calculations).

Thanks! Best regards, Elena

VasileiosBouzas commented 4 years ago

Hey Elena,

At first, I would like to apologize for my late response but I have not worked in this project for a year and a half (apart from some repo tidying stuff).

Second, thank you very much for your kind words! Unfortunately, this work was still at an experimental phase when I was done with it, but I hope it can be of some help to you.

Now, for the problem you mentioned, I noticed you use CGAL v5.0 and if my memory serves me well, I used CGAL v4.0 to originally develop the app (you can check the dependencies in the repo description). As you can imagine, this may cause some problems. In your case, this happens while building the 2D arrangements since there seems to be an equality condition that it works as long as the arithmetic precision of geometric structures is well defined through exact predicates exact constructions. Therefore, I would advise you to use the recommended version for the time being.

Again, sorry for the late response. If you are still interested in sending me some comments, I would be very glad to hear from you again!

Kind regards, Vasileios

LiangliangNan commented 3 years ago

I suppose the issue has been solved so I am going to close it. Please reopen it when possible.

Thank you!