几何尺寸与公差论坛------致力于产品几何量公差标准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)
-   -   【转帖】ocs-wcs transformations (http://www.dimcax.com/hust/showthread.php?t=17379)

yang686526 2009-05-06 06:49 PM

【转帖】ocs-wcs transformations
 
ocs->wcs transformations
ocs->wcs transformations
is there a class and method that performs ocs-to-wcs transformations (for points).
it seems somewhat laborious for everyone to have to write their own (arbitrary axis algorithm, etc.)
in general it seems the problem is:
given:
a normal vector (3d)
an ocs elevation
a point in ocs (3d)
calculate:
the wcs point (3d)
odgematrix3d seems like a logical place to look, but i can't see a way to specify the normal vector and ocs elevation....
thanks,
-allan
odgematrix3d has methods:
worldtoplane(normal) and planetoworld() returning transforms ocs<->wcs.
elevation can be taken into account for example in the following manner:
code:
odgevector3d normal;
odgepoint2d ocspoint;
odgepoint3d wcspoint;
odgematrix3d trans;
trans.settotranslation(odgevector3d(0., 0., elevation()));
trans.settoproduct(odgematrix3d::planetoworld(normal), trans);
wcspoint.x = ocspoint.x;
wcspoint.y = ocspoint.y;
wcspoint.z = 0;
wcspoint.transformby(trans);
// or another variant
trans = odgematrix3d::planetoworld(normal) ;
wcspoint.x = ocspoint.x;
wcspoint.y = ocspoint.y;
wcspoint.z = elevation;
wcspoint.transformby(trans);
sergey slezkin
thanks
thanks, sergey.
i will give it a try.
-allan


所有的时间均为北京时间。 现在的时间是 04:18 AM.