Skip to content

mdiamantino/optimal-region-partitioning-convex-polygons-python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

About The Project

Please, read the following medium article to learn more about the implemented partitioning algorithm.

for drones zigzag partitioning

Getting Started

Prerequisites

Install tkinter

sudo apt-get install python3-tk

Installation

  1. Clone the repo
    git clone https://github.com/mdiamantino/optimal-region-partitioning-convex-polygons-python.git
  2. Enter the cloned directory and create a virtual environment
    cd optimal-region-partitioning-convex-polygons-python/
    python3 -m venv venv
  3. Activate the virtual environment
    . venv/bin/activate
  4. Install requirements
    pip3 install -r requirements.txt

Usage

  • Run demo.py to execute the partitioning of [(98, 136), (179, 323), (321, 313), (493, 142), (506, 23), (98, 58)] into 5 sub-regions.

    python3 demo.py
  • Or, use your own polygon's coordinates and number of partitions (with graphical visualization):

    python3 main.py
  • Or, use the project as module (without graphical visualization):

    python3
    >>> from partitioner import compute_partitions_recursive
    1. compute_partitions_recursive(YOUR COORDINATES HERE, YOUR NUMBER OF PARTITIONS HERE) Example:
    >>> compute_partitions_recursive([(0,0),(0,5),(7,7),(4,0)],3)

Contact

Mark Diamantino Caribé - Mark.Diamantinocaribe@student.kulevuen.be - LinkedIn

Project Link: https://github.com/mdiamantino/optimal-region-partitioning-convex-polygons-python

About

Implementation of algorithm to partition convex polygons in equal areas

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages