# Subdividing a cuboid into individual cuboids

**URL:** <https://forum.dynamobim.com/t/subdividing-a-cuboid-into-individual-cuboids/23545>\
**Category:** Geometry\
**Created:** [July 9, 2018, 4:30pm UTC](https://forum.dynamobim.com/t/subdividing-a-cuboid-into-individual-cuboids/23545 "2018-07-09T16:30:40Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![archjahzzy](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/archjahzzy/32/26144_2.png) [@archjahzzy](https://forum.dynamobim.com/u/archjahzzy)\
**Post date:** [July 9, 2018, 4:30pm UTC](https://forum.dynamobim.com/t/subdividing-a-cuboid-into-individual-cuboids/23545/1 "2018-07-09T16:30:40Z")

</div>

Hi all,

Is there a way to subdivide a cuboid into multiple cuboids (eg 3x3x3 into 27 1x1x1 cube just like a rubik’s cube but not necessarily have equal sides, can be 3x3x4, etc)…

I have done this only in 2d where a surface is subdivided into square panels…

Thanks in advance for your help - I am very new to Dynamo geometry…

---

<div class="post-metadata">

**Author:** ![Kulkul](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/kulkul/32/49801_2.png) [@Kulkul](https://forum.dynamobim.com/u/Kulkul)\
**Post date:** [July 9, 2018, 4:37pm UTC](https://forum.dynamobim.com/t/subdividing-a-cuboid-into-individual-cuboids/23545/2 "2018-07-09T16:37:05Z")

</div>

Hi @archjahzzy

> [@archjahzzy](#):
>
> I have done this only in 2d where a surface is subdivided into square panels

After you divide surface in 2d you can use surface.thickness node or Curve.Exrtrude node to get solids from it.

---

<div class="post-metadata">

**Author:** ![archjahzzy](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/archjahzzy/32/26144_2.png) [@archjahzzy](https://forum.dynamobim.com/u/archjahzzy)\
**Post date:** [July 9, 2018, 4:41pm UTC](https://forum.dynamobim.com/t/subdividing-a-cuboid-into-individual-cuboids/23545/3 "2018-07-09T16:41:08Z")

</div>

Hi @Kulkul, thank you! I will try that (don’t have my pc atm)

---

<div class="post-metadata">

**Author:** ![archjahzzy](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/archjahzzy/32/26144_2.png) [@archjahzzy](https://forum.dynamobim.com/u/archjahzzy)\
**Post date:** [July 10, 2018, 4:44am UTC](https://forum.dynamobim.com/t/subdividing-a-cuboid-into-individual-cuboids/23545/4 "2018-07-10T04:44:47Z")

</div>

Hi Kulkul,

Using the Surface.Thickness just created one solid surface without subdivisions… Curve.Extrude doesn’t work for some reason…

---

<div class="post-metadata">

**Author:** ![Kulkul](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/kulkul/32/49801_2.png) [@Kulkul](https://forum.dynamobim.com/u/Kulkul)\
**Post date:** [July 10, 2018, 5:00am UTC](https://forum.dynamobim.com/t/subdividing-a-cuboid-into-individual-cuboids/23545/5 "2018-07-10T05:00:15Z")

</div>

> [@archjahzzy](#):
>
> Curve.Extrude doesn’t work for some reason…

@archjahzzy Could you please show us your complete graph with all the previews visible.

---

<div class="post-metadata">

**Author:** ![archjahzzy](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/archjahzzy/32/26144_2.png) [@archjahzzy](https://forum.dynamobim.com/u/archjahzzy)\
**Post date:** [July 10, 2018, 4:12am UTC](https://forum.dynamobim.com/t/subdividing-a-cuboid-into-individual-cuboids/23545/6 "2018-07-10T04:12:40Z")

</div>

![Help-1](https://cdck-file-uploads-us1.s3.dualstack.us-west-2.amazonaws.com/flex022/uploads/dynamobim/original/3X/4/a/4ad253932a941066ae8c2bcc562d7cb8b3d2a1da.png)

Hi!

I have generated a solid mass with movable spherical voids to create different form options…  
However, I need to further refine this by subdividing the solid into cubes with LxWxH that can be varied, too. And all cubes that intersect by more than 50% with the spherical void will be deleted…

How do I go about this… Or am I in the right direction at all?

Thank you!

---

<div class="post-metadata">

**Author:** ![archjahzzy](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/archjahzzy/32/26144_2.png) [@archjahzzy](https://forum.dynamobim.com/u/archjahzzy)\
**Post date:** [July 10, 2018, 5:39am UTC](https://forum.dynamobim.com/t/subdividing-a-cuboid-into-individual-cuboids/23545/7 "2018-07-10T05:39:58Z")

</div>

Hi @Kulkul, this is the graph… sorry, later I will turn on all previews… I am out having lunch. Thanks!

---

<div class="post-metadata">

**Author:** ![archjahzzy](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/archjahzzy/32/26144_2.png) [@archjahzzy](https://forum.dynamobim.com/u/archjahzzy)\
**Post date:** [July 10, 2018, 6:42am UTC](https://forum.dynamobim.com/t/subdividing-a-cuboid-into-individual-cuboids/23545/8 "2018-07-10T06:42:14Z")

</div>

Hi @Kulkul,

This is how I ma

 ![Capture3](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/4/0/402107b67f2ccfc33038965d13c6cb17306388ef.PNG)de the surface with panels -

---

<div class="post-metadata">

**Author:** ![Kulkul](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/kulkul/32/49801_2.png) [@Kulkul](https://forum.dynamobim.com/u/Kulkul)\
**Post date:** [July 10, 2018, 7:10am UTC](https://forum.dynamobim.com/t/subdividing-a-cuboid-into-individual-cuboids/23545/9 "2018-07-10T07:10:47Z")

</div>

Hi @archjahzzy

It works as expected:

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

---

<div class="post-metadata">

**Author:** ![archjahzzy](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/archjahzzy/32/26144_2.png) [@archjahzzy](https://forum.dynamobim.com/u/archjahzzy)\
**Post date:** [July 10, 2018, 8:47am UTC](https://forum.dynamobim.com/t/subdividing-a-cuboid-into-individual-cuboids/23545/10 "2018-07-10T08:47:38Z")

</div>

Ohhh… I seee! I used **Curved.Extrude** instead of **Curve.ExtrudeAsSolid** …

So… now, just another thing. Instead of one single cuboid along the z axis, I want it to be a series of cubes such that they are divided into my panel size… However, using the range values as input to the **distance** gives me an error…

---

<div class="post-metadata">

**Author:** ![Kulkul](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/kulkul/32/49801_2.png) [@Kulkul](https://forum.dynamobim.com/u/Kulkul)\
**Post date:** [July 10, 2018, 9:30am UTC](https://forum.dynamobim.com/t/subdividing-a-cuboid-into-individual-cuboids/23545/11 "2018-07-10T09:30:54Z")

</div>

> [@archjahzzy](#):
>
> However, using the range values as input to the **distance** gives me an error…

@archjahzzy What does the error says?

---

<div class="post-metadata">

**Author:** ![archjahzzy](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/archjahzzy/32/26144_2.png) [@archjahzzy](https://forum.dynamobim.com/u/archjahzzy)\
**Post date:** [July 10, 2018, 9:35am UTC](https://forum.dynamobim.com/t/subdividing-a-cuboid-into-individual-cuboids/23545/12 "2018-07-10T09:35:39Z")

</div>

Hi @Kulkul,

I managed to do that with the voids excluded, too. Thank you so much!

To further explain my previous question… here is the outcome of the original extrusion with a single z-value:

 ![Z%20Grid%20Question](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/a/d/ad1603133fe66fd39481754695ee9c0bfe39f81a.PNG)

But I want to add grids so that these cuboids will be further subdivided into small cubes… I thought I could do it by using **0…1…#1.2** as codeblock range value but it gives me error…

 ![Z%20Grid%20Question_script2](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/a/2/a2d86ba8b6b7867e74475aee736197e73b72456e.PNG)  
Am I using the wrong node or writing the wrong code?

Thanks

---

<div class="post-metadata">

**Author:** ![Kulkul](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/kulkul/32/49801_2.png) [@Kulkul](https://forum.dynamobim.com/u/Kulkul)\
**Post date:** [July 10, 2018, 9:37am UTC](https://forum.dynamobim.com/t/subdividing-a-cuboid-into-individual-cuboids/23545/13 "2018-07-10T09:37:45Z")

</div>

@archjahzzy Could you please drop here your dyn file.

---

<div class="post-metadata">

**Author:** ![archjahzzy](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/archjahzzy/32/26144_2.png) [@archjahzzy](https://forum.dynamobim.com/u/archjahzzy)\
**Post date:** [July 10, 2018, 9:39am UTC](https://forum.dynamobim.com/t/subdividing-a-cuboid-into-individual-cuboids/23545/14 "2018-07-10T09:39:04Z")

</div>

here it is… thanks!

[Actual\_v2.dyn](https://forum.dynamobim.com/uploads/short-url/ssPczdqdBVbvcS8YMYWIafMW8Wv.dyn) (921.2 KB)

---

<div class="post-metadata">

**Author:** ![Kulkul](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/kulkul/32/49801_2.png) [@Kulkul](https://forum.dynamobim.com/u/Kulkul)\
**Post date:** [July 10, 2018, 11:07am UTC](https://forum.dynamobim.com/t/subdividing-a-cuboid-into-individual-cuboids/23545/15 "2018-07-10T11:07:55Z")

</div>

@archjahzzy Is this what your looking for?

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/d/3/d3fdb3bbab40c3ab4805f4dfefce73fd64b2e9d3.png)

---

<div class="post-metadata">

**Author:** ![archjahzzy](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/archjahzzy/32/26144_2.png) [@archjahzzy](https://forum.dynamobim.com/u/archjahzzy)\
**Post date:** [July 10, 2018, 2:45pm UTC](https://forum.dynamobim.com/t/subdividing-a-cuboid-into-individual-cuboids/23545/16 "2018-07-10T14:45:29Z")

</div>

Hi, I think the concept is the same…

But I’m thinking of using the 2 spheres along the longer sides as attractor objects _(points used will have x&y value equal to spheres’ midpoints but z value will be equal to the spheres’ radii)_

I still need to figure it out… But thanks anyways. I will create another post for attractor points if I can’t find any helpful posts…

---

<div class="post-metadata">

**Author:** ![Kulkul](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/kulkul/32/49801_2.png) [@Kulkul](https://forum.dynamobim.com/u/Kulkul)\
**Post date:** [July 10, 2018, 6:21pm UTC](https://forum.dynamobim.com/t/subdividing-a-cuboid-into-individual-cuboids/23545/17 "2018-07-10T18:21:44Z")

</div>

> [@archjahzzy](#):
>
> I will create another post for attractor points

@archjahzzy Don’t forget to mark this post as solved. You’re welcome!

---

<div class="post-metadata">

**Author:** ![Nick\_Boyts](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/nick_boyts/32/76313_2.png) [@Nick\_Boyts](https://forum.dynamobim.com/u/Nick_Boyts)\
**Post date:** [July 10, 2018, 7:53pm UTC](https://forum.dynamobim.com/t/subdividing-a-cuboid-into-individual-cuboids/23545/18 "2018-07-10T19:53:25Z")

</div>

I’ve also done something similar by building the individual cubes. They have to be fairly regular this way but it still works.

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