14

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 centers in image 1. More than this do exist. Image 1: Some of the possible centers of a single span Bézier curve In practice nearly all graphics applications ...


14

First off, here's the Kajiya method I think you're thinking of: Kajiya, Ray Tracing Parametric Patches, SIGGRAPH 82. The tech report version might be more informative. What I hope you get from that is that it's not impossible and it's not conceptually difficult if you don't mind getting your hands dirty with some algebraic geometry and complex numbers. ...


8

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 with this surface, you have to find the roots of a polynomial of degree 18. There is no formula for these roots -- you have to find them by numerical methods. In ...


7

What you (probably) want to achieve is something like this: When having a closer look at one of the corners and add a few lines, we see this: The black lines indicate that the center points of the circles along the borders of the red and blue boxes is the same. If the outer radius of the red box, for example, is $50px$, and the distance between the outer ...


6

An alternative way to formulate the problem is to define a function that gives the distance between points on the two curves, as a function of the curves' parameters. Then attempt to find the global minimum of this function. If the curves intersect, the minimum will be zero; otherwise the minimum will be some positive distance. To be explicit, given a pair ...


5

[Disclaimer: I think the following should work but have not actually coded it myself] I couldn't think of a "trivial" method of producing a yes/no answer but the following would be a reasonable approach to a practical solution to the question. Let's assume our curves are A(s) and B(t) with control points {A0, A1..An} and {B0,..Bm} respectively. It seems ...


5

Another option, which I used a couple of decades ago (yikes!), is to use Toth's scheme from 1985 that employed interval arithmetic to narrow down the search space. IIRC, eventually it will resort to Newton-Rhapson but, again IIRC, I think it rarely required more than one or two steps to get to a good solution. Though I haven't looked at it (well, apart ...


5

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 k is the row index and n is the column index of control point. l is the elevation factor and is equal to {-1, -1/3, 1/3, 1}. p(k) is the center of the k'th row. Rationale: From the new images, red ...


4

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 spline is almost the same as Bezier spline but with different $B$ matrix, so if you already understand Bezier, then understanding Hermite is a trivial step. So ...


4

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 triangles. The triangilation is called tesselation or meshing depending on what literature you read. There are lots of applications that do this allready. Most ...


3

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 a popular research topic in production graphics a few years ago, but the industry has moved onto polygon mesh subdivision. Subdivision gives much more ...


3

Yes, its pretty standard stuff. Most 3D applications our there can do this. Since the nomenclature of 3d applications is not standardized, the tool has different names in different applications: Loft (Maya, 3DSMax), Blend (Creo, Catia...) and so on. Image 1: Blend between 3 curves, not closed but same principle applies. Open curves are easier as they ...


2

You can use OpenGl 4.x tessellation shaders to convert Bezier control points into polygons. A google search for "tessellation shader bezier" found this outline describing the tessellation of Bezier surfaces and curves: http://web.engr.oregonstate.edu/~mjb/cs519/Handouts/tessellation.1pp.pdf This offloads the Bezier evaluation from the CPU to the GPU and ...


2

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}$. Then the silhouette curve is the intersection of the quadric and the so-called polar plane of $\mathbf{Y}$, which is $\mathbf{Y}^T \mathbf{M} \mathbf{X} = 0$...


2

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 equal d0. That gives you C0 continuity or positional continuity. The next step is to make sure that the tangents where the 2 curves meet are the same. That will ...


2

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 segmented for example. One way to approach this is to find all the points that match your curvature requirements. Then find the point x units away from point ...


2

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 when you only want one. This causes the wrong evaluation of the basis function at the knot values and therefore the spikes.


1

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 you could do this is take steps down the ray and test if the point is inside or outside of this bezier tube. You would iterate down the ray until you either ...


1

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 Casteljau algorithm for Bezier curves. In fact, the de Casteljau algorithm is a special case of de Boor's algorithm. A link Another one And another


1

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 side is easily identified as the cross product of the tangent in direction of point order crossed by the paper plane. Image 1: Offset side in 2D. The higher ...


1

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 $\mathbf{P}_0$, $\mathbf{P}_1$, $\mathbf{P}_2$, $\mathbf{P}_3$ are the control points of the curve.


1

https://www.shadertoy.com/results?query=bezier sort by age, in case of compatibility issues: ,...shows many solutions of many spline-subsets, either returning the distance to a 2d spline, or tracing a 3d patch. Splines and patches come in many forms. heavensine beind simplest, bezier being simple, nurbs being overly complex. The more constrains yo add to ...


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