Grasshopper

algorithmic modeling for Rhino

Hi All,

Does anyone have experience with recursion? I'm trying to implement a simple procedure in Csharp that recursively fragments a mesh.

A Tree datastructure is used because nested lists returned errors. However, when I feed a data stream back to itself, it returns : 

1. Recursive data stream found, this component depends on itself

Might anyone have advice on this? Are datatrees the way to go? Is it possible to do this in a single Csharp component? The purpose is this exercise is pure curiosity: I want to learn how to implement recursion in Csharp.

Attached is a clean file with a "hacked" version that works and the broken component...

Recursion - clean

Thanks in advance for any pointers.

cheers,

Lenn! 

Views: 805

Attachments:

Replies to This Discussion

C# is the perfect vehicle for recursion, Rather than trying to output something then input the same thing again you want to create your manipulation within a loop. Loops are how you would code recursive mesh manipulations like smoothing, minimal surfaces, or in your case fragmentation.

To answer your question directly, datatrees are not the way to go when dealing with meshes. Meshes are very good at keeping track of their properties like faces and vertices but instead of me going on and on why don't you check out my attached file and tell me if I'm on the right track...

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