Can someone please direct or tell me the differences between these different data management systems... I understand the basic concept of the branch data, but don't really understand how to use the sets and strings... please help... Thanks
Lists. A List is an ordered (but not necessarily sorted) collection of data. Lists may contain zero elements, a single element, or (at most) 2,147,483,647 elements. Furthermore, the same element can occur more than once in the same list, and different elements with identical values can occur more than once. Also, a list may contain lack of elements, referred to as "nulls".
Sets. Strictly speaking a Set is a mathematical construct which adheres to a strict collection of rules and limitations. Basically, a Set is the same as a List, with the exception that it cannot contain the same element more than once, or indeed two or more different elements with the same values. You see, in mathematics there is no difference between a value and an instance of that value, they are the same thing. In programming however it is possible to store the number 7 in more than one spot in the RAM. Grasshopper does not enforce this rule very strongly though, you can use a lot of Set components on lists that have multiple occurrences of the same value. The big difference between Lists and Sets in Grasshopper is that Sets are only defined for simple data types that have trivial equality comparisons. Basically: booleans, integers, numbers, complex numbers, strings, points, vectors, colours and intervals. Lists can contain all kinds of data.
Strings. Strings are text. There's nothing more to it. I don't know why early programmers chose to call them strings, but I suppose it's a better description of the memory representation of them. Strings are essentially sequences of individual characters.
Trees. Trees are the way all data is stored in Grasshopper. Even when you only have a single item, it will still be stored in a tree. A tree is a sorted collection of lists, where each list is identified by a path. A specific path can only occur once in a tree, when you merge two trees together, lists with identical paths are appended to each other. Trees are an attempt to losslessly represent not just the data itself, but also the history of that data. Imagine you have 4 curves {A,B,C,D} and you divide each into 3 points {X,Y,Z}. Then, for each of those points you create a new line segment {X',Y',Z'} and then divide each of those line segments again into 5 points each {K,L,M,N,O}. The way data is stored in trees, it should be possible to figure out whether a point M belongs to X' or to Z', and whether that X' or Z' came from A, B, C or D. This is why paths are often quite long after a while, because they encode a lot of history.
Paths. A Path is nothing more than a list of integers. It's denoted using curly brackets and semi-colons: {A;B;...;Z}. A Path should never be empty {} or have negative integers {0;-1}, but it is certainly possible to create a path like this and it probably won't even crash Grasshopper. Paths are 'grown' by components that (potentially) create more than one output value for a single input value. For example Divide Curve. It creates N points for every single input curve. In cases like this a new integer is appended to the end of the path.
In the next release the Path logic in Grasshopper is somewhat different. I fixed a number of obscure bugs (hopefully without introducing new fresh bugs) and special cased certain operations to somewhat reduce the speed at which paths grow. This may well break files that rely on a specific tree layout, but I hope the temporary sacrifice will be worth the long-term benefits.
I'm pretty new to Grasshopper and i'm using it for a unit of my Masters.
The problem is:
I have 2 sets of curve(polygon) data. Set 1 is small building outlines. Set 2 is the plots of land which the buildings sit. There are over 2000 of these entries (Its a small village).
I am trying to figure out the way that grasshopper sorts lists using the sort list tool. I basically want to calculate the area of the buildings and the individual plot sizes and then calculate the percentage of plot surrounding the building (so basically the difference but in a percentage not m2). The basic maths of this is fine, what I cant get grasshopper to do is match the correct building with the correct plot from the the list of 2000 values!! Does anyone know how to do this?
The final stage of the process is to then extrude each plot according to the percentage calculated. This part is also fine. The problem currently is that grasshopper doesn't understand which value to match from each list.
The current algorithm looks like this:
I have tried just sorting the lists but it doesn't seem to be sorting them in the same order!
David Rutten
In the next release the Path logic in Grasshopper is somewhat different. I fixed a number of obscure bugs (hopefully without introducing new fresh bugs) and special cased certain operations to somewhat reduce the speed at which paths grow. This may well break files that rely on a specific tree layout, but I hope the temporary sacrifice will be worth the long-term benefits.
--
David Rutten
david@mcneel.com
Poprad, Slovakia
Jun 21, 2012
Jessica Hillam
Hi,
I'm pretty new to Grasshopper and i'm using it for a unit of my Masters.
The problem is:
I have 2 sets of curve(polygon) data. Set 1 is small building outlines. Set 2 is the plots of land which the buildings sit. There are over 2000 of these entries (Its a small village).
I am trying to figure out the way that grasshopper sorts lists using the sort list tool. I basically want to calculate the area of the buildings and the individual plot sizes and then calculate the percentage of plot surrounding the building (so basically the difference but in a percentage not m2). The basic maths of this is fine, what I cant get grasshopper to do is match the correct building with the correct plot from the the list of 2000 values!! Does anyone know how to do this?
The final stage of the process is to then extrude each plot according to the percentage calculated. This part is also fine. The problem currently is that grasshopper doesn't understand which value to match from each list.
The current algorithm looks like this:
I have tried just sorting the lists but it doesn't seem to be sorting them in the same order!
Any help with this would be greatly appreciated!
Thanks
J
Dec 19, 2014
Jessica Hillam
Hi both,
Thanks for the solutions, i just need to try and understand how they work now! Pretty new to Grasshopper so i'm not familiar with all the plugs.
Most appreciated, thanks!
Dec 24, 2014