How to fix the gap problem?

I created a roof, which is made up of some rooms, but there are gaps between the rooms. I don’t know what the problem is.How to fix it?

https://playground.babylonjs.com/#VWBPXT

Three.js has the same problem, but it doesn’t exist in Unity3D.The second image is the result in Unity3D.

I thought it was a loss of precision, I tried to keep all the values down to 3 decimal places, but the problem is still there.

You should use the exact same coordinates for the points of the irregular polygon than the coordinates used for the other polygons. Currently, the points are slightly different, so it’s expected to see some rendering artifacts:

https://playground.babylonjs.com/#VWBPXT#2

1 Like