being driven by the wii nunchuck... But, here's my issue. I tried it first by having the output from the listener be a 6-digit number... so, I'm using the (CInt(Val(StoredValue))) command and it's writing out 181130... and I can easily split it up selecting the Left(x,3) or Right(x,3)... I first rant that number through a Format("{0:000000}",x) so that even if one of the accx or accy numbers were a 2-digit number (so my overall number would only have 5-digits)... with this Format function... I'm always assured a 6-digit number. And this method works... except...
If the first group of numbers coming in only has 2-digits... So, lets say the accelerometer read out of the first one (accx) is 89. Let's say the accy read out is 119. So, when I run this through the Format function to make it have at least 6 digits, my number now reads 011989. So, if I were to take the first three numbers on the right, my read out would be 989... which is much higher than my expected (60-180 range that is really coming over the Serial Port)... So, I'm back to where I started... in that I need to figure out a better way to split up the data.
Which brings me to your method. I tried it as well... in fact, I added a comma in the serial readout, so the string coming out of the listener reads 89,119. So, I can use your trick to go look for a delimeter and then read to the left and right a certain number of digits... The problem I still have is that the data going into the function is a string, and thus even if I split the 3 digits to the right of the comma out (so, my output says 119)... it's still a string, and my number parameter is still red. In your picture above, was your original 181 130 a number or a string? My guess is that it was understood as a number, because your number parameters at the end are accepting the value. But, in my case... I'm still stuck with the inability to convert a string to a number... Does this make sense? And are their any other workarounds?…
Added by Andy Payne at 9:42am on September 3, 2009
s).
I don't know how the speed/efficiency will compare with other spatial tree structures, but for me the main appeal would be getting the surface triangulation from the same process as the neighbour queries.
I figured someone has probably tried this idea before - did some searching and sure enough, for granular simulations it has been used for detecting collisions in 'discrete element modelling', but not very widely as far as I can tell (and not the part about a changing triangulated surface from the tetrahedra). Some info on this here:
http://www.apprendre-en-ligne.net/auteur/roso/boston.pdf
and in more detail here:
http://infoscience.epfl.ch/record/32908/files/EPFL_TH2432.pdf
(see Fig 2.15)
and a similar approach can even be extended to collision detection between polygons, not just spheres
http://www.apprendre-en-ligne.net/auteur/roso/marseille.pdf
@Dan H
If I understand correctly, what you are suggesting is a little bit like what they use here for splitting the surface when handles get too thin, though in this case based on unflippable edges not aspect ratios:
http://research.microsoft.com/en-us/UM/people/yangliu/publication/cmc.pdf
(see figure 3)
However, this only works for splits, and won't help 2 blobs which start separate then need to merge.
Another possibility could be to do constant local connectivity updates together with occasional more expensive global checks for topology change by using some spatial tree to check proximity.
Similar to what is described here:
http://hal.inria.fr/docs/00/60/65/16/PDF/Freestyle.pdf (Fig. 6)
and implemented rather nicely here:
http://stephaneginier.com/…
Added by Daniel Piker at 3:19am on October 11, 2013
is Radius = (size+40)/(2*Pi), where "size" is the value to give, it's usually used in countries like Spain, Italy, Netherlands, Switzerland... The next release will have 6 ways (5 regional system + diameter) to give it the size in different regional systems with just two clicks, in fact, the rings of the next release are already developed, but will have to wait...
Knowing that:
ISO (International Organization for Standardization). mm of internal circunference. Austria, France, Germany, Belgium, Scandinavia...
radii = Size / (2 * Math.PI)
European Size. Spain, Italy, Netherlands, Switzerland...radii = (Size + 40) / (2 * Math.PI)
British Size. United Kingdom, Ireland, Australia, New Zealand, South Africa...radii = ((Size * 0.4) + 11.5) / 2
American Size. United States, Canada, Mexico...radii = ((Size * 0.83) + 11.54) / 2
Japanese Size. Japan, China, India, South America...radii = ((Size / 3) + 12.67) / 2
Diameter Size. Many goldsmiths anywhere.
radii = Size / 2
Source: http://www.18carat.co.uk/ringsizes.html
and since this release are UserObject componentes, you can remplace if you want the Size component with one new. For example, right clicking size_param, going to Expresion and setting x*pi-40, the size input will be the diameter of the resulting circle, if you give it a value of 14, the circle will have a radius of 7. Then save the userobject (File>Create User Object) and remove the other.
Or create a new one, since this component is just a rotated circle and a cylinder.
Hope this helps.…
ngle list is identified by a unique path. For example {0}, {0;0;0} or {0;3;0} are all different paths. When data form multiple sources is merged (as in the [V] input of your polyline component), then the various paths are also merged. Thus, the point in the first panel at path {0;0;0} will be put in the same list as the point in the third panel at {0;0;0} as well as the point in the fourth panel at {0;0;0}. Thus, the polyline component will create a polyline through those three points. The second panel contains data with a different path format (only two numbers) and these points will not be merged with anything else because their paths are unique. However a polyline through a single point cannot be made which is probably why the component is orange.
I cannot fix your file because you didn't upload it, but here's some general advice:
Don't put panels in between source and target components. Panels convert the data into text, and this text will then be converted back into whatever type is required on the right. Sometimes this works fine (for example with booleans or integers), sometimes it won't work at all (for example with curves, meshes or breps) and sometimes it will work poorly (for example with points and vectors). The reason it works poorly is because the panel rounds the coordinates to 6 decimal places because this makes for easier viewing. However when points are recreated from the text, the remaining 10 decimals are now lost.It's fine to use panels to inspect data, but inserting them in between source and target components is rarely a good idea.
If you have data that exists in multiple lists but you want to put it all into a single list, you should use a Flatten component.
If you have data in various lists that you want to merge into a single tree (tree = list of lists), but you want to keep all the lists separate, you can use the Entwine component.
You should flatten all your individual point lists, then use Entwine to put them all together and finally plug the result of Entwine into the Polyline V input.…
Added by David Rutten at 3:04pm on September 9, 2016
h tree is actually a number of curves in rhino. I am then refreancing those groups of curves [trees] into grasshopper so each tree [group of curves] is held in one crv compnent. this is where my problem starts. The end goal is to extract endpoints from branches in each tree, then add splines that go through those endpoints of each tree in order, i.e. point 0 - tree 0, point 0 - tree 1, point 0 - tree2, point 0 - tree 3 ......... My problem is that i cant seem to get the data structured in a way that each branch holds each tree or group of curves, my problem may be that i start with (x) lists of (y)curves in each list. corresponding to x curve components [each a tree] with y curvres in them [each a crv of respective tree in rhino] Now i say x lists with y curves becuase right now its set up 6 lists each with somewhere between 20 and 45 curves in each, but those both will be changing often through iterations. so my problem may not be changing the structure of the data but getting it structured the way i want from the begining. I cant see to pass each of those trees into a component and have it come out as x lists/branchs of y crvs each, i either get one branch with (x*y) curves in the list, so essentiall all curves in the model. or i get (x*y) branches each with 1 curve per branch, essentially creating a new branch for every single curve. I have been working with the path mapper to try and solve but no luck, like i said i think it may be somethign to do with how it is structured from the begining rather than changing it down the line. attached def and model for referance, any thoughts /ideas greatly appreciated, midcrit on wednesday and need to get this base def working so i can start pumping out iterations with added attraction and repulsion fields built into trees/points.…
the past 6 months).
You can download this release from the usual location. The internal version number for this release is 0.9.0068.
Fixes:
All expressions inside parameters now use 'x' as the variable instead of the nickname. Old files should be converted automatically.
GetDataTree method calls with mismatched parameter access would display the wrong error message, this is fixed.
Menu items on submenus that are disabled due to document states could not be triggered by shortcuts or buttons, this is fixed.
Lofting would fail with zero-length start and end profiles, this is fixed (they are now treated as points).
When lofting failed due to invalid profile curves, the error message was useless, this is fixed.
Under rare conditions null entries in persistent data would cause the Manage X Collection window to crash, this is fixed.
Mouse Leave events on the Expression Editor window would sometimes cause a crash due to null timers, this is fixed.
Offsetting curves would sometimes result in superfluous control points, this is fixed.
Trim Solid would fail if one of the trimming shapes did not intersect the base shape, this is fixed.
Solid Difference would fail if one of the trimming shapes did not intersect the base shape, this is fixed.
The annealing history curve in the Galapagos window would sometimes crash on repaint, this is fixed.
Having a (partially) transparent background colour for a Text Panel would crash the panel editor window, this is fixed.
The Evaluate component would crash when editing an expression with coincident variable names, this is fixed.
--
David Rutten
david@mcneel.com…
Added by David Rutten at 9:07am on January 26, 2014
frontare il tema della modellazione parametrica con Grasshopper. Questa plug-in di Rhino consente di progettare, confrontandosi con un contesto evolutivo, attraverso la comprensione e l'utilizzo di parametri e componenti che influenzano la rappresentazione e la rendono dinamica componendo algoritmi. Nel corso verranno introdotte le nozioni base di Grasshopper approfondendo le metodologie della progettazione parametrica e le tecniche di modellazione algoritmica per la generazione di forme complesse.Le informazioni teoriche saranno fornite in maniera accelerata ma organica e contestuale agli argomenti elencati. Per massimizzare i risultati, le lezioni saranno accompagnate da piccole esercitazioni pratiche.Argomenti trattati:- Introduzione alla progettazione parametrica: teoria, esempi, casi studio- Grasshopper: concetti base, logica algoritmica, interfaccia grafica- Nozioni fondamentali: componenti, connessioni, data flow- Funzioni matematiche e logiche, serie, gestione dei dati- Analisi e definizione di curve e superfici- Definizione di griglie e pattern complessi- Trasformazioni geometriche, paneling- Attrattori, image sampler- Data tree: gestione di dati complessiStrutturaIl corso ha una durata di 16 ore programmate nell'arco di 2 giornate con i seguenti orari: i giorni 28/07 e 29/07 dalle 10,00 alle 19,00 con pausa pranzo di un'ora.DestinatariIl corso è rivolto a tutti coloro che hanno buone conoscenze di Rhinoceros e vogliono affrontare i nuovi metodi di progettazione in maniera consapevole attraverso il linguaggio visual scripting proposto dal software Grasshopper.PrerequisitiPer affrontare il corso è richiesta una conoscenza di base del software Rhino attraverso esperienze teoriche e pratiche. I partecipanti dovranno venire muniti di proprio laptop e con software Rhinoceros 5 o Rhinocero 4 perfettamente funzionanti.AttestatoAlla fine del corso verrà rilasciata l’attestato di partecipazione ad un corso qualificato McNeel valido per l’ottenimento di crediti formativi universitari.LuogoLe lezioni si terranno presso lo studio il Pedone in Via Muggia 33, 00195 ROMA…
, 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
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