dmytromishkin
commited on
Commit
•
5d64839
1
Parent(s):
da4ae8f
vertex color
Browse files- hoho/vis.py +4 -2
hoho/vis.py
CHANGED
@@ -41,7 +41,7 @@ def line(p1, p2, c=(255,0,0), resolution=10, radius=0.05):
|
|
41 |
|
42 |
return mesh
|
43 |
|
44 |
-
def show_wf(row, radius=10, show_vertices=False):
|
45 |
EDGE_CLASSES = ['eave',
|
46 |
'ridge',
|
47 |
'step_flashing',
|
@@ -53,7 +53,9 @@ def show_wf(row, radius=10, show_vertices=False):
|
|
53 |
'transition_line']
|
54 |
out_meshes = []
|
55 |
if show_vertices:
|
56 |
-
out_meshes.extend([trimesh.primitives.Sphere(radius=radius+5, center = center, color=
|
|
|
|
|
57 |
if 'edge_semantics' not in row:
|
58 |
print ("Warning: edge semantics is not here, skipping")
|
59 |
out_meshes.extend([line(a,b, radius=radius, c=(214, 251, 248)) for a,b in np.stack([*row['wf_vertices']])[np.stack(row['wf_edges'])]])
|
|
|
41 |
|
42 |
return mesh
|
43 |
|
44 |
+
def show_wf(row, radius=10, show_vertices=False, vertex_color=(255,0,0, 255)):
|
45 |
EDGE_CLASSES = ['eave',
|
46 |
'ridge',
|
47 |
'step_flashing',
|
|
|
53 |
'transition_line']
|
54 |
out_meshes = []
|
55 |
if show_vertices:
|
56 |
+
out_meshes.extend([trimesh.primitives.Sphere(radius=radius+5, center = center, color=vertex_color) for center in row['wf_vertices']])
|
57 |
+
for m in out_meshes:
|
58 |
+
m.visual.vertex_colors = np.ones_like(m.visual.vertex_colors)*vertex_color
|
59 |
if 'edge_semantics' not in row:
|
60 |
print ("Warning: edge semantics is not here, skipping")
|
61 |
out_meshes.extend([line(a,b, radius=radius, c=(214, 251, 248)) for a,b in np.stack([*row['wf_vertices']])[np.stack(row['wf_edges'])]])
|