This post has been de-listed
It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.
I guess this is an advanced question so I try my best to summarize it as clearly as I can.
My final goal is to add a pattern to my preset patterns which is strictly defined and never resizes, no matter how I resize the filled object or which units I work in. I want it exactly 3 pixels wide, 1 red, 2 white so when it repeats the object is filled with vertical lines, one pixel wide red, two pixels wide white.
To do this I'm editing the xml code of patterns.svg and as a model I copied the definition of the basic "Stripes 1:1" and I get this (you can see the original pattern below mine):
<pattern
inkscape:collect="always"
patternUnits="px"
width="3"
height="1"
patternTransform="translate(0,0) scale(1,1)"
id="Mine"
inkscape:stockid="Mine">
<rect style="fill:red;stroke:none" x="0" y="-0.5" width="1" height="2"/>
<rect style="fill:white;stroke:none" x="1" y="-0.5" width="2" height="2"/>
</pattern>
<pattern
inkscape:collect="always"
patternUnits="userSpaceOnUse"
width="2"
height="1"
patternTransform="translate(0,0) scale(10,10)"
id="Strips1_1"
inkscape:stockid="Stripes 1:1">
<rect style="fill:black;stroke:none" x="0" y="-0.5" width="1" height="2"/>
</pattern>
As you can see I've changed:
The pattern units which I defined in pixels.
The width which I set up to three.
The Id and stockid.
The scale, original 10,10, mine 1,1.
The pattern itself, I changed the color to red and added a second white rectangle so the pattern is not "transparent".
So far, this is good... ish. I have a new pattern on my list and I can fill objects with it. However it doesn't behave when it comes to sizes. For the most part it works but for some reason I don't know some apparently random objects are filled with a scaled or displaced version of the pattern and I'm struggling to find why. I looked at the xml code of a drawing in case the objects themselves had different parameters but they are identical, and yet their filling behaves differently so my best guess is the issue is with the "patterntransform" tag, but I can't find ANY documentation regarding how it works and what parameters does it have. I searched inkscape forums and even github threads but I found anything regarding.
I'll be very thankful is some of you can provide me any info or resource about the specific inkscape xml coding, tags, parameters accepted, and so. Even better if you can help me directly to make this works. I'm not an expert and I find myself at a dead end.
Subreddit
Post Details
- Posted
- 2 years ago
- Reddit URL
- View post on reddit.com
- External URL
- reddit.com/r/Inkscape/co...