dxf_outlines.py revision a99c2ce8986cc437b934d14cbca64c2e8615cc48
'''
Copyright (C) 2005,2007,2008 Aaron Spike, aaron@ekips.org
Copyright (C) 2008 Alvin Penner, penner@vaxxine.com
- template dxf_outlines.dxf added Feb 2008 by Alvin Penner
- ROBO-Master output option added Aug 2008 by Alvin Penner
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
'''
try:
from numpy import *
except:
inkex.errormsg(_("Failed to import the numpy or numpy.linalg modules. These modules are required by this extension. Please install them and try again."))
return (1-u)**3*csp[0][col] + 3*(1-u)**2*u*csp[1][col] + 3*(1-u)*u**2*csp[2][col] + u**3*csp[3][col]
self.dxf_add(" 10\n%f\n 20\n%f\n 30\n0.0\n 11\n%f\n 21\n%f\n 31\n0.0\n" % (csp[0][0],csp[0][1],csp[1][0],csp[1][1]))
knots = 8
ctrls = 4
for i in range(2):
for j in range(4):
for i in csp:
# this spline has zero curvature at the endpoints, as in ROBO-Master
knots = 10
ctrls = 6
fits = 4
for i in range(4):
for i in range(4):
for i in range(6):
for i in range(4):
#References: Minimum Requirements for Creating a DXF File of a 3D Model By Paul Bourke
# NURB Curves: A Guide for the Uninitiated By Philip J. Schneider
# The NURBS Book By Les Piegl and Wayne Tiller (Springer, 1995)
path = '//svg:path'
for sub in p:
# generate unique handle for DXF ENTITY
s = sub[i]
e = sub[i+1]
if s[1] == s[2] and e[0] == e[1]:
else:
if __name__ == '__main__':
e = MyEffect()
e.affect()
# vim: expandtab shiftwidth=4 tabstop=8 softtabstop=4 encoding=utf-8 textwidth=99