Sweepline
Fortune's algorithm for Voronoi diagram generating on the plane. Intended for runtime speed and careful handling of corner cases.
Install / Use
/learn @tomilov/SweeplineREADME
sweepline
Fortune's algorithm for Voronoi diagram generating on the plane. Intended for runtime speed and careful handling of corner cases.
How to use:
using value_type = double;
struct point
{
value_type x, y;
bool operator < (point const & p) const
{ return std::tie(x, y) < std::tie(p.x, p.y); }
};
using points = std::vector< point >;
using site = typename points::const_iterator;
using sweepline_type = sweepline< site, point, value_type >;
sweepline_type sweepline_{eps};
points points_;
// fill points_ with data
std::sort(std::begin(points_), std::end(points_));
sweepline_(std::cbegin(points_), std::cend(points_));
// sweepline_.vertices_ - resulting vertices
// sweepline_.edges_ - resulting edges
Related Skills
node-connect
346.4kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
107.2kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
346.4kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
346.4kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
