W3C home > Mailing lists > Public > www-svg@w3.org > November 2011

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

From: Jasper van de Gronde <th.v.d.gronde@hccnet.nl>
Date: Tue, 22 Nov 2011 14:58:18 +0100
Message-ID: <4ECBAA7A.4050508@hccnet.nl>
To: www-svg@w3.org
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

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 22:54:33 UTC