Nebukam / PCGExtendedToolkit

PCGEx is a free (libre) Unreal 5 plugin that expands PCG capabilities. It offers a variety of high-performance nodes; with an edge for building relational graphs (Freeform, Delaunay, Voronoi, MST etc), advanced pathfinding; and much more.
MIT License
161 stars 19 forks source link

findcontours only returning one path for multiple seeds? #50

Closed tychotic closed 5 months ago

tychotic commented 5 months ago

I seem to be only getting one path back (it's a nice one) from findcountours when I am passing in multiple seeds. Should we not see multiple paths coming out? Very likely user error, still learning this system.

tychotic commented 5 months ago

Also, I am using findcontours to recover the 2d hull around each seed in a voronoi graph. I assume this is a canonical use? I tried to extract individual hulls from the voronoi directly but not clear how to.

Nebukam commented 5 months ago

So, it's indeed the canonical way of getting the Voronoi cells! (if there is one ahah) -- however the findcountours suffers from some legacy code, I'll update ASAP to have a single target input, with each individual point being a seed.

At the moment, it's using collections as seed, which is bad. You basically need to create individual partitions from your points in order for them to act as individual seeds. I added an example in the example project (EdgesAndGraphs/FubdVoronoiCellContours) image

However as you can see, some contours are picked on the wrong side: it looks like some seeds are missing their associated contour, but it's in fact creating duplicate contours from neighboring cells >.<

Nebukam commented 5 months ago

So bottom line: your approach is the right one, I'm the one who fucked up.

tychotic commented 5 months ago

haha so it was good input I'm happy thanks again

I thought it was partionsomething

tychotic commented 5 months ago

user error, better version coming anyway :D