Quantcast
Channel: Scripting - McNeel Forum
Viewing all articles
Browse latest Browse all 4125

Rhino python preview geometry methods?

$
0
0

When programming with Rhino python I find myself working without much visual connection. Sure the product of my script is some geometry that is added to the document in the end, but I wish that there was an easy way to preview geometry just like selecting a grasshopper component. I’ve been wanting to write a python library that would let you take a quick peek at Rhinocommon geometry while running your script, without writing it to the document.
It would have the following features:

  • Geometry would be drawn with display order priority over existing rhino geometry just like grasshopper. This would allow the user to see highlighted brep edges etc.
  • Ability to show geometry in the document after script is run.
  • Simple use of the library, one fuction to show any type of geometry.

A potential usage:

import geo_viewer
pt = Rhino.Geometry.Point3d(0,0,1)
geo_viewer.show(pt, show_after=True, color='red') ]
geo_viewer.hide(pt)
geo_viewer.clear()

I’ve been trying to write this library for my own use but am having issues with display conduits written in python(I’m on mac). Does anyone have ideas on how I could implement something like this? Maybe using NodeInCode to hijack the native grasshopper preview? I thought I would reach out on the forum in case anyone is already doing something similar or would want to help develop this?

From the DisplayConduit examples it looks like something like this would be possible using sticky to keep the geometry around after script is run etc.

One of the things that makes grasshopper a great tool is how easy it is to see what your working with in the viewport, I’d like to have that same benefit when working with python.

Best,
Tristan

7 posts - 3 participants

Read full topic


Viewing all articles
Browse latest Browse all 4125

Trending Articles