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

18 vertices for 3-d box patch?
18 vertices for 3-d box patch?
i realize this isnt really a c++ issue, but i'm not sure where else to look for help!
that said, i made a quick 3-d box patch in autocad, moved the top vertices in a bit since all of the inputs to my physics model will likely be patches, except for things like screws, pins, etc. i opened the dwg file up in the mfc app provided in the samples and got model space with 18 vertices.
the only thing i can think of is my 8 vertices, 8 for a bounding area? and maybe 2 for the bounding cube?
the points were:
6.75143, 11.3342, 2.5868
6.7541, 10.5668, 0
6.7541, 10.5668, 0
1.3366, 11.3342, 2.5869
1.3366, 10.5668, 0
1.3366, 10.5668, 0
1.3366, 13.2653, 2.5869
1.3366, 14.064, 0
1.3366, 10.5668, 0
6.75142, 13.2653, 2.5869
6.7541, 14.064, 0
6.7541, 10.5668, 0
6.75142, 13.2653, 2.5869
6.75142, 13.2653, 2.5869
6.75143, 11.3342, 2.58681
1.3366, 13.2653, 2.5869
1.3366, 13.2653, 2.5869
1.3366, 11.3342, 2.5869
again, if there is a better place for such questions, or an faq out there, or otherwise, point me in the right direction.
thanks
corry
what do you mean by "model space with 18 vertices"?
does model space contain 3dsolid entity? how did you counted the vertices?
sergey slezkin
sorry, i am still getting a handle on all this as i am really not familier with cad.
i understand now how my previous statement was rather confusing. i also thought i had this figured out, but thanks to some bad logic i was wrong, so let me try this again.
issue i do not understand: 3d mesh box (box3d) has 18 vertices
steps to reproduce: in autocad select draw->surfaces->3d surfaces. select box3d. draw a box3d. save the drawing, and exit autocad. open drawing in the odamfcapp. select codamefappdoc->acdbblocktable->model_space->acdbpolygonmesh. 18 acdbpolygonmeshvertex objects will be listed.
the reason i think this is an issue is because a box3d should be representable by 8 vertices, not 18. many of the listings are duplicates, and for this case, at least, i can eliminate all duplicates. i looked at the order in which they were given, figuring maybe it was a triangle list/fan/strip, but it matches none, and has either too many, or too few vertices to make the object in triangles.
i have written a simple d3d app which opens the dwg with the library, extracts polygon mesh vertex data, and attempts to render it. a lot of my college programming time went into video game programming, so a simple d3d app like this was the easiest way for me to verify the data. i then used this app to try the various triangle orderings. i then looked at the data and realized that no ordering was possible since if the order was v1 v2 v3, v2 and v3 were the same vertex. so using my app i tried to get some info on the vertices, and so far, without any luck. the only functions to check with i could find were the following: oddb::vertex3dtype vt=pvertex->vertextype(); and oddb::visibility vis=pvertex->visibility(); both returned the same values for all vertices (simple vertex, and visible).
i'm pretty much at a loss here. for all 3d meshes, can i always just drop/ignore any/all duplicate points? do they serve some purpose? i can't see any rendering purpose, but maybe there is some cad purpose? or did autodesk just throw these in there to "muddy up" the format in the hopes of making it more difficult to reverse engineer?
any ideas?
thanks
corry
now it's clear. autocad created acdbpolygonmesh object.
polygon mesh object is defined by array of vertices mxn.
imagine a net of mxn size which is placed on a surface.
for example parallels and meridians on globe. their intersection points stored in mxn array form polygon mesh object representing a sphere.
all vertices in row representing pole coincide.
sergey slezkin
well, with that, i decided to search the forums, and got another explanation from you in someone elses thread about this, so its just about cleared up, and i suddenly realized why it is necessary
so just one problem left i think, obviously the library reads this as a linear array. there are therefore 2 ways of interpreting the data to make it 2-dimensional. row major and column major, which does the library/autocad use? i may just experiment, but its already 10:30pm and i'm stil lat work (sort of, on my own time, testing software....had a stupid bug of entering the wrong critical section ) so chances are i will be done w/ programming tonight, but who knows.
thanks again
corry
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)
回复


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

高级搜索
显示模式

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

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

相似的主题
主题 主题发起者 论坛 回复 最后发表
【转帖】dialog box sample code yang686526 SolidWorks二次开发 0 2009-04-13 10:20 AM
VC中Combo Box控件使用大全 huangyhg vc编程 2 2009-03-22 10:45 PM


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


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