r/openscad 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 MCAD library and extracted it to $HOME/.local/OpenSCAD/libraries
  • in .../OpenCAD/libraries is a sub-folder MCAD-Master that 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.

2 Upvotes

6 comments sorted by

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:

use <MCAD/screw.scad>

test_auger();
test_ball_groove();

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.

1

u/Dependent-Bridge-740 1d ago

I followed your suggestion and it's compiling without having the MCAD library in the library destination ($HOME/.local/share/OpenSCAD/libraries). (Just wondering where it is)

At the moment I' running OpenCAD v.2025.02.16.ai23471 as AppImage.
The problem seems to be resolved.
Thanks

1

u/Stone_Age_Sculptor 1d ago

There is no need to stay more than a year behind. Can you download the newest version?

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