From 89cb2479232ea949b368e849d90fd6ce563154c1 Mon Sep 17 00:00:00 2001 From: wmayer Date: Mon, 11 Jan 2016 13:01:01 +0100 Subject: [PATCH] + handle degenerated ellipse for SVG output --- src/Mod/Drawing/App/DrawingExport.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/Mod/Drawing/App/DrawingExport.cpp b/src/Mod/Drawing/App/DrawingExport.cpp index 2cbdde8c3..b41dc08c1 100644 --- a/src/Mod/Drawing/App/DrawingExport.cpp +++ b/src/Mod/Drawing/App/DrawingExport.cpp @@ -257,6 +257,14 @@ void SVGOutput::printEllipse(const BRepAdaptor_Curve& c, int id, std::ostream& o gp_Pnt m = c.Value((l+f)/2.0); gp_Pnt e = c.Value(l); + // If the minor radius is very small compared to the major radius + // the geometry actually degenerates to a line + double ratio = std::min(r1,r2)/std::max(r1,r2); + if (ratio < 0.001) { + printGeneric(c, id, out); + return; + } + gp_Vec v1(m,s); gp_Vec v2(m,e); gp_Vec v3(0,0,1);