For all issues regarding the Forums use, please, refer to the Forum Rules.

Our Solutions

Need professional assistance?
Consider our:

Support Offerings

 

Need to speed up your development?
Have a look at our:

Samples & Tools

 

Need some functionality extending standard OCCT capabilities?
Check out our:

Adv. Components

Related pages

Wrong First and Lastparameter using BRepAdaptor_CompCurve

Stefan Kunze's picture
Forums: 

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:
http://rapidshare.com/files/263562344/SampleWire.opn.html

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");

Stefan Kunze'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