Skip to content

Instantly share code, notes, and snippets.

@mimetaur
Last active June 16, 2018 10:57
Show Gist options
  • Select an option

  • Save mimetaur/27afaf322f0795324cf3d27326e09582 to your computer and use it in GitHub Desktop.

Select an option

Save mimetaur/27afaf322f0795324cf3d27326e09582 to your computer and use it in GitHub Desktop.
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()
@mimetaur

Copy link
Copy Markdown
Author

Removed reference to $PT (current point) - no longer necessary when using Python's random method

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment