a pain to use sometimes. I recently found this great post:
http://www.grasshopper3d.com/forum/topics/formatting-numbers-in-grasshopper
which points to the msdn .net framework standard numeric format strings:
http://msdn.microsoft.com/en-us/library/dwhawy9k.aspx
and the custom ones too:
http://msdn.microsoft.com/en-us/library/0c899ak8.aspx
Sooo... today I was trying to make a 2D array generator for RGB values to use with a RGB LED and an Arduino. For instance, declaring a 2D array in Arduino:
int color[3][3]={{255,0,0},{0,255,0},{0,0,255}};
I'm using the blend color component to spit out transitions between two colors. I want the list in the panel to be in the format above, so I used both the expression component and the string format component (are they the same under the hood?). In any case, if I have R, G and B values coming into the component, I want to format them so the come out looking like {R,G,B}, so I can just copy the output in a panel and paste it into the Arduino IDE. But what about {curly braces}. If the expression/format component uses them in it's syntax, for instance:
Format ("{R:0},{G:0},{B:0}",R,G,B)
how do I get them into the formatting string? I tried escaping them like:
Format ("\{{R:0},{G:0},{B:0}\}",R,G,B)
but that just makes the component angry
Escaping characters is explained in the formatting references above. Is it implemented in this component? Should I be looking at a different approach?
I've included a sample file below.
Thanks!
~BB~
…
ing-in-python?commentId=2985220%3AComment%3A628495
For the most part, I got the serial port to work and I could share the port with other components without wiring the components together using a sticky Python dictionary. There were a couple of issues with closing the port (Rhino had to be restarted).
In any case, I'm back at it. I am however going the C# component route with an eye towards writing my own components with visual studio. I am trying to create bidirectional communication with a serial device in grasshopper. I need more control over the serial port that the generic Firefly components can afford. Furthermore, I would like to understand how to program this myself. The first goal would be to create a few components that could handle various serial tasks, one to open/close port, one to read from port and one to write to it. This is not unlike how I got it to work in python, and is also similar to the logic in Firefly's serial components.
The thing that has me stumped with C# is how one shares the port between components? If one component is responsible for creating and opening/closing the port, how do the read/write components address the instance of the port created in the other component? Python has the sticky dictionary, is there something similar in C#? I'm a novice when it comes to C# and how it works within grasshopper, so maybe I'm missing something simple.
I've attached a klunky definition that uses C# to open/close a serial port. I've tried accessing the port with other components, but I don't know enough to make it work. Again, I'm mainly interested in the mechanics of how one component can access the serial port instance created in another component. If I could get some user objects going for now, I'd be happy. In the future, I want to roll my own components. If anyone has any suggestions, code snippets, or any other forms of enlightenment, I'd be greatly appreciative!
Rhino5 x64 + GH version 0.9.0056
Thanks,
~BB~
…
starting as soon as possible.
We're offering challenging projects, insights and contact to leading industry companies, project responsibilities according to abilities and initiative, great work environment and laid-back atmosphere, room to play and evolve,...
Our ideal candidate:
- is passionate about construction, engineering and (computational) design
- is proficient in Rhino / Grasshopper / (GH-)Python
- knows his ways around the Adobe Suite and MS Office
- has a current work permit for Germany
- is a German speaker (other native speakers also welcome, with excellent English skills)
- has an architectural background (Student / BA / MA /...), ideally with work experience
- is interested / has experience in digital manufacturing and prototyping
- will be able to join us shortly
We're looking forward to your applications / inquiries / CVs to: mpelzer@fat-lab.de
View our past projects here: www.fat-lab.com
(Current projects, unfortunately, are non-disclosed)
…
onents (radiation, sunlight-hours and view analysis) which let you study the effect of the orientation of your building and the analysis result. When you come to a question similar to "what is the orientation that the building receives the most/least amount of radiation?" is probably the right time to use this component.
HOW?
I'll try to explain the steps using a simple example. Here is my design geometries. The building in the center is the building to be designed and the rest of the buildings are context. I want to see the effect of orientation on the amount of the radiation on the test building surfaces from the start of Oct. to the end of Feb. for Chicago.
First I need to set up the normal radiation analysis and run it for the building as it is right now. [I'm not going to explain how you can set up this since you can find it in the sample file (Download the sample file from here)]
Now I need to set up the parameters for orientation study using orientationStudyPar component. You can find it under the Extra tab:
At minimum I need to input the divisionAngle, and the totalAngle and set runTheStudy to True. In this case I put 45 for divisionAngle and 180 for the totalAngle which means I want the study to be run for angles 0, 45, 90, 135 and 180.
[Note1: The divisionAngle should be divisible by totalAngle.]
[Note 2: If you don't provide any point for the basePoint, the component will use the center of the geometry as the center of the rotation.]
[Note 3: You can also rotate the context with the geometry! Normally you don't have the chance to change the context to make your design work but if you got lucky the rotateContext input is for you! Set it to True. The default is set to False.]
You're all set for the orientation study, just connect the orientationStudyPar output to OrientationStudyP input in the component and wait for the result!
The component will run the study for all the orientations and preview the latest geometry. To see the result just grab a quick graph and connect it to totalRadiation. As you can see in the graph 135 is the orientation that I receive the maximum radiation. Dang!
If you want to see all the result geometries set bakeIt to True, and the result will be baked under LadyBug> RadaitionStudy>[projectname]> . The layer name starts with a number which is the totalRadiation.
Mostapha…
her people) a tremendous amount of time creating them by hand. Dog Treat was far from perfect, however it was good enough to use almost daily.
Three years is a long time. Since 2016 my Gh knowledge has expanded and I’ve seen how dodgy some of the scripting is. With this in mind I started work on a new build. Many things have been tweaked and some things have been rebuilt from the ground up.
Everything has been designed to be leaner and be a general solution to the problem of creating dog bone corners on geometry for quick, efficient and safe CNC fabrication.
Some of these things are:
Adding prompts about user geometry to make them aware about open curves, varying curve heights and if their geometry had been altered (mostly removing unnecessary points on curves).
Smooth Transfers. If you’re in a rush and need to speed through cutting, smooth transfers mean that a lead in geometry is now created alongside the actual dog bone arc. This means the router bit doesn’t have to come to a minute stop at every corner. This is turned on by default.
Acute Angle Condition If the angle between the two curves adjacent to a dog bone point is acute, previously the dog bone corner was useless. This was because the distance between the end points of the dog bone arc were less than the diameter of the router bit. There are many ways this condition could be addressed. I chose to circumscribe a larger arc based on the original angle between the adjacent curves. While it removes more material from the corner, it minimises tool wear and any potential for material to burn.
Single Curve A single curve can now be input into Dog Treat. It will be output with both internal and external treatments.
I’ll continue to update Dog Treat as the need arises, it’s become somewhat of a hobby now. Maybe one day it will become part of a Plug-in… once I learn to code it though!
Happy Treating!
Hi Everyone,
Here's a tool I've been working on for the past 4 months or so in my free time. It's a dog bone corner generator, however it's a little different to some of the existing ones. It's designed to be used for large amounts of geometry and as such, it avoids using any curve boolean operations that are computationally taxing. You don't have to split your curves up into internal and external lots either, it works it all out so you can be lazy. I've also incorporated Lunch Box's Object Bake Component for a one click operation that bakes geometry back out to Internal and External profile layers.
Let me know how it goes, will update where necessary.
Best,
Darcy
Change Log
06/11/19 - Version 2.0 SECOND DINNER - Rebuild
29/09/17 - Version 1.3 - Now with smooth corners option, True for smooth default/False for original
18/05/17 - Version 1.2 - Now includes variable angle domain input (defaults at 90°) for angled corners
13/11/16 - slight change to enable acceptance of very large interior curves
…
Added by Darcy Zelenko at 8:44pm on November 9, 2016
string may contain any number of curly bracket pairs with non-negative integers in them:
"When {0} brings back {1} days and {2}"
The number inside the brackets refers to the data to insert in that location. In effect, {x} is a placeholder for actual data. The data inserted into a specific bracket pair is the data supplied in the latter part of the function. {0} refers to the first item, {1} to the second, {2} to the third and so on ad infinitum.
If I supply some data the entire expression may look like this:
Format("When {0} brings back {1} days and {2}", "Spring", "blue", "fair")
which will result in the string "When Spring brings back blue days and fair".
If the data you're inserting is a number (or a date) then you have additional formatting flags that you can use. These additional flags appear behind the placeholder index integer separated by a colon.
Format("Pi = {0:0.00} ({0:0.000000})", Pi)
The :0.00 means the number will be formatted using two digits. The other flag will enforce six digits, resulting in: "Pi = 3.14 (3.141593)"
--
David Rutten
david@mcneel.com
Poprad, Slovakia…
Added by David Rutten at 3:00pm on February 3, 2013
n the inability to be a real-life member within a parametric workflow (same kind of issue with Evolute Tools Pro).
As regards strictly AEC matters the main problem with GH is Rhino itself (not feature/constrain driven, not a solid modeler, not AEC oriented by any means and not biased towards assembly/component modeling). Other than that and due to the known GH inability to handle/manage blocks/nested blocks at bake time ... well... I hardly can see how "to set up work flows between different tools such as ..."
I'll post soon 5 - rather "trivial" - AEC cases that are totally undoable (shop drawing level) with anything other than CATIA (or NX).
BTW: since international practices grow and grow in numbers these days (and individuals are dead) I can't see any realistic limitation for creating dedicated teams (kinda like Frank Gerhy did) that can easily deal with the "extremely heavy" nature of the beast.
BTW: this is a job ad (Project Architect role) from one of the biggest US AEC practices (rather a corporation, he he)
How things change these days ... don't you agree?
best, Peter
…
nette for years.. but without the nice GUI. It also allows combining constraints solving to be part of the DAG.
What is parameterics? Or parametric associative as GC has been described. Can't remember. History or procedural modeling? Even constraints solving or rules based solving all use parameters. Is it generative or merely parametric? I guess the difference is a parametric door doe not generate other parameteric doors?
BIM has opened the door to a more data centric view and manipulation of the design model. To old skoolers a wall is a linear construct that can be abstracted into parameters... beginning and end points of wall in plan + height and thickness. But start adding other stuff and need to ineteroperate with others and things get problematic.
Pretty soon, all those abstractions (parametric or otherwise) need to be structured and you end up talking about schemas etc to control the format of the parameters using rules as checks or constraints..so that your parameters can interface with parameters from others without causing data quality issues. It all gets very database thinking like.
So, I would say parametrics as GH does it is more free form and ad hoc and at some point if it goes BIM, the parametrics will be need to be (re)structured..
BIM is dependent on IFC development which is not very fast. IFC4 is only beginning to think about parametrics and 'Design Transfer'.
…
humacher (Zaha Hadid) and in fact most issues of AD (Architecture Design)
The Politics of Parametricism: Digital Technologies in Architecture by Matthew Poole, which is kind of a follow up
In my opinion learning Grasshopper will be enough and there is no need to learn Python to use it successfully. Best to have a deep understanding of Grasshopper and what it can do then to try and learn too many things at once. It will help you in applying the principles to other code and not the other way round (ie. learning the concepts first and then going into grasshopper). The best way to learn the concepts is by applying and trying them in a tool like Grasshopper.
I absolutely recommend that you visit a Grasshopper workshop, as that will teach you a lot more than Youtube videos. If you cant visit a workshop, then I recommend the rese.arch video series on Grasshopper. They're really indepth and go from simple introduction to very advanced. You should ideally buy and complete all of them.
Also there is of course Dynamo and its integration with Revit and BIM, which is something to look at, although Grasshopper covers all of that as well, at least with the integration with ArchiCad. Autodesk products are more common around the world though.
Be aware that a lot of the power of Grasshopper is also in the plugins you can get for it, like Kangaroo (physics simulation), Ladybug&Honeybee (environmental analysis), Karamba (finite element analysis), Hoopsnake or Anemone (looping) and many, many more. You can find them at food4rhino.com.
Good luck!…
edit 29/04/14 - Here is a new collection of more than 80 example files, organized by category:
KangarooExamples.zip
This zip is the most up to date collection of examples at the moment, and collects t