Optimizing Shortest Path Networks

calendar_today

03.03.2025

label

Vegetation

mouse

Houdini 20.5

Description

Optimizing network efficiency by iteratively mapping shortest paths back into the weight of the base mesh.

1 Initializing the base mesh

After setting up a base mesh to travel onto, we add "start" and "end" groups to a point cloud. On the base mesh we initialize a weight attribute to prepare tracking on how often each point gets traversed.

// INITIALIZE
f@weight = 1.0;

2 Weighting the network

In a for loop we update the weight of the mesh by counting how often each mesh point is traversed by the shortest path node.

// UPDATE WEIGHTS
int count = findattribvalcount(1, 'point', 'origpt', i@ptnum);

f@weight = float(count);

3 Building a tree

In the final step another shortest path node runs over the weighted base mesh to build the curve network.

download

Downloads