algorithmic modeling for Rhino

- Comment on: Topic 'recursion in c#'
*n; n = (int) (Math.Log10((double) nfaces / 20.0) / Math.Log10(4.0)); double t = (1.0 + Math.Sqrt(5.0)) / 2.0; double c = Math.Sqrt(1 + (1.0 + Math.Sqrt(5.0)) * (1.0 + Math.Sqrt(5.0)) / 4.0); //Icosaedron Rhino.Geometry.Mesh mesh = new Rhino.Geometry.Mesh(); mesh.Vertices.Add(-1 / c, t / c, 0); mesh.Vertices.Add(1 / c, t / c, 0); mesh.Vertices.Add(-1 / c, -t / c, 0); mesh.Vertices.Add(1 / c, -t / c, 0); mesh.Vertices.Add(0, -1 / c, t / c); mesh.Vertices.Add(0, 1 / c, t / c); mesh.Vertices.Add(0, -1 / c, -t / c); mesh.Vertices.Add(0, 1 / c, -t / c); mesh.Vertices.Add(t / c, 0, -1 / c); mesh.Vertices.Add(t / c, 0, 1 / c); mesh.Vertices.Add(-t / c, 0, -1 / c); mesh.Vertices.Add(-t / c, 0, 1 / c); mesh.Faces.AddFace(0, 11, 5); mesh.Faces.AddFace(0, 5, 1); mesh.Faces.AddFace(0, 1, 7); mesh.Faces.AddFace(0, 7, 10); mesh.Faces.AddFace(0, 10, 11); mesh.Faces.AddFace(1, 5, 9); mesh.Faces.AddFace(5, 11, 4); mesh.Faces.AddFace(11, 10, 2); mesh.Faces.AddFace(10, 7, 6); mesh.Faces.AddFace(7, 1, 8); // 5 faces around point 3 mesh.Faces.AddFace(3, 9, 4); mesh.Faces.AddFace(3, 4, 2); mesh.Faces.AddFace(3, 2, 6); mesh.Faces.AddFace(3, 6, 8); mesh.Faces.AddFace(3, 8, 9); // 5 adjacent faces mesh.Faces.AddFace(4, 9, 5); mesh.Faces.AddFace(2, 4, 11); mesh.Faces.AddFace(6, 2, 10); mesh.Faces.AddFace(8, 6, 7); mesh.Faces.AddFace(9, 8, 1); for (int i = 0; i < n; i++) { Rhino.Geometry.Mesh mesh_rec = new Rhino.Geometry.Mesh(); recursiveSubdivision(mesh, ref mesh_rec); mesh = mesh_rec; } mesh.Vertices.CombineIdentical(true, true); mesh.Normals.ComputeNormals(); mesh.Compact(); A = mesh; } // <Custom additional code> public void recursiveSubdivision(Mesh mesh, ref Mesh mesh_rec) { int ind = 0; for (int i = 0; i < mesh.Faces.Count; i++) { Point3f A = new Point3f(mesh.Vertices[mesh.Faces[i].A].X, mesh.Vertices[mesh.Faces[i].A].Y, mesh.Vertices[mesh.Faces[i].A].Z); Point3f B = new Point3f(mesh.Vertices[mesh.Faces[i].B].X, mesh.Vertices[mesh.Faces[i].B].Y, mesh.Vertices[mesh.Faces[i].B].Z); Point3f C = new Point3f(mesh.Vertices[mesh.Faces[i].C].X, mesh.Vertices[mesh.Faces[i].C].Y, mesh.Vertices[mesh.Faces[i].C].Z); ind = mesh_rec.Vertices.Count; mesh_rec.Vertices.Add(A);//0 mesh_rec.Vertices.Add(middle(A, B)); mesh_rec.Vertices.Add(B); mesh_rec.Vertices.Add(middle(B, C)); mesh_rec.Vertices.Add(C); mesh_rec.Vertices.Add(middle(C, A)); mesh_rec.Faces.AddFace(ind + 0, ind + 1, ind + 5); mesh_rec.Faces.AddFace(ind + 1, ind + 3, ind + 5); mesh_rec.Faces.AddFace(ind + 1, ind + 2, ind + 3); mesh_rec.Faces.AddFace(ind + 5, ind + 3, ind + 4); } } public Point3f middle(Point3f A, Point3f B) { Point3f AB = new Point3f(); float length; AB.X = (A.X + B.X) / 2; AB.Y = (A.Y + B.Y) / 2; AB.Z = (A.Z + B.Z) / 2; length = (float) Math.Sqrt(AB.X * AB.X + AB.Y * AB.Y + AB.Z * AB.Z); AB.X = AB.X / length; AB.Y = AB.Y / length; AB.Z = AB.Z / length; return AB; }…*- Added by Laurent DELRIEU at 12:58pm on August 6, 2016

