Task

Draw a   cuboid   with relative dimensions of    2 × 3 × 4. 



The cuboid can be represented graphically, or in   ASCII art,   depending on the language capabilities.

To fulfill the criteria of being a cuboid, three faces must be visible.

Either static or rotational projection is acceptable for this task.



Related tasks
 draw a sphere
 draw a rotating cube
 write language name in 3D ASCII
 draw a Deathstar


const dirs = Hash("-" => [1,0], "|" => [0,1], "/" => [1,1])
 
func cuboid(nx, ny, nz) {
  say("cuboid %d %d %d:" % [nx, ny, nz])
  var(x, y, z) = (8*nx, 2*ny, 4*nz)
  var area = []
  var line = func(n, sx, sy, c) {
    var(dx, dy) = dirs{c}...
    for i (0..n) {
      var (xi, yi) = (sx + i*dx, sy + i*dy)
      area[yi] \\= [" "]*(x+y+1)
      area[yi][xi] = (area[yi][xi] == " " ? c : '+')
    }
  }
 
  0 .. nz-1 -> each {|i| line(x,       0,     4*i, "-") }
  0 .. ny   -> each {|i| line(x,     2*i, z + 2*i, "-") }
  0 .. nx-1 -> each {|i| line(z,     8*i,       0, "|") }
  0 .. ny   -> each {|i| line(z, x + 2*i,     2*i, "|") }
  0 .. nz-1 -> each {|i| line(y,       x,     4*i, "/") }
  0 .. nx   -> each {|i| line(y,     8*i,       z, "/") }
 
  area.reverse.each { |line|
     say line.join('')
  }
}
 
cuboid(2, 3, 4)
cuboid(1, 1, 1)
cuboid(6, 2, 1)
cuboid(2, 4, 1)