Using a pattern fill on a group of objects

Post unfinished work here for feedback and advise.
logiczero
Posts: 1
Joined: Fri Jan 21, 2011 9:05 am

Using a pattern fill on a group of objects

Postby logiczero » Fri Jan 21, 2011 2:19 pm

I'm wondering if anyone can suggest how this image SVG Image can be given a uniform ermine pattern fill? It's a group of several objects, and each object seems to use the pattern fill differently, so that the overall object is a mess when the ermine pattern is used to fill it.

Also, the default ermine fill pattern in Inkscape has a transparent background. I messed around with the SVG in the patterns.svg file, but I can't get the pattern to have a white background. Any suggestions on how to make it a white instead of transparent background?

mj

Re: Using a pattern fill on a group of objects

Postby mj » Fri Jan 21, 2011 8:33 pm

About the first question: It's only a problem if you want to change (rotate, translate, scale) the pattern after you have applied it, right? That's a problem I had at least. I don't know if there's a better way, but if you do the transformation so it's looks right for just one of the objects (paths), you copy that path and use Ctrl+Shift+V (Paste style) on the other paths, and the pattern should look continuous.

User avatar
prkos
Posts: 1625
Joined: Tue Nov 06, 2007 8:45 am
Location: Croatia

Re: Using a pattern fill on a group of objects

Postby prkos » Fri Jan 21, 2011 10:36 pm

When using the Node tool on a patterened object you get the pattern control handles that you can use to move, scale and rotate the pattern. They are usually positioned at the top left corner of the page but you can move them closer to the object. I guess if you snapped the pattern handles of all objects to the same point you'd get what you're after.

But I think it's easier to create one object that will be filled with pattern - duplicate all the small ones, do a union and fill it with pattern, and send it back behind the original objects. Remove fill from the original objects so you can see through to the pattern below, and keep the black strokes.

To change the pattern colors you have to edit them manually, use the XML editor. Select the patterened object, open XML editor, note the pattern reference, find the defs element near the top, find the pattern in questions there, and change the color, usually under Style attribute.

But the easiest way is to duplicate the ermine object, set its fill to white and send it back behind the pattern.
just hand over the chocolate and nobody gets hurt

Inkscape Manual on Floss
Inkscape FAQ
very comprehensive Inkscape guide
Inkscape 0.48 Illustrator's Cookbook - 109 recipes to learn and explore Inkscape - with SVG examples to download

oxplot
Posts: 2
Joined: Mon Nov 21, 2011 1:16 pm

Re: Using a pattern fill on a group of objects

Postby oxplot » Mon Nov 21, 2011 1:27 pm

prkos wrote: ...
To change the pattern colors you have to edit them manually, use the XML editor. Select the patterened object, open XML editor, note the pattern reference, find the defs element near the top, find the pattern in questions there, and change the color, usually under Style attribute.


Not necessary. Here's what you can do to be able to later change a pattern and see the changes applied to all the objects that use the pattern:

  • Create your pattern as you normally would.
  • Make a linked copy from it (by selecting it and pressing Alt+D).
  • Now move the copy away from the original object.
  • Convert the copy to pattern (by selecting it and pressing Alt+I).
  • Now use the pattern to fill another object.
  • Go back to your original pattern object and change something (e.g. color)
  • Zoom in and out once to force a canvas redraw (this is a bug https://bugs.launchpad.net/inkscape/+bug/708269)
  • You should now see the change applied everywhere the pattern is used.

Hope this saves you time ;)

User avatar
prkos
Posts: 1625
Joined: Tue Nov 06, 2007 8:45 am
Location: Croatia

Re: Using a pattern fill on a group of objects

Postby prkos » Tue Nov 22, 2011 11:09 pm

Great tip oxplot!
just hand over the chocolate and nobody gets hurt

Inkscape Manual on Floss
Inkscape FAQ
very comprehensive Inkscape guide
Inkscape 0.48 Illustrator's Cookbook - 109 recipes to learn and explore Inkscape - with SVG examples to download


Return to “Work in progress”