The Noble Effort To Put OpenSCAD In The Browser

In a world of CAD packages with arcane or unfriendly interfaces there’s a stand-out player that’s remarkable because it has no interface. OpenSCAD is a CAD package for coders, in which all design elements are created in a scripting language rather than graphically. It’s maybe not for everyone but it has a significant following, and its reach has been extended further as you can now run it from within a modern web browser.

The origins of this project can be tracked back to August of 2021, when when Autodrop3D’s [mmiscool] offered a sizable bounty for anyone willing to port the parametric CAD modeler to web assembly. Developer [Dominick Schroer] ultimately answered the call with openscad-wasm, which implements the core of OpenSCAD as a JavaScript ES6 module. From there, it just needed to get paired with a user interface, and off to the cloud we go.

Opening it up and giving it a go, we found it to be a very usable OpenSCAD version, albeit a little slower to render than the desktop equivalent on a mediocre laptop. We didn’t try exporting and printing an STL, but so far it has given us no reason to believe it wouldn’t be every bit as useful as the version you’re used to.

But wait, there’s more! Parallel to this effort, [Olivier Chafik] has also been working on his own idea of what OpenSCAD in the web should be. He’s using the same core developed by [Dominick], but has combined it with the Monaco editor from Microsoft and a Javascript STL viewer. Despite being very similar, we’re happy to report there’s no rivalry here; in fact, according to the video after the break, it sounds like two the projects have already swapped a bit of code.

The move among desktop applications to move into the browser and often into a pay-to-play cloud has seemed relentless over recent years, so it’s pleasing to see a rare example of a browser migration that’s open-source. It has the handy effect of bringing the CAD package to platforms such as tablets or Chromebooks which wouldn’t normally be an OpenSCAD platform, and this we like, a lot.

Continue reading “The Noble Effort To Put OpenSCAD In The Browser”

An OpenSCAD Library For All Your CNC Cutting Needs

While there’s always the edge case, there’s a strong likelihood that if you’re using OpenSCAD, you’re probably working on a CAD model that you intend to 3D print at some point. Of course that’s not to say this is all you can do in OpenSCAD, but it’s arguably what it does best. If you wanted to make artistic models, or maybe render what your new kitchen will look like, there are other tools better suited to such tasks.

But thanks to lasercut.scad, a library that [Brendan Sleight] has been working on for the last several years, we might have to reconsider our preconceived dimensional notions. Instead of designing parts for 3D printing, his library is all about creating parts intended for subtractive manufacturing. Originally (as the name implies) it was geared towards laser cutting, but the project has since evolved to support CNC routers, vinyl cutters, and pretty much anything else that can follow a DXF file.

This “clip” joint is great for acrylic.

The library has functions for creating the standard tricks used to build things from laser-cut pieces, like finger joints, captive nuts, and assembly tabs. If it was something you once saw holding together an old wooden 3D printer kit back in the day, you can probably recreate it with lasercut.scad. It even supports a pretty wild piece of rotational joinery, courtesy of [Martin Raynsford].

Don’t have a way of concentrating a sufficient number of angry photons at your workpiece? No worries. The library has since been adapted to take into account a parametric kerf width, which lets you dial in how much of a bite your particular tool will take from the material when it does the business. There are even special functions for dealing with very thin cuts, which [Brendan] demonstrates by assembling a box from sheet vinyl.

Of course, those who’ve used OpenSCAD will know there’s not an “Export for CNC” button anywhere in the stock interface. So to actually take your design and produce a file your cutter can understand, [Brendan] has included a Bash script that will run the necessary OpenSCAD incantations to produce a 2D DXF file.

[Brendan] decided to send this one in after he saw the aluminum enclosure OpenSCAD library we covered recently. If you’ve got your own pet project that bends some piece of hardware or software to your will, don’t be shy to let us know.

Planning Custom Aluminum Enclosures With OpenSCAD

We’ve seen a number of projects over the years that let you create custom enclosures using OpenSCAD, and for good reason. The parametric CAD tool is ideal for generating 3D models based on user-adjustable variables, and if you leverage its integrated Customizer, producing a bespoke box is as easy as moving some sliders around. The resulting files get sent off to the 3D printer, and you’re set. But what if you’re looking for a custom enclosure that’s not so…plastic?

In that case, AlClosure by [0xPIT] might be the answer. Rather than generating STL files intended for your 3D printer, the code is written to help you design an enclosure made from aluminum sheets. The top and bottom panels are intended to be cut from 1.5 mm – 2.5 mm sheets, while the sides are made from thicker 5 mm – 8 mm stock to accept a machined pocket that holds the front and rear inserts.

Since it’s OpenSCAD, much of the design is governed by variables which you can tweak. Obviously the outside dimensions of the enclosure can be changed in a flash, but it’s just as easy to modify the thickness of the aluminum sheet being used, or the size of the screw holes. [0xPIT] has also done a great job of documenting the code itself, so you’ll know exactly what you’re modifying.

