CSG(ProBuilder.Csg)
public static Model Union(GameObject lhs, GameObject rhs)
{
Model csg_model_a = new Model(lhs);
Model csg_model_b = new Model(rhs);
Node a = new Node(csg_model_a.ToPolygons());
Node b = new Node(csg_model_b.ToPolygons());
List<Polygon> polygons = Node.Union(a, b).AllPolygons();
return new Model(polygons);
}
public static Model Subtract(GameObject lhs, GameObject rhs)
{
Model csg_model_a = new Model(lhs);
Model csg_model_b = new Model(rhs);
Node a = new Node(csg_model_a.ToPolygons());
Node b = new Node(csg_model_b.ToPolygons());
List<Polygon> polygons = Node.Subtract(a, b).AllPolygons();
return new Model(polygons);
}
public static Model Intersect(GameObject lhs, GameObject rhs)
{
Model csg_model_a = new Model(lhs);
Model csg_model_b = new Model(rhs);
Node a = new Node(csg_model_a.ToPolygons());
Node b = new Node(csg_model_b.ToPolygons());
List<Polygon> polygons = Node.Intersect(a, b).AllPolygons();
return new Model(polygons);
}