{"id":16162413,"url":"https://github.com/sunsided/widemeadows.rotatedgrid","last_synced_at":"2025-04-07T03:47:58.167Z","repository":{"id":184462407,"uuid":"671923322","full_name":"sunsided/WideMeadows.RotatedGrid","owner":"sunsided","description":"Rotated grid calculations for CMYK halftone dithering and more ... in C#","archived":false,"fork":false,"pushed_at":"2023-07-28T14:07:27.000Z","size":23,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-13T08:26:53.853Z","etag":null,"topics":["csharp","dithering","dithering-images","halftone","image-processing","poster","print"],"latest_commit_sha":null,"homepage":"https://www.nuget.org/packages/RotatedGrid/","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"eupl-1.2","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sunsided.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-07-28T13:04:54.000Z","updated_at":"2025-01-14T01:28:02.000Z","dependencies_parsed_at":"2023-07-28T15:03:39.545Z","dependency_job_id":null,"html_url":"https://github.com/sunsided/WideMeadows.RotatedGrid","commit_stats":null,"previous_names":["sunsided/widemeadows.rotatedgrid"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sunsided%2FWideMeadows.RotatedGrid","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sunsided%2FWideMeadows.RotatedGrid/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sunsided%2FWideMeadows.RotatedGrid/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sunsided%2FWideMeadows.RotatedGrid/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sunsided","download_url":"https://codeload.github.com/sunsided/WideMeadows.RotatedGrid/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247589835,"owners_count":20963022,"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":["csharp","dithering","dithering-images","halftone","image-processing","poster","print"],"created_at":"2024-10-10T02:30:03.112Z","updated_at":"2025-04-07T03:47:58.143Z","avatar_url":"https://github.com/sunsided.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Rotated grids in .NET\n\n🎨 _For halftone dithering and more._\n\nThis project provides an enumerator for creating grid coordinates at a specified frequency along\na rotated grid. This can come in useful e.g. when you want to create halftone dithering grids for CMYK processing.\n\nThis is a port of the [rotated-grid](https://github.com/sunsided/rotated-grid) Rust crate.\nThe following screenshot is taken from that repo; this repository does not contain any visualization code.\n\n\u003cdiv align=\"center\" style=\"text-align: center\"\u003e\n    \u003cimg src=\"https://raw.githubusercontent.com/sunsided/rotated-grid/main/readme/grid.png\" alt=\"CMYK grid examples\" /\u003e\n\u003c/div\u003e\n\n## Examples\n\nEnumeration on an aligned grid (0 degrees rotation). The points are evenly spaced by dx=2\nand dy=3, centered inside a 10×7 rectangle. No offset is used.\n\n```csharp\nconst float width = 10.0F;\nconst float height = 7.0F;\n\nvar grid = new GridPositionIterator(width, height, 2.0F, 3.0F, 0.0F, 0.0F, Angle.Zero);\n\nvar coordinates = new List\u003cGridCoord\u003e();\nwhile (grid.MoveNext())\n{\n    coordinates.Add(grid.Current);\n}\n\ncoordinates.Count.Should().Be(15);\ncoordinates.Should().ContainInOrder(\n    // First row\n    new GridCoord(1.0F, 0.5F),\n    new GridCoord(3.0F, 0.5F),\n    new GridCoord(5.0F, 0.5F),\n    new GridCoord(7.0F, 0.5F),\n    new GridCoord(9.0F, 0.5F),\n    // Second row row\n    new GridCoord(1.0F, 3.5F),\n    new GridCoord(3.0F, 3.5F),\n    new GridCoord(5.0F, 3.5F),\n    new GridCoord(7.0F, 3.5F),\n    new GridCoord(9.0F, 3.5F),\n    // Third row\n    new GridCoord(1.0F, 6.5F),\n    new GridCoord(3.0F, 6.5F),\n    new GridCoord(5.0F, 6.5F),\n    new GridCoord(7.0F, 6.5F),\n    new GridCoord(9.0F, 6.5F)\n    );\n```\n\nEnumeration on a rotated grid; in the example below, 45 degrees rotation are used:\n\n```csharp\nconst float width = 10.0F;\nconst float height = 7.0F;\nconst float angle = 45.0F;\n\nvar grid = new GridPositionIterator(width, height, 2.0F, 2.0F, 0.0F, 0.0F, Angle.FromDegrees(angle));\n\nvar coordinates = new List\u003cGridCoord\u003e();\nwhile (grid.MoveNext())\n{\n    coordinates.Add(grid.Current);\n}\n\ncoordinates.Count.Should().Be(17);\ncoordinates.Should().ContainInOrder(\n    // First row\n    new GridCoord(0.7573595F, 2.0857863F),\n    new GridCoord(2.1715730F, 0.6715729F),\n    // Second row\n    new GridCoord(0.7573595F, 4.9142137F),\n    new GridCoord(2.1715730F, 3.5000000F),\n    new GridCoord(3.5857863F, 2.0857863F),\n    new GridCoord(5.0000000F, 0.6715729F),\n    // Third row\n    new GridCoord(2.1715730F, 6.3284273F),\n    new GridCoord(3.5857863F, 4.9142137F),\n    new GridCoord(5.0000000F, 3.5000000F),\n    new GridCoord(6.4142137F, 2.0857863F),\n    new GridCoord(7.8284273F, 0.6715729F),\n    // Fourth row\n    new GridCoord(5.0000000F, 6.3284273F),\n    new GridCoord(6.4142137F, 4.9142137F),\n    new GridCoord(9.2426405F, 2.0857863F),\n    // Fifth row\n    new GridCoord(7.8284273F, 6.3284273F),\n    new GridCoord(9.2426405F, 4.9142137F)\n);\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsunsided%2Fwidemeadows.rotatedgrid","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsunsided%2Fwidemeadows.rotatedgrid","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsunsided%2Fwidemeadows.rotatedgrid/lists"}