Added the ability to operate the algorithm with different types of curves.
myFirstSect = GeomConvert::CurveToBSplineCurve(Circ,Convert_QuasiAngular);
}
-
+
if (myType <= 3 && myType >=1 ) {
for (Standard_Integer i = 2; i <= myNbSections; i++) {
Standard_Real Alpha = U - myAdpPath->FirstParameter();
Alpha /= myAdpPath->LastParameter() - myAdpPath->FirstParameter();
- Standard_Real U1 =
- ( 1- Alpha) * myAdpFirstSect->FirstParameter() +
- Alpha * myAdpFirstSect->LastParameter();
-
+ Standard_Real U1 = ( 1- Alpha) * myAdpFirstSect->FirstParameter() +
+ Alpha * myAdpFirstSect->LastParameter();
+
+ if (myAdpFirstSect->GetType() == GeomAbs_Line)
+ {
+ if (Precision::IsInfinite(myAdpFirstSect->FirstParameter()) ||
+ Precision::IsInfinite(myAdpFirstSect->LastParameter()))
+ {
+ gp_Lin aLine = myAdpFirstSect->Line();
+ U1 = ElCLib::Parameter(aLine, PPath);
+ }
+ }
gp_Pnt P1 = myAdpFirstSect->Value(U1);
Standard_Real U2 =
( 1- Alpha) * myAdpLastSect->FirstParameter() +
Alpha * myAdpLastSect->LastParameter();
-
+
+ if (myAdpLastSect->GetType() == GeomAbs_Line)
+ {
+ if (Precision::IsInfinite(myAdpLastSect->FirstParameter()) ||
+ Precision::IsInfinite(myAdpLastSect->LastParameter()))
+ {
+ gp_Lin aLine = myAdpLastSect->Line();
+ U2 = ElCLib::Parameter(aLine, PPath);
+ }
+ }
gp_Pnt P2 = myAdpLastSect->Value(U2);
gp_Ax2 Axis;
Pipe.Init(path, firstS, lastS);
}
else {
+ if (narg == 6 && !Option_NS && Draw::Atof(a[5]) != 0)
+ {
+ Handle(Geom_Curve) lastS = DrawTrSurf::GetCurve(a[isect + 1]);
+ Cont = GeomAbs_C2;
+ Pipe = GeomFill_Pipe(path, firstS, lastS, Draw::Atof(a[5]));
+ Pipe.Perform(Standard_True);
+ Handle(Geom_Surface) aSurface;
+ if (Pipe.IsDone())
+ {
+ aSurface = Pipe.Surface();
+ }
+ DrawTrSurf::Set(a[1], aSurface);
+ return 0;
+ }
// tuyau a N sections, N>=2
TColGeom_SequenceOfCurve Seq;
Seq.Clear();
theCommands.Add("tuyau",
- "tuyau [-NS] result Path Curve/Radius [Curve2] [Curve3] ... \n the option -NS is used only with 2 sections.\n With it, <result> is going from the first section to the last section \n Without, <result> is a pipe by evolutive section ",
+ "tuyau [-NS] result Path Curve/Radius [Curve2] [Curve3] ... [Radius]\n the option -NS is used only with 2 sections.\n With it, <result> is going from the first section to the last section \n Without, <result> is a pipe by evolutive section ",
__FILE__,
tuyau,g);
theCommands.Add("partuyau",
- "tuyau result Path Curve/Radius [Curve2]\n the parametrization of the surface in the V direction will be as the Path",
+ "tuyau result Path Curve/Radius [Curve2] [Radius]\n the parametrization of the surface in the V direction will be as the Path",
__FILE__,
tuyau,g);
--- /dev/null
+puts "============"
+puts "0031631: Modeling Algorithms - Invalid result of Pipe builder"
+puts "============"
+puts ""
+
+pload ALL
+
+restore [locate_data_file bug31631_1.brep] path
+restore [locate_data_file bug31631_2.brep] sup1
+restore [locate_data_file bug31631_3.brep] sup2
+
+tuyau res1 path sup1 sup2 6.35001275
+
+tuyau res2 path sup2 sup1 6.35001275
+
+mkface face1 res1
+mkface face2 res2
+
+checkprops face1 -s 352.49
+checkprops face2 -s 352.49
+
+checkview -display face1 -3d -path ${imagedir}/${test_image}.png
+
+puts "TEST COMPLETED"
\ No newline at end of file