about it.
2. Nick's comment below got me thinking about unit testing for clusters. Being able to work will data flowing in from outside the cluster or having multiple states to test against could be really cool. Creating definitions that were valid across a general cross section of possible input parameters was a significant issue for us. It was all too easy to write the definition as if we were drawing (often we were working from sketches) and then have it fail when the input parameters changed slightly.
4. I wasn't thinking about threading the solver itself. I was thinking along the lines of some IDEs that I've seen which compile your project while you type it. I know that threading within components and at the rhinocommon-level is a freaking hard problem that has been discussed at length already. (although when, 5-10 years from now, it's finished it will be very cool)
Let's say the solver is threaded and the canvas remains responsive. As soon as you make a change to the GH file, the solver needs to be terminated as it is now computing stale data.
What if the solver was a little more atomic and like a server? A GH file is just a list of jobs to do with the order of the jobs and the info to do them rigidly defined - right? The UI could pass the solver stuff to do and store the results back in the components on a component by component basis (i have no idea what the most efficient way to do this is in reality - I'm just talking conceptually) this might even allow running multiple solvers to allow for at least the parallelism the might be built into a given GH file to be exploited (not within components but rather solving non-interdependent branches of components simultaneously). This type of parallelism would more than make up for the performance hit you alluded to for separating the UI and the solver (at least for most of the definitions i write).
I was imagining a couple of scenarios:
a) Writing a parallel module: solver starts chewing away - you see it working - you know it's done 1/3 of the work - if you have something to do at that point you could connect up to some of the already calculated parameters and write something in parallel to the main trunk which is still being solved.
b) Skipping modifications: you need to make a series of interventions at different intervals along a section of code. Sure you could freeze out that bit of a section of down steam code and make modifications so you can observe the effects more quickly. Unfreeze a bit more and repeat etc. etc. until your done and then unfreeze that big chunk at the end to make sure you haven't blown anything up. Just letting it resolve as far as it can while you sit there waiting for inspiration seems a lot more intuitive to me though.
On a file which takes 15 minutes to solve that's no big deal, but you certainly don't want to be adding a 20 millisecond delay to a solution which only takes 30 milliseconds.
You also wouldn't notice it at that point :-) perhaps for things where it would really make a difference, like Galapagos interactivity, it could be disabled - or could the existing "speed" setting just digest this need? Since the vast majority of time that Gh is solving is on files under active development not on finished code, i think qualitative performance is probably more important that quantitative performance (again with cases like Galapagos needing to be accommodated). In our case the code only had to "work" once since its output went to a cnc machine to make a one off project and it didn't really matter if it took 15 seconds or 15 hours for the final run.
Lastly, I have no way to predict how long a component is going to take. I can probably work out how far along in steps a component is, but not how far along in time.
that's ok, from a user point of view, just seeing a percentage tick along once in a while would be nice reassurance that the thing is just slow and has not, in fact, crashed. Maybe there could be two modes of display: the simple percentage version for unpredictable code and, for those of us able to calculate the time taken for our algorithm based on the number of input parameters, a count down in seconds or minutes or whatever.
I think a good place to start with these sort of problems is to keep on improving clusters, ... etc etc
i totally agree.
…
Added by Dieter Toews at 7:53pm on September 4, 2013
isseminated at the firms I've worked at:
Always write your scripts as though someone else is going to have to use and debug them without any instruction from you. This is kind of an overall governing principle that drives a lot of the other best practices.
Structure your definitions left to right. This way it is clear what is dependent on what, what executes in what order, and makes it easy to use the "Moses" tool (alt-click and drag on the canvas to spread components apart) to insert intermediate functionality to an already-existing definition.
For a given functional group (a set of components that does a well-defined thing) keep all the data going in to the group as labeled parameters on the left, and everything going out of the group as labeled parameters on the right. This is the intent of my "Best Practicizer" tool in Metahopper (now a menu item instead of a component). In essence, you're treating each group as though it's about to be clustered - you've defined what it does, what its inputs are, and what its outputs are. This makes troubleshooting much easier - if something is going wrong, you can easily isolate which group is causing the trouble by looking at inputs and outputs.3b. If you're grabbing some value or data (e.g. "STEP COUNT") many times from elsewhere in the definition, don't make a bunch of long wires that connect all the way back to the original source - grab that data into ONE labeled parameter and then connect all your inputs that need it to that - makes for one long wire instead of 20.
Annotate, annotate, annotate. Label your params (and if you're in icon mode, switch them manually to text). Label your groups. Use scribbles to mark larger regions of functionality. Use panels for "instructions" wherever it might not be clear how someone is supposed to use your tools.
Avoid "wireless" (Hidden Wires) connections. If you MUST use them, make sure you create params at both ends with matching names so it's clear what the data represents and where it comes from.
Cluster where possible. It's extremely helpful to isolate functional groups into clusters - it makes debugging faster and easier, since you don't have to wait for the whole definition to recompute when making small edits to the inside of a cluster, and it sets you up well to create code that can be re-used later on. However, don't take whole definitions and cluster them. As a rule of thumb, if a cluster has more than ~10 inputs, it should probably be broken into multiple clusters. There is a slight performance impact when clustering, because unlike an un-clustered group of components, which only executes the parts of the definition where something has changed, any time ANY input to a cluster changes, the WHOLE cluster re-computes. Because of this, a cluster shouldn't generally wrap any groups of components that are not related / don't connect with each other.
Color code your groups. Many firms develop a standard around group coloring so that it's easy to understand what parts of a definition are doing what kind of task. For instance, at Woods Bagot where I work, we have different colors for component groups that highlight inputs, outputs, rhino references, baking, and visualization. You may find that a different set is useful to you, but having a consistent standard can improve legibility. That's my 2c. At the end of the day, everyone works a little bit differently, and that's unavoidable (and not even a bad thing!) As long as you keep #1 in mind, all the rest will follow.
…
DP ($$$ aside), GC, and Grasshopper. Arthur’s original question is very important
and the exact question (and hopefully answer) I was hoping to find on a
forum.
“How to take intelligent 3D parametric generative design models (scripting, etc.) into 2D documents?" Or, deliver the 3D design for evaluation, bid, construction, etc.
I am intrigued by Jon’s comments in the same thread and would like to know how I can learn more about the process (and
pitfalls) of turning over a 3D digital generative models to a contractor/fabricator.
Are there any industry guidelines established I could use as a reference to guide our firm through this type of uncharted territory?
Arthur’s question is very reminiscent of 10 years ago when I was frustrated with the amount of time spent on the development of a 3D model design (physical and/or virtual) only to have to wipe the table clean and start the process all over again in 2D in order to document the project for delivery. From this I jumped head first into BIM and Revit, vowing never to go back to unintelligent 2D line work. I am now working on Bentley software (v8i: Microstation and Bentley Architecture) with the access and desire to venture into Generative Components. I am very intrigued by Rhino/Grasshopper primarily with the apparent ease of use and available resources assisting in the learning process – something not really available with Bentley.
In hindsight, as I am doing my software research I think the current use of Revit and BA (Bentley Architecture) are more of a “bridge”
between the past (decades of digital 2D work, i.e. AutoCAD) and where hopefully
we all will be someday in the near future (100% 3D modeling, i.e. Digital
Project??). Without having the experience
it would appear that DP/CATIA (PLM software) are closer to this than any other
type of software. As complicated as the
industry standards are for the automobile and airline industry, I feel we
(architectural industry and others) are heading in a similar direction with
total understanding (PLM/ Evidence Based Design) of a design (a whole other topic). If anything I think the market will begin to
demand it sooner or later.
Gehry (DP) article NY Times:
http://www.nytimes.com/2009/02/11/business/11gehry.html
I know these type of broad discussions (software vs. software) can be blown out of proportion on forums, but I am would like to read
the pulse of those who are already in the trenches (using Grasshopper, CATIA, Digital Project, Generative Components, others??) and hear your thoughts. Just as valuable would be other threads,
industry articles/reviews of 3D parametric generative design software.
Thanks,
Boyd…
):
import rhinoscriptsyntax as rsstart=rs.AddPoint(0,0,0)end=rs.AddPoint([10,0,0])divide=20vec=rs.VectorCreate(end,start)vec=rs.VectorDivide(vec,divide)centerList=list()for i in range(divide): newVec=rs.VectorScale(vec,i) centerList.append(rs.CopyObject(start,newVec))for center in centerList: rs.AddCircle(center,2.0)any help appreciate thanks,roy…
Added by roy orengo at 4:03pm on November 15, 2016
):
import rhinoscriptsyntax as rsstart=rs.AddPoint(0,0,0)end=rs.AddPoint([10,0,0])divide=20vec=rs.VectorCreate(end,start)vec=rs.VectorDivide(vec,divide)centerList=list()for i in range(divide): newVec=rs.VectorScale(vec,i) centerList.append(rs.CopyObject(start,newVec))for center in centerList: rs.AddCircle(center,2.0)any help appreciate thanks,roy…
Added by roy orengo at 3:09am on November 16, 2016