Reputation: 11
Most of the time I import a dxf file it makes a huge mess. We need DXF files for 2d paths but when the file is imported the lines are broken up and more points are inserted in and lines join several points all over. I have been doing some research for that last few hours I did find the R12 Autocad DXF Reference. I did find out that I can look at a DXF file in notepad.
But I was hoping someone might shed some light on the question
How does DXF define a path in regards to points?
It could be that I would read the whole R12 DXF reference and not know a thing more than I did before about how to understand DXF better.
I'm not ignorant to the software world MAX Blender Acad. But feel out of sorts with DXF
I do a lot of eps or AI from an image and then import that in Cad and Export to DXF for CNC plasma cutters and CNC water cutter... My goal is to understand what is going on much better so I can create these files for these CNC machines. The Vicon plasma cutting machine does not USE G-Code like a lot of other machines. But the others use G-code and M-Code Its all so fascinating. But they all seem to except dxf as an import. Often they will hang on an import because the DXF file splits up points into millions of little segments and hangs the system. Often they are older XP machines.
What I am after is any information that may get me pointed in the right direction. Should I study the DXF reference first?
Upvotes: 1
Views: 1966
Reputation: 2239
If you have read the DXF reference, I expect you are aware of SECTIONS, the interesting section for you is the ENTITIES section, which contains the entities of the modelspace.
Important entities for 2d paths are:
The first 3 (LINE, ARC, CIRCLE) are self contained entities, the entity starts with the structural entity tag (0, LINE) and ends with the next structural entity tag (0, ENTITYNAME).
The POLYLINE entity is a combination of 3 entities:
0
POLYLINE
...
0
VERTEX
...
0
VERTEX
...
...
0
SEQEND
The POLYLINE entity contains all the information about the line properties, the VERTEX entities defines the vertices (points) and the SEQEND entity marks the end of the POLYLINE entity. The VERTEX entity can contain bulge values, which defines ARC segments in the POLYLINE.
If there are INSERT entities, than its getting more complex, the INSERT entity describes the insertion location, rotation and scaling for a BLOCK reference, I assume you will ignore entities located in 3d space by using OCS and extrusion. The BLOCK itself is defined in the BLOCKS section and has the name referenced by the INSERT entity. The transformation of the entities in the BLOCK definition into the modelspace (or another BLOCK definition, BLOCK contains INSERT) has to be done by yourself.
That should be a starting point to read DXF R12 file, for writing R12 files, there is a little bit more to know, but not much more, in fact it is enough to write only the ENTITIES section to create a valid R12 file (don't forget the (0, EOF) tag), but without the ability to use different line types or text styles, different layers can be used, layers work without a definition in the LAYER table.
Upvotes: 3