Hello,
I’m having issues using CSG2 to create an object from a Mesh. So I went to a demo PG (https://playground.babylonjs.com/#PJQHYV#1), stripped out all the stuff I didn’t need and was able to recreate and solve my issue (which, incidentally, was that my source mesh was not manifold because one face was facing “inwards” and all others were facing “outwards”).
Integrating what I discovered from the PG back into my application…. and it still didn’t work in my app (getting an error saying “Uncaught TypeError: ManifoldMesh is not a constructor”).
Next step: I dumbed down my test case a lot, planning to ask about the problem in this forum with a demo PG, only to find that the new PG I created with content exactly the same as my locally-modified existing PG (referenced above) does not work. There’s a new error printed : “PR is not a constructor”. I’ve no idea what “PR” is. My PG is here: Babylon.js Playground
In other words, I loaded PG #PJQHYV#1, modified its content and it generates a CSG2 object without issue. I then copy and paste the content exactly from PG #PJQHYV#1 into PG #E0QTEF and the CSG2 fails to run. Both PGs indicate they are running version 8.36.0 (WebGL2).
Why is the behaviour of the two PGs different when they have exactly the same content?
What does “PR is not a constructor” mean?
Before discovering this difference in behaviour between two PGs, I copied the way the mesh is constructed in the working PG (my local copy of #PJQHYV#1) back into my application assuming it would work in the application, only to find the CSG2.FromMesh() call still fails with the “Manifold Mesh is not a constructor” error. Why would it work in the PG and not in my application? Could it be a similar issue to why it works in my modifed version of PG #PJQHYV#1 and not in the PG I created to ask these questions (#E0QTEF)? My app is using npm @babylonjs/core 8.36.0.
Hopefully this makes sense? Any help appreciated.