Dash lines convert to rectangles when Stoke to Path is used?

Post about using Inkscape with cutters or plotters.
ColinR
Posts: 4
Joined: Mon Feb 23, 2009 2:33 am

Dash lines convert to rectangles when Stoke to Path is used?

Postby ColinR » Mon Feb 23, 2009 2:39 am

I use Inkscape for clients who buy my cutting plotters in conjunction with Signcut to produce signs, craft effects, card designs etc. It works extremely well via signcut except when I use patterned lines etc. such as a dashed effect.

The 'dash' always converts to a 4 sided rectangle rather than a simple line - space - line - space effect.

Is there any way to turn off the 'rectangle' effect and be left with a simple dashed line?

User avatar
loonquawl
Posts: 135
Joined: Thu May 15, 2008 7:57 pm

Re: Dash lines convert to rectangles when Stoke to Path is used?

Postby loonquawl » Thu Feb 26, 2009 12:30 am

I guess the end product is one rectangle, the size of the line if it had not been dashed?
-> I guess this is because the dashed line is still a line - e.g. the code says "line from A to B, looking dashed" - I suppose the Signcut program ignores the "looking dashed" part, just as it would ignore any other "looking ..." (gradient, colorshift etc).
One (admittedly dumb) solution i tried with a similar problem: Make the thing a bitmap, and then do some Bitmap2Path magic in Inkscape, then export to eps and Signcut...
Or: make a number of rectangles and do "pattern along path" for an invisible path where the dotted line should be.

ColinR
Posts: 4
Joined: Mon Feb 23, 2009 2:33 am

Re: Dash lines convert to rectangles when Stoke to Path is used?

Postby ColinR » Fri Feb 27, 2009 8:43 pm

Thanks for the input, the problem is, I don't want any rectangles, I want a point A to point B and the line has already been converted to a path so it does not 'look' as though it is dashed, it is, but instead of a series of single lines with spaces it is converted to a series of rectangles with spaces.

I need single x,y to x,y coordinates with spaces, thats it, imagine drawing a dashed line on paper, you would not draw each line item as a rectangle, you would put the pen down draw a line, pen up, move pen the required space, pen down, draw a line etc. etc.

I need a line - space - line - space, effect. simple x,y coordinates that draw a series of straight lines with spaces in it.

User avatar
loonquawl
Posts: 135
Joined: Thu May 15, 2008 7:57 pm

Re: Dash lines convert to rectangles when Stoke to Path is used?

Postby loonquawl » Fri Feb 27, 2009 9:41 pm

I had some (limited) success with a very short, horizontal path, that is then applied to the original path via "pattern along path" with the "repeated" option.
I also tried duplicating the path, making one duplicate "stroke to path" and then cutting the underlying path with this succession of boxes - sadly, it seems there can only be one path as the result of such cutting , so that did no good either.

The tool you are using to convert the inkscape work to cutter compatible filetype is to blame in my opinion - it should convert the code from "looks like many small lines" to "_is_ many small lines"

User avatar
kelan
Posts: 178
Joined: Thu Sep 06, 2007 12:55 am
Location: Unicorn of Open Source
Contact:

Re: Dash lines convert to rectangles when Stoke to Path is used?

Postby kelan » Fri Feb 27, 2009 10:53 pm

Unfortunately, there's not an automatic way to do what you want. It would be nice if stroke to path had an option for creating a line path rather than a shape path, but currently it doesn't.

However, you can achieve the effect you want with some effort. Here's how.

Easier way, if you don't need the dashes to be a specific distance apart:
  1. Draw the line.
  2. Switch to the :tool_node: node tool.
  3. Select all to select both nodes.
  4. Press Insert a number of times. Each time you press it, a new node will be added between every two existing nodes, essentially doubling the number of nodes. Keep pressing Insert until you have the desired number of dashes.
  5. Here's the tedious part, because you have to do each segment individually. Select a segment between two nodes (ie, click the actual line segment), and then press the "split path between two non-endpoint nodes" icon on the toolbar. The icon looks like two nodes joined by a segment on top, pointing to two nodes unjoined below.
  6. Now do the same for each segment you want to remove.
You'll end up with a dashed line, and not a bunch of small rectangles. Unfortunately, I couldn't find a keyboard shortcut for split path, which would make this operation much faster.

If you do need the dashes to be a specific distance apart, you can replace step 4 with this: Go to the Effects menu, Modify Path submenu, Add Nodes option. That lets you specify the distance between the nodes. Note that the last segment of the line might not be the correct length unless the line length is an exact multiple of the distance you specified. After the nodes are added, proceed with the rest of the steps above.

As I said, it's more work for you, but you'll get a nice dashed line that should behave as you intended.

DrunkenSailor
Posts: 1
Joined: Wed Aug 12, 2009 8:55 am

Re: Dash lines convert to rectangles when Stoke to Path is used?

Postby DrunkenSailor » Fri Dec 11, 2009 5:26 am

Edit: Don't read this, read the next comment first it's MUCH simpler than my method.

Doable in version 0.47.

Use pattern along path, then object to path. This is fast.

Draw a short straight horizontal line segment the width and length you want your dashes. Copy it to the clipboard. Select your line. Open the path effect editor, select pattern on path, click 'add', select repeated (stretched or not), click the from clipboard icon and then go to the offset section, click offset in units of length, now go to the number entry section labeled 'spacing' and start making the number bigger. Your line should start becoming dashed, with the length of the spaces being the fraction of the dash length shown in the 'spacing' entry box.

At this point it's still one long line with a fancy new effect applied, but it's a line. It's very likely your cutter can handle this effect better than the 'dashed line' setting, I guess it depends on how Inkscape sends it to the cutter. But don't fret if it doesn't. Just go back to the path menu and select 'object to path'. Now get the node tool and check. You should have the dashes turned into individual line segments, not filled rectangles. Nodes on the ends of each segment. Of course the line is no longer editable as a line, its a series of subpaths which are lines, so it probably would be better if your cutter can handle it without 'object to path'.

Got more than one line to do? Got a lot of lines to do? BEFORE selecting 'object to path' in the last step, copy your newly created dashed line (still just one long line with an effect applied) to the clipboard. Select all the lines you'd like to do this to and then select 'paste path effect' from the clipboard. Presto, all the lines should be dashed. NOW select 'object to path' from the path menu (if necessary). All the lines should now be individual paths consisting of subpaths for each dash which are line segments, not filled rectangles.

DS

Edit: one. I just noticed the date on the orig post. You probably solved this long ago. Didn't mean to necro this.

two: after reading the next comment... uh, Never mind.
Last edited by DrunkenSailor on Fri Dec 11, 2009 6:44 pm, edited 1 time in total.

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

Re: Dash lines convert to rectangles when Stoke to Path is used?

Postby ~suv » Fri Dec 11, 2009 8:24 am

Why not use the new extension in Inkscape 0.47 specially developed for this issue?
'Extensions > Modify Path > Convert to dashes'


Return to “Inkscape & Cutters/Plotters”