Not trying to troll you, BTW; it’s impressive work. Just trying to save you a year’s worth of dead-ends that I had to go through. There’s only one practical solution for tessellation of resolution independent paths that I know of, and it’s what Pathfinder uses.
-
-
You will need to rework the whole thing for SVG spec compliance when you get to implementing fill rules. The spec mandates that you handle winding vs. even-odd properly. Probably best to do it sooner rather than later, IMO.
1 reply 0 retweets 0 likes -
Yeah. I already found some svgs that earcut can't handle. SVG is like COLLADA, we won't support it fully, but we'll have decent support with performant and maintainable code. Enjoying the luxury of not being a browser
2 replies 0 retweets 1 like -
libTess is the gold standard for polygon tessellation. A JS port is available:https://github.com/brendankenny/libtess.js/ …
2 replies 0 retweets 1 like -
Replying to @Vector_GL @mrdoob and
No it's not.Maybe 10 years ago it was) ) Try
#mapbox earcut.1 reply 0 retweets 0 likes -
Replying to @SasMaster1980 @mrdoob and
It looks very good, but I need a constrained Delaunay triangulation solution. I also use libTess for its robust boundary contour operations for clipping and booleans.
3 replies 0 retweets 0 likes -
Replying to @Vector_GL @SasMaster1980 and
For what it’s worth, I like the libtess approach of monotone polygon decomposition a lot better than ear clipping. I just have an engineer’s bias toward simplicity, which is why I like trapezoidation :)
1 reply 0 retweets 0 likes -
Replying to @pcwalton @SasMaster1980 and
libTess is academically impeccable - but it produces a lot of tall very skinny triangles due to the horizontal sweepline.
2 replies 0 retweets 0 likes -
Replying to @Vector_GL @SasMaster1980 and
Ditto with trapezoidation. In fact I believe trapezoidation plus monotone polygon decomposition is *equivalent* to the libtess approach.
1 reply 0 retweets 0 likes -
Replying to @pcwalton @Vector_GL and
In other words: Lorenzetto trapezoidation is half of libtess. The problem I had is that monotone polygon decomposition is really hard to make work, maybe impossible, while preserving curves. So I just threw that part out. End result: A simple approach.
3 replies 0 retweets 0 likes
What’s become clear to me is that trapezoids are a much more natural mesh representation than triangles for 2D vector paths. Keith Packard came to the same conclusion a decade ago, BTW.
-
-
Replying to @pcwalton @SasMaster1980 and
Indeed, it’s a variation on the classic scanline algorithm.
1 reply 0 retweets 1 like -
Replying to @Vector_GL @SasMaster1980 and
Exactly. That’s what I love about it :)
0 replies 0 retweets 0 likes
End of conversation
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.