Simplification of a 2D-polyline or a 3D-polyline