Contour intersection

Hi, I've trying to find answer to my pretty simple question but with no success. I wanted to create a complex contour inside shape and I expected that contours would be added to each other but they didn't. My question is how can i cut a complex contour from shape without cancelling effect in intersection areas?

Снимок экрана от 2015-04-29 17:14:08

def setup():
    size(480, 480)
    background(0)
    noStroke()
    beginShape()
    vertex(40, 40)
    vertex(40, height - 40)
    vertex(width - 40, height - 40)
    vertex(width - 40, 40)
    beginContour()
    vertex(width / 2 + 20, 60)
    vertex(width / 2 + 20, height - 60)
    vertex(width / 2 - 20, height - 60)
    vertex(width / 2 - 20, 60)
    endContour()
    beginContour()
    vertex(width - 60, height / 2 - 20)
    vertex(width - 60, height / 2 + 20)
    vertex(60, height / 2 + 20)
    vertex(60, height / 2 - 20)
    endContour()
    endShape(CLOSE)

Answers

  • It's not clear for me why my question was trown in Questions about Modes. Yes, my code in Python but it's not very different from Java code, functions using by me are the same as in original Java mode. My qestion is rather programming question than question about Python mode

Sign In or Register to comment.