summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Schwarz <michi.schwarz@gmail.com>2015-08-07 02:01:08 +0200
committerMichael Schwarz <michi.schwarz@gmail.com>2015-08-07 02:03:47 +0200
commit51d896929e52d935d00b81bec7e56e80ec854708 (patch)
tree3e53c6ba6e567cab7df2be2bd36fcea4b4311ab0
parent3971ddf2561a11d70d319177796e40662b67ce86 (diff)
downloadpogojig-51d896929e52d935d00b81bec7e56e80ec854708.tar.gz
pogojig-51d896929e52d935d00b81bec7e56e80ec854708.tar.bz2
pogojig-51d896929e52d935d00b81bec7e56e80ec854708.zip
Inkscape export: Fix elliptical arcs not being closed.
-rwxr-xr-xsupport/inkscape/cubicsuperpath.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/support/inkscape/cubicsuperpath.py b/support/inkscape/cubicsuperpath.py
index 925efdb..861b9da 100755
--- a/support/inkscape/cubicsuperpath.py
+++ b/support/inkscape/cubicsuperpath.py
@@ -87,15 +87,20 @@ def ArcToPath(p1,params):
pt=[O[0]+cos(angle) ,O[1]+sin(angle) ]
v2=[O[0]+cos(angle)- v *sin(angle),O[1]+sin(angle)+ v *cos(angle)]
p.append([v1,pt,v2])
- p[ 0][0]=p[ 0][1][:]
- p[-1][2]=p[-1][1][:]
mat=matprod((rotmat(teta),[[rx,0],[0,ry]],rotmat(-teta)))
for pts in p:
applymat(mat, pts[0])
applymat(mat, pts[1])
applymat(mat, pts[2])
- return(p)
+
+ # Use exact coordinates for the endpoints. This prevents small drifts when relative coordinates are used and guarantees that a path ending with a z command closes perfectly.
+ p[0][0] = p1[:]
+ p[0][1] = p1[:]
+ p[-1][1] = [x2, y2]
+ p[-1][2] = [x2, y2]
+
+ return p
def CubicSuperPath(simplepath):
csp = []