BasicFit, a curve fitting algorithm to generate a Bézier Curve from my Polygon2D brush

While it is currently under review by insert name here ;-), I would like to share my latest work here; just for funzies.

Mind you, I’m not a mathematician by any means, but you still might have a very good purpose for this curve-fitting algorithm somewhere in your game. I dubbed it BasicFit, because that’s a pun when you live in a country that has that fitness franchise:

Aside from BasicFit (currently under review), I’ve also been wanting to talk about Geometry2DUtil, which I’ve been using to make it more easy to cut holes, detect closest points on the line segment of Curve2D and similar stuff:

I ship these classes under MIT license, for what that’s worth… Here’s hoping it makes someone here a little happy!

1 Like

Those are cool, I’m just not sure what I would use them with.

1 Like

You never know. I use it for painting fills, strokes and collision polygons.

You could calculate a Path2D around a dynamically generated island too, I guess.

Think of it like this. If someone searches the web for this stuff, now there’s a bigger chance to find it via the forum.

1 Like

It reminds me a lot of the Gravity Ace level editor, shown in the second video. I just found this the other day, and it’s really cool. So it could be used for something like that.

1 Like

Thing is. Scalable Vector Shapes 2D became a big solve the world plugin, showcased mostly for art drawing in engine… But if I were an experienced game dev I would probably want to just cherry pick some useful stuff and not have a big old dependency added to my project.

Also. I just want to make the flash games I used to play online, and make games fit any screen without blur or raspy edges.. and x and y and solve the world. :rofl:

1 Like