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

rendering (precision)
rendering (precision)
hello,
new dwgdirect library renders drawing into points with double precision. this is really a nice enhancement regarding old viewkit library. good work!
while testing this new feature i found some problems:
in paperspace i created a view on the model (two lines connected in one point), which is very far away. than i added new red line in paperspace view, which connects these two lines.
i rendered this paperspace view into rectangle(0,0->100,100), and got following points:
line1 (red):
55.011855,46.269315 -> 55.011847,46.269350
line 2:
54.972059,46.300682 -> 54.972038,46.300717
line3
54.972045,46.300682 -> 54.972059,46.300682
line 2 and line 3 are connected on one point, but line 1, which is drawn on paperspace viewport does not connect line2 and line 3.
i tried to render this drawing also to rectangle (0,0->100.000,100.000) but i got the same result.
is this a bug in the library or some kind of limitation?
i am attaching my example drawing.
i have another question regarding precision:
circles are rendered as polylines. if circle is big enough, rendered polyline is similar to circle (it has some corners), but if circle is very small, than rendered polyline has only four corners (square).
is it possible, to render circles depending on their radius? - so that rendered circles will always look similar to original entity?
regards, tomaz.
attached files
hi,
does anybody from opendwg know why precision problem occurs in dwgdirect 1.09 (patch)?
regards, tomaz
precision
have you try the resview variable ?
thanks,
laurent
hi lg,
in which class can i find the resview variable? i have searched in many classes, but no success.
regards, tomaz
viewres
hi, viewres is a system variable in autocad.
try wrtriangulationparam class and odsettriangulationparams function
thanks,
laurent
hi, lg,
i have tried the wrtriangulationparam class and odsettriangulationparams function:
{
wrtriangulationparams params;
params.normaltolerance = 1e-12;
params.surfacetolerance = 1e-12;
odsettriangulationparams(&params);
// vectorize the dawing
}
i get the same result as before. is there any documentation about this class and function? (or maybe an example)
what is the meaning of variables of the class wrtriangulationparam?
regards, tomaz
triangulation params effect only acis triangulation/rendering.
curves tesselation (arcs, splines) depends on value returned by odgiabstractgeometry :: deviation() and modeldeviation() methods. in sample devices used by odamfcapp pixel size is taken into account to return proper deviation value.
sergey slezkin
hello,
so, the only way to render each circle with the same number of line segment is to catch it before it is drawn, and correct the return value of deviation method, depending on circle's radius.
but in my first (original) message, there was another question. why the drawing is not rendered correctly? even if i export it to dwf format, with odamfc application, i do not get the same result as in autocad.
here i am sending another drawing with similar problem. (red lines, drawn into the paper space are not visible in dwf drawing). (export the drawing into dwf and zoom in into the center of circles).
regards, tomaz
attached files (31.5 kb, 5 views)

if you override circle(), circulararc() methods in your geometry inheritor you can treat them as you like. default implementation tesselates them into polyline using value returned by deviation().
dwf format stores integer coordinates so if zoom is "very large" you can't see details less than 1 dwf logical unit.
btw, dwf saved by autocad for your file does not allow to view your red paper space lines too.
sergey slezkin
sergey,
since dwf file format stores integer coordinates, i guess that dwf export works ok.
but i render the drawing into a format, which stores double coordinates.
in first message i wrote, that dwgdirect rendering functionality returns coordinates, which are not correct (in double format):
line3 is not connected to line1 and line2.
but in autocad, all three lines are connected to each other.
is this a bug in dwgdirect library?

this problem is reproducible with the drawing attached to the first message in this thread.
if you can not reproduce the problem, i can create a small example and send it to you.
regards, tomaz
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)
回复


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

高级搜索
显示模式

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

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



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


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