Cut a pattern with a closed curve

Hi everyone! I use Rhino at work but I’m a newbie in using Grasshopper. I’m currently working on a project that I need to parametrize and I’m stuck at the beginning: I want to trim this hexagonal pattern I created (I tried “hexagonal cells” and “hexagonal structure” from Lunchbox but couldn’t set regular hexagons so I used “hexagonal grid” from Grasshopper. What is the best way to cut the portion of the grid outside the rectangular region? Could you please tell me what’s the problem with this code or where I am doing wrong?

Thank you so much
Sara
pattern.gh (12.3 KB)

RInt works when you first isolate the hexagons that collide with the trimming region:

Also: you added “-0.5” in your ‘D’ input for the Offset component; however “-0.5” is not an expression. Did you intend to subtract 0.5 from whatever distance value you were specifying? If yes then you need something like “X - 0.5” or just do a simple subtraction prior to the ‘D’ input:


pattern.gh (20.1 KB)

You can create a single hexagon with the Polygon component.

Thank you so much :folded_hands: This helped me a lot. Yes, I intended to subtract 0.5 in order to create a sort of a frame from the original rectangle whatever its dimensions may be.

1 Like