From bc9565609d004ad69636231de195a0197bebff27 Mon Sep 17 00:00:00 2001 From: Sadeep Madurange Date: Wed, 19 Aug 2026 05:58:52 +0800 Subject: Minor update. --- _log/2d-geometry-kernel.md | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) (limited to '_log/2d-geometry-kernel.md') diff --git a/_log/2d-geometry-kernel.md b/_log/2d-geometry-kernel.md index e6c67e2..e3594f0 100644 --- a/_log/2d-geometry-kernel.md +++ b/_log/2d-geometry-kernel.md @@ -6,10 +6,10 @@ layout: post Written in 2026, backdated to 2022. -Real estate firm decided to rewrite the building design system from C# to Java. -Building geometries are small—mostly 2D. No frame budgets or low-latency -constraints. Numerical parity with Rhino was mandatory. Architects and -structural engineers supplied test cases and floating-point tolerances. +Firm decided to rewrite the building design system from C# to Java. Geometries +are small—mostly 2D. No frame budgets. Numerical parity with Rhino was +mandatory. Architects, structural engineers supplied test cases and +floating-point tolerances. Implemented polygon clipping with Sutherland–Hodgman. No drama. @@ -17,13 +17,14 @@ Fortune's algorithm 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. -Z and H-shaped floor plan offsets produced self-intersections that even Rhino -mishandled. Could not get straight skeletons working under time pressure. Wrote -a custom solver that fixed invalid loops by backtracking instead. +Couldn't get straight skeletons working. Even Rhino mishandled +self-intersections Z and H-shaped floor plan offsets produced. Wrote a custom +solver that fixed invalid loops by backtracking. -Problem of finding the largest inscribed rectangle was surprisingly difficult. -No single algorithm covered both convex and concave shapes. Brute-force grid -search yielded 12% more buildable area—but not the true optimum. +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. + +BSP library proved numerically incompatible with Rhino. Replaced BSP trees with +vector-based primitives and JBLAS instead. All tests passed. -Java BSP library proved numerically incompatible with Rhino. Replaced BSP trees -with vector-based primitives and JBLAS instead. -- cgit v1.2.3