Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Relative path failure in CSG export on Windows #4401

Open
rwb27 opened this issue Oct 27, 2022 · 0 comments
Open

Relative path failure in CSG export on Windows #4401

rwb27 opened this issue Oct 27, 2022 · 0 comments

Comments

@rwb27
Copy link

rwb27 commented Oct 27, 2022

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant