That’s related to something happening upstream in the script - your box centers are irregular, which creates inconsistencies when looking for the closest point - you need to make the box centers more regular first - So B will be “wrong” because A should be in line with B
I don’t know your project well enough to advise - maybe? You could create a grid yourself, you could adjust the center point locations, you can break it down in multiple boxes and check the distances to a “group” of centers - checking to the box doesn’t really help when the boxes are irregular and overlapping, you still have to make them make sense.
What do you mean by “Group”? All im after is collect closest points to each box. or point. Problem is these boxes will newer be the same hence i want a method that works on given box or point.
Boxes should not overlap here , do i have them overlapping?
Sorry been spinning on this for a weeks now probably overlooked something
Generate a number of points per surface and then sample the distance to them - then either with MassAddition or Average, you could find which “group” the points are closer to - but I don’t know, I doubt I’ll get round to Rhino today, so I can’t test - the boxes are not only overlapping, there’s a massive one that goes through almost all of the others - you could try with a BrepClosestPoint or even a mesh - the logic I gave you was mainly focusing on sorting things into branches based on distance to an object, how you generate that distance is up to you - I would be looking to redraw the grid so that the spacing is even