Grasshopper controlling tolerances

Hi,

Is there a way to control the tolerance for components.
Say I want to join a set of curves with a tolerance different than the document tolerance.
Is that possible without resorting to writing my own components?

Thanks
-Willem

Hi Willem,

It’s the best if David answers this question, but until that happens:
I do not think you can do that. Grasshopper gets its tolerances from Rhino document’s tolerances (Options->Units->Absolute tolerances).
So you have to call the Rhino.Geometry.Curve.JoinCurves if you would like to set some custom tolerance value.

Hi Djordje,

Thanks, I was afraid so.
Coming from scripting it’s easy to take these freedoms for granted.
I worked around it already.

-Willem

1 Like

you can always scale your geometry by the ratio of the desired tolerance to the document tolerance, perform your operation, and scale it back…

9 Likes

This worked for me. Scaled curves in GH, joined, then scaled back. Thanks

1 Like

Wow, that workaround works for me as well, so thanks, @andheum. I had issues with both “Trim with Region” and “Point in Curve” components just avoiding little pieces shorter than 0.01mm.
It seems that tolerance is really Grasshopper’s workflow bottleneck. It costed me 1 hour debugging.

1 Like

had the same yesterday, especially for operations such as split region / srf trimming gave null results. Happened when I migrated my code from mm to m units (as preferenced by ladybug/eddy3d). Changing the tolerance settings fix it in the end, but lost couple of hours to notice and finding out. What was annoying that it’s about finding that “sweet spot” 0.01 tolerance failed surface trimming/splitting, while 0.0001 also failed BBX intersection. 0.001 worked for both cases. While the reason is given here: Understanding Tolerances [McNeel Wiki] it is still pretty annoying and possibly worrisome (one operation failed not adding to my total m2 count, which lucky i noticed by luck, but i would have looked like a fool to my client otherwise. Hope someday this gets resolved

in python you can do

import Rhino

# Set a new absolute tolerance
Rhino.RhinoDoc.ActiveDoc.ModelAbsoluteTolerance = 0.001

# or 

# Get the absolute tolerance from the active Rhino document
absolute_tolerance = Rhino.RhinoDoc.ActiveDoc.ModelAbsoluteTolerance