@@ -43,7 +43,7 @@ def draw(self):
4343 return self .guids
4444
4545 def draw_vertices (self , vertices , color ):
46- positions = [self .vertex_xyz [ vertex ] for vertex in vertices ]
46+ positions = [self .mesh . vertex_coordinates ( vertex ) for vertex in vertices ]
4747 positions = numpy .array (positions , dtype = numpy .float32 )
4848 colors = [color [i ] for i in range (len (vertices ))]
4949 colors = numpy .array (colors , dtype = numpy .float32 )
@@ -65,8 +65,8 @@ def draw_edges(self, edges, color):
6565 colors = []
6666
6767 for u , v in edges :
68- positions .append (self .vertex_xyz [ u ] )
69- positions .append (self .vertex_xyz [ v ] )
68+ positions .append (self .mesh . vertex_coordinates ( u ) )
69+ positions .append (self .mesh . vertex_coordinates ( v ) )
7070 colors .append (color [u , v ])
7171 colors .append (color [u , v ])
7272
@@ -91,32 +91,32 @@ def draw_faces(self, faces, color):
9191 c = color [face ]
9292
9393 if len (vertices ) == 3 :
94- positions .append (self .vertex_xyz [ vertices [0 ]] )
95- positions .append (self .vertex_xyz [ vertices [1 ]] )
96- positions .append (self .vertex_xyz [ vertices [2 ]] )
94+ positions .append (self .mesh . vertex_coordinates ( vertices [0 ]) )
95+ positions .append (self .mesh . vertex_coordinates ( vertices [1 ]) )
96+ positions .append (self .mesh . vertex_coordinates ( vertices [2 ]) )
9797 colors .append (c )
9898 colors .append (c )
9999 colors .append (c )
100100 elif len (vertices ) == 4 :
101- positions .append (self .vertex_xyz [ vertices [0 ]] )
102- positions .append (self .vertex_xyz [ vertices [1 ]] )
103- positions .append (self .vertex_xyz [ vertices [2 ]] )
101+ positions .append (self .mesh . vertex_coordinates ( vertices [0 ]) )
102+ positions .append (self .mesh . vertex_coordinates ( vertices [1 ]) )
103+ positions .append (self .mesh . vertex_coordinates ( vertices [2 ]) )
104104 colors .append (c )
105105 colors .append (c )
106106 colors .append (c )
107- positions .append (self .vertex_xyz [ vertices [0 ]] )
108- positions .append (self .vertex_xyz [ vertices [2 ]] )
109- positions .append (self .vertex_xyz [ vertices [3 ]] )
107+ positions .append (self .mesh . vertex_coordinates ( vertices [0 ]) )
108+ positions .append (self .mesh . vertex_coordinates ( vertices [2 ]) )
109+ positions .append (self .mesh . vertex_coordinates ( vertices [3 ]) )
110110 colors .append (c )
111111 colors .append (c )
112112 colors .append (c )
113113 else :
114- polygon = Polygon ([self .vertex_xyz [ v ] for v in vertices ])
114+ polygon = Polygon ([self .mesh . vertex_coordinates ( v ) for v in vertices ])
115115 ears = earclip_polygon (polygon )
116116 for ear in ears :
117- positions .append (self .vertex_xyz [ vertices [ear [0 ]]] )
118- positions .append (self .vertex_xyz [ vertices [ear [1 ]]] )
119- positions .append (self .vertex_xyz [ vertices [ear [2 ]]] )
117+ positions .append (self .mesh . vertex_coordinates ( vertices [ear [0 ]]) )
118+ positions .append (self .mesh . vertex_coordinates ( vertices [ear [1 ]]) )
119+ positions .append (self .mesh . vertex_coordinates ( vertices [ear [2 ]]) )
120120 colors .append (c )
121121 colors .append (c )
122122 colors .append (c )
0 commit comments