Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/rulyotano/wpf-bezier-interpolation

Interpolate 2D points, usign Bezier curves in WPF
https://github.com/rulyotano/wpf-bezier-interpolation

2d bezier-curves interpolation wpf

Last synced: 1 day ago
JSON representation

Interpolate 2D points, usign Bezier curves in WPF

Awesome Lists containing this project

README

        

# WPF-Bezier-Interpolation

This is a sample project for the CodeProject article Interpolate 2D points, usign Bezier curves in WPF. I suggest reading the article.

[Live JS Demo](https://rulyotano.com/demos/bezier)

☝️ you can play a bit with the live JS demo. It is the same algorithm implemented for JS.

![Alt text](interpolation-bezier-curves.gif?raw=true "The sample running")

## What is it about?

The main goal of this project is provide a control that, given a sorted collection of points draw a curve for interpolate those points (the curve will pass for each point).

Besides that, another goal is that this control could be used along the MVVM pattern, then when each point's position changes, or when any point is added or removed, the control is refreshed.

In this example app, the points can be dragged by the user, and also can be draw a closed or open curve.

## UPDATE 1.0:
Also was added the adding points in the best curve placement behavior. Now when clicking in some canvas locations, a point is added to the curve and inserted at the right point.

## UPDATE 2.0:
The math related to the interpolation has been refactored to a new .Nuget package. In this way becomes more ease to use it in other projects. This packages is [Rulyotano.Math.Interpolation.Bezier](https://www.nuget.org/packages/Rulyotano.Math.Interpolation.Bezier) and the code can be found at [Github Project](https://github.com/rulyotano/Rulyotano.CrossCutting/tree/main/src/Rulyotano.Math.Interpolation.Bezier).

## Want to contribute?
You are welcome!