()
| 258 | orientation[i], ]); |
| 259 | |
| 260 | def main(): |
| 261 | args = parse_args(); |
| 262 | mesh = pymesh.load_mesh(args.input_mesh, drop_zero_dim=True); |
| 263 | if mesh.num_voxels > 0 and mesh.vertex_per_voxel != 4: |
| 264 | raise RuntimeError("Only tet mesh is supported for distortion computation"); |
| 265 | elif mesh.num_voxels == 0 and mesh.num_faces > 0 and mesh.vertex_per_face!=3: |
| 266 | raise RuntimeError("Only triangle mesh is supported for distortion computation"); |
| 267 | |
| 268 | numeric_level = getattr(logging, args.log, None); |
| 269 | if not isinstance(numeric_level, int): |
| 270 | raise ValueError('Invalid log level: %s' % loglevel); |
| 271 | logging.basicConfig(level=numeric_level); |
| 272 | |
| 273 | if mesh.num_voxels > 0: |
| 274 | compute_distortion_energies_3D(mesh); |
| 275 | compute_tet_quality_measures(mesh); |
| 276 | if args.csv != None: |
| 277 | output_to_csv_3D(mesh, args.csv); |
| 278 | else: |
| 279 | compute_distortion_energies_2D(mesh); |
| 280 | compute_tri_quality_measures(mesh); |
| 281 | if args.csv != None: |
| 282 | output_to_csv_2D(mesh, args.csv); |
| 283 | |
| 284 | pymesh.save_mesh(args.output_mesh, mesh, *mesh.attribute_names); |
| 285 | |
| 286 | if __name__ == "__main__": |
| 287 | main(); |
no test coverage detected