javascript - paperjs: clip two paths -
im trying exclude 1 polygon polygon in paperjs, cant seem figure out how this.
var base_points = [[50,50],[100,50],[125,10]]; var clippolygon = [[50, 50], [100,50], [100,0], [200, 0],[200,300]]; var base = pointstopath(base_points); base.strokecolor = "#000"; var clip = pointstopath(clippolygon); clip.strokecolor = "#ff00"; var clipped = base.exclude(clip) clipped.fillcolor = '#00ff00'
i made jsfiddle attempting here.
http://jsfiddle.net/thesamprice/9jm896gd/6/
it seems paperjs manual says possible.
jsfiddle seems have been using older paperjs link, code working expected.
Comments
Post a Comment