toanqng / martinez-rueda

Martinez algorithm for polygon Boolean operations

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Martinez-Rueda polygon boolean operations algorithm

PHP implementation of original algorithm http://www4.ujaen.es/~fmartin/bool_op.html

Algorithm is used for computing Boolean operations on polygons:

  • union
  • difference
  • intersection
  • xor

Usage

Input parameter is a multipolygon - an array of polygons. And each polygon is an array of points x,y.

   TODO

Some visual examples

Let's consider two polygons: green multipolygon of two polygons and yellow polygon.

Snow-white polygon is result of Boolean operation on two polygons.

Union

Difference (green NOT yellow)

Intersection

Xor

About

Martinez algorithm for polygon Boolean operations

License:MIT License


Languages

Language:Go 100.0%