I am having problems extracting the PCurves from a BRepAlgoAPI_Section.
I have intersected two shapes (each has a b-spline surface as its underlying geometry) and when I explore the result, I can extract Edges for all the intersections and display them. I can also extract the PCurves on my first shape, but the call to PCurveOn2 results in a unhandled exception in TKBREP.DLL.
Is there anything wrong with my code listed below?
I am using the precompiled stable release 4.0 on Windows 2000, Visual C++ 6.0.
BRepAlgoAPI_Section mySection(myShape1, myShape2, false);
// build b-spline curves
// make sure we find the parametric curves
for ( anExp.Init(mySection.Shape(), TopAbs_EDGE); anExp.More(); anExp.Next())
TopoDS_Edge myEdge = TopoDS::Edge(anExp.Current());
Handle_AIS_Shape anAISShape=new AIS_Shape(myEdge);
double rWFirst, rWLast;
Handle(Geom_Curve) aCurve = BRep_Tool::Curve (myEdge, rWFirst, rWLast);
Handle(Geom2d_Curve) myPCurveOn1 = mySection.PCurveOn1(myEdge);
Handle(Geom2d_Curve) myPCurveOn2 = mySection.PCurveOn2(myEdge); // this call results in an exception