how do i retrieve vertex informations of a prim made by BRepPrimAPIs?

i just finished reading the tutorial pdf,and i got how to build prims and how to do boolean operations,now my problem is obtain the vertex buffer and index buffer of these prims or boolean operation results,i need these data to create meshes in another graphic engine.

any help please?

Roman Lygin's picture

Can you be more specific of what you are doing and expecting to achieve ? A step-by-step description of your process should be helpful.

Thanks.
Roman

---
opencascade.blogspot.com - blog on Open CASCADE
Join the Open CASCADE Group at LinkedIn

cloudage's picture

Thanks for reply.
i`m working on these:

1) Build 3d prims(box,sphere,cylinder,etc) at runtime

2) Do boolean operations on these prims

3) Transform prims and boolean operation results into meshs

4) Obtain vertex buffer and index buffer of these mesh

5) Transfer these buffer datas to a external graphic render engine(ogre,irrlicht,unreal,etc)

6) Inside that external graphic render engine,use these buffer datas build a mesh object,and add it into the scenegraph.Then i finally displayed the prims build by CASCAD with my favorite graphic engine.This is my goal.

Patrik Mueller's picture

Hi,

try at the triangulation inside OCCT: BRepMesh_IncrementalMesh and BRep_Tool::Triangulation. If you use windows take a look at the "02_7_TopologyTriangulation" sample. I do similar...

Best regards,

Patrik

cloudage's picture

thanks,but i saw BRep_Tool::Triangulation will return me a Handle_Poly_Triangulation,it seems not a vertex buffer but some thing can be use to gain the real buffer,but i don`t understand how to use it.what should i do with it,please?

Rob Bachrach's picture

You might want to check out the code in:

http://www.opencascade.org/org/forum/thread_14748/

Rob

cloudage's picture

i got it.thank you very much.thanks all of you.