Dynamic Texture projection after a CSG subtraction

You can do it like this:

https://playground.babylonjs.com/#BC4XLY#5

Thank you so much @Evgeni_Popov!

I really appreciate the help!

Hi @Evgeni_Popov

When I have many shapes that I am subtracting I end up getting this error when it is trying to work on the texture…

Uncaught RangeError: Maximum call stack size exceeded
at Loader.CSG [as sceneConstructor] (mcb.threed.loader.js:552)
at mcb.threed.loader.js:673

This is where it is happening:

Any idea how to fix?
Thanks!

You should do a proper loop instead that will compute the xmin/xmax/ymin/ymax values. I used this syntax because it was quicker to write but it is not performant at all.

1 Like

@Evgeni_Popov
Worked perfectly.

Thanks again!