几何尺寸与公差论坛------致力于产品几何量公差标准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:38 PM   #1
yang686526
高级会员
 
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
yang686526 向着好的方向发展
默认 【转帖】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.
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)
回复


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

高级搜索
显示模式

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

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

相似的主题
主题 主题发起者 论坛 回复 最后发表
【转帖】question regarding datum and tolerances on it as well as fea yang686526 American standards 0 2009-04-29 09:37 PM
【转帖】basic gdt question yang686526 American standards 0 2009-04-29 06:37 PM
【转帖】auxilliary section view question yang686526 American standards 0 2009-04-29 06:34 PM
【转帖】assembly drawing bom change question yang686526 American standards 0 2009-04-29 06:31 PM
【转帖】video card driver question yang686526 SolidWorks二次开发 0 2009-04-13 03:16 PM


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


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