W3C home > Mailing lists > Public > www-svg@w3.org > July 2003

Silhouette of group or clippath

From: Filip Krıka <lillek@quick.cz>
Date: Wed, 23 Jul 2003 10:23:52 +0200 (CEST)
To: www-svg@w3.org
Message-ID: <Pine.LNX.4.44.0307230942020.14610-100000@fkrska.pha.comstar.cz>

Hello,

is there any (possibly tricky) way, HOWTO stroke a silhouette
of a groupped path?

Consider following tests (i render them using batik 1.5):

   <defs>
      <rect id="rect" x="0" y="0" width="100" height="100"/>
      <g id="rect_pair_base">
         <use xlink:href="#rect" transform="translate(30, 30)"/>
         <use xlink:href="#rect" transform="translate(50, 50)"/>
      </g>
   </defs>
   <use xlink:href="#rect_pair_base"
         stroke="black" stroke-width="10" fill="none"/>

in this case both squares are stroked fully, so
there are lines also in the interior of the object.

   <defs>
      <rect id="rect" x="0" y="0" width="100" height="100"/>
      <g id="rect_pair_base">
         <use xlink:href="#rect" transform="translate(30, 30)"/>
         <use xlink:href="#rect" transform="translate(50, 50)"/>
      </g>      
      <clipPath id="cp_rect_pair">
         <use xlink:href="#rect_pair_base"/>
      </clipPath>
      <g id="rect_pair">
         <rect x="40" y="0" width="100" height="200"
               clip-path="url(#cp_rect_pair)"/>
      </g>
      <clipPath id="cp_inv_rect_pair">
            <rect x="-5000" y="-5000" width="10000" height="10000"/>
            <use xlink:href="#rect_pair"/>
      </clipPath>
   </defs>

   <use xlink:href="#rect_pair"
         stroke="red" stroke-width="10" fill="none"/>

in this case the clip-path is applied after stroking, so
result are two discrete lines.

But i want to draw an outline (silhouette) along the border
of the grouped squares avoiding creating single path manually.

Is it possible ? (avoiding overpainting interior of the group -
it is not suitable in some cases)

Thanks, filip
Received on Wednesday, 23 July 2003 04:34:50 GMT

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