robbmcleod / pyfastnoisesimd

Python module wrapping C++ FastNoiseSIMD
BSD 3-Clause "New" or "Revised" License
39 stars 6 forks source link

start parameter from Noise().genAsGrid() seems doesn't work #17

Closed Enderlook closed 5 years ago

Enderlook commented 5 years ago

Just write:

>>> ns = Noise()
>>> ns.genAsGrid(shape=[3,3,3], start=[0,0,0]) == ns.genAsGrid(shape=[3,3,3], start=[50,50,50])
array([[[ True,  True,  True],
        [ True,  True,  True],
        [ True,  True,  True]],

       [[ True,  True,  True],
        [ True,  True,  True],
        [ True,  True,  True]],

       [[ True,  True,  True],
        [ True,  True,  True],
        [ True,  True,  True]]])

They should be different. I'm trying to generate a huge terrain from smaller chunks using the start parameter, but it seems doesn't work. Am I doing something wrong? I think it may be a bug.

robbmcleod commented 5 years ago

Looks to me I'm ignoring the start keyword if it's running with more than one thread.

from pyfastnoisesimd import Noise
ns = Noise()
ns.numWorkers = 1
ns.genAsGrid(shape=[3,3,3], start=[0,0,0]) == ns.genAsGrid(shape=[3,3,3], start=[50,50,50])

I'll look into it, but that will work if you want to prototype for now.

robbmcleod commented 5 years ago

Can you build the latest version from master and see if this is behaving as expected now?

Enderlook commented 5 years ago

I'm sorry but I got an error. It's the first time I install a package from a downloaded file, so maybe the mistake was mine, but I did:

Open console:

cd C:\Panda3D-1.10.0-x64\python
python -m pip install C:\Users\myUser\Downloads\pyfastnoisesimd-master

And the output was this pastebin.

I can't say if the error was yours or mine because I've never installed a library from a downloaded file, I'm sorry.

PD: About the fix with numWorkers it worked perfectly, thanks! I was trying to understand why it doesn't work for a few days and I was getting very anxious!

robbmcleod commented 5 years ago

Ah, you would need the Microsoft Visual C++ build tools installed. They are free.

https://visualstudio.microsoft.com/downloads/#build-tools-for-visual-studio-2017

In any case I will prepare a new release.

Enderlook commented 5 years ago

Ok, I'll install that!

Enderlook commented 5 years ago

Sorry. I've installed Visual Studio Build Tools 2017: Visual C++ build tools. Then I just tried to install the library, but I got this error (I think it's the same error). Have I downloaded the wrong stuff? By the way, Visual Studio Build Tools doesn't use the Visual Studio IDE... open it executes a "Visual Studio 2017 Developer Command Prompt v15.0", I tried executing from there the installation and its raised a bigger error. I'm sorry for making so many troubles. Maybe have I to download "Development for Deskopt with C++"? It doesn't sound as "build tool" so I'm not sure.

robbmcleod commented 5 years ago

@Enderlook I've been able to resolve the memory leak and now 0.4.0 is released on PyPI, so you can try that for multi-threaded acceleration.

robbmcleod commented 5 years ago

Closing as I'm fairly sure this is resolved.

Enderlook commented 5 years ago

Yes, it works. I'm sorry for not have answered before.