Commit 9960e37b authored by sfritschi's avatar sfritschi
Browse files

Minor refactoring

parent d1e87581
......@@ -31,10 +31,9 @@ def main():
# Colors
black = np.array([0.0, 0.0, 0.0])
red = np.array([1.0, 0.0, 0.0])
blue = np.array([0.0, 0.0, 1.0])
red = np.array([0.8, 0.0, 0.0])
blue = np.array([0.0, 0.0, 0.8])
magenta = np.array([1.0, 0.0, 1.0])
gold = np.array([186./255., 151./255., 47./255.])
n_zero_radius = 0
for i, pore in enumerate(basenet.pores):
......@@ -44,6 +43,7 @@ def main():
continue
# Add sphere
sphere = o3d.geometry.TriangleMesh.create_sphere(radius=radius, resolution=10)
"""
if pore.label == netflow.LABELS[0]:
sphere.paint_uniform_color(black)
elif pore.label[:2] == 'in':
......@@ -52,6 +52,8 @@ def main():
sphere.paint_uniform_color(blue)
else:
sphere.paint_uniform_color(magenta)
"""
sphere.paint_uniform_color(blue)
pos = coord_transform(pore.pos, basenet.lb[0], basenet.ub[0])
sphere.translate(pos)
......@@ -59,7 +61,7 @@ def main():
print("Did not render %d/%d pores because of too small radius" % (n_zero_radius, len(basenet.pores)))
n = 100
n = 500 # Upper limit of throats to render
n_zero_radius = 0
for i, throat in enumerate(basenet.throats):
if i == n:
......@@ -74,7 +76,7 @@ def main():
x2_t = coord_transform(x2, basenet.lb[0], basenet.ub[0])
height = np.linalg.norm(x1_t - x2_t)
cylinder = o3d.geometry.TriangleMesh.create_cylinder(radius=radius, height=height, resolution=8, split=4)
cylinder.paint_uniform_color(gold)
cylinder.paint_uniform_color(red)
# normalized vectors
cylinder_orient = np.array([0.0, 0.0, 1.0])
......
Supports Markdown
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