Jump to content
jlrvfx

Creating concentric rings with nested for each loops

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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
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

Share this post


Link to post
Share on other sites
Posted (edited)

here's mine, vex-free...extremely simple.....it relies on user to observe spatial pattern and then use trig.

vu_HexRings.hiplc

(haven't checked overlapping yet...shouldn't be too hard)

Edited by Noobini

Share this post


Link to post
Share on other sites

That is a very interesting and logical way to approach it - building each edge with an offset I would not have thought of that. Both solutions are amazing. Thank you both.

Share this post


Link to post
Share on other sites
Posted (edited)

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

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×