Skip to content

Include Simplex Noise as SNoise #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions vnoise/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from .vnoise import Noise
from .vsnoise import SNoise


def _get_version() -> str:
Expand Down
105 changes: 105 additions & 0 deletions vnoise/_tables.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,3 +280,108 @@
156,
180,
)

M_1_PI = 0.31830988618379067154


GRAD4 = (
(0, 1, 1, 1),
(0, 1, 1, -1),
(0, 1, -1, 1),
(0, 1, -1, -1),
(0, -1, 1, 1),
(0, -1, 1, -1),
(0, -1, -1, 1),
(0, -1, -1, -1),
(1, 0, 1, 1),
(1, 0, 1, -1),
(1, 0, -1, 1),
(1, 0, -1, -1),
(-1, 0, 1, 1),
(-1, 0, 1, -1),
(-1, 0, -1, 1),
(-1, 0, -1, -1),
(1, 1, 0, 1),
(1, 1, 0, -1),
(1, -1, 0, 1),
(1, -1, 0, -1),
(-1, 1, 0, 1),
(-1, 1, 0, -1),
(-1, -1, 0, 1),
(-1, -1, 0, -1),
(1, 1, 1, 0),
(1, 1, -1, 0),
(1, -1, 1, 0),
(1, -1, -1, 0),
(-1, 1, 1, 0),
(-1, 1, -1, 0),
(-1, -1, 1, 0),
(-1, -1, -1, 0),
)

SIMPLEX = (
(0, 1, 2, 3),
(0, 1, 3, 2),
(0, 0, 0, 0),
(0, 2, 3, 1),
(0, 0, 0, 0),
(0, 0, 0, 0),
(0, 0, 0, 0),
(1, 2, 3, 0),
(0, 2, 1, 3),
(0, 0, 0, 0),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