Surface.IsPlanar tolerance vs. surface type

Here is an example where larger tolerances are required for IsPlanar to return True for a RevSurface and a SumSurface than their NurbsSurface equivalents.

NurbsSurface IsPlanar(0.0001): True
NurbsSurface IsPlanar(0.0001): True
RevSurface IsPlanar(0.01): True
SumSurface IsPlanar(1.0): True

IsPlanar_depends_on_srf_type.3dm (53.7 KB) (619 Bytes)

Rhino 6.11.18348.17061

Thank you,

Hi @spb,

Yep, I can see the differences. Each of the surfaces calculates IsPlanar in a much different manner. Is there a problem here that you are trying to solve?

– Dale

I am testing non-PlaneSurfaces in Breps to determine which ones can be replaced with PlaneSurfaces. In this case, when IsPlanar tolerance is set to the ModelAbsoluteTolerance (0.001), the RevSurface and SumSurface are missed when tested directly.

Using TryGetPlane on the RevSurface, SumSurface, and their ToNurbsSurface results, only the RevSurface results in a poorly-oriented plane:

When the PlaneSurface of its TryGetPlane's plane is extended over the RevSurface, the deviation is about 0.008, which coincides with a more refined testing of IsPlanar. On the hand, the plane from SumSurface matches the plane from ToNurbsSurface result.

Now knowing this, I will convert RevSurfaces and SumSurfaces to NurbsSurfaces to use IsPlanar and TryGetPlane on the latter.

rhinoscript’s IsSurfacePlanar tests BrepFaces directly, so the same issue exists with it.

TryGetPlane isn’t used by rhinoscript (by Surfaces).