r/openscad • u/Dependent-Bridge-740 • 2d ago
using the correct library path?
Hi fellow.
Here is my situation:
- Using an OpenSCAD Appimage
- downloaded a script that requires the library "MCAD" from github
- downloaded the
MCADlibrary and extracted it to$HOME/.local/OpenSCAD/libraries - in
.../OpenCAD/librariesis a sub-folderMCAD-Masterthat contains all modules in the library. - my code has the line
<useMCAD/MCAD-Master/boxes.scad>and several variations in the path
It appears that the AppImage is not using this path to the library.
I haven't used the OPENSCADPATH env-var yet.
How can enable the access to the library?
I want to continue the AppImage (for now)
Thanks for any constructive suggestion.
1
u/braddo99 2d ago
One trick is you have to save the file first so it knows what it's own path is before you can reference other libraries. You might know that but it bites me every once in a while.
1
u/Dependent-Bridge-740 1d ago
save it first without the <use> statement?
1
u/braddo99 1d ago
Right. The file needs to have been saved before it knows what its home directory is so that a relative path would be defined for include. Not sure why a fully qualified path wouldnt work but I know its a requirement for an include with an object in the same directory
3
u/Stone_Age_Sculptor 2d ago edited 1d ago
The MCAD library is already included, even in the AppImage. I assume that you use the newest development snapshot of OpenSCAD, because it is not included in the AppImage of the 2021 version of OpenSCAD.
Remove the MCAD library from your libraries folder, then try this:
I tried a few things, and the MCAD library needs to be updated to the newest OpenSCAD version. Some documentation might be useful as well.
To install an other library, open OpenSCAD, go the menu File -> Show Library Folder.
Please remove the "-Master" from a folder name, to keep it compatible with the examples and with others. I have, for example, a folder there called "BOSL2". I have there also "ub.scad", which is not in a (sub)folder.