From 4c498e132e4e38c45c56ceb925ddce106a1b440c Mon Sep 17 00:00:00 2001 From: vocx-fc Date: Wed, 8 Jul 2020 12:04:41 -0500 Subject: [PATCH] Draft: move getCircle out of getSVG function --- src/Mod/Draft/getSVG.py | 87 ++++++++++++++++++++++++++--------------- 1 file changed, 56 insertions(+), 31 deletions(-) diff --git a/src/Mod/Draft/getSVG.py b/src/Mod/Draft/getSVG.py index 5cfb80b04a..88f1fec91f 100644 --- a/src/Mod/Draft/getSVG.py +++ b/src/Mod/Draft/getSVG.py @@ -166,6 +166,50 @@ def getPattern(pat): return get_pattern(pat) +def get_circle(plane, + fill, stroke, linewidth, lstyle, + edge): + """Get the SVG representation from a circular edge.""" + cen = get_proj(edge.Curve.Center, plane) + rad = edge.Curve.Radius + + if hasattr(FreeCAD, "DraftWorkingPlane"): + drawing_plane_normal = FreeCAD.DraftWorkingPlane.axis + else: + drawing_plane_normal = FreeCAD.Vector(0, 0, 1) + + if plane: + drawing_plane_normal = plane.axis + + if round(edge.Curve.Axis.getAngle(drawing_plane_normal), 2) in [0, 3.14]: + # Perpendicular projection: circle + svg = '= n: svg += '