高级会员
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
|
【转帖】dont chage scale
dont chage scale
dont chage scale
hi,
i need read dxf 2d faces and convert to lines, points and circles to add in my company proprietary format.
i making a import routine using vectorizeex sample but i found a problem: when it import dxf it change sizes (changing scale). i need convert faces to lines, points and circles but without change sizes.
please, where i need change in vectorizeex to solve this problem ?
[]s,
celso
help ! ! !
[]s,
celso
im still waiting help ! ! !
help me, please ! ! !
[]s,
celso
hi,
could you prepare test file. for example, it include one very simple 2d face. attach it here and describe your problem more carefully, like - vectorizeex return lines from xyz to xyz0, but autocad draws it from xyz1 to xyz2 or i think that this coordinates should be xyz3 - xyz4. also i need to known your toolkit version.
simple face
tks for your attention.
im including: demodxf.dxf, testelog.txt and demodxf.icn.
well,
i run odvectorizeex in demodxf.dxf and get testelog.txt.
demodxf.dxf have a line with coords from (473251.8392, 7836822.3764) to (473187.1624, 7836754.3456).
in testelog.txt (generated by odvectorizeex) its adjusted to (535.971902, 696.488330) - (454.127925, 499.907385), changing real position and scale.
in my routine i use this returned value (generated by odvectorizeex) to plot in my application but i need real positions and correct scale.
i see in the code this :
code:
odgsdcrect screenrect(odgsdcpoint(0, 0), odgsdcpoint(1000, 1000));
pdevice->onsize(screenrect);
its set viewport to (0,0) (1000,1000). all cordinates are generated between this values.
well, i change this code for this:
code:
odgepoint3d p3dextmin,p3dextmax;
odgsdcpoint pdcextmin,pdcextmax;
p3dextmin=pdb->getextmin();
p3dextmax=pdb->getextmax();
pdcextmin.x=(long)p3dextmin.x;
pdcextmin.y=(long)p3dextmin.y;
pdcextmax.x=(long)(p3dextmax.x + (0.55));
pdcextmax.y=(long)(p3dextmax.y + (0.55));
odgsdcrect screenrect(pdcextmin,pdcextmax);
pdevice->onsize(screenrect);
... but dont solve all troubles. the values dont match with the original. have a large difference (in proprietary format demodxf.icn. open it by notepad to see)...
line coords in my proprietary format (using vectorizeex changed)
(473226.554099, 7836845.262549) (473209.366864 7836803.980551)
please, do you can help me ?
[]s
celso
quote:
originally posted by alexander rumyantsev
hi,
could you prepare test file. for example, it include one very simple 2d face. attach it here and describe your problem more carefully, like - vectorizeex return lines from xyz to xyz0, but autocad draws it from xyz1 to xyz2 or i think that this coordinates should be xyz3 - xyz4. also i need to known your toolkit version.
attached files (6.3 kb, 7 views)
[]s,
celso
last edited by celsolrc; 18th october 2006 at 08:43 amfff">.
hi,
as i understand you'd like to get geometry in world coordinates. so you should just ignore world to eye and eye to screen transformation:
in main() replace:
code:
pdevice = oddbgsmanager::setupactivelayoutviews(pdevice, pdwgcontext);
with
code:
pdevice->setusergicontext(pdwgcontext);
odgsviewptr pview = pdevice->createview();
pview->setview(odgepoint3d::korigin, odgepoint3d::korigin + odgevector3d::kzaxis, odgevector3d::kyaxis, 1., 1.);
pdevice->addview(pview);
pview->add(pdb->getmodelspaceid().safeopenobject(), 0);
and modify exsimpleview::update() like this:
code:
void exsimpleview::update()
{
(static_cast<odgigeometrysimplifier*>(device()->destgeometry()))->setdrawcontext(drawcontext());
seteyetooutputtransform(geteyetoworldtransform());
odgsbasevectorizeview::update();
} // end exsimpleview::update()
its work ! ! ! !
tank you very much ! ! !
its work ! ! !
[]s,
celso
|