Grasshopper

algorithmic modeling for Rhino

Hello all,

I have a component that plays with a geometry made of lines. at the moment when the iteration are done the component draws the final geometry to rhino viewport. is it possible to show the updated design after each iteration in the viewport? without breaking the loop of course.

thanks in advance

Roey

Views: 413

Attachments:

Replies to This Discussion

Hmm ... it's the right time for the Paris Hilton (results always in Pink) collection of demos.

See attached.

BTW: I'll modify yours soon.

nothing attached...

Indeed ... for some reason it's impossible to attach anything.

I'll try later

2nd time lucky? (this IS nerve breaking to the max, wonder what's happening)

Attachments:

Also get this ("abstract") stuff

Attachments:

i don't understand how does this answer my question

Hi Roey

I will try to answer your question in general terms, so that you can get further with the code on your own.

If you are willing to stay as much as possible within Grasshopper SDK conventions, you will have to save the state of the loop at a certain point and do the next moves independently in a new iteration.

Ideally, this would suffice:

- add a number of fields that store the state of the loop
- add a counter field that starts at 0

When the component is called the first time (counter == 0), then fill the fields with data coming from the inputs. 

- add a reset toggle (Boolean) to reset the counter to 0.
- use the stored data from the fields each time you update the solution.

You could also do a number of sub-iterations per update.


Alternatively (option 2), you could try to request a view redraw from within the component SolveInstance(). This will create an even tighter coupling between viewport redraw and solution, and might work less efficiently as you are requesting to redraw the screen while computing your solution, but I'd like to mention it as a "cheaper" alternative.

I hope this helps,

Giulio
--
Giulio Piacentino
for Robert McNeel & Associates
giulio@mcneel.com

Attachments:

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service