Recursion Exercise

Hi All,

I have an interesting recursion exercise that I would like to test out with GC.

Over the years our landscape team have create a variety of paving patterns for different projects. (sample below)

One in particular comes to mind when I was watching the SIG on recursion.

What I am interested in is creating is a script that takes a large rectangle or square and then using a spline each of the 4 lines creating the rectangle or square sub divided depending on if the spline intersects with it.

More a true/false statement so a module will sub divide if one of the sides intersects with the spline and so on.

I had a look at Volkers examples from the SIG and there is a good script that subdivides in a similar way but it does it based on a recursion number and applies to all “squares”.

What I am looking for is to insert into this sample script a couple of If statements I think.

1 if the spline intersects (this could be a bool based on if a point is created by interestion)

2 if the line length of the sides of the square greater than some limit. (so pavers don’t get too small)

I think it is all in where you place the if statements

I will keep testing but any help would be appreciated.

then I just need to work out how to add some random values :)

Thanks

Wayne

Parents
  • Hi Wayne,

    Yes, you are on the right track.

    The adaptive façade script shown and shared in both, the recursion SIG (March 2018) and the façade SIG (April 2018), does include conditional recursion based on "local" conditions encountered in the recursion, rather than on "rote" depth level or other uniform termination criteria. With adaptive recursion the risk of missing a termination criterion is increased, so some safeguard should be employed to avoid infinite recursion. This has been discussed in our August 2018 SIG, too, which I am preparing for posting hopefully early next week (week of Aug 27).

    In your case, you'd check whether the curve intersects with the current tile, if so, subdivide the tile, and then send the subdivisions into the next recursion. Also, if a tile is larger than your maximum tile size, you'd subdivide it. As you stated, most likely you want to stop subdividing when the tiles get too small (i.e. only subdivide if the tile is greater than some minimum size). This is very similar to the checks for the façade, with the curve intersection taking the role of the "OutOfPlane" condition.

    Attached is the subdivision façade script (ABD CONNECT Edition Update 3).

    HTH,

         Volker

    3 SubdivisionFacade.dgn

       

Reply
  • Hi Wayne,

    Yes, you are on the right track.

    The adaptive façade script shown and shared in both, the recursion SIG (March 2018) and the façade SIG (April 2018), does include conditional recursion based on "local" conditions encountered in the recursion, rather than on "rote" depth level or other uniform termination criteria. With adaptive recursion the risk of missing a termination criterion is increased, so some safeguard should be employed to avoid infinite recursion. This has been discussed in our August 2018 SIG, too, which I am preparing for posting hopefully early next week (week of Aug 27).

    In your case, you'd check whether the curve intersects with the current tile, if so, subdivide the tile, and then send the subdivisions into the next recursion. Also, if a tile is larger than your maximum tile size, you'd subdivide it. As you stated, most likely you want to stop subdividing when the tiles get too small (i.e. only subdivide if the tile is greater than some minimum size). This is very similar to the checks for the façade, with the curve intersection taking the role of the "OutOfPlane" condition.

    Attached is the subdivision façade script (ABD CONNECT Edition Update 3).

    HTH,

         Volker

    3 SubdivisionFacade.dgn

       

Children
No Data