Open MackJoly opened 3 months ago
Another possiblity is to put a try except: def to_triangles3d(self): """ Export the mesh faces as Triangle3D objects.
:return: The triangles comosing the mesh.
:rtype: list[Triangle3D]
"""
# pylint: disable=import-outside-toplevel, cyclic-import
from volmdlr.faces import Triangle3D
triangles3d = []
for vertex1, vertex2, vertex3 in self.remove_degenerate_triangles(tol=1e-6).triangles_vertices():
point1 = volmdlr.Point3D(*vertex1)
point2 = volmdlr.Point3D(*vertex2)
point3 = volmdlr.Point3D(*vertex3)
try:
triangles3d.append(Triangle3D(point1, point2, point3))
except ZeroDivisionError:
continue
return triangles3d
I'm submitting a ...
What is the current behavior? I have a triangle from a STL with 3 points aligned and it is not delete by remove_degenerate_triangles method
If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem Avoid reference to other packages
Those are my points aligned: point1: Point3D(-0.6205590209960937, 0.349411376953125, 0.17962226867675782) point2: Point3D(-0.6205590209960937, 0.349411376953125, 0.407595458984375) point3: Point3D(-0.6205590209960937, 0.349411376953125, 0.384592529296875)
What is the expected behavior? Aligned point to be deleted OR method Mesh3D.to_triangles3d to not fail because of those three aligned points
What is the motivation / use case for changing the behavior? Customer
Possible fixes Check with normalize vector in order to verify that they are not aligned
Please tell us about your environment: