Interesting, looks like you’re tessellating the convex hulls. Is that a constrained Delaunay triangulation?
-
-
Looks like it’s modified ear-clipping, based onhttps://github.com/mapbox/earcut
1 reply 0 retweets 0 likes -
Ah. That’s O(n^2) and won’t handle self-intersecting paths, which are extremely common in the real world :(
2 replies 0 retweets 0 likes -
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.
1 reply 0 retweets 1 like -
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
I looked at it but it didn’t handle self-intersecting paths with a consistent fill rule last I looked, nor did it preserve curves.
1 reply 0 retweets 0 likes -
Indeed, it’s a polygon library. Self intersections can be handled using TESS_BOUNDARY_CONTOURS
1 reply 0 retweets 0 likes -
Replying to @Vector_GL @mrdoob and
I don’t see fill rules in there though. How do you select even-odd vs. winding?
2 replies 0 retweets 0 likes
This is what kept getting me when I looked into tessellation: almost nothing out there handles fill rules properly. The best you can usually hope for is what FIST does: it generates “something that looks reasonable”—not good enough to implement the spec :(
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.