summaryrefslogtreecommitdiff
path: root/support/dxf_export/cspsubdiv.py
diff options
context:
space:
mode:
authorMichael Schwarz <michi.schwarz@gmail.com>2015-08-05 13:57:53 +0200
committerMichael Schwarz <michi.schwarz@gmail.com>2015-08-06 16:32:59 +0200
commit14f078c8217450317b4824cb450b336ba6590011 (patch)
treefaeab31f4175d093eefc5516b704e991c6f95270 /support/dxf_export/cspsubdiv.py
parentc451c40dd2fa394c0e7fa300eeca9094a6da19bd (diff)
downloadpogojig-14f078c8217450317b4824cb450b336ba6590011.tar.gz
pogojig-14f078c8217450317b4824cb450b336ba6590011.tar.bz2
pogojig-14f078c8217450317b4824cb450b336ba6590011.zip
Inkscape export: Renamed module to inkscape.
This module will later be used for other export types than just DXF.
Diffstat (limited to 'support/dxf_export/cspsubdiv.py')
-rwxr-xr-xsupport/dxf_export/cspsubdiv.py37
1 files changed, 0 insertions, 37 deletions
diff --git a/support/dxf_export/cspsubdiv.py b/support/dxf_export/cspsubdiv.py
deleted file mode 100755
index c34236a..0000000
--- a/support/dxf_export/cspsubdiv.py
+++ /dev/null
@@ -1,37 +0,0 @@
-#!/usr/bin/env python
-from bezmisc import *
-from ffgeom import *
-
-def maxdist(((p0x,p0y),(p1x,p1y),(p2x,p2y),(p3x,p3y))):
- p0 = Point(p0x,p0y)
- p1 = Point(p1x,p1y)
- p2 = Point(p2x,p2y)
- p3 = Point(p3x,p3y)
-
- s1 = Segment(p0,p3)
- return max(s1.distanceToPoint(p1),s1.distanceToPoint(p2))
-
-
-def cspsubdiv(csp,flat):
- for sp in csp:
- subdiv(sp,flat)
-
-def subdiv(sp,flat,i=1):
- while i < len(sp):
- p0 = sp[i-1][1]
- p1 = sp[i-1][2]
- p2 = sp[i][0]
- p3 = sp[i][1]
-
- b = (p0,p1,p2,p3)
- m = maxdist(b)
- if m <= flat:
- i += 1
- else:
- one, two = beziersplitatt(b,0.5)
- sp[i-1][2] = one[1]
- sp[i][0] = two[2]
- p = [one[2],one[3],two[1]]
- sp[i:1] = [p]
-
-# vim: expandtab shiftwidth=4 tabstop=8 softtabstop=4 fileencoding=utf-8 textwidth=99