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

Function print_quantile_info

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

Source from the content-addressed store, hash-verified

114 quantile_breakdown(face_areas, "area", info);
115
116def print_quantile_info(mesh, info):
117 mesh.add_attribute("vertex_valance");
118 vertex_valance = mesh.get_attribute("vertex_valance");
119 quantile_breakdown(vertex_valance, "valance", info,
120 title = "Vertex Valance", with_total=False);
121
122 mesh.add_attribute("face_aspect_ratio");
123 aspect_ratios = mesh.get_attribute("face_aspect_ratio");
124 quantile_breakdown(aspect_ratios, "aspect_ratio", info,
125 title = "Face Aspect Ratio", with_total=False);
126
127 if mesh.dim == 3:
128 mesh.add_attribute("edge_dihedral_angle");
129 dihedral_angles = mesh.get_attribute("edge_dihedral_angle");
130 quantile_breakdown(dihedral_angles, "dihedral_angle", info,
131 title = "Edge Dihedral Angle", with_total=False);
132
133 if (mesh.num_voxels > 0 and mesh.vertex_per_voxel == 4):
134 mesh.add_attribute("voxel_dihedral_angle");
135 voxel_dihedral_angle = mesh.get_attribute("voxel_dihedral_angle");
136 voxel_dihedral_angle = voxel_dihedral_angle.reshape((-1, 6));
137 min_voxel_dihedral_angle = np.amin(voxel_dihedral_angle, axis=1);
138 max_voxel_dihedral_angle = np.amax(voxel_dihedral_angle, axis=1);
139
140 quantile_breakdown(min_voxel_dihedral_angle,
141 "voxel_min_dihedral_angle", info,
142 title="Per-voxel min dihedral Angle", with_total=False);
143 quantile_breakdown(max_voxel_dihedral_angle,
144 "voxel_max_dihedral_angle", info,
145 title="Per-voxel max dihedral Angle", with_total=False);
146
147 mesh.add_attribute("voxel_edge_ratio");
148 edge_ratio = mesh.get_attribute("voxel_edge_ratio");
149 quantile_breakdown(edge_ratio, "voxel_edge_ratio", info,
150 title="Voxel edge ratio", with_total=False);
151
152 mesh.add_attribute("voxel_inradius");
153 mesh.add_attribute("voxel_circumradius");
154 inradius = mesh.get_attribute("voxel_inradius").ravel();
155 circumradius = mesh.get_attribute("voxel_circumradius").ravel();
156 radius_ratio = np.divide(inradius, circumradius);
157 quantile_breakdown(radius_ratio, "voxel_radius_ratio", info,
158 title="Voxel radius ratio", with_total=False);
159
160def print_voxel_info(mesh, info):
161 if mesh.dim == 2:

Callers 1

mainFunction · 0.85

Calls 3

quantile_breakdownFunction · 0.85
add_attributeMethod · 0.45
get_attributeMethod · 0.45

Tested by

no test coverage detected