Fix: Non-int harmonics were faulty
This commit is contained in:
parent
17dec720f1
commit
bec6a5ffcd
@ -116,11 +116,11 @@ class Harmonic_Perlin_Noise():
|
||||
self.scale = scale
|
||||
if type(octaves) in [int, float]:
|
||||
int_octaves = int(octaves)
|
||||
octaves = [1/(i+1) for i in range(int_octaves)]
|
||||
octaves_arr = [1/(i+1) for i in range(int_octaves)]
|
||||
if type(octaves) == float:
|
||||
octaves += [1/(int_octaves+2)*(octaves-int_octaves)]
|
||||
octaves = np.array(octaves)
|
||||
self.octaves = octaves / np.linalg.norm(octaves)
|
||||
octaves_arr += [1/(int_octaves+2)*(octaves-int_octaves)]
|
||||
octaves_arr = np.array(octaves_arr)
|
||||
self.octaves = octaves_arr / np.linalg.norm(octaves_arr)
|
||||
self.reset()
|
||||
|
||||
def __call__(self, shape):
|
||||
|
Loading…
Reference in New Issue
Block a user