This project uses recursion to generate pseudo‐random art in a Mondrian style. Your program’s output will be an HTML document that contains rectangle primitives (perhaps among others) within an SVG tag.
The main strategy for recursion is:
- If the region is wider than half the initial canvas size and the region is taller than half the initial canvas height:
- Use recursion to split the region into 4 smaller regions (a vertical split and a horizontal split) with the split location is chosen randomly
- Else: if the region is wider than half the initial canvas size: Use recursion to split the region into 2 smaller regions using a vertical line with the split location chosen randomly
- Else: if the region is taller than half the initial canvas size: Use recursion to split the region into 2 smaller regions using a horizontal line with the split location is chosen randomly
- Else: if the region is big enough to split both horizontally and vertically, and both a horizontal and vertical split is randomly selected: Use recursion to split the region into 4 smaller regions (a vertical split and a horizontal split) with the split location is chosen randomly
- Else: if the region is big enough to split horizontally, and a horizontal split is selected: Use recursion to split the region into 2 smaller regions using a vertical line with the split location chosen randomly
- Else: if the region is big enough to split vertically, a vertical split is selected: Use recursion to split the region into 2 smaller regions using a horizontal line with the split location is chosen randomly
- Else:fill the current region (randomly, either white or colored, and if colored, with a random determination of picked color, with a pattern or not).
The project is written in Python 3.8.2 and packages which are used:
pip install numpy PyQt5Execute file
randomMondrianArt.exe
cd 2020_Random_Mondrian_Art-master
python3 gui.pyThis project is a university assignment from the subject Programming Paradigms
- Profesor: doc dr Milena Vujošević Janičić
- Assistant: Marjana Šolajić
Students authors of the project:
- Ana Milićević (mr16042@alas.matf.bg.ac.rs)
- Miloš Kutlešić (mr16182@alas.matf.bg.ac.rs)
- Uroš Dimitrijević (mr16193@alas.matf.bg.ac.rs)