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

yang686526 2009-05-05 09:00 AM

【转帖】ellipse sample points wrong
 
ellipse sample points wrong.
ellipse sample points wrong.
hi,
with the attached drawing, the 2 ellipses are calculated with wrong geometry (as per view in autocad) with the following code :
double majorradius = linedist3d(0.0f, 0.0f, 0.0f, odelpsptr->majoraxis().x, odelpsptr->majoraxis().y, odelpsptr->majoraxis().z, 1.0f, 1.0f);
double minorradius = linedist3d(0.0f, 0.0f, 0.0f, odelpsptr->minoraxis().x, odelpsptr->minoraxis().y, odelpsptr->minoraxis().z, 1.0f, 1.0f);
odgeelliparc3d odgeelps(odelpsptr->center(),
odelpsptr->majoraxis(),
odelpsptr->minoraxis(),
majorradius,
minorradius,
odelpsptr->startangle(),
odelpsptr->endangle());
odgepoint3darray pnts;
odgeelps.getsamplepoints(30, pnts);
the first point here contains : 1578.046, 1629.913 , where is the start point in autocad is 1578.958, 1648.7826.
all other values ( major radius, minor radius, center, start angle, end angle, and the axis vectors are all identical to autocad.)
cheers
jason
attached files
angles in odgeelliparc3d and oddbellipse have different meaning.
look at odgeelliparc3d description in api reference.
angle in odgeelliparc3d corresponds to parameter in oddbellipse.
for setting odgeelliparc3d angles use getstartparameter() and getendparameter() of oddbellipse.
sergey slezkin
thank you, works perfectly.


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