is set up to manipulate strings into an STL file that is quite different from how Grasshopper defines meshes, in that an STL seems to define each face by XYZ points, Grasshopper wants a single list of all vertex points and then has an allied lists of topological connectivity according to vertex number, so for now I just hacked it to spit out points minus so many duplicates it generates for STL:
Right now it has an internal 3D trigonometric function I added input sliders to control, that creates surfaces that look a lot like molecular orbitals.
So how do I make a mesh? I failed to make a single mesh face from each STL face since AddMesh seems to want a list, so I tried making a single list and matching it with a simple ((1,2,3),(4,5,6),(7,8,9)...) array of connectivity but it hasn't worked yet since the STL list of vertices has duplicates that won't work for Grasshopper and removing the duplicates scrambles the connectivity relation.
After some work on this and seeing the output, I figure I could just randomly populate the mathematical function with points instead, unless it really gives a better mesh result than other routines. I'm not sure what to do with it yet, even if I get the mesh figured out.
import rhinoscriptsyntaximport RhinoPOINTS_CONTAINER =[]POINTS = []class Vector: # struct XYZ def __init__(self,x,y,z): self.x=x self.y=y self.z=z def __str__(self): return str(self.x)+" "+str(self.y)+" "+str(self.z) class Gridcell: # struct GRIDCELL def __init__(self,p,n,val): self.p = p # p=[8] self.n = n # n=[8] self.val = val # val=[8] class Triangle: # struct TRIANGLE def __init__(self,p1,p2,p3): self.p = [p1, p2, p3] # vertices # HACK TO GRAB VERTICES FOR PYTHON OUTPUT POINTS_CONTAINER.append( (p1.x,p1.y,p1.z) ) POINTS_CONTAINER.append( (p2.x,p2.y,p2.z) ) POINTS_CONTAINER.append( (p3.x,p3.y,p3.z) )# return a 3d list of values def readdata(f=lambda x,y,z:x*x+y*y+z*z,size=5.0,steps=11): m=int(steps/2) ki = [] for i in range(steps): kj = [] for j in range(steps): kd=[] for k in range(steps): kd.append(f(size*(i-m)/m,size*(j-m)/m,size*(k-m)/m)) kj.append(kd) ki.append(kj) return ki from math import sin,cos,exp,atan2 def lobes(x,y,z): try: theta = atan2(x,y) # sin t = o except: theta = 0 try: phi = atan2(z,y) except: phi = 0 r = x*x+y*y+z*z ct=cos(PARAMETER_A * theta) cp=cos(PARAMETER_B * phi) return ct*ct*cp*cp*exp(-r/10) def main(): data = readdata(lobes,10,40) isolevel = 0.1 #print(data) triangles=[] for i in range(len(data)-1): for j in range(len(data[i])-1): for k in range(len(data[i][j])-1): p=[None]*8 val=[None]*8 #print(i,j,k) p[0]=Vector(i,j,k) val[0] = data[i][j][k] p[1]=Vector(i+1,j,k) val[1] = data[i+1][j][k] p[2]=Vector(i+1,j+1,k) val[2] = data[i+1][j+1][k] p[3]=Vector(i,j+1,k) val[3] = data[i][j+1][k] p[4]=Vector(i,j,k+1) val[4] = data[i][j][k+1] p[5]=Vector(i+1,j,k+1) val[5] = data[i+1][j][k+1] p[6]=Vector(i+1,j+1,k+1) val[6] = data[i+1][j+1][k+1] p[7]=Vector(i,j+1,k+1) val[7] = data[i][j+1][k+1] grid=Gridcell(p,[],val) triangles.extend(PolygoniseTri(grid,isolevel,0,2,3,7)) triangles.extend(PolygoniseTri(grid,isolevel,0,2,6,7)) triangles.extend(PolygoniseTri(grid,isolevel,0,4,6,7)) triangles.extend(PolygoniseTri(grid,isolevel,0,6,1,2)) triangles.extend(PolygoniseTri(grid,isolevel,0,6,1,4)) triangles.extend(PolygoniseTri(grid,isolevel,5,6,1,4)) def t000F(g, iso, v0, v1, v2, v3): return [] def t0E01(g, iso, v0, v1, v2, v3): return [Triangle( VertexInterp(iso,g.p[v0],g.p[v1],g.val[v0],g.val[v1]), VertexInterp(iso,g.p[v0],g.p[v2],g.val[v0],g.val[v2]), VertexInterp(iso,g.p[v0],g.p[v3],g.val[v0],g.val[v3])) ] def t0D02(g, iso, v0, v1, v2, v3): return [Triangle( VertexInterp(iso,g.p[v1],g.p[v0],g.val[v1],g.val[v0]), VertexInterp(iso,g.p[v1],g.p[v3],g.val[v1],g.val[v3]), VertexInterp(iso,g.p[v1],g.p[v2],g.val[v1],g.val[v2])) ] def t0C03(g, iso, v0, v1, v2, v3): tri=Triangle( VertexInterp(iso,g.p[v0],g.p[v3],g.val[v0],g.val[v3]), VertexInterp(iso,g.p[v0],g.p[v2],g.val[v0],g.val[v2]), VertexInterp(iso,g.p[v1],g.p[v3],g.val[v1],g.val[v3])) return [tri,Triangle( tri.p[2], VertexInterp(iso,g.p[v1],g.p[v2],g.val[v1],g.val[v2]), tri.p[1]) ] def t0B04(g, iso, v0, v1, v2, v3): return [Triangle( VertexInterp(iso,g.p[v2],g.p[v0],g.val[v2],g.val[v0]), VertexInterp(iso,g.p[v2],g.p[v1],g.val[v2],g.val[v1]), VertexInterp(iso,g.p[v2],g.p[v3],g.val[v2],g.val[v3])) ] def t0A05(g, iso, v0, v1, v2, v3): tri = Triangle( VertexInterp(iso,g.p[v0],g.p[v1],g.val[v0],g.val[v1]), VertexInterp(iso,g.p[v2],g.p[v3],g.val[v2],g.val[v3]), VertexInterp(iso,g.p[v0],g.p[v3],g.val[v0],g.val[v3])) return [tri,Triangle( tri.p[0], VertexInterp(iso,g.p[v1],g.p[v2],g.val[v1],g.val[v2]), tri.p[1]) ] def t0906(g, iso, v0, v1, v2, v3): tri=Triangle( VertexInterp(iso,g.p[v0],g.p[v1],g.val[v0],g.val[v1]), VertexInterp(iso,g.p[v1],g.p[v3],g.val[v1],g.val[v3]), VertexInterp(iso,g.p[v2],g.p[v3],g.val[v2],g.val[v3])) return [tri, Triangle( tri.p[0], VertexInterp(iso,g.p[v0],g.p[v2],g.val[v0],g.val[v2]), tri.p[2]) ] def t0708(g, iso, v0, v1, v2, v3): return [Triangle( VertexInterp(iso,g.p[v3],g.p[v0],g.val[v3],g.val[v0]), VertexInterp(iso,g.p[v3],g.p[v2],g.val[v3],g.val[v2]), VertexInterp(iso,g.p[v3],g.p[v1],g.val[v3],g.val[v1])) ] trianglefs = {7:t0708,8:t0708,9:t0906,6:t0906,10:t0A05,5:t0A05,11:t0B04,4:t0B04,12:t0C03,3:t0C03,13:t0D02,2:t0D02,14:t0E01,1:t0E01,0:t000F,15:t000F} def PolygoniseTri(g, iso, v0, v1, v2, v3): triangles = [] # Determine which of the 16 cases we have given which vertices # are above or below the isosurface triindex = 0; if g.val[v0] < iso: triindex |= 1 if g.val[v1] < iso: triindex |= 2 if g.val[v2] < iso: triindex |= 4 if g.val[v3] < iso: triindex |= 8 return trianglefs[triindex](g, iso, v0, v1, v2, v3) def VertexInterp(isolevel,p1,p2,valp1,valp2): if abs(isolevel-valp1) < 0.00001 : return(p1); if abs(isolevel-valp2) < 0.00001 : return(p2); if abs(valp1-valp2) < 0.00001 : return(p1); mu = (isolevel - valp1) / (valp2 - valp1) return Vector(p1.x + mu * (p2.x - p1.x), p1.y + mu * (p2.y - p1.y), p1.z + mu * (p2.z - p1.z)) if __name__ == "__main__": main() # GRASSHOPPER PYTHON OUTPUTPOINTS = rhinoscriptsyntax.AddPoints(POINTS_CONTAINER)POINTS = rhinoscriptsyntax.CullDuplicatePoints(POINTS)…
思った感じになりません。
balls の代わりにplanarカーブを直接入れてみましたがエラーが出ます。
ファンクションにしてみたところ、forループので作った数値が反映されていません。
ファンクションのインスタンス?を出力していないと思い上記のようにしましたがエラーが出てしまいます。
以上の事から自分の認識が正しいのかよくわからなくなりました・・・
python自体の深いところをわかっているわけではないので余計こんがらがりました。
そこで、for b in ballsはどのような条件または使い方であれば使えるのでしょうか?
そして、上記のように別のオブジェクトに対しての使い方はどのようにすればできるのでしょうか?
2:同じファンクション内のdist = rs.Distance(self.pos,b.pos)についてですが
この文章も for b in balls によってbはBallのインスタンスであると定義?されたためb.posがbの位置であると分かるのでしょうか?
pythonは定義しなくても動いてしまうのでどのような時に使えるのか文章見ただけではよくわかりません・・・
大変細かいことかもしれませんが、よりpythonをしっかりと理解するためにも、どなたかわかる方ご教授いただけると幸いです。…
with various protocols and applications.
One module, led by Luis E. Fraguada will focus on the communication between Processing and Grasshopper utilizing the various protocols available through the gHowl add on for Grasshopper.
The four modules include:
Processing+Grasshopper: Luis E. Fraguada (Barcelona) - http://tinyurl.com/6m49x5e
Processing+OSC: Alba Corral (Barcelona) -
Processing+Shypon: Miguel Espada (Madrid) - http://tinyurl.com/7no8egx
OpenFrameworks+Kinect: Carles Gutierrez (Barcelona) - http://tinyurl.com/79mmsnd
For registration, please email: hola@welovecode.net.
…
Added by Luis Fraguada at 4:11am on February 29, 2012
r [String Split] in version 0.9.0014)
The [Timer] prompts a component to up date at the set interval. in this case every 1 seconds.
The [Time] param is a placeholder for a time in the same way that a [Number] param can hold real numbers.
By using "Now" as the input to the [Time] param you will get the current time when the param updates. therefore every second it resets to the current time.
The [Text Split] is there to separate the output of [Time] in a string format at every colon ":"
Therefore "Monday, 13-MAY-2013 (11:23:30)" would become:
0 Monday, 13-MAY-2013 (1
1 23
2 30)
The next two components use this to convert it into the current seconds. Because we are after the last item "30)" we can use [List Item] on a reversed list to get the last item.
Now we have to remove the ")" with [Replace String] but we are replacing it with nothing so it disappears.
The Arrow is part of the Sketch Tool Functionality of the canvas.
Lastly the 3 different inputs should go into the three different Inputs of the [Stream Filter]
…
his comes in the form of an HTML page with links to every component, so you will need to view it in your web browser. (I use Chrome and it doesn't seem to be working correctly, but when opened in IE its fine.)
2) Included in each help topic for each component is the Inputs and Outputs descriptions and data types.
3) You supply the data. What you supply and how you supply it is for you to decide. There are umpteen different ways. Are you asking for a list of those ways for each input?
4) Points can either be Rhino objects or 3D co-ordinates. To create a point you can use any of these methods, but it mostly comes down to user preference. I like using Panels as this displays outside of the component.
5) Because of the nature of vectors they represent magnitude and direction but they don't have an independent location, so there is a component that will display vectors in Rhino.
6) The user.
7) There is a Primer on the front page. Here you find the Basics, but because GH is ever evolving in its current beta state you might find things that aren't relevant any more or simply don't work the same. And here is the reason why nobody is writing an update because it could be soon out of date.
8) Importing images by either dragging them from explorer onto the canvas or right click context menu Image...
9) Single line = Single Item of Data. Double line = Multiple items of data on the same Branch. Dashed Double Line = Multiple Data on Multiple Branches.
10) User preference
11) Toolbar management is probably the bane of David's life. Most things are logically placed. For example the Curve Tab, Primitives are any simple curve types that you are creating from scratch. Similarly Splines is for more complex curve types created from scratch. Analysis is where you find components that are finding answers supplied by curves, control points, curvature, parameters, end points etc. Division is a subset of this category but has a group of its own. And Utilities is where you find curve related actions that you want to perform, offsetting, rebuilding projecting, exploding etc.
12) I would image it would have been the Point On Curve component in Curve>Analysis. Why that group? You are not putting a point on a curve you are analysing a curve for the location of a point based on some parameters that you are supplying. For example "what is the mid point?"
I hope this goes some way towards answering you questions. No doubt this will have generated more so don't be afraid to ask, it took me several releases of Explicit History (aka Grasshopper) before I realised what the egg did, it never occurred to me that I could put my objects into Rhino when I was finished. Or the fact that I could use panels to 'see' data outputs.
Al the best,
Danny…
Added by Danny Boyes at 3:48am on December 9, 2010
should follow the instruction which mostapha has wrote in https://github.com/mostaphaRoudsari/ladybug/blob/master/resources/I...
Instructions for Installing Ladybug + Honeybee: (Follow steps 1-6 for basic functionality and 1-11 for full functionality) 0. If you have an old version of LB+HB, download the file here (https://app.box.com/s/ds96em9l6stxpcw8kgtf) and open it in Grasshopper to remove your old Ladybug and Honeybee version. 1. Make sure that you have a working copy of both Rhino and Grasshopper installed. 2. Open Rhino and type "Grasshopper" into the command line (without quotations). Wait for grasshopper to load. 3. Install GHPython by downloading the file at this link (http://www.food4rhino.com/project/ghpython?ufh) and drag the .gha file onto the Grasshopper canvas. 4. Select and drag all of the files in the "userObjects" folder (downloaded with this instructions file) onto your Grasshopper canvas. You should see Ladybug and Honeybee appear as tabs on the grasshopper tool bar. (If you are reading this instruction on github you can download them from http://www.food4rhino.com/project/ladybug-honeybee) 5. Download the files at this link (https://app.box.com/s/bh9sbpgajdtmmystv3n4), unzip them and copy the contents to both C:\ladybug and C:\Users\[yourUsername]\AppData\Roaming\Ladybug. 6. Restart Rhino and Grasshopper. You now have a fully-functioning Ladybug. For Honeybee, continue to the following: 7. Install Radiance to C:\Radiance by downloading it from this link (https://github.com/NREL/Radiance/releases/download/4.2.2/radiance-4...) and running the exe. 6. Install Daysim to C:\DAYSIM by downloading it at this link (http://daysim.ning.com/page/download) and running the exe. 8. Install Energy Plus 8.1 to C:\EnergyPlusV8-1-0 by going to the DOE website (http://apps1.eere.energy.gov/buildings/energyplus/energyplus_downlo...), making an account, going to "download older versions of EnergyPlus, selecting 8.1 and running the exe. 9. Copy falsecolor2.exe (http://pyrat.googlecode.com/files/falsecolor2.exe) and evalglare.exe (http://www.ise.fraunhofer.de/en/downloads-englisch/software/evalgla...) to C:\Radiance\bin 10. Download the OpenStudio Libraries (https://app.box.com/s/y2sx16k98g1lfd3r47zi) and unzip them to C:\ladybug\OpenStudio. 11. You now have a fully-working version of Ladybug + Honeybee. Get started visualizing weather data with these video tutorials (https://www.youtube.com/playlist?list=PLruLh1AdY-Sj_XGz3kzHUoWmpWDX...).
It works for me..
Agus…
he "return" is comment out as shown below?
After restarting Rhino and Grasshopper, I opened the outdoors_airflow demo file, and the first step of creating the case file is ok:
Then the blockMesh component gives the following error: seems I have to manually start OF first..
so, as the error message suggested, I open OF by Start_OF.bat:
Then come back to the blockMesh component, now it can be executed while the OF command line window is also openning:
... and the blockMesh finished successfully:
... so I proceeded to run snappyHexMesh, checkMesh and update fvScheme:
... up to the simpleFoam component, I got the error again:
The warning message is:
1. Solution exception: --> OpenFOAM command Failed!#0 Foam::error::printStack(Foam::Ostream&) in "/opt/OpenFOAM/OpenFOAM-v1606+/platforms/linux64GccDPInt32Opt/lib/libOpenFOAM.so" #1 Foam::sigFpe::sigHandler(int) in "/opt/OpenFOAM/OpenFOAM-v1606+/platforms/linux64GccDPInt32Opt/lib/libOpenFOAM.so" #2 ? in "/lib64/libc.so.6" #3 double Foam::sumProd<double>(Foam::UList<double> const&, Foam::UList<double> const&) in "/opt/OpenFOAM/OpenFOAM-v1606+/platforms/linux64GccDPInt32Opt/lib/libOpenFOAM.so" #4 Foam::PCG::solve(Foam::Field<double>&, Foam::Field<double> const&, unsigned char) const in "/opt/OpenFOAM/OpenFOAM-v1606+/platforms/linux64GccDPInt32Opt/lib/libOpenFOAM.so" #5 Foam::GAMGSolver::solveCoarsestLevel(Foam::Field<double>&, Foam::Field<double> const&) const in "/opt/OpenFOAM/OpenFOAM-v1606+/platforms/linux64GccDPInt32Opt/lib/libOpenFOAM.so" #6 Foam::GAMGSolver::Vcycle(Foam::PtrList<Foam::lduMatrix::smoother> const&, Foam::Field<double>&, Foam::Field<double> const&, Foam::Field<double>&, Foam::Field<double>&, Foam::Field<double>&, Foam::Field<double>&, Foam::Field<double>&, Foam::PtrList<Foam::Field<double> >&, Foam::PtrList<Foam::Field<double> >&, unsigned char) const in "/opt/OpenFOAM/OpenFOAM-v1606+/platforms/linux64GccDPInt32Opt/lib/libOpenFOAM.so" #7 Foam::GAMGSolver::solve(Foam::Field<double>&, Foam::Field<double> const&, unsigned char) const in "/opt/OpenFOAM/OpenFOAM-v1606+/platforms/linux64GccDPInt32Opt/lib/libOpenFOAM.so" #8 Foam::fvMatrix<double>::solveSegregated(Foam::dictionary const&) in "/opt/OpenFOAM/OpenFOAM-v1606+/platforms/linux64GccDPInt32Opt/lib/libfiniteVolume.so" #9 Foam::fvMatrix<double>::solve(Foam::dictionary const&) in "/opt/OpenFOAM/OpenFOAM-v1606+/platforms/linux64GccDPInt32Opt/bin/simpleFoam" #10 Foam::fvMatrix<double>::solve() in "/opt/OpenFOAM/OpenFOAM-v1606+/platforms/linux64GccDPInt32Opt/bin/simpleFoam" #11 ? in "/opt/OpenFOAM/OpenFOAM-v1606+/platforms/linux64GccDPInt32Opt/bin/simpleFoam" #12 __libc_start_main in "/lib64/libc.so.6" #13 ? in "/opt/OpenFOAM/OpenFOAM-v1606+/platforms/linux64GccDPInt32Opt/bin/simpleFoam"
... and the command lines in the readMe! output are pretty long and it is saved in the text file attached here.
So, my questions are:
1. why I have to manually start OF first before I can use the blockMesh component? Should butterfly automatically start OF?
2. what might be the cause of the unsuccessful run of simpleFoam in the end?
Hope you can kindly advise! Thank you!
- Ji
…
rested in specializing in the field of Computational design.
The workshop will help understand how Grasshopper facilitates during the design process allowing one to Generate, Automate and Manipulate data.
To Register:
Mail us at intofablab@gmail.com
Workshop Structure:
Day 01: 11 February 2019
Introduction to Computational Processes in Architecture
Understanding Grasshopper and its relation to Rhino3D
Working with fields and Grids (Supplementary readings for Architectural theory)
Spatial Concepts using Data
Day 02: 12 February 2019
Understanding Data in Grasshopper - LISTS
Managing Data in Grasshopper (Supplementary reading)
Experimentation on Massing and Architectural Forms
Day 03: 13 February 2019
Understanding Data in Grasshopper – Trees
Surface Logics (Supplementary reading)
Design Exercise and Prototyping
Day 04: 14 February 2019
Architectural Skins
Day 05: 15 February 2019
MasterClass Project
Introduction to various types of Digital Fabrications
Prototyping of works during the Workshops
Basic knowledge of Rhino 5 is required to be able to take this training.
CERTIFICATION: All participants will receive a Workshop certificate from Authorized Rhino Trainer.
3D Printing: Prototyping of works during the Workshops
Workshop Tutor:
Kavitha M, an Architect and Computational Designer, 3D Printing Specialist is also the co-founder of INTO Design Research, will head the Computational Process in Architecture using Grasshopper workshop. Graduated from Stadelschule Architecture class with Masters in Advanced Architecture Design, has been researching on teaching methodologies on digital tools and their influence on Design thinking.…