KDT Closest Path

https://user-images.githubusercontent.com/14288520/196288317-b722f118-7e59-4013-9e1e-6208b5aa587f.png https://user-images.githubusercontent.com/14288520/196291396-d6aab023-7dc5-410e-8563-bb0ab74123a6.png

Functionality

Using a K-dimensional Tree it will create a path starting at the desired index joining each vertex to the closest free vertex. If no vertex is found in the desired range the path will break and will start a new path at the next unused vertex.

Inputs / Parameter

Name

Type

Description

Verts

Vectors

Vertices to make path

Max Distance

float

Maximum Distance to accept a pair

Start Index

Int

Vert index where path will start

Cyclic

Boolean

Enable to join the first and last vertices

Advanced Parameters

In the N-Panel (and on the right-click menu) you can find:

  • Match List Global: Define how list with different lengths should be matched. Refers to the matching of groups

  • Match List Local: Define how list with different lengths should be matched. Refers to the matching of max distances and vertices

Outputs

  • Edges, which can connect the pool of incoming Vertices to make a path.

Examples

Creating paths in a random vector field.

https://user-images.githubusercontent.com/14288520/196292568-b402cab3-db88-4c0c-9126-54034366266e.png

Find the best starting index to make the minimum path by starting at every vertex and comparing the path lengths and taking the shortest one.

https://user-images.githubusercontent.com/14288520/196377705-41e926f3-87c6-41d7-ace0-53436f6c642b.png

Find a coherent short path among shuffled vertices.

parametric_sverchok_KDT_closest_path_examples2.png