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

Function compute_tet_quality_measures

scripts/distortion.py:170–192  ·  view source on GitHub ↗
(mesh)

Source from the content-addressed store, hash-verified

168 mesh.set_attribute("grad_bound", measure);
169
170def compute_tet_quality_measures(mesh):
171 mesh.add_attribute("voxel_inradius");
172 mesh.add_attribute("voxel_circumradius");
173 inradius = mesh.get_attribute("voxel_inradius");
174 circumradius = mesh.get_attribute("voxel_circumradius");
175 radius_ratio = np.divide(inradius, circumradius);
176 mesh.add_attribute("radius_ratio");
177 mesh.set_attribute("radius_ratio", radius_ratio);
178 mesh.add_attribute("voxel_dihedral_angle");
179 dihedral_angle = mesh.get_voxel_attribute("voxel_dihedral_angle");
180 if mesh.num_voxels == 0:
181 min_dihedral_angle = np.zeros(0);
182 max_dihedral_angle = np.zeros(0);
183 else:
184 min_dihedral_angle = np.amin(dihedral_angle, axis=1);
185 max_dihedral_angle = np.amax(dihedral_angle, axis=1);
186 mesh.add_attribute("voxel_min_dihedral_angle");
187 mesh.set_attribute("voxel_min_dihedral_angle", min_dihedral_angle);
188 mesh.add_attribute("voxel_max_dihedral_angle");
189 mesh.set_attribute("voxel_max_dihedral_angle", max_dihedral_angle);
190 mesh.add_attribute("voxel_radius_edge_ratio");
191 mesh.add_attribute("voxel_edge_ratio");
192 compute_grad_upper_bound(mesh);
193
194def compute_tri_quality_measures(mesh):
195 mesh.add_attribute("face_incircle_radius");

Callers 1

mainFunction · 0.85

Calls 5

compute_grad_upper_boundFunction · 0.85
get_voxel_attributeMethod · 0.80
add_attributeMethod · 0.45
get_attributeMethod · 0.45
set_attributeMethod · 0.45

Tested by

no test coverage detected