Closed nkint closed 3 months ago
Hi @nkint — this new feature (like many more recent examples) is still relying on the as-of-yet unpublished v8 of thi.ng/geom, so you'll have to use the repo version. This next update is one of the largest in recent years and I've been working it now for over a month. Hope to get it out sometime next week (at last!)
thanks, no hurry 😅
This next update is one of the largest in recent years
Seems exciting! Can I ask you a quick spoiler? Just out of curiosity, what is the reason that drives you to this refactor? Sorry I'm missing for a long time and I don't want to flood you with questions...
Lots of reasons, incl. long planned additions, but also just quality of life improvements:
xxxFromTessellation
functionsI'm sure I'm missing a ton of other features here, just take a look at the comparison with the v7 version (most of the commits since then are related to this major overhaul):
https://github.com/thi-ng/umbrella/compare/%40thi.ng/geom%407.0.1...develop
Hope that helps! :)
Yes thanks! 👏 Great work! Always learning from inspecting your commits/refactor-process.
While lurking last commits I also noted some rewrite of algorithms from tranducers to simple for loop (random example):
Is it just a completely unrelated random thing, a shift in paradigm, or an optimization effort?
Hehe... here the shift away from transducers was for mainly for these reasons:
1) the new tessellators are generating faces of point indices (aka vertex IDs) rather than just emitting points and we're also storing these results in a tessellation object, rather than just emitting a sequence of faces. this all gives us more flexibility for post-tessellation uses (e.g. graph building), but also is much more suitable for WebGL...
2) I wanted the different tessellators to be as uniform as possible (in terms of implementation) and for some of them there was no easy/efficient way to do them in this transducer style (transducers are flexible, but not a silver bullet :)
3) The use of transducers here was a performance bottleneck, especially considering these tessellator functions are kind of a performance hot spot, so it's been worth it replacing them. e.g. in the edgeSplit()
example you posted above, the new version saves 2 array allocations, a loop and some other overhead for each single edge, all quickly adding up...
4) The diff you posted isn't actually the latest version (which is shown below). There you can see that the target tessellation has now actually an interface (and there're two implementations available for now, one with mesh-like characteristics to dedupe vertices). Again, this is a type of update which doesn't really suit a transducer approach...
Btw. This all is not to say that transducers are inefficient in general or that you should stop using them, it's just one of the examples why there're many approaches/paradigms used throughout umbrella: Rather than insisting that everything is a nail for our hammer (as often w/ frameworks), different situations/contexts are just calling for different solutions...
Hi! Not sure why but the new
from-tessellation
is not exported correctly. (I am super excited fromgraphFromTessellation
⚡️❤️😱💥)I am expecting to see
from-tessellation
as well....I might miss something...