Geometry on hexagonal matrix

Hi!

I’m new to Grasshopper, so far I’ve read the Grasshopper Primer v3.
I’m trying to create a matrix that has a certain geometry (circled in black) located at the center of each hexagon. Control on the geometry size is also needed.
So far I know how to create the matrix, and I know that the Points output of the Matrix has the coordinates for the center of each hexagon, but I can’t get past that.
Any thoughts?
Thanks!

Without your file, I can only really give you a quick example of one way to do it using Orient Component. The little code I posted works with a closed curve as the first item in the list but this easy to edit if required.

You may also want to consider building the module at the centre or each hex module than just orienting a single set of data to each point as it will give you more control over each module later.

Simple Orient.gh (15.2 KB)

sorry! here are the files!

I’ll try your code as soon as I can.
thanks a lot!

unnamed.gh (2.8 KB)
Model.3dm (412.8 KB)

The module you wanted to put on the hex grid does not match exactly the grid. See overlaps Image.

One option is to make the module parametric also with the same input radius slider and orient this another is what I have done for you below is build the module in-place instead of orient it. See new Code below.

Thinking about it you could also replace the hex grid with a single hex to make the parametric one and then orient it after to the main hex grid.

Module in-place.gh (27.8 KB)

Ps Try to name you GH file Unnamed as that is the default file name as Untilted in Rhino as this may cause you issues with autosave etc.

Thanks Matt!
Regarding the orientation, it was slightly rotated (my bad!) but if oriented correctly and scaled it can create a beautiful pattern
I’ll try your first option, using the orient and adding some scaling for the module.

Later, the challenge will be to offset and create further patterns (hopefully i’ll figure it out by myself!

thanks a lot in advance for your help!

The pattern you have posted though can be built from a hexagon outline is not on a Hexagon Grid but on a Triangle/Rhombus Grid.

This was done manually so no new code but was easy its way to test/explain it.

1 Like

Hey Matt!

Just wanted to upload my version, based on your recommendations. I sticked to the geometry and played with the scale factors to adjust it the way I wanted.

patron.gh (9.2 KB)
Pattern.3dm (372.5 KB)

1 Like

Nice one thanks, though you did not internalise the geometry so not working here, thought the code looks good all the same.

My bad, i edited my original post to include the Rhino file

In Grasshopper if you right click and click on Internalise Data on the input Parameter you will be able to internalise you data/geo etc into the grasshopper file so no need to always post the linked Rhino file unless its required. Note this does break the link to the rhino geometry so you would need to select it again if you changed it.

Easy way to check its worked is open you Grasshopper code in a new blank rhino and if the code runs your all set to post.

Hello! I saw the example shown here because it is useful for what I am doing, but I have two problems: 1. I have to insert a hexagonal element in a hexagonal grid, but when I try to insert it as in your files, the elements overlap me. 2. the Trim component reports an error, I have tried everything but it keeps reporting an error.
I apologize, but this is the first time I’ve tried to create a similar project.
1 2

I believe the problem is that your element is being copied on every intersecting corner of the grid, while it should only be placed on the center of each hexagon.

1 Like

@Mat_kat I hadn’t thought about it, I’m sorry, but I didn’t realize I didn’t put it on the center. But the Trim component keeps giving me an error “Data conversion failed from Brep to Curve”

@Mat_kat no nothing, I solved the problem :joy:

1 Like