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.
-
-
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 -
TESS_WINDING_ODD and TESS_WINDING_NONZERO It’s well documented in http://www.glprogramming.com/red/chapter11.html … I use the
@MikkoMononen’s excellent port:https://github.com/memononen/libtess2 …1 reply 0 retweets 0 likes -
Replying to @Vector_GL @mrdoob and
Oh interesting, that’s cool. Still, all things considered I prefer the simplicity of trapezoidation over triangulation. Trapezoidation is very similar to what a CPU renderer does, which is nice to avoid surprises.
1 reply 0 retweets 0 likes -
Pathfinder seems to take several seconds to generate a mesh when using the SVG demo. Is this correct?
1 reply 0 retweets 0 likes -
Replying to @Vector_GL @mrdoob and
Most of that is parsing the SVG on the JS side—the demo is a bit of a mess. The actual mesh generation is extremely fast.
1 reply 0 retweets 0 likes
I want to replace the JS SVG parsing code with Rust…just got a ton of stuff to do.
-
-
Thanks. I know that feeling ;-) If anyone is working on a C++ to Rust translator, this is a pretty good SVG lib:https://github.com/memononen/nanosvg …
0 replies 0 retweets 0 likesThanks. Twitter will use this to make your timeline better. UndoUndo
-
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.