From fa5b6d79295daacbe0ae2ad61d60f48293a842e6 Mon Sep 17 00:00:00 2001 From: Alex Shvartzkop Date: Tue, 25 Jun 2024 14:56:33 +0300 Subject: [PATCH] If there's a single shape in fuseShapesOrCompound input, just return it. --- pcbnew/exporters/step/step_pcb_model.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pcbnew/exporters/step/step_pcb_model.cpp b/pcbnew/exporters/step/step_pcb_model.cpp index 01d8ce2531..7ce111d9e5 100644 --- a/pcbnew/exporters/step/step_pcb_model.cpp +++ b/pcbnew/exporters/step/step_pcb_model.cpp @@ -673,10 +673,13 @@ static TopoDS_Compound makeCompound( auto& aInputShapes ) // Try to fuse shapes. If that fails, just add them to a compound -static TopoDS_Shape fuseShapesOrCompound( auto& aInputShapes ) +static TopoDS_Shape fuseShapesOrCompound( TopTools_ListOfShape& aInputShapes ) { TopoDS_Shape outShape; + if( aInputShapes.Size() == 1 ) + return aInputShapes.First(); + if( fuseShapes( aInputShapes, outShape ) ) return outShape;