Oh, right. We'll cross that bridge when we come to it. For now, there is a ton of SVG spec to support.
-
-
@pcwalton this is useful for generating geometries. For resolution independent rendering, the conversion to the following approach shouldn't be difficult. https://threejs.org/examples/webgl_shaders_vector.html …1 reply 0 retweets 2 likes -
Replying to @BlurSpline @mrdoob
Interesting, looks like you’re tessellating the convex hulls. Is that a constrained Delaunay triangulation?
1 reply 0 retweets 0 likes -
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 -
It's much faster than O(n^2) in practice (because of hashed lookups). About 7–8x faster than libtess for us, while being more resilient. For self-intersections, while we handle that by preprocessing on the server, I'm working on a client-side "fixing" libhttps://github.com/mapbox/polysnap
1 reply 0 retweets 0 likes -
Why not do trapezoidation instead? In my tests, Pathfinder’s tessellator outperformed earcut by a lot, while simultaneously needing nothing special to handle self intersections.
3 replies 0 retweets 0 likes -
As far as I understand, trapezoidation produces many more primitives than triangulation by adding a lot of new vertices, which is much slower to render and takes more GPU memory. This is probably fine for text, but not for detailed maps like we do (e.g. complex water polys)
2 replies 0 retweets 1 like -
BTW, quite a few years ago, I tried to build a triangulation library that had trapezoidation as the first step, but it was slow and non-robust. https://github.com/mourner/seidel Perhaps it's worth looking into converting a Lorenzetto-based trapezoidation intro triangulation.
1 reply 0 retweets 2 likes -
Oh, I had forgotten about the technique in that paper to convert a trapezoidation to a triangulation. I should try that, thanks!
1 reply 0 retweets 1 like
Actually, thinking about it, I think the Lorenzetto trapezoidation + triangulation postpass is very close to the libtess monotone polygon decomposition approach, just in two phases. I don’t think I want to use it in Pathfinder because of robustness/complexity concerns…
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.