re is my problem... I need to arrange Boxes in the most efficient way within boundaries of object and follow the following constraints.
The Goal: To fit 125 boxes in the most efficient way inside the total area. Starting Variables:
(1) 40% of the Boxes need to be between 60 and 85MSQ. (2) 40% of the boxes need to be between 86 and 110MSQ.
(3) 20% of the boxes need to be between 111 and 125mSQ. The breakdown doesn’t have to be exact to give the script some flexibility. Meaning you can have 41% +39% +20% = 100%.
Constraints:
1. A total MAXIMUM area of approximately 1600M per layer.
2. A maximum of 8 layers for a total of 12,800M per layer. Optimization can make as little or as many as 8 layers vertical to accommodate all boxes. So if script can achieve with 3 levels great. If needed all 8 levels, that's fine too. However, pay attention to next constraint (#3).
3. Approximately 15% of that space on each layer is off limits. (internal area) (blue area in example script) and the shape of the boundary cannot be modified to accommodate box design resulting in jagged lines for the internal area.
4. All generated squares/rectangles must have at least 3m touching an outside border (The Green lines).
5. All boxes must also be touching minimum 1M of border of the blue line.
6. If the boxes generated go outside the green boundary, they must be fillet to maintain the straight lines of the green boundaries.
7. Get as many of the boxes as possible a view towards the dots.
Could any one provide me a method or a way to start, if there are any useful links, please share with me. Thank you!
…
rection: there's no visible demand. Explanation: a lot of AEC oriented people (Smart Geo daydreamers) they think - potentially - about GH but they are rejecting it for more than obvious reasons: our job is 1% about the smart thing and 99% about the structured aspect of the smart (or stupid thing).
Back to that "hangar" : The primary role of this GH definition provided herein (and hopefully some future updates) is NOT to outline some academic solution (via some abstract collection of pipes/lines/points/surfaces) ...but to place in 3d space - properly structured - all the real-life (hmm, he he) bits that can compose the actual project. Of course if the bits could be parametrically driven assemblies ...well...you get the gist of the message.
All in all: I think that Engineers who are GH skeptics could see GH with a totally new perspective if, say, a collection of similar examples/test cases could be available for demo/evaluation/whatever > Ah! at last : this appears to be a real thing > what software did it? > say it again - Grass Components you said? > what sort of name is this? ... etc etc etc.
But since a similar development is quite expensive (and requires a team of several gurus), maybe this is rather a future potential task for the GH/Rhino people if they think that the AEC market segment could be beneficial for their products. Combine a similar capability with tools like yours and/or Evolute (planar quads are "a-la-mode" these days).
PS: forget trivial stuff > what about Stefanie? (plan B : better something than nothing)…
e case pictured already: don't bother how this truss is made and never mind that the def attached looks like an "add-on" (no components) - because it could be (so don't get stuck on that, it's irrelevant). In fact since the critical part (the 99% of the whole) if only doable with code ... it makes sense to do the rest with code as well (but that's my personal preference anyway, he he). Note: Balls are excluded from the demo.
You can toggle what "class" of struts is gonna being made with these booleans:
You can vary the sliders and if the code thinks that you make a valid input ... it obeys, he he.
But the big questions are:
1. Can you work with this in some interactive way? I mean vary any slider and ... wait ... for some change. Although the MERO components here are created ONCE and then placed around (minus obviously the tubes) ... they are placed as copies of the "donor" object (not instance definitions) creating a vast "pool" of "unnecessary" data.
2. What happens if you bake these little thingies? What file size you get? Is it OK?
But the bad news are that as I said ... this is ... NOT a task for a novice ... nor you can handle this get-a-truss-and-make-a-MERO-thing goal with half-measures: either you should do it properly ... or abandon ship.
NOTE: Load R file first (nothing is internalized).
Moral: even if this was made with components ... it wouldn't serve much.
best, Peter…
H are automated by using them as an ActiveX, the C# script object fails on the simplest tasks. That is, when initiating Rhino and GH externally (as by the following C# code):
Rhino5Application rhino_app = new Rhino5Application();
dynamic grasshopper = newRhino.rhino_app.GetPlugInObject("b45a29b1-4343-4035-989e-044e8580d9cf", "00000000-0000-0000-0000-000000000000") as dynamic;
The following very simple C# script component fails because it cant cast its input:
The c# code at the component is only:
Line 89 is simply casting of the input. Clearly, this makes the usage of C# component, under automation, impossible which is a major loss.
As said, when initiating Rhino and GH manually , all works well as in the following:
Any ideas why it misbehaves under automation (as an Active X ) ?
I added the gh file of this example.…
oCommonSDK, I modified a working C# component that does something similar (ReduceMesh, written by Andrew Heumann). Both scripts are attached.
Aside from changing the component name and eliminating the P parameter, I made two modifications to the script:1) changed line 87 from private void RunScript(Mesh M, double P, ref object A) to: private void RunScript(Mesh M, ref object A)2) changed line 93 from: Rhino.RhinoApp.RunScript("_-ReduceMesh _ReductionPercentage " + Convert.ToString(P) + " _Enter", false); to: Rhino.RhinoApp.RunScript("_-MatchMeshEdge " + " _Enter", false);When I run the ReduceMesh component, the mesh object I feed it gets baked, the ReduceMesh command is run, the temporary object is deleted, and the reduced mesh result is returned. (Thanks, Andrew).When I run the MatchMeshEdge component, the mesh object I feed it is baked, the MatchMeshEdge command is run, but the temporary object is not deleted and no result is returned. The runtime error reads: "Sequence contains no elements (line 0)". I have a feeling that the command line string I am handing to RunScript is incomplete. When I enter it manually on the Rhino command line I see that it wants a mesh and three parameters. Of course I can hit Enter to accept the default values, but when you invoke a command through RunScript do you have to supply all parameters regardless? Also, where would I find details on the argument types that the command wants? For example, the last parameter reads "RatchetMode=On" or "RatchetMode=Off". How do I know if the type is Bool or the literal string "On" or "Off"?I am a complete novice at this so any help you can provide would be greatly appreciated! …
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
st sampled into data trees (if not we must "add" them "manually" == code: get this item from Rhino and put it there) into collections.
2. Then we must perform some kind of selection(s) on a per individual item basis and THAT is in 99% of cases "manual" (== code) or on a per "global basis" (hard or soft clusters et all == code). If clusters are hierarchical and some kind of dendrogram is required ... this obviously means ... er ... more code.
3. Doing the 2 we use some kind of input by means of sliders (say pairs of 2: for branches and items) and therefor MAY their values cause slider control issues (== code). For instance IF this slider yields a x event > do this and that to some other sliders.
4. Then perform the "histogram" required and obviously treat this as just a variant (i.e. a possible solution out of a given collection witch is variable) meaning ways to "store" this into parameter(s) (as persistent data). This also requires code.
In a nutshell (and oversimplified): given a collection of "shapes" pick some make the histogram, store the result (or do something with that and store the outcome as well) recall some other for any reason, modify it, stored it ... and then repeat until the end of time (or worst: until you are out of espresso).
As I said: NOT a task for a novice AND NOT a task for someone not familiar with code matters (But I guess that you qualify in both areas, he he).
I do this type of things day in day out (but for real-life AEC purposes) therefor I could make a "simple demo" (add some "" more) but ... well ... you are warned, he he
But in case that you take the wrong decision (you are warned) we must use Skype a bit.…
Integer = 0 To 9
val *= 2
lst.Add(val)
Next
Since val is a ValueType, when we assign it to the list we actually put a copy of val into the list. Thus, the list contains the following memory layout:
[0] = 2
[1] = 4
[2] = 8
[3] = 16
[4] = 32
[5] = 64
[6] = 128
[7] = 256
[8] = 512
[9] = 1024
Now let's assume we do the same, but with OnLines:
Dim ln As New OnLine(A, B)
Dim lst As New List(Of OnLine)
For i As Integer = 0 To 9
ln.Transform(xform)
lst.Add(ln)
Next
When we declare ln on line 1, it is assigned an address in memory, say "24 Bell Ave." Then we modify that one line over and over, and keep on adding the same address to lst. Thus, the memory layout of lst is now:
[0] = "24 Bell Ave."
[1] = "24 Bell Ave."
[2] = "24 Bell Ave."
[3] = "24 Bell Ave."
[4] = "24 Bell Ave."
[5] = "24 Bell Ave."
[6] = "24 Bell Ave."
[7] = "24 Bell Ave."
[8] = "24 Bell Ave."
[9] = "24 Bell Ave."
To do this properly, we need to create a unique line for every element in lst:
Dim lst As New List(Of OnLine)
For i As Integer = 0 To 9
Dim ln As New OnLine(A, B)
ln.Transform(xform)
lst.Add(ln)
Next
Now, ln is constructed not just once, but whenever the loop runs. And every time it is constructed, a new piece of memory is reserved for it and a new address is created. So now the list memory layout is:
[0] = "24 Bell Ave."
[1] = "12 Pike St."
[2] = "377 The Pines"
[3] = "3670 Woodland Park Ave."
[4] = "99 Zoo Ln."
[5] = "13a District Rd."
[6] = "2 Penny Lane"
[7] = "10 Broadway"
[8] = "225 Franklin Ave."
[9] = "420 Paper St."
--
David Rutten
david@mcneel.com
Poprad, Slovakia…
Added by David Rutten at 6:26am on September 9, 2010
Horticulture and Landscape in same time.
The most common plastic materials used as agricultural films are the low density polyethylene (LDPE, with a density less than 0.93 kg m−3), the copolymer of ethylene and vinyl-acetate (EVA)
Also here you can find the characteristics of the flexible materials for greenhouse covers (adapted from CPA, 1992 and Tesi, 2001) as much as i get.
UV-PE Film ( UV-PE~ polyethylene Long life or UV)
Thickness (mm) = 0.18
Direct PAR transmissivity (%) = 90
Diffuse PAR transmissivity (%)= 86
Long-wave IR transmissivity (%)= 65
EVA Film ( EVA~Ethylene vinyl-acetate copolymer)
Thickness (mm) = 0.18
Direct PAR transmissivity (%) = 90
Diffuse PAR transmissivity (%)= 76
Long-wave IR transmissivity (%)= 27
and here you will find the global heat transfer coefficient’ (K in W m−2 °C−1) for the above greenhouse covering materials, measured under normalized conditions (temperatures: exterior: −10°C, interior: +20°C, wind: 4 m s−1). (Source: Nisen and Deltour, 1986.)
Cover Clear sky Overcast Sky
Single PE 8.8-9.0 7.1- 7.2
Single EVA 7.8 6.6
Note : the PAR radiation (photosynthetically active or photoactive radiation and its the amounts to 45–50% of the global radiation; Berninger, 1989)
The name PAR is used to designate the radiation with wavelengths useful for plant photosynthesis. It is accepted that the PAR radiation ranges from 400 to 700 nm (McCree, 1972), although some authors consider the PAR from 350 to 850 nm.
The composition of the radiation changes with time, as a function of the Sun’s elevation and the cloudiness. When the Sun is low over the horizon, the short wavelengths are reduced (less UV and more red). The clouds reduce the amount of energy, greatly decreasing the NIR.
The PAR proportion in relation to the global radiation increases with scattering (diffusion). It is lower with clear sky and in the summer (45–48%).
kind regards
rafat …
Grasshopper. So, I once made an attempt to bind ms sqlServer in order to get frozen definitions at some states, to avoid managing baked objects in Rhino and also be able to retain whole results without using the GH state manager that rebuilds everything.
But at that time GH's VB.Net component didn't properly read referenced dlls and I forgot it since then.
At first, I was surprised by Slingshot's extensive interface : I was still having in mind my own old project, a tool that would have acted at the Rhino's geometry object level, and auto creating the needed tables.
The bd would have consisted of a main table, owning the objects ID and name, and related tables containing the necessary information relative to the main objects.
For example, a Brep is made of so and so underlying objects, passed to respective tables, according to GH objects definition layout (just the way they are written in the xml schema).
Then, on a db, query an object by name, and retrieve the whole object or underlying objects (e.g. at the bounding curves level, or points level for a Brep).
With Slingshot, I made a few attempts to cheat GH with BLOB data fields, but no way to get a whole object. It seems that GH simply provides an object.toString ... and GH is definitely not conceived to produce persistence outside of Rhino. If I have some spare time, I will try to extract
About points and colors, I am now simply using a single field with CHAR(asLargeAsNeeded...), as GH parses String to every Point (or Vector or Color) entry of any component.
I do so because it need less to display on the canvas...
Whatever I wrote before, I really like your conception, as opened to relational interactions between ...whatever you need or dream of !
One last thing : GH can't open the definition file "Genome_DB_Template.gh" that I've downloaded from your site : http://slingshot-dev.wikidot.com/database-genome. I was expecting to learn a lot from your very smart stuff ! (I am running GH 08.00.13 and Slingshot 0.7.2.0)
Slingshot is running great, opened to any use...Thanks again.
Best,
Stan
…