[How to] Breb closest Breb - Grasshopper

hallo,

How to get Breb closest Breb with Grasshopper, and then the length of the distance between them.

Did i need to create Point clouds on the surface ?
But the quality of the accuracy would then depend on the number of point cloud density

breb_closest_Breb.gh (10.9 KB)
Breb_closest_Breb.3dm (1.8 MB)

Brep
 Boundary rep
resentation

2 Likes

Cant find a Component with this name.

There is no command for a Brep Brep closest point. You can use Galapagos to find the closest point between two isocurves.

crv-crv-cp-galapagos.gh (24.0 KB)

3 Likes

Thanks for your time !

1 Like

Yes. :roll_eyes:

No need for a plugin that I can see.

Your GH file is profoundly useless.

Here is a way that sorta works, though the Clash point and distance move around as you move the tolerance distance slider. Lowest slider value is best?


brep_closest_brep_2024Aug4a.gh (654.0 KB)

Internalized geometry, no need for Rhino file.

2 Likes

thank you too.

Yes i search the lowest distance
The precision of the distance depends on the slider correct ?

This Clash Component is interesting, i think i can use it also for Collision Control of drilling pipes

The sections in your pipes make it difficult to move a point around with Galapagos.

I went to an absurd extreme with CrvProx to get closest points between centerlines but the resulting surface points are further apart than my previous effort :interrobang: Interesting problem.


brep_closest_brep_2024Aug4b.gh (656.9 KB)

1 Like

I have the original centerlines of these objects, and also a working script that shows me the distance from the curve of 1 Breb to the surface of another Breb.

I was just looking for a way to get this distance without the curve directly from 2 brebs. Now I know that there is no component that I didn’t know about.

Thank you for your tips and the help !! “Clash” & “Galapagos” were not known to me before.

I didn’t see them in your Rhino file so was forced to derive them. Didn’t help (yet).

That’s correct, I wanted to avoid referring to the curves, so I had deliberately removed them. To strive for a pure Breb solution.

Breb_distance_01.gh (11.5 KB)
This was one version i used. When using Curve

BREP, not “Breb” :exclamation:

Here is a Galapagos solution that looks promising, if I let the solver run longer.


brep_closest_brep_2024Aug4c.gh (665.3 KB)

Not interested in solutions that lack geometry or require installing a plugin.

2 Likes

Sofistik is a Plugin in Grasshopper, but nothink is inside the Canvas or the .gh file. I dont knew why some Sofistik settings are in .gh U can ignore it yes.

I ignored the whole file because the breps were empty, even though I had the Rhino file open.
When a file doesn’t work when opened, it’s game over :bangbang:

P.S. Adjusted my sliders to five decimal places (‘B1’ = 0.53772, ‘B2’ = 0.33402), I got the lowest distance yet between the two breps: 0.323218

I remember a Rhino command ( clearance ) that did exactly this @martinsiegrist ? The shortest line between two objects. Do you remember this or am I wrong? It doesn’t exist anymore or got changed to something else - the current command closestpt requires you specify a point before.

Here’s another option that maybe works for this case (not a solution):
clearance.gh (634.8 KB)

And this one based on Joseph’s use of clash component - I actually hadn’t used it with a distance search - pretty handy :ok_hand: (my line is still longer by ~.3 though)

clearanceB.gh (633.6 KB)

Here’s a simple iterative algorithm (using GhPython):

Edit: Had to increase the iterations a bit, but the profiler still doesn’t kick in, so it’s plenty fast and gets a smallest distance of 0.323216 units. It would probably make sense to extend the algorithm to automatically stop searching after the minimal distance difference from the previous iteration drops below some threshold:


240805_BrepsClosestPoints_00.gh (653.4 KB)

3 Likes