Concentric engraving inkscape plugin

If you haven’t read this thread, go check it out:

Then you’ll see this:

And I like a good challenge, so… off to learn how to make an Inkscape extension! Or, fi you know your Sagan, I must first invent the universe (AKA, learn python and like 37 other things).

What it does:

It converts selected stroked paths to be nested paths that fill that stroke, so you can engrave along the path instead of side-to-side.

Here’s how that looks.

Start with two paths:

Take one, and convert it the traditional way using stroke to path, and you get a filled shape:

What I’m offering is a way to make that concentric offset paths. Select the blue path.

Use the extension (I’m calling it Offset Engrave", inside Generate from Path):

Select the desired LPI:

and when all is said and done:

Zoomed way in…

Want to help me out? Give it a try:

offset_engrave_v0.02b.zip (7.4 KB)

This is largely untested, I’m just one guy with one setup. Please try it out and let me know how it goes.

18 Likes

Looks great, it will be several days before I can possibly test but will when we get back in town.
Extra points for the Sagan quote.

8 Likes

Thank you for all of the effort you have put into advancing the user knowledge base with this and so many other Glowforge related things. I will test as soon as possible.

8 Likes

That’s brilliant! Totally gonna give it a go :smiley:

Plugins are such a grand way to get improvements to a program that focus on exactly what you want them to do, but I never considered trying to create one.

10 Likes

Ah hah! SO, you have to have it in node mode - but you cannot also have those nodes selected, or you get a failure.

Solved Issue

So I’m definitely having issues. I’ve tried doing straight boxes with no luck. Once I combined two boxes into an O and it worked perfectly, but recreating those steps I find I can’t get it to do it again. Not sure if it’s a chaching issue, but even opening a new design I can’t repeat my success :frowning:

  • I note that it defaults to outputting lines at .002" - which at least for me is smaller than the eye can see - if that’s hard coded I’d suggest a .007" minimum.
  • Also that you have to have the paths in node-mode for it to notice them (otherwise it says “no paths selected”), is worth adding to the readme if that remains true :slight_smile:

No idea if you’d get anything from output, but these are the files I made:
Success
Success II

Neat - now I’m gonna play with more complicated things :smiley:

7 Likes

Rectangles aren’t paths. You have to do “object to path” first.

Click on your shape and look at the bottom of your window, it should say something like “one object of type path selected”. That’s how you know it’s a path for sure.

The issue with stroke thickness at the end is that 300 lpi is 0.003333”. If I go any higher than about 0.002 it’ll look like a solid line again.

I could modify the output to make the strokes of the paths increase if you do lower resolution, 100 lpi is 0.01”, so I could go up to like 0.008 and still have gaps.

I might also put text in the output to let people know that it’ll be very thin lines. Hmm this is good feedback, thanks for trying it out.

I’ll collect more feedback and make changes when there are a few more opinions. I need to handle extremely thick lines better, right now I have a hard limit of 500 new paths, I probably need to make it fail more explicitly before it does anything, rather than just stopping at 500.

6 Likes

Btw combining two rectangles into an O makes a new path. It converts the rectangles to paths first if you do a Boolean like difference or exclusion.

5 Likes

Much funkier shapes (though not actually with crossing lines, it’s faked)

I see now why the line weight is .002" though! With the busier ones it just becomes a black block at .007"

Fret_Outset Engrave

5 Likes

They were definitely paths…

Ah ok, digging in - if I change it to a path and go immediately to the offset, it failed. If I deselect, and re-select, it works fine. BUT - in both cases when I tried to record exactly what it just did so I could post a video, it worked fine. Rectangle object > convert to path > offset engrave.

I swear, I’m not nuts. It really did fail before! Weird.

Edit 1
Might be that I’m running into that total number of lines limit. I did a .75" wide piece at 300lpi and got the “No paths” error - but that exact same shape at 100lpi and it worked.

Edit 2
Also, I see what you mean about actually crossed lines, but having to rotate a few handles is a small price to pay for everything else being automated!
Success III

3 Likes

Shouldn’t be. 0.75 * 300 is much lower than 500. Maybe post the file that failed if you have it so I can try to duplicate it?

4 Likes

Sadly I no longer remember which it was, and both things I tried had no issue, so clearly I just need to complain about it not working and you cross through the ether to fix it for me :stuck_out_tongue:

5 Likes

This is excellent… hats off to you. Reminds me a bit of another plugin for the eggbot which created infill … no idea if this is helpful to you but that plugin is out there.

5 Likes

Thanks!

Yes i think the eggbot one is the crosshatch extension that I mentioned in that other thread.

I’m planning to dig into that one to learn some things from it now that I know how extensions work. I have ideas about how to extend it.

5 Likes

I have found that making a shape in Gimp and then save it, inset one pixel, and save again, etc etc. reload the first and outset one pixel etc.

2 Likes

I’m not sure you finished that post? If you did I can’t tell what you’re trying to say, can you elaborate?

2 Likes

Neato! I got a little dialog that essentially said “inkscape didn’t error out but it said some stuff”, but despite that it seems to have worked like a charm.


A little looping on the tightest part of the bend, interesting.

For those who complain the thin lines “disappear”, there’s a view setting for that:

I commonly set my line width to approximate the kerf, so “Enhance Thin Lines” is useful!

7 Likes

Thanks for testing that. Do you have the file pre-extension? Id like to see if I can find out what error it is.

Also it looks like you get weirdness when you have your stroke set to have flat square edges. I think you have lots of lines that overlap on the end there. This is actually a problem.

I did my test with rounded caps. The extended square end would work well too.

4 Likes

spiral

Let me know if that works for you, I have a fuzzy memory that the forum code can muck with .svg files…

5 Likes

Cool thanks. And yeah that spiraling at the corners is a thing with stroke to path. There’s probably nothing I can do with that, it’s part of why the extension says to carefully check your resulting paths.

4 Likes

Did a test on one of my canvas experiments with this image;

This first one was a 1 hour 45 minute engrave on a 10 by 10 originally black canvas:


The paint was a little too dark for good contrast but you get an idea of the details.

This next one was a score using the plugin (200DPI) and a traced bitmap of the original image:

It turned out very nice and took only 35 minutes. That’s a nice chunk of time saved. The contrast is also more consistent than the original.

Thanks Dave. This will make a fun addition to the arsenal.

12 Likes