BrunoLevy / geogram

a programming library with geometric algorithms
Other
1.87k stars 128 forks source link

unexpected behaviour in triangle_intersection algorithm #10

Closed Abenabbou closed 1 year ago

Abenabbou commented 2 years ago

I have the two triangles t0 and t1 below t0={p0, p1, p2}; with p0={1898.68 775 1158.48} , p1={2000 775 1166.7}, p2={1898.68 675 1148.6} t1={q0, q1, q2}; with q0={1966.41 675 1163.79}, q1={1971.63 675 1166.95}, q2={1967.56 684.554 1166.67}

When I call the api:
bool GEOGRAM_API triangles_intersections( const vec3& p0, const vec3& p1, const vec3& p2, const vec3& q0, const vec3& q1, const vec3& q2, vector& result ); I got this error (run in windows): | o-[Assert ] Error: Control should not have reached this point. | | File: \Geogram\src\lib\geogram\mesh\triangle_intersection.cpp, | | Line: 475 |

I except to get no intersection as depicted in the attached image. Capture

BrunoLevy commented 2 years ago

Thank you for notifying, I'll investigate...

BrunoLevy commented 1 year ago

Pushed a completely revisited version (if you want to try), github repo is up to date.

BrunoLevy commented 1 year ago

Double-checked with the following file:

v 1898.68 775 1158.48
v 2000 775 1166.7
v 1898.68 675 1148.6
f 1 2 3
v 1966.41 675 1163.79
v 1971.63 675 1166.95
v 1967.56 684.554 1166.67
f 4 5 6

Fixed in current version.