|
[size=15.008px]rhinocommon帮助文档中说,CreateFromSweep可以有两种单轨扫掠模式:一种只需4个参数,这个我已经扫掠成功了;另一种有13个参数,可以指定roadlike选项,但我在做测试时发现这种模式无论如何也扫掠不成功,运行时[size=15.008px]编辑器并不报错,但就是扫掠不出来。特在此求助各路老师,有用过的请指教一二,万分感谢! 附源码及附件
[size=15.008px]import rhinoscriptsyntax as rsfrom Rhino.Geometry import *from scriptcontext import doc[color=var(--hljs-comment)][size=15.008px]#设定参数的值[size=15.008px]rail1 = rs.coercecurve(rs.AddLine((0, 0, 0), (0, 0, 60)))shape1 = rs.coercecurve(rs.AddCircle((0, 0, 0), 15)) shape2 = rs.coercecurve(rs.AddCircle((0, 0, 30), 15)) shapes = [rs.coercecurve(shape1), rs.coercecurve(shape2)]startPoint = rs.coerce3dpoint(rs.AddPoint(15, 0, 0))endPoint = rs.coerce3dpoint(rs.AddPoint(15, 0, 40))frameType = SweepFrame.FreeformroadlikeNormal = Vector3d.Unsetclosed = TrueblendType = SweepBlend.GlobalmiterType = SweepMiter.Trimmedtolerance = 0.015rebuildType = SweepRebuild.RebuildrebuildPointCount = 5refitTolerance = 0.0 [color=var(--hljs-comment)][size=15.008px]#进行单轨扫描,只含四个参数[size=15.008px]a = Brep.CreateFromSweep (rail1,shape1,False,0.1) [color=var(--hljs-comment)][size=15.008px]#进行单轨扫描,含loadlike等13个参数[size=15.008px]b = Brep.CreateFromSweep(rail1,shapes,startPoint,endPoint,frameType,roadlikeNormal,closed,blendType,miterType,tolerance,rebuildType,rebuildPointCount,refitTolerance)
|
|