TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

A Primer on Bézier Curves

197 pointsby s1291over 3 years ago

18 comments

samwillisover 3 years ago
Oh I do love a Bézier Curve post, the math and geometry behind them is just so beautiful.<p>Bartosz Ciechanowski&#x27;s one from last year is my favourite, a little less math heavy and goes on to explain other curves and surfaces: <a href="https:&#x2F;&#x2F;ciechanow.ski&#x2F;curves-and-surfaces&#x2F;" rel="nofollow">https:&#x2F;&#x2F;ciechanow.ski&#x2F;curves-and-surfaces&#x2F;</a>
评论 #30104044 未加载
评论 #30102353 未加载
PaulHouleover 3 years ago
I used to think it was my fault that I struggled to draw things with Bézier curves but then I took a look at the resource packs for a game I respected (which had a flat art style that would have been a good fit for vectors) and found that my favorite character designers didn&#x27;t know how to draw anime characters with Bézier curves either.<p>That is, no matter how much art you know or math you know it is awkward to draw things with Bézier curves and it&#x27;s a bit of a tragedy that NURBS and other curve families that are more intuitive to work with haven&#x27;t caught on.
评论 #30104658 未加载
评论 #30103650 未加载
评论 #30109059 未加载
评论 #30103988 未加载
评论 #30107130 未加载
评论 #30109297 未加载
herodotusover 3 years ago
Good article but I found this remark at the start interesting: &quot;The first of these are as easy to draw as they are easy to make a computer draw. Give a computer the first and last point in the line, and BAM! straight line. No questions asked.&quot;<p>Ha! Of course every graphics API makes it easy, but there is much going on under the hood. (Um, do GPU&#x27;s have hoods?) See &quot;Bresenham&#x27;s algorithm&quot;: <a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Bresenham&#x27;s_line_algorithm" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Bresenham&#x27;s_line_algorithm</a>
评论 #30103007 未加载
评论 #30103094 未加载
评论 #30101892 未加载
zajio1amover 3 years ago
There is a trivial interpretation of Bezier curves that helped me to understand them:<p>Quadratic Bezier is just trajectory of a point with initial velocity and constant acceleration.<p>Cubic Bezier is just trajectory of a point with initial velocity and acceleration, and constant change of acceleration.<p>Direction to control points are just initial&#x2F;final velocity.
评论 #30106791 未加载
评论 #30104242 未加载
chriswarboover 3 years ago
Norman J Wildberger has a series of videos about Bézier curves (referring to them as &quot;de Casteljau Bézier&quot;, or dCB, curves) <a href="https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=6LtMKObyKMs" rel="nofollow">https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=6LtMKObyKMs</a><p>He&#x27;s got hundreds of videos, from elementary school subjects up to research seminars, and they usually provide interesting perspectives even for familiar subjects, since he always tries to avoid using infinite sets, irrational numbers, limits, etc. (which he &quot;doesn&#x27;t believe in&quot;)
评论 #30101818 未加载
nayukiover 3 years ago
This video tutorial is also good: <a href="https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=aVwxzDHniEw" rel="nofollow">https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=aVwxzDHniEw</a>
评论 #30103543 未加载
评论 #30101605 未加载
pickledcodsover 3 years ago
Slightly related: Closed Continuous Bézier Curves with on-curve control-points for a Much more intuitive interaction. It is also used to fit curves into arbitrary outlines like country&#x2F;region borders.<p>The project is heavily under construction, however the interactive examples are functional. The examples are intended for desktop, but should work with touchscreens.<p><a href="https:&#x2F;&#x2F;rockingship.github.io&#x2F;ccbc&#x2F;README.html" rel="nofollow">https:&#x2F;&#x2F;rockingship.github.io&#x2F;ccbc&#x2F;README.html</a>
TheRealPomaxover 3 years ago
Always nice to see folks enjoying the primer - if anyone runs into issues with it, feel free to head on over to <a href="https:&#x2F;&#x2F;github.com&#x2F;Pomax&#x2F;BezierInfo-2&#x2F;issues" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;Pomax&#x2F;BezierInfo-2&#x2F;issues</a> and report your findings so we can improve things together.
评论 #30103453 未加载
andrewncover 3 years ago
So, let&#x27;s say I want to implement these (or other) curves into a drawing program. How do I go about doing that? I mean to say, I want to implement a brush on canvas type interface - how do Bézier curves fit into that?<p>Do I collect points when mouse is down and build a curve with those points? Do I get some other path information and rasterize?<p>I&#x27;m trying to write my own drawing program (for fun) but given my lack of background in this I feel myself floundering.
评论 #30108827 未加载
评论 #30105218 未加载
tpoacherover 3 years ago
This is still the best resource I have come across for Bezier curves, B-splines and Nurbs:<p><a href="https:&#x2F;&#x2F;pages.mtu.edu&#x2F;~shene&#x2F;COURSES&#x2F;cs3621&#x2F;NOTES&#x2F;" rel="nofollow">https:&#x2F;&#x2F;pages.mtu.edu&#x2F;~shene&#x2F;COURSES&#x2F;cs3621&#x2F;NOTES&#x2F;</a><p>OP&#x27;s primer looks very good too though. I look forward to going throught it properly.
robinjhuangover 3 years ago
This post helped me so much when I was using the graphviz library. I was trying to use the layout functions in graphviz for another tool, and graphviz spits out layout in bezier curve points. I was plotting the points directly, and didn&#x27;t realize I needed to interpolate the actual points of the curve. This post helped immensely.
counternotionsover 3 years ago
Related, for a practical application of Bézier curves, they can be used to simulate human-like mouse movements to prevent bot detection (ie. aimbots, web scraping): <a href="https:&#x2F;&#x2F;github.com&#x2F;vincentbavitz&#x2F;bezmouse" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;vincentbavitz&#x2F;bezmouse</a>
dtjbover 3 years ago
Unrelated but similar, <a href="https:&#x2F;&#x2F;blog.maximeheckel.com&#x2F;posts&#x2F;cubic-bezier-from-math-to-motion&#x2F;" rel="nofollow">https:&#x2F;&#x2F;blog.maximeheckel.com&#x2F;posts&#x2F;cubic-bezier-from-math-t...</a>.<p>Includes hands-on examples to help understand the math behind bezier curves.
cpachover 3 years ago
Previously: <a href="https:&#x2F;&#x2F;hn.algolia.com&#x2F;?dateRange=all&amp;page=0&amp;prefix=true&amp;query=pomax%20curves&amp;sort=byDate&amp;type=story" rel="nofollow">https:&#x2F;&#x2F;hn.algolia.com&#x2F;?dateRange=all&amp;page=0&amp;prefix=true&amp;que...</a>
评论 #30103005 未加载
sydthrowawayover 3 years ago
I would forget Bezier and go straight to Catmull Rom. They&#x27;re convertible.
评论 #30101649 未加载
评论 #30103034 未加载
jacquesmover 3 years ago
I worked a lot with different curve generating algorithms when I was working in sail CAD design. If you can, avoid Bezier curves and use Splines. Far more predictable and much easier to construct with.
laurensrover 3 years ago
Is it just me or do the sliders lose focus after the slightest change? This prevents me from dragging the slider to different values using my cursor to view the changes smoothly.
评论 #30103018 未加载
phkahlerover 3 years ago
There is a nice C++ (GPLv3+) implementation of a lot of these algorithms in Solvespace here:<p><a href="https:&#x2F;&#x2F;github.com&#x2F;solvespace&#x2F;solvespace&#x2F;blob&#x2F;master&#x2F;src&#x2F;srf&#x2F;ratpoly.cpp" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;solvespace&#x2F;solvespace&#x2F;blob&#x2F;master&#x2F;src&#x2F;srf...</a><p>I&#x27;ll be having a read of this to see if we can improve on some of these. In particular I&#x27;ve wanting to add curve-curve intersection as in section 29:<p><a href="https:&#x2F;&#x2F;pomax.github.io&#x2F;bezierinfo&#x2F;#curveintersection" rel="nofollow">https:&#x2F;&#x2F;pomax.github.io&#x2F;bezierinfo&#x2F;#curveintersection</a><p>I had already considered that exact approach, but there are cases (in CAD anyway) where portions of 2 curves may exactly overlap. In that case we&#x27;d want to identify the overlapping region and split the 2 curves into 3. These special cases might seem like corner cases and they are, but they come up in practice more than I&#x27;d like.
评论 #30102675 未加载