
Wed, 05/12/2010 - 18:56
Hello,
I have a problem that seems very simple.
I'm creating a tetrahedron using the Graphic3d_ArrayOfTriangleStrips class.
It's well showned when I use this code in the Compute function :
Handle(Graphic3d_ArrayOfTriangleStrips) aTriangleStripsArray = new Graphic3d_ArrayOfTriangleStrips(6, 6, Standard_False, Standard_True, Standard_False, Standard_False);
//Add 6 vertices
aTriangleStripsArray->AddVertex(...)
//Display
Handle(Graphic3d_Group) aGroup = Prs3d_Root::CurrentGroup(aPresentation);
Handle(Graphic3d_AspectFillArea3d) myFillAspect = myDrawer->ShadingAspect()->Aspect();
Graphic3d_MaterialAspect mat;
mat.SetReflectionModeOff(Graphic3d_TOR_AMBIENT);
mat.SetReflectionModeOn(Graphic3d_TOR_DIFFUSE);
mat.SetReflectionModeOff(Graphic3d_TOR_SPECULAR);
mat.SetReflectionModeOff(Graphic3d_TOR_EMISSION);
myFillAspect->SetFrontMaterial(mat);
aGroup->BeginPrimitives();
aGroup->AddPrimitiveArray(aTriangleStripsArray);
aGroup->EndPrimitives();
When a apply an OpenGl clipping plane, the tetrahedon is well cut but it's not a solid shape. I can see the interior and I don't want this behaviour. (see capture)
How can I fill the tetrahedron ?
Thank you very much for your help
Mathieu
Thu, 05/13/2010 - 14:31
Hi Mathieu,
Your TriangleStrip is only an OpenGL representation. In my opinion, if you wish to fill in your mesh with matter, you have to create a TopoDS_Solid from TopoDS_Edge, Vertex and Face. But maybe OCC is not the most suitable tool for advanced mesh visualization.
Thomas
Mon, 05/17/2010 - 16:42
Hi,
Thank you Thomas for your answer.
If I create a TopoDS_Solid object, it's too slow for my application... (I have more than 1 million tetrahedron...)
Do you advise me to directly use OpenGl to fill my mesh with matter ?
I don't know if it's possible to do that directly with opengl or if I need to use a visualization engine (like opencascade or VTK).
I'm looking for informations, thank you for your help
Regards