Open CASCADE, the 3D modelling kernel
3D modeling & numerical simulation

Open CASCADEShowroomGet it!Developer CornerSupport and ProductsAbout us
Technical overview
Areas of use
Advantages
FAQ
Screenshots
Shape factory
Shape gallery
Demonstrations
What's new
System requirements
Download Center
Public license
Documentation
Getting started
Forum
Open Source community
Training and e-learning
A la Carte Support
Value-added software
Complementary Components
Customer Corner
Company Profile
Marketing Materials
Contact Us
News
Home / Developer Corner / Forum / Help: a mesh program

Forum

Help: a mesh program
davenkin2010/03/04 08:22
Hi, everyone. I'm now working on a little CAD program using Open CASCADE, but I came across some problems when using the mesh utility, few examples are available and the reference documentation didn't provide enough imformation on how to use the APIs, can anybody help?

I've made a test program using the example given in the Open CASCADE help PDF file (Modeling Algorithms):

Standard_Real radius=10. ;
Standard_Real height=25. ;
BRepAPI_MakeCylinder myCyl (radius, height) ;
TopoDS_Shape myShape = myCyl.Shape() ;
Standard_Real Deflection = 0.01 ;
BRepMesh::Mesh (myShape, Deflection);

then convert the TopoDS_Shape into AIS object:
Handle(AIS_Shape) aisShape=new AIS_Shape(myShape);

at last display the AIS_Shape:
myContext->Display(aisShape, Standard_False);
where myContext is an instance of Handle_AIS_InteractiveContext.

when the program runs, the cylinder appears, but the mesh result is not displayed, I don't know the reason.

mz2010/03/04 16:17
Hi davenkin,

you need to display the mesh explicitely by getting it from the TopoDS_Shape via BRep_Tool::Triangulation() and then either create an AIS_Shape for every triangle or combine these triangles to a compound before displaying (this will be faster).

Maybe this thread can help: http://www.opencascade.org/org/forum/thread_14748/

davenkin2010/03/05 09:40
Thank you very much. I've read the thread you gave, it helps me a lot, but another question appears:
BRep_Tool::Triangulation (const TopoDS_Face &F, TopLoc_Location &L) only deals with TopoDS_Face, this is only enough for display the mesh result, the thread from http://www.opencascade.org/org/forum/thread_14748/ gives an example on how to get the nodes from a face which is retruned by calling BRep_Tool::Triangulation, but how can I get the inner nodes of a solid, not a face.

mz2010/03/08 13:20
If my understanding is correct, you are not looking for a surface mesh but for a volume mesh. I'm afraid, OCC does not provide volume meshing. But maybe NETGEN can do this for you.

See also: http://www.opencascade.org/org/forum/thread_7303/
davenkin2010/03/09 08:57
Thank you,mz,you've got what I'm thinking about.
 
 
Latest news
  • FAQ section updated
  • OPEN CASCADE Uses Intel ® Parallel Studio XE to Introduce Parallelism into SALOME SMESH Module
  • Open CASCADE Technology 6.5.2 is available for download!

  • © OPEN CASCADE 2000 - 2012  |  Search  |  Contacts   |  Site map