Rebuild command, is the Max deviation info accessible via scripting?

Is it possible to access the maximum deviation information that shows up in the “Rebuild” pop up window, via rhinoscript or python?

I’d like to create a script that would iteratively test out various rebuild options, checking the maximum deviation for each option, and then choosing the option with with lowest point count and lowest deviation…


the curve rebuild command does not check for deviation, but you could do this eg. with python:

result = Rhino.Geometry.Curve.GetDistancesBetweenCurves(crv_A, crv_B, tolerance)

If result[0] is True, the maximum deviation distance between crv_A and crv_B can be get from result[1].

Below is a script i recently wrote for conversion of polylines into smooth curves with lowest possible pointcount. Sounds pretty much like what you´re trying to do :wink: (5.5 KB)


Hi Clement,
Yes! thank you that’s great. That is indeed what I was interested in. I will look to see if there is a comparable method for surfaces as well! Thanks for the tips and sharing you script.

Hi Ian,

also check out the curve commands _RebuildCrvNonUniform, _FitCrv and for surfaces _FitSrf


interesting, I’ll look into them