BRepAlgo::ConcatenateWire bug!?

BRepAlog/BRepAlgo.cxx 69 147 in BRepAlgo::ConcatenateWire

@@@ Original @@@
tab(index) = GeomConvert::CurveToBSplineCurve(new //storage in a array
Geom_TrimmedCurve(BRep_Tool::Curve(edge,L,First,Last),First,Last));
@@@ Fixed @@@
Handle(Geom_Curve) tmpC = BRep_Tool::Curve(edge,L,First,Last);
tab(index) = GeomConvert::CurveToBSplineCurve(new Geom_TrimmedCurve(tmpC, First,Last));

For the purpose of converting wire (lines and arcs are connected) into BSpline, I use this function BRepAlgo::ConcatenateWire.
but it always raise exception at the constructor of Geom_TrimmedCurve as U1 and U2 are equal to zero.

if (U1 == U2)
Standard_ConstructionError::Raise("Geom_TrimmedCurve::U1 == U2");

so I finally understand that the First and Last parameter which BRep_Tool::Curve calculated are not passed to Geom_TrimmedCurve constructor.

Roman Lygin's picture

Hmmm, really interesting. I assume this can be compiler-specific and those on which this code was initially tested ensured that arguments to a function are computed from left to right. Debugging in VS2005 I noticed that arguments are computed from right to left. That's why I think. So, yes, your observation and fix seem correct. Thanks !

OCCPATCH (fix stamp (c) Peter Dolbey ;-) )

Roman
---
opencascade.blogspot.com - the Open CASCADE blog

Kazumasa Uno's picture

Hello Roman.

Nice to meet you.
I have been programing at 2D cad for more than a decade.
buf I am pretty new to 3D cad.

Please give my best regards to OCC members.