[Question]
  [
Write the shortest code measured by byte count to generate an ASCII grid composed of rhombi, given the following parameters:
* m - number of complete rhombi in one row
* n - number of rows
* s - side of the smallest rhombus
* r - level of nesting - how many rhombi are there inside the "base ones" (which are fonud between the intersections of the grid)
## Examples
```
1. Input: 5 3 1 0
Output:
/\/\/\/\/\
\/\/\/\/\/
/\/\/\/\/\
\/\/\/\/\/
/\/\/\/\/\
\/\/\/\/\/
A 5x3 grid of rhombi with side 1, no nesting
2. Input: 3 2 2 0
Output:
 /\  /\  /\
/  \/  \/  \
\  /\  /\  /
 \/  \/  \/ 
 /\  /\  /\
/  \/  \/  \
\  /\  /\  /
 \/  \/  \/ 
 
A 3x2 grid of rhombi with side 2, no nesting
3. Input: 5 2 1 2
Output:
///\\\///\\\///\\\///\\\///\\\
///\\\///\\\///\\\///\\\///\\\
///\\\///\\\///\\\///\\\///\\\
\\\///\\\///\\\///\\\///\\\///
\\\///\\\///\\\///\\\///\\\///
\\\///\\\///\\\///\\\///\\\///
///\\\///\\\///\\\///\\\///\\\
///\\\///\\\///\\\///\\\///\\\
///\\\///\\\///\\\///\\\///\\\
\\\///\\\///\\\///\\\///\\\///
\\\///\\\///\\\///\\\///\\\///
\\\///\\\///\\\///\\\///\\\///
A 5x2 grid of rhombi with side 1 (the smallest rhombus), level of nesting is 2
4. Input: 4 2 2 1
Output:
 //\\  //\\  //\\  //\\ 
///\\\///\\\///\\\///\\\
//  \\//  \\//  \\//  \\
\\  //\\  //\\  //\\  //
\\\///\\\///\\\///\\\///
 \\//  \\//  \\//  \\//   
 //\\  //\\  //\\  //\\ 
///\\\///\\\///\\\///\\\
//  \\//  \\//  \\//  \\
\\  //\\  //\\  //\\  //
\\\///\\\///\\\///\\\///
 \\//  \\//  \\//  \\//   
 
A 4x2 grid of rhombi with side 2 with level of nesting 1 
 
5. Input: 4 2 3 3
Output:
 
  ////\\\\    ////\\\\    ////\\\\    ////\\\\
 /////\\\\\  /////\\\\\  /////\\\\\  /////\\\\\
//////\\\\\\//////\\\\\\//////\\\\\\//////\\\\\\
//////\\\\\\//////\\\\\\//////\\\\\\//////\\\\\\
/////  \\\\\/////  \\\\\/////  \\\\\/////  \\\\\
////    \\\\////    \\\\////    \\\\////    \\\\
\\\\    ////\\\\    ////\\\\    ////\\\\    ////
\\\\\  /////\\\\\  /////\\\\\  /////\\\\\  /////
\\\\\\//////\\\\\\//////\\\\\\//////\\\\\\//////
\\\\\\//////\\\\\\//////\\\\\\//////\\\\\\//////
 \\\\\/////  \\\\\/////  \\\\\/////  \\\\\/////  
  \\\\////    \\\\////    \\\\////    \\\\////  
  ////\\\\    ////\\\\    ////\\\\    ////\\\\
 /////\\\\\  /////\\\\\  /////\\\\\  /////\\\\\
//////\\\\\\//////\\\\\\//////\\\\\\//////\\\\\\
//////\\\\\\//////\\\\\\//////\\\\\\//////\\\\\\
/////  \\\\\/////  \\\\\/////  \\\\\/////  \\\\\
////    \\\\////    \\\\////    \\\\////    \\\\
\\\\    ////\\\\    ////\\\\    ////\\\\    ////
\\\\\  /////\\\\\  /////\\\\\  /////\\\\\  /////
\\\\\\//////\\\\\\//////\\\\\\//////\\\\\\//////
\\\\\\//////\\\\\\//////\\\\\\//////\\\\\\//////
 \\\\\/////  \\\\\/////  \\\\\/////  \\\\\/////  
  \\\\////    \\\\////    \\\\////    \\\\////  
A 4x2 grid of rhombi with side 3, level of nesting 3
```
Be sure to display the partially visible rhombi at the edges and corners where necessary.
  
[Answer]
# [SOGL V0.12](https://github.com/dzaima/SOGL), 20 [bytes](https://github.com/dzaima/SOGL/blob/master/chartable.md)
```
ā.I∫e+H╚╬8}:±№╬8╬¡∙*
```
[Try it Here!](https://dzaima.github.io/SOGLOnline/?code=JXUwMTAxLkkldTIyMkJlK0gldTI1NUEldTI1NkM4JTdEJTNBJUIxJXUyMTE2JXUyNTZDOCV1MjU2QyVBMSV1MjIxOSo_,inputs=MyUwQTMlMEEyJTBBNA__)
Takes the input in the reversed order of what they are in the examples - r, s, n, m.
Explanation:
```
ā                     push an empty array - canvas
 .I∫      }           for each in range(input) (1-indexed)
    e+                  add the second input
      H                 decrement
       ╚                create a diagonal of that size
        ╬8              insert into the canvas
           :          create a duplicate of the canvas
            ±№        reverse it vertically and horizotally
              ╬8      insert that into the canvas
                ╬¡    quad-palindromize
                  ∙   multiply vertically by the next input
                   *  multiply horizontally by the next input
```
[Answer]
# [Charcoal](https://github.com/somebody1234/Charcoal), ~~48~~ ~~39~~ 37 bytes
```
ＵＯ⊕Ｉε\Ｆ⊖ＩζＣ¹¦¹‖ＭL≔⊗⁺ＩζＩεδＦ⊖ＮＣδ⁰Ｆ⊖ＮＣ⁰δ
```
[Try it online!](https://tio.run/##jY07C8IwFIV3f0XodAMRWnHSSdql4AvnLm16@4A0KTeJoH8@BqEO4iB3OVy@cz451CRNrUK4NMroHkotCSfUDlvIa@sAORcsqaqE71edIQYFfhFPzjnLzfyATLAsYjfsFEp3GokMwe4YXwdrx15DYXyjYu@qvF3Kgi2eGNtfllLP3p391CDBx9UKlv4Np@/lELZsEy8L67t6AQ "Charcoal – Try It Online") Link is to verbose version of code. Explanation:
```
ＵＯ⊕Ｉε\
```
Draw a square of size `r + 1`. This is a quarter of a nested diamond of size 1.
```
Ｆ⊖ＩζＣ¹¦¹
```
Copy the square 1 square right and down `s - 1` times to get it to the right size.
```
‖ＭL
```
Reflect it to become a full nested diamond.
```
≔⊗⁺ＩζＩεδ
```
Compute the size of this nested diamond.
```
Ｆ⊖ＮＣδ⁰
```
Copy the diamond to the right `m - 1` times.
```
Ｆ⊖ＮＣ⁰δ
```
Copy the diamond downwards `n - 1` times.
[Answer]
# [Python 2](https://docs.python.org/2/), ~~160~~ ~~159~~ 158 bytes
-1 byte thanks to Jonathan Frech
```
m,n,s,r=input()
l=~-s*' '+'/'*(r-~r)+~-s*' '
for x in range(n*2):print'\n'.join(m*(l[i:i+s+r]+l.replace(*'/\\')[i:i+s+r][::-1])for i in range(r+s))[::1-x%2*2]
```
[Try it online!](https://tio.run/##RcxNCoMwEEDhvafIpkx@FaOrgCdRF1JsmxLHMLFgN149baG02/fBi8/ttqLNedGok6bOY3xsXBShO0ySwEBBBZKTOUiobyouK7GdeWQ04XXmKK1wkTxuMCCU99UjXyQPvXdeJUWjCiXNMUznmUuohgHEj3rnTD2Kz9H/j6SSEG@qzX6y0o45t9rqRjcv "Python 2 – Try It Online")
This uses the fact that the bottom of the rhombus is the top inverted (`[::-1]`), iterating over `range(n*2)` and using `~x%2*2-1` to control if it is the top or the bottom.  
For the top (and the bottom) the right side is just the left side inverted and replacing `/` with `\` -> `l.replace(*'/\\')..[::-1]`  
To generate the pattern / nesting `~-s*' '+'/'*(1+r*2)+~-s*' '` is used to make a string like  `///`  that will be iterated and chopped : 
```
   '|  //|/  '  
  ' | ///|  '  
 '  |/// | '  
'  /|//  |'  
```
[Answer]
# [Julia 0.6](http://julialang.org/), 190 bytes
```
g(n,m,s,r)=(s+=r+1;f(i,j,u=mod(i-j+r,2s),v=mod(j+i+r,2s))=(" \\/")[abs(u-r)<abs(v-r)?1+(u<=2r):1+2(v<=2r)];
for i=1:2(s-1)m println((f(i+(i-1)÷(s-1),s+j+(j-1)÷(s-1))for j=1:2(s-1)n)...)end)
```
This is a functional solution which computes for every index pair `i,j` what the symbol should be displayed.
[Try it online!](https://tio.run/##RY5RDoIwEESvQvjazS6YbaIfSONBxA8MYtpAMa3lah7Ag2HBRP/ezO5kxsbBtIdluYPjkQN71BBIe5JjD4YtRz1OHZjCkmcVkOdNWzJfnd7zrGl2OZ7ba4BYeKxXmBOchCDWWnmshBTMG16O/eQzo6VSEArBMXt4456DA0iFlJoE36/txIEsgf0buEbtL@qwLEu8uQ7T/D0rFla4fAA "Julia 0.6 – Try It Online")
### Illustration
Start with a grid
```
f(i,j,u=mod(i,2s),v=mod(j,2s))=(" -|*")[1+(u==0)+2(v==0)]
for i=1:2(s-1)m println((f(i-1,j)for j=1:2(s-1)n)...)end
---------*---------*----
         |         |    
         |         |    
         |         |    
         |         |    
         |         |    
         |         |    
         |         |    
         |         |    
         |         |    
---------*---------*----
         |         |    
         |         |    
         |         |    
         |         |    
         |         |    
```
`r > 0` means thicker lines
```
f(i,j,u=mod(i+r,2s),v=mod(j+r,2s))=(" -|*")[1+(u<=2r)+2(v<=2r)]
for i=1:2(s-1)m println((f(i,j)for j=1:2(s-1)n)...)end
**-----*****-----*****--
**-----*****-----*****--
||     |||||     |||||  
||     |||||     |||||  
||     |||||     |||||  
||     |||||     |||||  
||     |||||     |||||  
**-----*****-----*****--
**-----*****-----*****--
**-----*****-----*****--
**-----*****-----*****--
**-----*****-----*****--
||     |||||     |||||  
||     |||||     |||||  
||     |||||     |||||  
||     |||||     ||||| 
```
Handle the corners by checking which line on the original grid is closest
```
f(i,j,u=mod(i+r,2s),v=mod(j+r,2s))=(" -|")[abs(u-r)<abs(v-r)?1+(u<=2r):1+2(v<=2r)]
for i=1:2(s-1)m println((f(i,j)for j=1:2(s-1)n)...)end
|-------|||-------|||---
||-----|||||-----|||||--
||     |||||     |||||  
||     |||||     |||||  
||     |||||     |||||  
||     |||||     |||||  
||     |||||     |||||  
||-----|||||-----|||||--
|-------|||-------|||---
---------|---------|----
|-------|||-------|||---
||-----|||||-----|||||--
||     |||||     |||||  
||     |||||     |||||  
||     |||||     |||||  
||     |||||     |||||  
```
A fairy tells us to remove every `s-1` line
```
f(i,j,u=mod(i+r,2s),v=mod(j+r,2s))=(" -|")[abs(u-r)<abs(v-r)?1+(u<=2r):1+2(v<=2r)]
for i=1:2(s-1)m println((f(i+(i-1)÷(s-1),s+j+(j-1)÷(s-1))for j=1:2(s-1)n)...)end
---||------||------||---
--||||----||||----||||--
  ||||    ||||    ||||  
  ||||    ||||    ||||  
  ||||    ||||    ||||  
  ||||    ||||    ||||  
--||||----||||----||||--
---||------||------||---
---||------||------||---
--||||----||||----||||--
  ||||    ||||    ||||  
  ||||    ||||    ||||  
  ||||    ||||    ||||  
  ||||    ||||    ||||  
--||||----||||----||||--
---||------||------||---
```
Traverse diagonally and done
```
f(i,j,u=mod(i-j+r,2s),v=mod(j+i+r,2s))=(" \\/")[abs(u-r)<abs(v-r)?1+(u<=2r):1+2(v<=2r)]
for i=1:2(s-1)m println((f(i+(i-1)÷(s-1),s+j+(j-1)÷(s-1))for j=1:2(s-1)n)...)end
 ///\\\  ///\\\  ///\\\ 
////\\\\////\\\\////\\\\
////\\\\////\\\\////\\\\
///  \\\///  \\\///  \\\
\\\  ///\\\  ///\\\  ///
\\\\////\\\\////\\\\////
\\\\////\\\\////\\\\////
 \\\///  \\\///  \\\/// 
 ///\\\  ///\\\  ///\\\ 
////\\\\////\\\\////\\\\
////\\\\////\\\\////\\\\
///  \\\///  \\\///  \\\
\\\  ///\\\  ///\\\  ///
\\\\////\\\\////\\\\////
\\\\////\\\\////\\\\////
 \\\///  \\\///  \\\/// 
```
[Answer]
## JavaScript (ES6), 154 bytes
```
f=
(m,n,s,r)=>[...Array((s+=r)*n*2)].map((_,i)=>[...Array(s*m*2)].map((_,j)=>i/s&1^j/s&1?`\\ `[g(j%s)]:`/ `[g(s-1-j%s)],g=j=>i%s-j>r|j-i%s>r).join``).join`
`
```
```
<div oninput=o.textContent=f(+m.value,+n.value,+s.value,+r.value)>
m: <input type=number min=0 id=m><br>
n: <input type=number min=0 id=n><br>
s: <input type=number min=0 id=s><br>
r: <input type=number min=0 id=r></div>
<pre id=o>
```
Directly calculates the character at each cell of the output.
[Answer]
# CJam, 44
```
q~:R+,_ff{-zR>}{_W%:~\+"\ /"f=}%_W%Wf%+*f*N*
```
[Try it online](http://cjam.aditsu.net/#code=q%7E%3AR%2B%2C_ff%7B-zR%3E%7D%7B_W%25%3A%7E%5C%2B%22%5C%20%2F%22f%3D%7D%25_W%25Wf%25%2B*f*N*&input=4%202%203%203)
**Explanation:**
```
q~           read and evaluate the input
:R+          save the last number in variable R, then add the last 2 numbers (s+r)
,_           make an array [0 1 … s+r-1] and duplicate it
ff{…}        make a matrix, calculating for each (x,y) pair from the 2 arrays:
  -z         abs(x-y)
  R>         compared with R (1 if greater, 0 if not)
{…}%         transform each row of the matrix:
  _W%        duplicate and reverse it
  :~         bitwise-NOT each element (0 → -1, 1 → -2)
  \+         prepend to the original row
  "\ /"f=    replace numbers with characters from this string (by index):
              0 → '\'; 1, -2 → ' '; -1 → '/'
              this generates the "/\" part
_W%          duplicate the matrix and reverse the rows
Wf%+         reverse each row, then append (by rows) to the original matrix
              this adds the "\/" part
*            repeat the matrix (by rows) n times
f*           repeat each row m times
N*           join the rows with newlines
```
[Answer]
# [C# (.NET Core)](https://www.microsoft.com/net/core/platform), 167 bytes
```
(c,r,s,n)=>{int w=s+n,i=0,j;var g="";for(;i<r*2*w;i++,g+="\n")for(j=0;j<c*2*w;){int y=i%w,q=(j/w+i/w+1)%2,p=~-w*q+j++%w*(1-2*q);g+=p>y+n|p<y-n?' ':"\\/"[q];}return g;}
```
[Try it online!](https://tio.run/##jY8xT8MwEIVn8iusSFHt@EKbhC44DgMSLCBVMDBQhmBCcNQ6je02ikr468GthIRYqE53y/vu6T1hItHoctwaqSr02BtbrpknVoUxaLH3jC2sFOhmq0QmlQX05xir3V@OHj6a9asUt1q@IY5GLECDAUV4vncc6rihCiSfQc12hUYV93323mjMZKbDJOyYpBQqyv2l8slBqPmM1Zk4auTo0XMZdNByXE87Kt3GJEhgw7@iLmxpTWnQhTiOkrAlzDlt8p6qz03WR@pqgiaX/nI59Z/bFzbo0m61QhUbRub9NNw1Lvl9IRUm3t47u26UaVbl@ZOWtryTqsS/GuI5pBDDjBD2H5lC4uYUcu64GJITyIujZ3wimUJ6IAdvGL8B "C# (.NET Core) – Try It Online")
I'm surprised by the size I managed; I was initially expecting a longer solution. In saying this, I'm sure there are other tricks I've missed.
### DeGolfed
```
(c,r,s,n)=>{
    int w=s+n, // rhombus quadrant width, and height
        i=0, // string row
        j; // string column
    var g="";
    // go through every character row and column
    for(; i < r*2*w; i++, g += "\n")
        for(j = 0; j < c*2*w;)
        {
            int y = i % w, // vertical position in the quadrant
                q = ( j / w + i / w + 1) % 2, // Get the rhombus quadrant as a 0 or 1
                p = ~-w * q + j++ % w * (1-2*q); // horizontal position in quadrant. the value is either ascending or descending depending on the quadrant
            // select which character to use at this [i,j] position
            g += p > y + n | p < y - n ? ' ' : "\\/"[q];
        }
    return g;
}
```
[Answer]
# [Python 2](https://docs.python.org/2/), ~~201~~ 189 bytes
```
def f(m,n,s,r):Z=range(s+r);R=[r-~min(i,s+~i+r,min(s-1,r))for i in Z];L=[m*(' '*(s+~i)+'/'*R[i]+'  '*(i-r)+'\\'*R[i]+' '*(s+~i))for i in Z];print'\n'.join((L+[l[s+r:]+l[:s+r]for l in L])*n)
```
[Try it online!](https://tio.run/##VY67DoMgFED3fgUbr2tbtS4a/8DJUWRoUmlpFA24dPHXKZjYpGE5nJzce5fP@ppN5v1jUEiRCQw4sLTsans3z4E4bmnV1sIm26QN0eD4prmF@HFJGlKqZos00gZ1smpqMTGCEWYkhpTjC2at0JJjFKVObHB9/5NH@DdlsdqsuDf4/J7DHtJwMYpwSSn5KMoAMtZjrBtJmaFekQJySOFKT4rkkIW3YxEghSzibbfpgTnk1H8B "Python 2 – Try It Online")
Uses the fact that the bottom is the same as the top, but shifted:
```
Top:       /\/\/\
Bottom:     /\/\/\
```
Saved 22 bytes thanks to Jonathan Frech
[Answer]
# Perl 5, 159 + 3 (-anl) bytes
```
($m,$n,$s,$r)=@F;$s=$"x($s+$r-1);$_="$s/\\$s"x$m;$n*=2;{$t=$_;map$t=~s, ?(\S) ?,$1x$&=~y///c,ge,1..$r;print$t;redo if s, /,/ ,g&&s,\\ , \\,g||y,/\\,\\/,&&--$n}
```
[Try It Online](https://tio.run/##DY3RCoIwGEZf5Uc@htZvS6urMeqqF@h2IFImgs6xeWFUPnrLu8OBw3GN708xphgYlhEYPtOXq0LQSOYUYQufF5lCpRMEaQxCMmNQsBtdqjcmjUoNtVthCUzn1NwyOjOKGUIvLynlnduGi90OXjnf2QmT8s1jpO5JayBZErdCBDaGmIzh9vN58TpahWQh8hz2G@ORSjrQ/je6qRttiHlt@z8)
]