Compas -v 0.15.5 unknown error

I upgraded to compas 0.15.5 and tried to run a simple test script and I got an error

The script I ran:

import compas
from compas.datastructures import Mesh
from compas_rhino.utilities import select_mesh
from compas_rhino.artists import MeshArtist
from compas_rhino.geometry import RhinoMesh

guid = select_mesh("select mesh ")
mesh = RhinoMesh.from_guid(guid).to_compas()
print(type(mesh))

#artist
artist = MeshArtist(mesh, layer=‘COMPAS::test’)
artist.clear_layer()
artist.draw_faces(join_faces=True)
artist.draw_edges()
artist.redraw()

the error message:
’NoneType’ object has no attribute 'Attributes’
Traceback:
line 515, in draw_mesh, “C:\Users\ukeer\AppData\Roaming\McNeel\Rhinoceros\6.0\Plug-ins\IronPython (814d908a-e25c-493d-97e9-ee3861957f49)\settings\lib\compas_rhino\utilities\drawing.py”
line 553, in draw_faces, “C:\Users\ukeer\AppData\Roaming\McNeel\Rhinoceros\6.0\Plug-ins\IronPython (814d908a-e25c-493d-97e9-ee3861957f49)\settings\lib\compas_rhino\utilities\drawing.py”
line 100, in wrapper, “C:\Users\ukeer\AppData\Roaming\McNeel\Rhinoceros\6.0\Plug-ins\IronPython (814d908a-e25c-493d-97e9-ee3861957f49)\settings\lib\compas_rhino\utilities\drawing.py”
line 100, in wrapper, “C:\Users\ukeer\AppData\Roaming\McNeel\Rhinoceros\6.0\Plug-ins\IronPython (814d908a-e25c-493d-97e9-ee3861957f49)\settings\lib\compas_rhino\utilities\drawing.py”
line 397, in draw_faces, “C:\Users\ukeer\AppData\Roaming\McNeel\Rhinoceros\6.0\Plug-ins\IronPython (814d908a-e25c-493d-97e9-ee3861957f49)\settings\lib\compas_rhino\artists\meshartist.py”
line 22, in , “c:\Users\ukeer\GitHub\hilo_floor_fabrication\src\hilo_floor_fabrication\rhino\selectors.py”

could you try the following:

mesh = RhinoMesh.from_guid(guid)
faces = []
for face in mesh.faces:
    if face[0] == face[-1]:
        faces.append(face[:-1])
    elif face[-2] == face[-1]:
        faces.append(face[:-1])
    else:
        faces.append(face)

mesh = Mesh.from_vertices_and_faces(mesh.vertices, faces)   

Yes this works. Thank you!
just noticed from_guid is not implemented

the file you are referring to is the base class for all geometry classes. the implementations are in the deriving classes. the error is not related to that.

the classmethod from_vertices_and_faces wrongly assumes that the only duplicate vertices will be at the beginning and end of the face vertex list (in case the input has all faces explicitly closed), but rhino actually has duplicate vertices at the end of the vertex list in case of triangle faces.

i will update to_compas to take this into account and then your original snippet should just work…

Understood. Thank you for explaining

this should be fixed since 857a29e0