本帖最后由 licml 于 2011-1-5 21:20 编辑
Dim strCurve,strStartPt,strParam,strTan,arrPlane,arrCircle,b,i,radius
radius=rhino.GetReal("input pipe radius:",1 )
strCurve=rhino.GetObjects("Select curves")
b=Ubound(strCurve)
For i = 0 To b
strStartPt=rhino.CurveStartPoint(strCurve(i))
strParam=rhino.CurveClosestPoint(strCurve(i),strStartPt)
arrPlane=rhino.CurvePerpFrame(strCurve(i),strParam)
'strTan=rhino.CurveTangent(strCurve(i),strParam)
'arrPlane=rhino.PlaneFromNormal(strStartPt,strTan)
arrCircle=rhino.AddCircle(arrPlane,radius)
rhino.addSweep1 strCurve(i),arrCircle
Next
开始用的strTan提取做圆的参考平面,后来一想,有个CurvePerpFrame,呵呵
|