Skip to content

matf-pp/2020_Random_Mondrian_Art

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

114 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

2020_Random_Mondrian_Art

Random Mondrian Art

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).

Language

The project is written in Python 3.8.2 and packages which are used:

Dependencies

To install NumPy and PyQt5:
pip install numpy PyQt5

Launching

Windows :

Execute file
icon randomMondrianArt.exe

Linux:

cd  2020_Random_Mondrian_Art-master
python3 gui.py

Examples

Example withouth patterns:

example_1

Example with patterns:

example_2

Authors and acknowledgment

This project is a university assignment from the subject Programming Paradigms

Students authors of the project:

About

Project from subject 'Programske Paradigme (University of Belgrade, Faculty of Mathematics) about generating random Mondrian-like art'

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages