{"by":"nickponline","descendants":5,"id":46549333,"kids":[46558296,46560724,46569703,46558246],"score":78,"text":"I deal with a lot of geometry stuff at work with computer vision and photogrammetry, which usually comes from the real world. It&#x27;s seldom clean and neat, and I&#x27;m often trying to find a way to &quot;make it nice&quot; or &quot;make it pretty&quot;. I&#x27;ve always struggled with what that really means formally.<p>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.<p>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 &quot;niceness&quot; or rather the constraints you impose, and goes down the more you impose them. Then you try and minimize A + B or rather H<i>A + (1-H)</i>B where H is a hyper-parameter that controls the relative importance of A and B.<p>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.","time":1767924781,"title":"Show HN: Various shape regularization algorithms","type":"story","url":"https://github.com/nickponline/shreg"}