Hello,
all I need is shown in image below. I have the left one mesh and need to get from it the right one. Mesh is 2D so Z is always 0. Is there any way or go around for it? Thank you for your help.
Hi
I can’t offer an easy solution I’m afraid, as what you describe is actually quite a difficult problem. The area you’re looking into is Constructive Solid Geometry (CSG), and is all about defining solid shapes, then performing certain operations on them. The one you’re talking about is a ‘boolean inversion’, as you’re talking about making all the solid bits none-solid, and all the none-solid bits solid. There are libraries and algorithms around to do this with 2D and 3D geometry, but it’s not something I can describe in a Unity Answers forum.
Without knowing anything about your actual issue, it’s hard to suggest any alternatives. If it works with your game design, you may be able to render the 2D mesh into a texture, so you get an image of the mesh instead of the raw geometry. Once you have an image you can easily invert it (it’s just pixels). However you obviously can’t then get back to mesh geometry easily.
Sorry I can’t offer anything better. Like I say, hard problem!
-Chris
Thank you for help. I did it another way.