Skip to main content
Share Your Experience: Take the 2024 Developer Survey
15 votes

Algorithm to find the center of a Bezier curve

Bézier curves are mathematical entities and have no clearly defined center. One can in fact define many different things as the center of the Bézier curve. I have tried to depict some of the possible ...
joojaa's user avatar
  • 8,437
10 votes

How to raytrace Bezier surfaces?

is it a total pipe dream to hope to solve the Ray/Bezier-surface intersection algebraically Yes, it's a pipe dream. A bicubic Bezier patch is an algebraic surface of degree 18. To intersect a ray ...
bubba's user avatar
  • 348
6 votes
Accepted

Determining Rational Quadratic Bezier Curve Weights for Circle

Check out the section on Circular Arcs and Circles, from Ching-Kuang Shene's excellent computational geometry course notes: [G]iven three control points P0, P1 and P2 such that P0P1 = P1P2 holds, if ...
gilgamec's user avatar
  • 901
5 votes
Accepted

Apply distortion to Bézier surface

Edit: changed the answer according to new images and clarification. for every control point p(k, n) p'(k, n) = ( p(k, n) - p(k) ) * d * l(k) + p(k, n) where <...
Cem Kalyoncu's user avatar
4 votes
Accepted

Bezier Curve Tool Controlled by Mouse

Instead of using cubic Bezier spline, you should use cubic Hermite spline. For cubic Hermite curve you specify the segment end points and tangents, which is what you then control in the tool. Hermite ...
JarkkoL's user avatar
  • 3,636
4 votes

Does this 3D rendering method exist? How is it called? Is there any C++ algorithm for it?

Yes, such rendering exists. It is called a parametric surface and there are several methods you can render such entities. In this case you are talking of bezier patches. Turn the object into enough ...
joojaa's user avatar
  • 8,437
3 votes

Join two bezier curves so that the result is two-times continuously differentiable

For 2 bezier curves to connect and be continuous at all, the last control point of the first curve (C in your case) must be the same as the first control point of the next curve (D). So c3 has to ...
user1118321's user avatar
  • 3,421
3 votes

Does this 3D rendering method exist? How is it called? Is there any C++ algorithm for it?

The 1994 game Ecstatica and its 1997 sequel rendered ellipsoid segments instead of triangles, but I don't think anyone else has ever used this exact technique. Direct raytracing of Bézier patches was ...
Dan Hulme's user avatar
  • 6,830
2 votes

Silhouette curve for isometric surface of revolution

The silhouette curve of a quadric surface is a conic (ellipse, parabola, hyperbola, etc.). Suppose you have the quadric $\mathbf{X}^T \mathbf{M} \mathbf{X} = 0$ and your eye is at the point $\mathbf{Y}...
bubba's user avatar
  • 348
2 votes
Accepted

First steps towards CAD standard curve fitting

Since you have a limited set of tools you are not actually doing a classical fitting. What you have is a discrete problem. And since you are looking for a somewhat easily drawn fit, no more than twice ...
joojaa's user avatar
  • 8,437
2 votes
Accepted

B spline curve generation in Python

In line 15 use the half-open interval, i.e., if u>=t[0][i] and u<t[0][i+1]: Otherwise, at knot values, you evaluate two basis functions at the k=1 basis ...
Iddo Hanniel's user avatar
2 votes
Accepted

How do I extrude a 2D Bezier curve representation into a 3D solid using Python?

You can't create a solid by extruding a single curve or set of curves. Even if they are closed. Think about a circle on on the XY plane. If you extrude the circle along the Z axis you have an uncapped ...
Joshua Kennedy's user avatar
2 votes

Continuity of parametric and geometric continuity

