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

Open CASCADEShowroomGet Open CASCADEDeveloper CornerSupportAbout us
Technical overview
Areas of use
Advantages
Public license
FAQ
Screenshots
Shape factory
Shape gallery
Demonstrations
System requirements
What's new
Download Center
CD-ROM
Documentation
Getting started
Forum
Open Source community
Training and e-learning
A la Carte Support
Value-added software
Client Area
Company Profile
Contacts and Locations
Customers
News
Home / Developer Corner / Forum / Extract only solid from shape

Forum

Extract only solid from shape
Markus Litz 2008-05-14 08:50
Hi,

I have a problem with extracting a solid from a shape. I have a shape with this specifications:

SOLIDS : 1
SHELLS : 1
FACES : 102
WIRES : 102
EDGES : 404
VERTICES : 808
Compounds: 1
CompSolids: 0

Now I want to get only the solid, but without all unnecessary faces. When using TopExp_Explorer Ex(myShape,TopAbs_SOLID) - I get the Solid and ALL other faces and edges. Is there the possibility to get only the shape without the faces in the middle of the solid?

Thanks in advance!
Markus
Svetlozar Kostadinov 2008-05-15 15:27
The solid is based on other underlying topology objects - always one closed shell, the closed shell is based on couple of faces and so on. As far as I know, the data is kept only in the underlying objects. If you just want to reject the faces, you could you TopExp_Explorer::Depth() to limit the traversal only at the desired level. Or try to use the third parameter of the constructor and set it to TopoAbs_FACE.

Regards!
Markus Litz 2008-05-26 08:21
TopExp_Explorer::Depth() sounds interesting, but I could not find any examples. Maybe someone here who has used this function in a similar context?
xiuerlee 2008-06-06 06:28
std::vector<TopoDS_Shape> theSolidVec;

for ( TopoExp_Explorer Ex(myShape, TopAbs_SOLID); Ex.More(); Ex.Next() ) {

TopoDS_Shape theSolid = TopoDS::Solid( Ex.Current());
theSolidVec.push_back( theSolid );
}

for ( std::vectro<TopoDS_Shape>::iterator shape = theSolidVec.begin()
; shape != theSolidVec.end()
; ++shape )
{
myAISContext->Display(Handle(AIS_Shape)(new AIS_Shape(*shape),Standard_False );
}

If you want to get the face of the shape, you could use TopExp_Explorer(myShape, TopAbs_FACE).
 
 
Latest news
  • Open CASCADE Technology 6.3
  • SolidWorks Import by Datakit
  • UG NX Import by Datakit

  • © Open CASCADE 2000 - 2008  |  Search  |  Contacts