clipper2

clipper2 is a skill for Claude Code, Codex from znlgis/opengis-skills. It costs 50 tokens per session (2,395 once invoked), scanned A, original, MIT.

A modern library for calculating operations on 2D polygons, including combining shapes, finding overlaps, cutting shapes apart and creating outlines at a distance. It supports C++, C#, Delphi and JavaScript, with Python bindings noted in the supplied material.

In plain words
What is it for?
Use it for map shapes, cutting paths, floor-plan geometry, nesting and other jobs that require polygon union, intersection, difference, XOR or offsetting. Choose decimal or integer paths depending on the precision needs of the application.
Why use it?
It handles common shape calculations with both decimal and whole-number coordinates, helping reduce errors in geometric processing. It is intended as the newer choice for projects that might otherwise use Clipper 1.x.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it for map shapes, cutting paths, floor-plan geometry, nesting and other jobs that require polygon union, intersection, difference, XOR or offsetting. Choose decimal or integer paths depending on the precision needs of the application.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/znlgis/opengis-skills/clipper2
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add znlgis/opengis-skills --skill clipper2
Clone the repo
git clone --depth 1 https://github.com/znlgis/opengis-skills

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for clipper2

README.md
[![agentmods](https://agentmods.dev/badge/skills/znlgis/opengis-skills/clipper2/github.svg)](https://agentmods.dev/skills/znlgis/opengis-skills/clipper2)
Your own site
<a href="https://agentmods.dev/skills/znlgis/opengis-skills/clipper2"><img src="https://agentmods.dev/badge/skills/znlgis/opengis-skills/clipper2/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for clipper2

Your own site · 80×15
<a href="https://agentmods.dev/skills/znlgis/opengis-skills/clipper2"><img src="https://agentmods.dev/badge/skills/znlgis/opengis-skills/clipper2.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 50 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,395 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00050 $0.02395
Opus 5 $0.00025 $0.01197
Sonnet 5 $0.00010 $0.00479
Haiku 4.5 $0.00005 $0.00239

Measured today against content hash cf6322d81ab1, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

clipper2 scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured today.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

cad/clipper2/SKILL.md · 250 lines

How it starts

The opening of the file, as written. The whole thing — 250 lines — stays where its author put it; the contents beside it link to each section on GitHub.

项目地址: https://github.com/AngusJohnson/Clipper2

官方文档: http://www.angusj.com/clipper2/Docs/Overview.htm

NuGet: Clipper2

许可证: Boost Software License 1.0

概述

Clipper2 相对 Clipper1 的提升:

  • 全新算法,速度更快、内存更省
  • 支持浮点(PathsD)与整数(Paths64)双模式
  • 全新偏移引擎:更鲁棒的 mitre/square/round 端帽与连接
  • 简洁 API:Union/Intersect/Difference/Xor 顶级函数
  • 多语言:C++、C#、Delphi、JS(Clipper2.js 移植)

安装

C#

dotnet add package Clipper2     # 提供 Clipper2Lib 命名空间

C++

# vcpkg
vcpkg install clipper2
# 或直接 add subdirectory CPP/Clipper2Lib 到 CMake

JavaScript

npm install clipper2-js

核心数据结构(C#)

using Clipper2Lib;

PointD pd = new(10.5, 20.7);            // 浮点点
PathD  path = new() { new(0,0), new(10,0), new(10,10), new(0,10) };
PathsD subj = new() { path };           // 多个 path
PathsD clip = new() { /* ... */ };

整数版本:Point64 / Path64 / Paths64,避免浮点误差。


布尔运算

using Clipper2Lib;

PathsD a = new() { Clipper.MakePath(new[] { 0d,0, 100,0, 100,100, 0,100 }) };
PathsD b = new() { Clipper.MakePath(new[] { 50d,50, 150,50, 150,150, 50,150 }) };

PathsD u = Clipper.Union(a, b, FillRule.NonZero);
PathsD i = Clipper.Intersect(a, b, FillRule.NonZero);
PathsD d = Clipper.Difference(a, b, FillRule.NonZero);
PathsD x = Clipper.Xor(a, b, FillRule.NonZero);

FillRule

  • EvenOdd(奇偶)
  • NonZero(非零)
  • Positive(正向缠绕)
  • Negative(负向缠绕)

多边形偏移(Inflate / 缩进)

PathsD outline = new() {
    Clipper.MakePath(new[] { 0d,0, 100,0, 100,100, 0,100 })
};

// 向外偏移 10 单位
PathsD outer = Clipper.InflatePaths(outline, 10,
    JoinType.Round,        // Square / Miter / Round
    EndType.Polygon);       // Polygon / Joined / Butt / Square / Round

// 向内偏移:负数
PathsD inner = Clipper.InflatePaths(outline, -10,
    JoinType.Miter, EndType.Polygon);

EndType:

  • Polygon 闭合多边形
  • Joined 开放多线段,端点首尾相连
  • Butt / Square / Round 开放线段端帽

高级用法(ClipperD/Clipper64 类)

需要更精细控制(PolyTree、ZFill 回调等):

Read the full file on GitHub · 250 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. today Changed cf6322d81ab1
  2. 8d ago Changed ce5a4cdf829c
  3. 12d ago First seen · 250 lines · 50 tokens per session scan A e0dfdf72e1f9

Subscribe to this mod's changes

clipper2 is a skill published in the GitHub repository znlgis/opengis-skills (61 stars, last pushed today), licensed MIT. It adds 50 tokens to every session and 2,395 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

game-engine-development

Skill de implementacao real de codigo de engine de jogo — Unity C# e Unreal C++. Cobre padroes de MonoBehaviour, ScriptableObject, object pooling, state machine, ECS, componentes de Actor/UPROPERTY/ UFUNCTION do Unreal, otimizacao de performance (profiling, batching, LOD, culling, garbage collection), e networking…

felvieira/claude-skills-fv · 247 tokens

vs-search

Routing rules for code search in C/C++, C#/.NET, JS/TS, and Python projects via vs-token-safer — use the vs-search MCP tools (clangd/Roslyn/tsserver/pyright language-server index) or the vts CLI instead of Bash grep. Use whenever searching for a symbol, definition, function, variable, type, or finding…

JSungMin/vs-token-safer · 109 tokens

dotnet-pinvoke

Correctly call native (C/C++) libraries from .NET using P/Invoke and LibraryImport. Covers function signatures, string marshalling, memory lifetime, SafeHandle, and cross-platform patterns. USE FOR: writing new P/Invoke or LibraryImport declarations, reviewing or debugging existing native interop code, wrapping a C or…

managedcode/dotnet-skills · 119 tokens

matlab-cpp-dll-csharp-validation

A workflow for moving numerical algorithms from MATLAB, a technical computing environment, into a C or C++ DLL that C# programs can call on Windows. It also checks that the converted results match MATLAB’s results.

Lggyy9/matlab2cpp-skill · 72 tokens

windows-interop-modernize

A reference for connecting modern Windows apps with older Windows technologies such as Win32, WPF, and WinForms. It covers native APIs, COM, C++, C#, Rust, and XAML Islands.

Fandhe-AI/agent-reference-skills · 202 tokens

ue5-cpp-gameplay

UE5.6/UE5.7 gameplay C++ implementation for Actors, Components, DataAssets, and gameplay logic. Use when requests ask to write .h/.cpp pairs, expose UPROPERTY/UFUNCTION to Blueprint, use GameplayTags, or build reusable component-based systems.

teixasalone/UnrealEngine5-Skills · 63 tokens