{"id":21874263,"url":"https://github.com/stefanjohnsen/pointin3dpolygon","last_synced_at":"2025-03-21T23:18:10.545Z","repository":{"id":226828206,"uuid":"769734710","full_name":"StefanJohnsen/PointIn3DPolygon","owner":"StefanJohnsen","description":"Verify whether a 3D point lies within an planar non-complex polygon in three-dimensional space.","archived":false,"fork":false,"pushed_at":"2024-03-17T15:18:25.000Z","size":50571,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-26T17:41:19.887Z","etag":null,"topics":["3d-graphics","pip","polygon"],"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/StefanJohnsen.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":"2024-03-09T22:44:06.000Z","updated_at":"2024-09-24T06:26:35.000Z","dependencies_parsed_at":"2024-11-28T07:21:56.548Z","dependency_job_id":null,"html_url":"https://github.com/StefanJohnsen/PointIn3DPolygon","commit_stats":null,"previous_names":["stefanjohnsen/pointinpolygon","stefanjohnsen/pointin3dpolygon"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StefanJohnsen%2FPointIn3DPolygon","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StefanJohnsen%2FPointIn3DPolygon/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StefanJohnsen%2FPointIn3DPolygon/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StefanJohnsen%2FPointIn3DPolygon/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/StefanJohnsen","download_url":"https://codeload.github.com/StefanJohnsen/PointIn3DPolygon/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244880660,"owners_count":20525515,"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":["3d-graphics","pip","polygon"],"created_at":"2024-11-28T07:11:48.507Z","updated_at":"2025-03-21T23:18:10.523Z","avatar_url":"https://github.com/StefanJohnsen.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Point in 3D polygon\r\nA header-only file providing a template-based solution for determining if a point resides within a three-dimensional non-complex polygon. This solution is self-contained and does not rely on external libraries, with the only dependency being the inclusion of `\u003cvector\u003e` and `\u003calgorithm\u003e`.\r\n\r\n### Compatibility and Dependencies\r\n- C++ 11 Standard and above\r\n- Standard Template Library (STL)\r\n\r\n![PointInPolygon](https://github.com/StefanJohnsen/PointInPolygon/blob/main/pictures/pic-01.png)\r\n*The stress test results for the PointInPolygon function applied to a 3D planar polygon with 180.000 test points. More test results can be found [here](Polygons-obj/README.md)*\r\n\r\n### Supported polygons\r\nThe solution works for all kinds of 3D non-complex polygons, concave or convex, open or closed.\r\n\r\n### OS Support\r\n- Windows\r\n- Linux\r\n- macOS\r\n\r\n### Usage\r\nCopy `PointInPolygon.h` to your project and include the file.\r\n\r\n```\r\n#include \u003ciostream\u003e\r\n#include \"PointInPolygon.h\"\r\n\r\nusing namespace pip;\r\n\r\nint main()\r\n{\r\n\tstd::vector\u003cPoint\u003e polygon;\r\n\r\n\tpolygon.emplace_back(0.0f, 0.0f, 0.0f);\r\n\tpolygon.emplace_back(2.0f, 0.0f, 0.0f);\r\n\tpolygon.emplace_back(2.0f, 2.0f, 0.0f);\r\n\tpolygon.emplace_back(0.0f, 2.0f, 0.0f);\r\n\r\n\tconst Point p = {1.0f , 1.0f , 0.0f};\r\n\r\n\tif( pip::pointInPolygon(polygon, p) )\r\n\t\tstd::cout \u003c\u003c \"Point inside polygon!\\n\";\r\n\telse\r\n\t\tstd::cout \u003c\u003c \"Point outside polygon!\\n\";\r\n\r\n\treturn 0;\r\n}\r\n```\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstefanjohnsen%2Fpointin3dpolygon","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstefanjohnsen%2Fpointin3dpolygon","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstefanjohnsen%2Fpointin3dpolygon/lists"}