Author Topic: Can I Create A Dashed Line With The Lines and Spaces Set To A Certain Millimeter  (Read 983 times)

July 02, 2019, 06:14:49 PM
Read 983 times

patrickonb

  • Sr. Newbie

  • Offline
  • **

  • 3
Hello All,

OK, I will try and make this as straightforward as I can...

I'm using Inkscape for designing my work for my laser cutter. What I need to do, is create a dashed line, with the lines and dashes
to be 2.30mm in length (or whatever else I might need). I've tried the "dashed line" option when I create a line, and click on the
"Stroke style" tab, but it doesn't work as I had hoped. Although I can choose the line to be dashes, it doesn't seem to matter that
I enter 2.30 into the "Pattern offset" input box, they do not come out to 2.30mm or any other number I put in. I thought the input
might be based on pixels and not millimeters, but even that doesn't workout properly.

I originally created a bunch of separate lines that were spaced at 2.30mm apart, but it made the laser machine do very strange things,
and it bounced all over the place as it engraved whatever random line it chose to do at any given moment! It should follow along as if
it was one continuous line, turning the laser on and off as needed for each dash, but it doesn't do that, it turns into a raging beast of
vengeance!!

Anyway, can anyone tell me if there is a way to create a dashed line, and set the spacing to whatever I need? Needs to be a consistent
2.30mm dash line, then 2.30mm dash no line, etc, etc. - - - - - -, so my laser will follow along that single path until finished, and then
move onto the next set?

Any help would be greatly appreciated!

Thanks,
Patrick
  • Inkscape 0.92.4
  • Windows 10, 64 bit

July 02, 2019, 08:45:29 PM
Reply #1

brynn

  • Administrator

  • Offline
  • ******

  • 3,941
  • Gender
    Female

    Female
    • Inkscape Community
Welcome to the forum!

I recall reading that a developer had started work on an LPE that would do something like that, but I don't recall hearing about it being finished or added to a new version.

Since the size and spacing seems the most important part, I would suggest just drawing the dashes as rectangles perhaps, or rectangles converted to paths.  There are plenty of ways to make the alignment precise, and  I can give specific steps, once we have all the details.  Unless this dashed line is a curved line?

If it's supposed to follow a curved path, I would probably suggest using Extensions menu > Generate from Path > Scatter.

As for the order the machine cuts them, I have no idea about that.  You'd have to search through the documentation for the machine (or its software), to find out how it decides the cutting order.  I have a suspicion that it would cut them in the order they are drawn.  Or I don't know, maybe the z-order.  The problem is that various different commands that you might use during drawing and editing, could affect that order.  Although having said that, we could probably suggest some tips that might help, depending on specifically what's happening with that unique file.

Will you be using a particular extension to prepare the file for cutting (I mean either Inkscape extension or file format extension).
  • Inkscape version 0.92.3
  • Windows 7 Pro, 64-bit
Inkscape Tutorials (and manuals)                      Inkscape Community Gallery                        Inkscape for Cutting Design                     



"Be ashamed to die until you have won some victory for humanity" - Horace Mann                       

July 03, 2019, 12:02:28 AM
Reply #2

Lazur

  • IC Mentor

  • Offline
  • ******
  • Inkscape Filters Wizard

  • 1,154
  • Gender
    Male

    Male
Hi.

Yes and no. Maybe. Needs testing.

Dashed strokes on screen are the result of a style setting so adding a custom dasharray won't end up being recognised by the cutter.
(Nonetheless the custom dasharray is set in relation to the stroke width only so you cannot retain a certain gap-line length after changing the stroke's thickness... being the laser cutter stroke's very thin it would definitely interfere with the design process when drawing the original shapes with wider stroke thickness.)

As far as I remember there was a developed extension/lpe (?) that did separate a path into its segments, each getting a new custom dashoffset style settings. Original issue was that setting a dashed stroke to an even sided object end up being looking way off due to every side would have a different dash layout.


So the other route I'd try is using a pattern along path path effect.
That can be customized well enough  and you'd need just converting the result to path before cutting.

July 03, 2019, 08:25:38 AM
Reply #3

Moini

  • IC Mentor

  • Offline
  • ******

  • 1,568
    • VektorRascheln
You need to set those manually in the xml editor. Then they should in theory render correctly.


July 03, 2019, 09:19:07 PM
Reply #5

patrickonb

  • Sr. Newbie

  • Offline
  • **

  • 3
Thanks everyone for your responses. I have opened up the XML editor, and am going to try Moini's solution.
So far, current testing is right on the money! In other words, when I put in "stroke-dasharray: 2.30;",
it certainly seems to be giving me a dashed line that is 2.30mm dash on and dash off, as I need it! Next step
will be testing this on the laser cutter tomorrow. I will let everyone know how it works out.

Thanks for the help and input, I really appreciate it!
Patrick
  • Inkscape 0.92.4
  • Windows 10, 64 bit

July 04, 2019, 11:59:23 AM
Reply #6

patrickonb

  • Sr. Newbie

  • Offline
  • **

  • 3
OK, well it didn't work as expected. The laser simply sees it as an entire line, and ignores the
dashes as if they are not there. I'm sure this is a function of the laser machines software/hardware
setup, so no fault of Inkscapes.

