Surface.Is{Shape} and TryGet{Shape} with new value of ZeroTolerance

The following demonstrates that the WIP’s value of ZeroTolerance (https://mcneel.myjetbrains.com/youtrack/issue/RH-52215) is slightly less than what is needed to find Cones, Cylinders, Spheres, and Tori for NurbsSurfaces that were created directly from the round primitive via ToNurbsSurface. The methods are requiring the Surface to be ‘<’, rather than than ‘<=’, the tolerance to the target shape. When the tolerance argument is not passed to the Surface.Is… and Surface.TryGet… methods, ZeroTolerance is used as the tolerance.

Should the shapes be discoverable for the NurbsSurfaces at ZeroTolerance?

(1.0 / 2**32) == 2.3283064365386962890625e-10: True
RhinoMath.ZeroTolerance == (1.0 / 2**32): True
2.3283064365386961e-10  <  RhinoMath.ZeroTolerance: True
RhinoMath.ZeroTolerance == 2.3283064365386962e-10: True
RhinoMath.ZeroTolerance == 2.3283064365386965e-10: True
RhinoMath.ZeroTolerance <  2.3283064365386966e-10: True

Tolerances
A: 1e-12
B: (1.0 / 2**32)
C: 2.3283064365386965e-10
D: 2.3283064365386966e-10


size            RevSrf                          NurbsSrf                        
                Is_             TryGet_         Is_             TryGet_         
                (NoTol/Tol)     (NoTol/Tol)     (NoTol/Tol)     (NoTol/Tol)     

Cone
247.6986        True  /A        True  /A        False /D        False /D        
211.2632        True  /A        True  /A        False /D        False /D        
592.7017        True  /A        True  /A        False /D        False /D        
13.3925         True  /A        True  /A        False /D        False /D        

Cylinder
347.6086        True  /A        True  /A        False /D        False /D        
794.2795        True  /A        True  /A        False /D        False /D        
143.9371        True  /A        True  /A        False /D        False /D        
647.5591        True  /A        True  /A        False /D        False /D        

Sphere
823.0163        True  /A        True  /A        False /D        False /D        
447.02          True  /A        True  /A        False /D        False /D        
893.3937        True  /A        True  /A        False /D        False /D        
687.836         True  /A        True  /A        False /D        False /D        

Torus
135.8395        True  /A        True  /A        False /D        False /D        
721.1443        True  /A        True  /A        False /D        False /D        
978.6872        True  /A        True  /A        False /D        False /D        
84.0928         True  /A        True  /A        False /D        False /D        

Study_TryGetRoundShapeVsZeroTol.py (4.2 KB)

Hi @spb,

I don’t believe this was ever the design intent.

– Dale