In case if your cylinders are not extruded verticaly, you can slice them into severals sections and calculate the nearest distances between each two corresponding cross sections and take the minumum distance from distances list.Minimum distances.gh (23.1 KB)
Thanks a lot, does it work for multiple holes? Like around 10?
I think the method I proposed is not giving you the right answer for all cases.
So basically the method I proposed will calculate the distance between curves at each cross-section of objects ( such as d1,d2, and d4). But it fails to calculate distances such as d3 which can be smaller than d4.
So it’s better to simplify the question of how to calculate the minimum distance between two or several objects?
I’m also interested to know if anyone has a clue.
min dis.gh (12.9 KB) this my my file, please do tell me
sir do you have a way?
Hi again. as I said your problem can not be solved by the method of comparing distances of several geometries from a curve. I have made a rudimentary code that can tell you whats the minimum distance between sets of surfaces. For now, it does not tell you where the point is. it’s just telling you the value. if you increase the r-value it gives you a more precise number as result(for sure it will be slower if you increase the r).Minimum distance between sets of surfaces.gh (4.8 KB)
i am focusing on straight cylinders, and the number of cylinders may vary. it should the distance between all the cylinders taken 2 at a time. how should i do this
you can put as many as cylinders you want in the input. it will tell you the minimum distance. Just make sure your cylinders are surfaces(Not Brep).
Please take a close look at what I sent you. it works with surfaces.
its actually top view of a solid. i tried again but, i’m not able to contour the 3rd cylinder
Ok I modified the file a bit. This new file can also tell you from which point the closes distance is happening.
min dis.gh (16.6 KB)
is it possible to modify this for 3d solids?
I believe this is a complicated question. There must be a mathematical approach such as Line geometry … to this problem.
@DavidRutten can we compute the minimum distance between sets of any kind of geometries?
Here you have the naive method
min dis.gh (35.6 KB)