From: alvinpenner Date: Tue, 23 Dec 2008 02:27:45 +0000 (+0000) Subject: add support for quadratic Bezier X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=fcbd94d58b7321808e39b6c7de9f0da2512a126f;p=inkscape.git add support for quadratic Bezier --- 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)