在cpython中嵌入rhino
rhinoinside的Python项目详细描述
RhinoInside Python包
在cpython中嵌入rhino
pip install --user rhinoinside
要求:
- 犀牛7
- 窗口
- 64位版本的cpython(2.7、3.5、3.6、3.7)
加入讨论
https://discourse.mcneel.com/t/rhino-inside-python/78987
如何使用
import rhinoinside
rhinoinside.load()
import System
import Rhino
# for now, you need to explicitly use floating point
# numbers in Point3d constructor
pts = System.Collections.Generic.List[Rhino.Geometry.Point3d]()
pts.Add(Rhino.Geometry.Point3d(0.0,0.0,0.0))
pts.Add(Rhino.Geometry.Point3d(1.0,0.0,0.0))
pts.Add(Rhino.Geometry.Point3d(1.5,2.0,0.0))
crv = Rhino.Geometry.Curve.CreateInterpolatedCurve(pts,3)
print (crv.GetLength())