Add editing methods

This commit is contained in:
Andras Schmelczer 2024-04-01 12:48:13 +01:00
commit f7d9c0193d
No known key found for this signature in database
GPG key ID: FC8F2C3D3D1A718C
12 changed files with 161 additions and 0 deletions

10
editor/utils/random.py Normal file
View file

@ -0,0 +1,10 @@
import numpy as np
def random(min: float = 0, max: float = 1):
mu = (max + min) / 2 # Mean of the distribution
sigma = (
max - min
) / 6 # Standard deviation, chosen so that ~99.7% fall within [min_val, max_val]
sample = np.random.normal(mu, sigma)
return np.clip(sample, min, max)