y to heaven (or hell) is full of pain,frustration and tears. In plain English: if you are not totally committed (and willing to pay the heavy price) ... well ... what about forgetting all that freaky stuff? (the best option, trust me)
Note: 99% of beginners dream to learn programing in order to make geometry. But the truth is that this is the least (and rather the most insignificant) that you can achieve especially when working in teams with lot's of CAD/MCAD apps (and verticals) in the practice of tomorrow (bad news: tomorrow is already yesterday).
Anyway: How to go to Hell in just 123 easy steps
Step 1: get the cookiesThe bible PlanA: C# In depth (Jon Skeet).The bible PlanB: C# Step by step (John Sharp).The bible PlanC: C# 5.0 (J/B Albahari) > my favoriteThe reference: C# Language specs ECMA-334The candidates:C# Fundamentals (Nakov/Kolev & Co)C# Head First (Stellman/Greene)C# Language (Jones)Step 2: read the cookies (computer OFF)Step 3: re-read the cookies (computer OFF)...
Step 122: re-read the cookies (computer OFF)Step 123: Open computer > burn computer > computers are a bad thing (not to mention the Skynet trivial thingy).May The Force (the Dark Option) be with you.
…
e or assembly 'StrandCommon, Version=1.0.0.0, Culture=neutral, PublicKeyToken=ef1982adf4660b58' or one of its dependencies. The system cannot find the file specified.Traceback: line 123, in __build_module, "C:\Users\murat.melek\AppData\Roaming\McNeel\Rhinoceros\5.0\Plug-ins\IronPython (814d908a-e25c-493d-97e9-ee3861957f49)\settings\lib\ghpythonlib\components.py" line 126, in <module>, "C:\Users\murat.melek\AppData\Roaming\McNeel\Rhinoceros\5.0\Plug-ins\IronPython (814d908a-e25c-493d-97e9-ee3861957f49)\settings\lib\ghpythonlib\components.py" line 2, in script…
Added by Murat Melek at 4:33pm on November 19, 2015
Albahari) > my favorite
The reference: C# Language specs ECMA-334
The candidates:
C# Fundamentals (Nakov/Kolev & Co)
C# Head First (Stellman/Greene)
C# Language (Jones)
Step 2: read the cookies (computer OFF)
Step 3: re-read the cookies (computer OFF)
...
Step 121: open computer
Step 122: get the 30 steps to heaven (i.e. hell)
Step 123: shut down computer > change planet
May The Force (the Dark Option) be with you.
…
in just 123 easy steps:
Step 1: get the cookies
The bible PlanA: C# In depth (Jon Skeet).
The bible PlanB: C# Step by step (John Sharp).
The bible PlanC: C# 5.0 (J/B Albahari) > my favorite
The reference: C# Language specs ECMA-334
The candidates:
C# Fundamentals (Nakov/Kolev & Co)
C# Head First (Stellman/Greene)
C# Language (Jones)
Step 2: read the cookies (computer OFF)
Step 3: re-read the cookies (computer OFF)
...
Step 121: open computer
Step 122: get the 30 steps to heaven (i.e. hell)
Step 123: shut down computer > change planet
May The Force (the Dark Option) be with you.
…
rtheless, here is how to do that:
Volvox.gha contains the Instructions objects which are the default instruction available in the plugin
Volvox_Instr.dll has the abstract classes from which the gha instructions inherit
Volvox_Cloud.dll finally contains the GH_Cloud object which tells Grasshopper how to treat the geometry.
You have to reference all 3 of them to make this script work. (they should be in the place you've installed Volvox, GH libraries by default). Just copy paste it then into a VB scripting component.
'create 2 instructions - these classes are from the Volvox.gha library Dim in1 As New volvox.Instr_planeclip(plane.WorldXY) Dim in2 As New Volvox.Instr_RandomSub(0.5, 123) 'create 2 rhino pointclouds Dim pc1 As New pointcloud Dim pc2 As New PointCloud
'populate them with some points For i As Integer = -100 To 100 Step 1 pc1.Add(New point3d(10, 0, i)) pc2.Add(New point3d(0, 0, i)) Next 'execute the instructions onto the pointclouds. in1.Execute(pc1) in1.Execute(pc2) 'note the random subsampling instruction has the same seed in both cases, 'hence it will sift the points in the same pattern in2.Execute(pc1) in2.Execute(pc2)
'get the clouds out with the GH_Cloud class, 'so that Grasshopper understands it as geometry object a = New GH_cloud(pc1) b = new GH_Cloud(pc2)
…
ints. Anyway this is made for AEC purposes (wavy roofs/envelopes and the likes) and is classified as internal (but I could provide a "light" version).
To give you a very rough idea: C# rebuilds first any input list of nurbs > then samples the control points in a tree > then excludes (or not) the "peripheral" points (case: closed in U/V surfaces) > then "picks" some of them according a rather vast variety of options (~30) > then modifies these either individually (that's only possible with code and it's a bit tricky) or via any collection of push/pull attractors or randomly or ... > then "joins" the 2 sets together (modified + unmodified) > and finally does the new nurbs. Only 456 lines of code that one.
With regard the Dark Side: C# would be my recommendation (P is ala mode, mind) for a vast variety of reasons (less than 10% of them are GH related).
If you decide to cross the Rubicon:
How to go to hell (and stay there) in just 123 easy steps:
Step 1: get the cookies
The bible PlanA: C# In depth (Jon Skeet).
The bible PlanB: C# Step by step (John Sharp).
The bible PlanC: C# 5.0 (J/B Albahari) > my favorite
The reference: C# Language specs ECMA-334
The candidates:
C# Fundamentals (Nakov/Kolev & Co)
C# Head First (Stellman/Greene)
C# Language (Jones)
Step 2: read the cookies (computer OFF)
Step 3: re-read the cookies (computer OFF)
...
Step 121: open computer
Step 122: get the 30 steps to heaven (i.e. hell)
Step 123: shut down computer > change occupation/planet
May The Force (the Dark Option) be with you.
…
e string so i will separate values by the char 'x')
for example
value1=123 and value2=456 and value3=789
will be
"123x456x789"
and in processing you will have to split the message whenever the program finds the char 'x'
String message = new String(data);
String[] messageParts = message.split("x");
from here you can read any part from the array
float value1 = Float.valueOf(messageParts[0]).floatValue();
float value2 = Float.valueOf(messageParts[1]).floatValue();
float value3 = Float.valueOf(messageParts[2]).floatValue();
i am not really sure if it is the fastest way.
check the attached files…
ou have 2 logical cores OFC ;)). Feel free to extend it to any amount of threads, the strategy should be very similar.
In this script, every of the 2 (potentially more) point clouds gets a separate list of instructions - those are classes as well, and I'm not sure how would they react to be called from 2 separate threads. After creating a list of instructions, we run the Parallel.For loop which takes care of all the multithreading mess for us. Select Case is probably not the nicest way of deciding on which list to take in, but it is good in showing visually what is going on in there.
Note that this code wasn't tested properly, I did run it only with those 2 simple point clouds. Double save everything whenever multithreading...
'create 2 lists of instructions, one for each threadDim inList1 As New list(Of Volvox_Instr.Instr_Base)Dim inList2 As New list(Of Volvox_Instr.Instr_Base)
'create and add the instructions to the listsinList1.add(New volvox.Instr_planeclip(plane.WorldXY))inList2.add(New volvox.Instr_planeclip(plane.WorldXY))inList1.add(New Volvox.Instr_RandomSub(0.5, 123))inList2.add(New Volvox.Instr_RandomSub(0.5, 234))
'create 2 rhino pointcloudsDim pc1 As New pointcloudDim pc2 As New PointCloud
'populate them with some pointsFor i As Integer = -100 To 100 Step 1 pc1.Add(New point3d(10, 0, i)) pc2.Add(New point3d(0, 0, i))Next
'a good coding practiceDim pccount As Integer = 2
'a classic parallel for loop, note the upper bound is exclusiveSystem.Threading.Tasks.Parallel.For(0, pccount, Sub(index As Integer)Select Case indexCase 0 For i As Integer = 0 To inList1.count - 1 Step 1 inList1(i).execute(pc1) NextCase 1 For i As Integer = 0 To inList2.count - 1 Step 1 inList2(i).execute(pc2) NextEnd SelectEnd Sub)
'get the clouds out with the GH_Cloud class,'so that Grasshopper understands it as geometry objecta = New GH_cloud(pc1)b = New GH_Cloud(pc2)
…
s for some solution "as it is" no matter the cost? (that's an extra stupid approach, very old fashioned). Do you use EvoluteTools Pro and/or Kangaroo for "optimization" ?
2. What is the FEA/FIM stuff in use? Do you expect "from/back" interactions? (If this is not doable ... increase this or that etc etc).
3. Do you validate real-life components with FEA/FIM? By what means you design these components? - present and/or future (inside Rhino?). This makes things "interesting" in a variety of ways (we need to extensively talk about that - Skype). The problem is that Rhino IS NOT a feature driven solid modeling app and thus ... a "certain" bottleneck arrives in no time: In the CATIA world you design ("MANUALLY") a parametric history driven component that "complies" to his parent "directives" (say: the Topology) and/or "imposes" his rules to his parent. This is what we call top<>bottom design approach (would become a standard across the AEC industry pretty soon: in around 123 years give or take some). This is far and beyond from what Rhino can do - but we DO make real-life things don't we?
4. Are all these things under a BIM umbrella ? What BIM? What type of details (blue prints) you deliver? (or you just make the thing?).
5. By what means cost is restricting/encouraging the solution? By what means you get feedback from component(s) cost that is outsourced? (i.e. outside your company). Do you monitor all things via some RDBMS? (that's Data Base).
6. What are the long term plans for dealing with such solutions? Using what apps (even in theory for the moment).…