{"id":23006355,"url":"https://github.com/rob1997/trackgenerator","last_synced_at":"2025-08-14T03:30:55.358Z","repository":{"id":259676913,"uuid":"879168437","full_name":"rob1997/TrackGenerator","owner":"rob1997","description":"A package that Procedurally Generates Closed Tracks from Voronoi Diagrams using C# Jobs System, Splines and Procedural Mesh Generation.","archived":false,"fork":false,"pushed_at":"2024-12-10T14:53:39.000Z","size":587,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-12-10T16:22:08.861Z","etag":null,"topics":["procedural-generation","track","unity","unity3d","voronoi","voronoi-diagram"],"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/rob1997.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-10-27T07:16:32.000Z","updated_at":"2024-12-10T14:53:42.000Z","dependencies_parsed_at":"2024-10-27T09:39:58.351Z","dependency_job_id":null,"html_url":"https://github.com/rob1997/TrackGenerator","commit_stats":null,"previous_names":["rob1997/voronoi","rob1997/trackgenerator"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rob1997%2FTrackGenerator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rob1997%2FTrackGenerator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rob1997%2FTrackGenerator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rob1997%2FTrackGenerator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rob1997","download_url":"https://codeload.github.com/rob1997/TrackGenerator/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":229795874,"owners_count":18125286,"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":["procedural-generation","track","unity","unity3d","voronoi","voronoi-diagram"],"created_at":"2024-12-15T08:12:11.388Z","updated_at":"2025-08-14T03:30:55.348Z","avatar_url":"https://github.com/rob1997.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Track Generator\n[![GitHub release](https://img.shields.io/github/v/release/rob1997/TrackGenerator?include_prereleases)](https://github.com/rob1997/TrackGenerator/releases)\n[![Made with Unity](https://img.shields.io/badge/Made%20with-Unity-57b9d3.svg?style=flat\u0026logo=unity)](https://unity3d.com)\n[![GitHub license](https://img.shields.io/github/license/rob1997/TrackGenerator)](https://opensource.org/licenses/MIT)\n\nA package that Procedurally Generates Closed Tracks from Voronoi Diagrams using C# Jobs System, Splines and Procedural Mesh Generation.\n\nThis package also contains a Voronoi Diagram implementation that can be found [here](https://github.com/rob1997/TrackGenerator/tree/main/Runtime/Scripts/Voronoi#voronoi).\n\nUnity Version: `2022.3.44f1`\n\n![spline_4](./~docs/spline_4.png)\n\n## Performance\n\n| Track Size/Cells | Performance in ms |\n|------------------|-------------------|\n| 10               | 2.5 - 3           |\n| 25               | 8 - 8.7           |\n| 50               | 21 - 23           |\n\nComplexity = 1\nSmoothness = 500\n\n## Installation\nYou can install the package via UPM (Unity Package Manager)\n- Open the Unity Package Manager from `Window \u003e Package Manager` and [Import Package from Git URL](https://docs.unity3d.com/Manual/upm-ui-giturl.html).\n- Input the following URL: https://github.com/rob1997/TrackGenerator.git\n\n## Configuration\n\nBelow are properties of Track Generator that you can configure to generate different types of tracks.\n\n| **Name**   | **Type**               | **Description**                                                                                                                                  |\n|------------|------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------|\n| Resolution | `int`                  | Number of triangles that'll be used for mesh generation, the higher the value the smoother the generated mesh.                                   |\n| Width      | `float`                | Width of the generated mesh.                                                                                                                     |\n| Tiling     | `Range[0f, 1f] float`  | The tiling of the generated mesh relative to the distance of the generated Spline. A value of 1 will tile the texture once per unit of distance. |\n| Scale      | `float`                | Scale of the generated track.                                                                                                                    |\n| Complexity | `Rangle[0f, 1f] float` | The lower the complexity the fewer sides/segments the track will have.                                                                           |\n\nThere are two types of Track Generators available in the package:\n\n### 1. Random Track Generator\n\nGenerates a random track based on size (area).\n\n| **Name** | **Type**               | **Description**                                                                                     |\n|----------|------------------------|-----------------------------------------------------------------------------------------------------|\n| Size     | `int`                  | Number of voronoi cells used to generate a random track. The higher the value the bigger the track. |\n\n### 2. Rect Track Generator\n\nGenerates a rectangular track based on size (width, height).\n\n| **Name** | **Type**     | **Description**                                                                              |\n|----------|--------------|----------------------------------------------------------------------------------------------|\n| Size     | `Vector2Int` | Determines the dimensions of the track, corresponding to width (Size.x) and height (Size.Y). |\n\n## Setup\n\n- Attach the `RandomTrackGenerator` or `RectTrackGenerator` `MonoBehaviour` to a `GameObject` in the Scene.  This will automatically add `SplineContainer`, `MeshRenderer` and `MeshFilter` components to the `GameObject`.\n\n\n- Assign a Material of your choice to the `MeshRenderer` component. You can find a default road material in the Materials folder in the package.\n\n## Usage\n\nFirst declare a serialized implementation of `TrackGenerator`\n\n```csharp\n    [field: SerializeField] public RandomTrackGenerator TrackGenerator { get; private set; }\n```\n\nor\n\n```csharp\n    [field: SerializeField] public RectTrackGenerator TrackGenerator { get; private set; }\n```\n\nthen generate track\n\n```csharp\n    private void Update()\n    {\n        // Generate a Random Track on Space Key Press\n        if (Input.GetKeyDown(KeyCode.Space))\n        {\n            TrackGenerator.Generate();\n        }\n    }\n```\nThe `TrackGenerator.Generate()` method generates a random track based on the `transform` of the `GameObject`.\n\nYou can also alternatively use the Generate Button in the Inspector.\n\n![spline_0](./~docs/spline_0.png)\n\nYou can use the Spline Editor tool to edit any generated Track Spline in the Scene View. Once you're done editing the Spline you can press the `Generate Mesh` button to generate a new mesh based on the edited Spline.\n\n![spline_1](./~docs/spline_1.png)\n\n![spline_2](./~docs/spline_2.png)\n\n![spline_3](./~docs/spline_3.png)\n\nYou can get the generated Vertices and Spline via `TrackGenerator.Spline` and `TrackGenerator.Vertices`.\n\n## How it Works\n\nIf you would like to know how it works, I've a dev-log entry on it [here](https://rob1997.github.io/devlog/log-2.html)\n\n## Contributing\n\nIf you'd like to contribute to the project, you can fork the repository and create a pull request. You can also create an issue if you find any bugs or have any feature requests.\n\n---\n\n##### **⚠️Caution⚠️**\n\nAs you go higher up in track size significantly you'll start to get a specific exception `Next segment not unique` more and more frequently which happens due to floating point precision. In cases where you need a significantly large track perhaps consider increasing scale instead. More on this [here](Runtime/Scripts/Voronoi/README.md#caution).\n\n---","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frob1997%2Ftrackgenerator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frob1997%2Ftrackgenerator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frob1997%2Ftrackgenerator/lists"}