# Grid vector direction

**URL:** <https://discourse.pollination.solutions/t/grid-vector-direction/4017>\
**Category:** Rhino Plugin\
**Tags:** feature-request\
**Created:** [June 9, 2024, 9:27pm UTC](https://discourse.pollination.solutions/t/grid-vector-direction/4017 "2024-06-09T21:27:18Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![byron](https://discourse.pollination.solutions/user_avatar/discourse.pollination.solutions/byron/32/7751_2.png) [@byron](https://discourse.pollination.solutions/u/byron)\
**Post date:** [June 9, 2024, 9:27pm UTC](https://discourse.pollination.solutions/t/grid-vector-direction/4017/1 "2024-06-09T21:27:18Z")

</div>

I was just wondering if it would be possible to expose the grid direction when setting up a simulation through the Rhino Environmental Analysis interface?

![image](https://discourse.pollination.cloud/uploads/default/original/2X/4/4a423075c884188912996e18a0bcfa8a301ec5a2.png)

Vertical planar grids is something I test a lot and it would be amazing to have the option to have grids facing up (0.0.1)

---

<div class="post-metadata">

**Author:** ![mostapha](https://discourse.pollination.solutions/user_avatar/discourse.pollination.solutions/mostapha/32/5761_2.png) [@mostapha](https://discourse.pollination.solutions/u/mostapha)\
**Post date:** [June 9, 2024, 10:49pm UTC](https://discourse.pollination.solutions/t/grid-vector-direction/4017/2 "2024-06-09T22:49:42Z")

</div>

Assigned @chriswmackey on June 9, 2024, 10:49pm UTC



---

<div class="post-metadata">

**Author:** ![chriswmackey](https://discourse.pollination.solutions/user_avatar/discourse.pollination.solutions/chriswmackey/32/6207_2.png) [@chriswmackey](https://discourse.pollination.solutions/u/chriswmackey)\
**Post date:** [June 10, 2024, 6:41pm UTC](https://discourse.pollination.solutions/t/grid-vector-direction/4017/3 "2024-06-10T18:41:58Z")

</div>

Thanks, @byron .

Can you be more specific about what you mean here and why you want it? For something like a direct sun study, setting like the direction of a sensor normal to `(0, 0, 1)` is kinda meaningless given that all sun vectors are already pointing above the horizon.

Is this only for radiation studies or something like that?

---

<div class="post-metadata">

**Author:** ![byron](https://discourse.pollination.solutions/user_avatar/discourse.pollination.solutions/byron/32/7751_2.png) [@byron](https://discourse.pollination.solutions/u/byron)\
**Post date:** [June 12, 2024, 8:35pm UTC](https://discourse.pollination.solutions/t/grid-vector-direction/4017/4 "2024-06-12T20:35:36Z")

</div>

Hi @chriswmackey ,

There are many cases where it is very useful for me to run a vertical grid to demonstrate distribution of solar access, solar radiation, or daylight (this is a different topic as not included in the Environmental Analysis tab) throughout a space, ie an atrium.

In GH I can manipulate all vectors to “look up” in my Honeybee runs.

For solar access or solar radiation, you have to simulate the surface twice, vectors facing either way, and then add up to get the total.

I guess, in the pollination method - through the Environmental Analysis - for solar studies, the Grid surface is also casting shadows? (same as in GH LB). If so, then what I am asking does not make sense.

If the creation of the grid though is only a point system, and does not include the surface as a “context”, then “facing up” could be very beneficial.

very simplistic example below.

 ![image](https://discourse.pollination.cloud/uploads/default/original/2X/9/9ce18eea4dd12fea6c93c3a18c0e0b9699641f2e.png)

---

<div class="post-metadata">

**Author:** ![chriswmackey](https://discourse.pollination.solutions/user_avatar/discourse.pollination.solutions/chriswmackey/32/6207_2.png) [@chriswmackey](https://discourse.pollination.solutions/u/chriswmackey)\
**Post date:** [June 12, 2024, 9:25pm UTC](https://discourse.pollination.solutions/t/grid-vector-direction/4017/5 "2024-06-12T21:25:31Z")

</div>

Thanks for providing more information, @byron .

So, if I’m putting this request into my own words, you would like to have an option (just on the `PO_DirectSun` command for now) that allows you to toggle off whether the input geometry blocks the sun or not. So, when you toggle off the geometry-blocking behavior, you’re looking at the number of hours seen by each point in the geometry mesh rather than the number of hours seen by the Surface of the geometry (accounting for the direction that the surface geometry is pointing).

If so, then yea I think that’s useful and do-able.

Honestly, I have already been considering whether the [LB Direct Sun](https://docs.ladybug.tools/ladybug-primer/components/3_analyzegeometry/direct_sun_hours) component should get a new optional input for `geo_block_`, which works the exact same way as the input on the [LB View Percent](https://docs.ladybug.tools/ladybug-primer/components/3_analyzegeometry/view_percent) component works.

An input like this would make some things people have requested a lot easier. For example, the results could help Ladybug users make visualizations of only new shadows cast by a given geometry:

> **[Shadow Analysis Approach](https://discourse.ladybug.tools/t/shadow-analysis-approach/25027/2)**
>
> Hi @rivindub Both Legacy Ladybug and LBT Ladybug have components that run relatively quick shadow studies using Rhino’s built in renderer and your GPU. In LBT, this is done with the LB Set Rhino Sun component. It’s much faster than than the LB...

 ![image](https://discourse.pollination.cloud/uploads/default/original/2X/6/6d6b35b94c77bcbcb70813ebffefa969b7776e07.png)

If you’re telling me you have more cases like this that would benefit from being able to turn off the geometry-blocking behavior, then let me implement something on the [LB Direct Sun Hours](https://docs.ladybug.tools/ladybug-primer/components/3_analyzegeometry/direct_sun_hours) component now. If you get the chance to test the Ladybug component and confirm that it gives you what you want, I’ll add it as an option on the `PO_DirectSun` command.

---

<div class="post-metadata">

**Author:** ![byron](https://discourse.pollination.solutions/user_avatar/discourse.pollination.solutions/byron/32/7751_2.png) [@byron](https://discourse.pollination.solutions/u/byron)\
**Post date:** [June 12, 2024, 9:44pm UTC](https://discourse.pollination.solutions/t/grid-vector-direction/4017/6 "2024-06-12T21:44:03Z")

</div>

Hi @chriswmackey,

thank you for the answer. I think adding that option might be a very interesting idea even on the LB components.

As a side note, I find it very common to have to explain to students that geometry assigned as a grid is self shading and acts as context.

The issue will be with people forgetting then to add the surface as an actual context if needed, but if the setting (to remove the surface) remains optional, then I see no harm to longtime users.

---

<div class="post-metadata">

**Author:** ![chriswmackey](https://discourse.pollination.solutions/user_avatar/discourse.pollination.solutions/chriswmackey/32/6207_2.png) [@chriswmackey](https://discourse.pollination.solutions/u/chriswmackey)\
**Post date:** [June 12, 2024, 10:06pm UTC](https://discourse.pollination.solutions/t/grid-vector-direction/4017/7 "2024-06-12T22:06:44Z")

</div>

Thanks, @byron ,

I added a new `geo_block_` option to the [LB Direct Sun Hours](https://docs.ladybug.tools/ladybug-primer/components/3_analyzegeometry/direct_sun_hours) component:

> <https://github.com/ladybug-tools/ladybug-grasshopper/pull/385>

 ![image](https://discourse.pollination.cloud/uploads/default/original/2X/f/f80ea549dcba0b0e9cecfc267066c50092ff1a72.png)

… and you should be able to get it on your end with the [LB Versioner](https://docs.ladybug.tools/ladybug-primer/components/5_version/versioner) now. If you confirm that it works the way you want it to, I’ll add a similar option into the `PO_DirectSun` command when I get the chance.

And I hear you with this:

> [@byron](#):
>
> As a side note, I find it very common to have to explain to students that geometry assigned as a grid is self shading and acts as context.

Sometimes I get confused too and I have to remind myself that’s how the component works. But I at least know that this confusion is less common than if we had made the geometry transparent/non-blocking by default. Then, people go to run their study without any context and they see everywhere gets 100% sun. I think a new toggle option like this is the “right” way to expose this type of functionality.

---

<div class="post-metadata">

**Author:** ![byron](https://discourse.pollination.solutions/user_avatar/discourse.pollination.solutions/byron/32/7751_2.png) [@byron](https://discourse.pollination.solutions/u/byron)\
**Post date:** [June 12, 2024, 10:27pm UTC](https://discourse.pollination.solutions/t/grid-vector-direction/4017/8 "2024-06-12T22:27:15Z")

</div>

@chriswmackey , it’s insane how fast you implement solutions these days…

I did a very quick test and overall it seems that it works as intended. On closer inspection though, I realise than there is a tiny difference when I flip the surface. In theory, the 2 results should be identical, irrespective of the surface’s normals.

 ![image](https://discourse.pollination.cloud/uploads/default/original/2X/0/0bce85e3fc1a8ed4780b11075d0dea0126007443.png)  
 ![image](https://discourse.pollination.cloud/uploads/default/original/2X/d/d9860430ec5003f506b06733c191f0a5e1e29a01.png)

edit: I just wanted to mention that the scale is fixed (0-12hrs), it does not show on my screenshots

---

<div class="post-metadata">

**Author:** ![chriswmackey](https://discourse.pollination.solutions/user_avatar/discourse.pollination.solutions/chriswmackey/32/6207_2.png) [@chriswmackey](https://discourse.pollination.solutions/u/chriswmackey)\
**Post date:** [June 12, 2024, 10:54pm UTC](https://discourse.pollination.solutions/t/grid-vector-direction/4017/9 "2024-06-12T22:54:00Z")

</div>

Thanks @byron ,

I know why that is happening. It’s because of the `_offset_dist_`. The sensor points are in slightly different locations depending on the direction of the input geometry. It makes sense that this is not what you’re expecting so I just changed the component to use a default `_offset_dist_` of zero whenever `geo_block_` is set to `False`. When it’s `True` or unspecified, it will use the default 10 cm as it usually does.

I also realized that my interpretation of the input wasn’t great since it follows intuitively that setting `geo_block_` to `True` should mean that the geometry blocks the sun while setting it to `False` means that the geometry is transparent. I originally had it reversed. I fixed all of this here:

> <https://github.com/ladybug-tools/ladybug-grasshopper/pull/386>

Now, you get the same result when you flip the geometry:

 ![image](https://discourse.pollination.cloud/uploads/default/original/2X/c/cc23651b23bf47257b832482667493b3418ee53f.png)  
 ![image](https://discourse.pollination.cloud/uploads/default/original/2X/5/5c45cc38a0ddaa4b846c44ff664a3390da3fad21.png)

---

<div class="post-metadata">

**Author:** ![byron](https://discourse.pollination.solutions/user_avatar/discourse.pollination.solutions/byron/32/7751_2.png) [@byron](https://discourse.pollination.solutions/u/byron)\
**Post date:** [June 12, 2024, 10:57pm UTC](https://discourse.pollination.solutions/t/grid-vector-direction/4017/10 "2024-06-12T22:57:00Z")

</div>

Good catch @chriswmackey , and silly of me for not thinking about it… It’s good that I did not manually set the offset to 0 as I would have not picked up the difference.

thanks again for being so quick to add the feature and fixing it.

---

<div class="post-metadata">

**Author:** ![chriswmackey](https://discourse.pollination.solutions/user_avatar/discourse.pollination.solutions/chriswmackey/32/6207_2.png) [@chriswmackey](https://discourse.pollination.solutions/u/chriswmackey)\
**Post date:** [June 12, 2024, 10:58pm UTC](https://discourse.pollination.solutions/t/grid-vector-direction/4017/11 "2024-06-12T22:58:00Z")

</div>

And thanks for this 🙂

> [@byron](#):
>
> it’s insane how fast you implement solutions these days…

I just have to give a disclaimer that updating the Environmental Analysis commands is going to be slower. For the LBT components, I have a whole nice automated set of workflows that run to push the changes out to you. I’m still in the process of setting this up for the Environmental Analysis commands but I’ll get there.

---

<div class="post-metadata">

**Author:** ![byron](https://discourse.pollination.solutions/user_avatar/discourse.pollination.solutions/byron/32/7751_2.png) [@byron](https://discourse.pollination.solutions/u/byron)\
**Post date:** [June 12, 2024, 11:00pm UTC](https://discourse.pollination.solutions/t/grid-vector-direction/4017/12 "2024-06-12T23:00:46Z")

</div>

haha not a problem.

I am sure we can all excuse a few days’ wait to get new functionalities.
