Just posted a new version of the MM.Points node set (https://vuo.org/node/2360) and added a new/improved MM.ListTools node set (https://vuo.org/node/2709) which is cleaned up and conforms more to Vuo standards with generic in/outs where applicable for those interested.

I also posted a heavily commented source code of the MM.ListTools if anyone is interested in such things. If anyone wants to have a look at it and suggest improvements and/or give me a beating for rubbish code I would be happy (although I hope it's a constructive beating with leads on how to do it better)!

While commenting/explaining the code I already thought of improvements for some of the nodes (getting rid of if/else statements). Trailing back and figuring out what I had actually done with the sorting node was quite the journey though. It works, but I'm not quite sure why. Although it's quite rubbish, I'd especially like pointers on how to do effective sorting within the framework.

Cheers MM

Comments

The MM.ListTools code overall

jstrecker's picture
Submitted by

The MM.ListTools code overall looks good to me. Thank you for the comments, documentation, and examples :)

For Sort with Index, even though computer science curricula devote like a month to teaching the different sorting algorithms (or at least they did back in my day), actually developers don't very often implement their own sorts. Better to use APIs that are already tested and optimized. As you probably saw, there's a VuoListSort_VuoGenericType1 function, but that wouldn't give you the indices for your output port. Instead, you could use std::sort like here.

My only other suggestion for MM.ListTools would be to call VuoGenericType1_curve in Morph Point List (as you did in Scale List to Center).