Grasshopper

algorithmic modeling for Rhino

Masking and Adding Expression to Parameter Components

Can someone please explain the string syntax when using a Mask expression for a path compare component in grasshopper? Also, what is the sytax when adding an expression as an argument to a parameter component such as a point parameter?

 

thanks

 

Views: 5167

Attachments:

Replies to This Discussion

[in passing]

Regular expressions are strictly textual; they describe a set of strings which a finite state automaton will accept. The basic idea came from Bell Labs. The original set of automata described by regexs had no backtrack and no memory. Later versions included backtrack. I suspect that Perl regexs are in fact Turing-complete, and can in principle implement any program. (Wikipedia, it turns out, covers this ground fairly well.)

In any event, you wanted a different sort of pattern matching. Now, I need to figure it out.

is there any way for me to make a series of series and pass that to a mask...

i have a tree with 89 main branches

i want to group them into sets of 3 [88,54,20],[87,53,19],...etc

 

i've been trying to define masks dynamically with series, but can't manage to get decent results unless the tree is basically one dimentional...

 

so i think it would be great if the compare mask could take an input of a list or a string, which i could then place into the mask:

 

like if a pass a list of 3 numbers into M on the compare i could make an expression for the M :

{0;M;*} ... and since i passed in [88,54,20] to M it would get internally parsed to:

{0;[88,54,20];*}

 

are there general string manipulation tools that I could use to do that stuff? or could i manage to create a mask in VB script somehow that i could pass in to the compare?

 

cheers,

gotjosh

http://www.grasshopper3d.com/profiles/blogs/series-branch-selector

 

answered my own question... but maybe someone knows a better way?

David,

It's been a while since this was updated. I couldn't find anyone asking this question but if you don't mind refreshing this post it would be great. I noticed that most of the masks described in here would not work with the latest GH. For example to get a range you used an example like this: {0;[0-10];0} while now it would have to be this: {0;(0~10);0} which is quite different. I honestly just kept trying different things until it worked but it would be nice to have a good set of working masks available for the latest GH. 

Thank you! 

The tilde is actually a shortcut, officially it's "0 to 10", the parentheses aren't needed either.

This FAQ post describes path notation: http://www.grasshopper3d.com/forum/topics/datatree-selection-rules

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service