Polylines with real arcs for CNC Router?

There is no way that Sketchup could or should have knowledge about the requirements for all CNC equipment and the CAM sofware driving the equipment.

Sketchup simply provides a generic DXF export solution.

Additionally - each industry have their own requirements. This is why I built my own DXF import / Export to specifically support the kitchen cabinet industry.

In my opinion Sketchup does a few things not conducive to the CNC industry.

So I created my own approach.

  1. Sketchup groups are used for layer names and to isolate geometry. Groups do not create DXF block inserts.
  2. Sketchup components do create block inserts. Some CAM software cannot handle blocks.
  3. Faces are exported as a single polyline and the segmented arc is skipped and exported as a bulge within the polyline.
  4. Reverse faces produces CW direction. Normal faces produce counter clockwise direction.
  5. My export adds a construction point at the center of circles and also adds text showing direction of cut.
  6. Some CAM software can handle 3D DXF some cannot. So My cabinet software supports both.

The image on the right was exported and the image on the left was imported after the export.

image

0.dxf (1.0 KB)

1 Like

The problem with dislodging is not just causing malfunctions in the CAM software but also in Autocad. In fact, it is the same problem but producing different anomalies in the two programs.

To demonstrate, i followed IanT’s approach by creating a larger rounded square with original rounded corners (no copies from double clicking) to see what effect it produces in the two programs. In the machine software the two right side corner arcs were still dislodged and in Autocad those same two corner arcs did not form into a polyline as the rest of the geometry did.

Large rounded square in Torchmate:

Same exact file in Autocad after PEDIT (polyline function) is applied:

So its clear that this is a bug and i hope the Sketchup team sees it and considers attempting to fix it.

Is this exporter available as a standalone extension?

I second that. If this or some other extension that fixes the problem is available then i will certainly use it.

Edit: This extension does the trick in skp_to_dxf.rbz (3.0 KB)

But its flawed since it doesn’t do real arcs and doesn’t support nested components.

Currently no - it is just part of my CabMaker 3 suite.

The main reason is I support just the subset that my industry needs. If I were to provide a plugin with just these current features I would get flack because I don’t support this or that.

That’s unfortunate, it does sound interesting I think it could be of use to me and the OP. However I don’t think Cabmaker would be of great use as all my parts are one offs sometimes consisting of fairly complex arc geometry, hence my problem.

You could email me a number of examples that you are trying to support.

@gkernan In skp file format?

Yes - that would be fine.

Additionally I support z == 0 which is good with most CAM software.

Ian
I had time to test out your 3 examples. I had to modify them to fit within my own paradigm. Currently I only support groups for the outermost container which contains 1 or more groups. Each machining operation is in a separate group. So for CNC drilling I put the holes on part three into group layer “Drilled”. The other groups that contained the outside part I put into group layer “OutsideCut”

As you can see the DXF files are quite small. Interestingly Sketchup’s built in DXF import does not import these DXF’s properly. Sketchup got the overall shape right but did not convert the polyline as arcs.

Check these DXF’s out and see if they present any problems with CNC

Gkernan.skp (402.7 KB)

second.dxf (1.2 KB)
third.dxf (2.2 KB)
first.dxf (657 Bytes)

@gkernan
Thankyou very much for your time with this, I will run a few tests and get back to you.

You seem to be at a high level of understanding so I’ll leave this info for now to see if it helps any more:

I imported “first” into machine software which basically just froze. I’m not sure if that is either the DXF format of the file or the fact the geometry is not exploded into separate entities. So I opened it in DraftSight and exploded the geometry into separate entities of lines/arcs as I usually do then saved as “ASCII R14 DXF” file format that it only seems to accept in the import environment.

I imported that into the machine and the arcs are in correct position for that case, encouraging.

I would only usually export a flat plane with no depth to it or face. The machine would not recognise any height to the part as it is instructed manually on import for the work height and the depth of each cut along with cut direction which can be changed too. The main importance (for me) is simply to retain the positions of the arcs on export from SU.

I’m not sure if any of that makes sense or is of help to you, but is what I find in my limited experience. As you’ve said already all cam is different.

Thanks again

I have options for 3D and for 2D. The advantage of 3D is that the depth of cut is automatically handled. For those CAM that can only work with 2D a frequently used strategy is to embed the depth in with the layer name.

The majority of my clients do not require exploded polylines. Under the hood in Sketchup I work with the outer loop of the face. This is the easy way to get all the vertex in the proper order and to give the user a way to control direction of cut.

The usual acid test is if AutoCad can read the DXF file. I did check Turbo Cad and ABViewer and they both read the files just fine. I don’t have AutoCad but I have sent files to a friend to check out. AutoCad seems to be the most picky on having certain codes in a very particular way. I have not tested the DXF output with Auto Cad as of yet.

Here are 2D files

third.dxf (2.2 KB)
second.dxf (1.2 KB)
first.dxf (655 Bytes)

Thanks for that info, yes my cam is only designed to work with 2d I believe. As for embedding the depth into layers that’s something I’ve not tried but could look into it, I have a very basic manual for the machine importer somewhere, but much success has only come through trial and error.
Yes DraftSight (similar to AutoCAD) reads the files fine. I have always exploded polylines for machine import, but maybe that’s worth a few tries too to differentiate between either that or simply the DXF format.

Second 3d machine import, exploded polylines again and saved as ASCII R14 format, looking good:

Third 3d machine import, exploded polylines and saved as ASCII R14 format, good again. The circle is identified as a boring operation as it should. These parameters assign depths and tools to the operations and similar parameters are assigned to profile operations.

So far so good with the first 3 examples, all arcs have retained their positions. I see while I have been writing you have posted some 2d examples, I will get back to you later with those.

Thanks again.

I now remember why I explode them, this is FIRST2d without exploding. The arcs are basically ignored:

So, as my last reply, I have to explode the polylines in order for the machine software to read the data of the arcs in my case, I also have to always save the DXF as ASCII R14 in all cases. That makes things work.

2D FIRST, retains all arcs and in correct position in machine…

2D SECOND, retains all arcs and in correct position in machine…

2D THIRD retains all arcs and circle “holes”, in correct position on machine…

To make all this fair and make sure none of this was all a giant fluke, I tried a “usual 3d export” from SketchUp with all 3 profiles to see if they would behave.

In DraftSight, all appears normal and arcs are retained…

Drop that into the machine and there’s a lot of fixing to do, the issue is the same…

I don’t really understand all the technicalities of the exporters, but whatever it is you’re doing with your software, it seems to work.

It works! I’m interested.

Is the extension up for sharing?

Dave,

Currently it is only available in my CabMaker suite.
Before I consider reworking it - please try the DXF’s that I produced and see what you get.

Garry

@gkernan I would be happy to do any further tests for you, if you were to rework it. My interest in the extension also remains.

All three worked perfectly in Torchmate CAD/CAM software. There was no segmentation, no dislodged arcs, and each produced a single toolpath.

1 Like

Maybe look at SketchUcam | OpenBuilds

I’ve never used it - it was made for cutting 2d shapes from foam for RC planes, but I don’t know what sorts of things it supports now.