The Belfry OpenScad Library, v2.0. An OpenSCAD library of shapes, masks, and manipulators to make working with OpenSCAD easier. BETA
Find a file
Revar Desmera cf58ee6f33
Merge pull request #484 from revarbat/revarbat_dev
Replace most trivial uses of slice() with faster list_head() and list…
2021-03-25 16:46:53 -07:00
.github Force 'sudo apt update' in linux workflow. 2021-03-12 21:54:56 -08:00
examples Corrected bezier patches example. 2021-01-19 04:51:28 -08:00
images Added logo to README. 2020-12-30 15:44:17 -08:00
scripts Added script to shrink wiki repo to just current files. 2021-02-24 16:42:09 -08:00
tests Replace most trivial uses of slice() with faster list_head() and list_tail() 2021-03-25 00:23:36 -07:00
tutorials Bottom half example fix. 2020-12-29 21:23:02 -08:00
.gitignore Added version.scad 2019-11-05 13:33:48 -08:00
.openscad_gendocs_rc Added Topics/SeeAlso to affine, arrays, attachments, beziers, common, constants, gears 2021-03-01 22:44:00 -08:00
affine.scad Added Topics/SeeAlso to affine, arrays, attachments, beziers, common, constants, gears 2021-03-01 22:44:00 -08:00
arrays.scad Replace most trivial uses of slice() with faster list_head() and list_tail() 2021-03-25 00:23:36 -07:00
attachments.scad Fixes for various example bugs. 2021-03-16 14:46:11 -07:00
beziers.scad Replace most trivial uses of slice() with faster list_head() and list_tail() 2021-03-25 00:23:36 -07:00
bosl1compat.scad Standardize indention on spaces, not tabs. 2020-05-29 19:04:34 -07:00
bottlecaps.scad Enable taper and better higbee in thread_helix() 2021-01-31 15:43:50 -08:00
common.scad further type checking fixes 2021-03-14 12:08:20 -04:00
constants.scad Removed erronerous DefineHeader from constants.scad. 2021-03-02 00:40:17 -08:00
CONTRIBUTING.md fixed modulated_circle() to work as advertised 2020-12-01 23:56:57 +01:00
coords.scad Added dashed_stroke(). path_cut() -> path_cut_points(). 2021-03-06 02:26:39 -08:00
cubetruss.scad Re-work to use openscad_docsgen package. 2021-02-19 19:56:43 -08:00
debug.scad Re-work to use openscad_docsgen package. 2021-02-19 19:56:43 -08:00
distributors.scad Replace most trivial uses of slice() with faster list_head() and list_tail() 2021-03-25 00:23:36 -07:00
edges.scad Improved docs gen script for Returns:, Custom:, Includes:, Topics:, and positional/named args spits. 2021-01-05 01:20:01 -08:00
gears.scad Fixed worm() face normals. 2021-03-15 15:14:10 -07:00
geometry.scad Added dashed_stroke(). path_cut() -> path_cut_points(). 2021-03-06 02:26:39 -08:00
hingesnaps.scad Re-work to use openscad_docsgen package. 2021-02-19 19:56:43 -08:00
hull.scad hull 2d tweak 2021-03-05 20:39:15 -05:00
joiners.scad Re-work to use openscad_docsgen package. 2021-02-19 19:56:43 -08:00
knurling.scad Corrected knurling.scad Includes. 2021-01-05 01:54:15 -08:00
LICENSE Updated copyright years. Split math.scad up. Enabled attach for lots of shapes. Removed backwards compatability. 2019-04-19 17:02:17 -07:00
linear_bearings.scad Fixes for various example bugs. 2021-03-16 14:46:11 -07:00
masks.scad Bugfix for rounding in cylinder_mask() 2021-03-16 23:31:11 -07:00
math.scad Replace most trivial uses of slice() with faster list_head() and list_tail() 2021-03-25 00:23:36 -07:00
metric_screws.scad Added docs Aliases. Fixed repeat of screw() 2021-02-24 14:09:11 -08:00
modular_hose.scad Re-work to use openscad_docsgen package. 2021-02-19 19:56:43 -08:00
mutators.scad Re-work to use openscad_docsgen package. 2021-02-19 19:56:43 -08:00
nema_steppers.scad Improved docs gen script for Returns:, Custom:, Includes:, Topics:, and positional/named args spits. 2021-01-05 01:20:01 -08:00
partitions.scad Fixes for various example bugs. 2021-03-16 14:46:11 -07:00
paths.scad Fix typo in assemble_a_path_from_fragments() 2021-03-25 00:29:52 -07:00
phillips_drive.scad Improved docs gen script for Returns:, Custom:, Includes:, Topics:, and positional/named args spits. 2021-01-05 01:20:01 -08:00
polyhedra.scad Re-work to use openscad_docsgen package. 2021-02-19 19:56:43 -08:00
primitives.scad Reworked docs for primitives.scad and shapes2d.scad 2021-02-25 02:16:55 -08:00
quaternions.scad Re-work to use openscad_docsgen package. 2021-02-19 19:56:43 -08:00
queues.scad Improved docs gen script for Returns:, Custom:, Includes:, Topics:, and positional/named args spits. 2021-01-05 01:20:01 -08:00
README.md involute_gears.scad -> gears.scad 2021-03-01 01:29:41 -08:00
regions.scad Replace most trivial uses of slice() with faster list_head() and list_tail() 2021-03-25 00:23:36 -07:00
rounding.scad Replace most trivial uses of slice() with faster list_head() and list_tail() 2021-03-25 00:23:36 -07:00
screws.scad Merge pull request #434 from revarbat/revarbat_dev 2021-02-21 21:25:06 -08:00
shapes.scad Re-work to use openscad_docsgen package. 2021-02-19 19:56:43 -08:00
shapes2d.scad Replace most trivial uses of slice() with faster list_head() and list_tail() 2021-03-25 00:23:36 -07:00
skin.scad Added subdivide_long_segments(), path_add_jitter(), jittered_poly() 2021-03-17 18:27:10 -07:00
sliders.scad Improved docs gen script for Returns:, Custom:, Includes:, Topics:, and positional/named args spits. 2021-01-05 01:20:01 -08:00
stacks.scad Improved docs gen script for Returns:, Custom:, Includes:, Topics:, and positional/named args spits. 2021-01-05 01:20:01 -08:00
std.scad Improved docs gen script for Returns:, Custom:, Includes:, Topics:, and positional/named args spits. 2021-01-05 01:20:01 -08:00
strings.scad Fix function header typos interfering with docs generation. 2021-02-17 18:56:20 +01:00
structs.scad Improved docs gen script for Returns:, Custom:, Includes:, Topics:, and positional/named args spits. 2021-01-05 01:20:01 -08:00
threading.scad VNF re-re-write of trapezoidal_threaded_rod() 2021-02-04 05:39:00 -08:00
torx_drive.scad Improved docs gen script for Returns:, Custom:, Includes:, Topics:, and positional/named args spits. 2021-01-05 01:20:01 -08:00
transforms.scad more rot doc tweaks 2021-03-09 16:47:26 -05:00
triangulation.scad Improved docs gen script for Returns:, Custom:, Includes:, Topics:, and positional/named args spits. 2021-01-05 01:20:01 -08:00
turtle3d.scad Replace most trivial uses of slice() with faster list_head() and list_tail() 2021-03-25 00:23:36 -07:00
vectors.scad further type checking fixes 2021-03-14 12:08:20 -04:00
version.scad Bump release version. 2021-03-20 11:06:37 +00:00
vnf.scad Fixed vnf.scad includes docs. 2021-03-18 19:39:03 -07:00
walls.scad Improved docs gen script for Returns:, Custom:, Includes:, Topics:, and positional/named args spits. 2021-01-05 01:20:01 -08:00
wiring.scad Improved docs gen script for Returns:, Custom:, Includes:, Topics:, and positional/named args spits. 2021-01-05 01:20:01 -08:00
WRITING_DOCS.md Rework of docs for transforms.scad and affine.scad. Fix for #439. 2021-02-26 13:07:11 -08:00

