OpenSCAD is one of the most powerful 3d modeling applications around. Its beauty is in its simplicity; if you need a box, you can just write the code for a box. If you need some bit of plastic to keep your 3D printer running, you can just write the code for that bit of plastic. Like all programming languages, OpenSCAD is only really powerful if you have a huge back-catalog of various components ready for reuse. That’s where [Mark]’s library for hinged boxes comes in handy. Every type of box you would ever want to create, from boxes with covers, magnet closures, or cases for your glasses is easily accessible with just a few lines of code.
The work presented here is an OpenSCAD script to generate two-piece hinged boxes, with rounded corners, a lid, interlocking rims, and optional snap fit, magnet, or screw closures. As you would expect from OpenSCAD, everything in this script is parametric. You can change any measurement or simply delete entire sections of the box.
The included examples consist of a small mini-Altoids tin-sized ‘Bee Box’ with a snap-fit lid. All of the relevant dimensions of the snap-fit lid are variables. Other examples include an eyeglass case and a box for small parts storage that interlock. If you have a few rolls of filament, a lot of time on your hands, and want to organize your workbench, you could do worse than checking out a few of these OpenSCAD boxes.
I am a heavy user of OpenScad. So heavy that I have spent the time to develop an Excel front end for it. To create a mtodule you describe it in a few rows and columns that take care of object name, type, rotations, color, transparency, and translation. The excel macro takes care of making the openscad file. Module hierarchy is supported and, since it’s Excel, all the cell formula and references are there for you to use. I also embed the $t variable and can do animations in a flash!
Where is this miracle script?
I’m not sure about the best place to share it. Would this be the place or someplace else?
I just loaded it as a project in hackaday.io. https://hackaday.io/project/164331-rapid-3d-models-with-excel-and-openscad
Found it. No files in the project though…
Wondering too if you’re going to share your Excel FE.
It would be awesome!
Great. This could possibly come in really handy just at the right time. I will need a box in a few days to throw a µC and all sorts of thing in, but I don’t know how big it needs to be yet, so this looks perfect for me. I was way too lazy to design one myself and would’ve went to the local diy shop.
Would you mind sharing your template? Do you create one for each project? It sounds very useful and should help keeping track of the objects in a openscad file.
I keep hearing how amazing OpenSCAD is, but I am familiar enough to know that you need to know how to code to use it.
I have written basic Python scripts for just simple math for astronomical gear trains, and I can natively program in G-Code, but I would love an open source parametric modeler that worked similar to Fusion 360 without having to learn how to code in another fashion to create when I am already adept in creating solids.
I don’t mean to hurt anybody by asking here but could anyone recommend something as powerful as OpenSCAD but without coding? It seems like everything either goes proprietary and easy to use but a pay model however everyone who wants open source just has to settle to learn how to code to do anything and it’s just really tiresome.
If you can write G-Code and a little Python, I think you could handle OpenSCAD. The list of commands is one page long: http://www.openscad.org/cheatsheet/index.html
But if you prefer a visual style parametric modeler, there is FreeCAD. Bonus, it is Python underneath.
The strength (and arguably the weakness) of openscad is that it’s code. If that’s not what you want, then openscad is not the tool for you.
See my comment above about my Excel front end for OpenScad and this project I added on hackaday.io https://hackaday.io/project/164331-rapid-3d-models-with-excel-and-openscad
No coding needed at all. typing, yes but even with a more powerful CAD program you will have to type in sizes and other properties Also with the Changer form you can change properties on the fly and see the effect in Openscad in real time because it can reopen the file and recreate the model whenever it changes
https://www.youtube.com/watch?v=HvYvQbkh4vs&feature=youtu.be
video of rotating model of 3-story townhouse with NO CODING. Made with Excel front end and OpenScad
That is amazing
> an open source parametric modeler that worked similar to Fusion 360
http://solvespace.com/index.pl
I can only say “Good luck with that!” I’ve never had an app that had me so ready to destroy something in frustration. It is *far* too buggy for prime time.
One option is Matt Meeker’s Antimony. It is node based, uses Python formulas, and any field in any component can be accessed via a ‘component.field’ variable name. It’s pretty cool, but the dev only has official Mac releases, though others have created releases for other systems.
‘OpenSCAD is one of the most powerful 3d modeling applications around.’ I honestly don’t know anyone in industry who uses it and really only hear about it on this website. It seems like CAD that is favored by programmers, but it feels really dated honestly. I guess if you like parts built from scripts knock yourself out…It would be nice to hear about alternatives on this website, since Hackaday seems like it is basically shilling for this software.
I honestly do agree with your opinion… being a Mech. Engg. I find OpenSCAD a pain to work with.. and I do agree more programmers/ coders find it easier to work with SCAD.
I have tried using it and I just could never get the hang of it.. Creo, Pro-E, Catia, Solidworks, F360..I have worked with.. and some how find it intuitive to draw a box than to write I want a box…
Just my opinion!
“draw a box than to write I want a box” is right on. A better comparison would be adding fillets or something, which is _much_ easier to draw than to script, at least in vanilla OpenSCAD. Free-form objects, organic shapes, etc. Getting the squash on an oval right by dragging is easier than figuring out the scaling ratio in the X axis. That’s where GUI modelers shine.
(But e.g. https://github.com/clothbot/ClothBotCreations/blob/master/utilities/fillet.scad)
What’s easier to do in OpenSCAD is to make a hundred boxes each rotated three degrees. Rather than cut/paste until your mouse finger is blue, you just type
for(){}
.Or if you want to quickly re-size or tweak a design, import sub-assemblies from previous projects, etc. Or extend the language to make adding fillets easy, or generate cookie cutters from DXFs automatically, or… In short, all the stuff that code is good at.
It’s easier to type “2+2=” into a calculator, but if you’re looking at millions of data points, you need to learn to code or else your calculator finger will get sore.
Horses for courses. Tools for jobs.
What would be good is some sort of simple gui that you can use to generate openSCAD code graphically. Maybe even a Web ui for it. There are times it would be very useful
I’ve heard that FreeCAD is just that. It’s got multiple modeling strategies under the hood, of which one is OpenSCAD interpretation.
I believe it can interpret openscad code, but I don’t think it can generate it, which would be much handier. If I could do that, I could use the gui to generate the more organic shapes or even a rough prototype, and then edit the generated scad file for the details
“What’s easier to do in OpenSCAD is to make a hundred boxes each rotated three degrees. Rather than cut/paste until your mouse finger is blue, you just type for(){}.”
If done a lot, that would be a dialog box. QUANTITY:100 STEP:3 in whatever default angle measures are being used.
> Hackaday seems like it is basically shilling for this software.
SHILLING FOR FREE, OPEN SOURCE SOFTWARE.
Day in, day out, brother! :)
“OpenSCAD is one of the most powerful 3d modeling applications around.”
This is in no way true.
There are advantages and disadvantages to programmatic modelling. It takes a lot of work to do your initial setup, but once you have your model, it is FAR easier to make modifications to it.
I honestly might not have understood you well here… are you referring to parametric design?
Well, parametric design and programmatic design have a lot of overlap, at least. I am referring to the more general case of designs that are generated by code, instead of by a person drawing it on a screen. Parametric is referring to thew ability to modify a design by changing parameters. In most cases they are the same thing, but it is possible to have programmatic designs that are can’t easily be parameterised, and have interfaces that allow you to parameterise a design that was originally done with more traditional design rules (although there would be code involved in that at some level, but the basic design itself is still done the organic way)
Ah! Thank you for explaining.. makes a bit more sense!
altium the electrical cad software uses openscad underneath for 3d file generation …
It is nice for simple constructive geometry. However basic functions such as fillet are not yet supported without workarounds
“Workarounds” is a strange thing to call functions that other people have written in a programming language that extend its functionality.
That’s like saying it’s too bad that databases aren’t supported in X86 assembly language without a workaround. Granted, it’s quite a workaround. :)
There are a fillet libs out there. I use a variant on this one sometimes: https://github.com/clothbot/ClothBotCreations/blob/master/utilities/fillet.scad
Also: https://www.thingiverse.com/thing:2461392
The real beauty of the software approach is that its extensible and can build easily on the work that others have done, and sharing is trivial/free. This is OpenSCADs killer feature.
I think the worst part of OpenSCAD (which I use a lot) is that it’s not multi-threaded. Some complex models that I have take a long time to render even though I’ve ensured that they don’t have too many extra faces and I bet it could utilize my desktop’s eight cores better. They should do Mozillas to the rendering engine and rewrite it in Rust. ;) Seriously though, I really like what they did with Stylo (CSS style system) and I wonder if similar worked for OpenSCAD. It doesn’t have to be done in that language of course but that level of parallelism would be nice indeed.
First thought: a laptop is just a box with an LCD in the lid. Hmm…
Second thought: can it model a butterfly keyboard?
The original github repo is no longer available. I’ve found this but I don’t know the diff between it and the upstream.
https://github.com/sbambach/MarksEnclosureHelper
If you look at the commits, you’ll notice it is only ever modified by the original author, Mark Lamb, so it appears original. According to the WayBackMachine we’re not missing any commits either. His entire github account is gone.