计算曲线线长

Standard_Real CPnts_AbscissaPoint::Length(const Adaptor3d_Curve& C,
                      const Standard_Real U1,
                      const Standard_Real U2) 
{
  CPnts_MyGaussFunction FG;
//POP pout WNT
  CPnts_RealFunction rf = f3d;
  FG.Init(rf,(Standard_Address)&C);
//  FG.Init(f3d,(Standard_Address)&C);
  math_GaussSingleIntegration TheLength(FG, U1, U2, order(C));
  if (!TheLength.IsDone()) {
    Standard_ConstructionError::Raise();
  }
  return Abs(TheLength.Value());
}
根据上述求曲线弧长的代码可知,只需要给定曲线及其求积区间,即可计算出此区间内曲线的弧长。因为采用直接求积计算,所得曲线的弧长值的精度还是很高的。
posted @ 2020-04-17 15:51  田大将  阅读(471)  评论(0)    收藏  举报