Applying a texture with faceUV to a mesh crated using .toMesh

I have created a mesh by subtracting four boxes from a larger box to create a window frame mesh using CSG and .toMesh. How to I apply a faceUV value to the mesh so that the texture only appears on the front face. I’ve tried applying the faceUV to the original mesh and to the new mesh, but the texture still covers all the mesh.

There are pretty good docs here for applying material to individual faces , alternatively if you can create a playground that would help others to sort it out for you

I know how to use textures on the faces of normal meshes, but cant work how to apply a texture to a mesh I created by using CSG and .toMesh. With the createBox etc I can use the faceUV variable, but the .toMesh doesn’t have that option… I will create a playground :slight_smile:

1 Like

Another way to create a frame Making A Frame | Babylon.js Documentation.

However faceUVs are only an option on a few specific meshes as they are set during the mesh creation.

Here is another approach Texturing Ribbon asset - #12 by JohnK

The image texture file has been removed by the op you will have to supply your own