Only Curves show up when opening SVG


(Andrew Doran) #1

Trying to open Winston Moy’s bottle opener SVG in Carbide Create to start playing with aluminum, but when I do, only the curves show up. I have tried multiple suggestions from web searches to use Inkscape to resolve this with no luck.

It’ can’t seriously be this difficult to open a vector drawing from one vector drawing program to another vector drawing program, can it? what am I missing? see the image, to see the difference between the file in Inkscape, and CC.


(Byrne Pedit) #2

It appears, for some reason, Inkscape has stored this as a series of line segments instead of continous, closed shapes, one sign of this is their magenta color in CC. Furthermore, I’d posit that the curves have multiple points defining them and that the straight line segments are defined by only two points.

CC has issues with open lines, most notably with the first point. If this first point has no tangent, CC will discard it completely which, in the case of a two point line, discards the entire line. I use open lines all the time in CC, my work-around is to add another point just downstream of the starting point.

I’d think your best bet would be to, within Inkscape, combine all those segments to make nine complete, closed curves.


(William Adams) #3

As @bpedit noted, the problem is this is importing as a series of open paths.

If you’ll let us know where the original is, we’ll try to get it added to the test suite.


(Andrew Doran) #4

I’m sure my problem is being new at Inkscape, but I have searched a bunch and haven’t been able to figure out how to do it. I just now tried using Path>Combine on each of the nine segments. They seem to be combined in Inkscape (they each select as one complete item) but the file looks the same when saved and opened in CC.

The original SVG file can be downloaded here: https://forum.shapeoko.com/viewtopic.php?f=30&t=4080&p=30586#p30586


(William Adams) #5

Here is an SVG with closed paths which will open in Carbide Create:

5

May need to be resized.


(Andrew Doran) #6

That’s awesome Will, Thanks.

Can you explain how you did it please, so that I (and others who visit this thread) might learn?

Cheers
Anderw


(William Adams) #7

Opened in Inkscape, resaved as PDF, opened in Freehand, joined all paths, exported as PDF, opened in Inkscape, resaved as SVG.


(Andrew Doran) #8

Of course, so simple…why didn’t I think of that? :roll_eyes:

Thanks!


(William Adams) #9

It could be done in Inkscape or some other vector editor, it’s just that Freehand is so fast and efficient, I just use it by preference.


(Nathaniel Klumb) #10

In Inkscape, it’s straightforward to join segments… if you know how to do it. What you want to do is select the ends of adjacent segments and join the end nodes. So, what does that mean?

Inkscape: Join Path Segments

  1. With the SVG loaded in Inkscape, select the “Edit paths by node (F2)” tool by pressing F2 or clicking the second icon down on the left side.
    • It’s the small arrow pointing at a middle square in an curve of three points. The icon is just below the “Select and transform objects (F1)” tool that looks just like a plain black mouse pointer.
  2. Click on a path (e.g. one of the offending lines that’s not importing correctly).
  3. Look at the nodes (squares, diamonds, circles) that appear on the path segment you’ve clicked.
  4. While holding Shift, click on a neighboring path segment. Both segments will now be selected.
  5. Drag a box around the point where the segments should be joined. The box can include more than just the ends to be joined, as long as it doesn’t include any additional ends.
    • To zoom in and out as you work, hold Ctrl and spin your mousewheel to zoom. Once you get the hang of that, your Inkscape life will become much easier.
  6. With the two ends to be joined now selected (although you may not see the overlapping ends, as they tend to cancel each other in the display), click the “Join selected nodes” button on the toolbar at the top.
    • It’s about third on the node edit toolbar, right after the plus and minus buttons to add or remove nodes. It looks like two ends on top, with a tiny arrow pointing toward one connected node on the bottom, and if you hover your mouse, it will say “Join selected nodes”.
  7. Repeat along the path, connecting each neighboring segment in turn.
  8. When you get back to the beginning, drag a box around your start/end point, and join that.
  9. Repeat for as many paths as you need to connect.

These instructions make it sound much longer than it actually is, but they should be detailed enough to follow until you catch on and can do it backwards in your sleep with gloves on. Once you have the hang of it, it’s just a rapid-fire repetition of:

  • Select a segment.
  • Shift-select it’s neighbor.
  • Drag a box around the join area.
  • Join selected nodes.

(Nathaniel Klumb) #11

Okay, I’m just starting my testing run on this, and I have to fork the original repository and upload the new completely enhanced sources. I’ll probably rename the extension, too, to properly distinguish it, but for now, here’s the work in progress that is apparently functioning as intended already.

NK_chain_paths.zip (4.4 KB)

This is an Inkscape plugin derived from Juergen Weigert’s “chain paths” extension that he wrote in a week back in 2015. Extracting the two files into your Inkscape extensions directory gives you a new “Chain Paths…” menu option under the “Modify Path” section of the “Extensions” menu, and the extension automatically finds adjacent path segment ends and links them together. My contribution is making it handle groups and transforms, ignore non-paths, and also close paths that loop back to their beginning.

Like I said, I’m not done testing and tweaking it, but since it takes unclosed paths and unlinked segments and basically magically connects them all in one shot (where able), it seemed like something that I should share early and perhaps get some bug reports and feedback from any interested parties.

(I already tried it on the bottle opener and one of my terrain model trail pathmaps, and it took that entire workload and turned it into a click!)