convert lsp to plg format

Example use:

cat tl2less.cin | python3.4 ~/code/geom/Segment_Delaunay_graph_Linf_2/developer_scripts/lsp2plg.py > tl2less.plg

Signed-off-by: Panagiotis Cheilaris <philaris@cs.ntua.gr>
This commit is contained in:
Panagiotis Cheilaris 2014-07-29 17:45:01 +02:00
parent 180fb36491
commit d0fa197b70
1 changed files with 17 additions and 0 deletions

View File

@ -0,0 +1,17 @@
#!/usr/bin/env python
import sys
for line in sys.stdin:
linesplit = line.strip().split()
if len(linesplit) == 3:
assert(linesplit[0] == 'p')
print('1')
print(linesplit[1] + ' ' + linesplit[2])
elif len(linesplit) == 5:
assert(linesplit[0] == 's')
print('2')
print(linesplit[1] + ' ' + linesplit[2])
print(linesplit[3] + ' ' + linesplit[4])
elif len(linesplit) == 0:
print