{"id":16980964,"url":"https://github.com/guzba/noisy","last_synced_at":"2025-03-21T23:26:38.810Z","repository":{"id":52153564,"uuid":"285719283","full_name":"guzba/noisy","owner":"guzba","description":"SIMD-accelerated noise generation.","archived":false,"fork":false,"pushed_at":"2023-08-28T18:45:46.000Z","size":637,"stargazers_count":29,"open_issues_count":1,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-26T17:46:51.591Z","etag":null,"topics":["nim","noise","perlin","simd","simplex"],"latest_commit_sha":null,"homepage":"","language":"Nim","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/guzba.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":"2020-08-07T02:35:49.000Z","updated_at":"2024-12-11T17:50:22.000Z","dependencies_parsed_at":"2024-11-28T07:24:04.654Z","dependency_job_id":"05e60d02-940f-4324-8f2b-cd20280b31e9","html_url":"https://github.com/guzba/noisy","commit_stats":{"total_commits":68,"total_committers":2,"mean_commits":34.0,"dds":0.1029411764705882,"last_synced_commit":"9625ee0a9dbdae44c427df95a4f8de006c061150"},"previous_names":[],"tags_count":8,"template":false,"template_full_name":"treeform/nimtemplate","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guzba%2Fnoisy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guzba%2Fnoisy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guzba%2Fnoisy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guzba%2Fnoisy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/guzba","download_url":"https://codeload.github.com/guzba/noisy/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244882246,"owners_count":20525824,"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":["nim","noise","perlin","simd","simplex"],"created_at":"2024-10-14T02:04:15.649Z","updated_at":"2025-03-21T23:26:38.790Z","avatar_url":"https://github.com/guzba.png","language":"Nim","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Noisy\n\n![Github Actions](https://github.com/guzba/noisy/workflows/Github%20Actions/badge.svg)\n\n`nimble install noisy`\n\nNoisy is a SIMD-accelerated Nim implementation of Simplex (Perlin) noise. The goal of this library is to be easy to use, performant and dependency-free.\n\nNoisy works well using Nim's relatively new `--gc:arc` and `--gc:orc` as well as the default garbage collector. This library also works using both `nim c` and `nim cpp`, in addition to `--cc:vcc` on Windows.\n\nI have also verified that Noisy builds with `--experimental:strictFuncs` on Nim 1.4.0.\n\n![2D Simplex Noise](examples/noise.png)\n\n## Example\n\n```nim\nimport noisy, strformat\n\nvar simplex = initSimplex(1988)\nsimplex.frequency = 0.1\n\n# Starting at (0, 0) generate a 16x16 grid of 2D noise values.\nlet values = simplex.grid((0, 0), (16, 16))\nfor x in 0 ..\u003c 16:\n  for y in 0 ..\u003c 16:\n    let value = values[x, y]\n    echo \u0026\"({x},{y}): {value}\"\n```\n\n## Performance\n\nBenchmarks can be run comparing methods for generating noise values. Check the performance yourself by running [tests/benchmark.nim](https://github.com/guzba/noisy/blob/master/tests/benchmark.nim).\n\n`nim c -d:release -r .\\tests\\benchmark.nim` (256 x 256 x 256 cube of 3D simplex noise with 3 octaves, lower time is better)\n\nMethod | Time\n--- | ---:\nPoint by point using `value(x, y, z)` | 1.6066s\nUsing `grid()` (SIMD accelerated, GCC default) | 1.0281s\nUsing `grid()` (SIMD accelerated, `--passC:\"-mavx\"`) | 0.7476s\n\n## Testing\n\n`nimble test`\n\n# API: noisy\n\n```nim\nimport noisy\n```\n\n## **type** Simplex\n\n\n```nim\nSimplex = object\n octaves*: int\n amplitude*, frequency*, lacunarity*, gain*: float32\n```\n\n## **type** Grid\n\n\n```nim\nGrid = ref object\n width*, height*, depth*: int\n values*: seq[float32]\n```\n\n## **type** NoisyError\n\n\n```nim\nNoisyError = object of ValueError\n```\n\n## **func** initSimplex\n\n\n```nim\nfunc initSimplex(seed: int): Simplex\n```\n\n## **func** `[]`\n\nReturns the noise value at (x, y) or (x, y, z).\n\n```nim\nfunc `[]`(g: Grid; x, y: int; z = 0): float32 {.inline.}\n```\n\n## **func** value\n\nGenerates the 2D noise value at (x, y) based on the Simplex parameters.\n\n```nim\nfunc value(simplex: Simplex; x, y: float32): float32 {.raises: [NoisyError], tags: [].}\n```\n\n## **func** value\n\nGenerates the 3D noise value at (x, y, z) based on the Simplex parameters.\n\n```nim\nfunc value(simplex: Simplex; x, y, z: float32): float32 {.raises: [NoisyError], tags: [].}\n```\n\n## **func** value\n\nHelper for working with ints.\n\n```nim\nfunc value(simplex: Simplex; x, y: int): float32 {.inline, raises: [NoisyError], tags: [].}\n```\n\n## **func** value\n\nHelper for working with ints\n\n```nim\nfunc value(simplex: Simplex; x, y, z: int): float32 {.inline, raises: [NoisyError].}\n```\n\n## **func** grid\n\nBeginning at position start, generate a grid of 2D noise based on the Simplex parameters. The width and height of the grid is set by the dimens parameter.\n\n```nim\nfunc grid(simplex: Simplex; start: (float32, float32); dimens: (int, int)): Grid {.raises: [NoisyError].}\n```\n\n## **func** grid\n\nHelper for working with ints.\n\n```nim\nfunc grid(simplex: Simplex; start: (int, int); dimens: (int, int)): Grid {. inline, raises: [NoisyError].}\n```\n\n## **func** grid\n\nBeginning at position start, generate a grid of 3D noise based on the Simplex parameters. The width, depth, and height of the grid is set by the dimens parameter.\n\n```nim\nfunc grid(simplex: Simplex; start: (float32, float32, float32);\n dimens: (int, int, int)): Grid {.raises: [NoisyError].}\n```\n\n## **func** grid\n\nHelper for working with ints.\n\n```nim\nfunc grid(simplex: Simplex; start: (int, int, int); dimens: (int, int, int)): Grid {. inline, raises: [NoisyError].}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fguzba%2Fnoisy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fguzba%2Fnoisy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fguzba%2Fnoisy/lists"}