From ef11025e9ee8142377017ff5ca9daacc7be524cd Mon Sep 17 00:00:00 2001 From: Jeremy Hu Date: Sun, 8 Jan 2017 12:07:18 +0930 Subject: [PATCH] Reduce radius of key ball when add to convex hull. --- src/bmesh.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/bmesh.c b/src/bmesh.c index cf6afe67..fa19a293 100644 --- a/src/bmesh.c +++ b/src/bmesh.c @@ -687,7 +687,9 @@ static convexHull *createConvexHullForBall(bmesh *bm, int depth, return 0; } if (BMESH_BALL_TYPE_KEY == ball->type) { - if (-1 == addBallToHull(hull, ball, + bmeshBall reduceBall = *ball; + reduceBall.radius *= 0.75; + if (-1 == addBallToHull(hull, &reduceBall, &outmostBall, &outmostBallFirstVertexIndex)) { fprintf(stderr, "%s:addBallToHull failed.\n", __FUNCTION__); arrayDestroy(ballPtrArray); @@ -1033,7 +1035,7 @@ int bmeshGenerate(bmesh *bm) { bmeshGenerateInbetweenMesh(bm); subdivCalculteNorms(bm->model); //bm->subdivModel = subdivCatmullClark(bm->model); - bm->subdivModel = subdivCatmullClarkWithLoops(bm->model, 2); + bm->subdivModel = subdivCatmullClarkWithLoops(bm->model, 1); return 0; }