[boost] [polygon] voronoi diagram in a bounding box

297 views
Skip to first unread message

Dan Chen

unread,
Feb 4, 2015, 8:01:29 AM2/4/15
to bo...@lists.boost.org
Hi all,
I am not sure whether this is the right place to ask this question. Basically, I want to compute the the voronoi diagram of a set of points in a bounding box, and output the voronoi cells. My idea is, after getting the voronoi diagram vd of the point set, for each voronoi cell in vd, compute the intersection of the cell and the bounding box. I am wondering whether this can be done in a better way with the boost libraries.
Thanks,Dan


_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

Andrii Sydorchuk

unread,
Feb 8, 2015, 5:28:47 PM2/8/15
to bo...@lists.boost.org
Hi Dan,

The feature is not provided natively by the library.
However, there are workarounds that depend on your use-case.
Could you please explain the problem you are trying to solve (e.g. draw
Voronoi diagram on a screen)?
Why do you need to clip Voronoi diagram with a bounding box?

Dan Chen

unread,
Feb 10, 2015, 1:37:13 AM2/10/15
to bo...@lists.boost.org
Hi Andrii,
I'm implementing a Lloyd's algorithm to get a centroidal Voronoi tessellation of a box. In this algorithm, I need to get the voronoi cells in the box, and find the centroids of these cells.
Thanks,Dan

Andrii Sydorchuk

unread,
Feb 10, 2015, 5:45:12 PM2/10/15
to bo...@lists.boost.org
Alright, thanks for the explanation!

Please have a look at the attached file.
The method signature you are interested in is the following:
static void clip(const voronoi_edge<CT> &edge,
const brect_type &brect, point_set_type &clipped_edge)

Let me know if the example is unclear or you have any other questions.

Regards,
Andrii
util.hpp

Dan Chen

unread,
Feb 11, 2015, 3:10:37 PM2/11/15
to bo...@lists.boost.org
Hi Andrii,
This helps. Thanks a lot!
Reply all
Reply to author
Forward
0 new messages