valette / ACVD

Fast simplification of 3D surface meshes
https://www.creatis.insa-lyon.fr/~valette/public/project/acvd/
Other
266 stars 57 forks source link

Bug fix in ACVDQ #28

Closed BinWang0213 closed 4 years ago

BinWang0213 commented 4 years ago

I just found a small bug while comping ACVDQ in windows.

// Line 246 @ ACVDQ.cxx
bool* fixed = new bool[mesh->GetNumberOfPoints()];
//bool fixed[ mesh->GetNumberOfPoints() ]; //Dynamic array should be used here
fixedVertices = vtkIdList::New();
int id, n = 0;

for ( int i = 0; i < mesh->GetNumberOfPoints(); i++ )
    fixed[ i ] = false;

while( input >> id ) {

    n++;
    vtkIdType v1, v2, v3;
    mesh->GetFaceVertices( id, v1, v2, v3 );
    fixed[ v1 ] = fixed[ v2 ] = fixed[ v3 ] = true;

}

for ( int i = 0; i < mesh->GetNumberOfPoints(); i++ )
    if ( fixed[ i ] ) fixedVertices->InsertNextId( i );

input.close();
cout << "Added " << n << " constraints on triangles" << endl;

delete[] fixed; //Free dynamic error
}

Can you check this issue and update your code?

valette commented 4 years ago

Hello, I just pushed a fix, does it work on your side?

BinWang0213 commented 4 years ago

It looks good. Thanks.