diff --git a/src/org/nschmidt/csg/CSG.java b/src/org/nschmidt/csg/CSG.java index 4babc97b..b628496b 100644 --- a/src/org/nschmidt/csg/CSG.java +++ b/src/org/nschmidt/csg/CSG.java @@ -211,10 +211,11 @@ public CSG union(CSG csg) { throw new LDPartEditorException(ie); } - final List polygons = new ArrayList<>(c1.polygons); - polygons.addAll(c2.polygons); + final List unifiedPolygons = new ArrayList<>(c1.polygons.size() + c2.polygons.size()); + unifiedPolygons.addAll(c1.polygons); + unifiedPolygons.addAll(c2.polygons); - return CSG.fromPolygons(polygons); + return CSG.fromPolygons(unifiedPolygons); } /**