2026-07-23 05:27:51 +00:00
|
|
|
#pragma once
|
|
|
|
|
#include "vde/core/polygon.h"
|
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
|
|
namespace vde::boolean {
|
2026-07-23 08:19:24 +00:00
|
|
|
using core::Point2D;
|
|
|
|
|
using core::Polygon2D;
|
2026-07-23 05:27:51 +00:00
|
|
|
|
|
|
|
|
enum class BooleanOp { Union, Intersection, Difference, SymDiff };
|
|
|
|
|
|
|
|
|
|
/// 2D polygon boolean operations (Vatti algorithm)
|
|
|
|
|
/// Currently implemented via a simple edge walking approach for convex polygons
|
|
|
|
|
std::vector<Polygon2D> boolean_2d(const Polygon2D& a, const Polygon2D& b, BooleanOp op);
|
|
|
|
|
|
|
|
|
|
} // namespace vde::boolean
|