From 843838ec194010197dcaf9e5d83d55f253d2ac03 Mon Sep 17 00:00:00 2001 From: Yorik van Havre Date: Fri, 17 Jan 2014 09:40:48 -0200 Subject: [PATCH] Draft: Added shoogen's fix to bspline to svg stuff --- src/Mod/Draft/Draft.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Mod/Draft/Draft.py b/src/Mod/Draft/Draft.py index 55fca8003..e9051fd70 100644 --- a/src/Mod/Draft/Draft.py +++ b/src/Mod/Draft/Draft.py @@ -1536,7 +1536,12 @@ def getSVG(obj,scale=1,linewidth=0.35,fontsize=12,fillstyle="shape color",direct svg += 'L '+ str(v.x) +' '+ str(v.y) + ' ' else: bspline=e.Curve.toBSpline() - if bspline.Degree <= 3 and not bspline.isRational(): + if bspline.Degree > 3 or bspline.isRational(): + try: + bspline=bspline.approximateBSpline(0.05,20, 3,'C0') + except RuntimeError: + print "Debug: unable to approximate bspline" + elif bspline.Degree <= 3 and not bspline.isRational(): for bezierseg in bspline.toBezier(): if bezierseg.Degree>3: #should not happen raise AssertionError