3

I am doing something quite basic, "spreading" (aka cloning) a circle shape multiple times with the spray tool in Inkscape.

My problem is that I created quite a few objects (~200) and I'm experiencing notorious lags.

I am trying to merge or combine the objects in such a way that they become only one object/path that can be rendered inexpensively. I could then copy and paste this "pattern" several times without lagging issues. I am not concerned about breaking the original link between the object and the source from where it's cloned.

One idea I'm exploring is to save the group as a .png and import the .png as an image later. I was expecting there was a cleaner way to conserve the pattern in .svg format within the same document.

3 Answers 3

3

When you use the Spray tool in Inkscape, it doesn't generate clones by default, merely copies. I think that may be your problem.

Clones are a completely different thing from a copy in Inkscape. A clone is like a symbol - it's paths are defined only once in the SVG code, in essence it's a single object. When you spray it, you spray instances of the clone. However, if you spray copies (not clones), each path's code is repeated again and again in the SVG. If the copied graphic is complex, the more you copy the more paths are generated in the SVG. You could end up with thousands of paths, which will result in a slow down in rendering.

Anyhoo, here's how you can spray actual clones:

  1. Create your initial graphic, group it, and clone it using Edit > Clone > Create Clone.

  2. Move the clone to the side.

  3. Select the clone before you hit the Spray Tool. Then when you spray, you merely spray clones, not copies.

enter image description here

You can check these are actual clones, by editing the clone source, in this example, I moved the inner circle in the clone source, and all the clones are updated instantly.

enter image description here

0

Select the objects you want to combine (the cloned circles) and do Object -> Group on the menu (Ctrl + G, on Windows). After the grouping operation is complete you can save the file as an svg and freely move and copy the unified object.

If all you have in your svg are the cloned circles, use Edit -> Select All (Ctrl + A, on Windows) to select the circles.

0
  • make sure your original object (the circle) that you then cloned with the spray tool is a path not a circle object (Path > Object to path)

  • Select (hold down SHIFT and drag the selection tool over the output of the spray tool and make sure everything is unlinked (Edit > Clone > Unlink Clone)

Depending on the number of clones and your available horsepower it may take a few seconds for Inkscape to process. This next step only works on path objects so skipping the first two steps won't yield a result.

  • Keep them all selected then merge them into one path object (Path > Combine)

This works like grouping object, in that you can drag them around the screen, resize, rotate etc but with the added bonus that combining multiple paths into one path object will allow you to get around the 2 object limit the pathing tools have.

With the above point in mind, once you've combined the paths:

  • Draw a rectangle either with the pen tool or with the rectangle tool (if you used the rectangle tool convert the object to a path object: Path > Object to path)

  • Position the rectangle over the object you want to outline, adjust the size as necessary so the bottom shape is completely covered and select them both (hold down SHIFT and drag the selection tool over them)

  • Making sure the rectangle is uppermost use Path > Intersection

This will essentially weld everything into one object - you will lose both the rectangle and the combined path object - so if you wanted to be able to re-edit it make a duplicate first (Edit > Duplicate)

The Path > Intersection method differs from using Path > Combine because you can't reverse it without using undo, whereas with Combine you can use Path > Break Apart to retrieve your original objects.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.