Questions tagged [bezier]

A Bézier curve is a parametric curve frequently used in computer graphics and related fields. Generalizations of Bézier curves to higher dimensions are called Bézier surfaces, of which the Bézier triangle is a special case.

A Bézier curve is a parametric curve frequently used in computer graphics and related fields. Generalizations of Bézier curves to higher dimensions are called Bézier surfaces, of which the Bézier triangle is a special case.

In vector graphics, Bézier curves are used to model smooth curves that can be scaled indefinitely. "Paths," as they are commonly referred to in image manipulation programs, are combinations of linked Bézier curves. Paths are not bound by the limits of rasterized images and are intuitive to modify. Bézier curves are also used in animation as a tool to control motion.

Bézier curves are widely used in computer graphics to model smooth curves. As the curve is completely contained within the convex hull of its control points, the points can be graphically displayed and used to manipulate the curve intuitively. Affine transformations such as translation, and rotation can be applied on the curve by applying the respective transform on the control points of the curve. Furthermore, the convex hull of the control points acts as a bounding region for quick visibility tests; if the convex hull is not visible, then the Bézier curve is also not.

Quadratic and cubic Bézier curves are most common; higher degree curves are more expensive to evaluate. When more complex shapes are needed, low order Bézier curves are connected together. This is commonly referred to as a "path" in vector graphics standards (like SVG) and vector graphics programs (like Adobe Illustrator and Inkscape). To guarantee smoothness, the control point at which two curves meet must be on the line between the two control points on either side.

Bézier curves can be Linear (order 1), Quadratic (order 2), Cubic (order 3, the most common form in drawing and graphics software), and of higher order (more than 3).

Important Links:

1289 questions
14
votes
2 answers

Joining bezier curves

I have a problem. Suppose we have a single cubic bezier curve defined by four control points. Now suppose, the curve is cut from a point and each segment is again represented using cubic bezier curves. So, now if we are given two such beziers B1 and…
Aarkan
  • 3,811
  • 6
  • 40
  • 54
14
votes
2 answers

how to compute the control points for a smooth path given a set of points?

I am using UIBezierPath, but this question concerns control points for the paths, not the drawing. Given a set of points, I can render a path. However, I have not been able to figure out how to calculate the control points to have a smooth line like…
akaru
  • 6,299
  • 9
  • 63
  • 102
14
votes
3 answers

Is it possible to thicken a quadratic Bézier curve using the GPU only?

I draw lots of quadratic Bézier curves in my OpenGL program. Right now, the curves are one-pixel thin and software-generated, because I'm at a rather early stage, and it is enough to see what works. Simply enough, given 3 control points (P0 to P2),…
zneak
  • 134,922
  • 42
  • 253
  • 328
14
votes
1 answer

How to create a curved SVG path between two points?

I need to draw a symmetrically curved line between the centers of two circles.
WenukaGTX
  • 155
  • 1
  • 1
  • 9
14
votes
4 answers

Pixel by pixel Bézier Curve

The quadratic/cubic bézier curve code I find via google mostly works by subdividing the line into a series of points and connects them with straight lines. The rasterization happens in the line algorithm, not in the bézier one. Algorithms like…
nebuch
  • 6,475
  • 4
  • 20
  • 39
14
votes
1 answer

Draw Quadratic Curve on GPU

My task is to render quadratic Bezier curve (path) via Stage3d (Adobe Flash) technology, which have no any extensions for that drawing out-of-the box (while OpenGl have it, as I know). Yea, there is a Starling-Extension-Graphics, but it uses simple…
Ilya
  • 181
  • 1
  • 7
14
votes
3 answers

Algorithm for path simplification and smoothing of 2D trajectories

I'm searching for an algorithm for path simplification and smoothing for 2D trajectories. So I have a ordered list of 2D points. These points should be simplified, e.g. with the Ramer–Douglas–Peucker algorithm. But the output must be smooth, so the…
Thomas W.
  • 2,134
  • 2
  • 24
  • 46
14
votes
3 answers

Algorithm for inserting points in a piecewise-cubic Bézier path

I'm looking for an algorithm to insert a new control point on a Bézier curve, without deforming. Does anybody know a library or reference for Bézier algorithms (insertion, optimize, de Casteljau ...)?
sorush-r
  • 10,490
  • 17
  • 89
  • 173
13
votes
1 answer

Draw an Inset NSShadow and Inset Stroke

I have an NSBezierPath and I want to draw in inset shadow (similar to Photoshop) inside the path. Is there anyway to do this? Also, I know you can -stroke paths, but can you stroke inside a path (similar to Stroke Inside in Photoshop)? Update…
Alexsander Akers
  • 15,967
  • 12
  • 58
  • 83
13
votes
2 answers

Draw SVG Bezier curve

I have an array of control points that represent a high-order Bezier curve. How can I draw this curve using a single SVG-path? UPD: For example, I have a set of points: (x1, y1) (x2, y2) (x3, y3) (x4, y4) (x5, y5).How SVG-path will look like in the…
Legotin
  • 2,378
  • 1
  • 18
  • 28
13
votes
2 answers

Cocos2d-x - Error drawing cubic bezier curves

I'm trying to draw a cubic bezier path with a certain thickness, but the curve appears like a sequence of disconnected segments (3 in my case). This is a screenshot (the blue circles are the control points of the curve). I noticed that the same…
Joe Aspara
  • 1,137
  • 1
  • 13
  • 26
13
votes
3 answers

Calculate a 2D spline curve in R

I'm trying to calculate a Bezier-like spline curve that passes through a sequence of x-y coordinates. An example would be like the following output from the cscvn function in Matlab (example link): I believe the (no longer maintained) grid package…
Marc in the box
  • 11,769
  • 4
  • 47
  • 97
13
votes
3 answers

Approximating data with a multi segment cubic bezier curve and a distance as well as a curvature contraint

I have some geo data (the image below shows the path of a river as red dots) which I want to approximate using a multi segment cubic bezier curve. Through other questions on stackoverflow here and here I found the algorithm by Philip J. Schneider…
josch
  • 6,716
  • 3
  • 41
  • 49
13
votes
2 answers

n-th order Bezier Curves?

I've managed to implement quadratic and cubic Bezier curves.They are pretty straightforward since we have a formula. Now I want to represent an n-th order Bezier curve using the generalization: Where and I'm using a bitmap library to render the…
Jonas
  • 1,019
  • 4
  • 20
  • 33
13
votes
2 answers

Bezier Cubic Curves: moving with uniform acceleration

Let's say I have a Bezier curve B(u), if I increment u parameter at a constant rate I don't obtain a costant speed movement along the curve, because the relation between u parameter and the point obtained evaluating the curve is not linear. I've…
Heisenbug
  • 38,762
  • 28
  • 132
  • 190