Grasshopper

algorithmic modeling for Rhino

David,

I have produced a custom component in visual studio (project and code enclosed) that I would like to visualize with display pipeline. This code clearly contains errors, your help in developing the correct display logic is appreciated.

I have noted the code where I can but am also including a screen snap of the cropping and visibility errors.

Sincere thanks!

Views: 1154

Attachments:

Replies to This Discussion

David recently explained the problem here: http://www.grasshopper3d.com/forum/topics/draw-order-of-multiple-cu...

The objects should be drawn at the same time.

I'll look into these tomorrow (unless it's a really nice day, in which case I'll go cycling)...

David,

Many thanks and I'm with you on the cycling too. It's the best time of year for it.

There's a number of things to keep in mind when writing display code.

  • Grasshopper already has a mechanism set up for drawing previews, you do not have to handle Rhino display pipeline events from scratch.
  • When you're adding event handlers (which in this case you need not do) always remember to remove them again as well when their time is up.
  • Grasshopper components have a Preview On/Off mechanism already, if you really want an input that sets the preview, I recommend setting THAT property rather than keeping a secondary class level bool around. I kept the bool in my example code though.
  • The methods that are called to draw previews are called a lot, and they have to be fast. You do not want to do any computations in these methods of you can at all avoid it. Thus extracting brep edge curves or meshing breps is a bad idea. Do it once and cache the results.

Attachments:

David,

I will take a good look a this and be in touch if I have any further questions - but thank you very much for taking the time.

On a somewhat but not exactly related topic, in the class submitted I placed the previously required author methods. I have been having some trouble with them as noted here. I'm just curious, have these standards been abandoned or are they still working? I noted them in the submitted class file but am happy to provide them again if needed -- just thought I should check with you.

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service