Hi @Quan_Li
Certainly Topologizer is doing a lot more than needed for this sort of use.
My main original motivation for making it was wanting to turn the results from ‘woolly threads’/‘edge bundling’ type simulations into clean graphs that could be thickened.
For that it needed to not only combine nearby points, but also find intersections between crossing and nearly overlapping but non-duplicate sets of line segments etc. All of which adds a lot to the calculation time.
If all we want it to do is get rid of short segments, it can be much simpler and faster.
Here’s a script:
simpler_graph_clean.gh (14.4 KB)
(and there’s still lots of room for speed improvement there)
However, regarding the specific case of turning 3d Voronoi edges into thickened lattice structures, there’s another thing I’ve been meaning to implement for a while that I think would give nicer results than simply collapsing short segments, as it avoids creating such short segments in the first place.
The Voronoi diagram is the circumcentric dual to the Delaunay tetrahedralization - its edges connect the centers of the circumspheres of adjacent tetrahedra.
Just like in the 2d case, this can sometimes give very short edges in the dual even if the points are well spaced and the tetrahedra have no short edges.
If instead we use different centers for the tetrahedra (such as the incenter or barycenter) as the vertices of the dual we can avoid these short edges.