----------
2;0
0
d
1
e
2
f
Path Mapper have a very interesting behavior, sometimes speed up things really easy.
(I've used the -1 to make paths start from 0 instead than from 1, with an input tree with 0 length branches or minimum branches length = 2 you will need to edit that)
:D
…
cells was determined by a network of tubules that he termed the cytoskeleton
(the name comes from Cyto- meaning cell or hollow vessel)
This is another wireframe thickening tool, intended for 3d printing use.
In contrast to exoskeleton (which works on general line networks), this works exclusively on lines which form the edges of meshes. The additional connectivity information present in this case makes it possible to produce an output with all quads, and moreover, a quad mesh with all even valence vertices.
Because it works on a Plankton mesh, the input can be made of ngons. We can also input a triangular mesh, apply the dual operation, and then thicken the edges of the resulting polygon mesh. This works well in combination with the remeshing script I posted here, for getting approximately equal edge lengths. This can be used to quickly turn any closed mesh into a lightweight hexagonal (mostly - with a few pentagons and heptagons for curvature) frame structure.
The even valence quad mesh property of the resulting thickened mesh means we can also use the mesh direction-sorting and directional-subdivision tools from Kangaroo (described here).
When combined with Weaverbird's Catmull-Clark subdivision, this allows us to smooth the mesh, while also having control over how much 'webbing' occurs at the nodes:
from left to right we see:
2 levels of Catmull-Clark with no directional subdivision
1 level of directional subD, then 2 Catmull-Clark
2 levels of directional subD, then 2 Catmull-Clark
One could even combine the resulting surfaces with all sorts of relaxation, or developable strip unrolling...
The code is there for you to read, so feel free to experiment and make adjustments to it. Hopefully it is fairly self explanatory.
Please feel free to ask any questions or suggest improvements, or just show off anything you create using this.
and yes - because the input and output are both meshes, you can apply it recursively!
This script references version 0.3.0 of Plankton, which you can download here:
https://github.com/Dan-Piker/Plankton/releases/tag/v0.3.0
…
j
1
c
e
h
k
2
f
-------------------------------------------------------------------------------------------------
To these...
0;0
0;1
0
a
i
------------------------------------------------------------
0;0
0;1
0;2
0
b
g
j
1
c
h
k
------------------------------------------------------------
0;0
0
d
1
e
2
f
------------------------------------------------------------
Thanx……
out of the practice walls.
Anyway get a hint: Hard top-bottom clustering is used (process is STOPPED to the fist level of clustering for clarity: meaning flat clustering):
Cubes are abstarct (spaces, say: "rooms") centroids:
Then clusters are made; Prox K-Means is used here (other methods also available). Cyans are the abstract representation of the flat clustering (for clarity). The decision upon the number of clusters is quite complex and is based on criteria that are not used here (adjacency matrices et all):
Then this:
And finally that:
Obviously the real thing works recursively (kinda like a fractal algo) on the clusters and stops if the predefined number of nodes is reached (say 2 or 3). Then the "flat" red connector shown connects actually (bottom to top) child to child AND child to parent clusters etc etc.
BTW: GH has a component (called quadTree) that - I guess - works "kinda" like a K-Means clustering algo but the fact that GH is a-cyclic by nature ... means that you should use Anemone - if the above are attempted via the component way (not my way anyway).
more soon
…
Angeles, which has 12% of the year made comfortable, and Shiraz, Iran, which also has 12% comfortable (assuming default parameters).
Jerusalem also makes sense to me. There is only a maximum possible 9% of the year that is inside the polygon (you'll see this if you set the timeConstant to a very high number). The default strategyPar makes 6% of these hours comfortable and 3% without cool enough temperatures in the previous hours. This seems reasonable to me.
I could be convinced to change the default time constant to 12 hours (instead of 8) as I know that 12 is the default of climate consultant but that seemed really idealized in my opinion. You'll need really high exposed mass and insulation without much internal heat gain to make conditions stable for more than 8 hours in my opinion.
As for the solarHeatCapacity, I get changes when I drop it down to 10 W/m2 or boost it up to 100 W/m2. It's definitely a parameter that operates on an "order of magnitude" scale and little tweaks to it won't change it too much. You can think of this number as representative of a lot of other physical properties: most notably the depth of the space being passively heated and the thermal mass of that space's materials that participate in heat exchange over the time constant. Climate consultant uses a default assumption of 30 W/m2 but, from my calculations, this is likely assuming a space that has a facade to floor area ratio that is greater than 1. If we say that we need to raise the temperature of 10 cm of an exposed concrete floor for passive heating purposes, and we have a facade-to-floor area ratio of 1:
Required solar flux = ((1 facade-to-floor ratio) x (0.1 m3 of concrete) x (2400 kg/m3 concrete density) x (880 J/kg-K concrete specific heat capacity)) / 3600 seconds/hour
This lands you with a required solar flux of 58 W, which is almost twice the 30 W climate consultant default. While me might say that not all 10 cm of concrete participates over the course of a default 8-hour time constant (most of the action is probably within the first 5 cm), we also have to account for things like transmittance of solar though the window, which, for triple pane, is probably only half of the incident solar. So 50 W seemed to be a more reasonable rule of thumb from my perspective, essentially assuming a facade-to-floor ratio of roughly 1 with 5 cm of concrete participating in an 8 hour heat exchange and a little more than half of solar heat getting through a fully glazed window.
Let me know if that makes sense or if you have any suggestions,
-Chris…
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
hit Commit.
I'm wondering how hard it would be to have an edit box which shows the
number the user could click inside of then type in a new number, then
hit enter. :)
2) How would I go about using one line from a table and assign each
field to a variable? Then, move a slider or something and use the values
from the next row?
background: I'm recreating elbows, Tees, and other fittings using
paramatric scripts, then baking and exporting them. Here's one source
table, http://www.wardfittings.com/Assets/PDFs/0902CatalogColorOld.pdf
page 5, the uniform elbows.
Current Setup: the attached ghx file. Create a point at 0,5,0 in a blank
document with units set to inches, then assign that point to the top
left 'Center Pnt' in the ghx file.
Current workflow:
a) Modify variables A, B, H, and Nominal Dia to match one line from the
table in the linked PDF file, page 5, table of regular elbows.
b) Select the 'Nodes' and 'Surfaces' with a drag box
c) Click 'Bake'
d) Switch to Rhino window, do the 'sellast' command.
e) Drag baked objects along Y axis so the center point is at 0,0,0
f) Run 'Join'
g) Run 'Cap'
h) set the 'node' points to a layer called 'nodes'
i) set the surface to a layer called 'fit-3d'.
j) select the surfaces and nodes
k) export selected
This elbow that I'm doing only has 12 rows, so doing it the above method
doesn't take THAT long. I'm also going to be doing a couple with larger
tables like the Tee on page 8, and in other spec files. As you can
imagine, entering in EACH value into a slider is a bit tedious.
I'd love to take the pdf table, run it through an OCR program to convert
to excel, modify the headers so the ghx script knows what they are, then
paste it into grasshopper, or save it and have grasshopper read it, and
I be able to move a slider or something to to select one line at a time.
Has anyone done something similar? ie: assigned one row in a table to a
predefined set of variables, each variable coming from one field in the row?
Thanks for taking the time to read this message. :)
I'm making a rhino script to do steps d-k, so that part will be much faster.
-Suthern…
, one is office and the other one is hotel for example.
- a list will control the points height
- to each of this point I am attaching a plane
- this plane will intersect the skin of the tower
- from this intersection I am try to take out the floor plate (as Curve) and the area ( as Data)
I think I've got most of the script. but I have some error that I can't figure it out.
Please if you have time can you look to this code?
thank you very much
Private Sub RunScript(ByVal skin As Brep, ByVal f1 As Integer, ByVal DELTAh1 As Double, ByVal Lobby1h As Double, ByVal f2 As Object, ByVal DELTAh2 As Object, ByVal Lobby2h As Object, ByRef A As Object, ByRef C As Object) 'Declare the list of Point on which attach the planes for intersections Dim p As New List(Of Point3d) 'first sector office Dim q As New List(Of Point3d) ' second sector hotel Dim floorPlate As New List(Of Curve) 'Declare a list for storing the curve
'for loop condition statement Dim i As Integer ' for the office Dim j As Integer ' for the hotel For i = Lobby1h To f1 + Lobby1h For j = f1 + Lobby1h + Lobby2h To f2 + (f1 + Lobby1h + Lobby2h)
p.Add(New Point3d(0, 0, i * DELTAh1)) ' points
Dim pl As New Plane(New Point3d(0, 0, i * DELTAh1), Vector3d.ZAxis) 'Planes Dim iCurves As curve() 'temporary store the curves Dim not_used_pt As Point3d() 'points needed only for the Intersect function
Intersect.Intersection.BrepPlane(skin, pl, 0.1d, iCurves, not_used_pt) floorPlate.Add(iCurves(0)) 'if you assume only once curve for each intersection
Next Next
Dim Areas As New list (Of Double) 'I will try to have a summ of all te areas 'Dim Areatot As Double
Dim k As Integer ' for loop to iterate the floorplates For K = 0 To floorPlate.Count - 1 Areas = AreaMassProperties.Compute(floorPlate)
Next
A = Areas.Area C = floorPlate
End Sub …
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.
--
David Rutten
david@mcneel.com
Poprad, Slovakia…