# Uniform grid for unclosed surfaces with hole

**URL:** <https://discourse.ladybug.tools/t/uniform-grid-for-unclosed-surfaces-with-hole/9691>\
**Category:** honeybee-legacy\
**Created:** [July 13, 2018, 6:18am UTC](https://discourse.ladybug.tools/t/uniform-grid-for-unclosed-surfaces-with-hole/9691 "2018-07-13T06:18:46Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![gogog](https://discourse.ladybug.tools/letter_avatar_proxy/v4/letter/g/8c91f0/32.png) [@gogog](https://discourse.ladybug.tools/u/gogog)\
**Post date:** [July 13, 2018, 6:18am UTC](https://discourse.ladybug.tools/t/uniform-grid-for-unclosed-surfaces-with-hole/9691/1 "2018-07-13T06:18:46Z")

</div>

hi, Mostapha and Abraham

It works well with closed surface, but cannot generate points with un-closed surface, like this one.  
Error message says “Data conversion failed from Surface to Curve”  
Could you please give some tips or advice to solve it?  
Thanks very much.

Zane

 ![issue](https://discourse.ladybug.tools/uploads/default/original/2X/a/a36bc9755dcb1d53c9d8e6a4522e6588163adef1.png)

---

<div class="post-metadata">

**Author:** ![Julioamodia89](https://discourse.ladybug.tools/user_avatar/discourse.ladybug.tools/julioamodia89/32/15720_2.png) [@Julioamodia89](https://discourse.ladybug.tools/u/Julioamodia89)\
**Post date:** [March 30, 2020, 12:57pm UTC](https://discourse.ladybug.tools/t/uniform-grid-for-unclosed-surfaces-with-hole/9691/2 "2020-03-30T12:57:49Z")

</div>

Hi gogog,

Did you find out a solution for uniform grid point in un-closed surfaces?

Thanks,

Julio

---

<div class="post-metadata">

**Author:** ![gogog](https://discourse.ladybug.tools/letter_avatar_proxy/v4/letter/g/8c91f0/32.png) [@gogog](https://discourse.ladybug.tools/u/gogog)\
**Post date:** [April 1, 2020, 2:17am UTC](https://discourse.ladybug.tools/t/uniform-grid-for-unclosed-surfaces-with-hole/9691/3 "2020-04-01T02:17:28Z")

</div>

Hi Julio  
see attached gh file.  
As i am not an expert user, i have to use dozens of components to fix this issue, but at least it works well for me.  
[Analysis\_Grid\_Uniform.gh](https://discourse.ladybug.tools/uploads/short-url/dTIryEsPfZpYG6rN4t1mnWqmlkf.gh) (35.0 KB)

---

<div class="post-metadata">

**Author:** ![AntonelloDiNunzio](https://discourse.ladybug.tools/user_avatar/discourse.ladybug.tools/antonellodinunzio/32/14522_2.png) [@AntonelloDiNunzio](https://discourse.ladybug.tools/u/AntonelloDiNunzio)\
**Post date:** [April 1, 2020, 8:21pm UTC](https://discourse.ladybug.tools/t/uniform-grid-for-unclosed-surfaces-with-hole/9691/4 "2020-04-01T20:21:19Z")

</div>

Hi @gogog and @Julioamodia89

could you test this raw component? I have written it fast, I have checked it only from geometrical point of view.  
[uniform\_grid\_dna.gh](https://discourse.ladybug.tools/uploads/short-url/iZwEwFA0vCNyqAXMxlAtLVdtHtV.gh) (20.2 KB)  
I hope it helps.

Regards,  
Antonello

---

<div class="post-metadata">

**Author:** ![gogog](https://discourse.ladybug.tools/letter_avatar_proxy/v4/letter/g/8c91f0/32.png) [@gogog](https://discourse.ladybug.tools/u/gogog)\
**Post date:** [April 2, 2020, 5:56am UTC](https://discourse.ladybug.tools/t/uniform-grid-for-unclosed-surfaces-with-hole/9691/5 "2020-04-02T05:56:34Z")

</div>

hi Antonello  
It’s cool, works very well.  
By the way, could you add a function which can set the distance from the envelope and inner wall?  
 ![analysis points](https://discourse.ladybug.tools/uploads/default/original/2X/e/eacd8471b0cedb3ad57274c14b16f2c421aaa3c9.png)

---

<div class="post-metadata">

**Author:** ![AntonelloDiNunzio](https://discourse.ladybug.tools/user_avatar/discourse.ladybug.tools/antonellodinunzio/32/14522_2.png) [@AntonelloDiNunzio](https://discourse.ladybug.tools/u/AntonelloDiNunzio)\
**Post date:** [April 2, 2020, 9:34am UTC](https://discourse.ladybug.tools/t/uniform-grid-for-unclosed-surfaces-with-hole/9691/6 "2020-04-02T09:34:03Z")

</div>

Hi @gogog,

> [@gogog](#):
>
> By the way, could you add a function which can set the distance from the envelope and inner wall?

Could you test this? It should work with every planar xy surface with holes.  
[uniform\_grid\_dna3.gh](https://discourse.ladybug.tools/uploads/short-url/zKLUigoNvyQzvnKdoxBusgZV3OD.gh) (20.8 KB)

Update v.3: it works also if your base surface is above elevation 0.

Regards,  
Antonello

---

<div class="post-metadata">

**Author:** ![Julioamodia89](https://discourse.ladybug.tools/user_avatar/discourse.ladybug.tools/julioamodia89/32/15720_2.png) [@Julioamodia89](https://discourse.ladybug.tools/u/Julioamodia89)\
**Post date:** [April 2, 2020, 9:43am UTC](https://discourse.ladybug.tools/t/uniform-grid-for-unclosed-surfaces-with-hole/9691/7 "2020-04-02T09:43:52Z")

</div>

Hi guys,  
Looks really good the solutions you have done.  
I haven’t manage to make work your component Antonello, I am nor sure where the mistake is.

 ![Uniform grid error](https://discourse.ladybug.tools/uploads/default/original/2X/e/e6bb7b453493c1e00b163635b037651bf38affdc.png)  
On the other hand I have also done my own cluster component.  
[Uniform grid point\_JFA.gh](https://discourse.ladybug.tools/uploads/short-url/rI3nHgZFULLyhbUmTYioLyr0UqV.gh) (37.1 KB)

---

<div class="post-metadata">

**Author:** ![gogog](https://discourse.ladybug.tools/letter_avatar_proxy/v4/letter/g/8c91f0/32.png) [@gogog](https://discourse.ladybug.tools/u/gogog)\
**Post date:** [April 2, 2020, 9:47am UTC](https://discourse.ladybug.tools/t/uniform-grid-for-unclosed-surfaces-with-hole/9691/8 "2020-04-02T09:47:21Z")

</div>

hi @AntonelloDiNunzio  
Amazing! Awesome!  
programming really can make life easier!  
many thanks!

---

<div class="post-metadata">

**Author:** ![Julioamodia89](https://discourse.ladybug.tools/user_avatar/discourse.ladybug.tools/julioamodia89/32/15720_2.png) [@Julioamodia89](https://discourse.ladybug.tools/u/Julioamodia89)\
**Post date:** [April 2, 2020, 10:27am UTC](https://discourse.ladybug.tools/t/uniform-grid-for-unclosed-surfaces-with-hole/9691/9 "2020-04-02T10:27:47Z")

</div>

I open it with rhino 6 and now it works, amazing job Antonello

---

<div class="post-metadata">

**Author:** ![Sonny.Weaver](https://discourse.ladybug.tools/user_avatar/discourse.ladybug.tools/sonny.weaver/32/19348_2.png) [@Sonny.Weaver](https://discourse.ladybug.tools/u/Sonny.Weaver)\
**Post date:** [May 11, 2020, 9:39am UTC](https://discourse.ladybug.tools/t/uniform-grid-for-unclosed-surfaces-with-hole/9691/10 "2020-05-11T09:39:54Z")

</div>

Dear @AntonelloDiNunzio, thanks for your Script,  
as you write, works on planar xy surfaces, but would be useful on (planar) surfaces such as facades on the Z-axis, if so, is the script adaptable?.

Greetings

---

<div class="post-metadata">

**Author:** ![AntonelloDiNunzio](https://discourse.ladybug.tools/user_avatar/discourse.ladybug.tools/antonellodinunzio/32/14522_2.png) [@AntonelloDiNunzio](https://discourse.ladybug.tools/u/AntonelloDiNunzio)\
**Post date:** [May 15, 2020, 9:46am UTC](https://discourse.ladybug.tools/t/uniform-grid-for-unclosed-surfaces-with-hole/9691/11 "2020-05-15T09:46:07Z")

</div>

Hi @Sonny.Weaver,

yes, it is adaptable. I modified it fast so I do not know if it works perfectly.  
[uniform\_grid\_dna4.gh](https://discourse.ladybug.tools/uploads/short-url/fHgcX9Vd4I4zbOZksKTxp0fPaKh.gh) (25.2 KB)

Best,  
Antonello

---

<div class="post-metadata">

**Author:** ![Sonny.Weaver](https://discourse.ladybug.tools/user_avatar/discourse.ladybug.tools/sonny.weaver/32/19348_2.png) [@Sonny.Weaver](https://discourse.ladybug.tools/u/Sonny.Weaver)\
**Post date:** [May 15, 2020, 10:47am UTC](https://discourse.ladybug.tools/t/uniform-grid-for-unclosed-surfaces-with-hole/9691/12 "2020-05-15T10:47:41Z")

</div>

Dear Antonello,  
it works perfectly!!

thank you for your time, for helping me.  
Greetings

---

<div class="post-metadata">

**Author:** ![LaFleur](https://discourse.ladybug.tools/user_avatar/discourse.ladybug.tools/lafleur/32/19513_2.png) [@LaFleur](https://discourse.ladybug.tools/u/LaFleur)\
**Post date:** [January 22, 2021, 7:58am UTC](https://discourse.ladybug.tools/t/uniform-grid-for-unclosed-surfaces-with-hole/9691/13 "2021-01-22T07:58:58Z")

</div>

Hallo dear @AntonelloDiNunzio,

thanks for the component, are very helpful.

I have two questions about two small problems I encountered.

In some cases I have the problem, that the vector direction of my geometries is negative, even if the direction is positive.  
I also did a test with the Ladybug’s gentest, and there the direction of the vectors are correct.

 ![geoVectors](https://discourse.ladybug.tools/uploads/default/original/3X/e/a/eab0803890e77f37ab082a97754bcca94c85cdcd.png)

Another curiosity I noticed is that in some situation,even if the distance that the grid points must have to the edges of the surface, is set to 0, equally a large strip is not generated, although I believe it depends on the size of the geometry.

 ![PointDistance](https://discourse.ladybug.tools/uploads/default/original/3X/f/e/fee0086bd240256b984ec858e13340dbb8a355a2.png)

[GenTestPoints.gh](https://discourse.ladybug.tools/uploads/short-url/dhKees9TqHiUauGxerh65AskD9E.gh) (31.8 KB)

Thanks again for this component which is a very important point in most of my works.

Best regards
