A desktop tool that takes a set of points, builds their convex hull, and finds the largest axis-aligned rectangle that fits inside it.
The interesting part is the split: the geometry runs in C#, the optimisation runs in
Python. The WinForms app collects the points and computes the hull with Graham's scan,
writes the hull as a set of half-plane constraints to src/data.json, and hands it to
src/cvx_optimization.py, which solves for the maximum inscribed rectangle with CVXPY
and returns the result for the app to draw.
| Path | What it does |
|---|---|
GrahamScan.cs |
Convex hull by Graham's scan |
AlgorithmBase.cs |
Shared algorithm scaffolding |
Form1.cs |
Canvas, point input, rendering of hull and rectangle |
src/cvx_optimization.py |
Maximum inscribed rectangle as a convex program (CVXPY) |
src/data.json |
Hull constraints passed between the two halves |
pip install cvxpyOpen ConvexHullRectangleApp.csproj in Visual Studio and run. Click to place points;
the hull and the inscribed rectangle are redrawn on each change.
Computational geometry course project, Taras Shevchenko National University of Kyiv.