[Question]
  [
A binary matrix represents a shape in the plane. 1 means a unit square at that position. 0 means nothing. The background is 0.
For example, the array `[[0,1,0],[0,0,1],[1,1,1]]` represents the following shape:
```
     o----o
     |////|
     |////|
     o----o----o
          |////|
          |////|
o----o----o----o
|////|////|////|
|////|////|////|
o----o----o----o
```
# Challenge
You take input as the array and output the matching ASCII art.
### As with all code-golfing challenges, the shortest code in terms of bytes wins.
# Examples
`[[1,1,1],[0,0,0]]`
```
o----o----o----o
|////|////|////|
|////|////|////|
o----o----o----o
```
(You may or may not trim)
`[[0,1,0],[1,0,1]]`
```
     o----o
     |////|
     |////|
o----o----o----o
|////|    |////|
|////|    |////|
o----o    o----o
```
`[[1,0,1,0],[0,0,0,0],[1,1,1,0]`
```
o----o    o----o
|////|    |////|
|////|    |////|
o----o    o----o
o----o----o----o
|////|////|////|
|////|////|////|
o----o----o----o
```
`[[1]]`
```
o----o
|////|
|////|
o----o
```
You can choose whether or not to trim surrounding whitespace, from either rows, columns, both or neither
  
[Answer]
# [Python](https://www.python.org), ~~232~~ ~~223~~ 209 bytes
*-9 bytes thanks to [@Kevin Cruijssen](https://codegolf.stackexchange.com/users/52210/kevin-cruijssen)*
*-11 bytes thanks to [@a stone arachnid](https://codegolf.stackexchange.com/users/80050/a-stone-arachnid)*
*-3 bytes thanks to [@Steffan](https://codegolf.stackexchange.com/users/92689/steffan)*
```
def f(a):R=range;E=enumerate;s=[[*" "*6*len(_)]for _ in 4*a];[s[I+3*i].__setitem__(J+j*5,"/|-o"[2*(I%3<1)+(J%5<1)])for i,r in E(a)for j,x in E(r)if x for I in R(4)for J in R(6)];print(*map("".join,s),sep="\n")
```
[Attempt This Online!](https://ato.pxeger.com/run?1=TVC7bsMgFJ3br0BIkQCT1DQPVXE9ZrDHrBQhS4UWq8YWJlIi9U-6ZGn_p2P_phAcKdO553EPj6-f4eTfe3s-fx-8nj_9_b4qDTRq8HZfusa-qWJXKnvolGu8KsaScwIBJBvyoSySWOjeAQmMBSvSiIKPvMqWxIiFlKPyxqtOSlRnLVlT-PA57yF_JKiaLZ8ZzlA9WwcUOHYY6mLLLpwcaUuPiTpsNDiCqFVR2aPVJVAnssGiGJyxHpGuGRCEi7Y3lo6Yjmoo4YuFeHrYKW51cYtznlNGc0EDhikgC5wJQYOXxmTlSbqm2SU9pW4r8slmFy0FhBDb-zuNuukC1x_-Bw)
[Answer]
# [Charcoal](https://github.com/somebody1234/Charcoal), 33 bytes
```
ＦＡ«Ｆι«ＦκＰ”{⊟∨¹↖﹪Ｈ✂sρSjυ%‖”Ｍ⁵→»⸿⸿⸿
```
[Try it online!](https://tio.run/##S85ILErOT8z5/z8tv0hBwzOvoLREQ1NToZqLEyyQCWZC2NmaCr6lOSWZBUWZeSUaSvm6QJAfk1ejDwQ1CBoirqRpDdTnm1@WqmGqo2AVlJmeUQISquXiDIDojykCQZC62v//o6OjDXUMdIA4VifaQAcMgSxDHUOwWGzsf92yHAA "Charcoal – Try It Online") Link is to verbose version of code. Explanation:
```
ＦＡ«
```
Loop through the rows.
```
Ｆι«
```
Loop through the cells of this row.
```
ＦκＰ”{⊟∨¹↖﹪Ｈ✂sρSjυ%‖”
```
If this cell is `1` then output a compressed representation of the shape without moving the cursor.
```
Ｍ⁵→
```
In any case move the cursor five characters to the right. This causes adjacent shapes to overlap by one character.
```
»⸿⸿⸿
```
After each row move the cursor to the start of the bottom row of the current line, so that the next row will overlap by one character.
Drawing the shape using Charcoal commands turns out to also take 33 bytes:
```
ＦＡ«Ｆι«Ｆκ«Ｆ²Ｆ²«o⁻⁴⊗ν↷»↘¤/↖»Ｍ⁵→»⸿⸿⸿
```
[Try it online!](https://tio.run/##TY7BC8IgFMbP66@QnRSMtqjLuo4gaBBBJ9thra1JosO2dYj97abPLeKhfu/3vU8tm0KXqhDG1EojfJBt32FC0GcRAOAgvX567Zs1QfMJMDhpLjscqpDs/vqMy/6FNxSlqr@J6o4lIfMAH1R35o/GPghkdFumhgonqXpLsLyz50LgcDVd7Ucu7bGqve@CALcUJb@YpdOfrtqVS4/GMMZiGlG7csoiCmVVTGNgeW6Wg/gC "Charcoal – Try It Online") Link is to verbose version of code. Explanation: As above, except instead of `Ｐ”{⊟∨¹↖﹪Ｈ✂sρSjυ%‖”`:
```
Ｆ²Ｆ²«o⁻⁴⊗ν↷»
```
Draw a rectangle with `o`s at the corners.
```
↘¤/↖
```
Fill the rectangle with `/`s.
If `+`s had been acceptable for corners then `Ｆ²Ｆ²«o⁻⁴⊗ν↷»` could have been replaced with `Ｂ⁶¦⁴` saving eight bytes.
```
ＦＡ«Ｆι«Ｆκ«Ｂ⁶¦⁴↘¤/↖»Ｍ⁵→»⸿⸿⸿
```
[Try it online!](https://tio.run/##S85ILErOT8z5/z8tv0hBwzOvoLREQ1NToZqLEyyQCWZC2NkQNqdTfoWGmY6CiaY1iOebX5aqYeWSX54XlJmeUQIRdMvMydFQ0ldCVhJa4JOaBpGv5YIKmuooWMG1AUUDijLzSjSUYopAEKS79v//6OhoQx0DHSCO1Yk20AFDIMtQxxAsFhv7X7csBwA "Charcoal – Try It Online") Link is to verbose version of code.
[Answer]
# [J](http://jsoftware.com/), 58 bytes
```
' -o/|'{~(1 3 3 1+/#:33)>./@((]$_3 _5&*@#:I.@,)|.*&$~{.[)]
```
[Try it online!](https://tio.run/##y/qvpKeepmBrpaCuoKNgoGAFxLp6Cs5BPm7/1RV08/Vr1KvrNAwVjIHQUFtf2crYWNNOT99BQyNWJd5YId5UTctB2cpTz0FHs0ZPS02lrlovWjP2vyZXanJGvkIaWJ8K0ExDIAYiEAOIgBCiQF1LSx2m1AhZKYjAokZHz/A/AA "J – Try It Online")
Consider input:
```
  0 1 0
  0 0 1
  1 1 1
```
* `(1 3 3 1+/#:33)` Create a numeric matrix representing the ascii "cell":
```
2 1 1 1 1 2
4 3 3 3 3 4
4 3 3 3 3 4
2 1 1 1 1 2
```
* `*&$~{.[` Multiply dimensions of that times dimensions of input, ie, `4 6 * 3 3`, giving `12 18`, and extend our cell to those dimensions, which will always be slightly bigger than we need:
```
2 1 1 1 1 2 0 0 0 0 0 0 0 0 0 0 0 0
4 3 3 3 3 4 0 0 0 0 0 0 0 0 0 0 0 0
4 3 3 3 3 4 0 0 0 0 0 0 0 0 0 0 0 0
2 1 1 1 1 2 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
```
* Our strategy will be to rotate the above matrix in 2 dimensions, one time for each 1, moving the cell into each require position.
	+ `$...#:I.@,` Convert the positions of the ones into 2d coordinates:
	
	
	
	```
	 0 1
	 1 2
	 2 0
	 2 1
	 2 2
	
	```
	+ `_3 _5&*@` Multiply row-wise by "dimensions of cell, minus 1, negated". The negation is needed because we want to rotate right rather than left.
	
	
	
	```
	 0  _5
	_3 _10
	_6   0
	_6  _5
	_6 _10
	
	```
	+ `|.` Create multiple copies of our "extended" cell, rotating by those amounts:
	
	
	
	```
	0 0 0 0 0 2 1 1 1 1 2 0 0 0 0 0 0 0
	0 0 0 0 0 4 3 3 3 3 4 0 0 0 0 0 0 0
	0 0 0 0 0 4 3 3 3 3 4 0 0 0 0 0 0 0
	0 0 0 0 0 2 1 1 1 1 2 0 0 0 0 0 0 0
	0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
	0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
	0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
	0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
	0 0 0 0 0 0 0 0 0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 4 0 0 0 0 0 0 0
0 0 0 0 0 2 1 1 1 1 2 1 1 1 1 2 0 0
0 0 0 0 0 0 0 0 0 0 4 3 3 3 3 4 0 0
0 0 0 0 0 0 0 0 0 0 4 3 3 3 3 4 0 0
2 1 1 1 1 2 1 1 1 1 2 1 1 1 1 2 0 0
4 3 3 3 3 4 3 3 3 3 4 3 3 3 3 4 0 0
4 3 3 3 3 4 3 3 3 3 4 3 3 3 3 4 0 0
2 1 1 1 1 2 1 1 1 1 2 1 1 1 1 2 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
```
* `' -o/|'{~` Convert to ascii:
```
o----o       
|////|       
|////|       
o----o----o  
     |////|  
     |////|  
o----o----o----o  
|////|////|////|  
|////|////|////|  
o----o----o----o
```
[Answer]
# [Perl 5](https://www.perl.org/) + `-pl`, 77 bytes
```
$"="..[6D";s!.!@{[$&?qw(o----o |////|)[0,1,1,0]:(".[6C")x4]}.[3A.!g;$\=".[3E"
```
[Try it online!](https://dom111.github.io/code-sandbox/#eyJsYW5nIjoid2VicGVybC01LjI4LjEiLCJjb2RlIjoiJFwiPVwiXGZcdTAwMWJbNkRcIjtzIS4hQHtbJCY/cXcoby0tLS1vIHwvLy8vfClbMCwxLDEsMF06KFwiXHUwMDFiWzZDXCIpeDRdfVx1MDAxYlszQVxiIWc7JFxcPVwiXHUwMDFiWzNFXCIiLCJhcmdzIjoiLXBsIiwiaW5wdXQiOiIxMDAxMDExMTEwMTAwMDAxMDAwMDAxMTAwMVxuMTAwMTAxMDAwMDEwMDAwMTAwMDAxMDAxMDFcbjExMTEwMTExMTAxMDAwMDEwMDAwMTAwMTAxXG4xMDAxMDEwMDAwMTAwMDAxMDAwMDEwMDEwMFxuMTAwMTAxMTExMDExMTEwMTExMTAwMTEwMDEifQ==)
Contains unprintable characters and uses ANSI escape codes to reposition the cursor and output the required ASCII art. Long arrays may not display correctly in the browser (as the terminal is a fixed height and the cursor cannot move out of bounds). Happy to delete if this is not to spec!
## Explanation
First, we set the list separator variable (`$"` - this is automatically added to string when a list is interpolated into it) to a string that will move the cursor down 1 line (form feed - `\x0c`) and back 6 characters (`\x1b[6D`). Then `s///`ubstitute each char (`.`) in (the implicit, stored in `$_`, via `-p`) input with an inline interpolated array (`@{[...]}`) that contains either the four parts of the box (`qw(o----o |////|)[0,1,1,0]`) or four repetitions of moving the cursor forward six characters (`("\x1b[6C")x4`), depending on whether or not the currently matched character (`$&`) is truthy. At the end of the string the cursor is moved back up three lines (`\x1b[3A`) and a literal backspace moves the cursor back one character (`\x08`). Finally, the output record separator (`$\`) is set to a string that moves the cursor to the beginning of the line three lines down (`\x1b[3E`), which is automatically printed (along with the modified input).
[Answer]
# JavaScript, 182 bytes
```
m=>m.map(g=r=>((p=(L=(` |`[r[0]]+r.map((d,x)=>d?`////|`:`    `+` |`[r[x+1]|0]).join``+`
`))[R='replace'](/\//g,'-')[R](/\|/g,'o'))[R](/ /g,(c,i)=>P[i]||' '))+(P=p,L)+L,P='').join``+P
```
Can probably be golfed a lot more.
```
f=
m=>m.map(g=r=>((p=(L=(` |`[r[0]]+r.map((d,x)=>d?`////|`:`    `+` |`[r[x+1]|0]).join``+`
`))[R='replace'](/\//g,'-')[R](/\|/g,'o'))[R](/ /g,(c,i)=>P[i]||' '))+(P=p,L)+L,P='').join``+P
;
console.log(f([
  [1,1,1],
  [0,0,0]
]));
console.log(f([
  [0,1,0],
  [1,0,1]
]));
console.log(f([
  [1,0,1,0],
  [0,0,0,0],
  [1,1,1,0]
]));
console.log(f([
  [1]
]));
console.log(f([
  [1,0,1,0],
  [1,0,0,0],
  [0,0,0,1],
  [1,1,1,0]
]));
```
[Answer]
# [C (clang)](http://clang.llvm.org/), ~~198~~ 197 bytes
-1 byte thanks to @ceilingcat.
---
Based on [@Matteo C.'s Python answer](https://codegolf.stackexchange.com/a/247113/80050).
```
#define F(_,t)for(_=t;_--;)
i;j;I;J;f(*a,X,Y){char*s[3*X+1];F(i,4*X)asprintf(s+i,"%*c",Y*5,0);F(i,X)F(j,Y)if(a[i*Y+j])F(I,4)F(J,6)s[I+3*i][J+j*5]="/|-o"[2*!(I%3)+!(J%5)];F(i,j=3*X+1)puts(s[j+~i]);}
```
[Try it online!](https://tio.run/##RU9ta8IwEP7ur6gRIZdcmX0TttCvQvt5HypZkdBZl@Kq2I5tOPfT12WJnRwJD/e83F3lV3vV7oZh9rytdbv1VnSDPdSHE92kvdj4voCJFo3IRC5qyhQWuIZz9aJOrJMRK3hQihXVGLMCVHc86bavacc1kjmrCK5ZgguwigJWtDFmXVMlNVvzpjSdDGPz57iETmY8YrqUOW9YUqbk7ss/EBmyKc3mEfApzecJuGlNakfD8a3vaCcb/q1LEJfhVemWwnkyXvNIe/zAT/CskDy1xJv1HnkgYI5xlJiYlb0@kPell3rnBQa4sBW4ulwFoVxagWtbyUhFV8p57RupWAbh1XZLvqX/RyQycDLTMEsHGGEEFoYYjjC6wdgIYgeTvyQDL8NPVe/Vrhv8918 "C (clang) – Try It Online") Takes input as the matrix as a flattened array, the number of rows in the matrix, and the number of elements in each row.
[Answer]
# [PowerShell](https://github.com/TryItOnline/TioSetup/wiki/Powershell), 186 bytes
```
$args|%{$l=$m=' '
$_|%{if($_){$l=($l-replace'.$')+'o----o';$m=($m-replace'.$')+'|////|'}else{$l+=' '*5;$m+=' '*5}}
$p+=$l*!$p
&{-join($l|% t*y|%{($_,$p[$i++])[$_-eq32]})}
$m;$m;$p=$l}
$p
```
[Try it online!](https://tio.run/##rVPRboIwFH3vV3TkalvBDbbsZYaEF39g2ZsxjGjdWIogYOYifDu7pTpRsmRZvCHk9vTce07b3Cz9lHnxLpVqYEV9um8gyt@KarAH5UPiM8oIhLiMVxxCoVEOapzLTEULyW6BCZulY4yUTZDPIbnYrO4wKlZLVUgst3XL0SNyD1ldE8hsH9ToBjIy3I8/0niNGtWAlqMvVEZdB7IZxLY9FzMIx3LzcD@vBdYlE/1lWKybNDUhASfE4QEjVIcxZnLjo58bTofYY3SBDtuUGPz06wO9EhY4NOCu4zmucHSCqU48RDwhDge4hhKGETOtD2JuqxH89ZZ@MdJh9ABD7PS@OLLXHvnHRY/@DwVyxadp7Z0exz2a9lr0wjY5a07OG2myoBUd0H17pyB3mVyUculQSKIyj3c4cxCavVwWW1UiMMRRDMy22VmlOS6x7PlI4Qe2HtTw9iWPk@l6yUUt2vGxXtdWW2lNN9tI0TKlR@EnalGb9zriUJ3Mia4fUjff "PowerShell – Try It Online")
Less golfed:
```
$args|%{
    $line=$midl=' '
    $_|%{                               # for each row element
        if($_){
            $line=($line-replace'.$')+'o----o'
            $midl=($midl-replace'.$')+'|////|'
        }else{
            $line+=' '*5
            $midl+=' '*5
        }
    }
    $prev+=$line*!$prev                 # use $line as previous if $prev is empty
    &{                                  # run in new context to reset the local variable $i.
        -join($line|% toCharArray|%{    # output a new line, where
            ($_,$prev[$i++])[$_-eq32]   # each space char from $line
        })                              # replaced by related char from $prev
    }
    $midl                               # implicit output
    $midl                               # implicit output
    $prev=$line
}
$prev                                   # implicit output
```
]