- Comment on: Topic 'Vector Mutiply Button?'
*vector * number 8. number * point 9. point * number 10. complex * complex 11. colour * colour 12. colour * number 13. number * colour -- David Rutten david@mcneel.com Seattle, WA…*- Added by David Rutten at 10:39pm on November 12, 2010

- Comment on: Topic 'Lofting Sequence not working out - Lists or Paths?'
*are on their own paths, but the first branch contains 3 curves and the second one 2 curves. If you want the same result for all pairs of curves you'd need to split up the first and second branches, so that all curves are on their own branch.…*- Added by Lars Renklint at 4:33am on September 6, 2009

- Comment on: Topic 'Little wish!'
*..... btw slider=50 gives me slider with integers. to make rounded i have to write slider=50.0…*- Added by Philipp at 4:23pm on September 1, 2011

- Comment on: Blog Post 'Umbilic Torus'
*Y(): cos(u)*((11+cos((v/1)-(13*v))+(2*cos((u/.25)+v))-v)-v) Z(): sin(u)*((11+cos((v/1)-(13*v))+(2*cos((u/.25)+v))-v)-v) [u]:-pi, pi [v]:-pi, pi ------------------------------------------------------------ Cordially Torolf…*- Added by Torolf Sauermann at 9:29am on June 11, 2009

- Comment on: Topic 'path mapper'
*is one path with 11 elements so you have to take B because it has a number series from 0 to 3 because you have 4 curves than everything works ;)…*- Added by to] at 12:58pm on February 19, 2010

- Comment on: Group 'SpiderWeb'
*ve a Vertex [V] connected to four other Vertexs [N1-N4]. Each of the has a Value: V ... 1 N1 ... 5 N2 ... 3 N3 ... 8 N4 ... 11 The Average Filter would set the Value of [V] to (1+5+3+8+11)/5 = 5,6 The Median Filter would Sort Values and pick the middle one 1,3, [5], 8, 11 Hope that helped...…*- Added by Richard Schaffranek to SpiderWeb at 4:44am on August 31, 2012

- Event: Grasshopper on Stage
- 9+10 in Vienna. Further dates in Munich will follow in March 11.…
- Added by michaeldrobnik at 3:39pm on January 17, 2011

- Topic: RunEnergySimulation error: 'hb_EPZoneSurface' object has no attribute 'punchedGeometry' (from Chris' tutorials)
- know how to solve. It appears in 11 - Honeybee Energy Modeling - The Laws of Geometry in E+ Part 3: Curved Geometry where I need to retrieve .idf file, and shows this message: 1. Solution exception:'hb_EPZoneSurface' object has no attribute 'punchedGeometry' I've added .gh file at a state where I meet the problem. Also, I've looked around the forum and found some mention OpeanStudio related problems, mainly one's lack of it. Could it be the source of the problem, because I only followed Installation Instructions and haven't installed OpenStudio. …
- Added by Tim to Ladybug Tools at 11:41pm on January 30, 2016

- Topic: Untitled
- ) 3. KeyError(1417,) 4. KeyError(1417,) 5. KeyError(1417,) 6. KeyError(1417,) 7. KeyError(1417,) 8. KeyError(1417,) 9. KeyError(1417,) 10. KeyError(1417,) 11....... i tried different weather file but also same result. it seems i have same problem. the file am working on is the radiation file i took from the examples . whats seems to be the problem? thank you for your time…
- Added by ahmad nour to Ladybug Tools at 5:20am on January 12, 2016

© 2023 Created by Scott Davidson. Powered by