Subdividing Hexagon

Hello everyone,

I was wondering how you guys would go about this: I have a figure that’s made up of the hexagon on the left; and I would like to subdivide this figure into many hexagons, but I don’t know yet if I want it to be subdivided into 7 hexagons, 21, or more. I’ve been trying to write a script to do this but no luck.

I’m guessing there might be a good plug in for this or something. Please let me know!

There are a few more things that could be done to control the size, position and extent of the HexGrid but I would approach it like this:




hexagons_2023_Aug12a.gh (10.6 KB)

1 Like

For example, this version does a better job of controlling size and position but not extent…


hexagons_2023_Aug12b.gh (16.7 KB)

Oops, I just noticed that this method does not produce your desired image, which appears to require something different… Overlapping hexagons? Would you care to elaborate? Post some code and/or geometry?

I jumped to the wrong conclusion again. :frowning:

Hi Joseph,

Thanks for the response, I got a couple ideas from them.

I see what you did but what I am looking for is more of a result like in this picture:

Well, that’s a different picture altogether, eh… You still haven’t posted any code/geometry :question:

If you can’t be bothered, neither can I. Wish I hadn’t touched this.

1 Like

Hexagonal grid cut by another hexagon grid.
Region Intersection fails at some division counts for no reason, Clipper is more robust.

Hexagons.gh (15.7 KB)

1 Like

But your small hexagons are not aligned with the exterior “corners” of the original shape, as in the latest image posted:

The original post suggested that only discrete values are allowed?

subdivided into 7 hexagons, 21, or more

That pattern is achieved with 8 divisions instead of 6 (I changed the value to see what happened and forgot to reset).

I still don’t see where those 21 hexagons are though.

Looking at your code now, it appears that 8 and 2 are the only valid values for your ‘Nb divisions’ slider?
And that your ‘Global size’ slider could be Real (fractions) instead of Integer.

The original spec is poor. I know better than “playing” with threads like this, I broke my own rule.

This is actually what I was looking for! I was playing around with most of those components but wasn’t able to get to that point. Thanks for the help!