eps with complex clipping paths

Post questions on how to use or achieve an effect in Inkscape.
TheHappyHexagon
Posts: 12
Joined: Fri Sep 20, 2013 6:16 am

eps with complex clipping paths

Postby TheHappyHexagon » Thu Nov 14, 2013 5:16 am

I'm having difficulty creating an eps file of the following image (it contains a clipping mask with many lines which act as shading) which is destined for inclusion into a tex file
8_2_planestrain.svg
The original diagram
(105.32 KiB) Downloaded 202 times

When I save as an eps however, the result is the following:
8_2_planestrain_broken.svg
after saving as an eps (postscript level 2 or 3)
(50.69 KiB) Downloaded 184 times

Which looks daft - is there anything I can do, perhaps with boolean operations to get this sort of effect quickly without clipping masks, or is there a way in which I should be saving the document?

I "need" to keep this particular style to keep it consistent with the other diagrams I created long ago in Adobe illustrator (for example, excusing the broken text:
7_2_Sphere1_svg.svg
(67.37 KiB) Downloaded 266 times
)
Last edited by TheHappyHexagon on Thu Nov 14, 2013 5:26 am, edited 1 time in total.

v1nce
Posts: 696
Joined: Wed Jan 13, 2010 4:36 am

Re: eps with complex clipping paths

Postby v1nce » Thu Nov 14, 2013 5:25 am


TheHappyHexagon
Posts: 12
Joined: Fri Sep 20, 2013 6:16 am

Re: eps with complex clipping paths

Postby TheHappyHexagon » Thu Nov 14, 2013 5:52 am

v1nce wrote:Maybe try to create pattern instead
http://tucsonlabs.com/2009/03/19/patter ... -inkscape/


Thanks for the suggestion, I tried a pattern and things were looking promising (new svg file:
8_2_planestrain_pattern.svg
(245.67 KiB) Downloaded 160 times
)

but the result after saving to eps (which I have to save as svg so I can upload here) is:
8_2_planestrain_pattern_broken.svg
(12.17 KiB) Downloaded 175 times



The real killer is that I actually really like the pattern idea since for consistency and speed it seems better - any more ideas?

v1nce
Posts: 696
Joined: Wed Jan 13, 2010 4:36 am

Re: eps with complex clipping paths

Postby v1nce » Thu Nov 14, 2013 9:58 am

Does it work better with this one ?
Attachments
8_2_planestrain_pattern_cleanb.svg
(16.63 KiB) Downloaded 228 times

TheHappyHexagon
Posts: 12
Joined: Fri Sep 20, 2013 6:16 am

Re: eps with complex clipping paths

Postby TheHappyHexagon » Thu Nov 14, 2013 10:54 am

v1nce wrote:Does it work better with this one ?


Hmm... thanks for that, though despite the preview looking like it does the job when I actually open it I get the following
8_2_planestrain_pattern_clean_eps.svg
(12.83 KiB) Downloaded 161 times


Which isn't quite right (a million miles better than what I had though) - It seems to have scaled the image and retained the pattern scaling (and then scaling the box back seems to scale the pattern too)

One approach I'm trying at the moment is with boolean operations - if I join those lines with paths to make parallelograms and then union them together I can then use this object as a cookie cutter with the difference operation (tested - and works). For the double hatch pattern I need a sort of union of diamonds to use as a cookie cutter (though the mitre is going to trip me up I think - along with making floating point errors so the things don't align or orient properly) - No clipping paths or patterns - just simple paths.

Should I ever finish this (I will) I shall post the solution for completeness. Thanks for your help so far though

hulf2012
Posts: 716
Joined: Sat Nov 24, 2012 12:37 pm

Re: eps with complex clipping paths

Postby hulf2012 » Thu Nov 14, 2013 11:48 am

Hello:
It's a recurrent problem: exporting from svg to pdf or eps generates strange results, at least in Inkscape 0.48.
An unpleasant behaviour. I tried to export your svg to pdf using a virtual pdf printer, and the result was the same that with saving as eps, which I asume is the way you export your svg.
A lot of trying and error later,... I suspect that it's the order of the cliping groups in the SVG document. If the cliped paths are on top on the other paths, then all the drawing appears.

I've attached my results: the svg and the eps.

