Commit 8c880731 authored by Dario Seyb's avatar Dario Seyb

Fixed HalfEdgeAttribute example

parent a7c516d1
......@@ -2,13 +2,13 @@
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"execution_count": 2,
"metadata": {},
"outputs": [
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "be06a7e9da8343b5894087e3ada16095",
"model_id": "67ea531ac07f452fa3c9aeff1d22bb67",
"version_major": 2,
"version_minor": 0
},
......@@ -49,16 +49,9 @@
"\n",
"mesh = threevis.Mesh(m.points(), m.face_vertex_indices())\n",
"\n",
"# (a) This works:\n",
"# mesh.colors = threevis.FaceAttribute(np.random.rand(m.n_faces(), 3))\n",
"\n",
"# (b) This doesn't:\n",
"\n",
"m.halfedge_from_vertex_indices()\n",
"mesh.colors = threevis.HalfEdgeAttribute(np.random.rand(m.n_halfedges(), 3))\n",
"\n",
"# (c) This doesn't work either:\n",
"# mesh.colors = threevis.HalfEdgeAttribute(np.random.rand(m.n_halfedges(), 3), range(m.n_halfedges()))\n",
"mesh.colors = threevis.HalfEdgeAttribute(np.random.rand(m.n_halfedges(), 3), m.halfedge_vertex_indices(), m.halfedge_face_indices())\n",
"\n",
"ctx = threevis.Context()\n",
"ctx.draw(mesh)\n",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment