Comments (3)
Interesting. This doesn't crash on macos, but does on Linux. I'll take a look
from noise.
It looks like the (my) code naively presumes that the base is in the range of 0..255, although other values can accidentally work they may read from outside the lookup table. Actually it's worse than that and even values in that range can result in reading garbage. Reading garbage will result in seemingly ok results on some platforms (it is a pseudo-random function after all), but on others with stricter memory access it crashes as you noted.
Anyway it's fixable but the internal api will need an adjustment. For some reason base is currently an integer, which only makes sense if you subscribe to the rather insane presumptions of the present code. It would be better for it to be a float and have it interact with the coordinates before they are mapped to the lookup table.
I'll work on a fix, but for now you can workaround by adding the base value to the input coordinates yourself, and leaving base at zero, which should not crash. The base value concept is a bit dubious anyway, and the implementation doubly so. Some self flagellation is possibly in order as well.
from noise.
Yeah, actually I started working assuming the base was a float, which is actually what the method signature in the help pages hints at: "base=0.0". Thankfully the error message was relatively explicit :)
I'll manually add the base as you suggest.
from noise.
Related Issues (20)
- Error during the installation HOT 6
- Can't import noise from other directories HOT 3
- noise fails to install with pip HOT 4
- noisemachine.com is offline ? HOT 1
- Where should the grad2 symbol in _perlin.so come from? HOT 13
- How to randomize the noise?
- cannot import name _perlin after running install.py successfully from master HOT 2
- README link to information on simplex noise is broken HOT 2
- [Discussion] Adding type hints?
- Segfault on snoise4 with lacunarity argument
- ImportError: Error relocating .../_perlin.cpython-37m-x86_64-linux-gnu.so: grad2: symbol not found HOT 1
- Add inverse function
- Can't import noise
- Could you update the latest version to pypi?
- Cant install noise via pip HOT 5
- IndexError
- Hot to credit noise
- Base in py_noise2 doesn't do *anything*
- ModuleNotFoundError: No module named 'noise.connection' HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from noise.