Pyth, 39 3838 36 bytes
IKjbmXXj\|m*\jbXmXXj\|m*\ Q2d\\_hd\/QK)j\Om*Q\JhyQQX*\-2_KJQ\O
Try it online: [Pyth Compiler/Executor][1]
Sadly I had to waste 3 2 bytes for not printing a leading newline for N = 0
.Pyth Compiler/Executor
jbXmXXj\|m*\ Q2d\\_hd\/JhyQQX*\-JQ\O mimplicit: Q = input
Q map each d ofJhyQ [0, 1, ..., input-1] to: J = 1 + 2*Q
m *\ Q J " "*input map each d of [0,1,...,2*Q] to:
m*\ Q 2 list with twice " "*input
j\| m 2 join this list by "|"
X list with twice " "*input
d\\ j\| replace the value at d to "\"
X join this _hd\/list by "|"
replaceX the value at -(d+1) to "/"
jb d\\ replace jointhe byvalue "\n"at d to "\"
K X _hd\/ store in K
IK replace the value at -(d+1) to "/"
X K) if K: print K (this avoids a leading newline, if N=0)
Q *Q\- replace line Q by:
"-"*input
m 2 *\-J list with twice "-"*input"*J
j\O join by "O" andX print
Q\O replace element at Q _Kwith "O"
jb print K in reverse order
join by "newlines"
[1]Another 36 bytes solution would be: https://pyth.herokuapp.com/?code=IKjbmXXj%5C%7Cm*%5C+Q2d%5C%5C_hd%5C%2FQK)j%5COm*Q%5C-2_K&input=3&debug=0
jbmXXj\|m*?\-KqdQ\ Q2d\\_hd?\OK\/hyQ