Re: Correct usage of cubic Bézier curve command s/S

On 22-11-11 12:55, Satz Klauer wrote:
> Hi,
> 
> I've got some troubles in implementing the cubic Bézier curve commands
> s and S correctly. According to the descritption at
> http://www.w3.org/TR/SVG/paths.html#PathDataCubicBezierCommands the
> missing first control point has to be generated by reflecting the
> second control point of the previous Bézier curve command.
> 
> But reflect at what? Reflecting at the X-axis (as shown in the example
> image) doesn't seem to be correct. And reflecting at the intermediate
> point (endpoint of the previous and start point of the current curve)
> causes strange results in my application.
> 
> So how should that be done correctly?

You should indeed reflect in the "current" point, so I would
double-check your implementation. Suppose the last control point of the
previous curve was c1 and the "current" point is p1, then the first
control point of the new curve is p1+(p1-c1)=2*p1-c1.

Received on Tuesday, 22 November 2011 13:59:02 UTC