I would rather draw the $G_1$ example something like this: This makes it clear that $t_2$ and $t_3$ are parallel, but have different lengths in general. (They both start at the same point, but $t_3$ ...
Nathan Reed's user avatar
2 votes
Accepted

How to get coordinates of opposite direction from mouse release point relative to a point?

Assuming you're doing spline curves: Let p be the point at the end of your curve (the one marked with a solid square above). Let h be your handle point (the one denoted as such). The vector from p to ...
jh100's user avatar
  • 136
2 votes

Algorithm to add a path point, preserving path shape?

I realized this would be better phrased as "how to split a bezier curve", answered well here (De Casteljau's Algorithm). And I had somehow missed that it's implemented in paper.js as Path....
Rick Mohr's user avatar
  • 141
2 votes
Accepted

How to decide granularity for sampling a bezier curve for rendetion

IIRC, Watt and Watt's "Advanced Animation and Rendering Techniques" (Chapter 3) has an interesting discussion on this (which I think is summarising the work of Clark https://dl.acm.org/doi/...
Simon F's user avatar
  • 4,261
1 vote

Methods for filling the area between complex curves

Define the curves to have a positive and negative side then determine which side of the curve the point in question lies on. There are a few ways to do this, one method is to shoot a ray out, usually ...
pmw1234's user avatar
  • 3,219
1 vote

Why is there a straight line between my bezier paths?

IIRC in another question, your said your Point class actually uses float x,y; for the coordinates. So one thing that can help is to shift the centers (the "...
luser droog's user avatar
  • 1,378
1 vote

How to get coordinates of opposite direction from mouse release point relative to a point?

One way to approach this topic that can help is to distinguish between points and vectors as distinct types and make sure your operations fit into one of the "known good" scenarios: Point + ...
luser droog's user avatar
  • 1,378
1 vote
Accepted

Is drawing Bezier curve with scanline algorithm possible with Vulkan?

The typical solution is to compute a bounding structure using triangles that would be transformed by the vertex shader. The bounding structure is computed to be large enough to fit the entire curve ...
pmw1234's user avatar
  • 3,219
1 vote

Continuity of parametric and geometric continuity

Yes, your understanding of $C1$ and $G1$, as shown in your drawings, is roughly correct: $C1$ means equal derivative vectors, and $G1$ means parallel derivative vectors. I say “roughly” because there ...
bubba's user avatar
  • 348
1 vote
Accepted

Cubic Bezier Curve - General Questions

Regarding the first question: a bezier curve is defined as linear combinations of control points and basis function (Bernstein polynomials). Although usually one considers a unit interval as ...
dweber's user avatar
  • 126
1 vote

Spline interpolation library in cpp

So you have a series of points and, at each point, a supplied derivative? Is a piecewise cubic sufficient or does it need higher derivative continuity? If the former is ok, then Cubic Hermite Splines ...
Simon F's user avatar
  • 4,261
1 vote
Accepted

LoopBlinn Cubic Curve Rendering - Serpentine arteffect

found the problem, it was the shader. I am using following shader, that works fine ...
codeKhor's user avatar
1 vote

Simple Intersection Algorithm for Ray and 3D Bézier Curves of Varying Thickness

You say that you don't need the fastest possible algorithm, so instead of solving it analytically, you might try considering the numeric alternatives, which in this case could mean ray marching. How ...
Alan Wolfe's user avatar
  • 7,801
1 vote
Accepted

How does the Lane Riesenfeld algorithm work?

What you're looking for is called de Boor's algorithm. It lets you compute a point on a b-spline curve by doing a series of linear interpolation (LERP) calculations. So, it works very much like the de ...
bubba's user avatar
  • 348
1 vote

First steps towards CAD standard curve fitting

As far as I know, there are no standard shapes for (physical) French curves. The folks who manufacture them are free to choose any shapes they like. Of course, they choose shapes that look "nice", ...
bubba's user avatar
  • 348
1 vote

Checking the correct offset direction for Bezier curve offset

For a two dimensional spline it is possible to define a left and a right side, or let us call the directions counterclockwise and clockwise side (or maybe port and starboard would be appropriate). The ...
joojaa's user avatar
  • 8,437
1 vote

Algorithm to find the center of a Bezier curve

Since we're not told what defintion of "center" to use, we may as well use the easiest. This would be $$ \text{Center} = \frac14( \mathbf{P}_0 + \mathbf{P}_1 + \mathbf{P}_2 + \mathbf{P}_3) $$ where $\...
bubba's user avatar
  • 348
1 vote

How to raytrace Bezier surfaces?

https://www.shadertoy.com/view/MldczM Is ANALYTIC intersection of a ray with a triangular b-spline, 3 quadratic bezier splines, 3 CVs for each spline, 3 corner CVs are shared by 2 splines. All cv ...
ollj's user avatar
  • 21

Only top scored, non community-wiki answers of a minimum length are eligible