Limiting branches from any node in a free-form triangulation

Hi all, having an issue with the attached definition. I have a series of lines based on a random point cloud which I’m interconnecting with bezier curves. I’m drawing connecting lines between every pair of originating lines and then sorting them by distance, so that I can select only the 3 shortest lines in the set while excluding the lines of 0 length, and then making beziers from these, with the originating lines serving as tangent vectors. My goal is to ensure that a maximum of 3 beziers can be drawn out of either end of any originating line (nodes). My current definition is close, but currently some nodes have 4 branches while the neighbouring node has one or two, so I suspect that choosing the 3 shortest lines in the set may not be the best way to achieve my goal. Any ideas?

directional (16.3 KB)

Looking at it, each node does have only three branches exiting - additional branches are incoming from other nodes having three branches… no? So, deleting a fourth branch would potentially decrease another nodes branches to two… tricky.

That’s exactly right, maybe there is a way to measure the number of branches exiting a node and if it is three, then the branch incoming would be “rerouted” to a node with 2 or fewer exiting branches. I’ve tried something like this by measuring coincident points with the different cull duplicate components, but the data trees always end up becoming mismatched.