예제 #1
0
mesh.set_vertices(vertices)
#mesh.display()

# test colors curvature
test_curv = mesh.vertices_cotan_curvature(False)
color_curv = np.zeros([len(test_curv),3])
max_curv_color = 10000
color_curv[:,0] = np.maximum(-test_curv,0) * max_curv_color / np.abs(test_curv).max()
color_curv[:,2] = np.maximum(test_curv,0) * max_curv_color / np.abs(test_curv).max()
mesh.set_colors(color_curv)
mesh.display()
exit()
"""

tri_mesh_flow = TriMeshFlow_Vtk(triangles, vertices)
print tri_mesh_flow.get_nb_vertices(), tri_mesh_flow.get_nb_triangles()

# Test parameters
nb_step = 10
diffusion_step = 1#
saved_flow = "testflow.dat"  # None
saved_fib = "testflow.fib"  # None

# Test functions
start = time.time()
#points = tri_mesh_flow.laplacian_smooth(nb_step, diffusion_step, l2_dist_weighted=False, area_weighted=False, backward_step=False, flow_file=saved_flow)
#points = tri_mesh_flow.curvature_normal_smooth(nb_step, diffusion_step, area_weighted=True, backward_step=True, flow_file=saved_flow)
#points = tri_mesh_flow.positive_curvature_normal_smooth(nb_step, diffusion_step, area_weighted=True, backward_step=True, flow_file=saved_flow)
#points = tri_mesh_flow.mass_stiffness_smooth(nb_step, diffusion_step, flow_file=saved_flow)
#points = tri_mesh_flow.positive_mass_stiffness_smooth(nb_step, diffusion_step, flow_file=saved_flow)
#points = tri_mesh_flow.volume_mass_stiffness_smooth(nb_step, diffusion_step, flow_file=saved_flow)