#PoissonDisk

Karsten Schmidttoxi@mastodon.thi.ng
2024-08-02

Just posted a new #ThingUmbrella example: Image-based Poisson-disk sampling, using the image brightness as minium distance function between points to spatially vary densities...

Demo:
demo.thi.ng/umbrella/poisson-i

Commented source code (<50 lines):
github.com/thi-ng/umbrella/blo

Benchmark:
31506 points @ 719.10ms
(max. 500 failed attempts to place a point, using a kD-Tree as spatial index)

/cc @nkint

#PoissonDisk #Sampling #Pixel #Graphics #TypeScript #JavaScript #Canvas

Portrait of Beethoven only using ~31000 black points/pixels on white background
Karsten Schmidttoxi@mastodon.thi.ng
2024-05-04

Still only on a feature branch, but over the past few days I've been working on updating thi.ng/geom to add support for polygons with holes and paths with holes (or more generally support for sub-paths, e.g. multiple curves). Since both of these shape types are containers of multiple geometries and therefore require in some situations (e.g. shape conversions) different handling than the other shapes with a single boundary/geometry, adding support for these also includes updating a dozen or so polymorphic shape operators/functions and unfortunately will involve a few of breaking changes. For instance, some of these functions are returning an array of shapes now, instead of just a single one. Also related, some of the other geom support packages (e.g. thi.ng/geom-axidraw, thi.ng/geom-sdf) will have to be refactored more and partially have been already (likely only internally, though)...

As part of this work, I've also just added example #160(!!!) to demonstrate & test out some of this new functionality:

Demo:
demo.thi.ng/umbrella/geom-comp

Source:
github.com/thi-ng/umbrella/blo

Commits:
github.com/thi-ng/umbrella/com

I will of course send another update once this all has been merged & released...

#ThingUmbrella #Geometry #Polygons #Shapes #PoissonDisk #TypeScript #JavaScript #OpenSource

Screenshot of the linked example project, showing a star polygon undergoing a series of transformations, like iterative subdivision, shape reconstruction using cubic beziers, point sampling (grid based, random, poisson disk sampling with varying density based on proximity to shape boundary...)
Karsten Schmidttoxi@mastodon.thi.ng
2024-01-08

Since some of you seem to like that above animation, here's an interactive version where you can disturb the cells via mouse/touch:

demo.thi.ng/umbrella/boids-vor

#Boids #Voronoi #Algorithm #PoissonDisk #ComputationalDesign #Physics #Simulation #GenerativeDesign #ThingUmbrella #TypeScript

Screenshot of the linked interactive demo, showing 2000 uniformly spaced voronoi cells with a diagonal center strip of larger cells, created via mouse interaction
Karsten Schmidttoxi@mastodon.thi.ng
2024-01-08

Nothing new, but maybe a little unusual: Using boids as alternative to Lloyd relaxation and/or Poisson-disk sampling. The boids here are using only two behaviors: local separation, plus a randomized attractor to create global disturbances. Cell density could also be varied by spatially adjusting the separation distance between boids. Overall convergence/relaxation can be much faster than shown here...

#Boids #Voronoi #Algorithm #PoissonDisk #ComputationalDesign #Physics #Simulation #GenerativeDesign #ThingUmbrella #TypeScript

Client Info

Server: https://mastodon.social
Version: 2025.04
Repository: https://github.com/cyevgeniy/lmst