[Dxfreader-info] entity reading process
Status: Beta
Brought to you by:
allandaly
|
From: Michael C. <mic...@gm...> - 2009-02-28 15:45:41
|
Hi list!
Just wanted to make sure that I'm going about loading entities
correctly. Seems that when I draw them into a DKDrawingLayer, I get
incorrect directions and line widths (not sure if line widths are part
of the DXF line entity though).
Process for reading in the DXF File:
BBDXFModel* model = [[BBDXFModel alloc] init];
[model loadDXFString:dxfFileContents];
[model getDXFFileStructure];
[model processEntities];
Process for translating LINE entities into DK lines:
BBDXFEntityLine* line = (BBDXFEntityLine*) entity;
// Ignoring z coordinates for the moment
NSPoint sp;
sp.x = [[line startPoint] x];
sp.y = [[line startPoint] y];
NSPoint ep;
ep.x = [[line endPoint] x];
ep.y = [[line endPoint] y];
DKDrawablePath* dkline =
[[DKDrawablePath alloc] initWithStartingCoordinate:sp
endingCoordinate:ep
grid:
[self gridLayer]];
return [dkline autorelease];
Like I said, it seems that when I render this way, I'm getting weird
directions, though the lines seem to be spatially correct, that is,
they are in the right places relative to each other, just sort of
rotated or something differently. It might be due to an error in
scaling it to microns, however. I haven't looked too far into it.
I also didn't see anything yet for getting the array of Header
objects. Am I missing something? I will add it if it's not there. It
was late... maybe I just totally overlooked it. Important to get
measurement data from the Header for SonoDraw.
Cheers.
Michael
------------------------------------------------
mic...@gm...
http://techrad.wordpress.com
http://mrcaron.wordpress.com
|