Tech News
← Back to articles

Show HN: Various shape regularization algorithms

read original related products more articles

shreg - Shape Regularization

A Python implementation of various shape regularization algorithms for regularizing line segments and closed contours.

Shape regularization is a technique used in computational geometry to clean up noisy or imprecise geometric data by aligning segments to common orientations and adjusting their positions to create cleaner, more regular shapes.

Features

Segment Regularization : Align line segments to common angles and offsets using quadratic programming optimization

: Align line segments to common angles and offsets using quadratic programming optimization Snap Regularization : Connect nearby endpoints to create watertight polygons and meshes

: Connect nearby endpoints to create watertight polygons and meshes Metric Regularization : Constrain segment dimensions - equal lengths, length quantization, and equal spacing

: Constrain segment dimensions - equal lengths, length quantization, and equal spacing Contour Regularization : Simplify closed polygons by aligning edges to principal directions

: Simplify closed polygons by aligning edges to principal directions T-Junction Detection : Snap endpoints onto segment interiors for proper connectivity

: Snap endpoints onto segment interiors for proper connectivity Flexible Configuration : Control maximum angle and offset tolerances

... continue reading