before I injure myself from repeated desk/head contact ... I've got an array/list/whatever of vectors, I want them ordered into a line based on proximity to the next nearest point. i.e point 0 connects to the nearest point, point 1 connects to the nearest point that isn't point 0 -- and so on I don't need to worry about…
I'm not really familiar with Java, but here's an example in Maxscript with a method that should be easily transferrable to other languages (assumes first position in array is the one we want to start the line with): allPositions = for obj in selection collect obj.pos --this line can just be replaced with any list/array of…
Thanks, that looks like it'll port over fine .. I'd been trying to take a list of points to visit and remove things from it - which (now i'm looking at it with a hangover) is ass backwards and obviously wouldn't work. very much appreciated :) this becomes this which is what I was after
If this is only for a very small number of points you can just loop through them one at a time while checking distance (via Pythagorean Theorem or whatever existing distance function you have access to) to all others you haven't already checked. If it's for a large number of positions then you may want to look into…
we're comfortably well under 100 points even in the worst plausible cases so that should be fine - I'm familiar enough with that sort of thing if i need to anyway. what i'm struggling with is the algorithm . Finding the nearest point (pointB) to a point (pointA) is simple, working out how to structure the data so I can…