fn cube = (length, center) => {
  let l = length/2
  let x = center[0]
  let y = center[1]
  let p0 = [-l + x, -l + y]
  let p1 = [-l + x,  l + y]
  let p2 = [ l + x,  l + y]
  let p3 = [ l + x, -l + y]

  return startSketchAt(p0)
  |> line(endAbsolute = p1)
  |> line(endAbsolute = p2)
  |> line(endAbsolute = p3)
  |> line(endAbsolute = p0)
  |> close()
  |> extrude(length = length)
}

fn double = (x) => { return x * 2}
fn width = () => { return 200 }

const myCube = cube(200 |> double(%), [0,0])
