查看单个帖子
旧 2009-05-05, 09:00 AM   #1
yang686526
高级会员
 
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
yang686526 向着好的方向发展
默认 【转帖】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.
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)