Community
DWF
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Incorrect coordinate geometry in dwfx

1 REPLY 1
Reply
Message 1 of 2
PedroUdjat
1019 Views, 1 Reply

Incorrect coordinate geometry in dwfx

Hi everyone,

 

I have a problem extracting dwg coordinate geometry from a dwfx file.

 

Using as an example the W2Dtest sample and the Read2DDWFxFile.cpp file, I get all the Whip coordinates.

 

For example:

 

2147467780, 8657

2147468114, 9319

 

I read in this topic that the coordinates appear correct:

http://forums.autodesk.com/t5/DWF/DWF-geometry-data/td-p/1887709/page/2

 

 

But when I  try to convert this coordinates to the original AutoCAD DWG coordinates, using first:

 

WT_Matrix xform3d( pGraphicsRes->transform() );
DWFToolkit::DWFPaper *pPaper( pEPlotSxn->paper() );
WT_Matrix2D xform;
xform(0,0) = xform3d(0,0);
xform(1,0) = xform3d(1,0);
xform(0,1) = xform3d(0,1);
xform(1,1) = xform3d(1,1);
xform(2,0) = xform3d(3,0);
xform(2,1) = xform3d(3,1);

XAMLFile->definePageLayout(xform, pPaper->width(), pPaper->height(),
pPaper->units() == DWFToolkit::DWFPaper::eMillimeters ? .03937 : 1.0 );

 

 

and then for each point:

 

WT_Point3D correctCoord = units.transform_from_DWF_to_application(newPoint); 

 

 

i get coordinates like this:

 

2142.55, 1011.14

2143.25, 1012.54

 

where I should be getting coordinates like this:

 

4543646.5803, 9.195

4545674.8390, 8.498

 

 

Any ideia what i'm doing wrong? Am I missing something? Any help is appreciated.

 

 

Thanks, 

 

Pedro Cruz

1 REPLY 1
Message 2 of 2
PedroUdjat
in reply to: PedroUdjat

Anyone?

 

I noticed that the the matrix that I get from WT_Units:

WT_Matrix original = units.application_to_dwf_transform();

 

have some correct values, and some other strange values like 2,89e-14. Is this normal? I could alter the values in the transformation matrix but I don't think that is the correct approach.

 

And i should be using units.transform_from_DWF_to_application(), not units.application_to_dwf_transform(), because I want the original DWG coordinates, but the output coordinates makes even less sense.

 

Any ideas? I'm really at a loss here.

 

Thanks,

 

Pedro Cruz.

 

 

 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

”Boost

 

”Tips

 

”Services