[Question]
  [
Write a function or a full program that applies an ASCII texture to a 2d shape.
**Inputs:** shape, texture, dimensions(optionally).
* Both Shape and Texture can be given by any convenient method (2d matrix, array of strings or string with newlines)
* Shape data have a rectangular shape and contains 2 possible values: [truthy/falsey] binary/integer values (0/1 or n1/n2) or 2 different characters, just specify which one represent the shape parts [truthy] and which one represent the blank parts [falsey] and be consistent .
* The texture has a square shape only (width ≡ height) and contains printable ASCII characters.
* Optionally you can also pass dimensions of the matrices if needed.
**Output:** the shape with each truthy value substituted with the corresponding texture value (coordinates/indices mod texture size), the blank parts must be substituted with spaces.
* The ratio is always 1:1
* The entire shape must be covered and only the shape.
* No offset, texturing must start at top-left corner (0,0) of the shape data with the origin of the texture also at the top-left corner.
# Examples (using various shape formats in JSON)
**Shape**
```
[[0,0,1,1,0,0],
 [0,1,1,1,1,0],
 [0,1,1,1,1,0],
 [0,0,1,1,0,0]]
```
**Texture**
```
["/\\",
 "\\/"]
```
**Output**
```
["  /\  ",
 " /\/\ ",
 " \/\/ ",
 "  \/  "]
```
---
**Shape**
```
["        xxxxxxxx     ",
 "  xxxxxxxxxxxxxxxx   ",
 "    xxxxxxxxxxxxxxxx ",
 "  xxxxxxxxxxxxxxxxxxx",
 "xxxxxxxxxxxxxxxxxxxxx",
 "xxxxxxxxxxxxxxxxxxxxx",
 "xxxxxxxxxxxxxxxxxxxxx",
 "xxxxxxxxxxxxxxxxxxxxx"]
```
**Texture**
```
["[__]",
 "_][_",
 "[__]",
 "_][_"]
```
**Output**
```
["        [__][__]     ",
 "  [__][__][__][__]   ",
 "    [__][__][__][__] ",
 "  [__][__][__][__][__",
 "[__][__][__][__][__][",
 "_][__][__][__][__][__",
 "[__][__][__][__][__][",
 "_][__][__][__][__][__"]
```
---
**Shape**
```
[0,0,0,1]
```
**Texture**
```
["ab",
 "ba"]
```
**Output**
```
["   b"]
```
---
**Shape**
```
["11100001011010",
 "01111010101101",
 "01011011111101"]
```
**Texture**
```
["   ./]| |  / /.",
 "_|_|[]|/|_/\\_|/",
 "_|_|[/|_|_\\/_|.",
 "./_./]|_|//\\/./",
 "_|_|[]|/|_/\\_|/",
 "_|_|[]/ | \\/_|.",
 " /_  /|_|//\\/3/",
 "_|_|[]|/|_/\\_|/",
 "_|_|/ |_|_\\/_|.",
 "./_$/]|_|//\\/./",
 " |_|  |/|_/\\_|/",
 "_|_|[/|_|_\\$_|/",
 "_/  /]|_/ /\\///",
 "_|_/[]|/|/ \\_|/",
 "_|/|[/|_|_ /_||",
 " /_./]|_|  \\/|/"]
```
**Output**
(a surprise for you!)
# Rules
* Input/output can be given by [any convenient method](http://meta.codegolf.stackexchange.com/q/2447/42963).
* You can print it to STDOUT or return it as a function result.
* Either a full program or a function are acceptable.
* Extraneous whitespace are forbidden.
* [Standard loopholes](http://meta.codegolf.stackexchange.com/q/1061/42963) are forbidden.
* This is [code-golf](/questions/tagged/code-golf "show questions tagged 'code-golf'") so all usual golfing rules apply, and the shortest code (in bytes) wins.
---
[Sandbox post](https://codegolf.meta.stackexchange.com/a/18249/84844)
  
[Answer]
# [APL (Dyalog Unicode)](https://www.dyalog.com/), ~~20~~ 12 [bytes](https://codegolf.meta.stackexchange.com/a/9429/43319 "When can APL characters be counted as 1 byte each?")[SBCS](https://github.com/abrudz/SBCS ".dyalog files using a single byte character set")
-6 bytes through dzaima
Full program. Prompts stdin for:
1. texture as a list of strings
2. number of rows in shape matrix
3. number of columns in shape matrix
4. indices of falsies (to be blanks) in the shape matrix
All the `⎕`s are supposed to be rectangles (they're not [tofu](https://english.stackexchange.com/a/233948/106629)). They symbolise a computer console which here means *prompt for array input via stdin*.
```
' '@⎕↑⎕⍴¨⎕⍴⎕
```
[Try it online!](https://tio.run/##fVIxTsRADOz3FS5OChTE691wHB0tFQ/IRquTkGhOIi3S1gcNCAr@wAN4AU/JR4LXTsIlUkgxa3tndmw5@/Zwcf@0Pzw@9N3b5@1dd3y3pnt5bvsCihsudcePjK/fP196MvZM6EG@1hQYmBqwMJXZmjML9hwYSbASvGQkqZPETmInsZfYC98L33PdTK/XMTb8fmzqyMdpZnbG0dLQCfqFuYWt4JUyNaEh2@lxrXo79ep4WJJMKKQUUso4Agk6Qa@xnU31NwljiU2CBICAZR4jxVQ3CVPEEBOOFc5TDBhT5pQYs4qvMWCJ66oG@eVRBRjZZVD5dRVr5l6buVe@BljpcDNUkK1YxUMFxIGD4oUwqXBQcWcpaYc6F3DTzDHeUGX@2d2wJl0z@cUvRbJbAl0RuZMVuelfc/niFw "APL (Dyalog Unicode) – Try It Online")
`⎕` prompt for texture as a list of strings; `["/\\","\\/"]`
`⎕⍴` prompt for number of rows in shape matrix (`4`) and use that to cyclically **r**eshape the texture (this gives us enough texture lines); `["/\\","\\/","/\\","\\/"]`
`⎕⍴¨` prompt for number of columns in shape matrix (`6`) and use that to cyclically reshape *each* of the texture lines (this gives us enough characters in each texture line); `["/\\/\\/\\","\\//\\/\\","/\\/\\/\\","\\//\\/\\"]`
`↑` combine the list of lines into a character matrix;  
  `["/\/\/\"`  
   `"\//\/\"`   
   `"/\/\/\"`   
   `"\//\/\"]`
`' '@⎕` prompt for indices for blanks (`[[0,0],[0,1],[0,4],[0,5],[1,0],[1,5],[2,0],[2,5],[3,0],[3,1],[3,4],[3,5]]`) and then place blanks **at** those indices;  
   `/\`   
   `//\`   
   `//`   
   `/` 
[Answer]
# [Canvas](https://github.com/dzaima/Canvas), 9 [bytes](https://github.com/dzaima/Canvas/blob/master/files/chartable.md)
```
ｍ⤢ｍ⤢；ｎ← ╋
```
[Try it here!](https://dzaima.github.io/Canvas/?u=JXVGRjREJXUyOTIyJXVGRjREJXUyOTIyJXVGRjFCJXVGRjRFJXUyMTkwJTIwJXUyNTRC,i=MjElMEElNjAlNjAlNjAlMEElNUJfXyU1RCUwQV8lNUQlNUJfJTBBJTVCX18lNUQlMEFfJTVEJTVCXyUwQSU2MCU2MCU2MCUwQTglMEElNjAlNjAlNjAlMEEldTIxOTAldTIxOTAldTIxOTAldTIxOTAldTIxOTAldTIxOTAldTIxOTAldTIxOTAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAldTIxOTAldTIxOTAldTIxOTAldTIxOTAldTIxOTAlMEEldTIxOTAldTIxOTAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAldTIxOTAldTIxOTAldTIxOTAlMEEldTIxOTAldTIxOTAldTIxOTAldTIxOTAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAldTIxOTAlMEEldTIxOTAldTIxOTAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMEElNjAlNjAlNjA_,v=8)
Abusing that the input will be ASCII and so won't contain `←`, but the shape is made of spaces and `←` for easy overlapping and replacement. Alternative [12 bytes](https://dzaima.github.io/Canvas/?u=JXVGRjREJXUyOTIyJXVGRjREJXUyOTIyJXVGRjFCJTIzJXUyMTkwJXUyNTRCJXVGRjRFJXUyMTkwJTIwJXUyNTRC,i=MjElMEElNjAlNjAlNjAlMEElNUJfXyU1RCUwQV8lNUQlNUJfJTBBJTVCX18lNUQlMEFfJTVEJTVCXyUwQSU2MCU2MCU2MCUwQTglMEElNjAlNjAlNjAlMEElMjMlMjMlMjMlMjMlMjMlMjMlMjMlMjMlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjMlMjMlMjMlMjMlMjMlMEElMjMlMjMlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjMlMjMlMjMlMEElMjMlMjMlMjMlMjMlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjMlMEElMjMlMjMlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMEElNjAlNjAlNjA_,v=8) taking shape as space and `#`.
[Answer]
# [Japt](https://github.com/ETHproductions/japt), 10 [bytes](https://en.wikipedia.org/wiki/ISO/IEC_8859-1)
```
ËmÈ?VgEY:S
```
[Try it](https://petershaggynoble.github.io/Japt-Interpreter/?v=1.4.6&code=y23IP1ZnRVk6Uw&footer=bXEgcVI&input=W1swLDAsMSwxLDAsMF0sCiBbMCwxLDEsMSwxLDBdLAogWzAsMSwxLDEsMSwwXSwKIFswLDAsMSwxLDAsMF1dLApbIi9cIiwKICJcLyJd)
```
ËmÈ?VgEY:S       U = shape as 2d array, V = texture as list of lines
Ë                Map each row, define E as row number
 mÈ                Map each element in these rows, define Y as element number
   ?                 Is the value a 1?
    VgEY               Get the character at texture[E,Y]
        :S           Else return a space if the value is a 0
```
[Answer]
# [J](http://jsoftware.com/), 32 bytes
```
4 :'y}'' '',:x({.@]$($"1~{:))$y'
```
[Try it online!](https://tio.run/##bZFNS8NAEIbv@yteysIkUGeybfAQCQiCJ09e3bAHsYgXD@nB0tG/Hicfli2GsGFe5snDG/Zj2DAd0DYgbFGhsXPDeHh@ehxqNHT6JgLRtvkqznzf@cJvws@5KUt/oqF07tjyDjtPEqOQ61tGjVt4s1QI9lSX6S/l84Vxb6/vnzjigN7NM5FzPcy3R6hNmH9UTVNY3tfS8G@bp3BFju1RdHecduX475UDwNIpFBAIu6RJXzoVTRKTypwtaYqSlB1LGnlbSRSWdb4T8808JJl54ffrvNG53@f@cQWs9vFTFtMbb@WjyLSXyS9YeFl4a6I69pn7wwravswuYvgF "J – Try It Online")
Some notes:
* This was a rare case where I got a shorter solution with an explicit, rather than tacit, verb.
* I wanted a solution that didn't prompt for input (ie, didn't want to just translate Adam's excellent APL solution into J).
[Answer]
# [Haskell](https://www.haskell.org/), ~~51~~ 49 bytes
* The texture and shape are provided in the format used by the first example.
* This works even if the texture isn't square or contains unprintables.
* Dimensions do not need to be passed.
* -2 bytes by abbreviating `zipWith` to `z`.
```
f=z(z(%)).cycle.map cycle
z=zipWith
_%0=' '
x%_=x
```
[Try it online!](https://tio.run/##1VRNj4IwEL33V7wQjZCQjmTPnPa6e9rDHkrToMFo/IgRTJT0v7MDVT50V71uJtDy@ubNtNNhmebrbLOpiiwv3tM8yxFD@QLKoyTxQgF4SUKe5plS03AaRmw81gCU@2ygP4HORQdho6yM0U7aaGXc7Abr4vUturF2ZRjrkd3QX3J5Xb0xR4/C6D/SrzVKZ64as3RQi44AQJK2sACBJC7Fs8Yqbckavj7GUg9lzBq@S8ZKh0oytQKzmEuSnipo4mh9BZDh6FeFt6cK7H@fw@g@h5oGPNrFqEOJU2AFPgRWoI5LTQ6EgQJdFDhza9Huwp0D6s3Za7MNr3jU9tFvvdZ7mndH6Lz6PVCXUUALsU1XO@74bbr/NPDdsD8WX8XhYweJ425@PBzOWARofxDVIi790h8HgZyf55tMsheamSjjcrX/XhVLYcbTeIKJOI1NfKqqHw "Haskell – Try It Online")
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E/wiki/Commands), 11 [bytes](https://github.com/Adriandmen/05AB1E/wiki/Codepage)
```
εNUεiXèNèëð
```
Port of [*@EmbodimentOfIgnorance*'s Japt answer](https://codegolf.stackexchange.com/a/195899/52210), so make sure to upvote him!
Inputs as defined in the first format of the challenge. Output as a character-matrix.
[Try it online](https://tio.run/##yy9OTMpM/f//3Fa/0HNbMyMOr/A7vOLw6sMb/sd6Hdr9PzraQMdAxxAIgXSsTjSEDeZj4SFUxnJFK@nHxCjpKMXE6CvFAgA) or [verify all test cases](https://tio.run/##1ZOxTsMwEIZ3nuIUdbRyjWBnY2DoBgI51imRGDoxsF7epxILS7t0a/a@UvgdO4mblqorOiWOz/93d47Pn19Vvf7oHp5eu@N29XLcrt/f2s2q3bTf7U/XNM3zYW8Ou8fOZlyWmcnKkjN3Z@3SLE0Bw@iMDd/9/MJsUoLMrIhDIHFWMKSzIW5qxczGlRj5XHGRGNU3ETfH7u1kx/9J7U@jqvH36yr598FPRDk7JSVi4twfkYpap6yCThDlwQWHCtpC1KtyFs9hHSrO@QroGNFHkFiQagDvr4DAZhkXs4xeQPRnqYvoYiQEiP0B5KjiPiPTBHIEUaFqqDRskXz1Gu7DaXcWY8@f3Yjk6d9xddKnnYuz@AU). (Footer will pretty-print the character-matrix, feel free to remove it to see the actual output.)
**Explanation:**
```
ε          # Map over the rows of the (implicit) integer-matrix:
 NU        #  Push the map-index, and then pop and store it in variable `X`
   ε       #  Inner map over the cells of the current row:
    i      #   If the value of the current cell is a 1:
     Xè    #    Use variable `X` to index into the (implicit) input-list of strings,
           #    with automatic wraparound
       Nè  #    And then use the inner map index to index into this string
    ë      #   Else:
     ð     #    Push a space instead
```
[Answer]
# [J](http://jsoftware.com/), 19 bytes
```
]]&' '"+]g"1~g=:$~#
```
[Try it online!](https://tio.run/##y/qvpKeepmBrpaCuoKNgoGAFxLp6Cs5BPm7/Y2PV1BXUlbRj05UM69JtrVTqlP9r/i/OSCxIBWnQ1TMAKjYEQiCtA2GBeShsKyRFXCWpFSWlRWDd6vp66jpW6jH66nDRNAWI2dEKqckZ@Qo@bijqo3Vj1XXUY6N1Qdp0Y6Px6AMA "J – Try It Online")
Dyadic train. Left argument is texture, right argument is shape, 1 is blank, 0 is fill.
### How it works
I extended [the dyadic `&` trick](https://codegolf.stackexchange.com/a/195891/78410) to the "If" usage of `^:`, i.e. boolean repetition amount. Also, an assignment `=:` can group the part of the train on its right, saving a pair of parens.
```
]]&' '"+]g"1~g=:$~#  Left argument: texture, Right argument: shape
                $~#  Repeat the texture's rows to fit the shape's rows
             g=:     Assign this sub-function to g
        ]g"1~        Use g to do the same on columns
]     "+             For each cell on the texture and shape,
 ]&' '                 Replace the texture's cell with ' ' if shape's cell is 1
                       Keep the texture if shape's cell is 0
```
[Answer]
# [Julia 1.0](http://julialang.org/), 68 bytes
```
f(s,t,n,Y,X)=[t[y,x] ? s[mod1(y,n),mod1(x,n)] : ' ' for y=1:Y,x=1:X]
```
Takes the shape as a 2d array of characters, the pattern as a array of Bools, and the dimensions (because `length` is long). Returns a character array via array comprehension.
[Try it online!](https://tio.run/##dY/RasMwDEXf@xUifYgNYo1D1odAN9hXtLgeuIlDXVw72O5Ixv49cwNZ@zJdEEdwdZEuN6MlG6apIwEjWjzgnu545CMOAt4h8KtrGRnRUpxpSCSghjypcx7GHasPOKS@F1OrQ09k2u@9ttFY0nvXEskHrAWls38AbYHVQX8rIpGlrPVshuYsvWyi8iC9lyO4r4TXm4m6NwqMtiqsOuJVOMteEZ5vcsyPx6VtcoEllhQ/nDMvJHppQ@@CeiwUWCBLKnChZXrmP49AssWKpkq5FW4p/LzB/b/V8lu2zj5fC/p0VOOMUU0kmTydZEYfB/EC7mICoUzx1b9h0y8 "Julia 1.0 – Try It Online")
[Answer]
# [Charcoal](https://github.com/somebody1234/Charcoal), 16 bytes
```
Ｆθ«ＦΣιＧ→¹η¿›0ι⸿→
```
[Try it online!](https://tio.run/##LYxBCsIwFETXeoohqwRqk2z1AK4E0WVTQpFoCzXBWAvi9@wxRv9mZh5/5tR38RS6MaVziOA3gddyUezxceWDENiH8XkJnq8Pw6WfKugKvdgsF8MZfBtdN7nImWIVynMc/MSZiUxs4Ma7wy7M7t/NrXdKDdNaq3xaZdXK@KzF/cA3F6N/OC8zALVsCQRIyBrGW7LUtCTJSmMsyT/Jmawx0lLN2rSaxw8 "Charcoal – Try It Online") Link is to verbose version of code. Takes input as newline-delimited strings. Explanation:
```
Ｆθ«
```
Loop over the shape.
```
ＦΣι
```
If the value is a `1`...
```
Ｇ→¹η
```
... then draw a 1x1 polygon filled using the template. Conveniently in Charcoal the fill is always relative to the origin of the canvas. Unfortunately Charcoal can't draw zero-sized polygons or Oblongs of sides less than 2, otherwise I could save a couple of bytes here.
```
¿›0ι
```
If this is a newline...
```
⸿
```
... then move to the start of the next line of the canvas...
```
→
```
... otherwise move forward on the current line.
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 13 bytes
```
JṁJ}ị⁸ṁ"⁹a@o⁶
```
[Try it online!](https://tio.run/##1VO9TsMwEN79FKcoG1GuFiNCYu4bVI5lpRJLVYkZ6ZAaFgZeAWYW5ogKiSF9kvpFwuXSOC4ttCu6wXefv8@ff86L2@Xyvm2n23U1fdh@Pvvqg9PEV@vy5s5XdTvzj@8Lv3pp6oum9qvXK8mv@3zzhrNUbZ6EU301dVO3rVEcCRZFkilIigITmyljJtkk0xw8cg2mrwT5pR75VjEkyxrnrKzrrHGS7CPBKg79I8JMxz5GOCoYyGcJzl1ZoiPrTP8v8vgm5Vzuf17Gtx8TACBHS0AACJhD/1zkyFhCctwqjnAEGSLHfeMoFzBH18mZw0zM8YTcIhtFckDHvoP88oScxQfu6YF7RwL4Y/NpAJHNWc4HZzkGJoo7QizHnZx3TATD5vuzQ3ck2v2l/TbW4aeExhsbV@8ThulREXe5PJqy3w "Jelly – Try It Online")
A dyadic link taking a list of Jelly strings for the texture as its left argument and an integer matrix for the shape as its right argument. Returns a list of Jelly strings. 
[Answer]
# [Icon](https://github.com/gtownsend/icon), ~~100~~ 97 bytes
```
procedure f(t,s)
i:=0&r:=|!t\*s&i+:=1&j:=0&c:=|!r\*!s&s[i,j+:=1]:=[" ",c][s[i,j]]&\z
return s
end
```
[Try it online!](https://tio.run/##vVPBboMwDD3DV7hRhaBDeGQ3JL4kRFFLqUSl0SnQTZvy750T0pZ2dNppOeHnx7P9nLT1oTud3vShbrZH3cAuHtI@CduifI50UZrFUK36qH0qyjzaW7C2oK5Wiz7qRZvubUYWpWDA0loKh0kZVV@hboaj7qAPm247qfC6brs4CYFO897oT/jQ7dBAvNjFgmFVsZRVFTKZhkEgWJ5znueMAgiAUUChjX4EI08mSXgv7ZQDJpSSjhwwJYXyn/eoK@vqjof74wJPvKKT7CU3k334Hx2f4/y/cs6iWY/YekPmb9ZkgjOAP7aTEZahNGAAEDDzW1BGGSENGkWLVAanMIFG0WaVObMzVFaDeMTGDP8gIpEq3ogAKmrhLPLyBxGSmOlkOdOJJQL8Os5yAiM1QiLkB4nghI2uE4RbEfQiNIEx12lGS8BOaS7PwN9Abm/53QPgHr2ALhov3rhB@/6@AQ "Icon – Try It Online")
Uses `1` for spaces and `2` for textured in shape data.
## Explanation:
```
procedure f(t,s)                   ; t - texture, s - shape data
    i:=0 &                         ; i is the row index
    r:=|!t\*s &                    ; repeats the rows of the texture as many times as the rows of the shape data  
    i+:=1 &                        ; next row
    j:=0 &                         ; j is the column index; reset to start
    c:=|!r\*!s &                   ; repeats the characters of each row of the texture as many times as the row of the shape 
    s[i,j+:=1]:=[" ",c][s[i,j]] &  ; modify the shape data ot " " or to texture
    \z                             ; z is not declared and thus causes Icon to backtrack 
    return s                       ; return the modified shape data
end
```
[Answer]
# [Python 2](https://docs.python.org/2/), ~~97~~ ~~94~~ 86 bytes
```
lambda S,P,w:[''.join([' ',P[j%w][i%w]][v]for i,v in E(s))for j,s in E(S)]
E=enumerate
```
[Try it online!](https://tio.run/##tVPBbqMwEL3zFSOrK0CyGAycVuLYuyWOxrJIN9EStaRKsm1W8r9nx2OasGo2Pa2RsOfNe57xM7z@Pv7cTdV50/bn5@Fl9WOATmr5/t2kabHdjVNmUkilNttv79aM9LLmzW52exjlG4wTPGaHPA/xVh5i3OU2eWzX06@X9X44rs@dghaMKWUpFT00W5mYGDBwM7ySbZJo3kJg3wsJou9RENhVvO84HbOntk1PKbfxFJo4WAhrbsgImMdpHhwImYC4YovcnLmR@4eGBmdOp/@fITc0n1sY5ywTnTWOF38jwaH64jzZGaQMiGEVbFwNzGmuLi4NXPinlCppqJJmVXIFWnIQsRnitYoZbrRp2fwCrQcPgIBF9NB554316B1dqfN4BQnyji7Y@YLBAl2QE4eYWOAXcotUaCEHdFT3Q15/ISfxp@oPn6oHEsCd5h8uIFJxktPBSY4XJnJ1hKUcZzl17D18NB/PDuFInj/61z3dFKT9NP@dm6xTUiv5vJ4yrfI8j4xbvErqKvKqu7xa6jry6ru8Ruom8poL7/wH "Python 2 – Try It Online")
3 bytes thx to [frank](https://codegolf.stackexchange.com/users/90146/frank)
Takes the shape as `S`, a list list of `0/1`;the texture `P` as a list of strings; and `w` as the width/height of `P`. Returns a list of strings.
[Answer]
# [Ruby](https://www.ruby-lang.org/), 65 bytes
```
->s,p,w,h{s.zip(p*h).map{|a,b|a.zip(b*w).map{|x,y|x>0?y:' '}*''}}
```
[Try it online!](https://tio.run/##KypNqvyfZhvzX9euWKdAp1wno7pYryqzQKNAK0NTLzexoLomUSepJhEslqRVDhWr0KmsqbAzsK@0UldQr9VSV6@t/V9QWlKskBYdHW2gY6BjCIRAOlYnGsIG87HwECqBXCX9mBglHQWlmBh9pViQRRpqVskZiUXFmjomOmax/wE "Ruby – Try It Online")
**Input**: Matrix of 0 and 1, texture as 2d array of characters, size of the matrix (width and height).
[Answer]
# [Japt](https://github.com/ETHproductions/japt), 9 [bytes](https://en.wikipedia.org/wiki/ISO/IEC_8859-1)
```
ËmÈù1VgEY
```
[Try it](https://petershaggynoble.github.io/Japt-Interpreter/?v=1.4.6&header=bcs/UDpT&code=y23I%2bTFWZ0VZ&footer=Vm1xIHFS&input=W1swLDAsMSwxLDAsMF0sCiBbMCwxLDEsMSwxLDBdLAogWzAsMSwxLDEsMSwwXSwKIFswLDAsMSwxLDAsMF1dLApbIi9cIiwKICJcLyJd)
]