DXF import misses out the last line

Bug #739803 reported by Tom Parker
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Inkscape
Fix Released
Medium
Alvin Penner

Bug Description

Attempting to import the attached DXF file causes Inkscape to decide to forget to draw the last line. QCAD is perfectly happy with it however.

Tags: dxf importing
Revision history for this message
Tom Parker (palfrey) wrote :
Revision history for this message
Tom Parker (palfrey) wrote :

The following patch double-checks the vals array, and sees if there's any left over data. If so, it outputs the missing last line.

su_v (suv-lp)
tags: added: dxf importing
Revision history for this message
su_v (suv-lp) wrote :

Missing path of attached DXF file reproduced with Inkscape 0.48.1 and 0.48+devel r10118 on OS X 10.5.8 (i386)
(drawing content compared to rendering in QCad, DraftSight and SolidWorks eDrawings)

It appears to be the last path according to the stack order in Inkscape - I didn't verify this with external applications.

Changed in inkscape:
importance: Undecided → Medium
status: New → Confirmed
Revision history for this message
Alvin Penner (apenner) wrote :

thanks, I'll check it out on the weekend

Alvin

Revision history for this message
su_v (suv-lp) wrote :

@Alvin - assigning this report to you: the patch didn't apply for me to current trunk (for testing). It would be great if you could take a look since you certainly have more insight into the current state and workings of 'dxf_input.py' than anyone else.

Please revert to 'Nobody' if you prefer not having reports assigned to you.

Changed in inkscape:
assignee: nobody → Alvin Penner (apenner)
Revision history for this message
Alvin Penner (apenner) wrote :

As far as I can tell, the file single.grid-plans is from AutoCad Release 10, based on the parameter ACADVER = AC1006. The Inkscape input routine supports only Release 13 and newer, which is the reason for the missing last line segment. The file is not viewable in Voloview Express 2.01 which is my favorite tool for checking syntax.

I would recommend loading this into QCad and then saving it. (The default save format for QCad is Release 13). I get the attached dxf file if I do this with QCad 2.1.3.2. This file is viewable in Voloview Express and appears to load properly into Inkscape, as far as I can tell.

hth,
Alvin

Revision history for this message
Tom Parker (palfrey) wrote :

So, strictly speaking single.grid-plans.dxf isn't from any release of AutoCad. It's a generated file from a modified version of the SDXF library (http://www.kellbot.com/sdxf-python-library-for-dxf/). I could change the version code that I'm spitting out, but I don't think that'll fix things. As far as I can tell, the QCad-saved version has a bunch of other items after the last LINE, so you don't see any problems with Inkscape as the item it misses things off of doesn't get rendered anyway. OTOH, single.grid-plans.dxf ends almost immediately after the last line segment, and so that gets missed off.

One thing that might potentially help is if it's identified that there's some part of the DXF format that Inkscape doesn't like, but given LINE has been in there for ages, I doubt that's the problem.

Revision history for this message
Alvin Penner (apenner) wrote :

attached is a modified version of the file dxf_input.py. I have replaced the entity called DICTIONARY with one called EOF. This is used as a flag to indicate when to stop processing. With this change the file single.grid-plans.dxf reads in properly as far as I can tell.

Revision history for this message
Tom Parker (palfrey) wrote :

Looks good to me. Just tested this both against single.grid-plans, and a couple of other similar files. All look fixed now. Thanks!

Revision history for this message
Alvin Penner (apenner) wrote :

good to hear, committed to bzr rev 10131

Changed in inkscape:
status: Confirmed → Fix Committed
su_v (suv-lp)
Changed in inkscape:
milestone: none → 0.49
su_v (suv-lp)
tags: added: backport-proposed
Revision history for this message
jazzynico (jazzynico) wrote :

Backported in the branch, revision 9811.

tags: removed: backport-proposed
Changed in inkscape:
milestone: 0.49 → 0.48.2
Ted Gould (ted)
Changed in inkscape:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.