From 3d87d88616d7316608e49077b9118e816f3061f4 Mon Sep 17 00:00:00 2001 From: wmayer Date: Sat, 5 Jul 2014 15:48:50 +0200 Subject: [PATCH] + fix Part.makeTube --- src/Mod/Part/App/TopoShape.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/Mod/Part/App/TopoShape.cpp b/src/Mod/Part/App/TopoShape.cpp index 4125ba2f3..d9084d5d4 100644 --- a/src/Mod/Part/App/TopoShape.cpp +++ b/src/Mod/Part/App/TopoShape.cpp @@ -75,7 +75,7 @@ # include # include # include -#include +# include # include # include # include @@ -91,6 +91,7 @@ # include # include # include +# include # include # include # include @@ -1463,8 +1464,8 @@ static Handle(Law_Function) CreateBsFunction (const Standard_Real theFirst, cons { //Handle_Law_BSpline aBs; //Handle_Law_BSpFunc aFunc = new Law_BSpFunc (aBs, theFirst, theLast); - Handle_Law_Linear aFunc = new Law_Linear(); - aFunc->Set(theFirst, theRadius, theLast, theRadius); + Handle_Law_Constant aFunc = new Law_Constant(); + aFunc->Set(1, theFirst, theLast); return aFunc; } @@ -1472,6 +1473,7 @@ TopoDS_Shape TopoShape::makeTube(double radius, double tol, int cont, int maxdeg { // http://opencascade.blogspot.com/2009/11/surface-modeling-part3.html Standard_Real theTol = tol; + Standard_Real theRadius = radius; //Standard_Boolean theIsPolynomial = Standard_True; Standard_Boolean myIsElem = Standard_True; GeomAbs_Shape theContinuity = GeomAbs_Shape(cont); @@ -1500,11 +1502,11 @@ TopoDS_Shape TopoShape::makeTube(double radius, double tol, int cont, int maxdeg } //circular profile - Handle(Geom_Circle) aCirc = new Geom_Circle (gp::XOY(), radius); + Handle(Geom_Circle) aCirc = new Geom_Circle (gp::XOY(), theRadius); aCirc->Rotate (gp::OZ(), M_PI/2.); //perpendicular section - Handle(Law_Function) myEvol = ::CreateBsFunction (myPath->FirstParameter(), myPath->LastParameter(), radius); + Handle(Law_Function) myEvol = ::CreateBsFunction (myPath->FirstParameter(), myPath->LastParameter(), theRadius); Handle(GeomFill_SectionLaw) aSec = new GeomFill_EvolvedSection(aCirc, myEvol); Handle(GeomFill_LocationLaw) aLoc = new GeomFill_CurveAndTrihedron(new GeomFill_CorrectedFrenet); aLoc->SetCurve (myPath);