MCPcopy Create free account
hub / github.com/PyMesh/PyMesh / print_extended_info

Function print_extended_info

scripts/meshstat.py:173–257  ·  view source on GitHub ↗
(mesh, info)

Source from the content-addressed store, hash-verified

171 quantile_breakdown(voxel_volume, "volume", info);
172
173def print_extended_info(mesh, info):
174 print_section_header("Extended info");
175
176 num_cc = mesh.num_components;
177 num_f_cc = mesh.num_surface_components;
178 if mesh.num_voxels > 0:
179 num_v_cc = mesh.num_volume_components;
180 else:
181 num_v_cc = 0;
182 isolated_vertices = mesh.num_isolated_vertices;
183 duplicated_faces = mesh.num_duplicated_faces;
184 unique_vertices = pymesh.unique_rows(mesh.vertices)[0];
185 duplicated_vertices = mesh.num_vertices - len(unique_vertices);
186
187 degenerated_indices = pymesh.get_degenerated_faces(mesh);
188 num_degenerated = len(degenerated_indices);
189
190 if num_degenerated > 0:
191 degenerated_faces = mesh.faces[degenerated_indices];
192 combinatorially_degenerated_faces = \
193 [f for f in degenerated_faces if len(set(f)) != len(f) ];
194 num_combinatorial_degenerated_faces =\
195 len(combinatorially_degenerated_faces);
196 else:
197 num_combinatorial_degenerated_faces = 0;
198
199 print_property("num connected components", num_cc);
200 print_property("num connected surface components", num_f_cc);
201 print_property("num connected volume components", num_v_cc);
202 print_property("num isolated vertices", isolated_vertices, 0);
203 print_property("num duplicated vertices", duplicated_vertices, 0);
204 print_property("num duplicated faces", duplicated_faces, 0);
205 print_property("num boundary edges", mesh.num_boundary_edges);
206 print_property("num boundary loops", mesh.num_boundary_loops);
207 print_property("num degenerated faces", num_degenerated, 0)
208 if num_degenerated > 0:
209 print_property(" combinatorially degenerated",
210 num_combinatorial_degenerated_faces, 0);
211 print_property(" geometrically degenerated",
212 num_degenerated - num_combinatorial_degenerated_faces, 0);
213
214 info["num_connected_components"] = num_cc;
215 info["num_connected_surface_components"] = num_f_cc;
216 info["num_connected_volume_components"] = num_v_cc;
217 info["num_isolated_vertices"] = isolated_vertices;
218 info["num_duplicated_vertices"] = duplicated_vertices;
219 info["num_duplicated_faces"] = duplicated_faces;
220 info["num_boundary_edges"] = mesh.num_boundary_edges;
221 info["num_boundary_loops"] = mesh.num_boundary_loops;
222 info["num_degenerated_faces"] = num_degenerated;
223 info["num_combinatorial_degenerated_faces"] =\
224 num_combinatorial_degenerated_faces;
225 info["num_geometrical_degenerated_faces"] =\
226 num_degenerated - num_combinatorial_degenerated_faces;
227
228 if mesh.dim == 2 and mesh.vertex_per_face == 3:
229 tri_orientations = pymesh.get_triangle_orientations(mesh);
230 num_inverted_tris = np.sum(tri_orientations < 0);

Callers 1

mainFunction · 0.85

Calls 9

print_section_headerFunction · 0.85
print_propertyFunction · 0.85
get_degenerated_facesMethod · 0.80
get_tet_orientationsMethod · 0.80
is_closedMethod · 0.45
is_edge_manifoldMethod · 0.45
is_vertex_manifoldMethod · 0.45
is_orientedMethod · 0.45

Tested by

no test coverage detected