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

3d view issue
3d view issue
hi all,
i have a drawing of the opera house, that is a 3d view, and i am using the model view to display.
originally i wrote my own rendering system going through all the entities and working out all the geometry the long hard way. but since on a previous post, i have decided to try the vectorizeex example to make my life easier. however here in lies a funny little problem.
only plotting cacdbline entities at the base of the blocktablerecord, if i plot them using the drawing opera.dwg, they go all over the place (nuclear explosion so to speak), but if i explode the opera.dwg heaviliy in autocad and save it as opera_exploded.dwg, and run the program again, i get a very sensible picture.
now i guess i am doing something incorrect, but i am at a loss to what it could be. i have attached the two drawings for your convenience, if someone wishes to help me. (unfortunately, i could not upload the exploded version of the opera house drawing, it seems to be the size that stops me from doing this. anyhow, to show that it does work ok, just highlight the entire drawing and explode it, i did this about 3 times)
if there is anything else i can do to help with this, please ask.
cheers
jason
ps. oh and thanx in advance to the person who helps me out.
attached files

i recomend you to start debugging your program with simple drawings, opera.dwg is quite complex.
first thing that should be verifyed - didn't you loose the model transform somewhere. create the drawing with two entities - single simple block reference (but with non-identity transform) and circle around it and watch if exploding the block reference changes the view (the relative dispostition of circle and former block reference).
sincerely yours,
george udov
quote:
originally posted by george udov
i recomend you to start debugging your program with simple drawings, opera.dwg is quite complex.
first thing that should be verifyed - didn't you loose the model transform somewhere. create the drawing with two entities - single simple block reference (but with non-identity transform) and circle around it and watch if exploding the block reference changes the view (the relative dispostition of circle and former block reference).
george,
i have been testing simplier drawings, and they are working fantastic, but based on your comment, i think you know the solution, the comment "didn't you loose the model transform somewhere", how do you mean loose. as the vectorizeex simple device / view vectorizes, they just output the points for everything, and i assume the block transformations are taken into account as it goes deeper into blocks into blocks. i assume from your comment this is not the case, so do i have to record the blocks transformation matrix and apply this to vectorized points inside of this block. (this is similiar to what i did with my old 2d drawing engine, but i suspected this geometry simplifier di d all the hard work for me, so i gather i am wrong?)
so is there an easy way to transform an entity object using the block references matrix?
am i just more confused than ever?
cheers
jason

jason,
of course, odvectorizeex returns points with applied model (blocks), view and projection transformations. if your application is based on odvectorizeex and you're loosing model transformation -- you should find difference between your application and vectorizeex.
so recommended way of debug is
1) test odvectorizeex if it does take model transformation into account on file i mentioned in previous post. i think the answer will be "yes".
2) test your application on such file - if it does. i think the answer will be "no".
if answers really are "yes" and "no" -- find difference between your application and vectorizeex.
btw, odgigeometrysimplifier doesn't apply any transforms - just simplifies incoming geometry. model transformations are applied by odgimodeltoviewproc inside gi vectorization framework.
sincerely yours,
george udov
george,
the following is my code in the attachment, and as you can see, it is just odvectorizeex with a very slight change (lots of output of string dumps removed, and very much is as is but with a few name changes.).
is there anything you can see that looks like a straight out problem. i have looked and looked, but i cannot find what the issue is (ie what is different between this code and odvectorizeex code)
also thank you for helping me so far, and hopefully this will soon be resolved.
cheers
jason
attached files (18.6 kb, 18 views)

george,
i also did some more investigation, and i added the following code to vectorizeex
gblinefound = false;
if( pent->isa() == oddbline::desc() ) {
gblinefound = true;
}
odgsbasevectorizeview::draw(pdrawable);
gblinefound = false;
gblinefound is just a simple global, and once it is starting to polyline a line type entiy, i output the vertices to screen only then. i compared these values to the values from my version, and they are exactly the same. i dont believe vectorizeex is supporting 3d drawings like the opera.dwg correctly, because if i plot those co-ordinates, the drawing is completely wrong (well not completly but does not resemble the drawing correctly.)
cheers
jason
anyone else have any idea on whats wrong?
could anyone else please help with this?
still confused as to what is wrong, else i just do the old way i did it originally, and work out all the vectorizing my self. which i might add was thinking this new way is just so much easier and better, would hate to not go down this track. i assume it must be an easy mistake i have made?
stuck.
jason
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)
回复


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

高级搜索
显示模式

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

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

相似的主题
主题 主题发起者 论坛 回复 最后发表
【转帖】projection view from a section view yang686526 American standards 0 2009-04-29 09:32 PM
【转帖】what am i doing wrong here select view yang686526 SolidWorks二次开发 0 2009-04-13 03:23 PM
【转帖】rotating a drawing view yang686526 SolidWorks二次开发 0 2009-04-13 01:59 PM
【转帖】get x,y,z of drawing view vertexedge yang686526 SolidWorks二次开发 0 2009-04-13 11:03 AM
【转帖】drawing view placements yang686526 SolidWorks二次开发 0 2009-04-13 10:35 AM


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


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