Search code examples
processing

Border of first circle is not displayed in overlapping circles


I am trying to draw two intersecting circles, as shown in the attached snapshot.

The border of my first circle on left is not displayed since the second circle on right is overlayed on it.

Is there a way that I can see the border of both the circles in the intersecting region?enter image description here

My code:

int x = 250;

void setup()
{  
  size(500,500);
  background(255);
}


void draw()
{

  coolCircles();

}


void coolCircles()
{       
  
      stroke(150);
      ellipse(180, 250, x, x);      
      ellipse(360, 250, x, x);
  
  
}

Solution

  • Actually you're drawing filled circles. Use noFill():

    void coolCircles()
    {       
         noFill(); 
         stroke(150);
         ellipse(180, 250, x, x);      
         ellipse(360, 250, x, x); 
    }