*** This script deletes 180-degree vertices.

mov r01 0
getwallnumber r09
while r01 < r09
  getselvertex r01 r00
  if r00 != 0
    getprevwall r01 r00
    getwall r01 point2 r02
    getwall r00 x r10
    getwall r00 y r11
    getwall r01 x r12
    getwall r01 y r13
    getwall r02 x r14
    getwall r02 y r15
    sub r14 r12
    sub r15 r13
    sub r12 r10
    sub r13 r11
    hypot r03 r12 r13
    hypot r04 r14 r15
    add r03 r04
    add r14 r12
    add r15 r13
    hypot r05 r14 r15
    sub r05 r03
    if r05 > -1
      deletevertex r01
      dec r01
    endif
    getwallnumber r09
  endif
  inc r01
continue