Exporting DXF files
-
Hi Guys an Gals,
I use Sketchup 8 and 2013 for RC Model airplane design. When the design is finished, all my parts are flat 2D on a common plane. Using 2013, I export as DXF. The problem is that when I send the files to the laser cutting shop, they complain about "faceted" arcs and circles. No problem I thought, I import to AutoCAD 2010 and change the line segmented arcs and cirles to true AutoCAD style. But they still complain........
The issue is, they are reading the files into Illustrator, then export their G-Code from there. They claim that Illustrator sees many errors, even when reading the AutoCAD file.
Possibly ......
-
- They don't know what they are doing
-
- They are just jacking the price
-
- Maybe there really is a problem
Please, anyone with experience on these issues, comment on what's really going on.
Thanks and Happy Holidays,
Marty Petri -
-
Remember that exported 2d DXFs are made of all lines, so there are no arcs - just facets [these are intended for illustration use, not full-blown CAD use - hence the '2d' epithet] - however, exported 3d DXFs are made of proper lines, arcs, circles etc.
You can export a 3d DXF from a 'flat set'.
It's as easy as making the 2d line-only version... -
@tig said:
You can export a 3d DXF from a 'flat set'.
It's as easy as making the 2d line-only version...Hi TIG,
Easy? Yes and No. If I take a part that is 3D, parallel, top view, and export as DXF, I have double lines (line on top of line) which will cause the laser to cut each line twice. Also, when I try to edit the part in AutoCAD, it sees it as a block, not individual lines and circles. If I delete the Block, the underlying lines and circles are segmented. Not sure what a block would do to the G-Code.
The one BIG advantage, if I collapse to a 2D part and export as 3D, I can move the entire block in AutoCAD and see any orphan lines left behind.
Thanks for the insights,
Marty -
I have attached one of my files, fairly simple one. It has been collapsed to a 2D plane.
Marty
-
This is the 3d dxf I made from your skp [Pro dxf-exporter].
I exploded the containers back to geoemetry
It's just edges and R12 [as set in dxf-export options].
The arcs/curves/circles all retained their settings.
In CAD, any 'segmentation' you see in an arc is the way the arc is represented to speed, it is a true arc...I can see that manually reducing all geometry to a flat 2d form before exporting it as a dxf is a pain.
My Slicer5 exporter does that automatically by deleting unwanted geometry etc.
This one-liner works on a selection, it will remove all faces and any edges that are not flat at z=0...m=Sketchup.active_model;s=m.selection;a=m.active_entities;m.start_operation('x');t=s.grep(Sketchup;;Face);a.erase_entities(t)if t[0];t=[];s.grep(Sketchup;;Edge).each{|e|t<<e unless e.start.position.z==0 && e.end.position.z==0};a.erase_entities(t)if t[0];m.commit_operation;
This version retains the selected flat faces and orients them 'up' if needed
m=Sketchup.active_model;s=m.selection;a=m.active_entities;m.start_operation('x');t=[];s.grep(Sketchup;;Edge).each{|e|t<<e unless e.start.position.z==0 && e.end.position.z==0};a.erase_entities(t)if t[0];s.grep(Sketchup;;Face).each{|e|e.reverse! if e.normal.z==-1};m.commit_operation;
-
@tig said:
This is the 3d dxf I made from your skp [Pro dxf-exporter].
My Slicer5 exporter does that automatically by deleting unwanted geometry etc.
This one-liner works on a selection, it will remove all faces and any edges that are not flat at z=0...
m=Sketchup.active_model;s=m.selection;a=m.active_entities;m.start_operation('x');t=s.grep(Sketchup;;Face);a.erase_entities(t)if t[0];t=[];s.grep(Sketchup;;Edge).each{|e|t<<e unless e.start.position.z==0 && e.end.position.z==0};a.erase_entities(t)if t[0];m.commit_operation;
This version retains the selected flat faces and orients them 'up' if needed
m=Sketchup.active_model;s=m.selection;a=m.active_entities;m.start_operation('x');t=[];s.grep(Sketchup;;Edge).each{|e|t<<e unless e.start.position.z==0 && e.end.position.z==0};a.erase_entities(t)if t[0];s.grep(Sketchup;;Face).each{|e|e.reverse! if e.normal.z==-1};m.commit_operation;
The file s exactly what I am looking for. I was with you right up to the point of the 1 liners.
Where is this code entered?
Marty
-
Work on a copy...
Explode the parts to be DXF exported.
'Select all' geometry to be 'flattened' and copy+paste the one-liner code into the Ruby Console +<enter>
Then export the DXF...
The DXF will consist of flat edges at z=0 - with faces if you use the second version... -
Thanks Tig, You have been a big help! The 1st script gives me better results. Is there a way to save the Ruby Script so I don't have to cut and paste every time I want to use it?
Marty -
Try this...
(c) TIG 2013-2014
TIG-flatten.rb
Usage: Plugins > 'TIG.flatten'
Selected geometry is deleted unless it's an edge and its start/end z==0;
all faces are removed.
The result is a 'flat' 2d outline useful for 3d DXF export retaining arcs etc.AutoInstall it from the RBZ... Preferences > Extension > Install... button [needs v8 latest or newer version]
For users with <v8M2 [update!!] - change the RBZ's suffix to .zip and extract it, and put the .rb file into the Plugins folder.You will also need FULL read/write access to your Plugins folder.
As an Admin [if you aren't an Admin give yourself that power in the Users Control-Panel]
Select the Plugins folder's icon, right-click > context-menu > Properties > Security > Edit...
Give every user/group in the list FULL rights.
Apply/OK.Also set SketchUp to 'run as admin'...
Select the SketchUp.exe icon, right-click > context-menu > Properties > Compatibility
Tick the bottom check box 'Always Run This Programs as an Administrator'.
Apply/OK.
-
Thanks so much Tig
Marty
Advertisement