Crash in ofTessellator.cpp

I’m experiencing an odd crash when I call ofVertex(x, y) inside ofBeginShape(); in my draw function.

here’s my draw()

ofTranslate(ofGetWidth() / 2, ofGetHeight() / 2);

ofBeginShape();
for (float theta = 0; theta <= 2 * PI; theta += 0.1) {
    float rad = r(theta, 2.0, 6.0, 6.0, ofGetMouseX(), 1, 1);
    float x = rad * cos(theta) * 50;
    float y = rad * sin(theta) * 50;
    
   ofVertex(x, y);
}
ofEndShape(false);

The crash occurs in ofTessellator.cpp:

	if (!tessTesselate(cacheTess, polyWindingMode, TESS_POLYGONS, 3, 3, 0)){
		ofLogError("ofTessellator") << "performTessellation(): mesh polygon tessellation failed, winding mode " << polyWindingMode;
		return;
	}

I’m also getting this warning in the console:

[ error ] ofTessellator: performTessellation(): mesh polygon tessellation failed, winding mode 0

My app draws the window and crashes immediately.

Can anybody shed some light on why this might be happening?

I’m getting the same error with my code. If I rebuild the app sometimes it launches fine though. Let me know if you found a solution (though it may not be the same problem).

I have the same issue. Any help ??

What graphics cards are you guys using? Mine is an AMD Radeon HD 6970M 2048 MB

I am using Nvidia GEFORCE

NVIDIA GeForce GT 330M 512 MB

has anyone found a solution to this? I am having the same issue with beginShape() and with ofPath…

this is a problem with the tesselation library itself. it usually happens when trying to tessellate shapes that are not at least a valid triangle

I am getting the vertices of the ofPath from a mesh which is drawn with no problems. I don’t understand what happend. The only thing I understand is that some coordinates are generated by a real-time input from a device and the range of values is from negative to positive. If I put fixed values, let’s say I generate the mesh with random coordinates, the same code works.
Still I have hard time to understand the tassellation and indices.
here is the code, just in case it would make more sense

Thank you!

for (int x=0; x<arraylength; x++) {
        if (x==0) {
            mesh.addVertex(ofVec2f(xpos + x*wl, (dataPointer[0]*amplitude) ));
            mesh.addIndex(0);
        }
        
        mesh.addVertex(ofVec2f(xpos + x*wl, (dataPointer[x]*amplitude) ));
        mesh.addColor(color);
        
        if (x<arraylength-1) {
            mesh.addIndex(x);
        } else {
            ofVec2f bottomRx(widthUpdate - xpos , heigthUpdate - ypos);
            mesh.addVertex(bottomRx);
            mesh.addIndex(arraylength);
            
            mesh.addVertex(ofVec2f(xpos , heigthUpdate - ypos));
            mesh.addIndex(arraylength+1);
            
            mesh.addVertex(ofVec2f(xpos , ypos));
            mesh.addIndex(arraylength+2);
        }
    }
  
    mesh.addColor(color);
    
    ofVec3f thisCentroid = mesh.getCentroid();
    mesh.draw();

    //crashes tassellation here.... no solution yet

 /*
           ofBeginShape();
    for( int i = 0; i < mesh.getVertices().size(); i++) {
        ofVertex(mesh.getVertices().at(i).x, mesh.getVertices().at(i).y);
    }
    ofEndShape();
    */

 //crashes tassellation here.... no solution yet
    /*
        float amplitude = ofMap(ofGetMouseY(), 0, ofGetHeight(), 1, maxAmp);
        float wl =  maxWl;
    
        ofBeginShape();
        for (int x=0; x<arraylength; x++) {
            if (x == 0){
    
            ofCurveVertex(xpos + x*wl, dataPointer[0]*amplitude );
            ofCurveVertex(xpos + x*wl, dataPointer[0]*amplitude );
            } else if (x == arraylength-1){
                ofVec2f bottomRx(ofGetWidth() - xpos , ofGetHeight() - ypos);
                ofCurveVertex(bottomRx.x,bottomRx.y);
                ofCurveVertex(xpos , ofGetHeight() - ypos);
            }else{
                ofCurveVertex(xpos + x*wl, dataPointer[x]*amplitude );
                }
    
        }
        ofEndShape();
    */