From 11b81418bc7f28f4e91e99320335a246099df033 Mon Sep 17 00:00:00 2001 From: flex-Alec <139144665+alec-flexcompute@users.noreply.github.com> Date: Thu, 11 Jan 2024 15:30:02 -0800 Subject: [PATCH] Update mesh.py's zero triangle area error message The current error message suggests using a function in Trimesh that will be deprecated in March 2024, and using it now results in some weird errors. The alternative suggestion I'm works. --- tidy3d/components/geometry/mesh.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tidy3d/components/geometry/mesh.py b/tidy3d/components/geometry/mesh.py index 3ec4c5486..fff9f8d4a 100644 --- a/tidy3d/components/geometry/mesh.py +++ b/tidy3d/components/geometry/mesh.py @@ -59,7 +59,8 @@ def _check_mesh(cls, val: TriangleMeshDataset) -> TriangleMeshDataset: if not all(np.array(mesh.area_faces) > fp_eps): raise ValidationError( "The provided mesh has triangles with zero area. " - "Consider using 'trimesh.Trimesh.remove_degenerate_faces' to fix this." + "Consider using numpy-stl's 'from_file' import with 'remove_empty_areas' set " + "to True and a suitable 'AREA_SIZE_THRESHOLD' to remove them." ) if not mesh.is_winding_consistent: log.warning(