Skip to content

Pyenvelope helps you find an arbitrarily oriented minimum bounding rectangle of a set of points. Minimum bounding rectangle (MBR), also known as bounding box or envelope.

License

Notifications You must be signed in to change notification settings

kaygorodov/pyenvelope

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pyenvelope

Build Status

Pyenvelope helps you find an arbitrarily oriented minimum bounding rectangle of a set of points. Minimum bounding rectangle (MBR), also known as bounding box or envelope.

Currently, it calculates a bounding rectangle with minimum area (I am going to add the logic for minimum perimeter soon). It uses the rotating calipers method https://en.wikipedia.org/wiki/Rotating_calipers.

Installation

You can use pip:

$ pip install pyenvelope

Usage

Use the get_minimum_bounding_rectangle function. It takes a set of points and returns coordinates of MBR vertices:

>>> from pyenvelope import get_minimum_bounding_rectangle
>>> get_minimum_bounding_rectangle([(1, 2), (2, 6), (3, 7), (2, 2)])
[(1.94, 1.76), (3.2, 6.94), (2.29, 7.17), (1.00, 2.00), (1.94, 1.76)]

About

Pyenvelope helps you find an arbitrarily oriented minimum bounding rectangle of a set of points. Minimum bounding rectangle (MBR), also known as bounding box or envelope.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages