From e7f7acf2f76e9699bd5d6c662aca16bdc4dbf6f2 Mon Sep 17 00:00:00 2001 From: Michael Kirsch Date: Wed, 10 Jul 2019 20:18:07 +0200 Subject: [PATCH] recalculate volume only if determinante != 1 --- xs/src/admesh/util.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/xs/src/admesh/util.c b/xs/src/admesh/util.c index b664654049..3f8f43ec58 100644 --- a/xs/src/admesh/util.c +++ b/xs/src/admesh/util.c @@ -206,7 +206,8 @@ void stl_transform(stl_file *stl, double const *trafo3x4) { if(det < 0) stl_reverse_all_facets(stl); stl_get_size(stl); - stl_calculate_volume(stl); + if(det - 1.0 > 1e-04) + stl_calculate_volume(stl); calculate_normals(stl); } @@ -247,7 +248,8 @@ void stl_get_transform(stl_file const *stl_src, stl_file *stl_dst, double const if(det < 0) stl_reverse_all_facets(stl_dst); stl_get_size(stl_dst); - stl_calculate_volume(stl_dst); + if(det - 1.0 > 1e-04) + stl_calculate_volume(stl_dst); calculate_normals(stl_dst); }