Self-intersection is not detected when intersecting triangles are on the same plane
Forum rules
Be nice to others! Read the FreeCAD code of conduct!
Be nice to others! Read the FreeCAD code of conduct!
Re: Self-intersection is not detected when intersecting triangles are on the same plane
Thanks guys. I'd like to test the patch, but I guess it requires building and running FreeCAD along with all its dependencies. Is there a quick way to test the patch without setting up FreeCAD build environment? Probably not! I'll test when I have the opportunity... =)
Re: Self-intersection is not detected when intersecting triangles are on the same plane
For coplanar triangles the two intersection points may show garbage values. This means it doesn't just have arbitrary values but some of the coordinates might be NaN.
Now if creating a line and adding it to the scene graph may invalidate the view frustum and this leads to the observed behaviour.
With git commit 8d0d149b5be5d there is now a function to get the intersection points of the edges of triangles.
Now if creating a line and adding it to the scene graph may invalidate the view frustum and this leads to the observed behaviour.
With git commit 8d0d149b5be5d there is now a function to get the intersection points of the edges of triangles.
Re: Self-intersection is not detected when intersecting triangles are on the same plane
The self-intersection function fails again when rotating the mesh with:
With git commit 30ba396a82 it works as expected now. The problem was that tri_tri_intersect_with_isectline() doesn't work very reliably for coplanar triangles.
Code: Select all
from FreeCAD import Base
mat = Base.Matrix()
mat.rotateX(1.0)
mat.rotateY(1.0)
mat.rotateZ(1.0)
mesh = App.ActiveDocument.ActiveObject.Mesh.copy()
mesh.transformGeometry(mat)
App.ActiveDocument.ActiveObject.Mesh = mesh