Recursive construction macro

Parent Previous Next

The purpose of such a macro is to implement a construction of the figure in an recursive way.


When creating such a macro, you must first choose the sources obects the macro will apply to.


The construction is implemented a first time. It is recursion level 0.

Then, il possible, the construction is applied taking for sources objects the first final objects just created. Then a number of objects equal to the iteration step is skipped and the construction is again implemented and this a number of times equal to number of iterations by level. But, on each call, the construction calls itself again, increasing the level of recursion, until the depth of recursion is reached.



It is also possible to ask some sources objects (starting from the beginning) to be common for all the implementations of the construction. For instance, if a construction has three sources objects : a calculation (angle for example) and two points, you may ask for the first source object (the angle) to be common for all the implementations of the construction. If, for instance, the iteration step is 2, the final objects of the construction will have to start with at least 8 points. If the iteration step is 1, they will have to start with at least 5 points.


It is also possible to ask that only final objects of last generation to be be created. With the preceeding example, let us suppose you ask for a depth of recursion 3, an iteration step of 2,and that the first eight final objects are eight points followed by a segment.

In the recursive calls of the construction, the segments will be created only for the calls of maximumn depth. For the calls of lower depth, only the eight points will be created.


You may also ask to impose a color for all the objects created. Otherwise the color of the construction will be used.


It is also possible to ask all the final points created at the maximum depth of recursion to be used to create a broken line or a polygon (and ask for this polygon to be filled).


If the chosen construction cannot be implemented in an iterative way wis you choices, the creation of the macro will be refused.


To be noted : If several constructions of the same type have been created, it is possible to assign a construction to each level of recursion. For this, clik on each level in the left list and choose the construction associated to this level in the right list.



See also example of Von Koch Flake.