几何尺寸与公差论坛------致力于产品几何量公差标准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-06, 04:06 PM   #1
yang686526
高级会员
 
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
yang686526 向着好的方向发展
默认 【转帖】invalid input error with a circular arc

invalid input error with a circular arc
invalid input error with a circular arc
hi,
in one of our dwg files, we have a problem while trying to get a oddbarc's coordinates. all geometries in that file are read correctly, but one:
here are the properties of that arc:
startparam = 4.1663234055087264
endparam = 4.1664700616472619
p1 = (296705.09660002124, 5050519.7547099842, 0)
p3 = (296705.09738335985, 5050519.7542340243, 0)
p2 = (296705.09699168178, 5050519.7544719893, 0)
here is the source code which is used to get these values:
code:
odgepoint3d p1;
dbarc->getstartpoint(p1);
odgepoint3d p3;
dbarc->getendpoint(p3);
if ((fabs(p1.x - p3.x) > 1.e-6 || fabs(p1.y - p3.y) > 1.e-6))
{
double start, end;
dbarc->getstartparam(start);
dbarc->getendparam (end);

odgepoint3darray gepoints;

if (fabs(end - start) > 1.e-6)
{
odgepoint3d p2;
dbarc->getpointatparam((start + end) / 2, p2);

odgecircarc3d arc(p1, p2, p3);
arc.getsamplepoints (0, 0, 0, gepoints, null);
...the error is thrown a the odgecircarc3d's instanciation.
do you see any problem is my source code ? what is the validation that is made in the odgecircarc3d constructor ?
thank you very much for your help.
sylvain
you may use set() method of the odgecircarc3d, that accepts odgeerror& as a last parameter, to get more information about the error in that case.
vladimir
hi wvk,
thank you for your answer.
the error code which is returned is 8 => klinearlydependentarg1arg2arg3.
can you explain what is the meaning of that error code, so i'll add a validation for that kind of arcs ?
thank you again,
sylvain
the code means that 3 points are on the same line.
sergey slezkin
thank you for your answer serge?
the three coordinates that are used to create my circular arc are:
p1 = (296705.09660002124, 5050519.7547099842, 0)
p2 = (296705.09699168178, 5050519.7544719893, 0)
p3 = (296705.09738335985, 5050519.7542340243, 0)
in my example, since i know that these coordinates were projected from lon/lat to mtm8 and that the mtm projection uses the meter unit, there is less that one centimeter between those coordinates. so in this example, the behavior of the odgecircarc3d's constructor seems to be ok.
what would happen if coordinates were in lon/lat (wgs84) ? in that case, coordinates may have less that 1.0e-3 difference, and it would be normal. what are the validation and precision required in the odgecircarc3d constructor ?
thank you,
sylvain
default tolerance used in ge functions is 1.e-10
sergey slezkin
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)
回复


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

高级搜索
显示模式

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

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

相似的主题
主题 主题发起者 论坛 回复 最后发表
【转帖】getting arc points yang686526 DirectDWG 0 2009-05-05 11:26 AM
【转帖】circular runou yang686526 American standards 0 2009-04-29 06:55 PM
【转帖】哪位高手指点一下下边lisp的怎么用 yang686526 数据库ObjectDBX 0 2009-04-28 12:13 PM
哪位高手指点一下下边lisp的怎么用 yang686526 ObjectARX(AutoLISP) 0 2009-04-26 06:19 PM
如何用用程序模拟键盘来控制 Media Player 7? huangyhg vc编程 9 2007-11-14 09:18 AM


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


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