Find face with wire in a TopoDS_Shape

Hi!

I am using BRepAlgoAPI_Section to find the section of 2 shapes.
Then I connect the edges to closed wires.

What I want to do now is to color the surface of the section.
I think I could use BRepBuilderAPI_MakeFace with a Geom_Surface and a wire.

My problem is how to find the face on which the wire is located.
I know that the wires are on a face in the shape, but the wires are no wires of the original shape, so I cant use TopExp_Explorer

Any suggestions?

Best Regards, Matthias

Stephane Routelous's picture

if you compute the pcurves in BRepAlgoAPI_Section ( ComputePCurveOn1 or On2 ), you can access the faces of the edges with the pcurves.

HTH,

Stephane

manika's picture

If I understand you correctly you want to find all the faces that are traversed by you wire that you get from BRepAlgoAPI_Section.
the solution should be:

BRepAlgoAPISection aSection (aShape1, aShape2);
TopoDS_Iterator its(aSecAlgo);
for (its; its.More(); its.Next()){
const TopoDS_Edge& aEdge = TopoDS::Edge(its.Value());
TopoDS_Face aFace;
if (aSecAlgo.HasAncestorFaceOn1(aEdge, aFace)){
//aFace should the Face you're looking for
}
}

Matthias Teich's picture

Thank you, that was a good hint!

Do you know if there is also an easy way to compute a shape from a number of faces and a wire lying on these faces?

Thank you & Best Regards,
Matthias