Sierpinski Gasket with Control Points
Wieslaw Kotarski (kotarski@math.us.edu.pl) & Agnieszka Lisowska (alisow@ux2.math.us.edu.pl) Institute of Computer Science Silesian University Bedzinska 39 41-200 Sosnowiec, Poland
(Abstract)
In this worksheet we show how one can easily change the shape of the well-known Sierpinski gasket.. The method is based on relationship between subdivision schemes and IFS (Iterated Function System) that contains information needed for fractal rendering. We present examples of deformed Sierpinski gaskets obtained using differet subdivision matrices and differently placed control points. The worksheet is the eighth one in the series of the authors' works published earlier on Maplesoft web page.
1. Introduction
It is well known fact that even small changes in coefficients of IFS usually causes that a fractal, simply speaking "scatters". So, it is not possible to control the fractal shape via IFSs coefficients. But we show that using subdivision matrices and the possibility of introducing control points to fractal, one can smoothly change the fractal shape. The method will be presented on the example of the well-known Sierpinski gasket. However, it is possibly to apply the presented method to other fractals. Examples show that one can control the fractal shape similarly as eg. in Bezier curve case.
2. IFS via subdivision matrices
Following [9] one can find IFS for fractal rendering of Sierpinski gasket using subdivision matrices. We show how they can be derived. Let's take into account a curvelinear triangle with vertices denoted by P1, P2 and P3, respectively. Additionally, we introduce three further points: the first P4 lying between P1, P3, the second P5 lying between P1,P2 and the third P6 lying between P2,P3, respectively, as shown in Fig. 1.
Fig. 1. Curvelinear triangle and its subdivision on subtriangles.
The triangle with vertices P1,P2,P3 can be transformed into three smaller ones: the first triangle T1 with vertices P1,P5,P4, the second triangle T2 with vertices P4,P6,P3 and the third one T3 with vertices P5,P2,P6. Dependencies between large triangle and three smaller ones may be expressed eg. with the help of three following subdivision matrices:
Then, we have P'=B1*P, P''=B2*P, P'''=B3*P, where P is a matrix of control points completed by arbitrary elements to the non-singular one and P', P'' P''' are points of smaller triangles. It should be pointed out that for all triangles the same points enumerating rule was applied. Next, following [1],[9] one can derive IFS for generating fractal triangle in the form:
It should be stressed that very many subdivision matrices may be proposed to obtain fractal objects of Sierpinski gasket types. But, to get IFS consisting of contractive transformations subdivision matrices should be Markov ones, what means that their elements in rows are summing up to 1. Some further details concerning modeling different fractal objects using subdivision matrices and explanations concerning used maple procedures can be found in [2]-[8]. To render fractally Sierpinski gasket we used probabilistic fractal algorithm, sometimes called Chaos Game.
3. Maple programs
1. Procedure for generating Sierpinski gasket. Parameters: n - number of iterations, B1,B2,B3 - subdivision matrices, P - matrix of control points.
2. Procedure for generating Sierpinski triangle depending on parameter k related to subdivision matrices, n - number of iterations, P - matrix of control points.
3.1. Example I
The first set of subdivision matrices
Control points
set 1
set 2
set 3
3.2. Example II
The second set of subdivision matrices
3.3. Example III
The third set of subdivision matrices
3.4. Example IV
The fourth set of subdivision matrices
3.5. Example V
Subdivision matrices parametrized by k.
Animation
4.Conclusions
In the worksheet we demonstrated how to introduce control points to Sierpinski triangle to obtain possibility of changing its shape. We presented an ample collection of deformed Sierpinski triangles using different subdivision matrices. Of course, it is possible to introduce control points to other fractals. Also one can try to obtain similar results in 3D eg. for Sierpinski pyramid.
5.References
[1] R. Goldman, The Fractal Nature of B?zier Curves, Proceedings of the Geometric Modeling and Processing, April 13-15, Beijing, China, 2004, pp.3-11. [2] W. Kotarski, and A. Lisowska.,On Fractal Modeling of Contours, Maplesoft, 2005,
http:/www.maplesoft.com/applications/app_center_view.aspx?AID=1651.
[3] W. Kotarski and A. Lisowska, Probabilistic Approach to Fractal Modeling of Shapes, Maplesoft, 2005, http:/www.maplesoft.com/applications/app_center_view.aspx?AID=1657. [4] W. Kotarski and A. Lisowska, Fractal Rendering of 3D Patches, Maplesoft 2006, http://www.maplesoft.com/applications/app_center_view.aspx?AID=1955.
[5] W. Kotarski and A. Lisowska, Fractal Teapot from Utah, Maplesoft 2006, http://www.maplesoft.com/applications/app_center_view.aspx?AID=1956. [6] W. Kotarski and A. Lisowska, On B?zier-Fractal Modeling of 2D Shapes, International Journal of Pure and Applied Mathematics, vol. 24, no. 1, 2005, pp.123-134. [7] W. Kotarski and A. Lisowska, Chaikin's Approach to Fractal Modeling of 2D Contours, Proceedings of EUROCON 2005, Belgrade, Nov. 21-24, 2005, pp. 21-24. [8] W. Kotarski and A. Lisowska, Fractal Rendering of 3D Shapes, Proceedings of IECON'06, Paris, Nov. 8-10, 2006, pp. 3391-3396. [9] S. Schaefer, D.Levin and R. Goldman, Subdivision Schemes and Attractors, Eurographics Symposium on Geometry Processing, 2005, pp. 171-180.
Legal Notice: The copyright for this application is owned by the author(s). Neither Maplesoft nor the author are responsible for any errors contained within and are not liable for any damages resulting from the use of this material. This application is intended for non-commercial, non-profit use only. Contact the author for permission if you wish to use this application in for-profit activities.