-
Notifications
You must be signed in to change notification settings - Fork 147
Home
Revar Desmera edited this page May 7, 2025
·
3 revisions
- Index by File (Table of Contents)
- Index by Function/Module Name
- Index by Topic
- Usage Cheat Sheet
- List of Tutorials
The BOSL2 library is an enormous library that provides many different kinds of capabilities to simplify the development of models in OpenSCAD, and to make things possible that are difficult in native OpenSCAD. Some of the things BOSL2 provides are:
-
Shorthands. The shorthands make your code a little shorter, and more importantly, they can make it significantly easier to read. Compare
up(x)
totranslate([0,0,x])
. The shorthands include operations for creating copies of objects and for applying transformations to objects, including rot() which extends rotate in some useful ways that are not easy to do directly. - Attachments. Unless you make models containing just one object the attachments features can revolutionize your modeling. They let you position components of a model relative to other components so you don't have to keep track of the positions and orientations of parts of the model. You can instead place an something on the TOP of something else, perhaps aligned to the RIGHT. For a full introduction to attachments, consult the Attachments Tutorial.
- Rounding and filleting. Rounding and filleting is hard in OpenSCAD. The library provides modules like cuboid() to make a cube with any of the edges rounded, offset_sweep() to round the ends of a linear extrusion, and prism_connector() which works with the attachments feature to create filleted prisms between a variety of objects, or even rounded holes through a single object. You can also use edge_profile() to apply a variety of different mask profiles to chosen edges of a cubic shape, or you can directly subtract 3d mask shapes from an edge of objects that are not cubes.
- Complex object support. The path_sweep() function/module takes a 2d polygon moves it through space along a path and sweeps out a 3d shape as it moves. You can link together a series of arbitrary polygons with skin() or vnf_vertex_array(). Support for beziers and NURBS can help you construct the building blocks you need. Metaballs can create organic surfaces that blend shapes together.
- Building Blocks. OpenSCAD provides cubes, cones and spheres. The BOSL2 library extends this to provide different kinds of prisms, tubes, and other abstract geometrical building blocks. In many cases the BOSL2 objects include options to round their edges. Basic objects have extensions like the ability to specify the inner radius of a circle to create holes with a guaranteed minimum size.
- Texturing. Many kinds of objects can be created with textures applied. This can create knurling, but it can do much more than that. A texture can be any repeating pattern, and applying a texture can actually replace the base object with something different based on repeating copies of the texture element. A texture can also be an image; using texturing you can emboss an arbitrary image onto your model.
- Parts library. The parts library includes many useful specific functional parts including gears, generic threading, and specific threading to match plastic bottles, pipe fittings, or standard screws. Also included are clips, hinges, and dovetail joints.
- Geometrical operations on data. In OpenSCAD, geometrical operations happen on geometry, and information can never be extracted from geometry. The BOLS2 library provides operations on 2d point lists (called "paths" or "regions") to make rounded paths from ones with corners or do operations like intersection and offset. It can also do some limited operations on three dimensional data.
- Programming aids. The library provides basic mathematical operations including solutions to linear systems of equations and generic and polynomial numerical root finding. It provides geometrical operations like line intersection or circle intersection, coordinate transformations, string manipulation, and list processing.
- Download the .zip or .tar.gz release file for this library. Currently you should be able to find this at https://github.com/BelfrySCAD/BOSL2/archive/refs/heads/master.zip
- Unpack it. Make sure that you unpack the whole file structure. Some zipfile unpackers call this option "Use folder names". It should create either a
BOSL-v2.0
orBOSL2-master
directory with the library files within it. You should see "examples", "scripts", "tests", and other subdirectories. - Rename the unpacked main directory to
BOSL2
. - Move the
BOSL2
directory into the apropriate OpenSCAD library directory. The library directory may be on the list below, but for SNAP or other prepackaged installations, it is probably somewhere else. To find it, run OpenSCAD and select Help→Library Info, and look for the entry that says "User Library Path". This is your default library directory. You may choose to change it to something more convenient by setting the environment variable OPENSCADPATH. Using this variable also means that all versions of OpenSCAD you install will look for libraries in the same location.- Windows:
My Documents\OpenSCAD\libraries\
- Linux:
$HOME/.local/share/OpenSCAD/libraries/
- Mac OS X:
$HOME/Documents/OpenSCAD/libraries/
- Windows:
- Restart OpenSCAD.
- Pathbuilder – SVG path string parsing.
- Attachable Text3d - FontMetrics aware attachable text for BOSL2.
- JL_SCAD - A Library to make enclosures for electronics projects, with BOSL2.
Table of Contents
Function Index
Topics Index
Cheat Sheet
Tutorials
Basic Modeling:
- constants.scad STD
- transforms.scad STD
- attachments.scad STD
- shapes2d.scad STD
- shapes3d.scad STD
- drawing.scad STD
- masks2d.scad STD
- masks3d.scad STD
- distributors.scad STD
- color.scad STD
- partitions.scad STD
- miscellaneous.scad STD
Advanced Modeling:
- paths.scad STD
- regions.scad STD
- skin.scad STD
- vnf.scad STD
- beziers.scad STD
- nurbs.scad
- rounding.scad
- turtle3d.scad
- isosurface.scad
Math:
- math.scad STD
- linalg.scad STD
- vectors.scad STD
- coords.scad STD
- geometry.scad STD
- trigonometry.scad STD
Data Management:
- version.scad STD
- comparisons.scad STD
- lists.scad STD
- utility.scad STD
- strings.scad STD
- structs.scad STD
- fnliterals.scad
Threaded Parts:
Parts:
- ball_bearings.scad
- cubetruss.scad
- gears.scad
- hinges.scad
- joiners.scad
- linear_bearings.scad
- modular_hose.scad
- nema_steppers.scad
- polyhedra.scad
- sliders.scad
- tripod_mounts.scad
- walls.scad
- wiring.scad
STD = Included in std.scad