sure, it can be done but it isn't that easy. you could use a library like carve-csg.