[HN Gopher] Show HN: Various shape regularization algorithms
___________________________________________________________________
Show HN: Various shape regularization algorithms
I deal with a lot of geometry stuff at work with computer vision
and photogrammetry, which usually comes from the real world. It's
seldom clean and neat, and I'm often trying to find a way to "make
it nice" or "make it pretty". I've always struggled with what that
really means formally. That led me to shape regularization (a
technique used in computational geometry to clean up geometric
data). CGAL had implemented a few methods for that, but there are
more ways to do it, which I thought were nice. Also I typically
work in Python, so it was nice to have a pure Python library could
handle this. I struggled to get the first version working as a QP.
At a high level most of these boil down to minimizing a cost A + B
where A is the cost associated the geometry and goes up the more
you move it, and B is the cost associated "niceness" or rather the
constraints you impose, and goes down the more you impose them.
Then you try and minimize A + B or rather H _A + (1-H)_ B where H
is a hyper-parameter that controls the relative importance of A and
B. I needed a Python implementation so started with the examples
implemented in CGAL then added a couple more for snap and joint
regularization and metric regularization.
Author : nickponline
Score : 30 points
Date : 2026-01-09 02:13 UTC (20 hours ago)
(HTM) web link (github.com)
(TXT) w3m dump (github.com)
| marquesine wrote:
| This is the thing I wished existed somewhere and didn't know how
| to search for.
|
| I'm a land surveyor, and another topic I'm interested in is
| automatic label (text) positioning around shapes, possible
| strategies, what works best, including design principles and how
| to keep it non-cluttered for the user.
| Fraterkes wrote:
| Hey, you've probably seen these already, but Redblobgames has a
| great series of posts about creating good labels for maps:
| https://www.redblobgames.com/blog/2024-08-20-labels-on-maps/
| https://www.redblobgames.com/blog/2024-10-09-sdf-curved-text...
| (There's a few others too)
___________________________________________________________________
(page generated 2026-01-09 23:00 UTC)