![]() |
VOOZH | about |
dotnet add package SixLabors.PolygonClipper --version 1.0.0
NuGet\Install-Package SixLabors.PolygonClipper -Version 1.0.0
<PackageReference Include="SixLabors.PolygonClipper" Version="1.0.0" />
<PackageVersion Include="SixLabors.PolygonClipper" Version="1.0.0" />Directory.Packages.props
<PackageReference Include="SixLabors.PolygonClipper" />Project file
paket add SixLabors.PolygonClipper --version 1.0.0
#r "nuget: SixLabors.PolygonClipper, 1.0.0"
#:package SixLabors.PolygonClipper@1.0.0
#addin nuget:?package=SixLabors.PolygonClipper&version=1.0.0Install as a Cake Addin
#tool nuget:?package=SixLabors.PolygonClipper&version=1.0.0Install as a Cake Tool
👁 Build Status
👁 codecov
👁 License: Six Labors Split
SixLabors.PolygonClipper provides high-performance polygon clipping and stroking in C#.
Boolean operations (union, intersection, difference, xor) are implemented with a Martínez-Rueda sweep-line pipeline for complex polygons with holes and multiple contours.
Contour normalization is handled by a dedicated Vatti/Clipper2-inspired pipeline (PolygonClipper.Normalize) that resolves self-intersections/overlaps into positive-winding output.
PolygonStroker can optionally run that normalization pass on emitted stroke geometry.
PolygonClipper.Normalize (Clipper2-inspired) for positive-winding contour normalizationPolygonStroker for configurable geometric stroking (joins, caps, miter limits)The API centers around Polygon and Contour types. Construct input polygons using contours, then apply Boolean operations via PolygonClipper:
Polygon result = PolygonClipper.Union(subject, clipping);
Boolean operations can process self-intersecting inputs directly. Use normalization when you want canonical positive-winding contours (for example, before export or rendering pipelines that rely on winding semantics):
Polygon clean = PolygonClipper.Normalize(input);
Normalize uses a fixed positive-winding normalization path.
Use PolygonStroker to generate filled stroke polygons from input contours:
Polygon stroked = PolygonStroker.Stroke(input, width: 12);
Configure join/cap behavior through StrokeOptions:
StrokeOptions options = new()
{
LineJoin = LineJoin.Round,
LineCap = LineCap.Round,
MiterLimit = 4,
ArcDetailScale = 1
};
Polygon stroked = PolygonStroker.Stroke(input, width: 12, options);
This project draws on the following algorithm and implementation references:
- Martínez et al., "A simple algorithm for Boolean operations on polygons", Advances in Engineering Software, 64 (2013), pp. 11-19.
https://doi.org/10.1016/j.advengsoft.2013.04.004
- Vatti, "A generic solution to polygon clipping", Communications of the ACM, 35(7), 1992, pp. 56-63.
https://dl.acm.org/doi/pdf/10.1145/129902.129906
21re, rust-geo-booleanop (Rust Martínez-Rueda implementation reference).
https://github.com/21re/rust-geo-booleanop
Angus Johnson, Clipper2 polygon clipping library (reference implementation for the normalization pipeline).
https://github.com/AngusJohnson/Clipper2
Six Labors Split License. See LICENSE for details.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 net8.0 is compatible. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 was computed. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 was computed. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
Showing the top 1 NuGet packages that depend on SixLabors.PolygonClipper:
| Package | Downloads |
|---|---|
|
SixLabors.ImageSharp.Drawing
Drawing extensions for ImageSharp with support for shapes, paths, text, and image rendering. |
Showing the top 1 popular GitHub repositories that depend on SixLabors.PolygonClipper:
| Repository | Stars |
|---|---|
|
SixLabors/ImageSharp.Drawing
:pen: Extensions to ImageSharp containing a cross-platform 2D polygon manipulation API and drawing operations.
|
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.0 | 19,624 | 5/12/2026 |