Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#102 iOS build error in IFCUtil.cpp::RemoveDegenerates

closed-fixed
nobody
Assimp lib (91)
5
2013-03-28
2012-11-03
Larsa
No

Hi,

I successfully built the static lib for iOS, but I had to patch the code due to compilation error in IFCUtil.cpp::RemoveDegenerates. I used the flag to disable boost and enabled static lib build.

Line 150 and 151 failed due to compilation errors. To resolve this I removed const from the two iterators being used, this is the code after the change:

void TempMesh::RemoveDegenerates()
{
// The strategy is simple: walk the mesh and compute normals using
// Newell's algorithm. The length of the normals gives the area
// of the polygons, which is close to zero for lines.

std::vector<IfcVector3> normals;
ComputePolygonNormals(normals, false);

bool drop = false;
size_t inor = 0;

// 1. Changed from const to non-const iterator
std::vector<IfcVector3>::iterator vit = verts.begin();

// 2. Changed from const to non-const iterator
for (std::vector<unsigned int>::iterator it = vertcnt.begin(); it != vertcnt.end(); ++inor) {
const unsigned int pcount = *it;

if (normals[inor].SquareLength() < 1e-5f) {
it = vertcnt.erase(it);
vit = verts.erase(vit, vit + pcount);

drop = true;
continue;
}

vit += pcount;
++it;
}

if(drop) {
IFCImporter::LogDebug("removing degenerate faces");
}

}

Regards/
Lars

Discussion

  • Larsa
    Larsa
    2012-11-03

    • labels: --> Assimp lib
     
  • Larsa
    Larsa
    2012-11-03

    Changed to the assimp lib category.

     
    • status: open --> closed-fixed
     
  • I think this is fixed now!