PointsAreCoplanar

Verifies that a list of 3-D points are co-planar.

Syntax

rhinoscriptsyntax.PointsAreCoplanar (points, tolerance=1.0e-12)

rhinoscript.pointvector.PointsAreCoplanar (points, tolerance=1.0e-12)

Parameters

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).

Returns

Boolean

True or False indicating either coplanar or not coplanar, respectively, if successful.

None

On error.

Example

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)

Also See

IsPoint

IsPointCloud

PointCoordinates