IsCurveRational

判断一个物件是否为有理 NURBS 曲线。

语法

rhinoscriptsyntax.IsCurveRational (curve_id, segment_index=-1)

rhinoscript.curve.IsCurveRational (curve_id, segment_index=-1)

参数

curve_id

必须参数。字符串或 Guid。物件的 ID 。

segment_index

可选参数。数字。如果 curve_id 标示出一个多重曲线物件,那么 segment_index 标示要计算的是多重曲线的哪一段。

返回值

布尔值

如果执行成功,返回 True,如果执行不成功返回 False。

None

出错返回空值。

示例

import rhinoscriptsyntax as rs

obj = rs.GetObject("Select a curve")

if rs.IsCurve(obj):

    if rs.IsCurveRational(obj):

        print "The object is a rational NURBS curve."

    else:

        print "The object is not a rational NURBS curve."

else:

   print "The object is not a curve."

同见

IsCurve

IsCurveClosed

IsCurveLinear

IsCurvePeriodic