Why is contour not working here

why is contour not working here? I would expect to see a cutout.

size(100, 100);
background(0);
stroke(255);
strokeWeight(2);
line(33, 0, 85, 100);
noStroke();
fill(102);
beginShape();
vertex(10, 10);
vertex(10, 100);
vertex(100, 100);
vertex(100, 10);
beginContour();
vertex(15, 15);
vertex(15, 50-5);
vertex(50-5, 50-5);
vertex(50-5, 15);
endContour();
endShape();

vertices in contour have to be counter clockwise, or go in the opposite direction to your original shape.

1 Like