%global _empty_manifest_terminate_build 0 Name: python-perlin-noise Version: 1.12 Release: 1 Summary: Python implementation for Perlin Noise with unlimited coordinates space License: MIT License URL: https://pypi.org/project/perlin-noise/ Source0: https://mirrors.aliyun.com/pypi/web/packages/02/82/4762c741b3edee5cda7207d45592c959760797860f1e8e69b143cf1805bc/perlin_noise-1.12.tar.gz BuildArch: noarch %description Smooth random noise generator read more https://en.wikipedia.org/wiki/Perlin_noise source code: https://github.com/salaxieb/perlin_noise noise = PerlinNoise(octaves=3.5, seed=777)     octaves : number of sub rectangles in each [0, 1] range     seed : specific seed with which you want to initialize random generator ```python from perlin_noise import PerlinNoise noise = PerlinNoise() # accepts as argument float and/or list[float] noise(0.5) == noise([0.5]) --> True # noise not limited in space dimension and seamless in any space size noise([0.5, 0.5]) == noise([0.5, 0.5, 0, 0, 0]) --> True ``` Usage examples: ```python import matplotlib.pyplot as plt from perlin_noise import PerlinNoise noise = PerlinNoise(octaves=10, seed=1) xpix, ypix = 100, 100 pic = [[noise([i/xpix, j/ypix]) for j in range(xpix)] for i in range(ypix)] plt.imshow(pic, cmap='gray') plt.show() ``` ![png](https://raw.githubusercontent.com/salaxieb/perlin_noise/master/pics/output_4_0.png) ```python import matplotlib.pyplot as plt from perlin_noise import PerlinNoise noise1 = PerlinNoise(octaves=3) noise2 = PerlinNoise(octaves=6) noise3 = PerlinNoise(octaves=12) noise4 = PerlinNoise(octaves=24) xpix, ypix = 100, 100 pic = [] for i in range(xpix): row = [] for j in range(ypix): noise_val = noise1([i/xpix, j/ypix]) noise_val += 0.5 * noise2([i/xpix, j/ypix]) noise_val += 0.25 * noise3([i/xpix, j/ypix]) noise_val += 0.125 * noise4([i/xpix, j/ypix]) row.append(noise_val) pic.append(row) plt.imshow(pic, cmap='gray') plt.show() ``` ![png](https://raw.githubusercontent.com/salaxieb/perlin_noise/master/pics/output_5_0.png) %package -n python3-perlin-noise Summary: Python implementation for Perlin Noise with unlimited coordinates space Provides: python-perlin-noise BuildRequires: python3-devel BuildRequires: python3-setuptools BuildRequires: python3-pip %description -n python3-perlin-noise Smooth random noise generator read more https://en.wikipedia.org/wiki/Perlin_noise source code: https://github.com/salaxieb/perlin_noise noise = PerlinNoise(octaves=3.5, seed=777)     octaves : number of sub rectangles in each [0, 1] range     seed : specific seed with which you want to initialize random generator ```python from perlin_noise import PerlinNoise noise = PerlinNoise() # accepts as argument float and/or list[float] noise(0.5) == noise([0.5]) --> True # noise not limited in space dimension and seamless in any space size noise([0.5, 0.5]) == noise([0.5, 0.5, 0, 0, 0]) --> True ``` Usage examples: ```python import matplotlib.pyplot as plt from perlin_noise import PerlinNoise noise = PerlinNoise(octaves=10, seed=1) xpix, ypix = 100, 100 pic = [[noise([i/xpix, j/ypix]) for j in range(xpix)] for i in range(ypix)] plt.imshow(pic, cmap='gray') plt.show() ``` ![png](https://raw.githubusercontent.com/salaxieb/perlin_noise/master/pics/output_4_0.png) ```python import matplotlib.pyplot as plt from perlin_noise import PerlinNoise noise1 = PerlinNoise(octaves=3) noise2 = PerlinNoise(octaves=6) noise3 = PerlinNoise(octaves=12) noise4 = PerlinNoise(octaves=24) xpix, ypix = 100, 100 pic = [] for i in range(xpix): row = [] for j in range(ypix): noise_val = noise1([i/xpix, j/ypix]) noise_val += 0.5 * noise2([i/xpix, j/ypix]) noise_val += 0.25 * noise3([i/xpix, j/ypix]) noise_val += 0.125 * noise4([i/xpix, j/ypix]) row.append(noise_val) pic.append(row) plt.imshow(pic, cmap='gray') plt.show() ``` ![png](https://raw.githubusercontent.com/salaxieb/perlin_noise/master/pics/output_5_0.png) %package help Summary: Development documents and examples for perlin-noise Provides: python3-perlin-noise-doc %description help Smooth random noise generator read more https://en.wikipedia.org/wiki/Perlin_noise source code: https://github.com/salaxieb/perlin_noise noise = PerlinNoise(octaves=3.5, seed=777)     octaves : number of sub rectangles in each [0, 1] range     seed : specific seed with which you want to initialize random generator ```python from perlin_noise import PerlinNoise noise = PerlinNoise() # accepts as argument float and/or list[float] noise(0.5) == noise([0.5]) --> True # noise not limited in space dimension and seamless in any space size noise([0.5, 0.5]) == noise([0.5, 0.5, 0, 0, 0]) --> True ``` Usage examples: ```python import matplotlib.pyplot as plt from perlin_noise import PerlinNoise noise = PerlinNoise(octaves=10, seed=1) xpix, ypix = 100, 100 pic = [[noise([i/xpix, j/ypix]) for j in range(xpix)] for i in range(ypix)] plt.imshow(pic, cmap='gray') plt.show() ``` ![png](https://raw.githubusercontent.com/salaxieb/perlin_noise/master/pics/output_4_0.png) ```python import matplotlib.pyplot as plt from perlin_noise import PerlinNoise noise1 = PerlinNoise(octaves=3) noise2 = PerlinNoise(octaves=6) noise3 = PerlinNoise(octaves=12) noise4 = PerlinNoise(octaves=24) xpix, ypix = 100, 100 pic = [] for i in range(xpix): row = [] for j in range(ypix): noise_val = noise1([i/xpix, j/ypix]) noise_val += 0.5 * noise2([i/xpix, j/ypix]) noise_val += 0.25 * noise3([i/xpix, j/ypix]) noise_val += 0.125 * noise4([i/xpix, j/ypix]) row.append(noise_val) pic.append(row) plt.imshow(pic, cmap='gray') plt.show() ``` ![png](https://raw.githubusercontent.com/salaxieb/perlin_noise/master/pics/output_5_0.png) %prep %autosetup -n perlin_noise-1.12 %build %py3_build %install %py3_install install -d -m755 %{buildroot}/%{_pkgdocdir} if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi pushd %{buildroot} if [ -d usr/lib ]; then find usr/lib -type f -printf "\"/%h/%f\"\n" >> filelist.lst fi if [ -d usr/lib64 ]; then find usr/lib64 -type f -printf "\"/%h/%f\"\n" >> filelist.lst fi if [ -d usr/bin ]; then find usr/bin -type f -printf "\"/%h/%f\"\n" >> filelist.lst fi if [ -d usr/sbin ]; then find usr/sbin -type f -printf "\"/%h/%f\"\n" >> filelist.lst fi touch doclist.lst if [ -d usr/share/man ]; then find usr/share/man -type f -printf "\"/%h/%f.gz\"\n" >> doclist.lst fi popd mv %{buildroot}/filelist.lst . mv %{buildroot}/doclist.lst . %files -n python3-perlin-noise -f filelist.lst %dir %{python3_sitelib}/* %files help -f doclist.lst %{_docdir}/* %changelog * Fri Jun 09 2023 Python_Bot - 1.12-1 - Package Spec generated