Check curve is parallel with view

I’m trying to test if a curve is parallel with the ViewCPlane. Is just comparing the Z axis form CurvePlane with the Z axis from ViewCPlane the easiest way. In the test in the image below the View ZAxis is 0,1,0 and the curve is 0,-1,0 is there an easy way to compare these.

Thanks Mark

You might want to try rs.IsVectorParallelTo() and check if the return is nonzero… (-1 or 1)…

HTH, --Mitch

Edit: if there is any floating point “fuzz”, the other thing you can do is use VectorAngle() and see if the result is close to 0 or 180° within tolerance…

Thanks Mitch

I’ll keep it simple and test with

if rs.IsVectorParallelTo(curveplane.ZAxis, plane.ZAxis):
    print 'Curves Parallel'
    print rs.IsVectorParallelTo(curveplane.ZAxis, plane.ZAxis)
else:
    print 'Curves Not Parallel'
    print rs.IsVectorParallelTo(curveplane.ZAxis, plane.ZAxis)

and see if I get any fails when I shouldn’t.

Mark.