Created
February 6, 2019 22:12
-
-
Save kogcyc/562e9476acff251c28e9a64c7c300ecc to your computer and use it in GitHub Desktop.
change a PovRAY 'prism' object, which was generated by Inkscape, into a 'lathe' object ( povray prism lathe )
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
fo = open(sys.argv[1] + '.pov') | |
a = fo.read() | |
fo.close() | |
b = a.find('prism') | |
c = a[b:] | |
d = c.find('}') | |
e = c[:d+1] | |
f = e.replace('prism','#declare ' + sys.argv[1] + ' = ' + 'lathe') | |
g = f.replace(' linear_sweep\n','') | |
h = g.replace(' 1.0, //top\n','') | |
i = h.replace(' 0.0, //bottom\n','') | |
print(i) | |
fo = open(sys.argv[1] + '.inc','w') | |
fo.write(i) | |
fo.close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment