Last active
June 16, 2018 10:57
-
-
Save mimetaur/27afaf322f0795324cf3d27326e09582 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import random | |
| # script globals | |
| normal_distribution_amount = 12 | |
| min_height = 1 | |
| max_height = 10 | |
| def get_random_height(): | |
| random_height = hou.hmath.fit(random.random(), 0, 1, min_height, max_height) | |
| return random_height | |
| def normally_distributed_height(): | |
| total_heights = 0 | |
| for i in range(normal_distribution_amount): | |
| random_height = get_random_height() | |
| total_heights += random_height | |
| return total_heights/normal_distribution_amount | |
| return normally_distributed_height() |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Removed reference to $PT (current point) - no longer necessary when using Python's random method