A better Workaround: Export your drawing to png (with a good resolution. 150 px is enough?), then use any other tool to export to eps (GIMP maybe). For Latex writing I've used LyX, which it's more understanble, at least for me.
Attachments
inkscape.zip
(10.45 KiB) Downloaded 160 times
If you have problems:
1.- Post a sample (or samples) of your file please.
2.- Please check here:
http://tavmjong.free.fr/INKSCAPE/MANUAL/html/index.html
3.- If you manage to solve your problem, please post here your solution.

TheHappyHexagon
Posts: 12
Joined: Fri Sep 20, 2013 6:16 am

Re: eps with complex clipping paths

Postby TheHappyHexagon » Thu Nov 14, 2013 12:10 pm

hulf2012 wrote:Hello:
It's a recurrent problem: exporting from svg to pdf or eps generates strange results, at least in Inkscape 0.48.
An unpleasant behaviour. I tried to export your svg to pdf using a virtual pdf printer, and the result was the same that with saving as eps, which I asume is the way you export your svg.
A lot of trying and error later,... I suspect that it's the order of the cliping groups in the SVG document. If the cliped paths are on top on the other paths, then all the drawing appears.

I've attached my results: the svg and the eps.

A better Workaround: Export your drawing to png (with a good resolution. 150 px is enough?), then use any other tool to export to eps (GIMP maybe). For Latex writing I've used LyX, which it's more understanble, at least for me.


Thanks a lot for that, that's brilliant - the irony is that I have spent the last several hours messing around and finally come up with another solution and was about to post it when I saw you had solved it the right way (mine's hacky) - though it is good to know that there is a way of getting the correct eps - thanks for your investigation there. With regards a png - noting that I forgot the convert to eps step before 150px is a bit too low (jaggy even at 300dpi) - and I think too many of them would make the compilation take a while."

For what it's worth the solution I wound up with is (see my previous post):
8_2_planestrain.svg
(125.52 KiB) Downloaded 223 times


which as an eps (saved back to svg for upload here) looks like:
8_2_planestrain_eps.svg
(40.49 KiB) Downloaded 188 times


As for lyx - I tend to work from emacs (way way faster when you set up some abbreviations and functions (and of course the "evil" plugin)) [:

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

Re: eps with complex clipping paths

Postby Lazur » Thu Nov 14, 2013 12:49 pm

I'm looking at the original svg right now.
Is that supposed to be in isometric projection?
There are some inaccuracy.

Also, is that lined shading technically correct?
I would draw it by separate paths with no clipping.
But for technical drawing rules that is not a correct one to my knowledge.

TheHappyHexagon
Posts: 12
Joined: Fri Sep 20, 2013 6:16 am

Re: eps with complex clipping paths

Postby TheHappyHexagon » Thu Nov 14, 2013 1:12 pm

Lazur URH wrote:I'm looking at the original svg right now.
Is that supposed to be in isometric projection?
There are some inaccuracy.

Also, is that lined shading technically correct?
I would draw it by separate paths with no clipping.
But for technical drawing rules that is not a correct one to my knowledge.


I agree that there are some inaccuracies, and the first one was more an attempt (a failed one) to establish that I can produce in inkscape what I used to produce in Illustrator (when I was better practised) (for example extending the three arrows (poorly oriented) they do not intersect in one point - I would have/will change(d) that) in addition to other mistakes. As for it being an isometric projection it wasn't specifically my intention to draw it in that style (more that 30 degrees from horizontal is a nice angle to work with - and looks pleasing enough for what I'm trying to do with them - I have nearly 75 diagrams I need to produce and speed is paramount (my own personal project)).

I agree with you about separate paths, and In the end I wound up drawing it as separate paths anyway - but in such way that in future diagrams the burden of drawing them reduces to a couple of boolean operations (though that is perhaps moot given that hulf2012 showed me how to export to eps correctlyi)

But I would agree that I probably fall short of any standards expected of a professional illustrator or draftsman.

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

Re: eps with complex clipping paths

Postby Lazur » Thu Nov 14, 2013 2:08 pm

Here is a bit more consistent version:
SVG Image
Personally I have always some trouble with ghostscript, eps/latex, but anyway hope it helps.


Return to “Help with using Inkscape”