From 63458b4c2b83988da2259dab7456b705c731ce85 Mon Sep 17 00:00:00 2001 From: Nils Schmidt Date: Mon, 19 Aug 2024 21:03:16 +0200 Subject: [PATCH] Fixed issue #624. --- src/org/nschmidt/csg/CSG.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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); } /**