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

No intersection detected for coplanar triangles #3

Closed
2 tasks done
minitoine opened this issue Jul 19, 2022 · 3 comments
Closed
2 tasks done

No intersection detected for coplanar triangles #3

minitoine opened this issue Jul 19, 2022 · 3 comments

Comments

@minitoine
Copy link
Collaborator

minitoine commented Jul 19, 2022

Specific case where coplanar triangles do not trigger an intersection

T1:
(-1.000,0.000,0.000),(2.000,0.000,-2.000),(2.000,0.000,2.000)
T2:
(0.551,0.000,-0.796),(1.224,0.000,0.326),(3.469,0.000,1.000)

fig 9 test  IV.b

On a [p1,p2,r1] >0 et il y a une intersection.

Si [p1,p2,r1] <0 alors la droite p1p2 va séparer les 2 triangles 
puisque l’orientation  de T1 nous permet de dire que q1 est du meme coté que r1
Si [p1,p2,r1]=0 alors on a p2 entre p1 et r1 et l’intersection est p2

Si [p1,p2,r1]>0 alors il me semble qu’un cas a été oublié,
il faut encore tester le triangle q1 r2 r1
si [q1,r2,r1] >0 alors q1r1 sépare les deux triangles
si [q1, r2, r1] <= 0 alors [q1 r1] coupe [p2 r2] et il y a intersection
  • Add failing test
  • Check paper's authors email response about an error in the paper (in french)
@minitoine
Copy link
Collaborator Author

@georgpukk
Copy link

georgpukk commented Feb 22, 2023

Found a coplanar case where intersection is not detected:

import { Triangle, Vector3 } from 'three'
import { trianglesIntersect, Intersection } from 'fast-triangle-triangle-intersection'

const t1 = new Triangle(
	new Vector3(0, 0, 0),
	new Vector3(0, 0, 8),
	new Vector3(8, 0, 0)
)

const t2 = new Triangle(
	new Vector3(2, 0, 2),
	new Vector3(1, 0, 4),
	new Vector3(9, 0, 0)
)

const intersection = trianglesIntersect(t1, t2)

console.log('Intersection.Coplanar', intersection === Intersection.Coplanar)

@minitoine
Copy link
Collaborator Author

minitoine commented Feb 22, 2023

Please don't comment on a closed issue. I will open one for you (#4).
For now, if you invert t1 and t2, intersection is detected. I'll will have a look at this.

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