() Sub Main()
' user input
Dim intHowManyTrees : intHowManyTrees = Rhino.GetInteger("how many trees is a forest",20,1,50) Dim intHowManyGenerations : intHowManyGenerations = Rhino.GetInteger("how many generations is a tree?",6,1,10) Dim dblForestLength : dblForestLength = Rhino.GetReal("was is the desired length of your forest",50) Dim dblForestWidth : dblForestWidth = Rhino.GetReal("was is the desired width of your forest",50) Dim dblInitLength : dblInitLength = Rhino.GetReal("was is the desired length of the first main Branch?",10) Dim ang : ang = Rhino.GetReal("angle of rotation", 30, 1, 180) Dim scale : scale = Rhino.GetReal("scale of branch", 0.9) 'loop for number of generations i 'ReDim arrgenerations (Ubound (intHowManyGenerations)) Dim layer_0 : layer_0 = Rhino.AddLayer("0") Dim i For i=0 To intHowManyTrees Dim arrSeed : arrSeed = Array(Rnd*dblForestLength, Rnd*dblForestWidth,0) Dim strLine : strLine = Rhino.AddLine(Array (arrSeed(0), arrSeed (1), arrSeed (2)+Rnd*3), Array(arrSeed(0), arrSeed(1),arrSeed(2)+Rnd*dblInitLength+3))
Call Rhino.ObjectLayer (strLine, "0" ) Call Rhino.ObjectName (strLine, i) Next Dim j,vec ReDim arrbranch (intHowManyGenerations) For i=1 To intHowManyGenerations 'select the elements arrbranch (i) = Rhino.ObjectsByLayer (i-1) Dim strBranch For j=0 To Ubound(arrBranch(i)) strBranch = arrBranch(i)(j) Dim strParentName : strParentName = Rhino.ObjectName(strBranch) ' get start and end points Dim arrStartPt : arrStartPt = Rhino.CurveStartPoint(strBranch) Dim arrEndPt : arrEndPt = Rhino.CurveEndPoint(strBranch)
' get a vector between start and end vec = Rhino.VectorCreate(arrEndPt, arrStartPt) ''''' vec(x,y,z)
' scale vector vec = Rhino.VectorScale(vec, scale)
' rotate vectors Dim arrPlane : arrPlane = Rhino.CurvePerpFrame (strBranch, Rhino.CurveDomain(strBranch)(1))
Dim arrRotAxis Dim layer layer = Rhino.AddLayer ( i )
arrRotAxis = arrPlane(Int(Rnd*3)) Dim vec1 : vec1 = Rhino.VectorRotate(vec, ang, arrRotAxis) ' add the vector to the end point Dim newEndPt : newEndPt = Rhino.VectorAdd(arrEndPt, vec1)
Dim line1: line1 = Rhino.AddLine(arrEndPt, newEndPt) Call Rhino.ObjectLayer (line1, i) Call Rhino.ObjectName(line1, strParentName)
If rnd<0.8 Then arrRotAxis = arrPlane(Int(Rnd*3)) Dim vec2 : vec2 = Rhino.VectorRotate(vec, -ang, arrRotAxis) Dim newEndPt2 : newEndPt2 = Rhino.VectorAdd(arrEndPt, vec2)
Dim line2: line2 = Rhino.AddLine(arrEndPt, newEndPt2) Call Rhino.ObjectLayer (line2, i) Call Rhino.ObjectName(line2, strParentName) End If
If rnd<0.2 Then arrRotAxis = arrPlane(Int(Rnd*3)) Dim vec3 : vec3 = Rhino.VectorRotate(vec, ang*(rnd-0.5)*2, arrRotAxis) Dim newEndPt3 : newEndPt3 = Rhino.VectorAdd(arrEndPt, vec3)
Dim line3: line3 = Rhino.AddLine(arrEndPt, newEndPt3) Call Rhino.ObjectLayer (line3, i) Call Rhino.ObjectName(line3, strParentName) End If Next Next End Sub
Any kind of help would be highly appreciated…
r spatial studies farther down the road, but I digress; on to my Grasshopper script:
I've built a Grasshopper script that will display a point field for a given topography map (curves extracted from contour lines). The idea here is to display higher levels of density where the highest slopes are within a given topo map.
The file works, but I'm wondering if there is a simpler way of going about this, since my file contains so much redundant info (open the cluster "Pt:50" to see what I mean). My Grasshopper Kung-Fu skills aren't anywhere near expert yet, so I defer to the experts out there for a simpler solution. Here's my breakdown:
1. Start at curve start point, and find closest point within the group of curves.
2. Get distance to that closest point, and find second point along said curve at that distance.
3. Repeat process along curve starting at each new point at each new process.
Thanks in advance for any suggestions/comments!
Cheers,
cb…
of the roof is getting higher results than expected (for city at north hemisphere), and higher than the south side of the (vertical) roof, (that is abnormal for the latitude).
The expected results should be like that of PVGIS:
ORIENTATION
ANGLE
PVGIS
DIVA
N
22
649
824
S
22
970
860
FLAT
0
829
867
N
43
504
525
S
43
1020
873
N
90
278
233
S
90
781
707
Can anyone guess the reason, or did anyone face this problem in the past? what do you think I should change?
Attached you may find the .gh file and the climate data file.
Thank you very much for your time.…
u can display:
1. All angles
2. Angles that are smaller than a number(chose number from the CONTROLS group)
3. Only the angles around a specific node (chose node from the CONTROLS group)
Can you please explain a little better what you are trying to do?
Do you want to create pipes around all the mesh edges?
If so, what is the rule for the pipe's radius?
If it starts or ends on a node that has at least one angle<50 then its radius is 100?
And if not?…
Added by nikos tzar at 10:10am on September 8, 2014
ent" grid (not that simple, mind: regulations et all)... it "loads" the desired plane (an instance definition: 40 planes available) in the appropriate layer (automatically created) and then place any seat "combo" (out of 50 available, i.e. instance definitions of 2 types: business/economy). It's so fast that when you alter the 2d grid ... it can keep-up live with the delete this [all blocks using the previous grid] re-load that [new blocks using the current grid] sequance. Tested up to 5K seats (for the next 7444447, he he) - BTW: these are rather far more complex than your "cells". Seats are multi-nested and multi-layered thus you can control rather easily what Rhino displays in Views in what detail.
…
flectance and use .2 as default. You can use ShadingProperty:Reflectance to change the default value. We don't support this in Honeybee interface right now but you can create the objects and add them to your energy model using additionalStrings_ input.
I put a simple example together were I change the reflection for shading surfaces to .5 for unglazed part of shading and portion and .7 for glazed part. I also set the percentage of glazing to 50% of the surface area.
I didn't put any input checks. Make sure to read the documentation to put valid input values for energyplus otherwise the energyplus simulation will fail. I also assumed that all the shading surfaces (context) will be planar surfaces.
Keep in mind that it will only effect the results if you are using one of the solar distributions with reflections. Honeybee is using FullInteriorAndExteriorWithReflections by default so you should be fine if you're using the default settings.
Hope it helps,
Mostapha
…
se, I don't fully understand the syntax and how to put it all together.
This script has no purpose whatsoever, it's simply practice for myself.
private void RunScript(int start, int end, ref object A) {
List<Point3d> pts = new List<Point3d>(); List<Rectangle3d> rect = new List<Rectangle3d>(); List<Plane> plane = new List<Plane>(); List<Extrusion> boxes = new List<Extrusion>();
Random random = new Random(); Vector3d vect = new Vector3d(0, 0, 1);
for (int i = start; i <= end; i = i + 2){ int random1 = random.Next(0, 100); int random2 = random.Next(0, 50); int random3 = random.Next(1, 5); int random4 = random.Next(1, 10);
Point3d pt = new Point3d(random3, random1, random2); Plane pl = new Plane(pt, vect); Rectangle3d rt = new Rectangle3d(pl, random3, random4); Extrusion box = new Extrusion(rt.Transform(Rhino.Geometry.Extrusion.Create(rt, random4, true))); rect.Add(rt); boxes.Add(box);
}
A = boxes; B = rect;
}…
.0004. [1 of 7] Writing simulation parameters...5. [2 of 6] No context surfaces...6. [3 of 6] Writing geometry...7. [4 of 6] Writing materials and constructions...8. [5 of 7] Writing schedules...9. [6 of 7] Writing loads and ideal air system...10. [7 of 7] Writing outputs...11. ...... idf file is successfully written to : c:\ladybug\unnamed\EnergyPlus\unnamed.idf12. 13. Analysis is running!...14. c:\ladybug\unnamed\EnergyPlus\eplusout.csv15. ......
Done! Read below for errors and warnings:
16. 17. Program Version,EnergyPlus, Version 8.2.7-777c1f8d79, YMD=2015.02.28 16:09,IDD_Version 8.2.718. 19. ** Warning ** IP: Note -- Some missing fields have been filled with defaults. See the audit output file for details.20. 21. ** Warning ** Version: in IDF="'8.2.7'" not the same as expected="8.2"22. 23. ** Warning ** ManageSizing: For a zone sizing run, there must be at least 1 Sizing:Zone input object. SimulationControl Zone Sizing option ignored.24. 25. ** Warning ** ManageSizing: For a plant sizing run, there must be at least 1 Sizing:Plant object input. SimulationControl Plant Sizing option ignored.26. 27. ** Severe ** GetHTSubSurfaceData: Surface Openings have too much area for base surface=F73533B3C6894C67936B_GLZP_1228. 29. ** ~~~ ** Opening Surface creating error=F73533B3C6894C67936B_GLZP_12_GLZ_1230. 31. ** Severe ** GetHTSubSurfaceData: Surface Openings have too much area for base surface=F73533B3C6894C67936B_GLZP_2532. 33. ** ~~~ ** Opening Surface creating error=F73533B3C6894C67936B_GLZP_25_GLZ_2534. 35. ** Severe ** GetHTSubSurfaceData: Surface Openings have too much area for base surface=F73533B3C6894C67936B_GLZP_2836. 37. ** ~~~ ** Opening Surface creating error=F73533B3C6894C67936B_GLZP_28_GLZ_2838. 39. ** Severe ** GetHTSubSurfaceData: Surface Openings have too much area for base surface=4BDFD67E6D0E486796CC_GLZP_940. 41. ** ~~~ ** Opening Surface creating error=4BDFD67E6D0E486796CC_GLZP_9_GLZ_942. 43. ** Severe ** GetHTSubSurfaceData: Surface Openings have too much area for base surface=4BDFD67E6D0E486796CC_GLZP_1044. 45. ** ~~~ ** Opening Surface creating error=4BDFD67E6D0E486796CC_GLZP_10_GLZ_1046. 47. ** Severe ** GetHTSubSurfaceData: Surface Openings have too much area for base surface=4BDFD67E6D0E486796CC_GLZP_1148. 49. ** ~~~ ** Opening Surface creating error=4BDFD67E6D0E486796CC_GLZP_11_GLZ_1150. 51. ** Severe ** GetHTSubSurfaceData: Surface Openings have too much area for base surface=4BDFD67E6D0E486796CC_GLZP_1552. 53. ** ~~~ ** Opening Surface creating error=4BDFD67E6D0E486796CC_GLZP_15_GLZ_1554. 55. ** Severe ** GetHTSubSurfaceData: Surface Openings have too much area for base surface=4BDFD67E6D0E486796CC_GLZP_2456. 57. ** ~~~ ** Opening Surface creating error=4BDFD67E6D0E486796CC_GLZP_24_GLZ_2458. 59. ** Severe ** GetHTSubSurfaceData: Surface Openings have too much area for base surface=4BDFD67E6D0E486796CC_GLZP_2560. 61. ** ~~~ ** Opening Surface creating error=4BDFD67E6D0E486796CC_GLZP_25_GLZ_2562. 63. ** Severe ** GetHTSubSurfaceData: Surface Openings have too much area for base surface=4BDFD67E6D0E486796CC_GLZP_3064. 65. ** ~~~ ** Opening Surface creating error=4BDFD67E6D0E486796CC_GLZP_30_GLZ_3066. 67. ** Severe ** GetHTSubSurfaceData: Surface Openings have too much area for base surface=4BDFD67E6D0E486796CC_GLZP_3268. 69. ** ~~~ ** Opening Surface creating error=4BDFD67E6D0E486796CC_GLZP_32_GLZ_3270. 71. ** Severe ** GetHTSubSurfaceData: Surface Openings have too much area for base surface=4BDFD67E6D0E486796CC_GLZP_3472. 73. ** ~~~ ** Opening Surface creating error=4BDFD67E6D0E486796CC_GLZP_34_GLZ_3474. 75. ** Warning ** GetSurfaceData: Very small surface area[2.94495E-004], Surface=F73533B3C6894C67936B_GLZP_076. 77. ** Warning ** GetSurfaceData: Very small surface area[3.84753E-004], Surface=F73533B3C6894C67936B_GLZP_178. 79. ** Warning ** GetSurfaceData: Very small surface area[9.16905E-004], Surface=F73533B3C6894C67936B_GLZP_380. 81. ** Warning ** GetSurfaceData: Very small surface area[4.96186E-004], Surface=F73533B3C6894C67936B_GLZP_482. 83. ** Warning ** GetSurfaceData: Very small surface area[2.37373E-005], Surface=F73533B3C6894C67936B_GLZP_684. 85. ** Warning ** GetSurfaceData: Very small surface area[6.35824E-004], Surface=F73533B3C6894C67936B_GLZP_786. 87. ** Warning ** GetSurfaceData: Very small surface area[5.86549E-004], Surface=F73533B3C6894C67936B_GLZP_888. 89. ** Warning ** GetSurfaceData: Very small surface area[7.63765E-004], Surface=F73533B3C6894C67936B_GLZP_1090. 91. ** Severe ** GetSurfaceData: Zero or negative surface area[-8.09566E-004], Surface=F73533B3C6894C67936B_GLZP_1292. 93. ** Warning ** GetSurfaceData: Very small surface area[1.51701E-004], Surface=F73533B3C6894C67936B_GLZP_1394. 95. ** Warning ** GetSurfaceData: Very small surface area[9.29917E-004], Surface=F73533B3C6894C67936B_GLZP_1596. 97. ** Warning ** GetSurfaceData: Very small surface area[2.94451E-004], Surface=F73533B3C6894C67936B_GLZP_1698. 99. ** Warning ** GetSurfaceData: Very small surface area[8.03294E-004], Surface=F73533B3C6894C67936B_GLZP_17100. 101. ** Warning ** GetSurfaceData: Very small surface area[6.83026E-004], Surface=F73533B3C6894C67936B_GLZP_18102. 103. ** Warning ** GetSurfaceData: Very small surface area[9.29917E-004], Surface=F73533B3C6894C67936B_GLZP_20104. 105. ** Warning ** GetSurfaceData: Very small surface area[3.19851E-005], Surface=F73533B3C6894C67936B_GLZP_21106. 107. ** Warning ** GetSurfaceData: Very small surface area[7.63765E-004], Surface=F73533B3C6894C67936B_GLZP_23108. 109. ** Severe ** GetSurfaceData: Zero or negative surface area[-4.05899E-004], Surface=F73533B3C6894C67936B_GLZP_25110. 111. ** Warning ** GetSurfaceData: Very small surface area[6.35824E-004], Surface=F73533B3C6894C67936B_GLZP_27112. 113. ** Severe ** GetSurfaceData: Zero or negative surface area[-9.91146E-004], Surface=F73533B3C6894C67936B_GLZP_28114. 115. ** Warning ** GetSurfaceData: Very small surface area[2.70158E-004], Surface=F73533B3C6894C67936B_GLZP_29116. 117. ** Warning ** GetSurfaceData: Very small surface area[3.22781E-004], Surface=F73533B3C6894C67936B_GLZP_30118. 119. ** Warning ** GetSurfaceData: Very small surface area[4.67821E-004], Surface=F73533B3C6894C67936B_GLZP_33120. 121. ** Warning ** GetSurfaceData: Very small surface area[3.22737E-004], Surface=F73533B3C6894C67936B_GLZP_34122. 123. ** Warning ** GetSurfaceData: Very small surface area[2.65634E-004], Surface=4BDFD67E6D0E486796CC_GLZP_0124. 125. ** Warning ** GetSurfaceData: Very small surface area[4.70736E-004], Surface=4BDFD67E6D0E486796CC_GLZP_1126. 127. ** Warning ** GetSurfaceData: Very small surface area[3.42507E-004], Surface=4BDFD67E6D0E486796CC_GLZP_3128. 129. ** Warning ** GetSurfaceData: Very small surface area[5.89276E-004], Surface=4BDFD67E6D0E486796CC_GLZP_4130. 131. ** Warning ** GetSurfaceData: Very small surface area[1.91146E-004], Surface=4BDFD67E6D0E486796CC_GLZP_6132. 133. ** Warning ** GetSurfaceData: Very small surface area[9.71205E-004], Surface=4BDFD67E6D0E486796CC_GLZP_7134. 135. ** Warning ** GetSurfaceData: Very small surface area[4.34494E-004], Surface=4BDFD67E6D0E486796CC_GLZP_8136. 137. ** Severe ** GetSurfaceData: Zero or negative surface area[-3.60159E-004], Surface=4BDFD67E6D0E486796CC_GLZP_9138. 139. ** Severe ** GetSurfaceData: Zero or negative surface area[-1.11946E-004], Surface=4BDFD67E6D0E486796CC_GLZP_10140. 141. ** Severe ** GetSurfaceData: Zero or negative surface area[-3.41257E-004], Surface=4BDFD67E6D0E486796CC_GLZP_11142. 143. ** Severe ** GetSurfaceData: Zero or negative surface area[-8.21483E-005], Surface=4BDFD67E6D0E486796CC_GLZP_15144. 145. ** Warning ** GetSurfaceData: Very small surface area[2.65716E-004], Surface=4BDFD67E6D0E486796CC_GLZP_16146. 147. ** Warning ** GetSurfaceData: Very small surface area[4.84044E-004], Surface=4BDFD67E6D0E486796CC_GLZP_17148. 149. ** Warning ** GetSurfaceData: Very small surface area[7.12297E-004], Surface=4BDFD67E6D0E486796CC_GLZP_19150. 151. ** Warning ** GetSurfaceData: Very small surface area[6.14324E-004], Surface=4BDFD67E6D0E486796CC_GLZP_22152. 153. ** Warning ** GetSurfaceData: Very small surface area[8.88887E-004], Surface=4BDFD67E6D0E486796CC_GLZP_23154. 155. ** Severe ** GetSurfaceData: Zero or negative surface area[-9.89060E-004], Surface=4BDFD67E6D0E486796CC_GLZP_24156. 157. ** Severe ** GetSurfaceData: Zero or negative surface area[-1.14849E-003], Surface=4BDFD67E6D0E486796CC_GLZP_25158. 159. ** Warning ** GetSurfaceData: Very small surface area[4.00479E-004], Surface=4BDFD67E6D0E486796CC_GLZP_27160. 161. ** Warning ** GetSurfaceData: Very small surface area[6.63061E-005], Surface=4BDFD67E6D0E486796CC_GLZP_28162. 163. ** Warning ** GetSurfaceData: Very small surface area[1.09018E-004], Surface=4BDFD67E6D0E486796CC_GLZP_29164. 165. ** Severe ** GetSurfaceData: Zero or negative surface area[-2.49326E-005], Surface=4BDFD67E6D0E486796CC_GLZP_30166. 167. ** Severe ** GetSurfaceData: Zero or negative surface area[-3.17446E-004], Surface=4BDFD67E6D0E486796CC_GLZP_32168. 169. ** Warning ** GetSurfaceData: Very small surface area[8.60686E-004], Surface=4BDFD67E6D0E486796CC_GLZP_33170. 171. ** Severe ** GetSurfaceData: Zero or negative surface area[-2.48515E-005], Surface=4BDFD67E6D0E486796CC_GLZP_34172. 173. ** Fatal ** GetSurfaceData: Errors discovered, program terminates.174. 175. ...Summary of Errors that led to program termination:176. 177. ..... Reference severe error count=24178. 179. ..... Last severe error=GetSurfaceData: Zero or negative surface area[-2.48515E-005], Surface=4BDFD67E6D0E486796CC_GLZP_34180. 181. ************* Warning: Node connection errors not checked - most system input has not been read (see previous warning).182. 183. ************* Fatal error -- final processing. Program exited before simulations began. See previous error messages.184. 185. ************* EnergyPlus Warmup Error Summary. During Warmup: 0 Warning; 0 Severe Errors.186. 187. ************* EnergyPlus Sizing Error Summary. During Sizing: 2 Warning; 0 Severe Errors.188. 189. ************* EnergyPlus Terminated--Fatal Error Detected. 41 Warning; 24 Severe Errors; Elapsed Time=00hr 00min 1.51sec190.…
strain for the moment.
Other than that:
1. On this type of structures equal members (although achievable) is not a consideration unless you use some type of MERO system and you have a zillion members in mind (balls must being drilled on a per ball basis, mind). But you are not after a MERO. Or ... you have "fixed" panels in mind that "fit" in your facets and make the envelope?? (but this is more theoretical than anything ... ).
2. Individually picking items in collections (your nodes for instance) although the essence of engineering ... is not achievable in GH unless you use code (I could easily provide a small demo on that matter using C# - it could change your perception on things rather drastically).
3: Academic means ... er ... academic, he he: something NOT related with a real-life project meaning that the level of detail and the whole approach is ... er ... hmm ... "indicative". Academic also means: non-profitable (in the strict sense).
Suggestions:
A. This type of stuff is 50% about designing a proper node. Provide some detailed sketches on that matter (BTW: "mobile" nodes ???). The more "accurate" they are the better. Using wood makes the structure "heavy" to the eye (and is BAD: killing trees for doing things?? No good at all - unless is fully synthetic [kitsch], that is).
B. The remaining 49.99% is the envelope: Provide ... blah, blah. Note: if the envelope "panels" are NOT engulfed in the facets (say: some planar glazing system and the likes) then the nodes MUST provide means to support the envelope as well (or at least the Primary support system). By Primary I mean "big" triangular frames that support a "grid" of smaller ones that host glass, poly carbonate sheets or some other stuff.
C: For a vast variety of reasons going from "abstract" to something "realistic" on that type of structures requires coding. Are you familiar with such freaky things? (C# for instance) OR do you have issues using a "component" that is made that way? (see 2).
…
d as a mask). By inputting the # of grid points in the Y direction, it calculates # of grid points in the X direction, trying to create as close as possible a square grid division.
Hovering over the surfaces are 2 curves. By calculating the distance between the curves' points and grid points, an attractor pattern is created.
The source object is scaled based on the attractor curves, flipped upside down and adapted to the surface normal. Finally a solid difference is applied resulting in the indented surface pattern.
(Also, there is some more detailed input regarding object size, rotation and location.)
While running this on a machine with enough processing power to fly me to Mars, Grasshopper still becomes really slow and unresponsive ever since I've added the sDiff component. The same goes for utilizing the Trim component instead of the sDiff (I assume they do the same in this scenario?).
Am I missing something here? Is it somehow calculating large amounts of unnecessary data? Am I doing things overly-complex?
Attached the Rhino & Grasshopper files. Please play with the "# Objects in Y direction" slider, to (hopefully) experience what I mean. I am looking at a preferred # Object in the Y direction upwards of 50 at least. Changing the "3D Object" BRep to something else (in the hidden layers) might also influence performance.
So, what do you guys think?…
Added by Pete Bell at 10:34am on September 24, 2012