GeometryHelper 10.0.0

dotnet add package GeometryHelper --version 10.0.0
                    
NuGet\Install-Package GeometryHelper -Version 10.0.0
                    
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="GeometryHelper" Version="10.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="GeometryHelper" Version="10.0.0" />
                    
Directory.Packages.props
<PackageReference Include="GeometryHelper" />
                    
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 GeometryHelper --version 10.0.0
                    
#r "nuget: GeometryHelper, 10.0.0"
                    
#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 GeometryHelper@10.0.0
                    
#: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=GeometryHelper&version=10.0.0
                    
Install as a Cake Addin
#tool nuget:?package=GeometryHelper&version=10.0.0
                    
Install as a Cake Tool

GeometryHelper

NuGet Version License: MIT

Geometry for engineering drawings and models, in two dimensions and in three, with the label placement algorithms that run on the 2D half. Written in C# and targeting netstandard2.0, so it loads into the .NET Framework hosts that Tekla Structures and AutoCAD provide as well as into modern .NET.

Every comparison that floating point error can affect takes a Tolerance, because coordinates that come out of a BIM model are never exact.

Installation

dotnet add package GeometryHelper

Quick start

using GeometryHelper;            // Tolerance, Angle, OffsetOptions
using GeometryHelper.Enums;      // LineEnd, OffsetJoin, PointLocation
using GeometryHelper.Geometry;   // every Geo type, 2D and 3D
using GeometryHelper.Core;       // every operation

// In the plane: grow a slab, then cut an opening out of it.
var slab = new GeoPolygon2(new GeoPoint2(0, 0), new GeoPoint2(4000, 0),
                           new GeoPoint2(4000, 2000), new GeoPoint2(0, 2000));
var duct = new GeoPolygon2(new GeoPoint2(1000, 500), new GeoPoint2(1400, 500),
                           new GeoPoint2(1400, 900), new GeoPoint2(1000, 900));

GeoPolygon2 grown = slab.Offset(50.0)[0];                 // 4100 x 2100
GeoFace2 pierced = Boolean2.Subtract(grown, duct)[0];     // one face, one hole

// In space: a beam trimmed where it runs into a wall.
var beam = new GeoLine3(new GeoPoint3(0, 0, 0), new GeoPoint3(3000, 0, 0));
var wall = new GeoPlane3(new GeoPoint3(2500, 0, 0), GeoVector3.XAxis);
beam.TryTrimTo(wall, LineEnd.End, out GeoLine3 cut);      // (0,0,0) -> (2500,0,0)

What is inside

Namespace Holds
GeometryHelper Tolerance, Angle, OffsetOptions, GeometryHelperLog, MassProperties3, MeasureComparison3
GeometryHelper.Enums PointLocation, PlaneSide, LineSide, LineEnd, LineExtension, OffsetJoin, VolumeMethod, AreaMethod
GeometryHelper.Geometry 30 immutable shapes: GeoPoint2 … GeoFace2 in the plane, GeoPoint3 … GeoSolid3 in space, arcs and the chains that carry them, and a transformation and a local coordinate system for each dimension
GeometryHelper.Core 35 operation classes, each dimension mirroring the other: Boolean2/Boolean3, Offset2/Offset3, Distance2/Distance3, … plus Arc2, Corner2 for chamfering and rounding, PlanarMap, which carries flat shapes between the two, and Measure3, a body's volume, mass and area read more than one way
GeometryHelper.Spatial GeoBvh2 and GeoBvh3, the bounding volume hierarchies for large chains and meshes
GeometryHelper.Extension turning raw point lists into geometry
GeometryHelper.Arranging label placement: Arranger, ArrangeItem, ArrangeResult, ArrangeOptions, five algorithms
GeometryHelper.Meshing closed shapes of the plane and flat shapes of space broken into triangles, grids, strips or convex pieces, and bodies cut into the cells of a grid: GeoMesh2, Mesh2, GeoMesh3, Mesh3, MeshKind, MeshOptions, MeshPlacement3, GeoCellGrid3, GeoCell3, CellOptions3, CellAxis, GridAlignment
GeometryHelper.Packing boxes onto sheets of paper: SheetPacker, Sheet, PackOptions, PackResult

