最近在rhino7的grasshopper里使用ghpython script学习gh二次开发,在利用CreateFromSweep方法进行单轨扫掠时遇到了问题,
就是调用CreateFromSweep单轨扫掠的最少参数模式时,运行是成功的,但加入文档里说的其他参数时就没反应,死活生成不了扫掠结果,编译器也不报错,不知道怎么回事。
运行成功的代码是:
from Rhino.Geometry import Brep, Curve, Point3d, Vector3d, SweepFrame, SweepBlend, SweepMiter, SweepRebuild
#breps = Brep.CreateFromSweep(rail1,san1,False,0.0115)
#a = breps
运行失败的代码是:
from Rhino.Geometry import Brep, Curve, Point3d, Vector3d, SweepFrame, SweepBlend, SweepMiter, SweepRebuild
startpoint = Point3d(0,0,0)
endpoint = Point3d(20,0,0)
frametype = SweepFrame.Freeform
roadlikenormal = Vector3d(0,0,1)
blendtype = SweepBlend.Local
mitertype = SweepMiter.Trimmed
tolerance = 0.01
rebuildtype = SweepRebuild.Rebuild
rebuildpointcound = 10
refittolerance = 0.01
breps = Brep.CreateFromSweep(
rail1,
san1,
startpoint,
endpoint,
frametype,
roadlikenormal,
False,
blendtype,
mitertype,
tolerance,
rebuildtype,
rebuildpointcound,
refittolerance
)
a = breps
以上代码我已附源文件。
感谢!
|