# Grids by Face issue

**URL:** <https://forum.dynamobim.com/t/grids-by-face-issue/1528>\
**Category:** Packages\
**Created:** [May 25, 2015, 6:58am UTC](https://forum.dynamobim.com/t/grids-by-face-issue/1528 "2015-05-25T06:58:03Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![solamour](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/solamour/32/153516_2.png) [@solamour](https://forum.dynamobim.com/u/solamour)\
**Post date:** [May 25, 2015, 6:58am UTC](https://forum.dynamobim.com/t/grids-by-face-issue/1528/1 "2015-05-25T06:58:03Z")

</div>

Hey guys,

I have a complex membrane surface (As depicted below) that curves in multiple directions at the same time. What I want to do is divide this off into either a quad or diamond (Preferably be able to choose) pattern to use as a host for a series of Adaptive Components.

I’m assuming I’ve either got the wrong Lunchbox package (Albeit, I downloaded the latest I believe), or it doesn’t handle non-rectangular surfaces?

I can do it “The hard way”, by creating points at parameter for each bounding curve of the surface, but I’ll probably lose a bit of the curve in the geometry if I do it that way.

![Complex Surface](https://cdck-file-uploads-us1.s3.dualstack.us-west-2.amazonaws.com/flex022/uploads/dynamobim/original/2X/b/b8153f77a1ecbe70bfc6985316a920192fb79b51.png) ![Grids issue - Lunchbox Diamond](https://cdck-file-uploads-us1.s3.dualstack.us-west-2.amazonaws.com/flex022/uploads/dynamobim/original/2X/3/385db3b1db4e4b413be6060dc9e56095ad5dc565.png)

&nbsp;

&nbsp;

&nbsp;

&nbsp;

&nbsp;

&nbsp;

&nbsp;

Any help would be greatly appreciated!

Cheers,

Sol

---

<div class="post-metadata">

**Author:** ![Dimitar\_Venkov](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/dimitar_venkov/32/2068_2.png) [@Dimitar\_Venkov](https://forum.dynamobim.com/u/Dimitar_Venkov)\
**Post date:** [May 26, 2015, 1:51am UTC](https://forum.dynamobim.com/t/grids-by-face-issue/1528/2 "2015-05-26T01:51:05Z")

</div>

It looks like the resulting surface is planar. For some weird reason Dynamo handles planar and non-planar surfaces differently. For planar surfaces, the points are not bound to the surface and are always aligned to the global CS. Usually the only way to divide them in a regular grid is to manipulate the generating curves/ perimeter curves.

![2015-05-26_15-07-32](https://cdck-file-uploads-us1.s3.dualstack.us-west-2.amazonaws.com/flex022/uploads/dynamobim/original/2X/f/f9d5a90446eea7c7ba2ec1ef19805ba0d6ee0dbe.png)

---

<div class="post-metadata">

**Author:** ![solamour](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/solamour/32/153516_2.png) [@solamour](https://forum.dynamobim.com/u/solamour)\
**Post date:** [May 26, 2015, 3:32am UTC](https://forum.dynamobim.com/t/grids-by-face-issue/1528/3 "2015-05-26T03:32:09Z")

</div>

Ah odd, thanks for clearing that up Dimitar. Once again, I owe you a beer or something 😃

I guess I’ll do it the hard way then!

---

<div class="post-metadata">

**Author:** ![solamour](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/solamour/32/153516_2.png) [@solamour](https://forum.dynamobim.com/u/solamour)\
**Post date:** [May 27, 2015, 5:17am UTC](https://forum.dynamobim.com/t/grids-by-face-issue/1528/4 "2015-05-27T05:17:25Z")

</div>

Dimitar, looking through my ‘library’ of random images downloaded from threads on here, I stumbled across one of yours that showcases using DesignScript to populate U/V points on a surface and I was wondering if you could please explain it to me.

It uses your ‘surfpts’ definition - I’ve simply copied it through as a starting point (As showcased in my image in the stand-alonee code-blocks an the final 4x lines of the major code block).

If I we’re to switch to PointAtDistance, would I be able to achieve a roughly organised points grid this way? Or could I still use PointAtParameter given that my surfaces are different sizes? I could potentially create new U and V division lists for the size variance.

My intention is to try and get the diamond points distribution for an adaptive panel placement as discussed above while maintaining the complex surface curvature.

If anyone else has any thoughts please by all means chime in!

![Dyn_Graph_Starting_Point](https://cdck-file-uploads-us1.s3.dualstack.us-west-2.amazonaws.com/flex022/uploads/dynamobim/original/2X/9/91469a34f231c118486a4110cb54d1d1a2c2f8da.jpg)

&nbsp;

---

<div class="post-metadata">

**Author:** ![solamour](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/solamour/32/153516_2.png) [@solamour](https://forum.dynamobim.com/u/solamour)\
**Post date:** [May 27, 2015, 6:23am UTC](https://forum.dynamobim.com/t/grids-by-face-issue/1528/5 "2015-05-27T06:23:43Z")

</div>

I’ve played around, and got a points distribution working well on the surfaces themselves - but now I need to also get points from the exterior lines that align with the surface distribution - but doing OK so far!

Then I guess it’s all about populating some form of 4x list structure… fun 😃

![Dyn_Graph_Divisions_CloseUp](https://cdck-file-uploads-us1.s3.dualstack.us-west-2.amazonaws.com/flex022/uploads/dynamobim/original/2X/c/c9a6495d3ccfde506210383fb8b4a5dbbaa1574c.jpg)

&nbsp;

&nbsp;

![Dyn_Graph_Divisions](https://cdck-file-uploads-us1.s3.dualstack.us-west-2.amazonaws.com/flex022/uploads/dynamobim/original/2X/e/e561fdeeb0e2dab3852dc6d6e53fccf4e00810e5.jpg)

---

<div class="post-metadata">

**Author:** ![Dimitar\_Venkov](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/dimitar_venkov/32/2068_2.png) [@Dimitar\_Venkov](https://forum.dynamobim.com/u/Dimitar_Venkov)\
**Post date:** [May 27, 2015, 11:38pm UTC](https://forum.dynamobim.com/t/grids-by-face-issue/1528/6 "2015-05-27T23:38:38Z")

</div>

Hmm I’m not sure how easy it would be to map a quad structure to that list of points because a)it’s a flat list of points and b)each row/collumn of points is of nonuniform length.

I was thinking of something along the lines of this:

![2015-05-28_12-55-18](https://cdck-file-uploads-us1.s3.dualstack.us-west-2.amazonaws.com/flex022/uploads/dynamobim/original/2X/e/e7e3a5b19fbea37e13882a20fd75a8c437eed627.png)

Wrap the above in a function/custom node, then check if each surface is planar or not with Clockwork’s “Surface.IsPlanar” and based on the output apply either the PointByParameter function or the above function. That would leave us with a list of points that is easier to handle:

![2015-05-28_13-02-28](https://cdck-file-uploads-us1.s3.dualstack.us-west-2.amazonaws.com/flex022/uploads/dynamobim/original/2X/1/1ea13a7b6e5fc0f0ba988b8a519227ca0338ac51.png)

---

<div class="post-metadata">

**Author:** ![solamour](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/solamour/32/153516_2.png) [@solamour](https://forum.dynamobim.com/u/solamour)\
**Post date:** [May 28, 2015, 2:10am UTC](https://forum.dynamobim.com/t/grids-by-face-issue/1528/7 "2015-05-28T02:10:49Z")

</div>

Ah brilliant. Your a Dynamo God! I’ll have a play with that workflow. Many thanks for your help yet again.

---

<div class="post-metadata">

**Author:** ![solamour](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/solamour/32/153516_2.png) [@solamour](https://forum.dynamobim.com/u/solamour)\
**Post date:** [May 28, 2015, 6:04am UTC](https://forum.dynamobim.com/t/grids-by-face-issue/1528/8 "2015-05-28T06:04:58Z")

</div>

I’ve had a play around with your suggestion Dimitar and have had to add in another step or two due to the complex geometry conditions (curve extrusion and the exclusion of the perimeter points from said extrusion before joining them up into a list again).

It’s working rather well so far. Next step would be to re-organise the points grid into a proper diamond structure for Adaptive Component output.

&nbsp;

![Design_Script_Diamonds_Example](https://cdck-file-uploads-us1.s3.dualstack.us-west-2.amazonaws.com/flex022/uploads/dynamobim/original/2X/0/0e91c9283435ff17cf6d94edfa01c83453415786.png)

---

<div class="post-metadata">

**Author:** ![Dimitar\_Venkov](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/dimitar_venkov/32/2068_2.png) [@Dimitar\_Venkov](https://forum.dynamobim.com/u/Dimitar_Venkov)\
**Post date:** [May 29, 2015, 2:20am UTC](https://forum.dynamobim.com/t/grids-by-face-issue/1528/9 "2015-05-29T02:20:20Z")

</div>

The above example works ok for 4 sided convex polygons but won’t work for 3/5/etc sided ones or for concave shapes. I’m not sure what the best approach for those would be. Maybe create a very slightly curved surface on top of the flat surface, create points on that and project them down to the flat surface?

I think that the DS team should work on the way planar faces are handled.

Edit:

![2015-05-29_17-10-45](https://cdck-file-uploads-us1.s3.dualstack.us-west-2.amazonaws.com/flex022/uploads/dynamobim/original/2X/e/e4f4765b9e16dd7edda13b94e8b1f2f5013bb5d7.png)

&nbsp;

![2015-05-29_17-10-26](https://cdck-file-uploads-us1.s3.dualstack.us-west-2.amazonaws.com/flex022/uploads/dynamobim/original/2X/3/3f6b19f0a45ce7a82e6ba19cfa5227b8b2a1eedf.png)

now I am confused

---

<div class="post-metadata">

**Author:** ![solamour](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/solamour/32/153516_2.png) [@solamour](https://forum.dynamobim.com/u/solamour)\
**Post date:** [May 29, 2015, 4:23am UTC](https://forum.dynamobim.com/t/grids-by-face-issue/1528/10 "2015-05-29T04:23:50Z")

</div>

It should work for concave as well as the extrusion is both in the negative and positive. But yeah, not an ideal solution as of yet. I can get it working I believe for my particular situation but it would be much better to figure out something for all potentialities.
