CG-Penrose is a software developed using Python 3.6 and Qt5, in Computer Graphics discipline, taught by prof. Jonatas Oliveira. It can help you to simulate lines rasterization and calculate 2D transformations on polygons.
Features:
- 2D Geometric transformations like translation, shearing, scaling, rotation and reflection/mirroring in any polygon specified by you.
- Simulate line rasterization using algorithms like Digital Differential Analyzer (DDA) and Bresenham Line-Drawing
🌟 Don't forget to give a star to this repo =)
-
Clone the repo
$ git clone https://github.com/allexlima/cg-penrose.git $ cd cg-penrose/
-
Using
Makefile
:Supported only in Linux-like operating systems yet 💁
Prepare everything using only
$ make
Then,
$ make run
and be happy :)
~OR~
-
Create virtualenv and install the requirements
$ virtualenv -p python3 env $ source env/bin/activate
$ pip install -r requirements.txt
-
Compile the UIs
$ python setup.py build_ui
-
Install the package
$ pip install -e .
-
And finally, run
penrose
=)$ python -m penrose
How to use line rasterization functions?
- Insert, using the push button exactly 2 vertices. Then, navigate to Tools > Rasterize line with... and choose any algorithm.
How to apply one or more transformations in a 2D polygon?
-
First, you should know that you must insert at least 3 vertices through the 'push' button, in the main screen. After this, you can render your polygon clicking in Tools > Render, or pressing F4 key shortcut.
-
With your polygon rendered, now you can apply any of one transformation available in the 2D Transformations tab. You can check the selected transformation and set the necessary parameters, then you should click in Tools > Update or press F5 key to apply and see the output.
Developed by Allex Lima, Paulo Moraes and Renan Barroncas with ❤️ using Python 3.6 and PyQt5!