You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, the bop writer fails for objects that contain mixed quad and triangular faces. This can be fixed by triangulating the quad faces.
Describe a possible solution
defmesh_as_trimesh(self) ->Trimesh:
""" Returns a trimesh.Trimesh instance of the MeshObject. :return: The object as trimesh.Trimesh. """# get mesh datamesh=self.get_mesh()
# check if faces are pure tris or quads and triangulate quads if this is not the caseifnotall(len(f.vertices[:]) ==len(mesh.polygons[0].vertices[:]) forfinmesh.polygons):
# Triangulate quadsself.select()
bpy.ops.object.mode_set(mode='EDIT')
bpy.ops.mesh.select_all(action='SELECT')
bpy.ops.mesh.quads_convert_to_tris(quad_method='FIXED', ngon_method='BEAUTY')
bpy.ops.object.mode_set(mode='OBJECT')
self.deselect()
# get vertices verts=np.array([[v.co[0], v.co[1], v.co[2]] forvinmesh.vertices])
# get faces faces=np.array([f.vertices[:] forfinmesh.polygonsiflen(f.vertices[:]) in [3, 4]])
returnTrimesh(vertices=verts, faces=faces)
```
The text was updated successfully, but these errors were encountered:
Describe your feature request
Currently, the bop writer fails for objects that contain mixed quad and triangular faces. This can be fixed by triangulating the quad faces.
Describe a possible solution
The text was updated successfully, but these errors were encountered: