Re: SVG 1.2 Comment: vector effects

On Tue, 23 Nov 2004, Chris Lilley wrote:
> On Tuesday, November 23, 2004, 2:09:04 PM, Ian wrote:
>> 
>> I mean, come on. If you want a shared edge on a map, just use one path 
>> element, with one stroke, instead of having the edge drawn by both 
>> elements.
> 
> That would reduce the semantic value.
> 
> How would you propose to fill such shapes?
> 
> The current solution is nicely engineered to meet these common problems 
> and solve them.

Ok here's a proposal which would dramatically simplify all this (and 
which, in conjunction with the two other proposals to address the two 
other use cases mentioned for this chapter, would reduce the entire 
chapter to about three minor extensions).

Add a new command to the path language that imports another path at that 
point. Instead of:

   <defs>
     <path id="border1" d="..."/>
     <path id="border2" d="..."/>
     <path id="border3" d="..."/>
     <path id="border4" d="..."/>
     <path id="border5" d="..."/>
   </defs>
   <vectorEffect>
     <vePath>
       <vePathRef xlink:href="#border1"/>
       <vePathRef xlink:href="#border2"/>
       <vePathRef xlink:href="#border3"/>
     </vePath>
     <veFill color="red"/>
     <vePath>
       <vePathRef xlink:href="#border4"/>
       <vePathRef reverse="true" xlink:href="#border2"/>
       <vePathRef xlink:href="#border5"/>
     </vePath>
     <veFill color="blue"/>
   </vectorEffect>

...you would do:

   <defs>
     <path id="border1" d="..."/>
     <path id="border2" d="..."/>
     <path id="border3" d="..."/>
     <path id="border4" d="..."/>
     <path id="border5" d="..."/>
   </defs>
   <path d="url(#border1) url(#border2) url(#border3)" fill="red"/>
   <path d="url(#border4) reverse-url(#border2) url(#border5)" fill="blue"/>

That would also get around another problem I have with vectorEffect,
which is the way you can make any random shape (e.g. a <circle>) look
like any other random shape (e.g. a country). That seems to defeat the
point of having shapes in the first place. It also makes trying to
understand SVG markup quite hard.

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'

Received on Tuesday, 23 November 2004 16:29:18 UTC