The following line in Mesh2d.triangulation is incomplete:
_triangles = Mesh2D._quad_to_triangles([self._vertices[i] for i in face])
Reason being is that _quad_to_triangles return 0 based indices. These indices have to be re-adjusted to match the indices in the "face" object
The correct snippet should be:
if len(face) == 3:
_new_faces.append(face)
else:
_triangles = Mesh2D._quad_to_triangles([self._vertices[i] for i in face])
_triangles = [tuple(face[vertex_idx] for vertex_idx in new_face) for new_face in _triangles]
_new_faces.extend(_triangles)
The following line in Mesh2d.triangulation is incomplete:
Reason being is that _quad_to_triangles return 0 based indices. These indices have to be re-adjusted to match the indices in the "face" object
The correct snippet should be: