[solved] Cropping a drawing using Clip and Set not working

Post questions on how to use or achieve an effect in Inkscape.
AnalogueMan
Posts: 97
Joined: Thu Jan 22, 2015 9:11 pm
Location: Holland (the Netherlands)

[solved] Cropping a drawing using Clip and Set not working

Postby AnalogueMan » Wed Jan 20, 2016 1:50 am

Hello,
Yes, I know that you cannot crop things in Inkscape, at least not in the usual sense of the meaning of clipping. Browsed through this forum and found a thread where brynn advised a method using the Clip feature: (viewtopic.php?f=5&t=1938).
I have a two layer drawing one with just a A4 graph paper with millimeter grid and above that a second layer containing a drawing which covers only a small part of the A4 graph paper layer.
Now I want to crop both layers just around the drawing.
I used the method described in that thread but it does not work. Arriving at: Object > Clip > Set, nothing happens.
What am I forgetting to do?
In the attachment I give that particular drawing.
Attachments
Opg.10-blz.236-Gain-Ra-kar.svg
(197.01 KiB) Downloaded 167 times
Last edited by AnalogueMan on Thu Jan 21, 2016 10:56 pm, edited 1 time in total.
Analogue man in a digital world

Polygon
Posts: 368
Joined: Thu Dec 19, 2013 3:27 am

Re: Cropping a drawing using Clip and Set not working

Postby Polygon » Wed Jan 20, 2016 2:18 am

Maybe unlock the grid layer first - then select everything (Masking object is on top) and go Object->Clipping->Set. (Not sure about the English UI entries as used a localized version):
Image

Cheers
P.

User avatar
brynn
Posts: 10308
Joined: Wed Sep 26, 2007 4:34 pm
Location: western USA
Contact:

Re: Cropping a drawing using Clip and Set not working

Postby brynn » Wed Jan 20, 2016 2:25 am

Wow, you sure found an old message there!

In your attached SVG file, I don't see a clipping path. Probably that will be a rectangle (or maybe square) around the black plotted graph in layer Gain-vs-Ra. And it will need to be on top of everything else (in layer Gain-vs-Ra).

Select the clipping path and the red graph, and do Object menu > Clip > Set

If you want to keep everything together, you could Group the red graph and the plotted graph (black) either before or after you do the Clip.

Last note -- Layer 1 with the red graph is locked, so you'll need to unlock it, to be able to select it.

Oops - Polygon sneaked in while I was typing :D

AnalogueMan
Posts: 97
Joined: Thu Jan 22, 2015 9:11 pm
Location: Holland (the Netherlands)

Re: Cropping a drawing using Clip and Set not working

Postby AnalogueMan » Wed Jan 20, 2016 6:48 am

Sorry guys, but after countless trial and errors ( with some Inkscape crashes), I cannot get it done :x .
Only once I got to the desired result but forgot what I did to get there.
In the attachment I again give the drawing but now with the (wanted to crop area) rectangle drawn in the top layer.
And I unlocked both layers.
Can someone please give a step by step procedure to produce the desired result?
Thanks in advance!!
Attachments
Gain-Ra-kar.svg
(197.27 KiB) Downloaded 164 times
Analogue man in a digital world

Polygon
Posts: 368
Joined: Thu Dec 19, 2013 3:27 am

Re: Cropping a drawing using Clip and Set not working

Postby Polygon » Wed Jan 20, 2016 7:35 am

All you need is to draw a rectangle around the whole scene with your cursor to make sure everything is selected and go Main menu ->Objects ->Clipping path-> Set.

Cheers
P.

AnalogueMan
Posts: 97
Joined: Thu Jan 22, 2015 9:11 pm
Location: Holland (the Netherlands)

Re: Cropping a drawing using Clip and Set not working

Postby AnalogueMan » Wed Jan 20, 2016 7:47 am

Polygon wrote:All you need is to draw a rectangle around the whole scene with your cursor to make sure everything is selected and go Main menu ->Objects ->Clipping path-> Set.

Cheers
P.

If I try to do that, the whole layer1 moves....
Analogue man in a digital world

Lazur
Posts: 4705
Joined: Tue Jun 14, 2016 10:38 am

Re: Cropping a drawing using Clip and Set not working

Postby Lazur » Wed Jan 20, 2016 7:49 am

Hi.

Some general notes.

Layers are implemented as "special groups". You cannot clip two objects on two different layers with "the same" clipping path. (You could clone the clipping path on a layer and use the clonnes for clipping on others though but that's unnecessary most cases.)

On your document setup.
You want to draw on a mm scale on an A4 sized page yet your default unit is pt.
And you also have a grid with pt units preventing you from accurate working.
More than that you set the snapping distance to incredibly small distance.
These won't make your work easier but more complicated instead.

On creating the mm scales. They are not that accurate now, probably those were made manually?
There is an extension creating such grids even with various colours thank's to Ragnar.
I for one would draw it manually though, by using the interpolate subpaths lpe.

There was a correct distortion on text/page or something similar, this guide can help you getting the concept.
You only need to draw one line, duplicate it, move it horizontally/vertically, combine the two together and apply the lpe for parallel lines.
Then they can be converted to paths by Ctrl+Shift+C, broken apart (Ctrl+Shift+K) and grouped together (Ctrl+G), so that you can access unnecessary lines and delete them/change stroke widths, combine some together etc.


Sorry just cannot break it down to effective steps, so adding a sample -without using clipping (the grid in question was reconstructed.)
Gain-Ra-kar2.svg
(44.84 KiB) Downloaded 148 times

AnalogueMan
Posts: 97
Joined: Thu Jan 22, 2015 9:11 pm
Location: Holland (the Netherlands)

Re: Cropping a drawing using Clip and Set not working

Postby AnalogueMan » Wed Jan 20, 2016 8:01 am

Thanks Lazur URH for your elaborate explanation. It takes time to digest this. Here it is 23:00 hrs local time.
Will come back on it tomorrow.....
Analogue man in a digital world

Polygon
Posts: 368
Joined: Thu Dec 19, 2013 3:27 am

Re: Cropping a drawing using Clip and Set not working

Postby Polygon » Wed Jan 20, 2016 8:17 am

Lazur URH wrote:Some general notes.
Layers are implemented as "special groups". You cannot clip two objects on two different layers with "the same" clipping path.

Can´t confirm as I just took AnalogueMan´s SVG - select everything - set clipping - done:

Image

Cheers
P.

Lazur
Posts: 4705
Joined: Tue Jun 14, 2016 10:38 am

Re: Cropping a drawing using Clip and Set not working

Postby Lazur » Wed Jan 20, 2016 9:35 am

Hmm you are right.

(0:34 am here)

User avatar
brynn
Posts: 10308
Joined: Wed Sep 26, 2007 4:34 pm
Location: western USA
Contact:

Re: Cropping a drawing using Clip and Set not working

Postby brynn » Wed Jan 20, 2016 10:26 am

Polygon wrote:
Lazur URH wrote:Some general notes.
Layers are implemented as "special groups". You cannot clip two objects on two different layers with "the same" clipping path.

Can´t confirm as I just took AnalogueMan´s SVG - select everything - set clipping - done:


Polygon, yes, layers are implemented in Inkscape as special groups, because there is no SVG standard for layers (at least not yet....I'm not sure about ever).

Lazur, I've clipped across layers many, many times, without problems. And that's why I didn't mention it, in the suggestions I made for AnalogueMan.

However, I'm having the same result as AM, where the clipped grid is shifted upwards. I don't know for sure why it's happening, but I can make a good guess. The displacement of the clip result reminds me of a well-known bug, which I think AM may have run into previously (if I recall correctly....maybe was someone else....). The "fix" for that bug, is NOT to use the default Layer 1. When I move the red grid into a new layer, the clip works flawlessly, even across layers!

Another possible problem, or at least a potential source of future problems, is that handmade vector grid. Drawing a grid like that can cause performance issues, because it eats up RAM. And it can also cause display problems. I wasn't sure if the displaced grid was caused by the transform attribute bug or a display issue. But since it was solved by avoiding the tranform bug, I think that's probably the reason.

AM is there some reason you drew the red grid manually, instead of using the grids that Inkscape provides (Document Properties > Grids)? They are completely configurable to any unit or set of units. You can even change the color.

I don't know about the various grids that can be created using extensions, being inaccurate, as Lazur suggested. But since it's a simple rectangular grid, you don't really need to use the extensions anyway.

Polygon, I wonder if you don't experience the problem that AM, Lazur and I do, because of using a different operating system?

Polygon
Posts: 368
Joined: Thu Dec 19, 2013 3:27 am

Re: Cropping a drawing using Clip and Set not working

Postby Polygon » Wed Jan 20, 2016 4:19 pm

brynn wrote:Polygon, I wonder if you don't experience the problem that AM, Lazur and I do, because of using a different operating system?

That´s maybe the case - but for me it´s a straight forward operation with no issues as you can see in the AnimGIF.

Cheers
P.

AnalogueMan
Posts: 97
Joined: Thu Jan 22, 2015 9:11 pm
Location: Holland (the Netherlands)

Re: Cropping a drawing using Clip and Set not working

Postby AnalogueMan » Wed Jan 20, 2016 6:09 pm

Getting a little bit desperate here.
When I do exactly what Polygon does in his answer with that animation,I get this.
See the attachment.
Attachments
Crop-problem.jpg
Crop-problem.jpg (96.9 KiB) Viewed 5500 times
Analogue man in a digital world

User avatar
brynn
Posts: 10308
Joined: Wed Sep 26, 2007 4:34 pm
Location: western USA
Contact:

Re: Cropping a drawing using Clip and Set not working

Postby brynn » Wed Jan 20, 2016 7:52 pm

Yes, I get that same result, and I've found the solution. Please read my last message above.

~suv
Posts: 2272
Joined: Sun May 10, 2009 2:07 am

Re: Cropping a drawing using Clip and Set not working

Postby ~suv » Wed Jan 20, 2016 10:33 pm

Just for those wondering - the difference is that Polygon uses a (unstable) development snapshot build (maybe forgot about that, or does not care, or ...). Several issues with clipping have been fixed in Inkscape trunk (0.91+devel) after the release of current stable Inkscape 0.91, these fixes will be available in a future stable version of Inkscape.

AnalogueMan
Posts: 97
Joined: Thu Jan 22, 2015 9:11 pm
Location: Holland (the Netherlands)

Re: Cropping a drawing using Clip and Set not working

Postby AnalogueMan » Thu Jan 21, 2016 1:16 am

brynn wrote:

However, I'm having the same result as AM, where the clipped grid is shifted upwards. I don't know for sure why it's happening, but I can make a good guess. The displacement of the clip result reminds me of a well-known bug, which I think AM may have run into previously (if I recall correctly....maybe was someone else....). The "fix" for that bug, is NOT to use the default Layer 1. When I move the red grid into a new layer, the clip works flawlessly, even across layers!

Using this the cropping problem is solved! :D Sorry brynn that I overlooked the above in your response :oops: .
I certainly will make a note about this in my little "how to" Inkscape knowledge book.
Thanks all for helping me here!
Will go studying what Lazur URH wrote in his last response. I still have a lot to learn about the proper use of Inkscape :!: .
AnalogueMan.
Analogue man in a digital world

User avatar
brynn
Posts: 10308
Joined: Wed Sep 26, 2007 4:34 pm
Location: western USA
Contact:

Re: Cropping a drawing using Clip and Set not working

Postby brynn » Thu Jan 21, 2016 10:32 pm

Good, I'm glad you got it working!

My experience in learning to use Inkscape, is that the more I learned, the more I realize how much more there is to learn! It seems like the deeper I go into it, the deeper Inkscape becomes.

AnalogueMan
Posts: 97
Joined: Thu Jan 22, 2015 9:11 pm
Location: Holland (the Netherlands)

Re: Cropping a drawing using Clip and Set not working[Solved]

Postby AnalogueMan » Thu Jan 21, 2016 11:01 pm

brynn wrote:

My experience in learning to use Inkscape, is that the more I learned, the more I realize how much more there is to learn! It seems like the deeper I go into it, the deeper Inkscape becomes.

So I do not have to be too much ashamed ..... :)
Analogue man in a digital world

User avatar
brynn
Posts: 10308
Joined: Wed Sep 26, 2007 4:34 pm
Location: western USA
Contact:

Re: Cropping a drawing using Clip and Set not working[Solved]

Postby brynn » Thu Jan 21, 2016 11:04 pm

Nope :D

AnalogueMan
Posts: 97
Joined: Thu Jan 22, 2015 9:11 pm
Location: Holland (the Netherlands)

Re: Cropping a drawing using Clip and Set not working

Postby AnalogueMan » Sat Jan 23, 2016 2:06 am

Lazur URH wrote:Hi.

Some general notes.

Layers are implemented as "special groups". You cannot clip two objects on two different layers with "the same" clipping path. (You could clone the clipping path on a layer and use the clonnes for clipping on others though but that's unnecessary most cases.)

On your document setup.
You want to draw on a mm scale on an A4 sized page yet your default unit is pt.
And you also have a grid with pt units preventing you from accurate working.
More than that you set the snapping distance to incredibly small distance.
These won't make your work easier but more complicated instead.

On creating the mm scales. They are not that accurate now, probably those were made manually?
There is an extension creating such grids even with various colours thank's to Ragnar.
I for one would draw it manually though, by using the interpolate subpaths lpe.

There was a correct distortion on text/page or something similar, this guide can help you getting the concept.
You only need to draw one line, duplicate it, move it horizontally/vertically, combine the two together and apply the lpe for parallel lines.
Then they can be converted to paths by Ctrl+Shift+C, broken apart (Ctrl+Shift+K) and grouped together (Ctrl+G), so that you can access unnecessary lines and delete them/change stroke widths, combine some together etc.


Sorry just cannot break it down to effective steps, so adding a sample -without using clipping (the grid in question was reconstructed.)
Gain-Ra-kar2.svg


Sorry for my late response. You wrote:

On creating the mm scales. They are not that accurate now, probably those were made manually?
There is an extension creating such grids even with various colours thank's to Ragnar.
I for one would draw it manually though, by using the interpolate subpaths lpe.


In fact I do not have to do this. I use the files available on this website:

http://incompetech.com/graphpaper

I always start assembling the kind of graph paper I need and then import it and use it as the first layer
when drawing a new graph.
So I do not have to worry about making for instance a millimetre graph and then having to draw lines at exactly the same distance from the preceding one or, in other cases, have to make a logarithmic grid myself. Saves a lot of work.
But the links you gave are very interesting and I will certainly have a close look at them.
Analogue man in a digital world

Lazur
Posts: 4705
Joined: Tue Jun 14, 2016 10:38 am

Re: Cropping a drawing using Clip and Set not working[Solved]

Postby Lazur » Sat Jan 23, 2016 3:15 am

Who would know that.

Anyway, here is the mentioned topic on creating graph paper with custom colours.

AnalogueMan
Posts: 97
Joined: Thu Jan 22, 2015 9:11 pm
Location: Holland (the Netherlands)

Re: Cropping a drawing using Clip and Set not working[Solved]

Postby AnalogueMan » Sat Jan 23, 2016 5:10 am

Lazur URH wrote:Who would know that.

Anyway, here is the mentioned topic on creating graph paper with custom colours.


Thank you very much Lazur URH for the link to this thread! :D
Analogue man in a digital world


Return to “Help with using Inkscape”

Who is online

Users browsing this forum: No registered users and 8 guests