Belfry OpenSCAD Library (BOSL2) Brings Useful Parts And Tools Aplenty

OpenSCAD has a lot of fans around these parts — if you’re unaware, it’s essentially a code-based way of designing 3D models. Instead of drawing them up in a CAD program, one writes a script that defines the required geometry. All that is made a little easier with the Belfry OpenSCAD Library (BOSL2).

Designing a part like this is a cinch with BOSL2.

BOSL2 has an extensive library of base shapes, advanced functions for manipulating models, and some really nifty tools for creating attachment points on parts and aligning components with one another. If that sounds handy for designing useful objects, you’re in for even more of a treat when you see their functions for gears, hinges, screws, and more.

There’s even one that covers bottle necks and caps. (Those are all standardized by the way, so it’s never been easier to interface to existing bottles or caps in a project.)

OpenSCAD really is very versatile software. It powers useful tools like this screw, washer, and nut generator as well as having more unusual applications like a procedural terrain generator. It’s free, so if you’ve never looked into it, check it out!

16 thoughts on “Belfry OpenSCAD Library (BOSL2) Brings Useful Parts And Tools Aplenty

        1. Geeze,

          “WARNING: The process is not deterministic, for some models it needs to be converted several times in order to get the proper results!”

          That’s certainly confidence inspiring……

          I’ve had the odd look at OpenSCAD. Can genuinely say, I don’t understand the fascination.

          I opened the screw file from the library. Or tried to. It took a significant amount of time just to open, and then the display was blank.

          At my age, I’m really not looking for another rabbit hole.

          Judos to those enthusiasts who make it sing.

          chris

          P.S.

          So every time I post one of these, it asks me to log in or provide email to leave a reply. I’ve done so several times turning on the “Save my name, email …” selection, and yet here I am entering the same info, yet again.

          Would someone please direct me to the magic decoder ring so I can set up an account?

          Thanks

  1. Geometry generated by BOSL2 gets complex rather quickly, so it’s much more usable with git version of OpenSCAD, which has new fast manifold backend that can be enabled and sometimes speeds up rendering by factor of 1000. I really hope they will release it soon, because the latest release (2021) is very slow compared to it. Especialy when processing all the fancy shapes BOSL2 can generate.

    Another problem is that just syntacticaly parsing the BOSL2 library takes second or two. It has over 71k LoC, so it’s far from instant render. I wish OpenSCAD could cache the libraries in memory or something…

  2. not trying to talk anyone out of using it, but from my perspective it’s just like OOP for software. for example, if you go digging around on CPAN (perl object library), there are some modules that are a thousand lines of interface code for a function that was only one or two lines of native perl in the first place. or there are thousands of people investing enormous energy into learning react.js when what they want is actually much easier with css. on and on, we see this pattern. i’d rather learn how to use the tools that openscad provides than spend just as many hours trying to understand the dozens of parameters that must go into some of these reusable models.

    i used to think i’d want a library if i ever made gears but i recently made a helical gear just to find out if i could, and actually it was pretty easy. i wound up just making a straight-cut gear and iterating the layers with an offset using “for”. when i started using openscad 10 years ago, that sort of thing seemed really intimidating, not least because openscad was so slow at that kind of operation. but today it’s pretty easy.

    definitely not trying to malign this project! really it’s just fascinating to me that openscad is enough like coding software that it introduces this OOP-or-not cultural question just like C does. a big part of why i love openscad is that i felt at home in it from day one, and this is just a part of that story

    1. An advantage of BOSL2 is that the standards are baked in. If you need a gear the BOSL2 library already produces an involute profile, so you get an efficient, strong gear for minimal effort, and one that you already know will properly mesh with a similarly pitched gear bought off the shelf from McMaster-Carr.

      Not that you can’t or shouldn’t write one for yourself! For example I find the challenge of designing a screw thread to be fascinating. But all things being equal when it comes to interoperability I’d rather use a tested design than to have to rewrite all the code and tests.

  3. After spending a while using OpenSCAD without any libraries, I eventually stumbled across the original BOSL. I didn’t use it so much for the fancier parts, but just for user-friendly shortcuts to moving parts around, making shapes offset in specific directions, etc.

    Having used BOSL2 for the last few projects, it’s even better. I still haven’t touched any of the really fancy stuff, but having shortcuts for things like tubes, and filleted cubes, and being able to use human readable names to move parts instead of having to think about each translate() I encounter, has just made it all that much easier. Especially when it comes to picking a project back up later.

    Sure, I still can do (and have done) plain OpenSCAD. But a good chunk of what I use BOSL2 for, I’d probably end up making my own library for anyway. So why not use it? Somebody else has already solved the problems with more thought and energy into them than I would have.

    1. “I’d probably end up making my own library for anyway.” that’s probably a big part of why i’ve never wanted something like BOSL. right away i made a library with just a few extra primitives. a cube that’s centered in x-y, a cube with different bottom and top dimensions analogous to cylinder’s r1/r2, a torus, and a squarus (really, a tube), and an ngon. each one is just like 5 lines of code tops. just gives me a few more idioms.

      hahah reminds me..i ought to make a rotated cylinder to use as a primitive so that i don’t have to ‘discover’ each time whether you have to use rotate([0,90,0]) or rotate([0,-90,0]) to have a cylinder extending into +x

    2. openscad = openscad + BOSL2 !

      When I design a part for 3D printing the first thing I do is “include <BOSL2/std.scad> followed by some module templates I have used.

      I don’t use the fancy libraries much. I work interactively and BOSL2 allows me to say simple clear things like “xcyl(d=77,h=10)” instead of “rotate([0,90,0]) cylinder(d=77,h=10,center=true)” or “left(30)” instead of “translate([30,0,0])”.

      Anchors are real time saving but I find I rarely use attachments.

      The del system is moderately better than delete(){mod1,mod2). I used to use del and tags a lot but now I tend to use my own negative modules.

      For me, BOSL2 is now just part of Openscad. Try it and give it the love it deserves.

      PS – What is wrong with it?
      1. It is big. Does that mean it is bloated? Maybe – I only use a small part of it so for my use case you could say it is a bit bloated.

      Try some of the other libraries. In specific cases these are smaller and better than BOSL2.
      Having a library means you have to install it and raises the worry that one day it will go away.
      It helps, but doesn’t really solve, Openscad’s perennial problems of fillets, chamfers and introspection.

  4. OpenSCAD has some really great community and ecosystem support, I wonder why none of the alternatives seem to be getting as popular, especially the SDF based stuff that can do fillets easily?

    I still use it when I need to make something more parametric than FreeCAD easily allows, but it is by far the most difficult to use of all the software that I actually use IRL.

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.