Polygon Boolean Operations

Boolean operations on polygons (union, subtract, intersect)

Algorithmia Platform License
apl

Run an Example

[
  [
    {
      "name": "segment",
      "pe": {
        "x": 200,
        "y": 20
      },
      "ps": {
        "x": 150,
        "y": 20
      }
    },
    {
      "name": "segment",
      "pe": {
        "x": 200,
        "y": 40
      },
      "ps": {
        "x": 200,
        "y": 20
      }
    },
    {
      "name": "segment",
      "pe": {
        "x": 100,
        "y": 40
      },
      "ps": {
        "x": 200,
        "y": 40
      }
    },
    {
      "name": "segment",
      "pe": {
        "x": 100,
        "y": 30
      },
      "ps": {
        "x": 100,
        "y": 40
      }
    },
    {
      "name": "segment",
      "pe": {
        "x": 0,
        "y": 30
      },
      "ps": {
        "x": 100,
        "y": 30
      }
    },
    {
      "name": "segment",
      "pe": {
        "x": 0,
        "y": 0
      },
      "ps": {
        "x": 0,
        "y": 30
      }
    },
    {
      "name": "segment",
      "pe": {
        "x": 150,
        "y": 0
      },
      "ps": {
        "x": 0,
        "y": 0
      }
    },
    {
      "name": "segment",
      "pe": {
        "x": 150,
        "y": 20
      },
      "ps": {
        "x": 150,
        "y": 0
      }
    }
  ]
]

Install & Use

Use

curl -X POST -d '[[0, 0, 150, 0, 150, 30, 0, 30],[100, 20, 200, 20, 200, 40, 100, 40],1]' -H 'Content-Type: application/json' -H 'Authorization: Simple YOUR_API_KEY' https://api.algorithmia.com/v1/algo/alexbol99/PolygonBooleanOp/1.1.0