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) and pathfinding; and much more.
MIT License
91 stars 10 forks source link

findcontours only returning one path for multiple seeds? #50

Closed tychotic closed 4 weeks ago

tychotic commented 4 weeks 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 4 weeks 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 4 weeks 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 4 weeks ago

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

tychotic commented 4 weeks ago

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

I thought it was partionsomething

tychotic commented 4 weeks ago

user error, better version coming anyway :D