BOSL2

BOSL2 Logo

The Belfry OpenScad Library, v2

A library for OpenSCAD, filled with useful tools, shapes, masks, math and manipulators, designed to make OpenSCAD easier to use.

  • NOTE: BOSL2 IS PRE-ALPHA CODE. THE CODE IS STILL BEING REORGANIZED.
  • NOTE2: CODE WRITTEN FOR BOSLv1 PROBABLY WON'T WORK WITH BOSL2!

Join the chat at https://gitter.im/revarbat/BOSL2 BOSL2 Docs

Installation

  1. Download the .zip or .tar.gz release file for this library.
  2. 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 or BOSL2-master directory with the library files within it. You should see "examples", "scripts", "tests", and other subdirectories.
  3. Rename the unpacked main directory to BOSL2.
  4. Move the BOSL2 directory into the apropriate OpenSCAD library directory for your platform:
    • Windows: My Documents\OpenSCAD\libraries\
    • Linux: $HOME/.local/share/OpenSCAD/libraries/
    • Mac OS X: $HOME/Documents/OpenSCAD/libraries/
  5. Restart OpenSCAD.

Terminology

For purposes of the BOSL2 library, the following terms apply:

  • Left: Towards X-
  • Right: Towards X+
  • Front/Forward: Towards Y-
  • Back/Behind: Towards Y+
  • Bottom/Down/Below: Towards Z-
  • Top/Up/Above: Towards Z+

