Weird issues when checking for intersection between meshes
See original GitHub issueHi!
I have the following situation/error and i haven’t been able to figure out why it happens. I can’t post the data, since it’s work product.
I have a lot of meshes, all of them being just a planar “square” made by two triangles joined at one side, rotated in axis z and x, and centered in different positions in the space (x,y,z).
Now, i’m checking for intersections between those meshes, using two nested loops that iterate pivoting over each one of them and checking for intersections with the rest using the intersectWith()
method.
Now, the weird behaviour is the following: Sometimes when checking two meshes for intersections, python crashes, without any error or warning, it just crashes. I tried to debug/guess what was happening and i was able to find out that when two meshes have the EXACT same midpoint position (the x,y,z of the center) the intersectWith()
method crashed (no idea why). I tried to quick-fix it by adding noise to the planes center coordinates, which so far fixed it for those cases, but i’m still getting the same error in other planes where apparently there is nothing related to that.
I’m asking here in case it’s a known issue; i suspect that something like… idk, when 2 vertices are exactly the same or something similar happens, the function crashes, but i don’t have a better clue about it.
This is an example of two planes that were crashing python when trying to calculate the intersection:
Any help or suggestion is more than welcome!
Issue Analytics
- State:
- Created a year ago
- Comments:21 (8 by maintainers)
Top GitHub Comments
Yeah. I’m still convinced it’s related to the internal vertex lines intersecting or ‘numerically intersecting’ (passing too close to each other). For a 2-elements mesh, each one can intersect the other mesh at 2 points, resulting in 4 intersection points, if the mid-arist intersect each other, the 2 ‘central’ intersection points are gonna be too close, and my guess is, if that distance is lower than the tolerance, it crashes. Maybe it assumes both are the same point and then the output doesn’t have the expected length or similar.
I tested on
vtk9.2.0rc2
but my guess is that the bug is there in all versions.