From dd6e16ae2433d2941b8490147e9bf033c10cc2c2 Mon Sep 17 00:00:00 2001 From: Zhiwen Zhao Date: Fri, 12 Jun 2026 23:41:21 -0400 Subject: [PATCH] Stop mutating dirLocation while importing CAD files MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The STL import loop used dirLocation.append("/").append(cf), which mutates dirLocation in place. After the first file, dirLocation was no longer the directory path — the second iteration produced paths like .../dir/a.stl/b.stl, so only the first STL resolved. The mangled value also leaked to line 33, where the per-variation cad__.yaml modifier path is built, so that override file was never found. Use non-mutating concatenation (dirLocation + "/" + cf) so dirLocation stays the directory path for every file and for the YAML lookup. Fixes #110 Co-Authored-By: Claude Fable 5 --- gemc/gsystem/gsystemFactories/cad/loadGeometry.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gemc/gsystem/gsystemFactories/cad/loadGeometry.cc b/gemc/gsystem/gsystemFactories/cad/loadGeometry.cc index e963957d..c51366c0 100644 --- a/gemc/gsystem/gsystemFactories/cad/loadGeometry.cc +++ b/gemc/gsystem/gsystemFactories/cad/loadGeometry.cc @@ -26,7 +26,7 @@ void GSystemCADFactory::loadGeometry(GSystem* s) { // Import each STL as a volume. Each volume name is derived from the filename. for (const auto& cf : cadFiles) { - s->addVolumeFromFile(GSYSTEMCADTFACTORYLABEL, dirLocation.append("/").append(cf)); + s->addVolumeFromFile(GSYSTEMCADTFACTORYLABEL, dirLocation + "/" + cf); } // If the file cad__.yaml is found in dirLocation, modify the gvolumes accordingly.