Python Interactive Graphical System made during Computer Graphics classes (INE5420-2021.1)

Overview

PY-IGS - The PYthon Interactive Graphical System

PY-IGS

The PY-IGS

Installation

To install this software you will need these dependencies (with their thevelopment libraries):

  • Numba/SciPy/NumPy Compatible Setup (https://numba.readthedocs.io/en/stable/user/installing.html) (Use for C matrix multiplication)
  • Gtk 3.20+
  • PyGOBject Dependencies (libgirepository1.0-dev gcc libcairo2-dev pkg-config python3-dev gir1.2-gtk-3.0)
  • Python 3.8+
  • Poetry (To install it, please visit the official install instructions)

After install them, install python dependencies with:

poetry install

How to Use

Executing

In order to execute this program, run the following command:

poetry run python3 py_igs

Navigation

To navigate through the world, you can use the mouse or the navigation widget.

To move with the mouse, simply click over the viewport and drag your cursor over the screen. The amplitude of this movement is inverse to the scale of the world, enabling a smooth view in your screen.

If you want to use the navigation widget, you need to click on the buttons that are displayed on the navigation grid in the left panel. You can configure the amplitude of this movement with the "Pan Step" field (world units).

For zooming, you can use your mouse scroll or the + and - buttons on the navigation grid. You can configure the zoom ammount with the "Zoom Step" slider (from 0,01% up to 50% each step)

You can also rotate the Window using the upper left and upper right buttons on navigation grid.

Navigation Widget

The navigation widget

Adding Objects

To add an object, you need to click on the "Add" button located in the objects widget. A dialog will popup in your screen.

In this dialog, insert the object name (unique in the scene) then insert the points coordinates of your object. You can select the type of the object by changing the active tab of the dialog. The drawing color can also be defined in this dialog. There is an option to fill wireframes too, just check the filled option when adding the object.

You can also input raw values at the "Text" tab. To use it, declare points using this format: (x1, y1), (x2, y2), ... (Obs: New lines are not allowed).

After that, click on the save button. The object will appear on the world at the given coordinates.

Adding an object

Adding an object

Editing Objects (Transforms)

Clicking in the edit button (in the objects widget) will open the editing dialog. In this window, you can define 3 transformations to apply on the object. They are: Translation, Rotation and Scaling. The translation will move the object over the world. The rotation will rotate the object around a given point that can be the world origin, the object center or a point that you specify. The scale will scale the objects in a "natural" way, i.e., based on the object center.

All transformations are stored in a list that will be merged when applying these transformations to the object.

Editing an object

Editing an object

Removing Objects

Select an object of the object list and then press the remove button in the objects widget. The object will disappear.

Objects Widget

The objects widget

Window Clipping

Currently we support 3 methods for Window clipping, they are:

  • None
  • Cohen-Sutherland
  • Liang-Barsky

To choose it, select the desired method in the Clipping Method option in the Window widget.

Window Widget

The window widget

Import/Export Scenes (Wavefront Object)

In the menu bar, you can select the Scene, then select Open to import objects. A file chooser will pop up and the you need to select the file to import.

To export your scene, click on Scene, then select Save As. Then define were you want to save your .obj (Model) file and then select a location for the .mtl (Materials) file.

Example Files

In the example/objects folder you can find many models that were utilized to test Py-Igs functionalities.


About

Made by Enzo Coelho Albornoz and Gabriel Soares Flores.

Software developed for the Computer Graphics (INE5420-2021.1) course. This course is part of our graduation in Computer Science at the Federal University of Santa Catarina (UFSC).

Window Widget

Made in UFSC

You might also like...
Izy - Python functions and classes that make python even easier than it is

izy Python functions and classes that make it even easier! You will wonder why t

Script that creates graphical representations of Julia an Mandelbrot sets.

Julia and Mandelbrot Picture Maker This simple functions create simple plots of the Julia and Mandelbrot sets. The Julia set require the important par

Macros in Python: quasiquotes, case classes, LINQ and more!

MacroPy3 1.1.0b2 MacroPy is an implementation of Syntactic Macros in the Python Programming Language. MacroPy provides a mechanism for user-defined fu

Python Classes Without Boilerplate

attrs is the Python package that will bring back the joy of writing classes by relieving you from the drudgery of implementing object protocols (aka d

Simple but maybe too simple config management through python data classes. We use it for machine learning.

👩‍✈️ Coqpit Simple, light-weight and no dependency config handling through python data classes with to/from JSON serialization/deserialization. Curre

This is a backport of the BaseExceptionGroup and ExceptionGroup classes from Python 3.11.

This is a backport of the BaseExceptionGroup and ExceptionGroup classes from Python 3.11. It contains the following: The exceptiongroup.BaseExceptionG

WATTS provides a set of Python classes that can manage simulation workflows for multiple codes where information is exchanged at a coarse level

WATTS (Workflow and Template Toolkit for Simulation) provides a set of Python classes that can manage simulation workflows for multiple codes where information is exchanged at a coarse level.

Simple tooling for marking deprecated functions or classes and re-routing to the new successors' instance.

pyDeprecate Simple tooling for marking deprecated functions or classes and re-routing to the new successors' instance

An extended version of the hotkeys demo code using action classes

An extended version of the hotkeys application using action classes. In adafruit's Hotkeys code, a macro is using a series of integers, assumed to be

Releases(v0.6.1)
  • v0.6.1(Aug 6, 2021)

    Changelog

    Import/Export

    • Support to export/import Bezier and B-Spline curves

    Performance

    • 🏎️ Used Numba + SciPy + Numpy to speed up matrix operations 🚀
    Source code(tar.gz)
    Source code(zip)
  • v0.6.0(Jul 27, 2021)

  • v0.5.0(Jul 27, 2021)

    Changelog

    Docs

    • Updated object edit description and screenshot.

    Curves

    • We now support curves! 🥳
    • Added Bezier 2D object type, with blending functions method

    Object Editing

    • You can now add more than three transformations per edit. You can repeat types in any order
    • Object centers keep tracks of all transformation that are in memory (Object center now follows transformations)
    Source code(tar.gz)
    Source code(zip)
  • 0.4.0(Jul 23, 2021)

    Changelog

    Docs

    • Updated docs with the new functionalities.
    • Added UFSC logo

    Clipping

    • Added Cohen-Sutherland line and wireframe clipping.
    • Added Liang-Barsky line and wireframe clipping.
    • Added Cohen Sutherland line and wireframe clipping.

    Object Creation

    • Added option to fill wireframes

    Import/Export

    • Added support for Wavefront Object file type
    Source code(tar.gz)
    Source code(zip)
  • 0.2.3(Jul 7, 2021)

  • 0.2.2(Jul 6, 2021)

    Changelog

    Object Creation

    • Added an option to use raw input with the format (x1, y1), (x2, y2), ...

    Docs

    • Update prints to inform about raw input
    Source code(tar.gz)
    Source code(zip)
  • 0.2.1(Jul 6, 2021)

  • 0.2.0(Jul 3, 2021)

    Changelog

    Objects Editing

    There is a new button that allows the user to transform the objects. These transformations are :

    • Translations
    • Scaling around object center
    • Rotations around:
      • Center of the world
      • Center of the object
      • Any point (arbitrary)

    Object Creation

    The user can now define a drawing color for an object. Simply use the color picker that appears at the object creation.

    Source code(tar.gz)
    Source code(zip)
Owner
Enzo Coelho Albornoz
Hello!!! I'm a brazilian undergrad student of Computer Science on UFSC (Universidade Federal de Santa Catarina).
Enzo Coelho Albornoz
Repo Home WPDrawBot - (Repo, Home, WP) A powerful programmatic 2D drawing application for MacOS X which generates graphics from Python scripts. (graphics, dev, mac)

DrawBot DrawBot is a powerful, free application for macOS that invites you to write Python scripts to generate two-dimensional graphics. The built-in

Frederik Berlaen 342 Dec 27, 2022
A program that takes Python classes and turns them into CSS classes.

PyCSS What is it? PyCSS is a micro-framework to speed up the process of writing bulk CSS classes. How does it do it? With Python!!! First download the

T.R Batt 0 Aug 3, 2021
Nicotine+: A graphical client for the SoulSeek peer-to-peer system

Nicotine+ Nicotine+ is a graphical client for the Soulseek peer-to-peer file sharing network. Nicotine+ aims to be a pleasant, Free and Open Source (F

null 940 Jan 3, 2023
Python 3.9.4 Graphics and Compute Shader Framework and Primitives with no external module dependencies

pyshader Python 3.9.4 Graphics and Compute Shader Framework and Primitives with no external module dependencies Fully programmable shader model (even

Alastair Cota 1 Jan 11, 2022
All exercises done during the Python 3 course in the Video Course (World 1, 2 and 3)

Python3-cursoemvideo-exercises - All exercises done during the Python 3 course in the Video Course (World 1, 2 and 3)

Renan Barbosa 3 Jan 17, 2022
The CS Netlogo Helper is a small python script I made, to make computer science homework easier.

The CS Netlogo Helper is a small python script I made, to make computer science homework easier. This project is really ironic now that I think about it.

null 1 Jan 13, 2022
Prints values and types during compilation!

Compile-Time Printer Compile-Time Printer prints values and types at compile-time in C++. Teaser test.cpp compile-time-printer

null 43 Dec 26, 2022
Schemdule is a tiny tool using script as schema to schedule one day and remind you to do something during a day.

Schemdule is a tiny tool using script as schema to schedule one day and remind you to do something during a day. Platform Python Install Use pip: pip

StardustDL 4 Sep 13, 2021
Originally used during Marketplace.tf's open period, this program was used to get the profit of items bought with keys and sold for dollars.

Originally used during Marketplace.tf's open period, this program was used to get the profit of items bought with keys and sold for dollars. Practically useless for me now, but can be used as an example of tkinter.

BoggoTV 1 Dec 11, 2021
PressurePlate is a multi-agent environment that requires agents to cooperate during the traversal of a gridworld.

PressurePlate is a multi-agent environment that requires agents to cooperate during the traversal of a gridworld. The grid is partitioned into several rooms, and each room contains a plate and a closed doorway.

Autonomous Agents Research Group (University of Edinburgh) 6 Dec 3, 2022