*** This script prepares a contour for horizontal extruding tool that is similar to arch-type structure but has equal widths of all created sectors.

// Parameter list begins
mov r94 0 // Initial floor Z
mov r95 8192 // Central floor raising
mov r96 0 // Initial ceiling Z
mov r97 -8192 // Central ceiling raising
mov r98 16 // Number of sectors (detail)
mov r99 1024 // Structure width
// Parameter list ends
~~~ Default parameters:
~~~ mov r94 8192 // Initial floor Z
~~~ mov r95 2048 // Central floor raising
~~~ mov r96 -8192 // Initial ceiling Z
~~~ mov r97 -8192 // Central ceiling raising
~~~ mov r98 16 // Number of sectors (detail)
~~~ mov r99 1024 // Structure width
settool 32
setcontourq r98
settoolvertq 0
mov r00 0
mov r01 r94 // Left side floor Z
mov r02 r96 // Left side ceiling Z
mov r03 r99 // Left side X offset
div r03 -2
while r00 < r98
  mov r07 r00 // Raising multiplier
  inc r07
  mul r07 2
  sub r07 r98
  mul r07 65536
  div r07 r98
  fppow r07 131072
  mov r08 65536
  sub r08 r07
  fpsqrt r07 r08

  mov r04 r95 // Right side floor Z
  mul r04 r07
  div r04 65536
  add r04 r94
  
  mov r05 r97 // Right side ceiling Z
  mul r05 r07
  div r05 65536
  add r05 r96
  
  mov r06 r00 // Right side X offset
  inc r06
  mul r06 2
  sub r06 r98
  mul r06 r99
  div r06 r98
  div r06 2
  
  setcontourl r00 r03 r01 r02
  setcontourr r00 r06 r04 r05
  
  mov r01 r04 // Right side is the left side of next sector
  mov r02 r05
  mov r03 r06
  inc r00
continue