{"id":19097308,"url":"https://github.com/lycantropos/gon.cs","last_synced_at":"2025-02-22T09:01:12.621Z","repository":{"id":179560324,"uuid":"663694473","full_name":"lycantropos/Gon.cs","owner":"lycantropos","description":"C# geometries processing","archived":false,"fork":false,"pushed_at":"2023-07-19T23:45:44.000Z","size":215,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-03T00:33:28.298Z","etag":null,"topics":["computational-geometry","polygon","polygon-boolean","polygon-clipping"],"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/lycantropos.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":"2023-07-07T22:29:05.000Z","updated_at":"2023-07-18T01:25:14.000Z","dependencies_parsed_at":null,"dependency_job_id":"ddb61e50-79ff-4b1b-b1fe-ad948e795229","html_url":"https://github.com/lycantropos/Gon.cs","commit_stats":null,"previous_names":["lycantropos/gon.cs"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lycantropos%2FGon.cs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lycantropos%2FGon.cs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lycantropos%2FGon.cs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lycantropos%2FGon.cs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lycantropos","download_url":"https://codeload.github.com/lycantropos/Gon.cs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240149848,"owners_count":19755754,"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":["computational-geometry","polygon","polygon-boolean","polygon-clipping"],"created_at":"2024-11-09T03:39:55.415Z","updated_at":"2025-02-22T09:01:12.595Z","avatar_url":"https://github.com/lycantropos.png","language":"C#","readme":"Gon.cs\n======\n\n[![](https://github.com/lycantropos/Gon.cs/workflows/CI/badge.svg)](https://github.com/lycantropos/Gon.cs/actions/workflows/ci.yml \"Github Actions\")\n[![](https://codecov.io/gh/lycantropos/Gon.cs/branch/master/graph/badge.svg?token=3GRG1SH4E2)](https://codecov.io/gh/lycantropos/Gon.cs \"Codecov\")\n[![](https://img.shields.io/github/license/lycantropos/Gon.cs.svg)](https://github.com/lycantropos/Gon.cs/blob/master/LICENSE \"License\")\n[![](https://img.shields.io/nuget/v/Gon.svg?style=flat-square)](https://www.nuget.org/packages/Gon/ \"NuGet\")\n\nInstallation\n------------\n\nInstall the latest\n[`.NET SDK`](https://learn.microsoft.com/en-us/dotnet/core/sdk#how-to-install-the-net-sdk).\n\n### User\n\nDownload and install the latest stable version from `NuGet` repository\n\n```bash\ndotnet add package Gon\n```\n\n### Developer\n\nDownload the latest version from `GitHub` repository\n\n```bash\ngit clone https://github.com/lycantropos/Gon.cs\n```\n\nInstall\n\n```bash\ndotnet add reference Gon.cs/src/Gon/Gon.csproj\n```\n\nUsage\n-----\n\n```cs\nusing System.Diagnostics;\n\nusing Point = Gon.Point\u003cdouble\u003e;\nusing Contour = Gon.Contour\u003cdouble\u003e;\nusing Polygon = Gon.Polygon\u003cdouble\u003e;\nusing Location = Gon.Location;\n\nnamespace GonExamples\n{\n    public static class Basic\n    {\n        public static void RunExamples()\n        {\n            // construction\n            var squareBorder = new Contour(\n                new[] { new Point(0, 0), new Point(4, 0), new Point(4, 4), new Point(0, 4) }\n            );\n            var square = new Polygon(squareBorder);\n\n            // accessing various properties\n            Debug.Assert(square.Border == squareBorder);\n            Debug.Assert(square.Border.Vertices.Length == 4);\n            Debug.Assert(square.Holes.Length == 0);\n\n            // equality checks\n            Debug.Assert(square == new Polygon(squareBorder));\n\n            // point-in-polygon checks\n            Debug.Assert(square.Contains(new Point(2, 2)));\n            Debug.Assert(square.Contains(new Point(4, 4)));\n            Debug.Assert(!square.Contains(new Point(6, 6)));\n\n            // point location queries\n            Debug.Assert(square.Locate(new Point(2, 2)) == Location.Interior);\n            Debug.Assert(square.Locate(new Point(4, 4)) == Location.Boundary);\n            Debug.Assert(square.Locate(new Point(6, 6)) == Location.Exterior);\n\n            // set intersection\n            Polygon[] intersection = square \u0026 square;\n            Debug.Assert(intersection.Length == 1);\n            Debug.Assert(intersection[0] == square);\n\n            // set union\n            Polygon[] union = square | square;\n            Debug.Assert(union.Length == 1);\n            Debug.Assert(union[0] == square);\n\n            // set difference\n            Polygon[] difference = square - square;\n            Debug.Assert(difference.Length == 0);\n\n            // set symmetric difference\n            Polygon[] symmetricDifference = square ^ square;\n            Debug.Assert(symmetricDifference.Length == 0);\n        }\n    }\n}\n```\n\nMore examples can be found at [src/GonExamples directory](src/GonExamples).\n\nDevelopment\n-----------\n\n### Bumping version\n\n#### Preparation\n\nInstall\n[bump2version](https://github.com/c4urself/bump2version#installation).\n\n#### Pre-release\n\nChoose which version number category to bump following [semver\nspecification](http://semver.org/).\n\nTest bumping version\n\n```bash\nbump2version --dry-run --verbose $CATEGORY\n```\n\nwhere `$CATEGORY` is the target version number category name, possible\nvalues are `patch`/`minor`/`major`.\n\nBump version\n\n```bash\nbump2version --verbose $CATEGORY\n```\n\nThis will set version to `major.minor.patch-alpha`.\n\n#### Release\n\nTest bumping version\n\n```bash\nbump2version --dry-run --verbose release\n```\n\nBump version\n\n```bash\nbump2version --verbose release\n```\n\nThis will set version to `major.minor.patch`.\n\n### Running tests\n\nIn what follows `python` is an alias for `python3.8`\nor any later version (`python3.9` and so on).\n\nInstall dependencies\n\n```bash\npython -m pip install -r requirements-tests.txt\n```\n\nRun tests\n\n```bash\npytest\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flycantropos%2Fgon.cs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flycantropos%2Fgon.cs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flycantropos%2Fgon.cs/lists"}