几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量

几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量 (http://www.dimcax.com/hust/index.php)
-   DirectDWG (http://www.dimcax.com/hust/forumdisplay.php?f=89)
-   -   【转帖】how to implement odgematrix3daligncoordsystem90 (http://www.dimcax.com/hust/showthread.php?t=16712)

yang686526 2009-05-06 02:52 PM

【转帖】how to implement odgematrix3daligncoordsystem90
 
how to implement odgematrix3d::aligncoordsystem()
how to implement odgematrix3d::aligncoordsystem()
it seems that this function is not implemented.
can someone please help me in implementing it?
i need to convert 3d coordinates from ucs to wcs and this function seems the ideal candidate to do it...
thanks in advance for any help.
regards
chudomir

quote:
originally posted by chudo
i need to convert 3d coordinates from ucs to wcs and this function seems the ideal candidate to do it...
i think the ideal candidate to convert 3d coordinates from ucs to wcs is function setcoordsystem(). such matrix is built in cdwgviewer::getworldstartendpoints function, that used in append line sample.
code:
oddbdatabase* pdb = database();
odgepoint3d ucsorigin;
odgevector3d ucsxaxis, ucsyaxis;
if(pdb->gettilemode())
{
ucsorigin = pdb->getucsorg();
ucsxaxis = pdb->getucsxdir();
ucsyaxis = pdb->getucsydir();
}
else
{
ucsorigin = pdb->getpucsorg();
ucsxaxis = pdb->getpucsxdir();
ucsyaxis = pdb->getpucsydir();
}
odgematrix3d ucs2wcs;
ucs2wcs.setcoordsystem(ucsorigin, ucsxaxis, ucsyaxis, odgevector3d());
sincerely yours,
george udov
thank you george,
this works!
but why is the last argumtnt an empty vector odgevector3d()?
i passed the real ucs normal and it seemed ok...
thanks again.
regards
chudomir
quote:
originally posted by chudo
but why is the last argumtnt an empty vector odgevector3d()?
i passed the real ucs normal and it seemed ok...
if you pass ucsxaxis.crossproduct(ucsyaxis), it will take z coordinate of input points into account. if an empty vector odgevector3d() - it won't. thats single difference.
sincerely yours,
george udov
thanlks for your help.
regards
chudomir


所有的时间均为北京时间。 现在的时间是 05:31 PM.