Open abey79 opened 3 years ago
This is easier in numpy. You're just moving midpoint towards middlepoint.
midpoint = (line[2:] + line[:-2]) / 2.0
middlepoint = line[1:-1]
line[1:-1] = amount * (midpoint - middlepoint) + middlepoint)
And that's basically it. Set a value for amount
(scalar between 0-1 (though permit negative amounts because it does some cool stuff that causes it to roughen). And allow the user to specify a number of times to apply the smoothing since it nicely propagates.
Discord discussion: https://discord.com/channels/499297341472505858/748589196532514826/815509855749668866
From @tatarize: