bow-simulation / virtualbow

Software for designing and simulating bows
http://www.virtualbow.org/
GNU General Public License v3.0
23 stars 3 forks source link

Consider alternatives to standard cubic splines for width and height interpolation #108

Closed stfnp closed 5 years ago

stfnp commented 5 years ago

In GitLab by spfeifer on Apr 18, 2018, 16:41

A method with a more 'local' character compared to the standard cubic splines used currently would be good. I.e. changing single data points should ideally only alter the curve in the neighborhood of those points. This should solve or improve problems like this one mentioned in issue #88:

  • When defining the thickness and width, the auto-curving makes extreme stuff (which caused a negative thickness for me), I had to define the same w/h for several points around to "straighten it out"

Optionally, a monotonicity preserving method would make it even easier to stay in the valid domain: If all supplied widths/heights are positive, the resulting interpolated values will be as well.

Akima Interpolation

Advantages: Apparently computationally efficient and doesn't tend to oscillate as much as standard splines, because it only uses a few local points for determining each cubic section. See example 2 on this website: http://valdivia.staff.jade-hs.de/akima.html

http://www.iue.tuwien.ac.at/phd/rottinger/node60.html

http://200.17.213.49/lib/exe/fetch.php/wiki:internas:biblioteca:akima.pdf

Variant for preserving the monotonicity of the data points:

https://www.osti.gov/servlets/purl/5328033

Cubic Hermite Spline

Combined with e.g. finite difference derivatives.

https://en.wikipedia.org/wiki/Cubic_hermite_spline

Monotone Cubic Interpoaltion

Addition to cubic hermite splines that preserves monotonicity. Seems like the best and most simple solution right now.

https://en.wikipedia.org/wiki/Monotone_cubic_interpolation

Interactive demo: http://www.stellingconsulting.nl/Spline_data_interpolation_tool.html

Implementation (Java): https://android.googlesource.com/platform/frameworks/base/+/master/core/java/android/util/Spline.java

stfnp commented 5 years ago

In GitLab by spfeifer on May 17, 2018, 21:12

closed via commit 54ac0d918cc43ccc2d989342681259ccac10bb65