Skip to content

Commit dd6e16a

Browse files
zhaozhiwenclaude
andcommitted
Stop mutating dirLocation while importing CAD files
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__<variation>.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 <noreply@anthropic.com>
1 parent 48f83e5 commit dd6e16a

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

gemc/gsystem/gsystemFactories/cad/loadGeometry.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ void GSystemCADFactory::loadGeometry(GSystem* s) {
2626

2727
// Import each STL as a volume. Each volume name is derived from the filename.
2828
for (const auto& cf : cadFiles) {
29-
s->addVolumeFromFile(GSYSTEMCADTFACTORYLABEL, dirLocation.append("/").append(cf));
29+
s->addVolumeFromFile(GSYSTEMCADTFACTORYLABEL, dirLocation + "/" + cf);
3030
}
3131

3232
// If the file cad__<variation>.yaml is found in dirLocation, modify the gvolumes accordingly.

0 commit comments

Comments
 (0)