From ac3c36ffda1fa68f2058f14d6e09fef61f0f5317 Mon Sep 17 00:00:00 2001 From: Richard Fabian Date: Sun, 14 Jan 2018 18:53:20 +0000 Subject: [PATCH] increase the size of the epsilon to give better axis choice for triangulation --- tiny_obj_loader.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tiny_obj_loader.h b/tiny_obj_loader.h index 001e04f..873223c 100644 --- a/tiny_obj_loader.h +++ b/tiny_obj_loader.h @@ -1029,7 +1029,8 @@ static bool exportFaceGroupToShape( float cx = fabs(e0y*e1z - e0z*e1y); float cy = fabs(e0z*e1x - e0x*e1z); float cz = fabs(e0x*e1y - e0y*e1x); - if( cx > 0.0f || cy > 0.0f || cz > 0.0f ) { + const float epsilon = 0.0001f; + if( cx > epsilon || cy > epsilon || cz > epsilon ) { // found a corner if( cx > cy && cx > cz ) { } else {