MCPcopy Create free account
hub / github.com/JeremyBYU/polylidar / run_test

Function run_test

examples/python/basic_mesh.py:141–156  ·  view source on GitHub ↗
(mesh, callback=None, polylidar_kwargs=None, config_pp=None)

Source from the content-addressed store, hash-verified

139
140
141def run_test(mesh, callback=None, polylidar_kwargs=None, config_pp=None):
142 tri_mesh = open_3d_mesh_to_trimesh(mesh)
143 bilateral_filter_normals(tri_mesh, 3, 0.1, 0.1)
144 vertices = np.asarray(tri_mesh.vertices)
145 normals_smooth = np.asarray(tri_mesh.triangle_normals)
146 mesh.triangle_normals = o3d.utility.Vector3dVector(normals_smooth)
147
148 planes, tri_set, all_poly_lines, timings = extract_all_dominant_planes(
149 tri_mesh, vertices, polylidar_kwargs, config_pp)
150 time_polylidar3D = timings['t_polylidar_planepoly']
151 polylidar_3d_alg_name = 'Polylidar3D with Provided Mesh'
152
153 mesh_3d_polylidar = []
154 mesh_3d_polylidar.extend(flatten([line_mesh.cylinder_segments for line_mesh in all_poly_lines]))
155 mesh_3d_polylidar.append(mesh)
156 callback(polylidar_3d_alg_name, time_polylidar3D, mesh_3d_polylidar)
157
158
159def callback(alg_name, execution_time, mesh=None):

Callers 1

mainFunction · 0.70

Calls 4

open_3d_mesh_to_trimeshFunction · 0.90
flattenFunction · 0.90
callbackFunction · 0.70

Tested by

no test coverage detected