ntación en distintos procesos del Diseño.
Se abordaran los conceptos basicos y la metodologia para abordar problemas de diseño a traves del desarrollo de Herramientas Algorítmicas mediante un proceso de programacion visual.
Como plataforma de trabajo se utilizara Rhinoceros+Grasshopper.
Instructor:
Leonardo Nuevo Arenas
Fechas:
17 y 18 de Septiembre de 2011
Lugar:
Calzada del Federalismo Sur No. 135 Altos 3, Frente al Parque Rojo (http://bit.ly/nNOuZ5)
Cupo:
Limitado a 15 plazas
Fecha limite de pago:
Viernes 9 de Septiembre
Importante:
Los participantes deberán traer su propia Laptop con todo el software y actualizaciones (originales o versiones de demostración oficiales) previamente instaladas. (Se fijara una fecha unos días antes para revisas que todos los equipos estén en orden y listos para trabajar). Si planeas venir de fuera de la ciudad contactanos y te pondremos en contacto con otras personas que también vayan a hacerlo para en caso de desearlo puedan compartir su lugar de estancia.
Contacto:
Leo. 33 3956 9209
nuarle@msn.com
Aye. 33 1050 3482
ayeritza.fara@gmail.com…
So it's not true that Bounds.X is only a getter. However it does behave as though it is. This is because RectangleF is a Value Type instead of a Reference Type. When you assign a variable of one value type to another variable of the same type, you always assign a copy of the first value. So when you request the Bounds from an attributes class, what you get is a copy of the actual bounds. Changing the X on this copy would be a useless operation which is why Visual Studio catches this mistake.
Let's assume that Dog is a class (a reference type) and it has a get/set property for fur type. Then, if I type:
Dog A = new Dog();
A.Coat = Long;
Dog B = A;
B.Coat = Short;
At the end of these lines, both A and B have a short coat, because the act of assigning A to B (line 3) means that both A and B now point to the same instance of Dog in memory. In effect, A and B are the same. If Dog were a struct (a value type), then at the end of this code A and B would have different coats, because assigning A to B means creating a copy of A. Any changes made to B will not affect A.
The one place where this causes annoying situations is exactly where you ran into it. If a property returns a value type then it's typically not useful to call properties and methods on that returned data, as it would only affect the copy of the actual data instead of the original data. That's why, if you want to change the Bounds of an attribute, you need code like this:
RectangleF box = Bounds;
box.X +=10;
Bounds = box;
On to the second problem, which is that doing it this way won't help you one bit. Laying out a component is a difficult job and the size of the Bounds depends on many things:
The display mode of the component (icon or text).
The size of the text (depending on which Font to use).
The maximum number of input and output parameters.
The maximum width of the longest input/output parameter name.
The maximum number of state icons to draw on the input/output parameters.
Changing the Bounds after the layout has occurred will basically just invalidate the parameter layout, resulting in parameter names and grips being drawn in the wrong places.
If you want to affect the size of the Bounds for a GH_Component class, you're going to have to dive in and do the laying out yourself. As mentioned before, this is not trivial.
There are static methods on GH_ComponentAttributes which are helpful when doing this, have a look at:
LayoutComponentBox()
LayoutInputParams()
LayoutOutputParams()
LayoutBounds()
Unfortunately they are undocumented.
--
David Rutten
david@mcneel.com…
Added by David Rutten at 1:39pm on January 31, 2014
via MIDI controllers.
my idea is to link PureData to GH via UDP. why pure data? cause' i can relate data like GH to generate numeric relations (and link it to audio generation)
so far i got PD and Processing to talk, but i can't get to grasshopper.
i use this definitions to make pd and processing to talk http://ubaa.net/shared/processing/udp/ and this GHX to get the data to GH http://www.grasshopper3d.com/forum/attachment/download?id=2985220%3...
i got this data from this post but the GH definition doesn't work for me. i have tried LAN definitions and "the engine" as well but they both freeze, even if i send data thru processing or PD.
i have a lot of questions at this time
1.- why processing tells me that i am getting the data from diferent ports, while i'm using 6000?
2.- why in the UDP definition i get no data out, even if it should say something like "waiting fordata/port/etc.." that's defined in the C# capsule
3.- is there a direct way to get midi data (key and CC) to GH
i also tried to use firefly to get the data via COM port. i know you can do this trick in processing but i just don't know how.
well. if anyone could help me i would share the results here (since it's a magister, results shoud be very interesting)
UDP has allways been a unsolved issue on other posts. maybe we could work it out ;)
Thanks…
Added by jota aldunce at 8:43am on September 28, 2010
s my code, so I decided to write a new simple component refreshing all time at 300 ms interval and the problem came up again. The code provoking the display exceptions and images with the erros are listed below.
----------------------------------------------------------------------------------------------
using System;using System.Drawing;using Grasshopper.Kernel;using FirstComp.Properties;using System.Timers;namespace FirstComp{ public class FirstCompGH : GH_Component { private Timer myTimer = new Timer(300); //3 veces por segundo private Random rand = new Random(DateTime.Now.Millisecond); public FirstCompGH() : base("Nombre", "Abreviado", "Descripcion", "Categoría", "SubCat") { myTimer.Elapsed += new ElapsedEventHandler(MainLoop); myTimer.Start(); } protected override void RegisterInputParams(GH_Component.GH_InputParamManager pManager) { pManager.Register_DoubleParam("Op A", "A", "Primer parámetro de la operación",0.0); pManager.Register_DoubleParam("Op B", "B", "Segundo parámetro de la operación",0.0); } protected override void RegisterOutputParams(GH_Component.GH_OutputParamManager pManager) { pManager.Register_DoubleParam("Suma", "S", "Resultado de la suma"); pManager.Register_DoubleParam("Resta", "R", "Resultado de la resta"); pManager.Register_DoubleParam("Mult", "M", "Resultado de la multiplicación"); pManager.Register_DoubleParam("Div", "D", "Resultado de la división"); } protected override void SolveInstance(IGH_DataAccess DA) { // Variables para contener los datos de entrada // Le podemos asignar algunos valores iniciales. double opA = double.NaN, opB = double.NaN; // El objeto DA recupera los datos de la entrada. // Si no hay datos de entrada abortamos. if (!DA.GetData(0, ref opA)) { return; } if (!DA.GetData(1, ref opB)) { return; } opA += rand.Next(1,10); opB += rand.Next(1,10); // Ahora realizamos las operaciones matemáticas DA.SetData(0, (opA + opB)); DA.SetData(1, (opA - opB)); DA.SetData(2, (opA * opB)); if (opB != 0) //Rhino.RhinoMath.ZeroTolerance DA.SetData(3, (opA/opB)); else { AddRuntimeMessage(GH_RuntimeMessageLevel.Error, "Error de división por cero"); return; } } public override Guid ComponentGuid { get { return new Guid("44BEA3FE-7CB8-42fe-AEC9-BE5F6EE424E8");} } protected void MainLoop(object source, ElapsedEventArgs e) { this.ExpireSolution(true); } protected override Bitmap Internal_Icon_24x24 { get { return Resources.icono; } } }}
-------------------------------------------------------------------------------------------------
Images showing errors.
I can't figure out what is causing these errors.
Best Regards
Ernesto
…
ences, so not terribly important in the end. After all, it's not really worth going through a lot of trouble to get a 15% speed increase; 15% faster than slow is still pretty slow.
Also processor speed has pretty much peaked these past few years, there have been no more significant increases lately. Instead, manufacturers have started putting more cores on motherboards, which is something GH unfortunately cannot take advantage of.
Multi-threading (very high on the list for GH2) brings with it a promise of full core utilisation (minus the inevitable overhead for aggregating computed results), but there are some problems that may end up being significant. Here's a non-exhaustive list:
It's not possible to modify the UI from a non-UI thread. This is probably not that big a deal for Grasshopper components, especially since we can make methods such a Rhino.RhinoApp.WriteLine() thread safe.
Not all methods used by component code are necessarily thread safe. There used to be a lot of stuff in the Rhino SDK that simply wouldn't work correct or would crash if the same method was run more than once simultaneously. Rhino core team has been working hard to remedy this problem, and I'm confident we can fix any problems that still come up, though it may take some time. If components rely on other code libraries then the problem may not be solvable at all. So we need to make sure multi-threading is an optional property of components.
There's overhead involved in multi-threading, it's especially difficult to get a good performance gain when dealing with lots of very fast operations. The overhead in these cases can actually make stuff perform slower.
There's the question on what level should multi-threading be implemented. Obviously the lower the better, but that means a lot of extra work, complicated patterns of responsibilities and a lot of communications between different developers.
There's the question on how the interface should behave during solutions now. If all the computation is happening in a thread, the interface can stay 'live'. So what should it look like if a solution takes -say- 5 seconds to complete? Should you be able to see the waves of data streaming through the network, turning components and wires grey and orange like strobe lights? What happens if you modify a slider during a solution? Simple answer is to abort the current solution and start a new one with the new slider value. But as you slowly drag the slider from left to right, you end up computing 400 partial solution and never getting to a final answer, even though you could have computed 2 full solutions in the same time and given better feedback. Does the preview geometry in the Rhino viewports flicker in and out of existence as solutions cascade through the network?
…
you working on a PV system which will power a domestic hot water boiler?
To answer your questions:1) Each grasshopper component (ghpython being one of those too) is using grasshopper's data matching algorithm. This algorithm takes care of complex issues which may arise from combining lists with single items, data trees with different number of items per branch and so on.I think there is a way of introducing a call to other processor's threads per each inputted surface, but this will be a very difficult job, as it will require writing a custom data matching algorithm. I do not think I am up to that task.Instead I tried to introduce the multithread only to the final part of the PVsurface component and one of its time consuming parts: calculation of sun angles, solar radiation and ac/dc power output.I attached the test file below, but sadly it didn't go well: the multithreaded version mostly runs at the same time as the regular version.I do not think I am qualified enough to answer why is that so, but I think that it may have something to do with the type of the function that the multithreading is applied to: the code is suppose to run few separate functions a couple of thousand times, and work with a couple of lists. From my experience, the multithreading works the best when a single list or two are supplied to a single function. I may be wrong on this.I am very sorry to say that I can not implement this feature.2) I am not familiar if open source PV modules database has been released.But one can always download the data for specific modules from producers websites. It can then easily be transferred to a .csv file or other text file.Ladybug Photovoltaics are based on NREL's PVWatts model.In comparison with other commercial software applications, PVWatts offers a more generalized system model, with some of the values and characteristics being assumed or embedded.The Fuentes empirical thermal model we are currently using follows the same logic: it generalizes the Module characteristics. The following characteristics are only editable: module efficiency, temperature coefficient and module mount type.It may be possible to replace Fuentes with some other, less generalized 5 parameter thermal model. But as an architect, I would definitively need help on this.
Sorry if my reply did not fulfill your expectations, and thank you for the kind words!…
t. This was a reasonably effective workflow for the purposes of solving the initial problem. (in reviewing this post, it seems a bit lengthy, but hopefully it's of use to others).
Link to Illustrator Script example:https://forums.adobe.com/thread/508138
Portion I used: This applies to entire illustrator document. I am using Illustrator CC 64 bit and this worked okay. Tested a few times and it failed once, but a restart of Illustrator fixed it.
var v_selection = app.activeDocument.pathItems;SwapFillStroke(v_selection); function SwapFillStroke(objSel) { for(k = 0; k < objSel.length; k++){ var subSel = objSel[k]; var c_fill = subSel.fillColor; var c_stroke = subSel.strokeColor; subSel.fillColor = c_stroke; if(!subSel.stroked) subSel.stroked = true; subSel.strokeColor = c_fill; }} redraw();
My goal was to export colored geometry, (analysis meshes for example), from Rhino and get it into illustrator with solid fills.
If you want to know how meshes are colored in rhino...there are many explanations here on the forum, a quick search will get you more detailed information.
Short version: export your lines from rhino to illustrator and run the script listed above to make the stroke color the fill color. (in illustrator, shift+X will swap the fill and stroke colors on individual objects, but does not work on multiple objects..hence the need for the script).
Detailed Version:
In my case, I had 2 case studies I was working with.1 - wind rose meshes generated from Ladybug/honeybee2 - A mesh terrain that was colored by pre-set slope values.
NOTE: There are a few plugins to bake objects with color. I used Human tools, (Bake Geometry and JustifiedText3D).http://www.grasshopper3d.com/group/human (lots of other great stuff in there too!)
I had two types of geometry. (2 different definitions)
1- An analysis mesh, (HoneyBee/LadyBug),
2 - Lines generated from mesh faces. (mesh terrain/slope values).
Export results as a DXF, and choose "do not explode". (these were my settings)
DXF seemed to produce the most consistent results.
(you could export/save as an AI file and just open them in illustrator, but that seemed to give inconsistent results with the script).
Open DXF in Illustrator:
Apply Script in illustrator:
In the terrain example, there are only 5 colors, so selection in illustrator, by color, is very easy. In the results from honeybee/ladybug, (or any analysis process I imagine), the default colors are created with a much wider range of values. I presume the legend is then created by an average of those values within a range. My point is that, with the analysis results, selecting objects by color in Illustrator is probably not a very effective workflow.
I only tested this on my instance of rhino and Illustrator. mileage may vary.
In summation, at this point, it seems that the best way to get colored mesh faces, into illustrator, is to export the meshes, (which really ends up being the mesh face edges...curves), and bringing them into illustrator and running a quick script to swap the colors. Once that is complete, you can then select ALL the objects, and change the stroke color/weight at once.…
s. (Go to RCE Tabs)
Normaly a compoment is disable.
Fill the 3 parameters: name, e-mail and company.
Enable the component with the right mouse button on the component and enable.
A file is created here:
C:\RhinoDeveloppements\RhinoCivilEngineering\license\licence_a_envoyer.txt
Send it to this address:
rhinodeveloppements@gmail.com
You will receive your license within 24 hours
----------------------------------------------------------------------
Pour procéder à la requête de licence, merci de suivre ces étapes.
1. Installer RhinoCivil Engineering
2.Charger Rhinoceros et Grasshoper
3.Glisser Déposer le composant RCE Protection sur le canevas de Grasshopper.(Sur le panneau RCE)
Normalement le composant est désactiver.
4. Remplir les 3 paramètres: Nom, Adresse mail et société.
Activer le composant avec un clic droit sur le composant et "enable"
Un fichier est alors créer ici:
C:\RhinoDeveloppements\RhinoCivilEngineering\license\licence_a_envoyer.txt
Envoyer le à cette adresse:
rhinodeveloppements@gmail.com
Vous recevrez votre licence dans les 24 heures.…
project below- should I be learning Grasshopper & Rhino or just Rhino first?
I'm trying to panel modules with low tolerances- I've prototyped regular shapes like geodesics and am now looking to experiment with irregular shapes with lots of different panel shapes.
I understand some things are best done through Grasshopper when using Paneling Tools- I'm trying to figure out if I can do what I want to achive with PT alone or should do it through Grasshopper (or some other route).
I’m on the MAC WIP - The module was built in Sketchup - all the components seem to be in order as blocks though am having problems running the ptpanel3dcustom command - thinking maybe a bug in the WIP or something wrong with my input or that I imported the sketchup file the wrong way. (I dropped it in the window) - If the 3D command is run it doesn’t do anything - if 2D (ptpanelgridcustom) it crashes.
The tileing pattern - the green rectangle is a refrence. each tile contains 4 blocks with 3 more nested in each.
How the module tiles.
The other thing I'm trying to do is specify that most of the lines in the panels don’t bend/curve when they are paneled (or something like Cage Edited). For my purposes the length & angles can change while the lines must remain straight.
These images show a test tile to be panneled on a ellipsoid. When the tile is mapped to the grid the lines curve, this is an extreme example but notice allot of tiles far from the hemespheres are also bent slightly.
These two questions have me stumped the most for now. What should I look into get a better handle on these problem areas? Maybe I should try recreating the work on a windows machine? or perhaps I should get started with Grasshopper?
Thanks for reading.
Lu…