Verifies that a list of 3-D points are co-planar.
rhinoscriptsyntax.PointsAreCoplanar (points, tolerance=1.0e-12)
rhinoscript.pointvector.PointsAreCoplanar (points, tolerance=1.0e-12)
points |
Required. List or tuple. A list of 3-D points. |
tolerance |
Optional. Number. A tolerance to use when verifying. The default is to use Rhino's internal zero tolerance (1.0e-12). |
Boolean |
True or False indicating either coplanar or not coplanar, respectively, if successful. |
None |
On error. |
import rhinoscriptsyntax as rs
def SurfacesAreCoplanar(srf1, srf2):
if( not rs.IsSurface(srf1) or not rs.IsSurface(srf2) ): return False
if( not rs.IsSurfacePlanar(srf1) or not rs.IsSurfacePlanar(srf2) ): return False
pts1 = rs.SurfacePoints(srf1)
pts2 = rs.SurfacePoints(srf2)
if( pts1==None or pts2==None ): return False
pts1.extend(pts2)
return rs.PointsAreCoplanar(pts1)
x = rs.GetObject( "First surface to test", rs.filter.surface)
y = rs.GetObject( "Second surface to test", rs.filter.surface)
print SurfacesAreCoplanar(x, y)