Skip to main content

Embed Rhino in CPython

Reason this release was yanked:

Bad binary data

Project description

rhinoinside python package

Embed Rhino in CPython

pip install --user rhinoinside

Requirements:

  • Rhino 7, 8, 9 (WIP)
  • Windows
  • 64 bit version of CPython (>= 3.7)

Join the discussion

https://discourse.mcneel.com/t/rhino-inside-python/78987

How to use

import rhinoinside
rhinoinside.load()    # this will load rhino 7 on dotnet framework (net48)
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())

You can pass arguments to the .load() function to start a different version of rhino on a specific dotnet framework

# Loading Rhino 7
rhinoinside.load(7) # defaults to net48
rhinoinside.load(7, 'net48')
rhinoinside.load(r"C:\Program Files\Rhino 7\System") # defaults to net48
rhinoinside.load(r"C:\Program Files\Rhino 7\System", 'net48')

# Loading Rhino 8
rhinoinside.load(8) # defaults to net48
rhinoinside.load(8, 'net48')
rhinoinside.load(8, 'net7.0')
rhinoinside.load(8, 'net8.0')
rhinoinside.load(r"C:\Program Files\Rhino 8\System") # defaults to net48
rhinoinside.load(r"C:\Program Files\Rhino 8\System", 'net48')
rhinoinside.load(r"C:\Program Files\Rhino 8\System", 'net7.0')
rhinoinside.load(r"C:\Program Files\Rhino 8\System", 'net8.0')

# Loading Rhino 9
rhinoinside.load(9) # defaults to net48
rhinoinside.load(9, 'net48')
rhinoinside.load(9, 'net9.0')
rhinoinside.load(r"C:\Program Files\Rhino 9 WIP\System") # defaults to net48
rhinoinside.load(r"C:\Program Files\Rhino 9 WIP\System", 'net48')
rhinoinside.load(r"C:\Program Files\Rhino 9 WIP\System", 'net9.0')

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rhinoinside-0.8.1.tar.gz (6.6 kB view details)

Uploaded Source

Built Distribution

rhinoinside-0.8.1-py3-none-any.whl (7.1 kB view details)

Uploaded Python 3

File details

Details for the file rhinoinside-0.8.1.tar.gz.

File metadata

  • Download URL: rhinoinside-0.8.1.tar.gz
  • Upload date:
  • Size: 6.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for rhinoinside-0.8.1.tar.gz
Algorithm Hash digest
SHA256 f9591d16c42b348167e3f0a8aa4336131644dd8cbae97b403312efe730f7804b
MD5 f06eeff250694db0fbac8dc45eb01dab
BLAKE2b-256 baaacc2710c0df83780cdcbbb87ffb4ee1d8cf2d49d1cdcb31352f738b74ba6d

See more details on using hashes here.

File details

Details for the file rhinoinside-0.8.1-py3-none-any.whl.

File metadata

  • Download URL: rhinoinside-0.8.1-py3-none-any.whl
  • Upload date:
  • Size: 7.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for rhinoinside-0.8.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b5186290b31637cd70e5a53b1286ed4f0030d4066882512be43f031dd38b7263
MD5 5149233d623fbd0d6670be04c5739061
BLAKE2b-256 2de485bfe3286614f434de8070dfca3df19aec08e83ff29cf71dd7ec1d9b4562

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page