fixed bug in crease_cut.h + minor changes
This commit is contained in:
parent
c9194ae005
commit
014edf0e05
|
@ -2,7 +2,7 @@
|
|||
* VCGLib o o *
|
||||
* Visual and Computer Graphics Library o o *
|
||||
* _ O _ *
|
||||
* Copyright(C) 2004-2016 \/)\/ *
|
||||
* Copyright(C) 2004-2017 \/)\/ *
|
||||
* Visual Computing Lab /\/| *
|
||||
* ISTI - Italian National Research Council | *
|
||||
* \ *
|
||||
|
@ -25,6 +25,7 @@
|
|||
#define __VCG_CREASE_CUT
|
||||
#include<vcg/simplex/face/jumping_pos.h>
|
||||
#include<vcg/complex/algorithms/update/normal.h>
|
||||
#include<vcg/complex/algorithms/update/flag.h>
|
||||
namespace vcg {
|
||||
namespace tri {
|
||||
|
||||
|
@ -96,13 +97,13 @@ void CutMeshAlongNonFauxEdges(MESH_TYPE &m)
|
|||
}
|
||||
iPos.NextFE();
|
||||
} while (startPos!=iPos);
|
||||
if(locCreaseCounter>0 && (!isBorderVertex) ) newVertexCounter--;
|
||||
if (locCreaseCounter > 0) newVertexCounter--;
|
||||
//printf("For vertex %i found %i creases\n",vertInd,locCreaseCounter);
|
||||
}
|
||||
} // end foreach face/vert
|
||||
|
||||
// Now the indVec vector contains for each the new index of each vertex (duplicated as necessary)
|
||||
// We do a second loop to copy split vertexes into new positions
|
||||
// Now the indVec vector contains for each face wedge the new index of each vertex (duplicated as necessary)
|
||||
// We do a second loop to copy split vertices into new positions
|
||||
tri::Allocator<MESH_TYPE>::AddVertices(m,newVertexCounter-m.vn);
|
||||
|
||||
tri::UpdateFlags<MESH_TYPE>::VertexClearV(m);
|
||||
|
@ -110,11 +111,10 @@ void CutMeshAlongNonFauxEdges(MESH_TYPE &m)
|
|||
for(int j=0;j<3;++j)
|
||||
{
|
||||
size_t faceInd = Index(m, *fi);
|
||||
size_t vertInd = Index(m, (*fi).V(j));
|
||||
int curVertexInd = indVec[faceInd*3+ j];
|
||||
assert(curVertexInd != -1);
|
||||
assert(curVertexInd < m.vn);
|
||||
if(curVertexInd < startVn) assert(size_t(curVertexInd) == vertInd);
|
||||
if(curVertexInd < startVn) { assert(size_t(curVertexInd) == Index(m, (*fi).V(j))); }
|
||||
if(curVertexInd >= startVn)
|
||||
{
|
||||
m.vert[curVertexInd].ImportData(*((*fi).V(j)));
|
||||
|
|
|
@ -378,7 +378,7 @@ public:
|
|||
{
|
||||
int e0,e1;
|
||||
bool ret=face::FindSharedEdge(f,*it,e0,e1);
|
||||
assert(ret);
|
||||
assert(ret); (void)ret;
|
||||
if(!face::IsBorder(**it,e1))
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue