{"id":16754808,"url":"https://github.com/zilmarinen/deltille","last_synced_at":"2025-03-16T06:14:21.857Z","repository":{"id":242342222,"uuid":"805728871","full_name":"zilmarinen/Deltille","owner":"zilmarinen","description":"Swift triangular and hexagonal grid utility framework","archived":false,"fork":false,"pushed_at":"2024-12-23T14:06:42.000Z","size":106,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-22T18:28:27.687Z","etag":null,"topics":["grid-system","hexagons","kites","septominos","triangles"],"latest_commit_sha":null,"homepage":"","language":"Swift","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/zilmarinen.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","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-05-25T09:49:20.000Z","updated_at":"2024-06-22T09:58:52.000Z","dependencies_parsed_at":"2024-06-22T19:23:55.635Z","dependency_job_id":"0e8ee4b6-8083-4208-8e5f-7a221fe5f66b","html_url":"https://github.com/zilmarinen/Deltille","commit_stats":null,"previous_names":["zilmarinen/deltille"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zilmarinen%2FDeltille","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zilmarinen%2FDeltille/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zilmarinen%2FDeltille/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zilmarinen%2FDeltille/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zilmarinen","download_url":"https://codeload.github.com/zilmarinen/Deltille/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243830955,"owners_count":20354855,"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":["grid-system","hexagons","kites","septominos","triangles"],"created_at":"2024-10-13T03:06:03.538Z","updated_at":"2025-03-16T06:14:21.834Z","avatar_url":"https://github.com/zilmarinen.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Platforms](https://img.shields.io/badge/platforms-iOS%20|%20Mac-lightgray.svg)]()\n[![Swift 5.1](https://img.shields.io/badge/swift-5.1-red.svg?style=flat)](https://developer.apple.com/swift)\n[![License](https://img.shields.io/badge/license-MIT-lightgrey.svg)](https://opensource.org/licenses/MIT)\n\n- [Introduction](#deltille)\n- [Installation](#installation)\n- [Implementation](#implementation)\n- [Examples](#examples)\n- [Credits](#credits)\n\n# Deltille\nDeltille is a utility framework designed to encapsulate the mathmatical principles and concepts of a coordinate system defined within a regular tiling of a triangular grid. \n\n# Installation\nTo install using Swift Package Manager, add this to the `dependencies:` section in your Package.swift file:\n\n```swift\n.package(url: \"https://github.com/zilmarinen/Deltille.git\", .upToNextMinor(from: \"0.1.0\")),\n```\n\n## Dependencies\n[Euclid](https://github.com/nicklockwood/Euclid) is a Swift library for creating and manipulating 3D geometry and is used extensively within this project for mesh generation and vector operations.\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details\n\n# Implementation\nDeltille is a lightweight wrapper for the base utility data structures required to get started working with triangular grids. By constraining triangles to a fixed `Grid`, it is possible to generate triangle vertices for any given `Scale` by leveraging the natural geometric properties of triangle subdivision. \n\n## Triangles\nThe basic building blocks of Deltille are both the `Coordinate` and `Triangle` types which are used together to model equilateral triangle vertex positions along a plane.\n\n```swift\n//create a triangle at the world origin\nlet triangle = Grid.Triangle(.zero)\n    \n//generate triangle vertices for the desired scale\nlet vertices = triangle.corners(for: .chunk)\n```\n\n## Stencils\nA `Stencil` can be used to subdivide a triangle into individual sub-triangles mapped to a specific grid scale.  \n\n```swift    \n//subdivide into stencil components\nlet stencil = triangle.stencil(for: .tile)\n    \n//grab the stencil center\nlet vertex = stencil.vertex(for: .center)\n```\n\n## Footprints\nA `Footprint` defines a collection of triangles centered around a given origin.\n\n```swift\n//define a collection of triangle coordinates\nlet septomino = Grid.Septomino.asterope\n    \n//create a footprint    \nlet footprint = Footprint(origin: .zero,\n                          coordinates: septomino.coordinates)\n    \n//rotate footprint around its origin\nlet rotated = footprint.rotate(rotation: .clockwise)\n```\n\n# Examples\n[Regolith](https://github.com/zilmarinen/Regolith/) makes usage of the concepts introduced by Deltille to generate meshes for predefined tessellations of a triangle interior using [Ortho-Tiling](https://www.boristhebrave.com/2023/05/31/ortho-tiles/).\n\n[Verdure](https://github.com/zilmarinen/Verdure/) implements additional mesh generation on top of Deltille to create stylised foliage canopies constrained to a triangular grid.\n\n# Credits\n\nThe Deltille framework is primarily the work of [Zack Brown](https://github.com/zilmarinen)\n\nSpecial thanks go to;\n\n- [Boris the Brave](https://www.boristhebrave.com) for his extensive articles on grid systems, dual contouring, marching cubes, ortho-tiling and so much more.\n- [Oskar Stalberg](https://t.co/qakKgmxfai) for inspiring posts on procedural generation and wave function collapse.\n- [Amit Patel](https://www.redblobgames.com) for stimulating deep dives into hexagonal grids, coordinate systems and \ngrid edge classifications.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzilmarinen%2Fdeltille","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzilmarinen%2Fdeltille","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzilmarinen%2Fdeltille/lists"}