if (GBz.IsNull()) {
GBs = DrawTrSurf::GetBSplineSurface(a[1]);
if (GBs.IsNull())
+ {
return 1;
- BSpline = Standard_True;
+ }
+ BSpline = Standard_True;
}
Standard_Real dx = Draw::Atof(a[n-3]);
if (GBz.IsNull()) {
GBs = DrawTrSurf::GetBSplineSurface(a[1]);
if (GBs.IsNull())
+ {
return 1;
- BSpline = Standard_True;
+ }
+ BSpline = Standard_True;
}
Standard_Integer UIndex = 0;
static Standard_Integer segsur (Draw_Interpretor& , Standard_Integer n, const char** a)
{
- if (n < 6) return 1;
+ if (n < 6 || n > 8) return 1;
Handle(Geom_BezierSurface) GBz = DrawTrSurf::GetBezierSurface(a[1]);
Handle(Geom_BSplineSurface) GBs;
GBs = DrawTrSurf::GetBSplineSurface(a[1]);
if (GBs.IsNull())
return 1;
- GBs->Segment(Draw::Atof(a[2]),Draw::Atof(a[3]),Draw::Atof(a[4]),Draw::Atof(a[5]));
+
+ Standard_Real aUTolerance = Precision::PConfusion();
+ Standard_Real aVTolerance = Precision::PConfusion();
+ if (n >= 7)
+ aUTolerance = aVTolerance = Draw::Atof(a[6]);
+ if (n == 8)
+ aVTolerance = Draw::Atof(a[7]);
+
+ GBs->Segment(Draw::Atof(a[2]),Draw::Atof(a[3]),Draw::Atof(a[4]),Draw::Atof(a[5]), aUTolerance, aVTolerance);
}
else {
GBz->Segment(Draw::Atof(a[2]),Draw::Atof(a[3]),Draw::Atof(a[4]),Draw::Atof(a[5]));
{
if (n < 2)
{
- cout<<"Invalid number of parameters"<<endl;
+ std::cout<<"Invalid number of parameters"<<std::endl;
return 1;
}
Handle(Geom_BSplineSurface) GBs1 = DrawTrSurf::GetBSplineSurface(a[1]);
Handle(Geom_BSplineSurface) GBs2 = DrawTrSurf::GetBSplineSurface(a[2]);
if (GBs1.IsNull() || GBs2.IsNull()) {
- cout<<"Invalid surface"<<endl;
+ std::cout<<"Invalid surface"<<std::endl;
return 1;
}
{
nbErr++;
Standard_Real aD = sqrt(aDist);
- cout<<"Surfaces differ for U,V,Dist: "<<aU<<" "<<aV<<" "<<aD<<endl;
+ std::cout<<"Surfaces differ for U,V,Dist: "<<aU<<" "<<aV<<" "<<aD<<std::endl;
}
}
}
exchuv,g);
theCommands.Add("segsur",
- "segsur name Ufirst Ulast Vfirst Vlast",
+ "segsur name Ufirst Ulast Vfirst Vlast [Utol [Vtol]]",
__FILE__,
segsur , g);