Hey guys,
I’m trying to wrap my head around the mesh data structure as well as the compas_rhino faces conduit to make a little script that allows me to select a rhino mesh, and then have it displayed for a few seconds by the faces conduit.
Here is my code:
import compas_rhino
from compas_rhino.geometry import RhinoMesh
from compas_rhino.conduits import FacesConduit
guid = compas_rhino.select_mesh()
mesh = RhinoMesh.from_guid(guid).to_compas()
def meshToConduit(mesh):
polygons = []
faces = [list(mesh.vertices())]
vertices = mesh.vertices_attributes('xyz',keys=None)
return FacesConduit(vertices,faces,(100,100,100))
conduit = meshToConduit(mesh)
with conduit.enabled():
for i in range(0,1000):
conduit.redraw()
The mesh appears, but has holes and faces seem to be angled inwards in places. I can tell the order of something is not right, but am super confused about faces/vertices and their indices within the FacesConduit().
If anyone could give a hand that would be great.
cheers
T