Your new fix fixes misplace objects in dxf output for support types.
It does not fix text output it does not fix rectangle output if does not address same problem in hpgl output
If you want to support rectangles I found some buggy code in pathmodifier for converting a rectangle to a path. Here is my corrected code.
def rectToPath(self,node,doReplace=True): if node.tag == inkex.addNS('rect','svg'): x =float(node.get('x')) y =float(node.get('y')) try: rx=float(node.get('rx')) except: rx=0 try: ry=float(node.get('ry')) except: ry=0 if rx == 0 and ry != 0: rx = ry if ry == 0 and rx != 0: ry = rx w =float(node.get('width' )) h =float(node.get('height')) d ='M %f,%f '%(x+rx,y) d+='L %f,%f '%(x+w-rx,y) d+='A %f,%f,%i,%i,%i,%f,%f '%(rx,ry,0,0,1,x+w,y+ry) d+='L %f,%f '%(x+w,y+h-ry) d+='A %f,%f,%i,%i,%i,%f,%f '%(rx,ry,0,0,1,x+w-rx,y+h) d+='L %f,%f '%(x+rx,y+h) d+='A %f,%f,%i,%i,%i,%f,%f '%(rx,ry,0,0,1,x,y+h-ry) d+='L %f,%f '%(x,y+ry) d+='A %f,%f,%i,%i,%i,%f,%f '%(rx,ry,0,0,1,x+rx,y)
newnode=inkex.etree.Element('path') newnode.set('d',d) newnode.set('id', self.uniqueId('path')) newnode.set('style',node.get('style')) nnt = node.get('transform') if nnt: newnode.set('transform',nnt) fuseTransform(newnode) if doReplace: parent=node.getparent() parent.insert(parent.index(node),newnode) parent.remove(node) return newnode
Your new fix fixes misplace objects in dxf output for support types.
It does not fix text output
it does not fix rectangle output
if does not address same problem in hpgl output
If you want to support rectangles I found some buggy code in pathmodifier for converting a rectangle to a path. Here is my corrected code.
def rectToPath( self,node, doReplace= True): 'rect', 'svg'): node.get( 'x')) node.get( 'y'))
rx=float( node.get( 'rx'))
rx=0
ry=float( node.get( 'ry'))
ry=0 node.get( 'width' )) node.get( 'height' )) i,%i,%i, %f,%f '%(rx,ry, 0,0,1,x+ w,y+ry) i,%i,%i, %f,%f '%(rx,ry, 0,0,1,x+ w-rx,y+ h) i,%i,%i, %f,%f '%(rx,ry, 0,0,1,x, y+h-ry) i,%i,%i, %f,%f '%(rx,ry, 0,0,1,x+ rx,y)
if node.tag == inkex.addNS(
x =float(
y =float(
try:
except:
try:
except:
if rx == 0 and ry != 0:
rx = ry
if ry == 0 and rx != 0:
ry = rx
w =float(
h =float(
d ='M %f,%f '%(x+rx,y)
d+='L %f,%f '%(x+w-rx,y)
d+='A %f,%f,%
d+='L %f,%f '%(x+w,y+h-ry)
d+='A %f,%f,%
d+='L %f,%f '%(x+rx,y+h)
d+='A %f,%f,%
d+='L %f,%f '%(x,y+ry)
d+='A %f,%f,%
nnt = node.get(
if nnt:
if doReplace:
return newnode