set the max. segments in BSpline approximation to 50

in Draft and Drawing WBs
This commit is contained in:
Sebastian Hoogen
2015-01-29 12:01:41 +01:00
committed by wmayer
parent b54dd77a50
commit 6a0bcfbaee
2 changed files with 4 additions and 4 deletions

View File

@@ -1817,7 +1817,7 @@ def getSVG(obj,scale=1,linewidth=0.35,fontsize=12,fillstyle="shape color",direct
bspline=e.Curve.toBSpline(e.FirstParameter,e.LastParameter)
if bspline.Degree > 3 or bspline.isRational():
try:
bspline=bspline.approximateBSpline(0.05,20, 3,'C0')
bspline=bspline.approximateBSpline(0.05,50, 3,'C0')
except RuntimeError:
print("Debug: unable to approximate bspline")
if bspline.Degree <= 3 and not bspline.isRational():

View File

@@ -157,7 +157,7 @@ TopoDS_Edge DrawingOutput::asCircle(const BRepAdaptor_Curve& c) const
TopoDS_Edge DrawingOutput::asBSpline(const BRepAdaptor_Curve& c, int maxDegree) const
{
Standard_Real tol3D = 0.001;
Standard_Integer maxSegment = 10;
Standard_Integer maxSegment = 50;
Handle_BRepAdaptor_HCurve hCurve = new BRepAdaptor_HCurve(c);
// approximate the curve using a tolerance
Approx_Curve3d approx(hCurve,tol3D,GeomAbs_C0,maxSegment,maxDegree);
@@ -355,7 +355,7 @@ void SVGOutput::printBSpline(const BRepAdaptor_Curve& c, int id, std::ostream& o
Handle_Geom_BSplineCurve spline = c.BSpline();
if (spline->Degree() > 3 || spline->IsRational()) {
Standard_Real tol3D = 0.001;
Standard_Integer maxDegree = 3, maxSegment = 10;
Standard_Integer maxDegree = 3, maxSegment = 50;
Handle_BRepAdaptor_HCurve hCurve = new BRepAdaptor_HCurve(c);
// approximate the curve using a tolerance
Approx_Curve3d approx(hCurve,tol3D,GeomAbs_C0,maxSegment,maxDegree);
@@ -628,7 +628,7 @@ void DXFOutput::printBSpline(const BRepAdaptor_Curve& c, int id, std::ostream& o
Handle_Geom_BSplineCurve spline = c.BSpline();
if (spline->Degree() > 3 || spline->IsRational()) {
Standard_Real tol3D = 0.001;
Standard_Integer maxDegree = 3, maxSegment = 10;
Standard_Integer maxDegree = 3, maxSegment = 50;
Handle_BRepAdaptor_HCurve hCurve = new BRepAdaptor_HCurve(c);
// approximate the curve using a tolerance
Approx_Curve3d approx(hCurve,tol3D,GeomAbs_C0,maxSegment,maxDegree);