OpenSCAD User Manual/Libraries - Wikibooks, open books for an open world (2024)

Contents

  • 1 Library locations
    • 1.1 Setting OPENSCADPATH
  • 2 MCAD
  • 3 Other libraries
  • 4 Other OpenSCAD tutorials and documentation

Library locations

[edit | edit source]

OpenSCAD uses three library locations, the installation library, built-in library, and user-defined libraries.

  1. The Installation library location is the libraries directory under the directory where OpenSCAD is installed.
  2. The Built-In library location is O/S dependent. Since version 2014.03, it can be opened in the system specific file manager using the "File->Show Library Folder..." menu entry.
    • Windows: My Documents\OpenSCAD\libraries
    • Linux: $HOME/.local/share/OpenSCAD/libraries
    • Mac OS X: $HOME/Documents/OpenSCAD/libraries
  3. The User-Defined library path can be created using the OPENSCADPATH Environment Variable to point to the library(s). OPENSCADPATH can contain multiple directories in case you have library collections in more than one place, separate directories with a semi-colon for Windows, and a colon for Linux/Mac OS. For example:
Windows: C:\Users\A_user\Documents\OpenSCAD\MyLib;C:\Thingiverse Stuff\OpenSCAD Things;D:\test_stuff
(Note: For Windows, in versions prior to 2014.02.22 there is a bug preventing multiple directories in OPENSCADPATH as described above, it uses a colon (:) to separate directories. A workaround, if your libraries are on C: is to leave off the drive letter & colon, e.g. \Thingiverse Stuff\OpenSCAD Things:\stuff. For more about setting Windows environment variables, see User Environment Variables.
Linux/Mac OS: /usr/lib:/home/mylib:.
OpenSCAD must be restarted to recognize any change to the OPENSCADPATH Environment Variable.

When you specify a non-fully qualified path and filename in the use <...> or include <...> statement OpenSCAD looks for the file in the following directories in the following order:

  • the directory of the calling .scad file
  • the User-Defined library paths (OPENSCADPATH)
  • the Built-In library (i.e. the O/S dependent locations above)
  • the Installation library

In the case of a library file itself having use <...> or include <...> the directory of the library .scad file is the 'calling' file, i.e. when looking for libraries within a library, it does not check the directory of the top level .scad file.

For example, with the following locations and files defined: (with OPENSCADPATH=/usr/lib:/home/lib_os:.)

1. <installation library>/lib1.scad2. <built-in library>/lib2.scad3. <built-in library>/sublib/lib2.scad4. <built-in library>/sublib/lib3.scad5. /usr/lib/lib2.scad6. /home/lib_os/sublib/lib3.scad

The following include <...> statements match to the nominated library files

include <lib1.scad> // #1.include <lib2.scad> // #5.include <sublib/lib2.scad> // #3.include <sublib/lib3.scad> // #6.

Since 2014.03, the currently active list of locations can be verified in the "Help->Library Info" dialog.

The details info shows both the content of the OPENSCADPATH variable and the list of all library locations. The locations are searched in the order they appear in this list. For example;

OPENSCADPATH: /data/lib1:/data/lib2OpenSCAD library path: /data/lib1 /data/lib2 /home/user/.local/share/OpenSCAD/libraries /opt/OpenSCAD/libraries

Setting OPENSCADPATH

[edit | edit source]

In Windows, Environment Variables are set via the Control panel, select System, then Advanced System Settings, click Environment Variables. Create a new User Variable, or edit OPENSCADPATH if it exists.

On Linux, to simply add the environment variable to all users, you can type in terminal:
sudo sh -c 'echo "OPENSCADPATH=$HOME/openscad/libraries" >>/etc/profile'
to set the OPENSCADPATH to openscad/libraries under each user's home directory. For more control on environment variables, you'll need to edit the configuration files; see for example this page.

On macOS, you can use launchctl to set the environment variable for the current logged in user:
launchctl setenv OPENSCADPATH "/Users/myuser/my/own/path"
The variable will be available the next time you launch OpenSCAD.

MCAD

[edit | edit source]

OpenSCAD bundles the MCAD library.

There are many different forks floating around (e.g.[1], [2], [3]) many of them unmaintained.

MCAD bundles a lot of stuff, of varying quality, including:

  • Many common shapes like rounded boxes, regular polygons and polyhedra in 2D and 3D
  • Gear generator for involute gears and bevel gears.
  • Stepper motor mount helpers, stepper and servo outlines
  • Nuts, bolts and bearings
  • Screws and augers
  • Material definitions for common materials
  • Mathematical constants, curves
  • Teardrop holes and polyholes

The git repo also contains python code to scrape OpenSCAD code, a testing framework and SolidPython, an external python library for solid cad.

More details on using MCAD are in a later chapter, OpenSCAD User Manual/MCAD.

Other libraries

[edit | edit source]

There is also a list with more libraries here: https://github.com/openscad/openscad/wiki/Libraries

Other OpenSCAD tutorials and documentation

[edit | edit source]

OpenSCAD User Manual/Libraries - Wikibooks, open books for an open world (2024)
Top Articles
What is going on at Northern Light?
Google Pay Österreich: 16 Anbieter - Stand August 2024
Spasa Parish
Rentals for rent in Maastricht
159R Bus Schedule Pdf
Sallisaw Bin Store
Black Adam Showtimes Near Maya Cinemas Delano
Espn Transfer Portal Basketball
Pollen Levels Richmond
11 Best Sites Like The Chive For Funny Pictures and Memes
Things to do in Wichita Falls on weekends 12-15 September
Craigslist Pets Huntsville Alabama
Paulette Goddard | American Actress, Modern Times, Charlie Chaplin
Red Dead Redemption 2 Legendary Fish Locations Guide (“A Fisher of Fish”)
What's the Difference Between Halal and Haram Meat & Food?
R/Skinwalker
Rugged Gentleman Barber Shop Martinsburg Wv
Jennifer Lenzini Leaving Ktiv
Justified - Streams, Episodenguide und News zur Serie
Epay. Medstarhealth.org
Olde Kegg Bar & Grill Portage Menu
Cubilabras
Half Inning In Which The Home Team Bats Crossword
Amazing Lash Bay Colony
Juego Friv Poki
Dirt Devil Ud70181 Parts Diagram
Truist Bank Open Saturday
Water Leaks in Your Car When It Rains? Common Causes & Fixes
What’s Closing at Disney World? A Complete Guide
New from Simply So Good - Cherry Apricot Slab Pie
Drys Pharmacy
Ohio State Football Wiki
Find Words Containing Specific Letters | WordFinder®
FirstLight Power to Acquire Leading Canadian Renewable Operator and Developer Hydromega Services Inc. - FirstLight
Webmail.unt.edu
2024-25 ITH Season Preview: USC Trojans
Metro By T Mobile Sign In
Restored Republic December 1 2022
Lincoln Financial Field Section 110
Free Stuff Craigslist Roanoke Va
Wi Dept Of Regulation & Licensing
Pick N Pull Near Me [Locator Map + Guide + FAQ]
Crystal Westbrooks Nipple
Ice Hockey Dboard
Über 60 Prozent Rabatt auf E-Bikes: Aldi reduziert sämtliche Pedelecs stark im Preis - nur noch für kurze Zeit
Wie blocke ich einen Bot aus Boardman/USA - sellerforum.de
Infinity Pool Showtimes Near Maya Cinemas Bakersfield
Dermpathdiagnostics Com Pay Invoice
How To Use Price Chopper Points At Quiktrip
Maria Butina Bikini
Busted Newspaper Zapata Tx
Latest Posts
Article information

Author: Dean Jakubowski Ret

Last Updated:

Views: 5805

Rating: 5 / 5 (50 voted)

Reviews: 81% of readers found this page helpful

Author information

Name: Dean Jakubowski Ret

Birthday: 1996-05-10

Address: Apt. 425 4346 Santiago Islands, Shariside, AK 38830-1874

Phone: +96313309894162

Job: Legacy Sales Designer

Hobby: Baseball, Wood carving, Candle making, Jigsaw puzzles, Lacemaking, Parkour, Drawing

Introduction: My name is Dean Jakubowski Ret, I am a enthusiastic, friendly, homely, handsome, zealous, brainy, elegant person who loves writing and wants to share my knowledge and understanding with you.