R
R
RKuzovlev2014-02-02 11:40:02
JavaScript
RKuzovlev, 2014-02-02 11:40:02

What is the algorithm for drawing a grid (like from soap bubbles) using JS?

Hello.
It is necessary to draw a two-dimensional grid similar to the one obtained when using soap bubbles.
Mesh examples
a465be6573d80a1927c8a0ae0d80a4d1.jpg7d3e86ef7105521be07a7c017d4e4361.jpg.
For example, we have 3 circles. Each circle has a center and a radius.
If some circle intersects with another, then they will begin to "crowd out" each other.
Examples
49f4cd3b4e454479c054ecdca9b474fe.jpg8a20f6490959086de88bc3f17a50a2ce.jpg
These are just simple examples, the number of "bubbles" is not limited.
How to draw this on canvas using JS. What is the best library to use?
Thanks in advance!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey, 2014-02-02
Protko @Fesor

I remember paper.js had a similar example ....
paperjs.org/examples/voronoi

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question