CodeBrix.PolygonTools.MitLicenseForever 1.0.252.1257

dotnet add package CodeBrix.PolygonTools.MitLicenseForever --version 1.0.252.1257
                    
NuGet\Install-Package CodeBrix.PolygonTools.MitLicenseForever -Version 1.0.252.1257
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="CodeBrix.PolygonTools.MitLicenseForever" Version="1.0.252.1257" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="CodeBrix.PolygonTools.MitLicenseForever" Version="1.0.252.1257" />
                    
Directory.Packages.props
<PackageReference Include="CodeBrix.PolygonTools.MitLicenseForever" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add CodeBrix.PolygonTools.MitLicenseForever --version 1.0.252.1257
                    
#r "nuget: CodeBrix.PolygonTools.MitLicenseForever, 1.0.252.1257"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package CodeBrix.PolygonTools.MitLicenseForever@1.0.252.1257
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=CodeBrix.PolygonTools.MitLicenseForever&version=1.0.252.1257
                    
Install as a Cake Addin
#tool nuget:?package=CodeBrix.PolygonTools.MitLicenseForever&version=1.0.252.1257
                    
Install as a Cake Tool

CodeBrix.PolygonTools

A fully managed, cross-platform 2D polygon clipping and offsetting library for .NET. CodeBrix.PolygonTools performs the four boolean set operations - intersection, union, difference and exclusive-or - on arbitrary sets of polygons and open paths, and inflates or deflates polygons with miter, round or square joins. It operates on 64-bit integer coordinates so that its arithmetic is exact and its results are robust, and it correctly handles self-intersecting polygons, holes, and polygons with coincident or collinear edges. CodeBrix.PolygonTools has no dependencies other than .NET, and is provided as a .NET 10 library and associated CodeBrix.PolygonTools.MitLicenseForever NuGet package.

CodeBrix.PolygonTools supports applications and assemblies that target Microsoft .NET version 10.0 and later. Microsoft .NET version 10.0 is a Long-Term Supported (LTS) version of .NET, and was released on Nov 11, 2025; and will be actively supported by Microsoft until Nov 14, 2028. Please update your C#/.NET code and projects to the latest LTS version of Microsoft .NET.

Installation

dotnet add package CodeBrix.PolygonTools.MitLicenseForever

Note that the NuGet package ID and the namespace are different - there is no package named plain CodeBrix.PolygonTools:

  • NuGet package ID: CodeBrix.PolygonTools.MitLicenseForever
  • Assembly and primary namespace: CodeBrix.PolygonTools - i.e. using CodeBrix.PolygonTools;

XML documentation (IntelliSense) ships alongside the assembly.

The package has no NuGet dependencies at all - nothing beyond .NET itself is pulled in.

CodeBrix.PolygonTools supports:

  • All four boolean clipping operations on sets of polygons - intersection, union, difference and exclusive-or
  • Four filling rules - even-odd, non-zero, positive and negative - so the library interoperates with GDI+, Cairo, OpenGL, SVG and similar rendering models
  • Polygon offsetting (inflating and deflating) with miter, round and square joins, and butt, square or round line ends
  • Open-path (polyline) clipping as well as closed-polygon clipping
  • Self-intersecting polygons, holes, and polygons with coincident or collinear edges
  • Results returned either as a flat list of paths or as a PolyTree that preserves the parent/child nesting of outer polygons and their holes
  • Supporting operations including SimplifyPolygon, CleanPolygon, Orientation, Area, PointInPolygon, MinkowskiSum and MinkowskiDiff
  • Exact 64-bit integer arithmetic, with no floating-point rounding artifacts in the clipping result

Sample Code

Union of two overlapping squares

using System.Collections.Generic;
using CodeBrix.PolygonTools;
using CodeBrix.PolygonTools.Enumerations;
using CodeBrix.PolygonTools.Models;

var subject = new List<IntPoint>
{
    new IntPoint(0, 0), new IntPoint(100, 0), new IntPoint(100, 100), new IntPoint(0, 100)
};

var clip = new List<IntPoint>
{
    new IntPoint(50, 50), new IntPoint(150, 50), new IntPoint(150, 150), new IntPoint(50, 150)
};

var solution = new List<List<IntPoint>>();

var polyClip = new PolyClip();
polyClip.AddPath(subject, PolyType.ptSubject, true);
polyClip.AddPath(clip, PolyType.ptClip, true);
polyClip.Execute(ClipType.ctUnion, solution, PolyFillType.pftNonZero, PolyFillType.pftNonZero);

//solution now holds the single L-shaped polygon covering both squares

Growing a polygon by 10 units

using System.Collections.Generic;
using CodeBrix.PolygonTools;
using CodeBrix.PolygonTools.Enumerations;
using CodeBrix.PolygonTools.Models;

var offset = new PolyClipOffset();
offset.AddPath(subject, JoinType.jtMiter, EndType.etClosedPolygon);

var inflated = new List<List<IntPoint>>();
offset.Execute(ref inflated, 10.0);

//pass a negative delta to Execute in order to shrink the polygon instead

Documentation

The NuGet package includes AGENT-README.txt, a complete API reference and usage guide written for AI coding agents - point your agent at that file when it is writing code against this library.

Additional sample code and usage examples are available in the CodeBrix.PolygonTools.Tests project: https://github.com/ellisnet/CodeBrix.PolygonTools/tree/main/tests/CodeBrix.PolygonTools.Tests

License

CodeBrix.PolygonTools is licensed under the MIT License, and portions of it remain subject to the Boost Software License 1.0 - see the LICENSE file, which carries both notices, and license-boost.txt for the full Boost licence text.

For licensing and provenance information about the open source code included in this package, see THIRD-PARTY-NOTICES.txt.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net10.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.252.1257 95 9/9/2026
1.0.242.1181 94 8/30/2026
1.0.200.1267 122 7/19/2026