
Sat, 08/08/2015 - 12:08
Dear sirs
May you please confirm or exclude that the crash occurring at the last line of following code is due to bug of the Geom_BezierCurve constructor ?
main.cpp:
----------------------------------------------------------
#include
#include
#include
#include
#include
int main(int argc, char *argv[])
{
TColgp_Array1OfPnt AP(0,1);
TColStd_Array1OfReal AW(0,1);
double w1=1.0;
double w2=1.0;
AW.SetValue(0,w1);
AW.SetValue(1,w2);
AP.SetValue(0,gp_Pnt(0.0,0.0,0.0));
AP.SetValue(1,gp_Pnt(0.0,0.0,1.0));
Handle(Geom_BezierCurve) hCurve=new Geom_BezierCurve(AP, AW);
}
--------------------------------------------------------------------
I have seen that the crash occurs for any input that involves the PoleWeights parameter of following constructor:
Standard_EXPORT Geom_BezierCurve(const TColgp_Array1OfPnt& CurvePoles, const TColStd_Array1OfReal& PoleWeights);
The crash does not happen whit the "non rational Bezier curve" defined using following constructor:
Standard_EXPORT Geom_BezierCurve(const TColgp_Array1OfPnt& CurvePoles);
I would like to know if this problem is specific of the liboce version 0.17 (which should correspond with OCC 6.8) or is a OCC bug.
Thanks
Walter Steffè
Tue, 09/01/2015 - 18:35
Hello, is'nt there anybody who can try this small code snippet ?
I am saying that Geom_BezierCurve constructor is not working at all.
It crashes with all input data that define a rational curve.
Strange that nobody cares about the total failure of a basic function like the BezierCurve constructor.
Walter
Tue, 09/01/2015 - 18:47
Hi Walter,
Could you try,
TColStd_Array1OfReal AW(1,2);
AW.SetValue(1,w1);
AW.SetValue(2,w2);
Some containers are expected to have index 1 as the first index instead of 0. Didn't try it myself.
Kind regards,
Arjan
Tue, 09/01/2015 - 19:39
Hello Arjan, many thanks for your hint.
You are right, when the container index starts at 1 it doesn't crash any more.
Kind regards,
Walter