A troublesome SVG file.

407 views
Skip to first unread message

Riley Porter

unread,
Sep 7, 2014, 12:24:25 PM9/7/14
to js...@googlegroups.com
I have attached a file that seems to be not working in jscut.  Perhaps I am just doing something wrong.  I cannot click on anything once its loaded.  Can someone else verify this behavior?  I created this file in sketchup exported to dxf then saved as svg in coreldraw.  I know that is a horribly complicated chain.  However the skp svg exporter seems to be broken so this is what I am doing like that at the moment.

Any input would be helpful thanks!

Riley
zsled.svg

Todd Fleming

unread,
Sep 7, 2014, 12:59:36 PM9/7/14
to Riley Porter, js...@googlegroups.com
It's a bunch of grouped but disconnected line segments (open paths). jscut requires closed paths.



--
You received this message because you are subscribed to the Google Groups "jscut" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jscut+un...@googlegroups.com.
To post to this group, send email to js...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jscut/0654c575-8bc0-4ee5-ace0-9e1d432661ed%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Todd Fleming

unread,
Sep 7, 2014, 1:58:15 PM9/7/14
to Riley Porter, js...@googlegroups.com
I'm thinking of adding an STL file importer which extracts the top surface. The problem is that this would only work with 2-manifold (water tight) STL files. If it's not 2-manifold then it's loaded with ambiguity and there's no correct way to do it. Sketchup has a history of exporting STL files with aren't water tight; this drives the 3d printing community insane.

Todd

Riley Porter

unread,
Sep 7, 2014, 9:44:02 PM9/7/14
to Todd Fleming, js...@googlegroups.com
Thanks guys,

I am curious as how to fix files like this?  Is this grouping etc?  
Check this out:


This is a dust shoe for a makita router and the shapeoko 2.  I downloaded it and it seems like its not grouped right.  How would you fix this to make it work with jscut?  I am trying to figure this out so I can get our TinyG product's documentation working to use jscut. 

Thanks guys!  Btw who is the creator of jscut?  Can you reply email me?  I would like to set you up with a TinyG.

Riley

Todd Fleming

unread,
Sep 8, 2014, 6:03:32 AM9/8/14
to Riley Porter, js...@googlegroups.com
Hi Riley,

I created jscut; I'll send you a separate message. I want to see how TinyG handles my high-speed experiments.

I'll drop down to SVG syntax to try to explain open paths vs closed paths vs groups. It would be great if someone would write an explanation in less technical terms.

Here's a path object: <path d="M 0 0 L 100 0" />  This says to move (M) to 0,0 then draw a line (L) to 100,0. The (L) can be left out; it automatically follows an M. Upper case uses absolute coordinates and lower case uses relative coordinates.

Here's a closed loop: <path d="M 0 0 L 100 0 L 100 100 L 100 0 Z" />  The close command (Z) says to connect the last point to the first; this forms a closed path. jscut pretends there's a final Z there if you leave it out.

Here are two ways to have a bunch of disconnected line segments:

Method 1: <path d="M 0 0 L 100 0" /> <path d="M 100 0 L 100 100" /> ...

Method 2: <path d="M 0 0 L 100 0 M 100 0 L 100 100 ..." />

Notice the "M" in the middle of Method 2. Either way jscut sees a bunch of unconnected line segments and not a closed path. jscut's implied Z rule doesn't help:

<path d="M 0 0 L 100 0 Z M 100 0 L 100 100 Z ..." />

The Z closes to the previous M. Each line segment is now a 2-line-segment loop; the loop has 0 volume so is useless.

Here's what happens when you group:

Method 3: <g> <path d="M 0 0 L 100 0" /> <path d="M 100 0 L 100 100" /> ... </g>

Now it's a group of separate line segments. jscut still doesn't see an enclosed volume.

Inkscape has easy commands to combine paths (method 1 -> method 2), break apart paths (method 2 -> method 1), group objects (method 1 -> method 3), and ungroup objects (method 3 -> method 1). None of this helps. It also has more advanced path editing tools, but these are a pain to use if you're trying to close a large set of line segments. They're also really nasty to explain. I don't know of an easy way to fix that SVG.

jscut works on closed paths because it needs to know what is inside vs. what is outside. The only operation which could have worked with open paths is "engrave", but I built it on the same machinery as the rest of the system, so it also requires closed paths.

Todd

Derrak Richard

unread,
Jun 3, 2015, 3:50:58 PM6/3/15
to js...@googlegroups.com, tbfl...@gmail.com
I think the Path>Combine operation in Inkscape may work for you. You'd have to select each of the shapes, in your case the circles and the outline individually, and apply the Path>Combine operation to each.
This video is intended for laser cutters, but I think the basics are the same: http://blog.ponoko.com/2010/08/01/how-to-combine-shapes-in-inkscape-for-laser-cutting-with-ponoko/

If that doesn't work you can join all the points individually, as is shown in this video: https://www.youtube.com/watch?v=cGJi5sXxSfQ
In your case it may be better to use a drag selection (rather than clicking on the two points individually) to select the points as they'll be overlapping.

This is getting beyond my area of expertise (as to the benefits of straight line segments as opposed to arcs), but another alternative could be to re-draw at least the circle polygons using the Circle tool in whatever vector program you choose. Input the correct dimension of the shapes, align/center to the old shapes, then delete the old shapes, and you're set to go. 
Reply all
Reply to author
Forward
0 new messages