karl- / pb_CSG

A C# port of CSG.js by Evan W (http://evanw.github.io/csg.js/).
MIT License
634 stars 99 forks source link

Mesh substraction results in non centered mesh #19

Closed nobrainstudio closed 3 years ago

nobrainstudio commented 3 years ago

If I substract a cube from another one like this image

Depending on the cutter mesh position it will result in a non centered mesh with an offset corresponding to the original meshToCut position

image

My MeshCutter is on the CubeCutter and looks like this

image

Thank you for your help !

karl- commented 3 years ago

The mesh is returned in world space coordinates. If you're assigning the mesh back to one of the source GameObjects you will need to reset the transform to identity.