Grasshopper

algorithmic modeling for Rhino

Hello everyone, 
I need a help regarding rhino scripting. I'm a 5th yr B.Arch. student from India, currently doing my thesis on " Exploring principles of plectic architecture to design a system for activating urban voids ".
For the same, i'm require a RHINO SCRIPT which can probably TRIANGULATE a surface or guide a form/surface, using EQUAL SIZED EQUILATERAL TRIANGLES (of size 5m, in my case).
Ive come across a lot of rhino scripts for triangulation with fabrication drawings, apart from conventional methods of triangulation in Rhinoceros, but could not tweak the script desirably.
Please help!

Regards
Sushant Verma
sushantverma16@gmail.com 

Views: 26175

Replies to This Discussion

Do you have any images of what you are trying to create in Grasshopper?
Thank you for responding to the query. But unfortunately, i do not have any images. And i'm not tryin to create in grasshoper but by scripting.
Infact, i should have mentioned that i'm new to GH and dun even know much of scripting. I just know how to run scripts and sometimes, modify them.
As per my design, i need to create surfaces (of any degree) which are formed of EQUILATERAL TRIANGLES.
I'll attach an image of a surface and block created through triangles, manually.
Attachments:
Thanks for posting the image. That is very helpful. I don't know rhinoscript but as a sculptor, I often sculpt similar forms using triangle based polygon meshes. When dealing with multi-triangular forms, meshes provide a very convenient way to modify the collection of triangles. When you change one triangle, all the adjacent triangles automatically adjust their edge lengths to maintain their edge or vertex coincidence. Unfortunately, this method does not provide a way to assure the triangles remain equilateral.

Stan
@Stan, Thank you very much for giving time to this query and givin it a shot!
Thnks!

Sushant
The image you have attached shows some squares as well, which seem fairly randomly placed. To begin with, you need to simplify this whole thing conceptually. Removing the squares and starting with a 4 sided surface (instead of the fragmented one in your image) is a good place to begin with. This would have to be a bottom-up process, which means it would need recursion, which implies you would have to either do it in RhinoScript or inside a script node in Grasshopper, the native interface in GH doesn't support recursion as yet.

I'll take a rough stab at the pseudocode:

1. Get any one of the 4 edges of the surface, and simplify it into a polyline of equal length segments (Divide Distance Component), this length is your target edge length.

2. The first segment of this polyline is your starting point. From each of the end points of this line, make a sphere with radius being your desired edge length, and intersect with the surface. This gives you two circles on the surface, which intersect at 2 points (most probably 1 of them is outside the surface).

3. Both of these points are eligible to be the third point of the triangle. Once you make the first triangle, you need to 'grow' more triangles from each edge of this triangle, until no more triangles fit on the surface.

4. The first triangle shouldn't give you much problem if you start with an edge, but most subsequent triangles will have to be tested for intersection with other triangles, and there will certainly be cases when you end up with gaps between neighbouring triangles.

5. Another tricky part to handle that I can imagine is that each new triangle will produce two new edges, which will give 'birth' to two new triangles. So with each new pair generated, you will need some mechanism that flags your 'naked edges' and saves them for 'growing' the next iteration of triangles.

I should add that if you're inadept with scripting or Grasshopper, this is a fairly massive task in terms of its geometric complexity as well as data flow logic. I hope someone hear can come up with a simpler method than the one I presented to solve this.

Good Luck.
Hi, I'm sorry to say the above won't work, rather it would only work on a flat surface or single curvature surface.

The problem I would think has to do with surface curvature and precision, i mean how much the triangulated surface(mesh) would resemble the original surface.

Cheers

Evert
Hey Suryansh,
thnx for givin time and tryin to help me out in this. Unfortunately, i dun know how to use GH even at a basic level...just been able to run through some tutorials and all..
But acc. to the points you made, it does help in understanding the geometry of the same. The image I attached, of the surface was modeled through a bottom up approach of starting on a physical model, and then translating it to a digital one, with visual judgement of angles. The square that is visible in the image, was a defect of the render, as the angle dip was very low.
Anyways, ive been able to figure out a way of doing this, in Sketchup, which can be fudged when taken as view....so...might as well go for that, of nothing works out..

I was actually thinking if i can have a surface (flat) which is made of Equilateral Triangles onto it (somewhat like welded to each other) and the surface can be pulled/pushed to get the gradation.... Just thinkin of possibilities of doing that this time..hope it works out..

Will upload the images if i find a Non-scriptive/non-GH type way as well..!
Thanks for givin it time.
Regards
Sushant
@Christophe Barlieb, Thnx fr replyin to the query...
I just checked out the photos that you had posted...
Well, THIS IS WHAT I'M LOOKIN FOR!! :D
Wud be great if you can share the defination wenever u can..!
Apart from that, CAN YOU PLS SHARE THE FILE (3dm) of which the screenshots are?

Thank You
Sushant

Unless your surface is developable, it is a mathematical impossibility to tile it with only flat equilateral triangles, all meeting exactly, with 6 around a vertex. Sorry.

 

As you say, 6 equilateral triangles around a vertex make an angle of 360°, but the variation or defect from this angle is exactly what enables a polyhedral surface to form a discrete version of double curvature.

 

In fact there is a precise relationship between the Gaussian curvature of a smooth surface, and the angle defects of its polyhedral version - the curvature can be regarded as concentrated at the vertices. As you refine the division into more and more smaller faces, getting closer to smoothness, the angle defects at each of the vertices get smaller, but their total remains the same. So as long as you have a finite number of triangles, they can get closer to all being equilateral, with 360° around each vertex, but never quite get there.

 

For example, in the case of a closed surface without handles, the angle defects will always sum to 720° (this is Descartes' theorem, and the Gauss-Bonnet theorem generalizes this to a relationship between the integral of Gaussian curvature and the topology of a surface).

A regular icosahedron is a special case, where the angle defect is divided into whole multiples of 60° -  so one triangle short of a full circle at each of the 12 vertices - but for most numbers of faces there will be no such neat division.

 

This being said, if you accept that what you want will not be achievable exactly, and allow some level of error from your conditions (such as not having the triangles touch exactly, or some amount of size/angle variation), then there are ways of finding an approximation.

 

In Kangaroo you can constrain points to a surface then use a combination of mutual attraction or repulsion and spring forces to relax points towards an even distribution. I'll post an example soon.

There are also some extra equalization functions coming in the new version that will help with this.

I tried something like this in Kangaroo (scaling a geodesic sphere then relaxing the elements on it).

It makes some improvements in the triangle equality, especially if you only take the top half and allow the lower boundary to distort, but they're still a way off equilateral. As you'd expect, the greatest variation is in the triangles that meet 5 around a vertex.

In the model shown here, the edge length ratio for those is around 1.24 and I don't think you'd get much better than that, even if you used many more triangles. If you disregard those ones, the next worst ratio is around 1.14

Here's the Rhino output from the above if you want to take a look at the kind of variation achieved.

I can't share the GH definition right now, because it is using the newer version of Kangaroo, which isn't quite ready for release yet, but I'll post it as soon as it is.

Attachments:

any update on how to do this daniel?

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service