libdxfrw / librecad DWG import bug

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

libdxfrw / librecad DWG import bug

mr-miky
Hi,
I did some testing with dwg2dxf and LibreCAD.
Both have the same problem, wrong rotation angle of the object imported. When I open the drawing objects that have different angle from 0 are positioned wrong. If I check the properties results the wrong angle. For objects rotated by 180 ° LibreCAD reports 3.14159 ° which is equivalent to Pi or 1 Rad. I checked and objects are rotated 90 ° I imported as 1.5708 ° -> Pi / 2.
Attached examples: test_acad.dxf saved in DXF from AutoCAD 2007 test.dwg the original saved from AutoCAD, test_librecad.
It seems that acad save in radians and libdxfrw0-0.6.1-1.1 treat them as degrees

https://www.dropbox.com/s/7x0o6j1kyahxujp/dwg.zip?dl=0
Reply | Threaded
Open this post in threaded view
|

Re: libdxfrw / librecad DWG import bug

Rallaz
Hi Michele,

The bug is due to diferences saving angles in dwg & dxf.

Rotation angle in Insert entity are saved in radians in DWG and in degrees in DXF.

In your test.dwg file I have noticed another issue:
The block "kfl08" are not linked whit the insert entity.

I send two patches one for angles and another for link.

To verify compile yourself or wait for a new daily build (the patches are in both master and 2.0 branch)

Cheers,
Rallaz