I created a tutorial that shows how to define a tiling pattern and add it to the stock pattern file (Inkscape .46 and above).
http://www.silent9.com/blog/archives/143-Creating-and-Adding-Custom-Patterns-to-Inkscape.html
-Rob A>
Tutorial: Adding to the Inkscape Stock Patterns
Tutorial: Adding to the Inkscape Stock Patterns
Last edited by RobA on Tue Apr 23, 2013 12:11 pm, edited 1 time in total.
Re: Tutorial: Adding to the Inkscape Stock Patterns
Thanks for sharing. I noticed you could do something like this when you wanted to save gradients to be reused in inkscape or the gimp.
Ok I gave your suggestion a go, but nothing seems to show up. Does someone mind trying this out to see what is going wrong. If I leave this pattern as it originally is it works fine but when I try as the tutorial suggested it does not work. Essentially it is just as 2 x 2 pixel square with the topleft and bottomright filled with the remaining squares not filled.
Ok I gave your suggestion a go, but nothing seems to show up. Does someone mind trying this out to see what is going wrong. If I leave this pattern as it originally is it works fine but when I try as the tutorial suggested it does not work. Essentially it is just as 2 x 2 pixel square with the topleft and bottomright filled with the remaining squares not filled.
Code: Select all
<pattern
inscape:collect="always"
patternUnits="userSpaceOnUse"
width="2"
height="2"
patternTransform="translate(0,0) scale(10,10)"
id="Scan_line">
inscape:stockid="Cap Scanlines"
<path
id="bottomleft"
d="M 0,1 L 1,1 L 1,2 L 0,2 L 0,1 z"
style="fill:none;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dashoffset:0;stroke-opacity:1" />
<path
id="topright"
d="M 1,0 L 2,0 L 2,1 L 1,1 L 1,0 z"
style="fill:none;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dashoffset:0;stroke-opacity:1" />
<path
id="topleft"
d="M 1,1 L 2,1 L 2,2 L 1,2 L 1,1 z"
style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dashoffset:0;stroke-opacity:1" />
<path
id="bottomright"
d="M 0,0 L 1,0 L 1,1 L 0,1 L 0,0 z"
style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dashoffset:0;stroke-opacity:1" />
</pattern>
Re: Tutorial: Adding to the Inkscape Stock Patterns
Tricky!
You have the line:
inscape:stockid="Cap Scanlines"
It should be inkscape (you dropped the k) and it should be one line up (as an attribute of the pattern node). Here is the fixed version:
As a note the scale(10,10) actually makes the pattern 20x20 rather than 2x2.
But it could be simplified to this (as a 20x20):
-Rob A>
You have the line:
inscape:stockid="Cap Scanlines"
It should be inkscape (you dropped the k) and it should be one line up (as an attribute of the pattern node). Here is the fixed version:
Code: Select all
<pattern
inscape:collect="always"
patternUnits="userSpaceOnUse"
width="2"
height="2"
patternTransform="translate(0,0) scale(10,10)"
id="Scan_line"
inkscape:stockid="Cap Scanlines">
<path
d="M 0,1 L 1,1 L 1,2 L 0,2 L 0,1 z"
style="fill:none;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dashoffset:0;stroke-opacity:1" />
<path
d="M 1,0 L 2,0 L 2,1 L 1,1 L 1,0 z"
style="fill:none;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dashoffset:0;stroke-opacity:1" />
<path
d="M 1,1 L 2,1 L 2,2 L 1,2 L 1,1 z"
style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dashoffset:0;stroke-opacity:1" />
<path
d="M 0,0 L 1,0 L 1,1 L 0,1 L 0,0 z"
style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dashoffset:0;stroke-opacity:1" />
</pattern>
As a note the scale(10,10) actually makes the pattern 20x20 rather than 2x2.
But it could be simplified to this (as a 20x20):
Code: Select all
<pattern
inkscape:collect="always"
patternUnits="userSpaceOnUse"
width="2"
height="2"
patternTransform="translate(0,0) scale(10,10)"
id="Scan_line"
inkscape:stockid="Cap Scanlines">
<rect y="0" x="0" height="1" width="1" style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dashoffset:0;stroke-opacity:1" />
<rect y="1" x="1" height="1" width="1" style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dashoffset:0;stroke-opacity:1" />
</pattern>
-Rob A>
Re: Tutorial: Adding to the Inkscape Stock Patterns
I actually thought I had everything right never even noticed the inkscape was spelled wrong. LOL. Also I was not quite sure about whether to delete the "whole" id part so I just renamed to make sure it would not clash with anything.
By the way how did you make it so that the code could be all selected?
By the way how did you make it so that the code could be all selected?
Re: Tutorial: Adding to the Inkscape Stock Patterns
capnhud wrote:By the way how did you make it so that the code could be all selected?
?!? Yours has a select all, too!
-Rob A>
Re: Tutorial: Adding to the Inkscape Stock Patterns
?!? Yours has a select all, too!
I really must learn to pay better attention to what is in a thread.