Split a shell in two halfs

Hi,

I have some problem two split two shells. The intersect completely and I want one side of the one shell. But I get same strange results. Perhaps because of the orientation of the faces in the shells? Can anybody give me an advice. See link for picture - make the problem more understandable.

PS: I have tried the GEOMAlgo_Splitter class too, but I can get any result back...
Regards Simon

Here's the pic:
http://img442.imageshack.us/img442/3812/splitter.jpg

Here's the code:

BRepAlgoAPI_Section asect(shellMP1, shellMP2,Standard_False);
asect.ComputePCurveOn1(Standard_True);
asect.Approximation(Standard_True);
asect.Build();
TopoDS_Shape splitResult = asect.Shape();

BRepFeat_SplitShape asplit(shellMP1);

for (TopExp_Explorer Ex(splitResult,TopAbs_EDGE); Ex.More(); Ex.Next()) {
TopoDS_Shape anEdge = Ex.Current();
TopoDS_Shape aFace;
if (asect.HasAncestorFaceOn1(anEdge,aFace)) {
TopoDS_Face F = TopoDS::Face(aFace);
TopoDS_Edge E = TopoDS::Edge(anEdge);
asplit.Add(E,F);
}
}

asplit.Build();

BRep_Builder builder;
TopoDS_Compound Comp;
builder.MakeCompound(Comp);

TopoDS_Shape splitResult2 = asplit.Shape();
TopTools_ListIteratorOfListOfShape theList = asplit.DirectLeft();

for (;theList.More();theList.Next()) {
builder.Add(Comp,TopoDS::Face(theList.Value()));
}

BRepMesh::Mesh(Comp,1);

Handle(AIS_Shape) ais2 = new AIS_Shape(Comp);
myAISContext->SetColor(ais2,Quantity_NOC_AZURE,Standard_False);
myAISContext->SetMaterial(ais2,Graphic3d_NOM_PLASTIC,Standard_False);
myAISContext->Display(ais2,Standard_False);
myAISContext->SetCurrentObject(ais2,Standard_False);

Fit();
_____________

Attachments: 
Forum supervisor's picture

Hello Simon,

I noticed your shell looks like a triangular mesh... in this case I would recommend you to consider our advanced Mesh Framework component ( http://www.opencascade.org/support/products/omf/ ) specially designed to work with meshes effectively. In particular, this component features mesh intersection operations and Boolean operations on meshes which can be an efficient replacement of operations on exact shapes you are trying to apply.

For more information about our products and services please contact us at http://www.opencascade.org/about/contacts/ .
Best regards,
Forum Supervisor