class TemplateEffect(inkex.Effect): def __init__(self): inkex.Effect.__init__(self) def effect(self): for node in self.selected.items(): output_all = output_nodes = "" for id, node in self.selected.items(): if node.tag == inkex.addNS('path','svg'): output_all += "" output_nodes += "" node.apply_transform() d = node.get('d') p = paths.CubicSuperPath(d) for subpath in p: for csp in subpath: # The line below has been modified, to make 'comma' delimited parts!! # output_nodes += str(csp[1][0]) + "\t" + str(csp[1][1]) + "\n" output_nodes += str(csp[1][0]) + "," + str(csp[1][1]) + ",\n" sys.stderr.write(output_nodes) TemplateEffect().run() sys.exit(0) #helps to keep the selection
Ahhh... Thank you!!!.... I love your name 'Polygon', as they are what I love playing with, and coding for. Mainly using a now On-Line Physics Simulation site... https://app.physion.net/, and going back for years, with the authors old PC-Based version. (A different beast!!). The Old 'Physion' had polygon points based on CSV data, but the new on-line version equates to 'JSON' data, instead of a CSV string.... I was never happy with the default created 'Gears' being produced, when you could not specify the Number Of Teeth!!! Sigh...
Code-Block for.... ExportXY-CSV.py
import inkex
import sys
from inkex import paths
from inkex import transforms
def warn(*args, **kwargs):
pass
import warnings
warnings.warn = warn
class TemplateEffect(inkex.Effect):
def __init__(self):
inkex.Effect.__init__(self)
def effect(self):
for node in self.selected.items():
output_all = output_nodes = ""
for id, node in self.selected.items():
if node.tag == inkex.addNS('path','svg'):
output_all += ""
output_nodes += ""
node.apply_transform()
d = node.get('d')
p = paths.CubicSuperPath(d)
for subpath in p:
for csp in subpath:
# The line below has been modified, to make 'comma' delimited parts!!
# output_nodes += str(csp[1][0]) + "\t" + str(csp[1][1]) + "\n"
output_nodes += str(csp[1][0]) + "," + str(csp[1][1]) + ",\n"
sys.stderr.write(output_nodes)
TemplateEffect().run()
sys.exit(0) #helps to keep the selection
Notice I have modified the Output-Nodes line....
Testing a reply to myself....
Hmmm.... That works here, but NOT in a reply to someone who replied to a post of mine???
ALL SORTED NOW !!!!
What is all the testing for?
Was just testing posting Code-Blocks mainly!! hahaha.... Sorted
Can I delete the other threads to free space or is it somehow important?
Yes, you can remove this whole test post/replies now.... Problem was sorted. Thanks friend...
How do i post in-line images !!!
Either drag an image into the editor window where you type the reply in or use the paperclip icon below to upload content.
Ahhh... Thank you!!!.... I love your name 'Polygon', as they are what I love playing with, and coding for. Mainly using a now On-Line
Physics Simulation site... https://app.physion.net/, and going back for years, with the authors old PC-Based version. (A different beast!!).
The Old 'Physion' had polygon points based on CSV data, but the new on-line version equates to 'JSON' data, instead of a CSV string....
I was never happy with the default created 'Gears' being produced, when you could not specify the Number Of Teeth!!! Sigh...