[Question]
  [
## Challenge
Write a program that takes an 11x11 array of integers, and constructs a 3D ASCII block building, where each value in the array represents the height of a column of blocks at the coordinates matching the array position. A negative height is a "floating" column - only the top block is visible.
## Example
```
                                                        __________________
                                        ___            /\__\__\__\__\__\__\
 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,      /\__\          /\/\__\__\__\__\__\__\
 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,     /\/__/         /\/\/__/__/__/__/__/__/
 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,    /\/\__\        /\/\/\__\      /\/\/__/
 1, 0, 0, 7,-7,-7,-7,-7, 7, 0, 0,    \/\/\__\      /\/\/\/__/     /\/\/__/
 0, 0, 0, 7,-7,-7,-7,-7, 7, 0, 0,     \/\/__/     /\/\/\/\__\    /\/\/__/
 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0,      \/\__\    /\/\/\/\/__/   /\/\/__/
 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0,       \/__/    \/\/\/\/\__\_  \/\/__/
 1, 0, 0, 4, 3, 2, 1, 0, 0, 0, 1,                 \/\/\/\/__/_\_ \/__/
 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,            ___   \/\/\/__/__/_\_         ___
 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,           /\__\   \/\/__/__/__/_\       /\__\
 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1,           \/\__\   \/__/__/__/__/       \/\__\
                                             \/\__\_________         ______\/\__\
                                              \/\__\__\__\__\       /\__\__\__\__\
                                               \/__/__/__/__/       \/__/__/__/__/
```
## Input
The input will be a list of 121 integers, either read from stdin (choice of separator is up to you), or passed in as an array (can be 1D or 2D).
Heights will be in the range -11 to 11.
## Output
The generated building can be written to stdout, displayed directly on the screen, or returned as a newline-separated string.
Leading and trailing whitespace is allowed.
## Building Rules
The shape of an individual 3D block looks like this:
```
 ___
/\__\
\/__/
```
And a 2x2x2 cube of blocks looks like this:
```
  ______
 /\__\__\
/\/\__\__\
\/\/__/__/
 \/__/__/
```
When blocks overlap, a higher block takes precedence over a lower one, blocks in front take precedence over those further back, and blocks to the left takes precedence over those to the right. The only special case is that the top line of a block should never overwrite any non-space character behind it. 
The interpretation of column heights can best be explained by looking at a 2D representation from the side.
```
HEIGHT:  1    2    3   -3   -2   -1
                  __   __
             __  |__| |__|  __
        __  |__| |__|      |__|  __
       |__| |__| |__|           |__|
```
## Test Cases
If you want to try out your solution on a few more inputs, I've put together a couple of test cases [here](https://gist.github.com/anonymous/8942545f3838de4a9130ff4966625d09).
## Winning
This is [code-golf](/questions/tagged/code-golf "show questions tagged 'code-golf'"), so the shortest submission (in bytes) wins.
  
[Answer]
# C, ~~376~~ ~~350~~ ~~313~~ ~~309~~ 285 bytes
*Thanks to @Jonathan Frech for saving four bytes!*
```
#define F for(
char*t,G[26][67],*s;i,j,e,k,v,x,y;b(){F s="\\/__//\\__\\ ___ ";*s;--y,s+=5)F e=5;e--;*t=*s<33&*t>32?*t:s[e])t=G[y]+x+e;}f(int*M){F;e<1716;++e)G[e/66][e%66]=32;F k=0;++k<12;)F i=0;i<11;++i)F j=11;j--;v+k||b())x=i+j*3+k,y=14+i-k,(v=M[i*11+j])>=k&&b();F;++e<26;)puts(G+e);}
```
[Try it online!](https://tio.run/##5ZfdbtowFMfveYqo0xBJbIHjxIEZd3dw1SdIoqhl6RaisanJEKjl2ZmT8hHwKbisY0WLjiC2f7KPz9@cg0f462i0XH74ktynk8QYGPc/HlqN0bfbB6tAw8BhUcD8CFk5T9EYJShDUzRDc37XMh8HRi6uwrAdx@12GMZxGBpxHBtXXNIYz1FuC88cGInweIIxtwph5X1Km1ZxTZ3PVvEpD5LILMQwmEf2zE744r6VTgrrRk7Nkz7xCeO2nZjDIGkz6UjyUX4K6vCBkYmOHMr6xOFyhVS20j4hsiuVzbGQr2O54tTOnp6kp@ZMpPbYonaG5oK4dooz1JqKmyC1CLHHkXktsmZTgnxQLth3GDd//iry1lCuzhdL6ZTx/TadtMzGY8OQT9mRTiRCgsgQVdfzQPlQZHQO2QZ03hwk6z4f4ZrJ5h7YeTXIjiy96fN0fXRRGSq5N1IDCQCCdiK4sdr42ipuwRvVd3kUS4HNVXsjuQNI3tEV6C@CLsJrK0P7Iohrg/i8oLaPZ4sjJLmjSE51JSfVeabl5jQ98HRBpgv6W9A9BOItiHVB7Rn1fXyjXR@L41YZSHKqSO4CkrtVcmM7SbPMmKzqr0l@uAJQ3cTunJDi3kMm@regkl3gX7mrSO4Bkj8L7EHm7xzjWu1UD3sd9HSP8f8JasexpgxeW00ZSHJPkZypkhOCDtsZwL2dXzZ4tjhCkjNFcv9ILQfSx7tIca5Sz3a9Bmu58m8Xu6@f8cISu69I3gUkl/mCreo37q5sVdfZXubSBC@qThIEXoZAEHo/Ewj4CEneVSTv1SQ/KUzgVfEFkK5NA/TgCzII@kgth@Bm5FnsaYLbuklXezsQHk8X3ETgGLgb1j@5pfWk5ovlbw)
**Unrolled:**
```
#define F for(
char *t, G[26][67], *s;
i, j, e, k, v, x, y;
b()
{
    F s="\\/__//\\__\\ ___ "; *s; --y, s+=5)
        F e=5; e--; *t=*s<33&*t>32?*t:s[e])
            t = G[y]+x+e;
}
f(int*M)
{
    F; e<1716; ++e)
        G[e/66][e%66] = 32;
    F k=0; ++k<12;)
        F i=0; i<11; ++i)
            F j=11; j--; v+k||b())
                x = i+j*3+k,
                y = 14+i-k,
                (v=M[i*11+j])>=k && b();
    F; ++e<26;)
        puts(G+e);
}
```
[Answer]
# [Charcoal](https://github.com/somebody1234/Charcoal), ~~70~~ ~~69~~ 68 bytes
```
≔Ｅ¹¹⮌Ｉ⪪Ｓ,θＦ²Ｆ¹¹Ｆ¹¹Ｆ¹¹«Ｊ⁻⁻⁺λκ×μ³ι⁻λκ≔§§θλμη¿∨⁼±η⊕κ‹κη¿ι“↗⊟&⁹κＵhnI”___
```
[Try it online!](https://tio.run/##pU9LawIxED67v2LY0wQiGu3j0JOUHiy1leoxEBYd12A2rpusFEp/@zZrdbX0JTR888p885otk2K2TkxVDZzTqcVRkqMQHJ5pS4UjvE2cx0lutMehzUs/8YW2KTIOMY9ZeBw27CZarAvAHoOdFeI75zVq3ZdZPl3jSNvS7fXYBGU4rEKjqc7IYcahX7fVQT44u3QY0trvOPBDO6eXxm44mEDOgixrml4APhV4tykT4/CR0sQTLkN2aGcFZWQ9zXFVz3gg53BVlzEGdZlmMA4Heoyl7UiplJTSStlRqhMzIOPokFdKxWHYW1VBn0P3F0TQ@zdBHPxr3j5BCPeE7tmEqx9GNP7lXztc8PrksLM4IYjoU/gVZxIaHP8bVO2teQc "Charcoal – Try It Online") Link is to verbose version of code. Explanation:
```
≔Ｅ¹¹⮌Ｉ⪪Ｓ,θ
```
Read the array, split each line on commas and cast to integer, but also reverse each line, since we want to draw right-to-left so that left columns overwrite right columns. (Other dimensions already have desired overwriting behaviour.)
```
Ｆ²Ｆ¹¹Ｆ¹¹Ｆ¹¹«
```
Loop through i) top lines and bodies k) height l) rows m) columns. (Looping through first top lines and then bodies avoids overwriting bodies with top lines.)
```
Ｊ⁻⁻⁺λκ×μ³ι⁻λκ
```
Jump to the position of the cube.
```
≔§§θλμη
```
Fetch the height at the current row and column.
```
¿∨⁼±η⊕κ‹κη
```
Test whether a cube should be drawn at this height for this row and column.
```
¿ι“↗⊟&⁹κＵhnI”___
```
Draw the body or top of the cube.
[Answer]
# JavaScript (ES6), ~~277~~ 251 bytes
```
a=>(n=55,$=f=>[...Array(n)].map((_,i)=>f(i)),S=$(_=>$(_=>' ')),n=11,$(l=>$(z=>$(y=>$(x=>(x=10-x,X=x*3+y+z,Y=y-z+n,Z=a[y][x])<=z&&Z+z+1?0:l?['/\\__\\','\\/__/'].map(s=>S[++Y].splice(X,5,...s)):S[Y].splice(X+1,3,...'___'))))),S.map(r=>r.join``).join`
`)
```
```
f=
a=>(n=55,$=f=>[...Array(n)].map((_,i)=>f(i)),S=$(_=>$(_=>' ')),n=11,$(l=>$(z=>$(y=>$(x=>(x=10-x,X=x*3+y+z,Y=y-z+n,Z=a[y][x])<=z&&Z+z+1?0:l?['/\\__\\','\\/__/'].map(s=>S[++Y].splice(X,5,...s)):S[Y].splice(X+1,3,...'___'))))),S.map(r=>r.join``).join`
`)
console.log(f([
	[3, 0, 0, 0, 0, 0, 0, 0, 0, 0, -11],
	[2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
	[2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
	[1, 0, 0, 7,-7,-7,-7,-7, 7, 0, 0],
	[0, 0, 0, 7,-7,-7,-7,-7, 7, 0, 0],
	[0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0],
	[0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0],
	[1, 0, 0, 4, 3, 2, 1, 0, 0, 0, 1],
	[1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1],
	[1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1],
	[1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 11]
]))
```
Saved 26 bytes from [@Neil's suggestion](https://codegolf.stackexchange.com/questions/153109/3d-ascii-block-building/153135#comment374122_153135).
### Ungolfed
```
a=>(
    n=55,
    $=f=>[...Array(n)].map((_,i)=>f(i)),
    S=$(_=>$(_=>' ')),
    n=11,
    $(l=>
        $(z=>$(y=>$(x=>(
            x=10-x,
            X=x*3+y+z,
            Y=y-z+n,
            Z=a[y][x],
            Z<=z && Z+z+1 || (
                l
                ? ['/\\__\\','\\/__/'].map(s=>S[++Y].splice(X,5,...s))
                : S[Y].splice(X+1,3,...'___')
            )
        ))))
    ),
    S.map(r=>r.join``).join`\n`
)
```
[Answer]
# [Python 2](https://docs.python.org/2/), 243 bytes
```
a=input()
s=eval(`[[' ']*55]*23`)
for h in range(7986):
 k=h%3;x=h/3%11;y=h/33%11;z=h/363%11;i=h/3993;u=y+z-x*3+30;v=y-z+10
 if~-(z>=a[y][10-x]!=~z):
	if i*k:s[v+k][u:u+5]='\//\____/\\'[k%2::2]
	if~-i:s[v][u+1+k]='_'
for l in s:print''.join(l)
```
[Try it online!](https://tio.run/##lZDLboMwFETX5SvcBTLPgnEhBeT@iLESFqG4IEC8BCz4dWpHKq0ipUmtWczIR77j28x9XlfetqWEV83Qa7rSkfOYltqJUgggM3yfGR4@6UpWtyAHvAJtWn2ctUP4FuiRAgqSqzieSO5gFaF4lubiFumCi@XShiGOBzKbiz0Z2MRuPJLZXkzkKoBnq60t7ySlM6PItSf2TNZFvP7EM8CNIuroaBaMDtFg@ozAxHGSozhOkkBaqF4UeUyyq80lKkATCZ7AI7zULmXtLmpaXvUQvnzWvNJKfdsoxRZwbwsxC1DvT8R9EEHf6WDZvyTijrj/QIKbg/bk3@/yagGxANEeXX8a3d/LY8iun5tdjH0B "Python 2 – Try It Online")
A Python translation of Neil’s Charcoal approach.
[Answer]
# [APL (Dyalog Unicode)](https://www.dyalog.com/), ~~117~~ ~~116~~ 112 bytes[SBCS](https://github.com/abrudz/SBCS)
```
a←23 55⍴0⋄{i←11 0+⍵+.×3 2⍴3-7897⊤⍨6⍴5⋄(,2 5↑i↓a)←745366⊤⍨10⍴4⋄(3⍴i↓1⌽¯1⊖a)⌈←1}¨j[⍋-/↑j←⍸↑⎕↑¨⊂⌽1,11/⍳2]⋄' _/\'[a]
```
[Try it online!](https://tio.run/##zZLPTsJAEMbvfYq5oaHITsu28ixITBuDgZDg1RgvxCAp1GiM@gIeuPWgJl681DeZFylfaUAoTaPEA8nsZjr7@3b@bL2Lfu3s0usPzhO5e@oOZHSvDBnfdhIPrmWT1hK@K5ncXHURYCZVlfCjevT9YpOFI7vmHjddCV4lnDn41kAPTIu0jB6gePQOIXMb2nacDGIFqpFSNpwUYZl@xRFL8Ax4Ok7TXMezXkvCSa2Oa3qISPgJDyVij2cSDKFhk7ku4ZvVxm0VOq2fVFpeO0H1iU@pJhjaRKrEDN/MOOufOV6GXIqjzYXQJqt2YZ3y/KuQ/mWdDSLMCu3xGsfbXKHtxK3s53hlRsfAO/uGsXxHamIerNKNM48QWqiWK99aHGFGuW2dL9Lkz/eJzxrn9RHEUbNcszUD9291LRLs06DQesF/Mgc "APL (Dyalog Unicode) – Try It Online")
[Answer]
# Tcl, 380 ~~409~~ bytes
User **[sergiol](https://codegolf.stackexchange.com/users/29325/sergiol)** has been busy crunching this down very nicely: 
```
set X [read stdin]
proc L {a b c d e s} {time {incr z
set y -1
time {incr y
set x -1
time {if {abs([set Z [lindex $::X [expr ($y+1)*11-[incr x]-1]]])==$z|$z<$Z} {set s [string repl [string repl $s [set i [expr -3*$x+57*$y-55*abs($z)+701]] $i+$b $a] [incr i $c] $i+$e $d]}} 11} 11} 12
set s}
puts [L /\\__\\ 4 56 \\/__/ 4 [L "" -1 -55 ___ 2 [string repe [string repe \  55]\n 23]]]
```
[Try it online!](https://tio.run/##lVHbaoNQEHw/XzGU85AoEo/xQkPzB/mAEhVJ9LQIqRW1oKZ@u10vpVpMSh8W3ZnZmV0twkvb5rLAM9xMniLkRRQnPkuz9xAHXE84I0QEibzBtYjfJK5xEmaoWTdVQRNsglY9Wk7QF/I45yu3w49wL3ESyRJ8t6NAWaYZVrxSxVoRQnN7i9LXhO/76/2e15@8fuJHCu6mc7h5kcXJKzKZXuYN70jSxKOptlV4qVqOwivNspRuA16vVUcna/BY5Wfwk48hMQYPB1SCR37TQIixjP6evGHpR0ERB2w8Lwg8DyYsG563CYINvRPx8EBHg8IQBAGM6Xpy3niAZfleAmNLd7YtoOOnBOb9rBgojMYXuOlcx5tseNpUzrKf5oy8NWq7/pHO0KnEpPQeH/j/as0x4y@tMbntxr4Y99Vs0hoY9N@csaA3Oi3YnQ/664PYN7QL5prF7v@wKW6yLw "Tcl – Try It Online")
### Original Content
```
set xs [read stdin]
proc L {a b c d e s} {set z 0
while {[incr z]<12} {set y -1
while {[incr y]<11} {set x -1
while {[incr x]<11} {set Z [lindex $::xs [expr ($y+1)*11-$x-1]]
if {abs($Z)==$z||$z<$Z} {set i [expr -3*$x+57*$y-55*abs($z)+701]
set s [string repl [string repl $s $i $i+$b $a] [incr i $c] $i+$e $d]}}}}
set s}
puts [L /\\__\\ 4 56 \\/__/ 4 [L "" -1 -55 ___ 2 [string repe [string repe \  55]\n 23]]]
```
[Try it online!](https://tio.run/##lVHRboJAEHy/r5iYe1DJRQ5FU6N/4BcoF6JwbS8x1ABNEfXb7SLXFFq0KWEDuzM7O3uXR/vrNdM5igybVG9jZHlsEsUO6VuEFU5b7BAhhkZ2walilnDZx6vZa5w2JolSlGohPQseIWQbPRIqLVr8QosGusZmb5JYF@DzeeVHF4cUfX505GAopeCFkEox80yudlmfrwfLJS/PZ14u@NpqGNslxkNeOP5syI/C94c3fjlwZq5UrOKRepanJnlBqg/7dsIzcEOvw3fgW4XaKVUidatq8Fhd6KmVLuzwnpPeCqMgCMMgwAT@FEEwCsMR/RPQ69HiICMIwxBec5xuJwHg@ypI4I2VUtcr4OI7JNp5KxhoGLV3YM2@Cp@w@julmHXriZnFfcut8idaw6WQjXBv9Rr/L3diZ/zF9Rq73fEL61dMieuh5n9hXgffq7hgDw70x4FM73A7xIXPHl9Ysz5hnw)
Alas, it is what it is. It’s only a tad easier on the eyes when “ungolfed”
```
set s [string repeat [string repeat " " 55]\n 23]
proc loops {s0 i0 io s1 i1} {
  set z  0; while {[incr z] < 12} {
  set y -1; while {[incr y] < 11} {
  set x -1; while {[incr x] < 11} {
    set Z [lindex $::xs [expr {($y+1) * 11 - $x - 1}]]
    if {abs($Z) == $z || $z < $Z} {
        set i [expr {-3*$x + 57*$y - 55*abs($z) + 701}]
        set ::s [string replace $::s $i $i+$i0 $s0]
        incr i $io
        set ::s [string replace $::s $i $i+$i1 $s1]
    }
  } } }
}
loops ""      -1 -55 \
       ___     2
loops /\\__\\  4  56 \
      \\/__/   4
puts $s
```
Builds a string, as per requirements. Takes the array from stdin. Goes from bottom to top, front to back, right to left over the string data. Does it in two passes, once for the top edge and again for the rest of the body of each cube.
I tried to make it smaller using some sweet functional lambda mojo, but alas, that made it larger.
]