RT.Coordinates 3.2.2

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

RT.Coordinates

Full documentation

This small library can generate and manipulate various grid structures, for example:

File.WriteAllText("output.svg", new Hex.Grid(5).Svg());

Hexagonal grid example

File.WriteAllText("output.svg", new OctoCell.Grid(7, 4).Svg());

OctoCell grid example

You can generate a random maze:

File.WriteAllText("output.svg", new Floret.Grid(4).GenerateMaze().Svg());

Floret grid example with random maze

Each cell in each grid geometry has a unique coordinate that identifies each cell:

File.WriteAllText("output.svg", new Cairo.Grid(7, 4).GenerateMaze().Svg(new SvgInstructions
{
	PerCellAfter = c => $"<text y='.1'>{c}</text>"
}));

Cairo grid example with maze and coordinates

Find a path in a maze:

var maze = new Kite.Grid(4).GenerateMaze();
var path = maze.FindPath((Kite) GridUtils.Parse("K(-3,0)/5"), (Kite) GridUtils.Parse("K(2,1)/2"));
File.WriteAllText("output.svg", maze.Svg(new SvgInstructions
{
    ExtraSvg4 = $"<path d='M{path.Select(p => $"{p.Center.X} {p.Center.Y}").JoinString(" ")}' fill='none' stroke='red' stroke-width='.1' />"
}));

Kite grid example with maze and path

Customize colors and appearance:

const int levels = 13;
var maze = new PentaCell.Grid(levels);

File.WriteAllText("output.svg", maze.Svg(new SvgInstructions
{
    HighlightCells = new Func<object, string>(c => c is PentaCell p ? $"hsl({p.Level * 360d / levels}, 70%, 70%)" : null),
    PerCellAfter = c => "<circle r='.1' />",
    PassagesPath = d => $"<path d='{d}' fill='none' stroke-width='.01' stroke='black' stroke-opacity='.7' />"
}));

PentaCell grid example with custom coloration

Multiple grid geometries can be combined and connected with bridges. Note that in the following example, the entire structure is a single maze — the only path connecting the cells shown involves use of the bridges.

var structure = new Structure<object>(
	new Penrose.Grid(true, 3).Cells.Cast<object>()
		.Concat(new Chamf.Grid(4, 7).Cells.Cast<object>()));
structure.AddLink(GridUtils.Parse("P(5,2,4,-1)/2/8"), GridUtils.Parse("H(0,1)/2"));
structure.AddLink(GridUtils.Parse("P(-3,4,1,6)/2/0"), GridUtils.Parse("H(0,5)/2"));
var maze = structure.GenerateMaze();
var path = maze.FindPath(GridUtils.Parse("H(3,1)/1"), GridUtils.Parse("H(4,2)/2"));

File.WriteAllText("output.svg", maze.Svg(new SvgInstructions
{
	GetCenter = c => c is Chamf p ? p.Center + new PointD(12, -8) : null,
	GetVertexPoint = v => v is Chamf.Vertex p ? p.Point + new PointD(12, -8) : v.Point,
	HighlightCells = path
}));

Combined Penrose and Chamf grid example showing maze path across connecting bridges

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 net35 is compatible.  net40 was computed.  net403 was computed.  net45 was computed.  net451 was computed.  net452 was computed.  net46 was computed.  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.
  • .NETFramework 3.5

    • No dependencies.
  • .NETStandard 2.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
3.2.2 235 6/9/2025
3.2.0 222 6/9/2025
3.1.0 129 11/9/2024
3.0.0 138 5/8/2024
2.9.0 217 7/31/2023
2.8.0 155 7/28/2023
2.7.0 181 7/25/2023
2.6.0 182 7/25/2023
2.5.0 370 11/10/2022
2.4.0 392 11/1/2022
2.3.0 399 10/29/2022
2.2.0 436 10/21/2022
2.1.0 405 10/19/2022
2.0.1 473 9/14/2022
2.0.0 495 9/14/2022
1.0.0 518 9/14/2022