Fixes issue where triangulated meshes from Rhino were causing invalid meshes in Blender. This is because Rhino stores every face as 4 ints ([0,1,2,3]), even tris. Tris repeat the last index ([0,1,2,2]), and this causes problems when constructing a Blender mesh, which treats those as invalid quads.
detailed explanation
Rhino stores every face as 4 ints ([0,1,2,3]), even tris.
Tris repeat the last index ([0,1,2,2]), and this causes problems when constructing a Blender mesh, which treats those as invalid quads.
This fix checks the list of faces before creating a Blender object, and deletes the last element if it is identical to the second-last element.
Fixes invalid faces
Fixes issue where triangulated meshes from Rhino were causing invalid meshes in Blender. This is because Rhino stores every face as 4 ints (
[0,1,2,3]
), even tris. Tris repeat the last index ([0,1,2,2]
), and this causes problems when constructing a Blender mesh, which treats those as invalid quads.detailed explanation
[0,1,2,3]
), even tris.[0,1,2,2]
), and this causes problems when constructing a Blender mesh, which treats those as invalid quads.