You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I just tried to export a CSG file using the command line, and found a surprising behaviour:
openscad openscad/file.scad -o builds/file.csg
produces an error Can't open file "builds/file.csg" for export.
Using just file.csg places the file in openscad/ rather than the current directory as I expected. So, this makes me think that it's being interpreted as a path relative to the input file, rather than relative to the current directory. However, other export formats interpret it relative to the current directory - and if I specify it as a relative path (../builds/file.csg) it fails because that is not a valid directory (relative to the current working dir).
I suspect the problem is that the CSG export code interprets the path relative to the input file, rather than relative to the working directory, but that the rest of the code (including other export formats) does the latter. A quick glance at the codebase (I am very much not familiar with it) suggests that the export code for CSG does not live in the same place as the export code for other formats, so I could well believe it works a bit differently.
Specifying an absolute path to the output works, which would be consistent with evaluating the path relative to an inconsistent place. That also means I can work around it easily enough, by just always specifying absolute paths. It's perhaps a little inelegant, but won't slow us down.
This occurs with OpenSCAD 2021.1 on both Windows 10 and Ubuntu 20 (in WSL2).
The text was updated successfully, but these errors were encountered:
I just tried to export a CSG file using the command line, and found a surprising behaviour:
produces an error
Can't open file "builds/file.csg" for export
.Using just
file.csg
places the file inopenscad/
rather than the current directory as I expected. So, this makes me think that it's being interpreted as a path relative to the input file, rather than relative to the current directory. However, other export formats interpret it relative to the current directory - and if I specify it as a relative path (../builds/file.csg
) it fails because that is not a valid directory (relative to the current working dir).I suspect the problem is that the CSG export code interprets the path relative to the input file, rather than relative to the working directory, but that the rest of the code (including other export formats) does the latter. A quick glance at the codebase (I am very much not familiar with it) suggests that the export code for CSG does not live in the same place as the export code for other formats, so I could well believe it works a bit differently.
Specifying an absolute path to the output works, which would be consistent with evaluating the path relative to an inconsistent place. That also means I can work around it easily enough, by just always specifying absolute paths. It's perhaps a little inelegant, but won't slow us down.
This occurs with OpenSCAD 2021.1 on both Windows 10 and Ubuntu 20 (in WSL2).
The text was updated successfully, but these errors were encountered: