![]() |
【转帖】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 |
所有的时间均为北京时间。 现在的时间是 02:54 PM. |