{"id":17217845,"url":"https://github.com/fzipp/pathfind","last_synced_at":"2025-09-19T19:22:08.209Z","repository":{"id":153237572,"uuid":"620991188","full_name":"fzipp/pathfind","owner":"fzipp","description":"Path finding on a 2D polygonal map","archived":false,"fork":false,"pushed_at":"2024-12-31T18:49:37.000Z","size":29,"stargazers_count":57,"open_issues_count":0,"forks_count":6,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-02T03:55:16.114Z","etag":null,"topics":["go","golang","path-planning","pathfinding","polygons","shortest-path","visibility-graph","walkboxes"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fzipp.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-03-29T19:18:42.000Z","updated_at":"2024-12-31T18:49:41.000Z","dependencies_parsed_at":null,"dependency_job_id":"e0371bcc-81f2-4435-85cb-a075ea50e186","html_url":"https://github.com/fzipp/pathfind","commit_stats":{"total_commits":10,"total_committers":1,"mean_commits":10.0,"dds":0.0,"last_synced_commit":"138e8267ee064357d5a1cac672cb99181cc44cef"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fzipp%2Fpathfind","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fzipp%2Fpathfind/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fzipp%2Fpathfind/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fzipp%2Fpathfind/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fzipp","download_url":"https://codeload.github.com/fzipp/pathfind/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238044095,"owners_count":19407128,"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":["go","golang","path-planning","pathfinding","polygons","shortest-path","visibility-graph","walkboxes"],"created_at":"2024-10-15T03:44:49.782Z","updated_at":"2025-09-19T19:22:03.186Z","avatar_url":"https://github.com/fzipp.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pathfind\n\n[![PkgGoDev](https://pkg.go.dev/badge/github.com/fzipp/pathfind)](https://pkg.go.dev/github.com/fzipp/pathfind)\n![Build Status](https://github.com/fzipp/pathfind/workflows/build/badge.svg)\n[![Go Report Card](https://goreportcard.com/badge/github.com/fzipp/pathfind)](https://goreportcard.com/report/github.com/fzipp/pathfind)\n\nPackage pathfind finds the shortest path between two points in a polygon set.\n\nThe algorithm works as follows:\n- determine all concave polygon vertices\n- add start and end points\n- build a visibility graph\n- use the A* search algorithm (package [astar](https://github.com/fzipp/astar))\n  on the visibility graph to find the shortest path\n\n## Demo\n\n```\ngo run github.com/fzipp/pathfind/cmd/pathfinddemo@latest\n```\n\nhttps://user-images.githubusercontent.com/598327/228644017-a9800747-a096-46ae-befe-d725da18205a.mp4\n\n## Example Code\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"image\"\n\t\n\t\"github.com/fzipp/pathfind\"\n)\n\nfunc main() {\n\t//  (0,0) \u003e---+   +-----------+ (50,0)\n\t//        | s |   |   \u003e---+   |\n\t//        |   +---+   |   | d |\n\t//        |           +---+   |\n\t// (0,20) +-------------------+ (50,20)\n\t//\n\t// s = start, d = destination\n\tpolygons := [][]image.Point{\n\t\t// Outer shape\n\t\t{\n\t\t\timage.Pt(0, 0),\n\t\t\timage.Pt(10, 0),\n\t\t\timage.Pt(10, 10),\n\t\t\timage.Pt(20, 10),\n\t\t\timage.Pt(20, 0),\n\t\t\timage.Pt(50, 0),\n\t\t\timage.Pt(50, 20),\n\t\t\timage.Pt(0, 20),\n\t\t},\n\t\t// Inner rectangle (\"hole\")\n\t\t{\n\t\t\timage.Pt(30, 5),\n\t\t\timage.Pt(40, 5),\n\t\t\timage.Pt(40, 15),\n\t\t\timage.Pt(30, 15),\n\t\t},\n\t}\n\tstart := image.Pt(5, 5)\n\tdestination := image.Pt(45, 10)\n\n\tpathfinder := pathfind.NewPathfinder(polygons)\n\tpath := pathfinder.Path(start, destination)\n\tfmt.Println(path)\n}\n```\n\nOutput:\n\n```\n[(5,5) (10,10) (30,15) (40,15) (45,10)]\n```\n\n## License\n\nThis project is free and open source software licensed under the\n[BSD 3-Clause License](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffzipp%2Fpathfind","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffzipp%2Fpathfind","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffzipp%2Fpathfind/lists"}