Verifying that a DXF file is correct

Making the file from this link:

programmatically, and while it opens fine in some tools (Inkscape, LibreCAD, Carbide Create v6), it generates an error (but w/o further description) in at least one other tool.

Is the fault with the file? Is there some aspect of the DXF format which I’m not getting? (the file is only 38 lines and just makes a single line)

Should the file be corrected, and if so, in what way?

Attaching here for the convenience of anyone willing to look into it.

export.102.dxf (189 Bytes)

Hi,

Your file is a valid dxf file. eDrawing is reading it without problem.

However I know that there are a lot of dxf formats…; They did evolve a lot during years !

1 Like

gawd, AutoCAD web won’t even load the dxf file stating it’s an unsupported file type…
FreeCAD opens it just fine, so did LibreCAD. But in my searching for a ‘validator’ it was stated a couple of times that there is no way to validate DXF files since there is no standard, only implementations. And we know where AutoDesk stands on standards. If you don’t, they don’t support them if they own the implementation such as they do with DXF since 1982. Why their tool won’t open it is a mystery since they provided no feedback.

2 Likes

Not sure if this helps . . .
One of the older industrial lasers in a shop I used to work at was fussy about which version of .dxf file it would open.
By opening a known good working file in a text editor and examining the header portion of the file and then comparing it to a file that wouldn’t open I noticed a slight difference.
The solution was to copy the first few lines from the working header and pasting to the file that’s not working.
The company engineers and designers created with the latest version of Solidworks yet the machine worked from early versions of .dxf.
As I recall it was something like the first 13 lines in the file that needed a change out.

Thanks!

The maddening thing is I’ve been making these files, and for a while they were working (and still work in an older version of the program) — they just create an error in a newer version and I’ve not been able to track down the specific difference.

It’s been a few years . . .
Maybe it was lines 9 thru 13 ?
Basically, for us, the problem related to which version the .dxf file was output in verses what the machine wanted.
The machine was a Metabeam 400 watt CO2 laser with a 4’ X 8’ bed.
Favorite text editor is Notepad++ as it’s the most complete for a wide variety of software / file editing.

As the shop manager I would create a “how to” file on the desktop of each computer driving that particular machine.
That’s where any notation like this would exist.
There were 80 people in the shop who were allowed to use all machines whenever.
Even after hours on personal projects.
Very creative and really fun place to work at . . . tempered with trying to keep a wide variety of old to state of the art machines running :slightly_smiling_face:

2 Likes

My couple of cents worth…
DXF is a terrible format. Not in a technical sense, but because it’s proprietary AutoCAD and has been modified by them, at will, over the years. With breakage between some versions and inadequate documentation.

This leaves anybody other then AutoCAD struggling to keep up. Doubtless a happy coincidence for them that tends to lock customers in.

I did a load of work to replace the DXF importer in LaserWeb with something more modern to address this. I came to loath .dxf as a result. ymmv.

If cross-compatibility or future-proofing matters to you save and work in SVG instead; It’s an open protocol which is properly curated by people with wider goals than the DXF maintainers.

“Friends dont let friends use .DXF” ?

If you do need to use this format; Inkscape has (afik) the best DXF importer(s) out there, and you can then save in a newer .dxf format, or as .svg.

4 Likes

Unfortunately, SVG has the complexity of a different coordinate system — DXF is much easier — maybe I’ll add an option to call Inkscape.

I’d like to thank everyone for their thoughts and observations.

I’m now at a file which is working again:

linetest_edited_24.dxf (279 Bytes)

and hopefully, iterative testing will ensure that it will continue to work.

After reviewing the code, it looks as if I was getting where the begin/end number/parameter was placed.

1 Like

However, it turns out that something is off in terms of how arcs are handled.

An arc from 0 to 179.88 degrees with a radius of 5mm falls 0.010mm short:

But if an additional 0.01 degree is added, then it overshoots:

by 0.061mm:

However, arcs of 90 degrees or less seem to be fine, so we will limit ourselves to quadrants or smaller.

They even get stitched together to make a nice curve:

1 Like