{"id":14779782,"url":"https://github.com/sjaak31367/micropython_perlin","last_synced_at":"2026-01-02T20:08:13.583Z","repository":{"id":255867387,"uuid":"850332462","full_name":"sjaak31367/micropython_perlin","owner":"sjaak31367","description":"A module for micropython which adds the ability to generate Perlin noise","archived":false,"fork":false,"pushed_at":"2024-09-11T14:14:20.000Z","size":1144,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-22T02:14:49.598Z","etag":null,"topics":["micropython","perlin"],"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/sjaak31367.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-08-31T13:35:25.000Z","updated_at":"2024-09-26T10:52:10.000Z","dependencies_parsed_at":"2024-09-11T20:13:17.347Z","dependency_job_id":null,"html_url":"https://github.com/sjaak31367/micropython_perlin","commit_stats":null,"previous_names":["sjaak31367/micropython_perlin"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sjaak31367%2Fmicropython_perlin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sjaak31367%2Fmicropython_perlin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sjaak31367%2Fmicropython_perlin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sjaak31367%2Fmicropython_perlin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sjaak31367","download_url":"https://codeload.github.com/sjaak31367/micropython_perlin/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243723048,"owners_count":20337301,"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":["micropython","perlin"],"created_at":"2024-09-17T01:00:59.384Z","updated_at":"2026-01-02T20:08:08.551Z","avatar_url":"https://github.com/sjaak31367.png","language":"C","readme":"## Micropython Perlin  \r\n----\r\n#### A module for micropython which adds the ability to generate Perlin noise  \r\n\r\nDeveloped against micropython [v1.24.0-preview.218.gb704ff66c.dirty](https://github.com/micropython/micropython/commit/b704ff66c3e034c36e548eb0b9874871b5f3b5d0) with a WEMOS S2 Mini (esp32s2) and ESP-IDF [v5.2.2](https://github.com/espressif/esp-idf/releases/tag/v5.2.2) with Python [3.8.10](https://www.python.org/downloads/release/python-3810/).  \r\n\r\n#### Examples:  \r\n###### planets.py\r\n![planets](examples/planets.gif)  \r\n\r\n#### How to:  \r\n###### Compile (firmware version):  \r\n1. You need the micropython repo.  \r\n2. Clone this repo into `micropython/ports/{port}/boards/{board}/modules`  \r\nI'm using a Lolin S2 Mini, so I'll end up with `/home/sjaak/.../micropython/ports/esp32/boards/LOLIN_S2_MINI/modules/micropython_perlin/`.  \r\n3. (A) Compile the firmware:  \r\n`cd` to `micropython/ports/{port}`  \r\n`make USER_C_MODULES=./boards/{board}/modules/micropython_perlin/firmware/perlin.cmake BOARD={board} all`  \r\n(B) Or you can add it to `micropython/ports/{port}/boards/{board}/mpconfigboard.cmake` with `set(USER_C_MODULES ${MICROPY_BOARD_DIR}/modules/micropython_perlin/firmware/perlin.cmake)`  \r\n4. Flash your new firmware, and you should have a functioning perlin noise generator installed!  \r\n###### Compile (native module version):  \r\n1. Have the micropython repo, and have mpy-cross compiled.  \r\n2. `cd` into this repo's `natmod`.  \r\n3. Update MPY_DIR and ARCH to your usecase.  \r\n4. `make`  \r\n5. Upload perlin.mpy to your board.  \r\n  \r\nKnown limitations:  \r\nNative module and firmware/python version have different results due to having a different random source.  \r\n###### Speed:  \r\nTo calculate 6 octaves for 100'000 points (on an ESP32) took:  \r\n\r\n| version  | time      |\r\n| -------- | --------- |\r\n| python   | 231'003ms |\r\n| firmware |   9'974ms |\r\n| natmod   |   4'340ms |\r\n\r\nOr in other words, the Python version is here for compatibility, but I'd recommend using another version.  \r\n###### Usage:\r\n```py\r\nimport perlin\r\n\r\n#perlin.reseed(int seed)\r\nperlin.reseed(31367)\r\n\r\n#perlin.octave_perlin(float x, float y, float z, [int octaves, [float persistence]])\r\nperlin.octave_perlin(0.5, 0.5, 0.5, 6)  # 0.531746\r\n```  \r\n\r\n----\r\n\r\n#### Credits  \r\nFirmware version is based off Adrian Biagioli's [Perlin.cs](https://gist.github.com/Flafla2/1a0b9ebef678bbce3215).  \r\nEarly Natmod version was based off Casey Duncan's [Noise](https://github.com/caseman/noise) (MIT License).  \r\n","funding_links":[],"categories":["Recently Updated","Libraries"],"sub_categories":["[Sep 15, 2024](/content/2024/09/15/README.md)","Mathematics"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsjaak31367%2Fmicropython_perlin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsjaak31367%2Fmicropython_perlin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsjaak31367%2Fmicropython_perlin/lists"}