Smoothing a hand-drawn curve

后端 未结 6 1315
孤城傲影
孤城傲影 2020-11-30 19:06

I\'ve got a program that allows users to draw curves. But these curves don\'t look nice - they look wobbly and hand-drawn.

So I want an algorithm that will automatic

6条回答
  •  情深已故
    2020-11-30 19:25

    Kris's answer is a very good port of the original to C#, but the performance isn't ideal and there are some places where floating point instability can cause some issues and return NaN values (this is true in the original code too). I created a library that contains my own port of it as well as Ramer-Douglas-Peuker, and should work not only with WPF points, but the new SIMD-enabled vector types and Unity 3D also:

    https://github.com/burningmime/curves

提交回复
热议问题