ng is deciding how and where to store your data. If you're writing textual code using any one of a huge number of programming languages there are a lot of different options, each with its own benefits and drawbacks. Sometimes you just need to store a single data point. At other times you may need a list of exactly one hundred data points. At other times still circumstances may demand a list of a variable number of data points.
In programming jargon, lists and arrays are typically used to store an ordered collection of data points, where each item is directly accessible. Bags and hash sets are examples of unordered data storage. These storage mechanisms do not have a concept of which data comes first and which next, but they are much better at searching the data set for specific values. Stacks and queues are ordered data structures where only the youngest or oldest data points are accessible respectively. These are popular structures for code designed to create and execute schedules. Linked lists are chains of consecutive data points, where each point knows only about its direct neighbours. As a result, it's a lot of work to find the one-millionth point in a linked list, but it's incredibly efficient to insert or remove points from the middle of the chain. Dictionaries store data in the form of key-value pairs, allowing one to index complicated data points using simple lookup codes.
The above is a just a small sampling of popular data storage mechanisms, there are many, many others. From multidimensional arrays to SQL databases. From readonly collections to concurrent k-dTrees. It takes a fair amount of knowledge and practice to be able to navigate this bewildering sea of options and pick the best suited storage mechanism for any particular problem. We did not wish to confront our users with this plethora of programmatic principles, and instead decided to offer only a single data storage mechanism.*
Data storage in Grasshopper
In order to see what mechanism would be optimal for Grasshopper, it is necessary to first list the different possible ways in which components may wish to access and store data, and also how families of data points flow through a Grasshopper network, often acquiring more complexity over time.
A lot of components operate on individual values and also output individual values as results. This is the simplest category, let's call it 1:1 (pronounced as "one to one", indicating a mapping from single inputs to single outputs). Two examples of 1:1 components are Subtraction and Construct Point. Subtraction takes two arguments on the left (A and B), and outputs the difference (A-B) to the right. Even when the component is called upon to calculate the difference between two collections of 12 million values each, at any one time it only cares about three values; A, B and the difference between the two. Similarly, Construct Point takes three separate numbers as input arguments and combines them to form a single xyz point.
Another common category of components create lists of data from single input values. We'll refer to these components as 1:N. Range and Divide Curve are oft used examples in this category. Range takes a single numeric domain and a single integer, but it outputs a list of numbers that divide the domain into the specified number of steps. Similarly, Divide Curve requires a single curve and a division count, but it outputs several lists of data, where the length of each list is a function of the division count.
The opposite behaviour also occurs. Common N:1 components are Polyline and Loft, both of which consume a list of points and curves respectively, yet output only a single curve or surface.
Lastly (in the list category), N:N components are also available. A fair number of components operate on lists of data and also output lists of data. Sort and Reverse List are examples of N:N components you will almost certainly encounter when using Grasshopper. It is true that N:N components mostly fall into the data management category, in the sense that they are mostly employed to change the way data is stored, rather than to create entirely new data, but they are common and important nonetheless.
A rare few components are even more complex than 1:N, N:1, or N:N, in that they are not content to operate on or output single lists of data points. The Divide Surface and Square Grid components want to output not just lists of points, but several lists of points, each of which represents a single row or column in a grid. We can refer to these components as 1:N' or N':1 or N:N' or ... depending on how the inputs and outputs are defined.
The above listing of data mapping categories encapsulate all components that ship with Grasshopper, though they do not necessarily minister to all imaginable mappings. However in the spirit of getting on with the software it was decided that a data structure that could handle individual values, lists of values, and lists of lists of values would solve at least 99% of the then existing problems and was thus considered to be a 'good thing'.
Data storage as the outcome of a process
If the problems of 1:N' mappings only occurred in those few components to do with grids, it would probably not warrant support for lists-of-lists in the core data structure. However, 1:N' or N:N' mappings can be the result of the concatenation of two or more 1:N components. Consider the following case: A collection of three polysurfaces (a box, a capped cylinder, and a triangular prism) is imported from Rhino into Grasshopper. The shapes are all exploded into their separate faces, resulting in 6 faces for the box, 3 for the cylinder, and 5 for the prism. Across each face, a collection of isocurves is drawn, resembling a hatching. Ultimately, each isocurve is divided into equally spaced points.
This is not an unreasonably elaborate case, but it already shows how shockingly quickly layers of complexity are introduced into the data as it flows from the left to the right side of the network.
It's no good ending up with a single huge list containing all the points. The data structure we use must be detailed enough to allow us to select from it any logical subset. This means that the ultimate data structure must contain a record of all the mappings that were applied from start to finish. It must be possible to select all the points that are associated with the second polysurface, but not the first or third. It must also be possible to select all points that are associated with the first face of each polysurface, but not any subsequent faces. Or a selection which includes only the fourth point of each division and no others.
The only way such selection sets can be defined, is if the data structure contains a record of the "history" of each data point. I.e. for every point we must be able to figure out which original shape it came from (the cube, the cylinder or the prism), which of the exploded faces it is associated with, which isocurve on that face was involved and the index of the point within the curve division family.
A flexible mechanism for variable history records.
The storage constraints mentioned so far (to wit, the requirement of storing individual values, lists of values, and lists of lists of values), combined with the relational constraints (to wit, the ability to measure the relatedness of various lists within the entire collection) lead us to Data Trees. The data structure we chose is certainly not the only imaginable solution to this problem, and due to its terse notation can appear fairly obtuse to the untrained eye. However since data trees only employ non-negative integers to identify both lists and items within lists, the structure is very amenable to simple arithmetic operations, which makes the structure very pliable from an algorithmic point of view.
A data tree is an ordered collection of lists. Each list is associated with a path, which serves as the identifier of that list. This means that two lists in the same tree cannot have the same path. A path is a collection of one or more non-negative integers. Path notation employs curly brackets and semi-colons as separators. The simplest path contains only the number zero and is written as: {0}. More complicated paths containing more elements are written as: {2;4;6}. Just as a path identifies a list within the tree, an index identifies a data point within a list. An index is always a single, non-negative integer. Indices are written inside square brackets and appended to path notation, in order to fully identify a single piece of data within an entire data tree: {2,4,6}[10].
Since both path elements and indices are zero-based (we start counting at zero, not one), there is a slight disconnect between the ordinality and the cardinality of numbers within data trees. The first element equals index 0, the second element can be found at index 1, the third element maps to index 2, and so on and so forth. This means that the "Eleventh point of the seventh isocurve of the fifth face of the third polysurface" will be written as {2;4;6}[10]. The first path element corresponds with the oldest mapping that occurred within the file, and each subsequent element represents a more recent operation. In this sense the path elements can be likened to taxonomic identifiers. The species {Animalia;Mammalia;Hominidea;Homo} and {Animalia;Mammalia;Hominidea;Pan} are more closely related to each other than to {Animalia;Mammalia; Cervidea;Rangifer}** because they share more codes at the start of their classification. Similarly, the paths {2;4;4} and {2;4;6} are more closely related to each other than they are to {2;3;5}.
The messy reality of data trees.
Although you may agree with me that in theory the data tree approach is solid, you may still get frustrated at the rate at which data trees grow more complex. Often Grasshopper will choose to add additional elements to the paths in a tree where none in fact is needed, resulting in paths that all share a lot of zeroes in certain places. For example a data tree might contain the paths:
{0;0;0;0;0}
{0;0;0;0;1}
{0;0;0;0;2}
{0;0;0;0;3}
{0;0;1;0;0}
{0;0;1;0;1}
{0;0;1;0;2}
{0;0;1;0;3}
instead of the far more economical:
{0;0}
{0;1}
{0;2}
{0;3}
{1;0}
{1;1}
{1;2}
{1;3}
The reason all these zeroes are added is because we value consistency over economics. It doesn't matter whether a component actually outputs more than one list, if the component belongs to the 1:N, 1:N', or N:N' groups, it will always add an extra integer to all the paths, because some day in the future, when the inputs change, it may need that extra integer to keep its lists untangled. We feel it's bad behaviour for the topology of a data tree to be subject to the topical values in that tree. Any component which relies on a specific topology will no longer work when that topology changes, and that should happen as seldom as possible.
Conclusion
Although data trees can be difficult to work with and probably cause more confusion than any other part of Grasshopper, they seem to work well in the majority of cases and we haven't been able to come up with a better solution. That's not to say we never will, but data trees are here to stay for the foreseeable future.
* This is not something we hit on immediately. The very first versions of Grasshopper only allowed for the storage of a single data point per parameter, making operations like [Loft] or [Divide Curve] impossible. Later versions allowed for a single list per parameter, which was still insufficient for all but the most simple algorithms.
** I'm skipping a lot of taxonometric classifications here to keep it simple.…
Added by David Rutten at 2:22pm on January 20, 2015
he time to work with it.
the project is about facade strips which turns along height. the top angle is
parallel to the facade and the bottom is max. 90 degrees twisted, but the strips
should turn diffrently to achieve more dinamic look.
first i have tried to achieve this by calculating distance between the rotation angle from points of the grid and a single point.
then i have tried to ad some more effecting points and used the distance to the divided surface (the circles are just to control the area of effection):
i manually lofted it.
the result is a bit annoying becouse the points that effect the angle are always visible:
i have triend to solve this by drawing a line and divided it to recieve points along the bottom of the geometry. the result is not working properly:
Anyway,
there must be a better/smoother way to achieve this. i would like to effect the twist of the surfaces by distance to a spline, but im just lost. can you help me please?
the problems im encountering:
0- distance spline to grid to effect the angle
1- list of x/y coordinates and angle of rotation for each point of the grid
2- export points to excel
3- lofting lines in one direction only (x1, x2, x3...)
4- reduce the list data to 2 decimal (0,00)
5- maybe angle from radian to degrees
thx…
each face of the mesh, but apparentely rhinoscriptsyntax.MeshVertexColors doesn't give me an output I can read and use , and same goes when I try to use rhinoscriptsyntax.ColorHLSToRGB command
look:
import rhinoscriptsyntax as rs
rs.Command("_selmesh")
rs.Command("unweld 0")
rs.UnselectAllObjects
rs.AddLayer("MainMesh")#'pick Mesh which is unwelded at 0strObject = rs.GetObject("Select mesh", 32)#'store mesh in base layerrs.ObjectLayer(strObject,"MainMesh")#' get the face vertices of the mesharrFaces = rs.MeshFaces(strObject, True)#'get the vertex colors of the meshcolor = rs.MeshVertexColors(strObject)
i = 0
arrFace = []arrHLS = []arrFaceVertices2 = []
while i <= len(arrFaces)-1:''''''arrFace.append(arrFaces[i]) ''''''arrFace.append(arrFaces[i+1]) ''''''arrFace.append(arrFaces[i+2]) ''''''arrFace.append(arrFaces[i+3]) ''''''arrHLS.append(rs.ColorRGBToHLS(color[i])) ''''''print(color[i]) ''''''print arrHLS
'''''' i = i + 4
''''''arrFace = [] ''''''arrHLS = [] ''''''arrFaceVertices2 = []
############
The result I get is :
Color [A=255, R=55, G=55, B=55][<Rhino.Display.ColorHSL object at 0x00000000000001F7 [Rhino.Display.ColorHSL]>]Color [A=255, R=55, G=55, B=55][<Rhino.Display.ColorHSL object at 0x00000000000001F8 [Rhino.Display.ColorHSL]>]Color [A=255, R=55, G=55, B=55][<Rhino.Display.ColorHSL object at 0x00000000000001F9 [Rhino.Display.ColorHSL]>]Color [A=255, R=59, G=59, B=59][<Rhino.Display.ColorHSL object at 0x00000000000001FA [Rhino.Display.ColorHSL]>]Color [A=255, R=55, G=55, B=55][<Rhino.Display.ColorHSL object at 0x00000000000001FB [Rhino.Display.ColorHSL]>]
But if I try to get color[i][0] I get an error, how can I access to the numbers RGB or the HLS one as numbers?
Thanks a lot!
V.…
n be moved to the appropriate place. The files are sensitive, but I can email them directly to you if you like.
1/ Contouring (and also Brep/Plane Intersection) generates non-closed curves from a closed brep (the screenshot actually shows a surface instead of a brep, but the same thing happens):
2/ Contour generates non-planar curves (one is also open, see below). This is very disturbing because it cannot be used to create a 'boundary surface'.
3/ Offset doesn't return all results. This seems like more of a rhinocommon problem. It always returns a valid result, but often not the one I want. Better would be to return all results and let me choose what I want.
4/ Fillet issues. See image below, the fillet component works fine up to a certain radius and then the one on the right disappears completely (presumably the radius is too large so it gives up). However, if I use the FilletAtParameter component, the fillet works at each of these points but it won't do all of the fillets at once (regardless of how I arrange the data tree). My work around at this point is to get it to fillet each of the sharp bits separately and then RegionUnion all the curves together, which is incredibly slow.
5/ There is no ExtrudeTapered component, so I wrote a quick VB.Net component to expose this functionality. Firstly: I cannot for the life of me figure out what the "Base Point" input does. This seems to have no impact on the result and the documentation is missing. Secondly: giving it a non-unitized vector does very strange things to the result.
Thank you for your help!
Steven
…
or Ladybug and Honeybee:
1. Our recent presentation at IBPSA-NYC is now available online. We do an overview of what Ladybug and Honeybee capabilities with a short live demo:
part 1: https://vimeo.com/107501953 - part 2: https://vimeo.com/107502226
2. Chris recorded a great set of tutorials together for "Getting Started with Ladybug" that walks you through several components in Ladybug: (https://www.youtube.com/playlist?list=PLruLh1AdY-Sj_XGz3kzHUoWmpWDXNep1O)
3. He (Chris) also recorded another great set of videos for comfort tools that he is currently developing for Ladybug and Honeybee: (https://www.youtube.com/playlist?list=PLruLh1AdY-Sho45_D4BV1HKcIz7oVmZ8v)
4. With the help of Mohammad, we finally uploaded the videos from the workshop that I led at Penn few months ago which covers Daylighting with Honeybee: (https://www.youtube.com/playlist?list=PLkjfDmSc5OryXkWSt57ltJFU4qXD5ss1v)
5. Finally, Chris also started a series of videos on Energy Modeling with Honeybee that you can watch here: (https://www.youtube.com/playlist?list=PLruLh1AdY-SgW4uDtNSMLeiUmA8YXEHT_)
There are couple of stuff which are coming next, soon:
1. So Young is modifying the videos for the Ladybug workshop and once they are ready, we will upload them.
2. I will be capturing a number of videos for developers soon. We are so excited to see all the new developers joining the team and we understand the need to support you to get started. I hope these videos can help you to understand the development logic and get you started with the development.
OK. Now if you have access to Internet, which I supposed you do as you are reading this online, you have no excuse not to learn Ladybug and Honeybee. :)
Let us know your comments and suggestions.
Cheers, Mostapha…
use Google's API, especially if you'd like to achieve a great quantity of data without overloading Google's servers.
I used a way to request data without overloading Google's servers by using a tiling method. Obviously, this component respects the limit of 2500 requests per day.
This is how the component works:
1) set one point and its coordinates
2) generate surfaces by using isotrim component (Basically, each sub-surface is a request)
3) set the number of division of each surface and the resolution of Google static maps
4) run, move points and generate surfaces with surface from points
5) apply textures to the surfaces
In the image below another small example:
I was thinking that this should be useful for wind simulation with Butterfly, maybe.
Best
Antonello…
ack to .ghx?
This is in relation to a discussion I've been having with David Rutten & Scott Davidson about GH consuming memory in a relatively large GH definition (~. I think what I've learned from this is that one should limit the size of the GH file, or put some incremental stops in the definition to limit the length of calculations that it runs at once. Is this a valid conclusion?
The GH file we're talking about is 7Mb & the Rhino file is about 120Mb, but when working w/ the GH def. I try to only keep about 2 curves turned on.
Here's a summary of the discussion:
Hi Mike,thanks for sending it over. I've been fiddling with the file for about 10 minutes and it climbed from 1.7 GB to 1.9GB, but then I've been switching previews on which means more meshes get calculated so you'd expect a higher memory consumption. It is possible we're leaking memory, but if you're working for hours on end, memory fragmentation might also explain part of the increase. Basically, memory gets fragmented just like disks get fragmented after prolonged use, difference is that memory cannot be defragmented unless you restart the application and allow it to start with a clean slate. I'll try and find any leaks we may have missed in the past.Goodwill,David
──────────── David Rutten
On 09/03/2011 06:19, Mike Calvino wrote:
Thanks very much David for the quick response. I've attached the files zipped. I can't figure out what's doing it. After working in the file for awhile, the memory usage in the Windows Task Manager climbs . . . it's gotten to 1.57+Gb before I exited GH & Rhino5Wip & let it dissipate, then restart & work for awhile before it does it again. It probably takes like 4 or 5 hours before it gets that high. That's the highest it's gotten, & that only happened while I was working in a Rhino file that had all of the elements baked into it - turned off at least, but it still climbed to 1.57+Gb. It seems to climbs when you work in the file & move around in both the GH def. & the Rhino file. Like turn on a few of the Extr components at the right end of the "StandareRibExtuder" groups, you can watch the MemUsage go up, but when you turn them off, it does not go down. - goes up fast at this point. Maybe I need to figure out how to do the definition with fewer components, I'm sure that's part of it, but I must confess, I think I'm still early on in the learning curve.I really hope that this is not operator error on my part & I do apologize up front if it is. I have done a disk cleanup, I have tried excluding .3dm & .ghx files from my NOD32 antivirus, no change. I hope you can find something.Let me know if you have any trouble with the files.See if you find anything & please let me know . . . thanks!Cheers! --Mike CalvinoCalvino Architecture Studio, inc.www.calvinodesign.com
…
Introduction to Grasshopper Videos by David Rutten.
Wondering how to get started with Grasshopper? Look no further. Spend an some time with the creator of Grasshopper, David Rutten, to learn the
, Engineer and Researcher from France with broad programming experience. He is the author of the City in 3D Rhinoceros plugin for creation of buildings according to geojson file and with real elevation. Guillaume already created a new component: "Address to Location". It enables getting latitude and longitude values for the given address:
2) Support of Bathymetry data: automatic creation of underwater (sea/river/lake floor) terrain. This feature is now available through new source_ input of the "Terrain generator" component. Here is an example of terrain of the Loihi underwater volcano, of the coast of Hawaii:
3) A new terrain source has been added: ALOS World 3D 30m. ALOS is a Japanese global terrain data. Gismo "Terrain Generator" component has been using SRTM 30m terrain data, which hasn't been global and was limited to -56 to +60 latitude range. With this addition, it is possible to switch between SRTM and ALOS World 3D 30m models with the use of source_ input.
4) 9 new components have been added:
"Address To Location" - finds latitude and longitude coordinates for the given address.
"XY To Location" - finds latitude and longitude coordinates for the given Rhino XY coordinates. "Location To XY" - vice versa from the previous component: finds Rhino XY coordinates for the given latitude longitude coordinates. "Z To Elevation" - finds elevation for particular Rhino point. "Rhino text to number" - convert numeric text from Rhino to grasshopper number. "Rhino unit to meters" - convert Rhino units to meters. "Deconstruct location" - deconstructs .epw location. "New Component Example" - this component explains how to make a new Gismo component, in case you are interested to make one. We welcome new developers, even if you contribute a single component to Gismo! "Support Gismo" - gives some suggestions on how to make Gismo better, how to improve it and support it.
5) Ladybug "Terrain Generator" component now supports all units, not only Meters. So any Gismo example file which uses this component, can now use Rhino units other than Meters as well. Thank you Antonello Di Nunzio for making this happen!!
Basically just forget about this yellow panel:
This panel is not valid anymore, so just use any unit you want.
6) A number of bugs have been fixed, reported in topics for the last couple of weeks. We would like to thank members in the community who invested their time in testing, finding these bugs and reporting them: Rafat Ahmed, Peter Zatko, Mathieu Venot, Abraham Yezioro, Rafael Alonso. Thank you guys!!! Apologies if we forgot to mention someone.
The version 0.0.2 can be downloaded from here:
https://github.com/stgeorges/gismo/zipball/master
And example files from here:
https://github.com/stgeorges/gismo/tree/master/examples
Any new suggestions, testing and bug reports are welcome!!…
Added by djordje to Gismo at 5:13pm on March 1, 2017
) Course Fee: Professional EUR 825,- (+VAT), Student EUR 415,- (+VAT)
Led by plug-in developer and structural engineer Clemens Preisinger, along with Zeynep Aksoz and Matthew Tam from the expert Karamba3D team, this three-day workshop will focus on methods of setting up structural systems in the parametric environment of Grasshopper. The participants will be guided through the basics of analyzing and interpreting structural models, to optimization processes, and how to integrate Karamba3D into C# scripts.
This workshop is aimed towards beginner to intermediate users of Karamba3D. However, advanced users are also encouraged to apply. It is open to both professional and academic users. For beginner users of Rhino and Grasshopper, there will be an optional introductory course one day before the Karamba3D course.
Karamba3D 1is a parametric structural engineering tool which provides accurate analysis of spatial trusses, frames, and shells. Karamba3D is fully embedded in the parametric design environment of Grasshopper, a plug-in for the 3D modeling tool Rhinoceros. This makes it easy to combine parameterized geometric models, finite element calculations, and optimization algorithms like Galapagos.
Course Outline
Introduction and presentation of project examples
Optimization of cross sections of line-based and surface-based elements
Geometric optimization
Topological optimization
Structural performance informed form finding
Understanding analysis algorithms embedded in Karamba3D and visualizing results
Complex workflow processes in Rhino, Grasshopper, and Karamba3D
Places are limited to a maximum of 10 participants with limited educational places. A minimum of 4 participants is required for the workshop to take place. The workshop will be canceled if this quota is not filled by October 28. The workshop will be taught in English.
Course Requirements
Basic Rhino and Grasshopper knowledge is recommended. An introductory course is offered.
No knowledge of Karamba3D is needed. Participants should bring their own laptops with Grasshopper and either Rhino 5 or Rhino 6 installed. You can download a 90-day trial version of Rhino. Karamba3D ½ year licenses for non-commercial use will be provided to all participants.
Please register here……
Added by Matthew Tam at 6:38am on September 13, 2019