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

Function print_bbox

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

Source from the content-addressed store, hash-verified

41 info["vertex_per_voxel"] = mesh.vertex_per_voxel;
42
43def print_bbox(mesh, info):
44 print_section_header("Boundding box");
45 if mesh.num_vertices == 0:
46 print_red("Cannot compute bbox on empty mesh.");
47 return;
48 bbox_min, bbox_max = mesh.bbox;
49 if mesh.dim == 3:
50 print_format = "[{v[0]:^10.6g} {v[1]:^10.6g} {v[2]:^10.6g}]";
51 elif mesh.dim == 2:
52 print_format = "[{v[0]:^10.6g} {v[1]:^10.6g}]";
53 print("bbox_min: " + print_format.format(v=bbox_min));
54 print("bbox_max: " + print_format.format(v=bbox_max));
55 print("bbox_size: " + print_format.format(v=bbox_max - bbox_min));
56
57 info["bbox_min"] = bbox_min.tolist();
58 info["bbox_max"] = bbox_max.tolist();
59
60def quantile_breakdown(data, name, info, title=None, with_total=True):
61 if title is None:

Callers 1

mainFunction · 0.85

Calls 2

print_redFunction · 0.90
print_section_headerFunction · 0.85

Tested by

no test coverage detected