. This means that we know both point's Y values, and the relation of one X value to the other. What we are missing is where the apex point's X value is. If we add to both points a "fudge factor, Xo" allowing for the apex point's X value to be variable, we get 2 simultaneous eqns with 2 unknowns, Xo and A, which is the catenary function coefficient. [this is important so that we don't unintentionally preset the catenary coefficient]
so..
Y1 = A cosh ((X1-Xo)/A) - A
Y2 = A cosh ((X2-Xo)/A) - A
This is solvable, but because cosh (x) = (e^x + e^-x) / 2, we can't separate one of the unknown variables or use one of the other easy techniques. I used Matlab's fsolve function, but obviously while it is very doable to hitch up Matlab to Grasshopper, having this functionality in your script would be ideal.
These are just my meandering thoughts, I'm sure someone on the internet that is better at maths than me has an explicit solution worked out.
Here is what I wrote in Matlab:
iA=1;
iXo=1;
X1=4;
Y1=10;
X2=-3;
Y2=7;
F = @(V) [V(2)*cosh((X1-V(1))/V(2))-V(2)-Y1;V(2)*cosh((X2-V(1))/V(2))-V(2)-Y2];
InitialGuess = [iXo;iA];
Options = optimset('Display','iter');
XY = fsolve(F, InitialGuess, Options);
*Matlab code taken/edited from help file on solving nonlinear simultaneous eqns: http://www.mathworks.com/support/solutions/en/data/1-15NRJ/index.html…
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)
…
rves that "intersect" a plane placed on Z=6 above the first circle. I did this to have a collection of points from which to choose 3 and make a 3pt-circle.
[this second circle "fits" the catenary at a certain height, that's what I wanted to do]
Maybe it's obtuse but anyway that's the way I managed it.. I then used the "intersection" of the top circle with the original catenary curve to "split" the catenary into 2 parts, I then "Rail Revolution" the first part of it around the axis of the original circle, using the circle as a "rail", and I get a Brep surface.
It is a "open brep" surface, so now i'm having the problem of managing it if I want to subdivide it with Isotrim or other commands to control the number of subdivisions.
Is there a better way to go about this?
I am attaching the file.
About the image, I checked my code about 10 times to understand why it has those "lines" every 1 meter in the Z, and they already appear in the "rail revolution" component when it is visible, but in the "brep components" I can see the individual points along the rail curve.
I think this is what might be causing the brep to surface problem, but for the life of me I can't understand why the rail is not smooth and is "divided" into the 7 points instead of just one smooth revolution...
Thanks! :)
…
both my plotter/cutter and wide format printer. I had been running the plotter from my main work laptop - a Win10 machine via the plotters USB port. As it turns out you can't get Win XP drivers for this USB connection so I needed another solution.
I tried to use the plotters DB25 serial port connection using an old DB9 to DB25 modem cable I had in my collection = no luck the plotter wouldn't talk. A bit more research and it turns out these plotters need a 'null modem' cross over cable to operate. I found a pic of the correct wiring online and made up my own with some cable and connectors from the local electronics hobby shop.
With this hooked up and using Hyperterminal I was able to fire some codes to the plotter directly and get a response back - winning!
At this point I got my original code working with the 'net use' redirect from LPT1 to COM1.
HOWEVER - being that the plotter was now on a COM port there are a few more interesting things you can do with it - one is being able to read the paper size/cut area from the printer.
So what I needed to to was find a way to send and receive data to/from the plotter using the serial port.
A bit of research into .NET's serial port interface and using a bunch of small pieces of test code I have manged to completely re-jig this driver.
Upgrades include:
- Direct Serial Port comms using Null Modem cable (a USB to serial adaptor + null modem should also work)
- Plot area read from the plotter - a rectangle the size of the plot area is placed on a separate layer and coloured red
- Testing to see if selected plotting curves are both closed and inside of the cutting area - with errors shown and exiting if they are not right.
- After plot 'parking' of the plot head at the end of the cut items + an adjustable offset (currently requires manual resetting of origin on the plotter before for next cut)
Great thing is it is now 100% running within Rhino Python - no DOS command line calls = no flashing up of the CMD wind. Also no temp files needed on the HDD and no limit to number of curves that can be plotted - tested with 200 or so with no issues.
Overall very happy with whole project - have learnt a LOT about Python and .NET interfacing AND ended up with a very handy/useful tool.
Cheers
DK
# This code is a WIP # It plots directly to a DGI Plotter# via the serial port
import System.IO.Ports as Portsimport rhinoscriptsyntax as rsimport time
#Some setup valuescom_port = 'COM1' #change to match plotter port baud_rate = 9600 #change to match plotter settingplotter_step = .025 #mmfinsh_offset = 10 #mm
#Delete old cutting area and cut objectsif rs.IsLayer('Cutting Area'): rs.PurgeLayer('Cutting Area')if rs.IsLayer('Cutting Objects'): rs.PurgeLayer('Cut Objects')
#Setup Serial PortMyport = Ports.SerialPort(com_port)Port_Write = Ports.SerialPort.WriteMyport.BaudRate = baud_rateMyport.ReadTimeout=5000 #5 secsMyport.Close()Myport.Open()
#Setup PlotterPort_Write(Myport, 'PU;PA0,0;IN;\n')Port_Write(Myport, 'SP1;\n')Port_Write(Myport, 'PA;\n')time.sleep(2)
#Read the Paper size from PlotterPort_Write(Myport, 'OH;') #HPGL read limits codetime.sleep(2)
return1 = ''papersize = ''count = 0char_in_buffer = 0chars_in_buffer = Ports.SerialPort.BytesToRead.GetValue(Myport)
if chars_in_buffer == 0: print 'Plotter not ready' Myport.Close() exit()
while (count < chars_in_buffer): return1 = Myport.ReadChar() papersize = papersize + chr(return1) count = count + 1
papersize = papersize.split(",")rect1 = (float(papersize[2])*plotter_step)rect2 = (float(papersize[3])*plotter_step)
print 'Cutting area = ' + str(rect1) + 'x' + str(rect2)
#place cutting area curve on its own layer, make it red and lock itplane = rs.WorldXYPlane()cutting_area = rs.AddRectangle( plane, (rect1), (rect2))rs.AddLayer (name='Cutting Area', color=(255,0,0), visible=True, locked=True, parent=None)rs.ObjectLayer(cutting_area, 'Cutting Area')
#get plotting objects
allCurves = rs.GetObjects("Select curves to plot", rs.filter.curve)
#test to see if these are closed curves - exit if not
for curve in allCurves: test_closed = rs.IsCurveClosed(curve) if test_closed == 0: print "One or move of these curves are not closed" Myport.Close() exit()
#test to see if these are inside cutting area - exit if not
for curve in allCurves: test_inside = rs.PlanarClosedCurveContainment(curve, cutting_area)
if test_inside==0 or test_inside==1: print "One or more of these curves are outside of cut area" Myport.Close() exit()
#All ok - convert to points and send data to printer
rs.AddLayer (name='Cut Objects', color=(0,255,0), visible=False, locked=True, parent=None)
for curve in allCurves: Port_Write(Myport, 'PU;PA;SP1;\n') polyline = rs.ConvertCurveToPolyline(curve,angle_tolerance=5.0, tolerance=0.025, delete_input=False, min_edge_length=0, max_edge_length=0) points = rs.CurveEditPoints(polyline) rs.ObjectLayer(polyline, 'Cut Objects')
# PU to the first point x = points[0][0] y = points[0][1] Port_Write(Myport, 'PU' + str(int(x / plotter_step)) + ',' + str(int(y / plotter_step)) + ';\n') # PD to every subsequent point i = 1 while i < len(points): x = points[i][0] y = points[i][1] Port_Write(Myport, 'PD' + str(int(x / plotter_step)) + ',' + str(int(y / plotter_step)) + ';\n') i += 1
Port_Write(Myport,'PU;\n')
#find the far end of the cutbox = rs.BoundingBox(allCurves)far_end = str(box[1])far_end = far_end.split(",")far_end = far_end[0]far_end = float(far_end)/plotter_stepfar_end = (int(far_end))+ finsh_offsetfar_end = str(far_end)print (far_end)
#return plotter home and close portPort_Write(Myport, 'PU;PA' + far_end + ',0;IN;\n')Port_Write(Myport, 'SP1;\n')Port_Write(Myport, 'PA;\n')Myport.Close()time.sleep(10)…
Loop'. The fun part of the slower version is that you can see what it's doing while it's running. 'Fast Loop' gives no indication that it's working, so you want to test it with small numbers and be sure it's coded properly before bumping the iteration count up.
The GH profiler running the slow version showed between 1 and 1.5 seconds per loop, but the reality was more like ~10 seconds per loop toward the end of an 11 X 11 grid, or ~20 minutes total. It's easier to be patient because you know it's working.
The 'Fast Loop' finished the same grid in 1.6 minutes! An impressive improvement. I've been running it on a 30 X 30 grid (900 points) for ~23 minutes so far and see nothing yet. Not the ~12 minutes I had hoped for... Now 36 minutes on this loop for 900 points... hope it's not stuck. Not fast! Later - DONE!! Profiler says 59 minutes for 900 points but it was more like an hour and twenty minutes total. It succeeded, I have a single 'Closed Brep' from 900 extruded rings, baked to Rhino.
Another strategy to explore would be doing 'SUnion' on a smaller grid using the Anemone loop, then replicate it by moving it as needed to form a larger grid; then run the copies through another 'SUnion' loop. I went ahead and implemented that while waiting. It works and is fast! Started with 3 X 3 and ran the result again as 5 X 5 (9 X 25 = 225 total) in barely ~70 seconds!? Trying 36 X 36 now... 1,296 points appears to have succeeded in less than ten minutes! Though it seems to take quite awhile after the loop ends before control is restored to GH/Rhino. I'll let you do your own experiments and benchmarks.
I encapsulated the loop in a cluster called 'suLoop' (blue groups).
Internal of 'suLoop' cluster:
…
Added by Joseph Oster at 11:14pm on March 22, 2017
s are not required)
// Agenda
Parametric Design, in the history of architecture, has defined many rules for current designers and for future practitioners to follow. One of the strongest aspects that are prominent from this style is ‘geometry’. Arguably, there is nothing new about geometry and aesthetics forming the most prominent aspect of any style or era. The language of any style, in the long history of architecture, is visually defined by geometry or shape, beyond the principles that define the core of the style. In the distinguishable style of parametric architecture, geometry has played and is continuing to play an integral role. And with this fairly young style, there are many strings of myths and false notions associated.
The workshop aims to provide a detailed insight to ‘parametric design’ and embedded logics behind it through a series of design explorations using Rhinoceros & Grasshopper platforms, along with understanding of data-driven fabrication strategies. An insight to Computational Design and its subsets of Parametric Design, Algorithmic Design, Generative Design and Evolutionary Design will be provided through presentations, technical sessions & studio work, with highlighting agenda of using data into Hands-on fabrication of a parametrically generated design. A strong focus will be made on ‘geometry’ and ‘matter’.
// Methodology
Workshop has been structured to teach participants the use of Grasshopper® (Generative modelling plug-in for Rhinoceros) as a generative tool, and ways to integrate it with Hands-on Fabrication process. A strong agenda on ‘geometry’ and ‘matter’ will form the focus of the studio with design experimentation through computational & parametric techniques, culminating into a manually fabricated wall panel using understanding of data-driven design during the course of workshop.
…
error, but resetting the height to <100m should fix things.
The height of the night boundary reflects the diurnal pattern of the urban boundary layer (image below). During the day the solar shortwave radiation heats up the urban surface, mixes with the air above creating a tall boundary layer. During the night the surface cools down, the boundary layer becomes more stable, and it's height is reduced. So typical heights for daytime is ~ 1000m, and for nightime ~ >100m.
So increasing it by a factor of 8 to 10 is likely what is causing issues with the UWG calculation for you. I started a github issue here: https://github.com/chriswmackey/Dragonfly/issues/11 so that we can fix this typo. Also we should figure out why exactly the calculation is failing so that can potentially put an upper bound to the inputs or a better error message. Thanks for catching it!
Finding some reference data linking weather layers to urban typologies is a good question, I'd like to find some too. Perhaps Chris/Mostapha might be able to provide some? You can check out the following thesis [1],[2] that the UWG algorithm is based on, which references three case studies for Singapore (Punggol), Capitoul and Bubble:
[1] https://dspace.mit.edu/handle/1721.1/107347
[2] https://dspace.mit.edu/handle/1721.1/59107…
ky.exe did not accept -p parameter and made empty sky.cal file.
----
Edit: solved run problem, Bee did not download OpenStudioMasterTemplate.idf
Get it here: https://github.com/mostaphaRoudsari/Honeybee/issues/119
Now get empty HDR:
C:\ladybug\prox\imageBasedSimulation>rpict -i -t 10 -vtv -vp 245.129 -226.458 20 0.405 -vd -0.549 0.656 -0.518 -vu -0.332 0.397 0.855 -vh 42.862 -vv 26.991 -v l 0 -vs 0 -vl 0 -x 800 -y 600 -af prox_RAD_Perspective.amb -ps 8 -pt 0.15 -pj 0.6 -dj 0 -ds 0.5 -dt 0.5 -dc 0.25 -dr 0 -dp 64 -st 0.85 -ab 2 -ad 1024 -as 175 -ar 150 -aa 0.200 -lr 4 -lw 0.050 -av 0 0 0 prox_RAD.oct 1>prox_RAD_Perspectiv e.unf rpict: 0 rays, 0.00% after 0.0000 hours rpict: skybright`c__ladybug_skylib_cumulativeSkies_SINGAPORE_SGP_SINGAPORE_SGP_1 : undefined variable rpict: 1020 rays, 4.91% after 0.0000 hours
----
Hi friends,
trying to get a cumulative sky image metric to run and encountered an issue with the image-based metrics component. It throws:
Runtime error (KeyNotFoundException): honeybee_materialLib Traceback: line 768, in main, "<string>" line 1442, in script
I guess this is some sort of setup issue on my end, or I messed up the definition? Any help appreciated.
Thanks,
Max
…
value=WINTERDESIGNDAY, in SIZINGPERIOD:DESIGNDAY=SINGAPORE ANN HTG 99.6% CONDNS DB ************* IDF Context for following error/warning message: ************* Note -- lines truncated at 300 characters, if necessary... ************* 53 SizingPeriod:DesignDay, ************* indicated Name=SINGAPORE Ann Htg 99% Condns DB ************* Only last 10 lines before error line shown..... ************* 57 23.5, !- Humidity Indicating Conditions at Maximum Dry-Bulb ************* 58 101133., !- Barometric Pressure {Pa} ************* 59 2, !- Wind Speed {m/s} design conditions vs. traditional 6.71 m/s (15 mph) ************* 60 320, !- Wind Direction {Degrees; N=0, S=180} ************* 61 0.00, !- Clearness {0.0 to 1.1} ************* 62 0, !- Rain {0-no,1-yes} ************* 63 0, !- Snow on ground {0-no,1-yes} ************* 64 21, !- Day of Month ************* 65 12, !- Month ************* 66 WinterDesignDay,!- Day Type
The relevant lines in the IDF file is shown below:
SizingPeriod:DesignDay, SINGAPORE Ann Htg 99.6% Condns DB, !- Name 23, !- Maximum Dry-Bulb Temperature {C} 0.0, !- Daily Temp Range {C} 23, !- Humidity Indicating Conditions at Maximum Dry-Bulb 101133., !- Barometric Pressure {Pa} 2, !- Wind Speed {m/s} design conditions vs. traditional 6.71 m/s (15 mph) 320, !- Wind Direction {Degrees; N=0, S=180} 0.00, !- Clearness {0.0 to 1.1} 0, !- Rain {0-no,1-yes} 0, !- Snow on ground {0-no,1-yes} 21, !- Day of Month 12, !- Month WinterDesignDay,!- Day Type 0, !- Daylight Savings Time Indicator WetBulb; !- Humidity Indicating Type ! SINGAPORE_SGP Annual Heating 99%, MaxDB=23.5°C SizingPeriod:DesignDay, SINGAPORE Ann Htg 99% Condns DB, !- Name 23.5, !- Maximum Dry-Bulb Temperature {C} 0.0, !- Daily Temp Range {C} 23.5, !- Humidity Indicating Conditions at Maximum Dry-Bulb 101133., !- Barometric Pressure {Pa} 2, !- Wind Speed {m/s} design conditions vs. traditional 6.71 m/s (15 mph) 320, !- Wind Direction {Degrees; N=0, S=180} 0.00, !- Clearness {0.0 to 1.1} 0, !- Rain {0-no,1-yes} 0, !- Snow on ground {0-no,1-yes} 21, !- Day of Month 12, !- Month WinterDesignDay,!- Day Type 0, !- Daylight Savings Time Indicator WetBulb; !- Humidity Indicating Type
It seems that there is an empty line after the line for "!- Humidity Indicating Type" field, and nothing is specified for "! SINGAPORE_SGP Annual Heating 99%, MaxDB=23.5°C" field.
May I ask why this happens and how to correct the error?
Thank you very much!…
having to deal with big data. i am about to release a version of OctopusE with 'explicit components', which expand some of the core functions of octopus into dedicated components. there, a new GH data container is introduced and used, called 'OctopusSolution', which stores a set of parameters, goal values, and metadata such as phenotypic shapes etc. i ll try to add a direct export to a container on the canvas.
> 2. firstly it is a lot easier to work with normalized parameter- and goal-values regarding the algorithms themselves. i could add the actual values to the solution-information, but secondly this would blow up the amount of data even more.. mostly it is the history which takes a lot of memory, and the actual values would almost double the data to be stored for most use cases.
> 3. i am not sure if i follow correctly, but you want to 'scroll' through the front? so one must give an objective dimension to sort the front, and by scrolling with the mouse wheel you would reinstate the solutions?
this might work fine for fast definitions, but there will be pain for more expensive problems.
what is there right now is the 'reinstate' function on the context menu of a solution,
and the mesh-display of the solutions points in the octpus viewport..
> 4. you should definitely be able to see the shapes, octopus in its current form just sets values, expires the solution and collects some values. no hidden stuff. but by default, 'minimize rhino on start' is set to true - because it can be a factor 10 speedup when rhino&GH do not have to update their UI.
best
Rob…