Wrong First and Lastparameter using BRepAdaptor_CompCurve

Hello,
I´m using BRepAdaptor_CompCurve to handle a wire as a curve. Normally it works very well but now I have a case where the First- and Lastparameter are not as expected. Can someone confirm that there is some kind of problem/bug???

My Sample Wire: ...

My CodeToTest:
BRepAdaptor_CompCurve lWireAdaptor(myWire, Standard_False);
Rep_Builder lBuilder;
TopoDS_Compound lCompound;

lBuilder.MakeCompound(lCompound);
lBuilder.Add(lCompound,BRepBuilderAPI_MakeVertex(lWireAdaptor.Value(lWireAdaptor.FirstParameter())));
lBuilder.Add(lCompound,BRepBuilderAPI_MakeVertex(lWireAdaptor.Value(lWireAdaptor.LastParameter())));
lBuilder.Add(lCompound,pWire);
WriteShapeToFile(lCompound,"C:\\Temp\\test.opn");

StefanKunze's picture

myWire and pWire are the same!!!

Benjamin Bihler's picture

Just for the record (I had a similar problem): there are some requirements that must be met for BRepAdaptor_CompCurve to work as expected. One is that all edges of the wire must be connected to each other to make chain. Another requirement is that the vertices of the wire's edges must have the right orientation (the vertex corresponding to first parameter must have orientation forward, and the vertex corresponding to last parameter must have orientation reversed).

If these requirements are not met, then length computations with CPnts_AbscissaPoint::Length(...) give wrong results and also point evaluations do not give the expected points (but displaying such wires works for example).

Benjamin