资源简介
laserengraver,一个激光扩展
代码片段和文件信息
#!/usr/bin/env python
‘‘‘
dxf_input.py - input a DXF file >= (AutoCAD Release 13 == AC1012)
Copyright (C) 2008 2009 Alvin Penner penner@vaxxine.com
Copyright (C) 2009 Christian Mayer inkscape@christianmayer.de
- thanks to Aaron Spike for inkex.py and simplestyle.py
- without which this would not have been possible
This program is free software; you can redistribute it and/or modify
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
‘‘‘
import inkex simplestyle math
from StringIO import StringIO
from urllib import quote
def export_MTEXT():
# mandatory group codes : (1 or 3 10 20) (text x y)
if (vals[groups[‘1‘]] or vals[groups[‘3‘]]) and vals[groups[‘10‘]] and vals[groups[‘20‘]]:
x = vals[groups[‘10‘]][0]
y = vals[groups[‘20‘]][0]
# optional group codes : (21 40 50) (direction text height mm text angle)
size = 12 # default fontsize in px
if vals[groups[‘40‘]]:
size = scale*vals[groups[‘40‘]][0]
attribs = {‘x‘: ‘%f‘ % x ‘y‘: ‘%f‘ % y ‘style‘: ‘font-size: %.1fpx; fill: %s‘ % (size color)}
angle = 0 # default angle in degrees
if vals[groups[‘50‘]]:
angle = vals[groups[‘50‘]][0]
attribs.update({‘transform‘: ‘rotate (%f %f %f)‘ % (-angle x y)})
elif vals[groups[‘21‘]]:
if vals[groups[‘21‘]][0] == 1.0:
attribs.update({‘transform‘: ‘rotate (%f %f %f)‘ % (-90 x y)})
elif vals[groups[‘21‘]][0] == -1.0:
attribs.update({‘transform‘: ‘rotate (%f %f %f)‘ % (90 x y)})
attribs.update({inkex.addNS(‘linespacing‘‘sodipodi‘): ‘125%‘})
node = inkex.etree.SubElement(layer ‘text‘ attribs)
text = ‘‘
if vals[groups[‘3‘]]:
for i in range (0 len(vals[groups[‘3‘]])):
text += vals[groups[‘3‘]][i]
if vals[groups[‘1‘]]:
text += vals[groups[‘1‘]][0]
found = text.find(‘\P‘) # new line
while found > -1:
tspan = inkex.etree.SubElement(node ‘tspan‘ {inkex.addNS(‘role‘‘sodipodi‘): ‘line‘})
tspan.text = text[:found]
text = text[(found+2):]
found = text.find(‘\P‘)
tspan = inkex.etree.SubElement(node ‘tspan‘ {inkex.addNS(‘role‘‘sodipodi‘): ‘line‘})
tspan.text = text
def export_POINT():
# mandatory group codes : (10 20) (
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 1800 2011-03-05 15:04 dxf_input.inx
文件 24775 2011-03-05 15:04 dxf_input.py
文件 143951 2011-03-16 07:17 laserengraver.py
文件 1771 2011-03-16 07:17 laserengraver_laser.inx
相关资源
- 小程序解压包软件.zip
- 由大断面计算水位流量关系.zip
- Evaluation.zip
- MSBuild.zip
-
jli
nk-ob_f072自动升级固件.zip - 5.单相逆变器并网_闭环.zip
- BaiduPanKey.zip
- 米思齐esp8266wifi库.zip
- cwtrack1.zip
- zipalign.exe
- KeygenMDK522.zip
- Quartus_II_11.0_x64破解器(内部版).zi
- 求职信i-worm.klez.zip
- Discuz!X3.5 X3.4腾讯云全局配置插件 1.
- NationalInstruments.VisaNS.zip
- 最新微信付费进群收费进群系统源码
- MSP430G2553小系统电路原理图及PCB图.z
- 芯片验证漫游指南.zip
- AttachedCommandBehavior.zip
- 仿真图.zip
- MMA14.zip
- 开放数据_光伏气象_国能日新.zip
- JT808模拟上报数据.zip
- CNNIC数字证书工具1.2和rootsupd.exe.zip
- CS_recovery_algorithms_OMP_SP_IHT.zip
- GodOfHacker-master.zip
- ANSYS19.2破解版.zip
- test30.zip
- 全国气象站stations.zip
- 图片批量器 快速解析整个网站图片及
评论
共有 条评论