Every operation is reachable both ways: the static form names the larger shape first, and the instance form sits on whichever of the two reads better where you are calling from.

Because both dimensions are one assembly, a flat shape in space can be laid out in its own plane, worked on with the whole 2D half of the library, and put back:

GeoCoordinateSystem3 frame = plate.GetFrame();
GeoFace2 flat = plate.ProjectToFace2(frame);
GeoFace3 back = flat.Subtract(openings)[0].ToFace3(frame);

Guides

The whole of it, searchable, with every type and member: https://nguyenthanguth.github.io/GeometryHelper/.

Guide Covers
Shared types Tolerance, Angle, the enumerations, OffsetOptions, GeometryHelperLog
Geometry in the plane points to polygons and faces; extending, trimming, offsetting, combining regions
Meshing the plane triangles, grids of panels or tiles with joints and alignment, strips and convex pieces, edge to edge
Geometry in space points to solids; splitting, boolean bodies, meshes, local frames
Meshing in space flat shapes of space in panels, tiles, strips and triangles; bodies and boxes cut into blocks, bays and lifts; the cases, drawn and checked
Label placement five algorithms behind one entry point
Packing boxes onto sheets drawing views onto A0 to A4 sheets or sheets of a size of their own, a new sheet when one is full

Coverage

dotnet test tests/GeometryHelper.UnitTest --collect:"XPlat Code Coverage"

writes a Cobertura file under TestResults. Only this library is counted.

Build and Test

dotnet build src/GeometryHelper/GeometryHelper.csproj
dotnet test  tests/GeometryHelper.UnitTest/GeometryHelper.UnitTest.csproj

Warnings are errors in CI, and every public member is documented, so a missing XML comment or a stale cref fails the build rather than landing quietly. Every example printed in the guides is also a test.

Licence

MIT. The clipping engine of Clipper2, by Angus Johnson, which is compiled into this package and resolves regions in the plane, is under the Boost Software License 1.0; THIRD-PARTY-NOTICES.md in the package holds its notice.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  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. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETStandard 2.0

    • No dependencies.

NuGet packages (5)

Showing the top 5 NuGet packages that depend on GeometryHelper:

Package Downloads
GeometryHelper.IfcConvert

Converts geometry between IFC (via xBIM) and GeometryHelper: points, vectors, matrices, faces, and solids.

GeometryHelper.CadConvert

Converts geometry between AutoCAD and GeometryHelper: points, vectors, lines, polylines, polygons, circles, and bounding boxes.

GeometryHelper.TeklaConvert.2026

Converts geometry between Tekla Structures 2026 and GeometryHelper: points, vectors, segments, planes, coordinate systems, bounding boxes, transformation matrices, and the faces and loops of a Tekla solid. Also reads the objects of IFC reference models into solids placed where Tekla shows them, through GeometryHelper.IfcConvert. Built for Tekla Structures 2026; install the package whose year matches your Tekla.

GeometryHelper.TeklaConvert.2025

Converts geometry between Tekla Structures 2025 and GeometryHelper: points, vectors, segments, planes, coordinate systems, bounding boxes, transformation matrices, and the faces and loops of a Tekla solid. Also reads the objects of IFC reference models into solids placed where Tekla shows them, through GeometryHelper.IfcConvert. Built for Tekla Structures 2025; install the package whose year matches your Tekla.

GeometryHelper.TeklaConvert.2020

Converts geometry between Tekla Structures 2020 and GeometryHelper: points, vectors, segments, planes, coordinate systems, bounding boxes, transformation matrices, and the faces and loops of a Tekla solid. Also reads the objects of IFC reference models into solids placed where Tekla shows them, through GeometryHelper.IfcConvert. Built for Tekla Structures 2020; install the package whose year matches your Tekla.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
10.0.0 0 10/3/2026
9.0.2 71 10/1/2026
9.0.1 79 10/1/2026
9.0.0 83 10/1/2026
8.0.0 82 9/30/2026
7.0.0 142 9/29/2026
6.3.0 187 9/29/2026
6.2.0 190 9/29/2026
6.1.0 225 9/28/2026
6.0.0 234 9/28/2026
5.1.0 248 9/21/2026
5.0.0 247 9/21/2026

