
A Primer on Bézier Curves – B-Splines - TheRealPomax
http://pomax.github.io/bezierinfo/#bsplines
======
exDM69
Looks like an excellent resource! I had not seen this before, bookmarking it
now.

Bezier curves are immensely useful in graphics, animation and pretty much
everywhere you need interpolation. But to get the most out of them, you need
to know the tricks to manipulate them, e.g. subdivision and calculation of
derivatives.

Nice to see a really thorough resource on one of my favorite methods.

------
jimsmart
Related: There's a Unity3D video on Bezier splines/curves [0] - it's far more
noob than this article, and very good at explaining b-splines from the basics
up. It certainly doesn't have the depth of this article (neither the maths nor
more advanced spline stuff), but some of it is 'practical' (if you have Unity)
and it might make a good primer for those getting started on the subject.

The actual Bezier stuff starts 15-16 mins in.

[0]
[https://www.youtube.com/watch?v=o9RK6O2kOKo](https://www.youtube.com/watch?v=o9RK6O2kOKo)

~~~
TheRealPomax
More education is always more better. Good link!

------
chestervonwinch
The degree `n` B-spline basis function can be obtained (up to scale and
location) by the `n`-fold convolution of the indicator function on [0,1]. It
is also, therefore, the pdf for the sum of `n` uniform random variables, i.e.,
the Irwin-Hall distribution [1].

I have no idea if these facts are useful, but I've always found them
interesting.

[1]:
[https://en.wikipedia.org/wiki/Irwin%E2%80%93Hall_distributio...](https://en.wikipedia.org/wiki/Irwin%E2%80%93Hall_distribution)

~~~
TheRealPomax
interesting counts just as much as useful! I shall dig into this myself.

------
themartorana
It's the way my brain works for sure, but dense material is always harder for
me to get through when it looks dense and is laid out densely. My brain
instantly puts up a hurdle and makes assumptions about the material.

That said, it seems like the entire mathematics and scientific community
disagrees with me :)

------
doppioandante
I would have liked it to be more mathy, the "it seems complicated but it
actually is" followed by an approximate explanation is confusing, and the math
looks like a bit hidden inside the main explanation.

~~~
TheRealPomax
For more detailed maths, wikipedia and actual B-spline articles are your
content of choice. Doing a full analysis of B-splines is out of scope as a
section in a Primer on Bezier curves (as noted in the text, I'd have to write
a separate primer on B-splines instead), so the maths is not _as_ detailed,
and the implementation focuses on code in use by several libraries (like the
JavaScript "bspline.js" or C "tinyspline" libraries).

One note about it being an approximate explanation: it's not, B-Spline maths
can analysed (like Bezier maths) either using calculus, using geometry, or
using algorithm operations, all three being different ways to work out exactly
the same thing. The explanation in this primer only covers the algorithmic
approach of computing the B-spline function as iterative interpolation, but is
functionally equivalent to a more "mathy" approach involving lots of calculus.
Doing so does not give you the information you'd get from symbolic maths to
aid in things like finding normals, tangents, extremities and inflection
points, etc. etc. but for the scope of the section, and given the article it's
part of, that's intentional.

------
melling
I've got this one and a few more resources here:

[https://github.com/melling/ComputerGraphics/blob/master/bezi...](https://github.com/melling/ComputerGraphics/blob/master/bezier.org)

------
KaiserPro
NURBS!

~~~
leftnode
One of my favorite acronyms: Non-Uniform Rational B-Spline. They were very
popular in 3D modeling packages like Lightwave years ago.

Are they still used frequently in 3D modeling?

~~~
gribbly
>They were very popular in 3D modeling packages like Lightwave years ago.

Actually I can't recall Lightwave ever having NURBS, it was all
polygon/subdivision surfaces.

Maya has NURBS, and there is NURBS oriented software like Rhino3d, Blender
also has rudimentary NURBS support.

>Are they still used frequently in 3D modeling?

I believe it's still the standard for anything requiring precision: computer
aided manufacturing/design (CAM, CAD).

~~~
TylerE
Almost all CAD/CAM these days runs on top of the Parasolid geometry kernel.
While Parasolid does have b-spline support, it's mostly truely mathematically
modeled geometry that is then converted to a poly mesh for rendering - but
internally it's all "full precision". It's actually closer to how something
like POV-Ray models, rather than NURBS.

------
cpach
Dupe:
[https://hn.algolia.com/?query=%22A%20Primer%20on%20B%C3%A9zi...](https://hn.algolia.com/?query=%22A%20Primer%20on%20B%C3%A9zier%20Curves%22&sort=byDate&prefix&page=0&dateRange=all&type=story)

~~~
TheRealPomax
No, it really wasn't, you changed the link and title I posted to a completely
different thing by removing the hash for the B-Spline section that I finally
finished adding to the primer about 10 minutes before posting the link, after
having been in request for about 2 years, weeks of research, and days of
writing/programming.

The link was very specifically to
[https://pomax.github.io/bezierinfo/#bsplines](https://pomax.github.io/bezierinfo/#bsplines),
and the title specifically mentioned the fact that it was about B-Splines, not
the base article (because the base article is nearly 70 print pages worth of
content, and the point was to link straight to the spline section near the end
instead of linking people to an article that's been on HN before several
times, but never with this new content, because it didn't exist any of the
previous times).

A lot of people had requested it, and it was worth calling out on its own,
specifically. Instead, by marking it a dupe and _rewriting_ the link, you
completely wasted the effort of posting it because no one will have any idea
the last section is even there. Certainly, some people will have never seen
the entire site, but fragment identifiers in URLs are there for a reason.
Don't strip them out unless you can show the content people get is the same
whether they click on the link with or without the hash. Which for this URL
was absolutely not the case.

So: can you please change this back, the link you rewrote it to is not useful
for the purposes of why this was posted to HN, and the title you picked
doesn't even make sense. This is a link to today's Primer, in 2016, not some
historical tiny document from 2011, which the Primer was five years ago when I
had only just started it.

~~~
cpach
Oh, I see. FWIW, I’m not an admin though. However, I sent them an e-mail
asking them to revert the changes.

Also, from on HN user to another: Thank you for submitting high-quality links
to the site. That’s what makes this site so awesome. Cheers!

~~~
TheRealPomax
ah, I see! cheers!

------
jomamaxx
Nerd Love.

------
userbinator
_If you have JavaScript disabled, you 'll have to enable it, as this book
heavily relies on JS rendering, both for the base content (it's been written
as a React application) and all the interactive graphics, which rely on JS not
just for the user interaction but also for the live-drawing (none of the
graphics in this book are flat images, they're all live-rendered)._

I wouldn't call that a book, but rather an interactive article. I consider a
book something I can save as a PDF, print out, and read without using a
computer.

~~~
abecedarius
I'd like to call this sort of thing a dynabook, though unfortunately that's
taken for a kind of laptop.

~~~
TheRealPomax
Yeah I typically go with "online article", I think the only place I call it a
book is literally in that JS notice, to highlight that we're talking about a
lot of content (roughly 70 print pages worth) instead of the more usual
"several pages max" that people think of when you use the word article.

