JZ7878 Posted October 19, 2018 Share Posted October 19, 2018 Hi all, I want to add a hole one a mesh which created via CreateRibbon function (the mesh itself is a bit complext, but I simplify in the demo). Following the demo http://playground.babylonjs.com/#T6NP3F#0 I create a demo, links is http://playground.babylonjs.com/#J4H6RF but seems it will failed to do the subtract operation on the mesh created via CreateRibbon, any one can help me on it? If I want to add a hole on this type of mesh, which is the better way I can have a try ? Thanks in advace. Quote Link to comment Share on other sites More sharing options...
JohnK Posted October 19, 2018 Share Posted October 19, 2018 Hi @JZ7878 and welcome to the forum from me. The issue is the use of double sides for the ribbons. To ensure the normal directions for the sides are correct (ie point away from solid) to produce the 'solid looking' mesh you need to swap the order of some of your arrays. I have done this by using the reverse function but you could change the appropriate arrays by hand. The 'direction' of the ribbon will also affect how CSG works. So here is a cube made up of single sided ribbons in correct direction http://playground.babylonjs.com/#J4H6RF#3 You can also remove the backface culling lines. I stuck to using a standard box as it was easier to experiment with just one 'ribbon cube'. You can try the same approach with a 'ribbon hole maker' making sure normals will be correct. kcoley, JZ7878 and ssaket 2 1 Quote Link to comment Share on other sites More sharing options...
JZ7878 Posted October 20, 2018 Author Share Posted October 20, 2018 @JohnK wow, thanks very much, that's realy what I want, you make me better understand it, and I will try it right now. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.