Trace from Vector outline

Post questions on how to use or achieve an effect in Inkscape.
acklenx
Posts: 5
Joined: Fri Sep 28, 2012 1:26 pm
Location: Charlotte, NC 28203

Trace from Vector outline

Postby acklenx » Fri Sep 28, 2012 2:11 pm

Hi my name is Quincy and I'm fairly new to Inkscape. I have a similar question several that I've found already - "Logo Outline" (very recently here) and even on the FAQ how do I make a T. But none of the posts seem quite appropriate/satisfying...

I have a black and white vector image of a schematic symbol (a diode) and I want to change the "stroke style" to make it thicker. I then want to cut the resulting perimeter on a laser cutter. The problem (I think) is that the stroke doesn't have a perimeter.

I've tried "object to path" and "stroke to path", grouping and ungrouping before and after. And of course trace bitmap. And a few other things. Nothing seems to have any effect except the old manual trace and bezier by hand... which I tried - and it was ugly. Not to mention it takes quite a while (did I mention I'm fairly new to inkscape). The vector file I have is actually 4 grouped strokes that overlap (but the joints are essentially hidden). So this seems to fall squarely in the camp of how do I make the letter T from the FAQ... but I actually managed to get it to work once by dumb luck (as in I cut the parts out on the laser... but they weren't thick enough). I tried to retrace my steps and failed, but I did it once, so I'm convinced there actually is a way to do this automagically.

So for simplicity sake, if I had a letter T made up of two strokes, and then I change the stroke style to be 50px instead of 1px, with rounded corners and end caps... what is the fastest/easiest way to get the vector outline? Tracing by hand is out (really, I tried, it was bad). It seems silly to save the file as a bitmap just so I can run the trace from bitmap operation. but at least that's more magical ;) If that really is my best bet, are there tips for making results better? It's a two color (black and white) very clean (smooth, consistent turns, straight lines, etc,) file. That has to be the best case bitmap, no?

I see a lot of commands that seem oh so promising. "Path > Offset" - as best I can tell leaves some funky mirroring in one dimension. "Path > Combine" seemed like a way to get two (or more) strokes into one... but had no effect on other operations that I could tell. And many of the filters and effects had promising names but didn't do what I expected/hoped.

Please tell me I'm not whining in vain. Is there a better way?

Quincy

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

Re: Trace from Vector outline

Postby brynn » Fri Sep 28, 2012 4:34 pm

Image
Welcome Quincy!

Using the T example, where the T is made up of 2 stroked paths, there may be a few ways to go about it. Select both at the same time, then Path menu > Combine, then Path menu > Stroke to Path. Or select both, the Path menu > Union, then Path menu > Stroke to Path. Note that Combine and Union are different commands, and aren't always interchangeable, as they seem in this situation. Another route is select both, then Path menu > Stroke to Path, then Path menu > Union. And maybe others will chime in with other ideas.

I'd say Union and Stroke to Path (or vice versa) might be the most appropriate, as far as understanding Inkscape. But any of those 3 techniques will get you the outline around the T.

I like how you seem to have jumped in with both feet, to learn Inkscape. That's how I learned too. After asking a few questions in the forum, I realized that I could sometimes, if not often, find answers on my own, using the manual. And once I started in on some tutorials, I started blazing up my learning curve. I would start a tutorial to learn a certain technique, and end up learning 2 or 3 other things along the way. So things really started to fall into place. Even now, I like to do new tutorials from a whole new perspective. I learn a lot now, by seeing how others have solved the same problems I've had.

Anyway let us know how it goes. And have fun :D

acklenx
Posts: 5
Joined: Fri Sep 28, 2012 1:26 pm
Location: Charlotte, NC 28203

Re: Trace from Vector outline

Postby acklenx » Sat Sep 29, 2012 12:50 am

Thanks for the quick reply. I gave it a quick test this morning before heading to work. No luck. Perhaps I'm just missing something more fundamental... like how to recognize success. My expectation is that when I'm "done" I'll be able to set the Stroke and Fill properties to such that what was previously the stroke, is now the fill, and the perimeter/outline is now the stroke. I would then turn the fill off, and voila - joy and happiness, no?

Is it working and I don't even know it? (thought it's entirely possible I messed up a step, or didn't fully reset before trying "union" approach, so I'll try all methods again this afternoon)

Now that there is a laser at the local hackerspace I'm a lot more motivated to learn Inkscape, so I'll think I'll take your advice and start on tutorials.

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

Re: Trace from Vector outline

Postby brynn » Sat Sep 29, 2012 12:54 pm

Hhmmm.....I don't know why it's not working. ....Ok, I've re-read your message. You said you have 4 grouped stroked paths. Try ungrouping first, then follow my steps.

acklenx
Posts: 5
Joined: Fri Sep 28, 2012 1:26 pm
Location: Charlotte, NC 28203

