rhinocommon帮助文档中说,CreateFromSweep可以有两种单轨扫掠模式:一种只需4个参数,这个我已经扫掠成功了;另一种有13个参数,可以指定roadlike选项,但我在做测试时发现这种模式无论如何也扫掠不成功,运行时编辑器并不报错,但就是扫掠不出来。特在此求助各路老师,有用过的请指教一二,万分感谢! 附源码及附件
import rhinoscriptsyntax as rs
import Rhino.Geometry as rg
#设定参数的值
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 = rg.SweepFrame.Freeform
roadlikeNormal = rg.Vector3d.Unset
closed = True
blendType = rg.SweepBlend.Global
miterType = rg.SweepMiter.Trimmed
tolerance = 0.015
rebuildType = rg.SweepRebuild.Rebuild
rebuildPointCount = 5
refitTolerance = 0.0
#进行单轨扫描,只含四个参数
a = rg.Brep.CreateFromSweep (rail1,shape1,False,0.1)
#进行单轨扫描,含loadlike等13个参数
b = rg.Brep.CreateFromSweep(
rail1,
shapes,
startPoint,
endPoint,
frameType,
roadlikeNormal,
closed,
blendType,
miterType,
tolerance,
rebuildType,
rebuildPointCount,
refitTolerance
)
|