Click here to Skip to main content
15,949,686 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i have two bezier curves placed at a distance apart in space.
curve 1 has control points A0, A1,A2, A3. A0 and A3 lie on curve and are its end points
Curve 2 has control points C0,C1, C2, C3 . C0 and C3 lie on curve.and are its end points

i want to join the two curves A and C with an intermediate bezier curve B. the intermediate Curve B has control points A3 and C0 which lie on the curve and are its end points. theintermediate control points B1 and B2 are unknown to me. also the joining should be smooth enough. please help as to how to proceed. have read alot about beziers but dont know how to do this.
thanks and regards,
zoya
Posted

1 solution

Letting B0 = A3 and B3 = C0 ensures G0 continuity (location). Choosing B1 to be collinear with A2A3 will ensure G1 continuity (direction) at B0, and similarly choosing B2 to be collinear with C0C1 ensures G1 continuity at B3.

Now there remain two degrees of freedom for the placement of B1 and B2. I guess that these can be used to achieve G2 continuity (curvature) as well.

Now a little bit of math. In the following document http://www.tsplines.com/resources/class_notes/Bezier_curves.pdf[^], you find an interesting formula on page 22, telling you that the curvature equals h/a^2 (dropping the constant n-1/n), where a is the length of the first leg of the control polygon, and h is the perpendicular distance from the second control point to the first leg of the control polygon.

We state that B1 = B0 + a U and B2 = B3 + a' V, where U and V are the unit vectors in the directions of B0B1 and B3B2 respectively. h and h' are obtained by projecting B1B2 onto U and V: h = B1B2 /\ U = (B0B3 + a' V) /\ U = p + q a', h' = B1B2 /\ V = (B0B3 + a U) /\ V = p' - q a. (/\ is the vector product operator, a 2x2 determinant in 2D).

This can be put together with the known curvatures at endpoints computed from the other two arcs:
h = K a^2 and h' = K' a'^2.

Elimination of three unknowns gives us a quartic equation in a, hence 0 to 4 solutions.

p + q a' = K a^2<br />
p' - q a  = K' a'^2<br />
<br />
=><br />
<br />
(p' - q a) q^2 = K' (K a^2 - p)^2


:-(
 
Share this answer
 
v12

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900