Closed simonhoss closed 2 years ago
Great question; when drawing things inside of others, the order of the anchors matter. In some programming contexts this is known as clockwise
or counterClockwise`. You need to reverse the order (as in the anchors need to go counter clockwise) of the anchors like so: https://codepen.io/jonobr1/pen/mdqaNmq?editors=0010
Thanks this solved it.
Is there any reason why you don't use "oddeven" for this? Maybe better performance?
Now I have to figure the direction of my path's. Would it be interesting for you having such a functionality inside two? I mean handing over a Path object which determine if a path is clock or counter clock direction?
Glad it helped and great question.
Currently Two simply passes off the "oddeven" to the underlying rendering environment (SVG or Canvas). This setup didn't add any overhead, but you bring up a good point. There could easily be a way to describe what you're saying so that the developer doesn't need to worry about the order of the points.
I think such functionality would fit well with this enhancement: https://github.com/jonobr1/two.js/issues/443
Thanks for your answer helped a lot
Hello
I'm trying to create a hole for a path, but somehow it's not working. Any advice of what I'm doing wrong?
Here is my code example: https://codepen.io/simonhoss/pen/KKybOPG
Thanks for your effort and help! Simon