From fcbd94d58b7321808e39b6c7de9f0da2512a126f Mon Sep 17 00:00:00 2001 From: alvinpenner Date: Tue, 23 Dec 2008 02:27:45 +0000 Subject: [PATCH] add support for quadratic Bezier --- share/extensions/dxf_input.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/share/extensions/dxf_input.py b/share/extensions/dxf_input.py index 6c759ba8f..ffb1194c8 100644 --- a/share/extensions/dxf_input.py +++ b/share/extensions/dxf_input.py @@ -65,10 +65,14 @@ def export_LINE(): def export_SPLINE(): # mandatory group codes : (10, 20, 70) (x, y, flags) if vals[groups['10']] and vals[groups['20']] and vals[groups['70']]: - if vals[groups['70']][0] == 8 and len(vals[groups['10']]) == 4 and len(vals[groups['20']]) == 4: + if not (vals[groups['70']][0] & 3) and len(vals[groups['10']]) == 4 and len(vals[groups['20']]) == 4: path = 'M %f,%f C %f,%f %f,%f %f,%f' % (vals[groups['10']][0], vals[groups['20']][0], vals[groups['10']][1], vals[groups['20']][1], vals[groups['10']][2], vals[groups['20']][2], vals[groups['10']][3], vals[groups['20']][3]) attribs = {'d': path, 'style': style} inkex.etree.SubElement(doc.getroot(), 'path', attribs) + if not (vals[groups['70']][0] & 3) and len(vals[groups['10']]) == 3 and len(vals[groups['20']]) == 3: + path = 'M %f,%f Q %f,%f %f,%f' % (vals[groups['10']][0], vals[groups['20']][0], vals[groups['10']][1], vals[groups['20']][1], vals[groups['10']][2], vals[groups['20']][2]) + attribs = {'d': path, 'style': style} + inkex.etree.SubElement(doc.getroot(), 'path', attribs) def export_CIRCLE(): # mandatory group codes : (10, 20, 40) (x, y, radius) -- 2.30.2