Poisson Node - Perpetual Motion

john's Avatar

john

31 Dec, 2019 12:25 AM

Attached is a demo of a new custom node: poisson.

Poisson generates random but evenly spaced points within a given rectangular area using Poisson Disk Sampling. It requires the poisson.py python module (included in the zip file).

The algorithm is by Robert Bridson (https://www.cs.ubc.ca/~rbridson/docs/bridson-siggraph07-poissondisk...) and the Python module is based on code by Christian Hill (https://scipython.com/blog/poisson-disc-sampling-in-python/). I adapted it to work with NodeBox.

To use the node just specify the width and height of a rectangular region and a point size - the minimum distance between neighboring points. If you use the points to draw objects with a diameter less than or equal to this point size, none of the objects will overlap. To fill a non-rectangular region, just use a delete node to delete points outside the region.

Poisson is an alternative to the scatter node (which creates random but ugly, non-homogenous, and often overlapping positions). It is surpassingly useful.

The demo creates an animation of a perpetual motion machine. As the pistons go up and down the gas molecules inside become more or less compressed. The molecules swim about in a brownian way but fill the available space in a pleasing fashion.

I will be including this node in the next 1.1 release of my node library.

If you use this in your own projects please consider sharing here on the forum.

Enjoy!

John

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Already uploaded files

  • perpetual_motion_screenshot.png 543 KB
  • perpetual_motion.mp4 366 KB
  • poisson.zip 6.6 KB

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac

Recent Discussions

18 Sep, 2020 09:16 PM
26 Aug, 2020 12:36 AM
21 Aug, 2020 09:58 PM
20 Aug, 2020 08:16 PM
20 Aug, 2020 07:56 PM

 

16 Aug, 2020 06:40 PM
01 Aug, 2020 11:34 PM
28 Jul, 2020 11:28 AM
27 Jul, 2020 10:47 AM
27 Jul, 2020 08:00 AM
27 Jul, 2020 06:46 AM