{"id":29097414,"url":"https://github.com/lambdaisland/daedalus","last_synced_at":"2025-06-28T13:42:26.670Z","repository":{"id":62431861,"uuid":"342637220","full_name":"lambdaisland/daedalus","owner":"lambdaisland","description":"    \"Path finding and Delaunay triangulation in 2D, cljs wrapper for hxdaedalus-js\"","archived":false,"fork":false,"pushed_at":"2021-05-22T15:08:25.000Z","size":2250,"stargazers_count":8,"open_issues_count":0,"forks_count":1,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-06-08T21:26:23.199Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Clojure","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lambdaisland.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-02-26T16:39:24.000Z","updated_at":"2025-04-30T04:17:35.000Z","dependencies_parsed_at":"2022-11-01T21:01:02.710Z","dependency_job_id":null,"html_url":"https://github.com/lambdaisland/daedalus","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/lambdaisland/daedalus","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lambdaisland%2Fdaedalus","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lambdaisland%2Fdaedalus/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lambdaisland%2Fdaedalus/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lambdaisland%2Fdaedalus/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lambdaisland","download_url":"https://codeload.github.com/lambdaisland/daedalus/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lambdaisland%2Fdaedalus/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260148954,"owners_count":22966006,"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":[],"created_at":"2025-06-28T13:42:17.753Z","updated_at":"2025-06-28T13:42:26.651Z","avatar_url":"https://github.com/lambdaisland.png","language":"Clojure","funding_links":["http://opencollective.com/lambda-island"],"categories":[],"sub_categories":[],"readme":"# \n\n\u003c!-- badges --\u003e\n[![cljdoc badge](https://cljdoc.org/badge/lambdaisland/daedalus)](https://cljdoc.org/d/lambdaisland/daedalus) [![Clojars Project](https://img.shields.io/clojars/v/lambdaisland/daedalus.svg)](https://clojars.org/lambdaisland/daedalus)\n\u003c!-- /badges --\u003e\n\nClojureScript wrapper for hxdaedalus-js path-finding and triangulation\n\n\u003c!-- opencollective --\u003e\n\n\u0026nbsp;\n\n\u003cimg align=\"left\" src=\"https://github.com/lambdaisland/open-source/raw/master/artwork/lighthouse_readme.png\"\u003e\n\n\u0026nbsp;\n\n## Support Lambda Island Open Source\n\ndaedalus is part of a growing collection of quality Clojure libraries and\ntools released on the Lambda Island label. If you are using this project\ncommercially then you are expected to pay it forward by\n[becoming a backer on Open Collective](http://opencollective.com/lambda-island#section-contribute),\nso that we may continue to enjoy a thriving Clojure ecosystem.\n\n\u0026nbsp;\n\n\u0026nbsp;\n\n\u003c!-- /opencollective --\u003e\n\n## What does it do?\n\nPath finding in 2D space based on Delaunay triangulation. The main use case is\nfor 2D games, where you want to determine a path from A to B, while keeping\nobstacles into account. For example, in point-in-click games, walking towards\nwhere the player has clicked.\n\nThe original implementation was written in ActionScript by [Cédric\nJules](https://github.com/totologic) in 2013. This code was later ported to Haxe\nas [hxDaedalus](https://github.com/hxDaedalus/hxDaedalus), a language which\ntranspiles to multiple other languages, including JavaScript. This is how we end\nup with [hxdaedalus-js](https://www.npmjs.com/package/hxdaedalus-js), which this\nlibrary is a ClojureScript wrapper for.\n\n- [Cédric's original announcement post](https://web.archive.org/web/20151102235416/http://totologic.blogspot.com/2013/12/introducing-daedalus-lib_19.html)\n- [Demo video](https://www.youtube.com/watch?v=5fZJ1x7R_u8)\n- [Original google code project](https://code.google.com/archive/p/daedalus-lib/)\n- [hxDaedalus JS examples](https://github.com/hxDaedalus/hxDaedalus-Examples/tree/master/hxDaedalus-Examples/web)\n\nCédric based their code on three research papers:\n\n- [Efficient Triangulation-Based Pathfinding, by Douglas Jon Demyen](/docs/pdf/thesis_demyen_2006.pdf)\n- [Fully Dynamic Constrained Delaunay Triangulations, by Kallmann, Bieri and Thalmann](/docs/pdf/fully_dynamic_constrained_delaunay_triangulation.pdf)\n- [An improved incremental algorithm for constructing restricted Delaunay triangulations, by Marc Vigo Anglada](/docs/pdf/An_Improved_Incremental_Algorithm_for_Constructing.pdf)\n\nThis library\n\n- Adds ClojureScript printer definitions for all of Daedalus's types, so you can\n  see what you are doing when working on a REPL\n- Implement `ILookup`, so you can access plain variables and object getters with\n  `(:x obj)` style keyword access (also supports destructuring, `get-in`, etc.)\n- Implement `ITransientCollection` for `Mesh`, so you can conveniently `conj!`\n  things onto it\n- Create constructor functions, for a more idiomatic API\n- Adds a few helper functions, `build-rect-mesh`, `rect`, `find-path`\n\nBefore:\n\n``` clojure\n(def p (d/PathFinder.))\n(set! (.-entity p) entity)\n(set! (.-mesh p) world)\n```\n\nAfter\n\n``` clojure\n(d/path-finder {:entity entity :mesh world})\n```\n\nThe best docs for what this library can do are the [wiki pages of the original\nproject](/docs/original-wiki), which I have archived here in case the original\ndisappear.\n\n\u003c!-- installation --\u003e\n## Installation\ndeps.edn\n\n```\nlambdaisland/daedalus {:mvn/version \"0.0.31\"}\n```\n\nproject.clj\n\n```\n[lambdaisland/daedalus \"0.0.31\"]\n```\n\u003c!-- /installation --\u003e\n\n## Usage\n\n``` clojure\n(require '[lambdaisland.daedalus :as d])\n\n;; Entity that is looking for a path, \n(def entity (d/entity-ai {:x 10 :y 10 :radius 1}))\n\n;; you can update `:x` / `:y` to set the start position\n;; (set! (.-x entity) 20)\n\n(def world (d/build-rect-mesh 100 100))\n(def path-finder (d/path-finder {:entity entity :mesh world}))\n\n;; add obstacle\n(conj! world (d/rect 10 12 10 10))\n\n;; find a path\n(d/find-path path-finder 30 30)\n;;=\u003e\n([10 10]\n [20.09901714548254 11.004914272587285]\n [20.38268343236509 11.076120467488714]\n [20.707106781186546 11.292893218813452]\n [20.89671072740957 11.557382929216907]\n [30 30])\n```\n\n\u003c!-- contributing --\u003e\n## Contributing\n\nEveryone has a right to submit patches to daedalus, and thus become a contributor.\n\nContributors MUST\n\n- adhere to the [LambdaIsland Clojure Style Guide](https://nextjournal.com/lambdaisland/clojure-style-guide)\n- write patches that solve a problem. Start by stating the problem, then supply a minimal solution. `*`\n- agree to license their contributions as MPL 2.0.\n- not break the contract with downstream consumers. `**`\n- not break the tests.\n\nContributors SHOULD\n\n- update the CHANGELOG and README.\n- add tests for new functionality.\n\nIf you submit a pull request that adheres to these rules, then it will almost\ncertainly be merged immediately. However some things may require more\nconsideration. If you add new dependencies, or significantly increase the API\nsurface, then we need to decide if these changes are in line with the project's\ngoals. In this case you can start by [writing a pitch](https://nextjournal.com/lambdaisland/pitch-template),\nand collecting feedback on it.\n\n`*` This goes for features too, a feature needs to solve a problem. State the problem it solves, then supply a minimal solution.\n\n`**` As long as this project has not seen a public release (i.e. is not on Clojars)\nwe may still consider making breaking changes, if there is consensus that the\nchanges are justified.\n\u003c!-- /contributing --\u003e\n\n\u003c!-- license --\u003e\n## License\n\nCopyright \u0026copy; 2021 Arne Brasseur and Contributors\n\nLicensed under the term of the Mozilla Public License 2.0, see LICENSE.\n\u003c!-- /license --\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flambdaisland%2Fdaedalus","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flambdaisland%2Fdaedalus","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flambdaisland%2Fdaedalus/lists"}