ofDrawCircle rendering problem

Hi everyone. When I try to draw some circles in OF, I get this weird texture on rendering. I’ve been searching for days for the answer but can’t quite find it so here I am.

Here is the code for the setup and drawing of the circles followed by a screen capture of the rendering :

    // Setup :
    ofSetLineWidth (5);
    ofNoFill ();
    ofSetColor (0, 0, 0);
    int offset = tileSize / 1.70;
    ofPoint position = getTilePosition (1, 1) + offset; 
    
    // Circles :
    position += offset;
    ofDrawCircle (position, 42);
    ofDrawCircle (position, 35);
    ofDrawCircle (position, 28);
    ofDrawCircle (position, 21);
    ofDrawCircle (position, 14);
    ofDrawCircle (position, 7);

Have a look at this discussion.

You could try hacks like drawing the same circle many times with slight rotation or radius…
But you may need to use some other tools to fix this issue in a proper way.

yes this is a problem of how opengl draws think lines and there’s no easy solution for the general case but an easy way to draw the specific shape you are trying to is using ofPath and drawing many filled concentric circles instead of contours. each circle will cut out from the previous one, so if you want 5px line width you just need to draw circles of -5px radius than the previous each:

//.h
ofPath circles;

//setup (or whenever the path changes)
int offset = tileSize / 1.70;
ofPoint position = getTilePosition (1, 1) + offset;
circles.clear(); 
circles.setColor(ofColor::black);
int radius = 42;
while(radius>5){
    circles.circle(position, radius);
    radius-=5;
}

//draw
circles.draw();