高级会员
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
|
【转帖】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.
|