W3C home > Mailing lists > Public > www-svg@w3.org > December 2012

Re: SVG2 - suggestion for a new path command to close a subpath smoothly

From: Jasper van de Gronde <th.v.d.gronde@hccnet.nl>
Date: Mon, 03 Dec 2012 13:45:22 +0100
Message-ID: <50BC9EE2.5070004@hccnet.nl>
To: www-svg@w3.org
On 03-12-12 12:37, Dr. Olaf Hoffmann wrote:
> Jasper van de Gronde:
>> I would suggest, though, to rethink the naming scheme. Essentially you'd
>> want ANY path command to be able to close a subpath (why allow a cubic
>> Bézier, but not an arc for example). So if they all get letters, that's
>> a lot of letters. Instead, I would suggest letting an author "flag" when
>> a path command should close a subpath.
> 
> With a cubic curve you can close the path smoothly, because you have
> enough parameters, two control points. For example with a quadratic path
> you have only one control point, therefore typically the path cannot be
> closed smoothly. With elliptical arcs - does it work in general? If you have
> multiple arc commands following each other with different half axis and
> alignments, are you sure you can close such arc paths smoothly with only one 
> arc command? Currently we do not even have something corresponding to 
> S and T for the A command to connect different elliptical arc segments
> smoothly.

I didn't necessarily mean closing /smoothly/ here. I split your
suggestion in two: being able to close a subpath with something other
than a straight line (smoothly or not) and being able to close it
smoothly. The smooth part is indeed mostly useful for cubic Béziers.

Just a reminder for why it is useful to be able to close a subpath with
something other than a line segment (regardless of whether or not you'd
be able to do it smoothly):
 - It is more efficient (no duplication of coordinates).
 - No duplication of coordinates means less chance to make mistakes when
changing them (through animation or otherwise).
 - Inkscape (and possibly others) wouldn't have to either contend with
bug reports about spurious nodes or implement a series of "hacks" to
implement its own logic on top of the SVG close path command.
 - A zero-length line segment can have a visible impact if markers are used.
 - It just plain makes sense.

I never considered allowing a "smooth close" command as well, but it is
indeed a brilliant addition. But I think it would only make sense if one
would be able to close subpaths with something other than a line at all.
It would be weird if one could only use a Bézier to close a subpath
smoothly...

As for the question of allowing a smooth command for arcs or mixed curve
types, that's a different (although interesting) question. I purposely
did not assume any such thing in writing my email.
Received on Monday, 3 December 2012 12:45:53 GMT

This archive was generated by hypermail 2.3.1 : Friday, 8 March 2013 15:54:53 GMT