Grasshopper

algorithmic modeling for Rhino

I'm new to grasshopper... I'm working with a group of regular buildings and want to find a way to view the supposed shadows of these buildings created by the sun during certain hours of the afternoon.  Is this possible?

Views: 9467

Attachments:

Replies to This Discussion

The basic components you need are in the Mesh>Util dropdown menu.

 

Chris

This will only cast shadows onto flat planes though. It seems Caroline has a freeform ground. One possible way forward from Chris' solution would be to create an extrusion of the shadow outline, then intersect this extrusion (Mesh|Mesh intersection probably makes the most sense) with the ground shape.

 

It sounds somewhat tricky but probably do-able. Unfortunately I've broken the file-format in the internal release so any files I creates you won't be able to open.

 

--

David Rutten

david@mcneel.com

Poprad, Slovakia

Nah forget that. The Rhino MeshMesh intersector just can't handle this. Which is odd since it doesn't seem like a difficult problem.

 

You also have to make absolutely sure that none of the buildings poke out the bottom of the landscape shape, or they'll cast 'reverse shadows' in front of them.

 

--

David Rutten

david@mcneel.com

Poprad, Slovakia

Ok, good news after all. The Rhino SDK offers two different MeshMesh intersection algorithms. The Mesh intersector component uses something called MeshMeshAccurate(). If you use the other one (called MeshMeshFast) you get the correct result. Albeit as a collection of loose line segments instead of closed curves. But you just have to use an extra Curve Join component to perform the last step.

 

You'll need to create a VB Script component and set the x and y input type hint to Mesh. Then add the following code:

 

A = Intersect.Intersection.MeshMeshFast(x, y)

 

This seems to give correct results in my test case.

 

--

David Rutten

david@mcneel.com

Poprad, Slovakia

 

I added both algorithms to the Mesh|Mesh component, with an option in the component menu to toggle between them. The default is off (so that the component works the same as before). 

 

 

The difference between both algorithms is

 

MeshMeshAccurate:

 

MeshMeshFast:

--

David Rutten

david@mcneel.com

Poprad, Slovakia

Oh, and MeshMeshFast including a massive Curve Join operation takes 17ms on the above example whereas MeshMeshAccurate takes 220ms. More than 12 times as fast.

 

I think I might switch on the Alternative Algorithm by default after all.

 

--

David Rutten

david@mcneel.com

Poprad, Slovakia

Can you add an info flag somewhere to alert users that this particular intersection routine has an alternate algorithm option?

 

I know I'm going to forget by the time I need to use it...

It's on by default. I could make this an import option instead of a hard-to-find menu item. Would that be any better?

 

--

David Rutten

david@mcneel.com

Poprad, Slovakia

I guess that's what I was thinking if adding another input doesn't irk your component consistency standards (for the 10% of the time it might matter).

 

 

Hi David and team,

I am wondering if someone can give me a few tips on how to handle curves after MeshMesh intersection. I am trying to contour casted shadows. It works fine on flat planes as you can see on  attached jpg. David’s method of casting shadows on flat planes using MeshMesh intersection also worked. The problem is that I can’t contour my shadows any more. Any idea how can I find a contour normal to each shadow?

Thanks.

Hi Volha

If you upload your files to I can look into for you.

Hi Danny,

Thank you for your response. Please disregard my question. I was able to figure it out on my own. I simply  projected my shadow lines from a flat plane to a free form surface. It worked.

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service