Hello i have been learning about CSG i have checked out evanW. And Sander Van Rossen blog about CSG(real-time), i understand on what Sander is talking about but i don’t know how to code it, i have been to many websites but its always in another code language and not in C#, so if anyone knows how to do CSG could you help me out? cheers

Blender3D has a boolean modifier functionality that can do all of the above.
Full source code is available at https://www.blender.org
From there you should be able to get a pseudocode idea of what is involved step-wise.
After that, coding it in C# is just an “implementation detail™.”
Asset store has plugins to do that (so could check those how its done)
seen few free ones in the forums too, search for unity csg
i’ll check it out
Now @mgear Kurt-Dekker i have looked at the pb_CSG but how do i a
Perform boolean operation without creating a new mesh?
I did try this
m.RecalculateBounds();
m.RecalculateNormals();
and this, but it doesn’t work.
CSG.Subtract(cube, sphere);
So @mgear would you know how to it??
It gives you a new mesh back so just assign the new mesh to the one you want to replace.
how?
Not sure I understand?
Mesh mesh = CSG.Subtract(cube, sphere);
MeshFilter filter = replacement.GetComponent<MeshFilter>();
filter.mesh = mesh;
The mesh is supplied by a property within the MeshFilter component.
The MeshFilter component in turn supplies the attached mesh to either a MeshRenderer or a SkinnedMeshRenderer.
What is “replacement” in line 3 @KelsoMRK
I don’t really understand @Kurt-Dekker could you use code and describe on what it does or link me to a website with the info. thanks ![]()