Grasshopper

algorithmic modeling for Rhino

Hi everyone!

So i'm working with some curves and i wan't to merge sets of curves together, but in order for this to work, the data paths must be identical (i think anyways).


But in the case shown in the screenshot, the only thing seperating the sets of curves are the number of zeroes before and after the actual index. The top set of curves have 4 zeroes after the index, and the bottom set of curves only have 3.

The datamapper shown in the screenshot is used for the top set of curves, i have another one for the bottom sets of curves: {0;0;0;0;0;0;A;*;*;*}
This one has only three wildcards.

Is it possible to remove varying number of zeroes using the mapper?
Or do you perhaps have another idea?

Thanks!
Thomas

Views: 652

Replies to This Discussion

Hi Thomas,

Try the simplify tree component:

Thanks.

But it only removes the zeroes infront of the index. Also the ability not only to select a certain number of path indices fx. {0;0;0} but instead {0(3)} or something similar would be nice, do anyone know of such a feature?

/Thomas

But here all your paths have equal amounts of zeroes after the index?
It would still work if they didn't have the same number of 0s.
You mean adding several paths to the mapper?
Attachments:

No, I wouldn't have attached so many components after the mapper if that was my idea. I am using the mapper only to attach zeros after the numbers in my path... just so as to repeat your case.

What I am doing here is literally destroying the structure of a list (flatten), and then rebuilding to my own custom format. The series component is very useful for that. Try the solution with your definition and see if it works.
I mean several paths yes, but without having to specify each path length... just saying that all paths with * number of zeroes infront of the index and * number of zeroes after the path.
I am not manually specifying the length of each path, I use list length for that. I don't know of a way you can do the same without using list length if that's what you asked.
In the screenshot you posted, there are 5 zeroes behind the index in each of your paths. My problem is that i have several sets of paths i want to merge using the index as the number on which to merge the paths.

Structure one (paths = 2)
{1;0;0;0;0}(N=10)
{2;0;0;0;0}(N=10)

Structure two (paths = 2)
{1;0;0;0}(N=10)
{2;0;0;0}(N=10)

If i merge the two lists i don't get a structure with 2 paths:
Structure result af merging (2 paths)
{1}(N=20)
{2}(N=20)

as i had expected, but instead a structure with 4 paths because of the difference in amount of zeroes:
Structure result af merging (4 paths)
{1;0;0;0;0}(N=10)
{2;0;0;0;0}(N=10)
{1;0;0;0}(N=10)
{2;0;0;0}(N=10)

The amount of zeroes changes all the time when working on the definition, so what im asking is if there some way to adress paths with * number of zeroes behind.
Hey Thomas,

The Replace Branches component will definitely do what you're after with some proper pre-processing, but I've been in search of a cleaner way to do it...

It seems the new path mapper won't help.

http://www.grasshopper3d.com/forum/topics/appending-to-a-tree?page=...

-taz

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service