From 84b8170401b95c117da41c206be35ec1a35e639c Mon Sep 17 00:00:00 2001 From: cignoni Date: Tue, 26 Mar 2013 23:02:23 +0000 Subject: [PATCH] Changed the default of the param and added the automatic reverse of flipped outlines --- vcg/space/rasterized_outline2_packer.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/vcg/space/rasterized_outline2_packer.h b/vcg/space/rasterized_outline2_packer.h index 70c1d365..73be2d50 100644 --- a/vcg/space/rasterized_outline2_packer.h +++ b/vcg/space/rasterized_outline2_packer.h @@ -226,8 +226,8 @@ public: ///default constructor Parameters() { - costFunction = MinWastedSpace; - doubleHorizon=false; + costFunction = LowestHorizon; + doubleHorizon=true; rotationNum = 16; cellSize = 8; } @@ -479,7 +479,9 @@ public: float totalArea = 0; for (size_t j = 0; j < polyPointsVec.size(); j++) { - totalArea += tri::OutlineUtil::Outline2Area(polyPointsVec[j]); + float curArea = tri::OutlineUtil::Outline2Area(polyPointsVec[j]); + if(curArea<0) tri::OutlineUtil::ReverseOutline2(polyPointsVec[j]); + totalArea += fabs(curArea); } //we first set it to the "optimal" scale