Patrick
  • Inkscape 0.92.4
  • Windows 10, 64 bit

July 04, 2019, 02:12:44 PM
Reply #7

Lazur

  • IC Mentor

  • Offline
  • ******
  • Inkscape Filters Wizard

  • 1,154
  • Gender
    Male

    Male
No stroke-dasharray. Use the pattern along path lpe.
Example attached.

dashwithpatternalongpath.svg
*dashwithpatternalongpath.svg
(7.14 kB . 210x297)
(viewed 311 times)

July 04, 2019, 07:08:10 PM
Reply #8

brynn

  • Administrator

  • Offline
  • ******

  • 3,941
  • Gender
    Female

    Female
    • Inkscape Community
After using XML Editor, after you set the right size/space, do Path menu > Stroke to Path.  Then it should be ready to cut.

Likewise, if you use Pattern Along Path, I think you'll probably have to use either Object to Path or Stroke to Path, afterwards as well.  Not positive, but I think will be needed.
  • Inkscape version 0.92.3
  • Windows 7 Pro, 64-bit
Inkscape Tutorials (and manuals)                      Inkscape Community Gallery                        Inkscape for Cutting Design                     



"Be ashamed to die until you have won some victory for humanity" - Horace Mann                       

July 05, 2019, 12:09:26 AM
Reply #9

Lazur

  • IC Mentor

  • Offline
  • ******
  • Inkscape Filters Wizard

  • 1,154
  • Gender
    Male

    Male
^-No.

Stroke to path=filled region= not a path that can be cut with one go. But a series of holes.

Whereas the attached example above along my first suggested solution would solve the problem most of the time.


Off-Topic: show
Not sure which forum etiquette would resolve the issue of me being gaslighted most of the time.
Hope you understand if I'm getting more and more annoyed. "Why bother?"

July 05, 2019, 02:15:33 AM
Reply #10

brynn

  • Administrator

  • Offline
  • ******

  • 3,941
  • Gender
    Female

    Female
    • Inkscape Community
No, I didn't mean to contradict or offend.  Just add extra info.

patrickonb just reported that it didn't cut the dashed line, only the solid line.  To cut the dashed line, there needs to be paths around the dashes.

So if you use PAP

papc1.png
*papc1.png
(7.87 kB . 547x368)
(viewed 303 times)


And you don't use
1 - Path menu > Object to path
2 - Path menu > Stroke to path

papc3.png
*papc3.png
(7.71 kB . 528x324)
(viewed 316 times)


Won't you just end up cutting the original, non-dashed path?

papc2.png
*papc2.png
(10.73 kB . 552x347)
(viewed 322 times)


Again?

There won't be any way to cut a series of dashes without picking up the cutting head, moving over and cutting again.  Well, there could be, if you draw it that way.  But I'm not clear that's what's wanted.
  • Inkscape version 0.92.3
  • Windows 7 Pro, 64-bit
Inkscape Tutorials (and manuals)                      Inkscape Community Gallery                        Inkscape for Cutting Design                     



"Be ashamed to die until you have won some victory for humanity" - Horace Mann                       

July 05, 2019, 05:02:40 AM
Reply #11

Moini

  • IC Mentor

  • Offline
  • ******

  • 1,568
    • VektorRascheln
Sorry, I forgot this part:

After making the dashes right, do Extensions > Modify Path > Convert to Dashes to turn the dashes into path segments.

July 05, 2019, 02:18:32 PM
Reply #12

jimbalny

  • Sr. Newbie

  • Offline
  • **

  • 2
Wow, after using inkscape and getting frustrated with certain stroke settings that can't be unset (markers) I never knew about the XML editor until reading this post. Very handy, especially if you intend on using SVG code in a website.
  • 1.0
  • Windows 10 / Manjaro Linux

July 05, 2019, 02:18:57 PM
Reply #13

Lazur

  • IC Mentor

  • Offline
  • ******
  • Inkscape Filters Wizard

  • 1,154
  • Gender
    Male

    Male
Extensions > Modify Path > Convert to Dashes to turn the dashes into path segments.

Hah! you got me there, never used that extension before.
Maybe worth mentioning upon testing with the current stabile if the path is drawn as a B-spline (or as a spiro-path for that matter) the convert to dashes extension doesn't work as expected -need to convert object to path first.

July 05, 2019, 02:54:10 PM
Reply #14

Moini

  • IC Mentor

  • Offline
  • ******

  • 1,568
    • VektorRascheln

July 06, 2019, 08:44:07 PM
Reply #15

flamingolady

  • IC Mentor

  • Offline
  • ******
  • Flamingo Lady

  • 154
  • Gender
    Female

    Female
Well, I accidentally posted this in the wrong thread, so just for the sake of it, will copy it here...  better late than never, lol.

Not sure this is helpful, but I'll throw my 2 cents in.  I did a few tests (won't share them all), and the PAP worked, except that I didn't know how to do the code to tell it the size of the space between the dashes.... (I started with a 2.30 cm), did a few tests with doing a dash of 2.30, and space of 2.30. Would have been great except it didn't recognize the end space (I set the last dash to no stroke and no fill thinking it would create a gap).  Wondering if you could start with the 2.30 dash and then set the spacing size to 2.30 in code, then it'd be perfect, well the line would look perfect, so idea if the cutter would like it.