public Csgjs Union(Csgjs csg) { if (Polygons.Count == 0) { return(csg.Clone()); } if (csg.Polygons.Count == 0) { return(Clone()); } var a = new CsgNode(Clone().Polygons); var b = new CsgNode(csg.Clone().Polygons); a.ClipTo(b); b.ClipTo(a); b.Invert(); b.ClipTo(a); b.Invert(); a.Build(b.AllPolygons()); return(FromPolygons(a.AllPolygons())); }
public void Invert() { for (int i = 0; i < Polygons.Count; i++) { Polygons[i].Flip(); } Plane.Flip(); Front?.Invert(); Back?.Invert(); var temp = Front; Front = Back; Back = temp; }