# Shadow boundary extraction

**URL:** <https://forum.dynamobim.com/t/shadow-boundary-extraction/9045>\
**Category:** Revit\
**Created:** [January 22, 2017, 2:06pm UTC](https://forum.dynamobim.com/t/shadow-boundary-extraction/9045 "2017-01-22T14:06:58Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ahmed\_Salah1](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/ahmed_salah1/32/17112_2.png) [@Ahmed\_Salah1](https://forum.dynamobim.com/u/Ahmed_Salah1)\
**Post date:** [January 22, 2017, 2:06pm UTC](https://forum.dynamobim.com/t/shadow-boundary-extraction/9045/1 "2017-01-22T14:06:58Z")

</div>

i have a problem while i`m doing my shadow study that i need to the cut plan to be in ground but also have the full geometry shadow appears in the same level then calculate the shadowed area

so what i thought of is there a way of extract the shadow boundary then use it to create a surface or maybe filled region to show it in the same level and also calculate the area of it

i have no idea what packages should i use but i searched for ladybug and read it`s primer and i can`t find the nodes related to shadow in dynamo  
anyway if any body have an idea or an workflow for that kindly suggest

@Mostafa_El_Ayoubi My always helper 😃 !

---

<div class="post-metadata">

**Author:** ![Ahmed\_Salah1](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/ahmed_salah1/32/17112_2.png) [@Ahmed\_Salah1](https://forum.dynamobim.com/u/Ahmed_Salah1)\
**Post date:** [January 22, 2017, 2:25pm UTC](https://forum.dynamobim.com/t/shadow-boundary-extraction/9045/2 "2017-01-22T14:25:36Z")

</div>

@Paul_Wintour may be you have a solution !

---

<div class="post-metadata">

**Author:** ![Zach\_Kron](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/zach_kron/32/349_2.png) [@Zach\_Kron](https://forum.dynamobim.com/u/Zach_Kron)\
**Post date:** [January 22, 2017, 2:26pm UTC](https://forum.dynamobim.com/t/shadow-boundary-extraction/9045/3 "2017-01-22T14:26:10Z")

</div>

It isn’t everything, but here’s a start  
 ![](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/4/0/409b305326bb5ba6eea52c757e74048ef4455109.png)  
[ShadowCasting\_ProjectOnto.dyn](https://forum.dynamobim.com/uploads/short-url/jIM7g9Ab8khDfgNHesccGBDeKC9.dyn) (23.5 KB)

 ![](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/2/f/2fc19ce18657b7a10019c3b34ab114dadef1c8cf.png)

---

<div class="post-metadata">

**Author:** ![viktor\_kuzev](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/viktor_kuzev/32/48254_2.png) [@viktor\_kuzev](https://forum.dynamobim.com/u/viktor_kuzev)\
**Post date:** [January 23, 2017, 9:37am UTC](https://forum.dynamobim.com/t/shadow-boundary-extraction/9045/4 "2017-01-23T09:37:02Z")

</div>

I can suggest a different approach.

1st. Creating a non-perspective camera that shows a plan view. We need that to get an accurate shadow:

 ![](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/6/8/689ff4eed36bd95c385b9ffa61837d7c9340b336.PNG)  
 ![](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/7/f/7fa4437ec658b7be1bb093f2410bfa4d83101872.PNG)

2nd. The view should be in “Hidden Line” so we only have 3 colors.  
3rd. Measuring the viewport size. In my case the width of the viewport is 30 000 mm.  
4th. Exporting the image in a lossless format so we don’t get some pixel artefacts.

 ![](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/0/c/0c43e508b013c835efe3f038c0ad3bb55ff901e2.PNG)  
5th. Using Dynamo to count the grey pixels (the shadow) and calculate it’s area.  
 ![](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/8/a/8aa063c129bc59ac950c0baeb7497903898ea19c.png)

---

<div class="post-metadata">

**Author:** ![jostein\_olsen](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jostein_olsen/32/8570_2.png) [@jostein\_olsen](https://forum.dynamobim.com/u/jostein_olsen)\
**Post date:** [January 23, 2017, 12:50pm UTC](https://forum.dynamobim.com/t/shadow-boundary-extraction/9045/5 "2017-01-23T12:50:57Z")

</div>

I think there is a way of doing this with the Revit API, but I do not have the time at the moment to dig in to it. Maybe someone else can?

[http://www.revitapidocs.com/2016/ba9e3283-6868-8834-e8bf-2ea9e7358930.htm](http://www.revitapidocs.com/2016/ba9e3283-6868-8834-e8bf-2ea9e7358930.htm)

---

<div class="post-metadata">

**Author:** ![viktor\_kuzev](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/viktor_kuzev/32/48254_2.png) [@viktor\_kuzev](https://forum.dynamobim.com/u/viktor_kuzev)\
**Post date:** [January 23, 2017, 12:57pm UTC](https://forum.dynamobim.com/t/shadow-boundary-extraction/9045/6 "2017-01-23T12:57:51Z")

</div>

@jostein_olsen I found those articles on this topic:

> **[Sun Direction, Shadow Calculation and Wizard Update](http://thebuildingcoder.typepad.com/blog/2013/06/sun-direction-shadow-calculation-and-wizard-update.html#3)**
>
> I enjoyed some wonderful hot sunny days since I returned from New England back to Switzerland. Summer finally arrived. A nice change after the rain and cold both here and in New Hampshire and Massachusetts. Talking about rain and sun leads up nicely...

  

> **[Extrusion Analyser and Plan View Boundaries](http://thebuildingcoder.typepad.com/blog/2013/04/extrusion-analyser-and-plan-view-boundaries.html)**
>
> Continuing the research and development for my cloud-based round-trip 2D Revit model editing project, I looked at using the ExtrusionAnalyzer to create a plan view boundary profile for the furniture and equipment family instances and implemented a...

They seem interesting, but I also don’t have the time to go deep into them right now.

---

<div class="post-metadata">

**Author:** ![Ahmed\_Salah1](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/ahmed_salah1/32/17112_2.png) [@Ahmed\_Salah1](https://forum.dynamobim.com/u/Ahmed_Salah1)\
**Post date:** [January 24, 2017, 5:03am UTC](https://forum.dynamobim.com/t/shadow-boundary-extraction/9045/7 "2017-01-24T05:03:08Z")

</div>

@Zach_Kron  
as u see in the image i need to find a way to clear the intersection fro circle on the planner surface i need them to be one closed boundary , any ideas !

 ![](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/9/3/93a32351b07729d580ea0e7fc73a7e1bf720c7c2.PNG)

---

<div class="post-metadata">

**Author:** ![Ahmed\_Salah1](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/ahmed_salah1/32/17112_2.png) [@Ahmed\_Salah1](https://forum.dynamobim.com/u/Ahmed_Salah1)\
**Post date:** [January 24, 2017, 5:03am UTC](https://forum.dynamobim.com/t/shadow-boundary-extraction/9045/8 "2017-01-24T05:03:47Z")

</div>

the project i work on is too big but i will try it thank you @viktor_kuzev