NEW IN 10.0.0

     BREAKING: a body is measured as its material.
     - GeoSolid3.GetVolume(), GetSurfaceArea() and GetCentroid(), each also within a tolerance, measure the faces with
       every opening cut out, the walls of the openings part of the surface, and TryGetVolume says whether the volume
       can be trusted: every opening cut out and the material closed. The cut is made once for a tolerance and kept by
       the body, and GetMassProperties and Measure3 measure the same cut. A body without openings, as every part
       GeometryHelper.TeklaConvert reads, is measured by its faces at once.
     - Removed: GeoSolid3.Volume, SurfaceArea and Centroid, which read the faces alone, duct and all; NetVolume, which
       took each opening's whole volume off, past the body or not; and GetNetVolume(). GetSignedVolume() is internal:
       TurnOutwards() gives the body wound outwards, its openings too.

     NEW
     - GeoTriangle2, the triangle of the plane, in the whole matrix of the plane, answered by Core.Triangle2.
     - TriangulateSurface on GeoPolygon2, GeoFace2, GeoPolygonArc2, GeoRectangle2 and GeoCircle2.
     - GeometryHelper.Meshing: ToMesh breaks a shape of the plane into a GeoMesh2, of triangles, of the cells of a grid
       as formwork panels or tiles are laid, of strips or of convex pieces, as MeshOptions says; and a shape of space
       into a GeoMesh3, its grid placed by MeshPlacement3. GeoRectangle2.Divide.
     - ToCells on GeoSolid3, GeoObb3 and GeoAabb3 cuts a body into a GeoCellGrid3 of closed GeoCell3s, by CellOptions3.
     - Measure3 measures volume, mass, centroid and area by the method asked, VolumeMethod Fan, Surface or FlatFaces,
       and Compare sets every method side by side.

     FIXED
     - A body wound inwards came out of the booleans, TryCutOpenings, TrySplitBy, TryGetContact and the clash check
       wrong; each turns its bodies outwards first.
     - Two slabs from Tekla Structures, one wrapping the other's corner at a slant of 0.32 milliradians, share a wedge
       of 15.79 million cubic millimetres, which the difference took none of and the common part lost an eighth of.
       Two planes are one now only where they stand together over what they cut, and a cell a plane could not cut is
       judged on both sides of it.
     - GeoSolid3.TrySplitBy, Section and the cells cut from a body: a plane parting a body without crossing it, through
       a corner, at a slant across an edge two faces share, beside a rim bridged across, through a face a hair out of
       flat; a hole on the rim of its piece came back as material.
     - GeoFace3 and GeoSolid3 Locate, Contains, DistanceTo and GetClosestPointOnBoundary read a face's holes in the
       plane of its boundary; a point of a body thinner than four point tolerances is placed by the solid angle.
     - Areas and centroids of GeoPolygon2 and GeoPolygonArc2 far from the origin; ConvexHull3 and GeoObb3.Fit on a
       hull with a tiny face; Merge3.CoplanarFaces on faces a hair turned; TriangulateSurface within a tolerance finer
       than the global one; GetMassProperties of a body its openings take whole.

     CHANGED
     - The package depends on no other package: Clipper2 2.0.0's clipping engine is compiled in, internal, and the
       package carries THIRD-PARTY-NOTICES.md. A project that used Clipper2 through GeometryHelper references the
       Clipper2 package itself now. Where its sweep fails, the plane gives no region and a warning.
     - Separating a body into pieces, IsClosed and cutting by a plane pair edges along the axis that leaves the fewest
       pairs: a drum of 4 096 sides took eleven seconds and takes four hundredths.

     Details in CHANGELOG.md.

     Earlier releases: https://github.com/nguyenthanguth/GeometryHelper/blob/main/CHANGELOG.md