designcoding
About Table of Contents Keywords Monthly Archive
Support designcoding!

Bezier Function Extractor

December 26, 2023 | Algorithms
#bezier-curve #grasshopper #rhino-python

Today’s curve is the beautiful Bezier curve. A series of linear interpolations between the coordinates of control points describe a Bezier curve. So, I created a simple tool in Grasshopper called Bezier Function Extractor to experiment with this elegant construction.

Bezier Function Extractor animation

In the linear form (degree 1) the linear interpolation between 2 points (P1 and P2). The point at parameter t (0<= t <= 1); Q = tP1 + (1-t)P2. In the second degree, we need three points (P1, P2, and P3). The two linear interpolations between P1-P2 and P2-P3 would create two more points, Q1, and Q2. The resulting point on the Bezier curve is the linear interpolation between Q1 and Q2. Similarly, in degree 3 (mostly used degree in CAD) we need 4 points (P1, P2, P3, and P4). This time we repeat the same process three times to get the point at parameter t.

Bezier Function Extractor bezier-curve, grasshopper

The above figure explains this process (Bezier – de Casteljau algorithm). Finally, below is the general formula that utilizes Bernstein polynomials and binomial functions to generate any degree Bezier function.

Bezier Function Extractor rhino-python, bezier-curve

This Grasshopper definition gives the formula for the degree-3 Bezier curve with four given coordinates of the control points. There are three Python components in the definition. The first one is a fast degree-3 formula generator from the four points. It uses the coordinates of the four control points and outputs the x=f(t), y=g(t), and z=h(t) functions. Then, the second Python component is a General Extractor which generates the formula for any degree. The third one is an evaluator, showing the point on a given t parameter with given, f, g, and h functions. Therefore, it is proving the others and mimicking the function of the Evaluate Curve component in Grasshopper. I made the definition with the help of the native Grasshopper components in Rhinoceros 7. So, no external add-on is necessary.

Bezier Function Extractor Grasshopper definition

You can check the de Castaljau algorithm in my previous post here.

Grasshopper definition (GH)Download
Grasshopper definition (GH)Download

Cite this post

Yazar, T. (2023, December 26). Bezier Function Extractor. designcoding. Retrieved August 24, 2026, from https://www.designcoding.net/bezier-function-extractor/

Related Posts

B-Spline Construction

January 25, 2024

I have been studying the Bezier-De Casteljau algorithm for several years. Last week, I finally managed to understand and implement B-Spline Construction in Rhino and Grasshopper Python code, using the Cox-De Boor algorithm. This algorithm calculates the effect of control points on a B-Spline with many control points. After this, I am not limited to the degree+1 control points. This animation shows both algorithms working together. This Rhino Python code in a Grasshopper definition can handle three tasks. The first…

Cubic Bézier Curve with Rhino Python

April 30, 2018

Below is the Python code you can run in Rhino, that draws a cubic Bézier curve (degree 3). As you can see, the Rhino Python code is very slow and inefficient because we calculate every point with lots of computations. Instead, we can use the spline formulae to make this quicker but I wanted to show that the mathematical construction is parallel to the geometric one. This is a nested set of linear interpolations. In fact, the linterp function in…

The Flow Earring

January 9, 2012

I developed this code 13 years ago while learning the fundamentals of Visual Programming in Grasshopper. I was studying the ways of NURBS curve geometry. The animation shows the construction process of several Bezier Curves. In 2024, I optimized the code and added the thickness. The Flow Earring project showcases the beauty of parametric curves. The Grasshopper definition displays the animated construction process and the variations. The flow of the curve and its variations still look fascinating, reminding me of…

Calculating a Guitar’s Surface Area with Bézier Curves

August 27, 2024

Below is the first paper of my son, Mete Yazar. It is about a mathematical and geometric exercise of calculating the surface area of an arbitrary shape (a classical guitar’s body panel). He did a good job in utilizing Bezier/de Casteljau curves and generating the parametric equations of the piecewise curve. I helped him to validate the results by using rhinoceros CAD software. Therefore, it seems that his calculations are correct. In this paper, we attempted to calculate a guitar’s…

Dual Polyhedra in Grasshopper

October 7, 2025

Exploring dual polyhedra in Grasshopper is an interesting topic. In this post, I try to generate the dual of any polyhedron using Rhino Python and possibly Grasshopper. I developed this code for Rhino Python earlier here, and now I have converted it into a Grasshopper-Python component for better usability. I start the process by breaking the polyhedron into individual faces and gathering the corner points of each face. These points become the vertices of the dual polyhedron. Then, for each…

  • Chapters

    • Algorithms
    • Discourses
    • Fabrications
    • Studios
  • Explore

    • All Keywords
    • Table of Contents
    • Monthly Archive
    • #polyhedra
    • #parametric-surface
    • #robot
    • #tessellation
    • #boolean
    • #kuka-prc
    • #dome
    • #parametric-curve
    • #design-object
    • #image-sampler
    • #linear-algebra
    • #terrain
    • #sandblasting
    • #stone
    • #animation
    • #cycloid
    • #art
    • #aperiodic
    • #tiling
    • #tutorial
  • Search

  • Support designcoding!

  • Enjoying designcoding? Support me on Patreon to keep it growing. Thank you!

  • copyright 2026 designcoding.net | about | privacy policy | end user license agreement