ai-agent

polygon-clipping: Simplify Geometries

Get boolean clipping operations for polygons.
639 stars68 forksJavaScriptGuide quality 8/10Updated 4/19/2024100% free · open source
What it does

The polygon-clipping tool applies boolean clipping operations such as union, intersection, difference, and xor to polygons and multi-polygons in JavaScript.

When to use it
  • When working with geographic information systems (GIS) and need to manipulate polygon shapes
  • When developing a web application that requires spatial operations on polygons
  • When analyzing geometric data and need to perform boolean operations on polygons
Ready-to-paste prompt
const polygon1 = [[0, 0], [1, 0], [1, 1], [0, 1], [0, 0]]; const polygon2 = [[0.5, 0], [1.5, 0], [1.5, 1], [0.5, 1], [0.5, 0]]; const unionResult = clip.union(polygon1, polygon2); console.log(unionResult);
Heads up: Make sure the input polygons are valid (i.e., they have at least 3 points and the last point is the same as the first point) to avoid errors during clipping operations
Saves to your device
Use with Claude
New

Skip the builder — one click puts this in Claude, Cursor, Antigravity and more.

✅ Light setup

Installs with a command or two; your AI agent can do it for you.

Try it instantly — no install
Claude Code
mkdir -p ~/.claude/skills/polygon-clipping && curl -fsSL https://workflowstacks.com/api/skills/polygon-clipping/claude-skill -o ~/.claude/skills/polygon-clipping/SKILL.md
Open in another AI app

Opens the app with this repo with the prompt ready to go — no copy-paste needed.

Connect the whole catalog (MCP)
claude mcp add --transport http workflowstacks https://workflowstacks.com/api/mcp

Adds a WorkflowStacks connector to Claude Code: search and load any skill here by chatting.

How polygon-clipping: Simplify Geometries works
Codeflow
Free to inspect

Polygon-clipping: Simplify Geometries is a small JavaScript project (~1.8k lines across 21 code files, plus 10 test files). Setup is light: installs like a normal app. Reading the code is optional. Last commit 29 months ago, MIT license, has a test suite.

Size
Small codebase
~1.8k lines · 21 code files · 15 min skim
Setup
One-command install
Installs like a normal app. Reading the code is optional.
Runs on
Node.js
No API keys detected
JavaScript 100%
Where to start reading
  1. 1
    README.md
    Start here — what it does and how to install it
  2. 2
    src/index.js
    Where the program starts running
  3. 3
    package.json
    Dependencies and the commands it exposes
What's in each folder
src/Core code — the actual logic13 files
docs/Documentation12 files
bench/Folder6 files
test/Tests — proof it works240 files
.github/CI / automation (GitHub Actions)1 files
READMEHas testsDocumentedCI checksMIT licenseLast update 29 mo ago
Quick Actions
Details
Creator
mfogel
Language
JavaScript
Category
ai-agent
Published
1/26/2018

Are you the creator of this tool? Claim your listing → and earn 85% of every sale.