SVGImport.wiki
changeset 1423 39ebd4eac1dd
parent 1422 a6f2064e67a5
child 1680 cec5c4d1cf78
equal deleted inserted replaced
1422:a6f2064e67a5 1423:39ebd4eac1dd
    38 
    38 
    39 The coordinates should now be rounded for use by the crude script in (10) unless you plan to handle that yourself in some way.  Here is a vim one-liner to do it.
    39 The coordinates should now be rounded for use by the crude script in (10) unless you plan to handle that yourself in some way.  Here is a vim one-liner to do it.
    40 {{{:s/[0-9][0-9.]*/\=float2nr(floor(submatch(0)*1))/g}}}
    40 {{{:s/[0-9][0-9.]*/\=float2nr(floor(submatch(0)*1))/g}}}
    41 
    41 
    42 Also, it is probably a good idea to remove duplicate points.  Here's a regex for that. 
    42 Also, it is probably a good idea to remove duplicate points.  Here's a regex for that. 
    43 {{ s/\(L\d\+ \d\+ \)\1/\1/g}}}  - you should run that a couple of times, then {{{s/M\(\d\+ \d\+ \)L\1/M\1/g}}}.  That just cuts down on a bit of redundancy.  If these regexes match anything, you probably should rerun them.
    43 {{{ s/\(L\d\+ \d\+ \)\1/\1/g}}}  - you should run that a couple of times, then {{{s/M\(\d\+ \d\+ \)L\1/M\1/g}}}.  That just cuts down on a bit of redundancy.  If these regexes match anything, you probably should rerun them.
    44 Since this page is a mass of hacks, here's one more redundancy reducer, in bash this time.
    44 Since this page is a mass of hacks, here's one more redundancy reducer, in bash this time.
    45 {{{
    45 {{{
    46 rm dupes.txt
    46 rm dupes.txt
    47 PREVXY=(99999 99999)
    47 PREVXY=(99999 99999)
    48 sed 's/\([LM]\)/\n\1/g' inputfile | while read f
    48 sed 's/\([LM]\)/\n\1/g' inputfile | while read f