Common Arguments:

Args What it is
rounding Radius of rounding for interior or exterior edges.
chamfer Size of chamfers/bevels for interior or exterior edges.
orient Axis a part should be oriented along. Given as an XYZ triplet of rotation angles. It is recommended that you use the ORIENT_ constants from constants.scad. Default is usually ORIENT_Z for vertical orientation.
anchor Side of the object that should be anchored to the origin. Given as a vector towards the side of the part to align with the origin. It is recommended that you use the directional constants from constants.scad. Default is usually CENTER for centered.

Examples

A lot of the features of this library are to allow shorter, easier-to-read, intent-based coding. For example:

BOSL2/transforms.scad Examples Raw OpenSCAD Equivalent
up(5) translate([0,0,5])
xrot(30,cp=[0,10,20]) translate([0,10,20]) rotate([30,0,0]) translate([0,-10,-20])
xspread(20,n=3) for (dx=[-20,0,20]) translate([dx,0,0])
zring(n=6,r=20) for (zr=[0:5]) rotate([0,0,zr*60]) translate([20,0,0])
skew_xy(xa=30,ya=45) multmatrix([[1,0,tan(30),0],[0,1,tan(45),0],[0,0,1,0],[0,0,0,1]])
BOSL2/shapes.scad Examples Raw OpenSCAD Equivalent
cube([10,20,30], anchor=BOTTOM); translate([0,0,15]) cube([10,20,30], center=true);
cuboid([20,20,30], fillet=5, edges=EDGES_Z_ALL); minkowski() {cube([10,10,20], center=true); sphere(r=5, $fn=32);}
prismoid([30,40],[20,30],h=10); hull() {translate([0,0,0.005]) cube([30,40,0.01], center=true); translate([0,0,9.995]) cube([20,30,0.01],center=true);}
xcyl(l=20,d=4); rotate([0,90,0]) cylinder(h=20, d=4, center=true);
cyl(l=100, d=40, fillet=5); translate([0,0,50]) minkowski() {cylinder(h=90, d=30, center=true); sphere(r=5);}
BOSL2/masks.scad Examples Raw Openscad Equivalent
chamfer_mask_z(l=20,chamfer=5); rotate(45) cube([5*sqrt(2), 5*sqrt(2), 20], center=true);
fillet_mask_z(l=20,fillet=5); difference() {cube([10,10,20], center=true); for(dx=[-5,5],dy=[-5,5]) translate([dx,dy,0]) cylinder(h=20.1, r=5, center=true);}
fillet_hole_mask(r=30,fillet=5); difference() {cube([70,70,10], center=true); translate([0,0,-5]) rotate_extrude(convexity=4) translate([30,0,0]) circle(r=5);}

The Library Files

The library files are as follows:

Basics (Imported via std.scad)

Math (Imported via std.scad)

Geometry (Imported via std.scad)

  • geometry.scad: Functions to find line intersections, circles from 3 points, etc.
  • edges.scad: Constants and functions to specify edges and corners.
  • vnf.scad: Vertices 'n' Faces structure to make creating polyhedron()s easier.
  • paths.scad: Functions and modules to work with arbitrary 3D paths.
  • regions.scad: Perform offsets and boolean geometry on 2D paths and regions.

Common (Imported via std.scad)

Processes

  • beziers.scad: Functions and modules to work with bezier curves.
  • threading.scad: Modules to make triangular and trapezoidal threaded rods and nuts.
  • rounding.scad: Functions to help rounding corners in a path.
  • knurling.scad: Masks and shapes to help with knurling.
  • partitions.scad: Modules to help partition large objects into smaller assembled parts.
  • rounding.scad: Functions and modules to create rounded paths and boxes.
  • skin.scad: Functions to skin surfaces between 2D cross-section paths.
  • hull.scad: Functions to create 2D and 3D convex hulls.
  • triangulation.scad: Functions to triangulate polyhedron() faces.
  • debug.scad: Modules to help debug polygons()s and polyhedron()s

Data Structures

  • strings.scad: String manipulation functions.
  • stacks.scad: Functions to manipulate stack data structures.
  • queues.scad: Functions to manipulate queue data structures.
  • structs.scad: Structure/Dictionary creation and manipulation functions.

Miscellaneous Parts

Documentation

The full library docs can be found at https://github.com/revarbat/BOSL2/wiki