![]() |
【转帖】acis question
acis question
acis question i tried to read data from a 3d solid, adapting code from one of the examples. i get an error odbrinvalidinput returned from odbrbrepfacetraverser::setbrep my code is assert(currententity->iskindof(oddb3dsolid: esc())); const void* pbody = ((oddb3dsolid *)currententity.get())->body(); if (pbody) { odbrbrep br; odbrerrorstatus er = br.set((const char*)pbody); assert(er == odbrok); odbrbrepfacetraverser bft; er = bft.setbrep(br); assert(er == odbrok); currententity is a oddbentityptr. any ideas what the problem could be? the code is called using a "protocol extension" structure which works fine for other entities. i tried this using a file with just a cube created in autocad 2004, as well as one or the sample files. after a little more experimentation it seems that the problem occurs for autocad 2004 files-some older files i have work fine, so presumably it's some problem in the decoding within dwgdirect. the string returned by oddb3dsolid::body() doesn't contain anything useful for 2004 files. i'm trying to work out how to get the information i need from the br library, but need a little help. what i need is to get a series of faces, each with a series of closed loops, and for each loop to get a series of vertices to represent the loop (facetted if required). the end result will be a bit like a polyface mesh, but preferably with co-planar faces joined together. what i can currently do it get to a list of vertices by loop, but i suspect that some of the edges joining these are curves, and can't see how to get at these. there are classes odbrcoedge and odbredge, but it's now clear how to use them. one approach might be to get a odgecurve3d using the getcurve member of odbredge, but how do i tell if i have a straight line or a curve. if it's a curve i assume i can use the member getsamplepoints to facet? the documentation for many of these classes lists the members, but doesn't say how to use them, what they do, etc. is it urgent question ? i can help if it is still important. sergey slezkin 1. the latest dwgdirect release has a limitation: it does not process acis objects from 2004 dwg files (rendering, triangulation, brep). this will be fixed in next release. 2. not only edges may be not straight lines but any type of curve3d. faces may be non-planar - any type of surface: sphere, cone, cylinder, nurbs. for example full sphere is a single face without edges. hemisphere is a single face with one edge. if you need to convert 3dsolid to polyface mesh you can use decomposeforsave() method. see odamfcapp sample (dwgview.cpp - cdwgview: neditacisconversion()) sergey slezkin i'll wait for the next release (what is the timescale for that, and will it be non-beta?). i'll have to look at the decomposeforsave, but will also consider other methods (i'd prefer that the data is only triangulated if that is needed to ensure planar faces). decomposeforsave hi i tried to convert a 3dsolid in a polyfacemesh with the decomposeforsave, but it returned me a pointer null. i am using the dd_cw8shared version of 1.09 lib. the exemple odamfcapp is running correctly and convert the dxf (with 3dsolid) i was using on mac. thanks in advance. since 1.09 acis functionality is not initialized by default (to allow linking without dd acis stuff if it's not necessary) do you call odrxinitmodelergeometry() ? (and odrxuninitmodelergeometry()) seel odamfcapp initinstance() and exitinstance. sergey slezkin acis conversion thank you for your quick answer. i wasn't calling odrxinitmodelergeometry(), i try with this method and decomposeforsave still return me a null pointer. you said the acis functionnality is not initialized by default. does odrxinitmodelergeometry initialize it? i saw that in initinstance() there is a call to odrxexappsinitialize() and to odrxinitwinntcrypt() which contains rxinit() (the one of odcrypt) should i call odrxexappsinitialize() and rxinit() (odcrypt's one) thank you for your support calling odrxinitmodelergeometry() should be enough. decomposeforsave() should return an object if dwg version passed is <= r12. sergey slezkin it works! thanks for your help. my problem was that i changed the first parameter. but when i put oddb::vac12, it works. i was just surprised that it didn't give me a polyfacemesh but some oddbsolid. no matter it's the same information. thank you very much for your useful help yann i forgot to ask my question... hi, about the dwg version. is there some version of dxf or dwg for wich some acis entities are not treated? yann oddbobject::decomposeforsave() is intended to convert an object before saving to some file version different from current. acis objects (3dsolid, body and region) appeared in r13. so to convert acis objects into something else r12 version should be used as parameter. it's strange that you got oddbsolid. are you using updated 1.09? initial 1.09 release realy converted acis objects into a block of oddbsolids. sergey slezkin another question about the oddbpolyfacemesh or oddbsolid generated by the method decomposeforsave. there are 4 vertices, the third and the fourth one are the same point. is there a specific reason for that? yann about oddbsolid indeed, i was using the initial 1.09 release. i am going to change that. |
所有的时间均为北京时间。 现在的时间是 10:31 PM. |