{"id":15039702,"url":"https://github.com/angusjohnson/clipper2","last_synced_at":"2025-05-14T07:08:13.331Z","repository":{"id":37306434,"uuid":"462938438","full_name":"AngusJohnson/Clipper2","owner":"AngusJohnson","description":"Polygon Clipping and Offsetting - C++, C# and Delphi","archived":false,"fork":false,"pushed_at":"2025-05-04T12:30:08.000Z","size":11845,"stargazers_count":1742,"open_issues_count":5,"forks_count":320,"subscribers_count":51,"default_branch":"main","last_synced_at":"2025-05-04T12:33:31.789Z","etag":null,"topics":["algorithm","boolean-operations","clipping","clipping-algorithm","cpp","csharp","delphi","geometry","inflate","offsetting","pascal","polygon","polygon-boolean","polygon-clipping","polygon-clipping-algorithm","polygon-intersection","polygon-union"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsl-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AngusJohnson.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2022-02-23T23:19:12.000Z","updated_at":"2025-05-04T12:30:12.000Z","dependencies_parsed_at":"2023-12-01T13:42:56.523Z","dependency_job_id":"b13abfdb-a645-49be-85ae-460f1ec54487","html_url":"https://github.com/AngusJohnson/Clipper2","commit_stats":{"total_commits":697,"total_committers":39,"mean_commits":"17.871794871794872","dds":0.1893830703012912,"last_synced_commit":"7598be97d333837c460c778dd16ba8d945fefdba"},"previous_names":[],"tags_count":21,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AngusJohnson%2FClipper2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AngusJohnson%2FClipper2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AngusJohnson%2FClipper2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AngusJohnson%2FClipper2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AngusJohnson","download_url":"https://codeload.github.com/AngusJohnson/Clipper2/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254092776,"owners_count":22013290,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["algorithm","boolean-operations","clipping","clipping-algorithm","cpp","csharp","delphi","geometry","inflate","offsetting","pascal","polygon","polygon-boolean","polygon-clipping","polygon-clipping-algorithm","polygon-intersection","polygon-union"],"created_at":"2024-09-24T20:43:41.362Z","updated_at":"2025-05-14T07:08:13.306Z","avatar_url":"https://github.com/AngusJohnson.png","language":"C++","readme":"# Clipper2\n### A Polygon \u003ca href=\"https://en.wikipedia.org/wiki/Clipping_(computer_graphics)\"\u003eClipping\u003c/a\u003e and \u003ca href=\"https://en.wikipedia.org/wiki/Parallel_curve\"\u003eOffsetting\u003c/a\u003e library (in C++, C# \u0026amp; Delphi)\u003cbr\u003e\n[![GitHub Actions C++ status](https://github.com/AngusJohnson/Clipper2/actions/workflows/actions_cpp.yml/badge.svg)](https://github.com/AngusJohnson/Clipper2/actions/workflows/actions_cpp.yml)\u0026nbsp;[![C#](https://github.com/AngusJohnson/Clipper2/actions/workflows/actions_csharp.yml/badge.svg)](https://github.com/AngusJohnson/Clipper2/actions/workflows/actions_csharp.yml)\u0026nbsp;[![License](https://img.shields.io/badge/License-Boost_1.0-lightblue.svg)](https://www.boost.org/LICENSE_1_0.txt)\n[![Nuget](https://img.shields.io/nuget/v/Clipper2?color=green)](https://www.nuget.org/packages/Clipper2)\n[![documentation](https://user-images.githubusercontent.com/5280692/187832279-b2a43890-da80-4888-95fe-793f092be372.svg)](https://www.angusj.com/clipper2/Docs/Overview.htm)\n\nThe \u003cb\u003eClipper2\u003c/b\u003e library performs **intersection**, **union**, **difference** and **XOR** boolean operations on both simple and complex polygons. It also performs polygon offsetting. This is a major update of my original \u003ca href=\"https://sourceforge.net/projects/polyclipping/\"\u003e\u003cb\u003eClipper\u003c/b\u003e\u003c/a\u003e library that was written over 10 years ago. That library I'm now calling \u003cb\u003eClipper1\u003c/b\u003e, and while it still works very well, Clipper2 is [better](https://www.angusj.com/clipper2/Docs/Changes.htm) in just about every way.\n\n### Compilers\n\u003cb\u003eClipper2\u003c/b\u003e can be compiled using either C++, or C#, or Delphi Pascal. The library can also be accessed from other programming languages by dynamically linking to exported functions in the [C++ compiled Clipper2 library](https://github.com/AngusJohnson/Clipper2/tree/main/DLL). (Since the C++ compiled code is [measurably](https://www.angusj.com/clipper2/Docs/Changes.htm) faster, C# and Delphi developers may also prefer this approach in applications where the library's performance is critical.) \n| Lang. | Requirements |\n| --- | --- |\n| [**C++:**](https://github.com/AngusJohnson/Clipper2/tree/main/CPP) | Requires C++17 (could be modified to C++11 with relatively minor changes), **or**| \n| [**C#:**](https://github.com/AngusJohnson/Clipper2/tree/main/CSharp) | The library uses Standard Library 2.0 but the sample code uses .NET6, **or**| \n| [**Delphi:**](https://github.com/AngusJohnson/Clipper2/tree/main/Delphi) | Compiles with any version of Delphi from version 7 to current.| \n\n### Documentation\n\n \u003ca href=\"https://www.angusj.com/clipper2/Docs/Overview.htm\"\u003e\u003cb\u003eExtensive HTML documentation\u003c/b\u003e\u003c/a\u003e\n\u003cbr\u003e\u003cbr\u003e\n\n### Examples\n\n\u003cpre\u003e\n      //C++\n      Paths64 subject, clip, solution;\n      subject.push_back(MakePath({100, 50, 10, 79, 65, 2, 65, 98, 10, 21}));\n      clip.push_back(MakePath({98, 63, 4, 68, 77, 8, 52, 100, 19, 12}));\n      solution = Intersect(subject, clip, FillRule::NonZero);\u003c/pre\u003e\n\u003cpre\u003e      //C#\n      Paths64 subj = new Paths64();\n      Paths64 clip = new Paths64();\n      subj.Add(Clipper.MakePath(new int[] { 100, 50, 10, 79, 65, 2, 65, 98, 10, 21 }));\n      clip.Add(Clipper.MakePath(new int[] { 98, 63, 4, 68, 77, 8, 52, 100, 19, 12 }));\n      Paths64 solution = Clipper.Intersect(subj, clip, FillRule.NonZero);\u003c/pre\u003e\n\u003cpre\u003e      //Delphi\n      var \n        subject, clip, solution: TPaths64;\n      begin\n        SetLength(subject, 1);\n        subject[0] := MakePath([100, 50, 10, 79, 65, 2, 65, 98, 10, 21]);\n        SetLength(clip, 1);\n        clip[0] := MakePath([98, 63, 4, 68, 77, 8, 52, 100, 19, 12]);\n        solution := Intersect( subject, clip, frNonZero);\u003c/pre\u003e\n![clipperB](https://user-images.githubusercontent.com/5280692/178123810-1719a1f5-25c3-4a9e-b419-e575ff056272.svg)\n\n\u003chr\u003e\n\n### Ports to other languages\n| lang. | link |\n| ------ | ------ |\n| **WASM** | https://github.com/ErikSom/Clipper2-WASM/ |\n| **Java** | https://github.com/micycle1/Clipper2-java/ |\n| **Kotlin** | https://github.com/Monkey-Maestro/clipper2-kotlin |\n| **golang** | https://github.com/epit3d/goclipper2 |\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fangusjohnson%2Fclipper2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fangusjohnson%2Fclipper2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fangusjohnson%2Fclipper2/lists"}