nuki Posted February 26, 2018 Share Posted February 26, 2018 (edited) I am struggling to find a comprehensive solution for the following problem: Given a scattered point cloud, how would I calculate a pscale for every point that is the maximum possible pscale while at the same time avoiding intersections between the spherical ranges they describe. Generating the pscales between the points is easy of course but maximizing the space they use is giving me a lot of trouble. If you look at this image, you can clearly see the problem: Blue numbers are the @ptnum, red numbers are the number of their closest neighbour. Points 6 and 9 work fine. They represent each others closest neighbour, thus "touch each others surface" fine. It gets tricky when points are not each others closest neighbours. Point 7 is closest to Point0 while Point 0 is closest to Point 1... My attempts at "fixing the gaps" finally lead to this: But since Points 7 and 0 BOTH Need to be scaled up to touch their neighbour, they start to intersect. I am at a bit of a loss here.... ClosestDistanceTest_mk_v003.hip Edited February 26, 2018 by nuki Quote Link to comment Share on other sites More sharing options...
jamesr Posted February 26, 2018 Share Posted February 26, 2018 Hi! Here's what I came up with. There's still a tiny bit of overlap I can't seem to resolve, and I think I you can do it in a regular wrangle outside of a sop solver, but I haven't stuck it there yet. Anyways, here's what I got so far. ClosestDistanceTest_mk_v005.hip Quote Link to comment Share on other sites More sharing options...
nuki Posted February 27, 2018 Author Share Posted February 27, 2018 thanks a lot for your file jamesr, this is definately a ton better than what I came up with! I think the overlap is a result of your step size. What really put a knot into my brain yesterday was finding a way to directly calculate the pscale in a single pass eg. by finding the min. of the lengths of all midwaypoints...and all that amounted to is that I am pretty sure there is no way to solve this other than incrementing the scale ^^. Quote Link to comment Share on other sites More sharing options...
jamesr Posted February 27, 2018 Share Posted February 27, 2018 I was thinking step size too, but even with it very low and iterations very high it never seemed to go away. And yeah I think you're right, I think it must be iterated and validated, but I'm pretty sure it could be done in a for loop in a vex wrangle outside of the sop solver as well. Quote Link to comment Share on other sites More sharing options...
nuki Posted February 27, 2018 Author Share Posted February 27, 2018 oh, you can just put the exact wrangle you have in the solver sop into a foreach iterating over points and get the same result Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.