{"id":24918220,"url":"https://github.com/gmoller/zen.hexagons","last_synced_at":"2025-07-14T08:35:22.859Z","repository":{"id":85708311,"uuid":"305244363","full_name":"gmoller/Zen.Hexagons","owner":"gmoller","description":"Hexagon routines for use in for software that uses hexagon grids.","archived":false,"fork":false,"pushed_at":"2020-12-30T04:49:17.000Z","size":115,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-14T20:41:58.555Z","etag":null,"topics":["hexagon","hexagonal-grid-library","hexagonal-grids","hexagonal-tiles","hexagons"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gmoller.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-10-19T02:40:57.000Z","updated_at":"2024-04-03T13:22:23.000Z","dependencies_parsed_at":null,"dependency_job_id":"b660bcad-aca2-432c-bac9-08301037d52f","html_url":"https://github.com/gmoller/Zen.Hexagons","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/gmoller/Zen.Hexagons","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gmoller%2FZen.Hexagons","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gmoller%2FZen.Hexagons/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gmoller%2FZen.Hexagons/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gmoller%2FZen.Hexagons/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gmoller","download_url":"https://codeload.github.com/gmoller/Zen.Hexagons/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gmoller%2FZen.Hexagons/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265262898,"owners_count":23736494,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["hexagon","hexagonal-grid-library","hexagonal-grids","hexagonal-tiles","hexagons"],"created_at":"2025-02-02T09:19:22.082Z","updated_at":"2025-07-14T08:35:22.837Z","avatar_url":"https://github.com/gmoller.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Zen.Hexagons\n\nHexagon routines for use in for software that uses hexagon grids.\nCan be used for pointy-topped or flat-topped hexes and offset, axial or cube coordinate systems.\n\nUses ideas from Amit Patel's brilliant http://www.redblobgames.com/grids/hexagons/.\n\nNuget package download: https://www.nuget.org/packages/Zen.Hexagons/1.0.7\n\n# Example\nTo use:\n\n    var hexLibrary = new Zen.Hexagons.HexLibrary(HexType.FlatTopped, OffsetCoordinatesType.Odd, 64.0f);\n    \n    var hexCube = hexLibrary.OffsetCoordinatesToCube(new HexOffsetCoordinates(2, 2));\n    var hexAxial = hexLibrary.OffsetCoordinatesToAxial(new HexOffsetCoordinates(2, 2));\n    \n    var neighbors = hexLibrary.GetAllNeighbors(new HexOffsetCoordinates(1, 1));\n    var neighborNW = hexLibrary.GetNeighbor(new HexOffsetCoordinates(1, 1), Direction.NorthWest);\n    \n    var ring1 = hexLibrary.GetSingleRing(new HexOffsetCoordinates(1, 1), 1);\n    var ring2 = hexLibrary.GetSingleRing(new HexOffsetCoordinates(2, 2), 2);\n    \n    var ring3 = hexLibrary.GetSpiralRing(new HexOffsetCoordinates(2, 2), 2);\n    \n    var line = hexLibrary.GetLine(new HexOffsetCoordinates(1, 0), new HexOffsetCoordinates(3, 4));\n    \n    var distance = hexLibrary.GetDistance(new HexOffsetCoordinates(1, 0), new HexOffsetCoordinates(3, 4));\n    \n    var pixel = hexLibrary.FromOffsetCoordinatesToPixel(new HexOffsetCoordinates(1, 1));\n    \n    var coords = hexLibrary.FromPixelToOffsetCoordinates(96, 166);\n    \n# Developer\nWritten by Greg Moller (greg.moller@gmail.com)  \nIf you have any questions drop me a line at the above email.\n\n# License\nLicensed under the MIT License. See the LICENCE file for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgmoller%2Fzen.hexagons","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgmoller%2Fzen.hexagons","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgmoller%2Fzen.hexagons/lists"}