From 6a4517b3774ad72f24e6f9ccdc6ad82b3e12fae8 Mon Sep 17 00:00:00 2001 From: cDc Date: Fri, 11 Oct 2024 18:34:00 +0300 Subject: [PATCH] mesh: stricter th for degenerate faces (cherry picked from commit c63bec05918915135df424109994b7872a221610) --- libs/Common/FastDelegate.h | 2 +- libs/MVS/Mesh.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/libs/Common/FastDelegate.h b/libs/Common/FastDelegate.h index 72206cb35..5d3428204 100644 --- a/libs/Common/FastDelegate.h +++ b/libs/Common/FastDelegate.h @@ -146,7 +146,7 @@ class delegate { using functor_type = typename ::std::decay::type; - if ((sizeof(functor_type) > store_size_) || !store_.unique()) + if ((sizeof(functor_type) > store_size_) || store_.use_count() != 1) { store_.reset(operator new(sizeof(functor_type)), functor_deleter); store_size_ = sizeof(functor_type); diff --git a/libs/MVS/Mesh.h b/libs/MVS/Mesh.h index 9e54ff806..411da78cf 100644 --- a/libs/MVS/Mesh.h +++ b/libs/MVS/Mesh.h @@ -190,8 +190,8 @@ class MVS_API Mesh void Decimate(VertexIdxArr& verticesRemove); void CloseHole(VertexIdxArr& vertsLoop); void CloseHoleQuality(VertexIdxArr& vertsLoop); - FIndex RemoveDegenerateFaces(Type thArea=1e-5f); - FIndex RemoveDegenerateFaces(unsigned maxIterations, Type thArea=1e-5f); + FIndex RemoveDegenerateFaces(Type thArea=1e-10f); + FIndex RemoveDegenerateFaces(unsigned maxIterations, Type thArea=1e-10f); void RemoveFacesOutside(const OBB3f&); void RemoveFaces(FaceIdxArr& facesRemove, bool bUpdateLists=false); void RemoveVertices(VertexIdxArr& vertexRemove, bool bUpdateLists=false);