Obviously, you’ll need the ability to cut and machine aluminum to actually utilize this project. The code itself is really just a way to conceptualize the design and get your dimensions figured out ahead of time. But as we were recently reminded by the keynote presentation [Jeremy Fielding] gave at the 2021 Remoticon, this sort of early prototyping can often save you a lot of headaches down the line.

Guide To Mastering OpenSCAD Costs Roughly The Same As OpenSCAD

OpenSCAD is a fantastic free tool for 3D modeling, but it’s far less intuitive to use for non-programmers than mouse-driven programs such as Tinkercad. Powerful as it may be, the learning curve is pretty steep. OpenSCAD’s own clickable cheat sheet and manual comes in handy all the time, but those are really more of a reference than anything else. Never fear, because [Jochen Kerdels] had quite the productive lockdown and wrote a free comprehensive guide to mastering OpenSCAD.

[Jochen]’s book opens with a nice introduction to OpenSCAD and it’s user environment and quickly moves into 10 useful projects of increasing complexity that start with simple stuff like wall anchors and shelf brackets and ends with recursive trees.

There are plenty of printing tips along the way to help realize these projects with minimum frustration, and the book wraps up by covering extra functions not expressly used in the projects.

Of course, you could always support [Jochen]’s Herculean effort by buying the print edition and forcing yourself to type everything in instead of copy/pasting, or give it to someone to introduce them to all the program has to offer.

Need help mastering OpenSCAD workflow? We’ve got that. Just want to make some boxes or airfoils? We have those in stock, too.

Main and thumbnail images via [Devlin Thyne]

Big Clive Hacks LED Bulbs With OpenSCAD

After accidentally crushing the plastic envelope on a cheap LED light bulb, [bigclivedotcom] figured out he could make custom ones using OpenSCAD in any shape he wants. He previously hacked a bunch of these inexpensive LED bulbs last month, discovering they all shared a similar circuit topology. All the ones he experimented with drove the LEDs hard, something that’s bound to reduce bulb lifetime. By reverse engineering the current control regulator, it turns out it is easy to adjust the drive current by changing a resistor or two. Reducing the current should not only increase lifetime, but could allow repurposing the bulb for other uses, such as decorative lighting.

Tweaking the LED Current

Three OpenSCAD scripts are provided which generate what he calls diamond, obelisk, and globe styles. Basic parameters for each style can be tweaked by the user, such as feature sizes and number of facets. He mentions the lack of OpenSCAD customizers in his script — this can easily be added as shown in the following example (this section of the User Manual on customizers explains the syntax). Note that you can’t make the slider generate real numbers, only whole numbers, which is why the scaling factor is multiplied by 10.

Adding Parameter Customization Sliders is Easy

These fancy globes can be used as night lights and possibly outdoor lighting, if you can make a good seal with the base. Custom chandeliers, anyone? Indicator lamps for very large panels? Any other ideas? If you want to explore the LED lifetime issue further, inveterate tinkerer Ted Yapo wrote a deep dive into the mythical 100,000 hour LED bulb. Thanks to [Cliff Claven] for the tip.

Continue reading “Big Clive Hacks LED Bulbs With OpenSCAD”

Micro Quadcopter Designed In OpenSCAD

Quadcopters are fantastical things, and now come in a huge variety of flavours, from lithe featherweight racers to industrial-grade filming rigs worth tens of thousands of dollars. The Beatle-1 from [masterdezign] comes in at the smaller scale, and its body was created entirely in code.

To create the Beatle-1, [masterdezign] used OpenSCAD, a 3D modelling program that uses code rather than visual tools for producing geometry. Thus, with a series of Boolean operations, extrusions and rotations, a basic lightweight quadcopter frame is created in a handful of lines of text. Then, it’s just a simple job of 3D printing the parts, wiring up four Olimex F1607 motors and hooking up a flight controller and the little drone is ready for takeoff.

The Beatle-1 serves as not only a fun flying toy but also a great example of applying OpenSCAD modelling techniques to real-world applications. Parts are available on Thingiverse for those wishing to roll their own. 3D printed drone frames are popular, and we’ve seen a few around these parts before. Video after the break.

Continue reading “Micro Quadcopter Designed In OpenSCAD”

OpenSCAD Prints Woodworking Aid

Home-based 3D printing is getting pretty unremarkable. Sure, printers aren’t as ubiquitous as, say, PCs. But you wouldn’t be any more surprised if your neighbor had a 3D printer than if you found out they had a drill press. In fact, sometimes the real value of 3D printing something isn’t to make a working part, but to make up something that helps you create other things using methods other than printing. That’s exactly what [iqless] does when he uses his printer to make some jigs to help him easily build shelves. (Video, embedded below.)

The issue is making dowel joints for the shelve’s feet. Sure, you could just drill a piece of scrap wood as a template, but with a 3D printer you can do better. Using OpenSCAD, it is possible to create a parameterized jig that fits exactly the job at hand.

Continue reading “OpenSCAD Prints Woodworking Aid”