Jump to content

Creating concentric rings with nested for each loops


jlrvfx

Recommended Posts

I am trying to create a series of concentric rings of hexagons that expand from a central point. The inner hexagon would be surrounded by a ring of six hexagons, that are in turn surrounded by 12 then 18 etc. I have been able to string together a few loops that add more hexagons but ideally, I would like each ring to be only one hexagon in thickness. Also, it would be great to be able to automate this so the number of rings could be generated form a single slider controlling one loop or a nested loop. This way I would not need to append an extra for loop for each required ring.

Maybe there is a different approach better suited to this.

hindie_aTCvWyAXX6.jpg

concentric_rings_001.hiplc

Link to comment
Share on other sites

  • jlrvfx changed the title to Creating concentric rings with nested for each loops

Still trying to chip away at this problem. I have found what I think is the correct way to nest the loops and am able to increase the number of rings with the controls of the outer for each loop. I am trying to find a way to group the correct points on the outer edge of the inner loop so each iteration creates only one ring of hexagons around the outer edge of the previous ring. At the moment a new hexagon is created at every point in every iteration.

 

hindie_txht1DEOXh.png

hindie_uMxVLA6c35.png

hindie_2AB9TeI7WQ.png

concentric_rings_002.hiplc

Link to comment
Share on other sites

Hi,

here are some ideas:

  • start with a single point (id = 0)
  • give each new point an id based on iteration (in the loop)
  • add 6 new points for each old point, which are on a circle with equal distance etc... -> problem: there are more points than needed
  • fuse seems to work (smaller ids seems to dominate with least target point)

hexa_growth.hipnc

Link to comment
Share on other sites

Sure :),

if you want to avoid the foreach (and fuse), you can also use a single detail wrangle (using VEX), but the results are the same. Advantage of VEX: it is much easier to add custom functions, which can do specific stuff, which is harder to achieve

with inbuild nodes. But this is of course my personal biased opinion. 

hexa_growthA.hipnc

Edited by Aizatulin
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...