What's wrong with this DXF conversion?

Post questions on how to use or achieve an effect in Inkscape.
varocketry
Posts: 12
Joined: Tue Jul 13, 2010 5:59 am

What's wrong with this DXF conversion?

Postby varocketry » Fri Jul 16, 2010 8:31 am

I continue to receive reports of DXF file distortions from the machinist assisting me in creating a medallion.

My design in SVG looks like this (saved as png):
Image

However, when SAVED AS DXF and loaded into CAMBAN program, the DXF displays like this with many parts rearranged:

Image

Any idea what might be going on here? All help is appreciated; my time on this project is running out.

~suv
Posts: 2272
Joined: Sun May 10, 2009 2:07 am

Re: What's wrong with this DXF conversion?

Postby ~suv » Fri Jul 16, 2010 9:08 am

Attaching your SVG file would help to investigate the issue (screenshot or PNG doesn't tell about how the bent text and the other displaced objects are coded in SVG).

A first guess would be a (known) issue with transformed groups (or objects with preserved transformations).

Possibly related bug reports:
Bug #600473 in Inkscape: “dxf save for autocad does not translate correctly
Bug #585021 in Inkscape: “save as .dxf does not handle transformations
Bug #487648 in Inkscape: “Problem with DXF save files

Workaround: Flatten the drawing before exporting to DXF:
  • Groups: Select each group, ungroup it, keep the selection and move it (e.g. with <Shift>+cursor key up, then back down): this forces a rewrite of the paths and stores any preserved transformations directly in the coordinates of the path nodes.
  • Shapes: (ellipses, stars, polygons, spirals): convert object to path and perform the same move operation (translate by a known distance and back).

varocketry
Posts: 12
Joined: Tue Jul 13, 2010 5:59 am

Re: What's wrong with this DXF conversion?

Postby varocketry » Fri Jul 16, 2010 9:20 am

Thanks much, just my luck.

Here's the SVG file:
http://www.wirelesstechradio.com/images/DharmaShield8.svg

Jim

~suv
Posts: 2272
Joined: Sun May 10, 2009 2:07 am

Re: What's wrong with this DXF conversion?

Postby ~suv » Fri Jul 16, 2010 9:56 am

attaching a fixed version that looks correct when exported to DXF (at least in QCad)...

Basically it is about above mentioned issues: groups and shapes with preserved transformations do not export well to DXF with the current version of the export script (a comment in bug #600473 says: "over the next month or so I will look at the code to see if it is feasible to automatically take into account the effects of the transform element." -> possibly there will be an updated version of the script available that can be downloaded to replace the one installed with the next Inkscape version)

Some of the things I edited:
  • Groups: ungroup -> move (and move back) -> group (some groups are nested!)
  • Shapes: convert to path -> move (and move back)
  • Text: convert to path -> ungroup -> move (and move back) -> group
  • Stroke: (octagon path in <root>) put it into one of the existing layers (using the command 'Move Selection to Layer Below' in the 'Layers…' menu), convert stroke to path -> move (and move back)
  • File > Vacuum Defs: to remove the remnant path from 'Put Text on Path' (the lower right half-circle seen on the DXF screenshot)
Maybe I forgot to list one of the steps here, just ask if something is not clear.
Attachments
QCad-screenshot.png
QCad-screenshot.png (19.9 KiB) Viewed 3967 times
DharmaShield8-test.svg
(32.35 KiB) Downloaded 190 times

~suv
Posts: 2272
Joined: Sun May 10, 2009 2:07 am

Re: What's wrong with this DXF conversion?

Postby ~suv » Fri Jul 16, 2010 1:57 pm

Further changes I'd do to optimize the drawing for DXF export:

Convert all strokes to filled outlines (menu 'Path > Stroke to Path') and union the results together as appropriate (to avoid double nodes and line segments), see screenshot from exported DXF file (viewed with QCad), as well as attached SVG file.

What's up with that blue cylinder BTW? ;-)
Attachments
QCad-screenshot-2.png
QCad-screenshot-2.png (19.99 KiB) Viewed 3953 times
DharmaShield8-test-2.svg
(26.79 KiB) Downloaded 191 times

varocketry
Posts: 12
Joined: Tue Jul 13, 2010 5:59 am

Re: What's wrong with this DXF conversion?

Postby varocketry » Fri Jul 16, 2010 3:08 pm

Thank you SUV, Brynn, all:

I wanted to take time before retiring tonight to acknowledge and thank you for the response and solution to my newbie errors.

I'll attach my final version. I'm happy with it and we'll see what the machinist says.

The BLUE cauldron now appears as a beer can pouring into the top to BM. I'll be able to add BEER color there after the casting is done.
The camp's theme is BEEROPOLIS but I didn't have room for the logo too.

Many thanks all for the suggestions and assistance.
Attachments
DharmaShield14a.png
DharmaShield14a.png (33.73 KiB) Viewed 3949 times

varocketry
Posts: 12
Joined: Tue Jul 13, 2010 5:59 am

Encountering more troubles tonight

Postby varocketry » Sat Jul 17, 2010 3:58 pm

I spent several hours converting lines to polygons to provide width to lines being cut in CNC router.
(pocket).

The aforementioned tricks to get the DXF conversion to work do not seem to help me.
I'd appreciate any ideas. I'll attach the files below.
Thanks.
Attachments
DharmaShield8_2.PNG
PNG of the DXF in CAMBAM
DharmaShield8_2.PNG (56.86 KiB) Viewed 3929 times
DharmaShield8_2.svg
Inkscape file
(33.63 KiB) Downloaded 188 times

~suv
Posts: 2272
Joined: Sun May 10, 2009 2:07 am

Re: What's wrong with this DXF conversion?

Postby ~suv » Sat Jul 17, 2010 4:41 pm

varocketry wrote:The aforementioned tricks to get the DXF conversion to work do not seem to help me.
I'd appreciate any ideas.

  1. select the (former) polygon path on layer "L2 - BMAN Outline"
  2. move it (e.g. with the cursor key) one tick up and back down again
  3. verify that exported DXF file now is correct

Method to verify if a path needs this "procedure":
  1. select a path
  2. open 'Edit > XML Editor'
  3. look for a 'transform' attribute for the selected object (path) listed in the upper right window
  4. if it exists -> use this 'move - move back' fix (so that the explicit transformation is resolved and only the resulting coordinates are saved in the path nodes. (this works for normal paths, for groups -> ungroup first, move the selection and group it again, for shapes, convert to path and apply the 'move' procedure)

varocketry
Posts: 12
Joined: Tue Jul 13, 2010 5:59 am

Re: What's wrong with this DXF conversion?

Postby varocketry » Sun Jul 18, 2010 10:51 am

Thankyou, I'll try it and report back.

varocketry
Posts: 12
Joined: Tue Jul 13, 2010 5:59 am

L2- BMAN Outline is the apparent problem

Postby varocketry » Sun Jul 18, 2010 11:40 am

SUV:

I've tried your suggestion and have isolated the problem to L2- BMAN Outline. It retains the transform value even after all the Path /Object to Path and Ungroup, and moving the elements back and forth.

All others drop the transform as expected.

I'll attach the offending SVG file in case you can see something I can correct.
Thanks.
Attachments
DharmaShield8_2.svg
SVG file
(32.12 KiB) Downloaded 186 times

~suv
Posts: 2272
Joined: Sun May 10, 2009 2:07 am

Re: What's wrong with this DXF conversion?

Postby ~suv » Sun Jul 18, 2010 11:59 am

The latest version of your file has other changes too which now cause different issues: a mix of layers added before and after resizing the document. I'll try to write up a short how-to.

varocketry
Posts: 12
Joined: Tue Jul 13, 2010 5:59 am

Does this "Better DXF Output

Postby varocketry » Sun Jul 18, 2010 12:07 pm

http://www.bobcookdev.com/inkscape/inkscape-dxf.html

He developed it for version .46 it says.
I wonder if anyone has tried it.

And this update to Bob Cook's work:
http://tim.cexx.org/?p=590
Last edited by varocketry on Sun Jul 18, 2010 12:19 pm, edited 1 time in total.

~suv
Posts: 2272
Joined: Sun May 10, 2009 2:07 am

Re: What's wrong with this DXF conversion?

Postby ~suv » Sun Jul 18, 2010 12:15 pm

  1. select the path on "L2 BMAN Outline"
  2. move it to the layer above using menu "Layer > Move Selection to Layer Above"
  3. move the still selected path with the known procedure (move a tick up and back down)
  4. delete the layer "L2 BMAN Outline"
  5. add a new layer and name it "L2 BMAN Outline"
  6. move the path back down to the new "L2 BMAN Outline" layer using the commands in the layer menu
  7. save, export to DXF R13

I'm sorry if I navigate you here around the mysterious consequences of "Resizing the page" which can cause all kind of complications for extensions (including export extensions obviously) and other Inkscape objects.

varocketry
Posts: 12
Joined: Tue Jul 13, 2010 5:59 am

Re: What's wrong with this DXF conversion?

Postby varocketry » Tue Jul 20, 2010 5:46 am

~suv:
Thanks you very much. I applied your instructions and I applied the script updates created by BobCook as updated by Tim.
The problem is fixed and has not reappeared.
Many thanks!

~suv
Posts: 2272
Joined: Sun May 10, 2009 2:07 am

Re: What's wrong with this DXF conversion?

Postby ~suv » Tue Jul 20, 2010 8:09 am

varocketry wrote:I applied the script updates created by BobCook as updated by Tim.

I do not recommend to install any of these extensions unchanged into the extensions folder of a current (stable) Inkscape version: they will overwrite existing python script libraries with older versions, potentially breaking other extensions.

Better DXF Output: from the web page:
simpletransform.py (this replaces an existing file, see Inkscape bug 220025)
dxf_templates.py (this is from Inkscape bug 192923)


Better Better DXF Output for Inkscape (layers!): from the web page:
Note that the updated ’simpletransforms.py’ replaces an existing file.

wgregori
Posts: 8
Joined: Sat Jun 05, 2010 3:04 pm

Re: What's wrong with this DXF conversion?

Postby wgregori » Tue Aug 06, 2013 12:39 am

I'm using inkscape 48.3.1 and I'm still having problems with saving to the DXF format. I've used a number of different dxf converters (Better DXF Output is one of them). Is there a work around for this problem. Does it continue to be a known problem?

Thanks

Selection_356.png
Selection_356.png (12.11 KiB) Viewed 2991 times


Selection_355.png
Selection_355.png (42.54 KiB) Viewed 2991 times

Lazur
Posts: 4717
Joined: Tue Jun 14, 2016 10:38 am

Re: What's wrong with this DXF conversion?

Postby Lazur » Tue Aug 06, 2013 1:50 am

I haven't tried to export to dxf as I don't have cad softwares to open them.
But there are other formats that can turn out better, as mentioned here:
http://www.inkscapeforum.com/viewtopic.php?f=5&t=15347&p=57416#p57416
Might worth a try saving as plt instead.


Return to “Help with using Inkscape”