8000 GitHub - helderco/univ-polyclip: Efficient Clipping of Arbitrary Polygons using OpenGPL, based on a paper by Günther Greiner and Kai Hormann, for a Graphical Computation class. Provided Python and Java versions. Switch branches for each.
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
This repository was archived by the owner on Feb 21, 2022. It is now read-only.
/ univ-polyclip Public archive

Efficient Clipping of Arbitrary Polygons using OpenGPL, based on a paper by Günther Greiner and Kai Hormann, for a Graphical Computation class. Provided Python and Java versions. Switch branches for each.

License

Notifications You must be signed in to change notification settings

helderco/univ-polyclip

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Efficient Clipping of Arbitrary Polygons using OpenGPL

Based on the paper "Efficient Clipping of Arbitrary Polygons" by Günther Greiner (greiner[at]informatik.uni-erlangen.de) and Kai Hormann (hormann[at]informatik.tu-clausthal.de), ACM Transactions on Graphics 1998;17(2):71-83.

Available at: http://www.inf.usi.ch/hormann/papers/Greiner.1998.ECO.pdf

Motivation

This work was created for educational purposes only, as an implementation in Python of the above algorithm, for a class in Graphical Computation.

To study the algorithm, inspect the file polygon.py. It can be imported and used in other contexts (i.e., not OpenGL).

Import

> import polygon
> help(polygon)
> from polygon import *

Command line

The command line interface (polyclip.py) is provided for demonstration or testing purposes, using OpenGL.

Requirements

Supports Python 2.5 or later.

Requires PyOpenGL (version 3 as of this writing). If you have pip, install is easy:

pip install pyopengl

Usage

Supported operations are: union, intersection and difference.

Polygon overrides

Subject and clip polygon can be defined per command line option. Defaults for the subject and clip polygon are set at the beggining of the file for easy edit, but they can be overriden from the command line using the options --subj-poly and --clip-poly.

Example:

polyclip.py --subj-poly="1.5, 1.25; 7.5, 2.5; 4, 3; 4.5, 6.5"

Options

Type polyclip.py -h for available options. Press Esc to exit.

About

Efficient Clipping of Arbitrary Polygons using OpenGPL, based on a paper by Günther Greiner and Kai Hormann, for a Graphical Computation class. Provided Python and Java versions. Switch branches for each.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

0