From 7d06710d46f289cd33a9690ebda580159bd2deac Mon Sep 17 00:00:00 2001 From: ponchio Date: Thu, 19 Oct 2006 10:11:01 +0000 Subject: [PATCH] I nuovi seed ora devono essere ad almeno radius dalla mesh. --- vcg/complex/trimesh/create/ball_pivoting.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/vcg/complex/trimesh/create/ball_pivoting.h b/vcg/complex/trimesh/create/ball_pivoting.h index 83b3e6f1..2522059b 100644 --- a/vcg/complex/trimesh/create/ball_pivoting.h +++ b/vcg/complex/trimesh/create/ball_pivoting.h @@ -141,6 +141,7 @@ Pivot(MESH &_mesh, ScalarType _radius, ScalarType _mindist = 0.1, ScalarType _cr } srand(time(NULL)); } + /* return false if you want to stop.\n */ void buildMesh(CallBackPos *call = NULL, int interval = 512) { bool done = false; @@ -188,6 +189,18 @@ bool seed(bool outside = true, int start = -1) { //some maximum tries. im lazy. return false; } + //find the closest visited or boundary + for(int i = 0; i < n; i++) { + if(dists[i] < radius) { + int id = targets[i]; + CVertex &v = mesh.vert[id]; + if(v.IsB() || v.IsV()) { + mesh.vert[start].SetD(); + return false; + } + } + } + int v0, v1, v2; bool found = false; //find a triplet that does not contains any other point