This looks like a great alternative to my past solution, to mask and convert to bitmap. Nice!
Thank you so much for this extension. I have installed the PY file and INX file
and closed out Inkscape and reopened. Where in the extensions menu can I find it?
Ha! Nevermind, I went back and read what I should have to begin with. I was looking for it to say “Better Cutter”!
For another example of workflows involving this plugin:
** A quick note. You must be using version 0.02b+ for this to work. It is being released as of this post.
better_cutter_v0.02b.zip (6.7 KB)
So in another thread, these two things came up:
and
Both of these things can be accomplished with the improved cut path extension (ICP) in basically the same way. Here’s how.
Let’s start with @markevans36301’s example:
Make my life a little easier by turning on some prefs. Snap node closest to pointer and then some snapping options: snap rotational center of objects, and snap to cusp nodes. This just makes the snapping process faster and more assured. It’s optional, but it’s good practice, and what you turn on and off will change depending on your design. This is a bunch of line segments so it’s all cusp nodes, so this was a no brainer.
Make yourself a nice visible small circle in a unique color. I chose 2mm, so a 1mm radius.
Drag and snap circles to the various important points.
Fun tip: when dragging an item hit the space bar to stamp a copy in place. I was able to place all these circles in seconds by hold left click->drag-snap-space-drag-snap-space-drag-snap-space.
I did one half and then selected all of the circles, copy/paste/horizontal flip and snapped the other half all at once.
OK cool. Now draw a rectangle around your entire design, and exclude all of the circles from the rectangle. (Right click on a circle, select same… fill and stroke. This is why we chose a unique color on the stroke, so we could easily select them all later.)
Excluded circles. Ditch that fill so we can see what we’ve done. Here’s a zoom:
Now we use improved cut path on the inner green lines. In my example I combined them all to be a single path with Path->Combine.
It truncates the lines at the edge of the circles. Now we want to remove some of the inner circles so that we can do the same thing to the blue shape in the appropriate places. I simply delete the nodes in question:
select
delete
Do similarly on the inner bottom green line end points:
And now we run ICP on the blue line and pink excluder:
and then delete our pink excluder, and make the stroke a little thinner for visibility:
Done. The gaps are consistent and quick to make. Overall I’d say with a little practice, this process should take no more than about 2 minutes and it will scale well. That is, something that is 3x as complex will probably only take 3 minutes, not 6.
As for @sqw’s issue, you can do the same thing but just snap your circles to line midpoints and possibly cusp nodes and smooth nodes. It should allow you quickly snap tabs where you want them, and then by using the combine/exclude trick, you can easily make gaps in your paths.
New version has been released. The original post was updated with the new zip file. The new version is more reliable with nested subpaths.
You never cease to amaze.
Sounds perfect, I will give it a go tomorrow and let you know how I got on. Thanks for your speedy response too.
Please send me the svg that was causing the error so I can try to reproduce and troubleshoot.
@sqw:
I tried to reproduce this, and had no luck. I really could use more info here. The SVG in question would be best, but a step by step of how you built it would be helpful too.
I made two rounded rectangles, then two ellipses, converted everything to paths, then excluded the ellipses from the outer rectangle path. Then I selected all, made sure the red path was on top of the green one, and ran ICP.
It worked perfectly.
Please let me know more details, I’d really like to know how you got it to bug out.
Found a bug for you!
star_cuts_spiral.zip (11.2 KB)
Ironically I was making an icon to use for the plugin.
@timjedwards nicely done. I was able to duplicate your issue.
Turns out there was a precision issue, I needed to be using a more accurate calculation method.
New version 0.03b! I confirmed it works with your spiral, and then stress tested it with more complex use cases.
New version here, and updated in the main post:
better_cutter_v0.03b.zip (6.9 KB)
That did the trick, excellent work!
we’ve got major building works going on, but will get back to you as soon as I can
I can’t get this to work at all.
Even trying the simple rectangle and spiral example. I create a spiral, then convert it to a path. I then create a rectangle and convert that to a path as well. they are the only two things in the test file.
when i run the extension i get this.
inkscape has recieved additional data form the scrip executed. the script did not return an error but this may indicate that the results will no be as expected.
Traceback (most recent call last):
File “C:\Program Files\Inkscape\share\inkscape\extensions\better_cutter.py”, line 325, in
PathCutterWithNodes().run()
File “C:\Program Files\Inkscape\share\inkscape\extensions\inkex\base.py”, line 250, in run
self.save_raw(self.effect())
^^^^^^^^^^^^^
File “C:\Program Files\Inkscape\share\inkscape\extensions\better_cutter.py”, line 101, in effect
length = sub.length()
^^^^^^^^^^
AttributeError: ‘PathCommandProxy’ object has no attribute ‘length’
And no modification to the spiral. Both the spiral and rectangle remain in an uncut state.
You’re getting the same error that @sqw was getting. Can you please give me the SVG so I can verify and troubleshoot it?
Also please confirm that you are using version 0.03b. (the latest as of now.)
Even simpler. I was using inkscape 1.32. When you mentioned newest version i double checked the inkscape verion i was running and then upgrades to 1.4.
Works fine now. Damn i hate beating my head against the wall for silly reasons.
Also, really cool extension. Thanks. Cool things will be done with it.