Inkscape path repair extension

I’ve made a new inkscape extension that detects defects in a path. There’s a zip file at the bottom of this post that you can download and try it.

From the readme:

Detailed Description

The Node Detector extension is designed to help vector artists and designers identify and visualize nodes that are positioned extremely close to each other within a path. It provides a visual way to detect potential issues in path geometry that might cause problems in various applications like CNC routing, laser cutting, or vector printing.

Key Features

  • Node Proximity Detection: Identifies consecutive nodes that are closer than a specified tolerance
  • Visual Marking: Adds colored circles to highlight problematic node clusters
  • Customizable Tolerance: Adjust the proximity threshold to suit your specific needs
  • Debug Mode: Optional verbose output for detailed analysis
  • Color-Coded Indicators:
    • Red Circles: Nodes that are connected within the same path segment
    • Orange Circles: Nodes representing path breaks or across different subpaths

What does it look like? Let’s say you have this grid of circles. One of them has an open path.

In the past, you’d have to go digging in the nodes to find them, it’s a manual process and not very fun. If you’ve done this, you know what I am talking about. If you’re an eagle eye you can spot the problem nodes, go ahead, see if you can find them.

Using the extension, the nodes are easily found.:

So that’s one relatively simple example. The more common use case will be more complicated. Take this trace:

Tis is a complex path, and there are many places it can go wrong when tracing or doing something like stroke to path. Running the extension finds two places where the path has a doubled up node, one closed (red) and one open (orange).

Zooming in:

This is an early beta and it may have bugs. Please help me out by trying it. It’s been reasonably well tested but SVGs are complicated with lots of edge cases. It’s very possible that it might fail if you have a complex or unusual SVG.

Read the README. It tells you how to install and system requirements etc.

node_detection_v0.02b.zip (6.9 KB)

26 Likes

Wow. Thanks for this work.

10 Likes

Very nice!

10 Likes

I’m looking forward to trying this out. You don’t take requests by chance?

10 Likes

What you got?

6 Likes

Sweet! Should make cleanup a lot easier!

9 Likes

Kind of a weird use case but it would be very useful to me when cutting out foam board for RC planes to have squares and rectangles exploded into lines and arks with about a mm of separation .

8 Likes

Give me a before and after of what you’re trying to do

7 Likes

At least in my install it did not show up under Modify Path but instead under Generate from Path so it took me a bit to find it!

After that it worked perfectly. It would be nice if there was a way to auto-delete all the circles, but it’s not like it’s hard to select and delete them while I’m all zoomed in on the area :slight_smile:

This will make both vectoring bitmaps, and picking up art from random folks much less frustrating!

10 Likes

Right click, select same… fill and stroke.

It will select all of the items that are the same color. Most likely it will just be the circles.

You could also choose select same object type. They’re all circles. If you have no other circles in your document then that would solve your problem as well. Once all selected just hit the delete key.

8 Likes

I could also insert the circles as a group so they could be easily removed. I’ll do that next version.

9 Likes

This is what you get for asking chatGPT to write your readme and skimming. The docs have been updated in two placesto be correct:

  1. In Inkscape:
    - Select a single path
    - Go to the “Extensions” menu
    - Find “Generate from Path” and select “Node Proximity Detector”

I have updated the extension to put all of the circles in a group It should make it much simpler to delete them all.

New version 0.02b here, and I will update the original post to have it as well:

node_detection_v0.02b.zip (6.9 KB)

7 Likes

before
Sketch9
after
after

I didn’t finish the after as it is quite tedious to do manually, but you should be able to see I am a)breaking the path, and then b) setting the path back just a bit. This way I can color code the paths for cutting and several types of scoring.

6 Likes

Really good idea, I’ll give a test later on.

What I would really like is the reverse tool - which adds short gaps so I can make tabs/bridges to hold pieces to a sheet.

5 Likes

I think what you want may already exist in Inkscape: a custom dash pattern so you can convert dashes to segments.

Does this solve your issue?

4 Likes

Not really, what I ideally want is 1 tab per item. What I would really, really like, is to be able to select a segment of a line, click the button and get a 1mm tab on that line.

Lightburn has an automatic or manual tabs feature which works well for cutting, except I do all my designing in inkscape.

4 Likes

You can pull it off with my other extension, improved cut path.

I’ll write up the workflow when I get a chance later today.

5 Likes

Do you have Cuttle? I thought you mentioned having it.

7 Likes

I do! So you are saying that I just need a lesson on how to convert in Cuttle?

5 Likes

This is impressive! Anxious to give it a try. Thanks for your work and sharing.

3 Likes