title: Paperjs boolean union and substraction (unite and subtract)
body: <p>Trying to understand how does unite and subtract methodes works in paperjs (paper.js).</p>
  
  <pre><code>var postyle = { fillColor:'grey', strokeColor: 'black'}
  
  var p1 = Path.Circle({
          center: new Point(80, 50),
          radius: 50
      })
  var p2 = Path.Circle({
          center: new Point(200, 50),
          radius: 50
      })
  
  var p3 = Path.Circle({
          center: new Point(120, 60),
          radius: 50
      })
  var p4 = Path.Circle({
          center: new Point(190, 60),
          radius: 15
      })
  var p5 = Path.Circle({
          center: new Point(50, 60),
          radius: 10
      })
  var p6 = Path.Circle({
          center: new Point(80, 40),
          radius: 10
      })
  
  var pos=p1.unite(p2)
  var neg=p3.unite(p4)
  
  var boolp=pos.subtract(neg)
  
  var path = boolp//.unite(p5)//.unite(p6)
  
  path.style=postyle
  </code></pre>
  
  <p>You can try it in <a href="http://sketch.paperjs.org" rel="nofollow">http://sketch.paperjs.org</a></p>
  
  <p>It works like this, but if you uncomment the <code>.unite(p5)</code>, the p5 circle is not union'ed with the others (the circle in the left quarter of moon).</p>
  
  <p>If you uncomment also the <code>.unite(p6)</code>, the p5 is now subtract'ed instead of union'ed. p6 is well union'ed.</p>
  
  <p>If you change p6 to <code>Point(60,40)</code>, p5 is well union'ed and p6 has the problem of union'ing.</p>
  
  <p>What goes wrong ?</p>
  
  <p>Thx</p>