/** * Returns a new mesh by merging @lhs with @rhs. */ public static Mesh Union(CSG_Model csg_model_a, CSG_Model csg_model_b) { CSG_Node a = new CSG_Node(csg_model_a.ToPolygons()); CSG_Node b = new CSG_Node(csg_model_b.ToPolygons()); List <CSG_Polygon> polygons = CSG_Node.Union(a, b).AllPolygons(); CSG_Model result = new CSG_Model(polygons); return(result.ToMesh()); }
/** * Returns a new mesh by merging @lhs with @rhs. */ public static Mesh Union(GameObject lhs, GameObject rhs) { CSG_Model csg_model_a = new CSG_Model(lhs); CSG_Model csg_model_b = new CSG_Model(rhs); CSG_Node a = new CSG_Node(csg_model_a.ToPolygons()); CSG_Node b = new CSG_Node(csg_model_b.ToPolygons()); List <CSG_Polygon> polygons = CSG_Node.Union(a, b).AllPolygons(); CSG_Model result = new CSG_Model(polygons); return(result.ToMesh()); }