BrepClosestPoint

Hi

Can anyone get the Tolerance to work in BrepClosestPoint it doesn’t seem to make any difference to the point brep relationship and any outcome.

Roger

dear @RogerD
can you give more information to the background of your question ?
maybe some code snippets ? a point and a brep in a .3dm file - and what are you after ? performance ? precision ?

you are using rhinoscriptsyntax in phyton ?
you are asking about BrepClosestPoint

or are you asking about Rhinocommon
Brep.ClosestPoint ?
It has a maximumDistance Parameter:

kind regards -tom

Hi Tom,

This is the function below,

TolR is set in my ETO form

I select a surface and coerce it to a brep

Select my list of points and loop through and if they are within TolR I create a vector

def ClosestPointEx(brep, pt, TolR):

info = brep.ClosestPoint(pt, TolR)

return info[0], info[1], info[5]

Can you confirm that the above functions as expected with any surface and a point at a distance within tolerance and out. I see you have the command spelt with a capital B for brep is that an error on my belhalf.

my model and full script relate to Classified Information and cannot be given out.

ok you are calling RhinoCommon Brep.ClosestPoint Method with python.

What behaviour are you expecting beyond the one explained in the documentation ?
The parameter you re talking about (“TolR”) “tolerance” is not a Tolerance in terms of precision but is named “maximumDistance” - to limit the search.

As you don t provide any geometry - another guess:
you should also check the return value ComponentIndex ci, (info[2] in your case).
The normal (info[5]) changes from surface-normal for surfaces to tangent for edges depending on ci.

hope this helps - kind regards -tom

Hi Tom

I appreciate it is not easy for you due to the restrictions I have on sharing data, this is Ministry Of Defence project data.

I was finding that the max distance was not working it would select all points if set to a value other than 0 and not filter out depending upon distance of point to surface.