{"id":18876288,"url":"https://github.com/strandedkitty/tiles-intersect","last_synced_at":"2025-04-14T17:32:06.986Z","repository":{"id":44017903,"uuid":"212637079","full_name":"StrandedKitty/tiles-intersect","owner":"StrandedKitty","description":"Find all tiles or voxels intersected by a line segment","archived":false,"fork":false,"pushed_at":"2022-12-06T17:29:17.000Z","size":150,"stargazers_count":4,"open_issues_count":12,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2023-03-10T04:36:55.256Z","etag":null,"topics":["algorithms","javascript"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/StrandedKitty.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}},"created_at":"2019-10-03T17:20:42.000Z","updated_at":"2022-10-23T17:00:46.000Z","dependencies_parsed_at":"2023-01-24T12:45:52.683Z","dependency_job_id":null,"html_url":"https://github.com/StrandedKitty/tiles-intersect","commit_stats":null,"previous_names":[],"tags_count":null,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StrandedKitty%2Ftiles-intersect","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StrandedKitty%2Ftiles-intersect/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StrandedKitty%2Ftiles-intersect/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StrandedKitty%2Ftiles-intersect/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/StrandedKitty","download_url":"https://codeload.github.com/StrandedKitty/tiles-intersect/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223639323,"owners_count":17177816,"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":["algorithms","javascript"],"created_at":"2024-11-08T06:12:11.988Z","updated_at":"2024-11-08T06:12:12.596Z","avatar_url":"https://github.com/StrandedKitty.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# tiles-intersect\nGiven two points which represent a line in 2D or 3D space find all tiles/voxels it intersects. It's a JavaScript implementation of [A Fast Voxel Traversal Algorithm for Ray Tracing](http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.42.3443\u0026rep=rep1\u0026type=pdf).\n## Usage\n```javascript\nconst tilesIntersect = require('tiles-intersect');\nlet line = [[0.1, 0.2], [3.5, 2.8]];\nlet tiles = tilesIntersect.calculate(line, 2); // [[0, 0], [1, 0], [1, 1], [2, 1], [2, 2], [3, 2]]\n```\n## API\n### `calculate(line, dimensions = 2)`\nReturns a 2D array of tiles/voxels intersected by a line.\n#### line\nTwo-dimensional array which contains two points.\n#### dimensions\nNumber of dimensions (2 or 3).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstrandedkitty%2Ftiles-intersect","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstrandedkitty%2Ftiles-intersect","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstrandedkitty%2Ftiles-intersect/lists"}