Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

efficient_RANSAC: Executed ends with segmentation fault #158

Closed
thopiekar opened this issue Feb 23, 2020 · 3 comments
Closed

efficient_RANSAC: Executed ends with segmentation fault #158

thopiekar opened this issue Feb 23, 2020 · 3 comments

Comments

@thopiekar
Copy link
Collaborator

See #157

@sgiraudot
Copy link
Contributor

The normal map must be added before doing anything related to normals, see the documentation and the Point Set 3 example of the bindings.

@thopiekar thopiekar changed the title Point_set_3: Passing Point and Vector causes segmentation fault efficient_RANSAC: Executed ends with segmentation fault Feb 26, 2020
@thopiekar
Copy link
Collaborator Author

Many thanks for your help! I added the normal map to my modified example and it works fine now.
At the moment I face an issue with efficient_RANSAC. Hope you don't mind if I rename the issue here.

Whenever feeding the function with points and normals, I get segmentation faults.
If the dataset is large (100.000 points), efficient_RANSAC is running for some time, but then ending with a segmentation fault. So it seems to happen at somewhere at the end of the function.

The strange thing is that if I move the points and normals into a text file with .pwn extension, the example script works with it. Also, if I don't reload the file as in the latest version of my example script and convert every value into floats, it still crashes. The vertices' coordinates are originally saved in a Numpy array and their normals is calculated using cross product and finally normalized.

Below a link of the code I'm running here. I personally don't see any difference to the Shape_Detection example. It would be great, if you could take a look! 😄
https://github.com/tetonsim/is-cura-ui/blob/7a8eeaa42afd7ab553730286713f8f27cb533443/SmartSlicePlugin/shape_detection/ShapeDetectedNode.py#L99

Regarding this and the error about the missing normal map, it would be great, if the CGAL won't crash and show an error message instead I think. Seeing these segmentation faults make me scared actually 😅


ShapeDetection.crash.log
ShapeDetection.pwn.log

@sgiraudot
Copy link
Contributor

sgiraudot commented Feb 27, 2020

At the beginning of generate_point_cloud(), you clear the point set, which removes all the properties (see documentation). If that function is called, the shape map you create in the constructor is not valid anymore (and normal map too by the way) and the efficient RANSAC will push its output into invalid memory, thus segmentation fault.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants