Pmad.Geometry.Json 0.1.46

dotnet add package Pmad.Geometry.Json --version 0.1.46                
NuGet\Install-Package Pmad.Geometry.Json -Version 0.1.46                
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="Pmad.Geometry.Json" Version="0.1.46" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Pmad.Geometry.Json --version 0.1.46                
#r "nuget: Pmad.Geometry.Json, 0.1.46"                
#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.
// Install Pmad.Geometry.Json as a Cake Addin
#addin nuget:?package=Pmad.Geometry.Json&version=0.1.46

// Install Pmad.Geometry.Json as a Cake Tool
#tool nuget:?package=Pmad.Geometry.Json&version=0.1.46                

Pmad.Geometry

NuGet

Geometry shapes and primitives toolkit (2D).

This project aim to provide optimized versions of 2D geometry arithmetic primitives used by GameRealisticMap and MapToolkit.

Those primitives are performance critical for the two related projects (data processing requires usually many hours, even little improvements can save a lot of time).

Current toolkit is an experimentation around Vector128, Vector2 and plain scalar implementations. It makes heavy use of generics and text templating to test multiple implementations of 2D vectors and shapes. It's intend to measure their relative performances on modern hardware.

API might change in future releases.

It includes a fork of Clipper2 from Angus Johnson.

Implementations

Vector Description Note
Vector2I Two scalar int Some operations are optimised with Vector128
Vector2F Vector2 wrapper
Vector2L Vector128 with long
Vector2D Vector128 with double

Performance

(Lower is better, 1 us : 1 Microsecond (0.000001 sec), 1 ns : 1 Nanosecond (0.000000001 sec))

Intel Core i7-14700KF, 1 CPU, with .NET 8.0.8 (8.0.824.36612), X64 RyuJIT AVX2

Polygon operations

Implementation Union Intersection Point in Polygon Signed Area
NetTopologySuite (double) 40.1 us 38.1 us 260.0 us 61.4 ns
Original GRM (float) 12.3 us 9.4 us 5.4 us
Original Clipper2 (long) 2.5 us 36.2 ns
Original Clipper2 (double)
Pmad.Geometry Vector2I 7.6 us 6.8 us 2.0 us 31.1 ns
Pmad.Geometry Vector2F 7.9 us 6.9 us 2.1 us 29.0 ns
Pmad.Geometry Vector2L 7.8 us 6.8 us 2.1 us 25.6 ns
Pmad.Geometry Vector2D 7.9 us 6.7 us 2.7 us 18.5 ns

Features

2D Vectors

2D vectors arithmetic with long, int, float and double support.

Matrix transforms on 2D vectors.

2D Polygons

Arithmetic operations with two or more polygons : union, difference, intersection

Offsetting of polygon.

Relations with points:

  • test if point is in polygon
  • distance from point to polygon
  • distance from point to boundary

Properties : Centroid, Area, Bounds

2D Paths

Offsetting path to polygon.

Path following with abitrary step length.

Properties : Length, Clockwise

Other shapes

Rotated rectangle:

  • Compute the smallest rectangle containing a list of points
  • Compute the largest rectangle between a list of points

Circle:

  • Compute the smallest circle containing a list of points

JSON

Serialization/Deserialization to/from GeoJSON

WKT

Serialization/Deserialization to/from Well-known text (OGC, Open Geospatial Consortium)

SVG

Serialization to SVG path definition.

License

Licensed under Boost Software License - Version 1.0 terms.

Copyright Julien Etelain 2024. Copyright Angus Johnson 2010-2024.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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
0.1.46 92 12/1/2024
0.1.5-gba3893693c 70 7/31/2024