Journal

/

Geometry kernel for building design

Written in 2026, backdated to 2022.

Joined the real estate firm mid-migration (C# to Java). The project, lacking a geometry kernel, had stalled.

Building geometries are small, mostly 2D; no frame budgets or low-latency constraints. Numerical parity with Rhino—the tool the architects had used previously—was mandatory. They supplied test cases and tolerances.

Implemented polygon clipping with Sutherland–Hodgman. No drama.

Fortune’s algorithm for Voronoi diagrams was a missed opportunity. Implemented the beach line using a linear list instead of the balanced binary tree. Planned to return to this. Never had the chance.

Polygon offsets had always been difficult. Z and H-shaped floor plans produced self-intersections that even Rhino mishandled. Briefly explored straight skeletons—couldn’t separate edge cases from the core algorithm; hesitated to implement under time pressure. Instead, implemented a custom solver that fixed invalid loops by backtracking.

The problem of finding the largest inscribed rectangle surprised me. No single algorithm covered both convex and concave shapes. Brute-force grid search yielded 12% more buildable area—but not the true optimum.

Binary Space Partitioning (BSP) produced results numerically incompatible with those of Rhino’s BLAS-based linear algebra. Replaced BSP trees with vector-based structures and JBLAS.

Migration resumed. No regressions in the building layouts reported.