Re: Trace from Vector outline

Postby acklenx » Sun Sep 30, 2012 2:09 pm

So I gave it another go and "discovered success". That is to say, I think your instructions worked the first time, I just didn't realize it. I had the Fill and Stroke window open the whole time and it didn't change after I did the Stroke to Path, and there was no visible change to the image either. So I assumed failure. But I just had to go back and change fill to none, and set the stroke to .001 and it worked! (Or rather it made it apparent that it had already worked the first time around).

To be sure it was the Combine that worked (on the "diode" schematic symbol).

...Then I tried to do the next symbol (a transistor) and both the combine gave some really bizarre results. It looked like some abstract art. After reading through the manual this made sense for the combine operation. So after setting the Stroke to the desired thickness and then tweaking the placement and size of the overlapping strokes to get things looking the way I wanted I had to:

Ungroup everything
Path > Union
Path > Stroke to Path
set Fill to None
set Stroke Paint to solid and black (not none)
set Stroke Style width .010in (**most_of_the_time* I can't see lines if I set it to .001, but sometimes I can - but the laser doesn't care on vector cuts anyway)
----- This gets the outlines of all the individual objects/pieces (as if the combine didn't really work the first time... except for the outline part)
Path > Union - if figured try again and it worked! (....but only once)

So in an effort to help the next poor guy that came along I thought I would follow up and post what worked and what I observed (at the hackerspace the night before). To be accurate I tried to reproduce the steps exactly... but I got different results. I tried for a couple of hours, reading the manual, trying stuff, looking at a tutorial, try (mostly the same stuff again), and it just wouldn't work. In particular the last step where I ran the Path > Union again to reduce the outlines to just one useful set. Nothing would happen/change. And this time I tried mucking with path and style settings to see if it worked and I just hadn't noticed. Nothing. With the diode that wasn't necessary at all. And with first transistor that I did it worked when I ran the Union command a second time (after the Stroke to Path command). But doing the transistor a second time from scratch for documentation purposes failed.

In the end I ended up needed to select just two paths at a time ( in the correct order no less - which was a guess and check and guess again affair ), until all the paths had been unioned together. I believe this is because of the z-index associated with the various strokes. And I guess it was just dumb luck that it worked the previous night in one fell swoop. It was a bit of a pain to guess and check though each pair to get the union to work (and a huge pain to figure out in the first pace ;) but it worked great. Hopefully there is a better way, but for now it got the job done. And hopefully the next guy will know that there may be one other thing worth trying.

Did any of that make sense? Thanks again for your help.

And that failed!!

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

Re: Trace from Vector outline

Postby brynn » Mon Oct 01, 2012 2:16 am

acklenx wrote:And that failed!!

Image I'm confused. Have you got it working?

As I read through your comments, I suspect there's probably a good explanation for the difficulty you're having. But since we don't have access to an SVG file, or even a screenshot, it's hard to say exactly what the problem, and explanation of the problem, might be. Since the "T" example was a clearly understandable situation, I was comfortable offering suggestions, and didn't ask for an image. But it sounds like you have other symbols that are not so simple as the "T". If you would like to provide an SVG file, with a couple of the more complex paths, we can look at them, and tell you what's happening. You sould be able to Union any number objects. But if there are any closed paths, or loops created by overlapping, it won't work as easily as the simple "T" example.

You can attach an SVG file to a reply using the full editor (not Quick Reply), or upload wherever you want, and give us the link to it. ORR, if you're sure that everything is simple stroked paths, a screenshot would be fine. But if you have, for example, a spiro spline in there, it could really throw the proverbial wrench in the works, as they say :lol:

Have you found the status bar yet? It's the single best tool, imo, for learning how to use Inkscape....although manual and tutorials are helpful too. Anyway, the status bar gives you all kinds of info about what you're doing. Selecting objects with Selection tool tell you what kind of object is selected. Various different kinds of info is shown, depending on which tool is engaged, and where the pointer is (i.e. mouseover).

Anyway, sorry to be rambling. Please feel free to show us a screenshot, or provide the SVG file, if you want :D

acklenx
Posts: 5
Joined: Fri Sep 28, 2012 1:26 pm
Location: Charlotte, NC 28203

Re: Trace from Vector outline

Postby acklenx » Mon Oct 01, 2012 3:14 am

Quick reply first. I tried one shape (the diode) and it worked - success. Then I tried another shape (the transistor) and it didn't work... it needed another step - success. The I tried the transistor again from scratch the next day - failure. But even in that failure I was able to go step by step doing unions and get the same transistor as I had the previous day - painful success. I have a file exactly as I need it now. And truth be told it's not that painful. If I had to carry on like this I could. But in the interest of help others just as much as helping myself I thought I should follow up with my experience. And yes I agree a picture or two will sure help. I'll gather those up and reply again. But at this point I don't _need_ a better solution, you got me where I need to be. But if you would like to understand how I got so messed up in the first place, please take a look - I sure wouldn't mind a better solution, let alone _knowing_ what went wrong and how to avoid it in the future. (If i would have to guess I would say the other the strokes are drawn would change everything).

Images shortly, thanks again

acklenx
Posts: 5
Joined: Fri Sep 28, 2012 1:26 pm
Location: Charlotte, NC 28203

Re: Trace from Vector outline

Postby acklenx » Mon Oct 01, 2012 3:56 am

I started with a file that was nothing but paths and I adjusted the stroke width and stretched moved things around to get the shape the way I wanted it. This file is that result, and the starting point of the part I didn't know how to do.
Transistor.svg
Symbol modified to "look" right, but still in need of paths for the laser.
(18.89 KiB) Downloaded 201 times


After the union, stroke style, I'm left with a that looks as though the initial union didn't work. From here I tried to do the union (or maybe combine) again and it worked one day but not the next (on a different file of the same symbol, but created from scratch).
Transistor2.svg
outlined but non unioned/combined
(21.34 KiB) Downloaded 290 times



And this is the end result I was after. Just the outline. I'm still in the prototyping phase of getting these shape just right, so it's kind of important to be able to quickly and reliably go from mucking with the shape and position of the strokes to just the outline.
Transistor3.svg
finished transistor
(19.93 KiB) Downloaded 187 times


My best guess is that for some reason the transistor didn't get the union applied originally.

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

Re: Trace from Vector outline

Postby brynn » Tue Oct 02, 2012 6:46 am

On that kind of a symbol, Union is not the proper way to start. It works on the simple T, but not this one.

I think there may have been some confusion on both our parts, about terminology. While it IS all paths, it's not all stroked paths. The triangle has a fill and no stroke. I would suggest that the first step should be to make sure you know what kind of objects are in the graphic. **

As before, there may be more than 1 way to do this. And in this case, Combine is not needed.

I started by dragging a selection box around the whole symbol. ** Then Path menu > Stroke to Path, then add stroke and remove fill. Don't panic, it looks weird because the strokes are 33.something px wide. Still leave everything selected and go to Object menu > Fill and Stroke > Stroke Style tab to change the width to 1.0 (or whatever you want). Now, still with everything selected, you can do the Path menu > Union.

You can streamline adding the stroke and removing the fill, by using the indicator area in the bottom left corner. The X at the far left end of the color palette removes the fill. Then Shift + click on any color either adds a stroke if there isn't one, or changes the color of the stroke. It's a little faster than using the Fill and Stroke dialog. If everything in the file is stroked paths, you can skip clicking the X to remove the fill. But you'll still have to add the new strokes. Also, there are key shortcuts for Stroke to Path, and Union, which will make it faster too. (See Help menu > Keys and Mouse Ref.)

**In your Transistor.svg file, Ctrl + A shows 7 objects. Only 6 are visible. The 7th is called "Link without URI". I don't know what that is, but it probably came from wherever the image was originally drawn. Union cannot be used on it because it's not a path. That may be what was causing some of your problems, especially if you were using Ctrl + A or Edit menu > Select All. You can select this Link by using the Tab key to cycle through the objects. Tab until the status bar says "Link without URI", then delete. You won't see anything when the status bar indicates it's selected, but if you use Delete key, it's gone. Unless you need it.....now that I think about it, perhaps "URI" is supposed to be "URL", which is basically an internet link. Well, whatever it is, if you need it later, don't delete, and use the so-called rubberband selection technique on the symbol, instead.

Journy on! Image

User avatar
flamingolady
Posts: 687
Joined: Wed Jun 10, 2009 1:40 pm

Re: Trace from Vector outline

Postby flamingolady » Tue Oct 02, 2012 10:10 am

ok, I haven't read all or even most of the posts, but am wondering if you've done the 'path' then 'union', then path simplify method? Try this method on a basic 'T' so you can see what I mean (I suggest making 2 rectangles for the T, then object to path, group them, then path - union, simplify).
that would give you a good cutting path, you may not need to simplify the path, sometimes you have to add nodes for a cutting path too.

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

Re: Trace from Vector outline

Postby brynn » Tue Oct 02, 2012 3:35 pm

I'm not sure I follow, dee. There really is a fairly minimum number of nodes in the final result. If you use Simplify where it's not needed, it just shifts nodes around, and can deform the paths. If there were a couple of hundred nodes, maybe. Ok yeah, I tried Simplify, and it reduced nodes from 68 to 41, but the path was noticeably deformed. Slightly, but noticeably. I would really only use simplify if the number of nodes in a file was affecting performance of the file (freezes, crashes, etc.). Although maybe I don't follow your reasoning for the cutters.


Return to “Help with using Inkscape”