Filling a cube with a truncated octahedron

Hey everyone,

I’m new to Rhino & Grasshopper and need to use them for my thesis on 3D printing.

I’m trying to create an infill pattern using truncated octahedrons, but I’m struggling to fill a cube with them as tightly as possible. Any help would be greatly appreciated!

Hello
Geometry gym plugin has a tool for this.

Hey!
thank you for your response!
unfortunately from my promotor i need to try to use no (or only essential plugins).
Is there a way to do it without using the geometry gym plugin?

Yes
you just have to do the math. For cubes of size L, displacement of cubes has this form

Position = InitialPosition + i* L * VectorX+ j* L * VectorY+ k* L * VectorZ
i, j and k are integers

I still am struggling with this. Could you maybe give an example?

Hey everyone!

I think i have made some progress but i am struggling to have octahedrons in the middle of the cubes, right now there are empty spaces between them. Also i the octahedrons need to be ‘cut’ when exceeding a box.



Truncated Octahedron in cube.gh (8.8 KB)

hey!
i think i have done it. Maybe some extra fine tuning.

A complete list of native Rhino polyhedra can be created here (updated):
RhinoPolyhedra_2022Oct17a.gh (47.0 KB)

Just write the equation, this is very simple math.


Truncated Octahedron in cube.gh (10.3 KB)

This is indeed a way ‘prettier’ solution. thank you