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


返回   几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量 » 仿射空间:CAX软件开发(三)二次开发与程序设计 » CAD二次开发 » AutoCAD二次开发 » DirectDWG
用户名
密码
注册 帮助 会员 日历 银行 搜索 今日新帖 标记论坛为已读


回复
 
主题工具 搜索本主题 显示模式
旧 2009-05-04, 07:24 PM   #1
yang686526
高级会员
 
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
yang686526 向着好的方向发展
默认 【转帖】deviation and relative deviation

deviation and relative deviation
deviation and relative deviation
hi,
i have a drawing with many circles of different diameters varying between 0.25 and 256.
1. with no deviation touching, all circles has some deviation, all circles has the same number of segments, which mean that _relative_ (to diameter) deviation is the same, but absolute deviation for big circles is bigger than for small circles.
now, i want to make circles more accurate, i want each circle to have, lets say, four times more segments, but still all circles should have the same number of segments. is there any way to do it?
2. using setdeviation before rendering causes that _absolute_ deviation is set and used, not relative, so small circles looks like triangles and big circles are smooth. it's not what i wanted and it is worse than default (1) behaviour.
tia
regards,
micha? ?liwka
attached files
hi,
i understand, that there may be more question than people to answer it, but can you tell me please, are you working on this problem or just have not read the message yet?
thanks in advace.
regards,
michal sliwka
hi,
there are two setdeviation in toolikt :
void setdeviation(const odgedoublearray& deviations);
void setdeviation(const odgideviation* pdeviation);
setdeviation(const odgideviation* pdeviation) used in our vectorizer. odgideviation has method deviation(const odgideviationtype deviationtype, const odgepoint3d& pointoncurve). returned value depends on pointoncurve.
did you mean setdeviation(odgedoublearray) or setdeviation(odgideviation) ?
hi,
i have used both methods with the same result. applied values did take effect (i have been modifying them) but they took effect in absolute, not relative manner described in my first post.
regards,
michal sliwka
hi,
how "returned value depends on pointoncurve" ? i don't see it in any example in 1.14 bundle. second issue is that in documentation pointoncurve is marked as output parameter but it's a _const_ reference.
regards,
micha? ?liwka
code:
void odgigeometrysimplifier::circleproc(const odgepoint3d& center, double radius, const odgevector3d& normal, const odgevector3d* pextrusion)
{
odgecircarc3d circarc(center, normal, radius);
odgepoint3darray points;
circarc.appendsamplepoints(0., oda2pi, deviation(kodgimaxdevforcircle, center), points);
points.last() = points.first();
polylineproc(points.size(), points.getptr(), &normal, pextrusion);
}
input\output parameter :
i think that this is mistake in our documentation.
as i see all circles have the same center, so deviation() return the same value for all. next step is inside odgeelliparc3d::appendsamplepoints.
it calculate small step angle based on radius and deviation.
code:
void odgeelliparc3d::appendsamplepoints(double fromparam, double toparam, double approxeps,
odgepoint3darray& pointarray, odgedoublearray* pparamarray) const
{
double delta = toparam - fromparam;
int n = getarcsegs(delta, approxeps, majorradius());
if (n)
{
delta /= n;
}
getarcsegs return different values for circles with different radius. you cannot change this functionality.
last edited by sslezkin; 3rd august 2006 at 02:15 amfff">.
alternative way is rewrite virtual void odgigeometrysimplifier::circleproc in inherited class.
currently i do override circleproc and circulararcproc and put to appendsamplepoints "eps" dependent on _radius_ not center, because appendsamplepoints seems to not depend on radius in odgecircarc3d class.
is appendsamplepoints radius - dependand only in odgeelliparc3d class? (through getarcsegs)
it is depend.
code:
void odgecircarc3d::appendsamplepoints(double fromparam, double toparam, double approxeps,
odgepoint3darray& pointarray, odgedoublearray* pparamarray) const
{
odgeelliparc3d elliparc(*this);
elliparc.appendsamplepoints(fromparam, toparam, approxeps, pointarray, pparamarray);
}
also
code:
int getarcsegs(double angletointerpolate, double approxeps, double radius)
{
if (!odzero(radius, 0.))
{
double maxstepangle = maxarcstepangle(approxeps / radius);
return int(ceil(fabs(angletointerpolate) / maxstepangle));
}
return 0;
}
and
code:
double maxarcstepangle(double n)// n = deviation / r
{
if (n <= 0.0)
{
return odapi / 16.;
}
if (n < 5.e-6)
{
return odapi / 500.;
}
double cosinhalfa = 1.0-n;
if (cosinhalfa <= -1.0)
{
return odapi2;
}
return ::acos(cosinhalfa) * 2.0;
}
last edited by sslezkin; 3rd august 2006 at 03:24 amfff">.
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)
回复


主题工具 搜索本主题
搜索本主题:

高级搜索
显示模式

发帖规则
不可以发表新主题
不可以回复主题
不可以上传附件
不可以编辑您的帖子

vB 代码开启
[IMG]代码开启
HTML代码关闭

相似的主题
主题 主题发起者 论坛 回复 最后发表
【转帖】runout relative to same features axis yang686526 American standards 0 2009-04-29 09:49 PM
【转帖】location information for hole position relative to basics yang686526 American standards 0 2009-04-29 08:42 PM
【转帖】asme - where to star yang686526 American standards 0 2009-04-29 07:28 PM
【转帖】redefine a relative to view yang686526 SolidWorks二次开发 0 2009-04-13 01:50 PM
Which functions of ISldWorks should I use to catch the error without relative dongle? huangyhg SolidWorks二次开发 1 2007-09-04 01:48 PM


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


于2004年创办,几何尺寸与公差论坛"致力于产品几何量公差标准GD&T | GPS研究/CAD设计/CAM加工/CMM测量"。免责声明:论坛严禁发布色情反动言论及有关违反国家法律法规内容!情节严重者提供其IP,并配合相关部门进行严厉查处,若內容有涉及侵权,请立即联系我们QQ:44671734。注:此论坛须管理员验证方可发帖。
沪ICP备06057009号-2
更多