Skip to content
Constructive Solid Geometry (CSG) for Unity in C#
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


NOTE: Don't get too excited. This doesn't work very well at present (see Issues & TODOs). But feel free to try it, maybe even make it better.

Constructive Solid Geometry (CSG) for Unity in C#

Direct port of (Actionscript 3) to C# / Unity.

Nice summary with pseudocode of the algorithm:

Copyright (c) 2011 Evan Wallace (, under the MIT license (original Javascript version,

Copyright (c) 2012 Tim Knip (, under the MIT license (AS3 port,

Copyright (c) 2013 Andrew Perry (, under MIT license (C#/Unity port).


  • Works, but adds a whole pile of verticies that don't need to be there. Find a way to simpify the mesh for tris that share a plane (maybe ?
  • Currently does nothing with the 'shared' field on Polygons. We could use this for tracking submeshes / materials ?
  • Almost certainly could do with optimization (eg, some Lists could probably become Vertex[] or Polygon[] arrays).
You can’t perform that action at this time.