16 ms·
Show HN: OpenSCAD configurable calendar 3D model
I created a highly configurable calendar 3D model using OpenSCAD. This project uses Zeller’s Congruence to automatically adjust the calendar layout for any year. Just change the year in the configurator, and the model updates accordingly.
The link contains a little more of the backstory and the downloadable model from a 3rd-party site, additionally the full source code is included in the post.
Some highlights:
- Implemented date calculations entirely in OpenSCAD (with no built-in date support, which was challenging but fun).
- Customizable layout, multi-material printing support, and translation for all text elements.
- Configurable holes for magnets/screws to mount on a fridge or wall.
- Utilizes JustinSDK/dotSCAD and davidson16807/relativity.scad for string manipulation.
- Correctly takes into account leap years.
Would love to hear your feedback. Thanks for checking it out!
- hnuser123456 2y agoThis is really cool! I only have a single-spool printer, but I wonder if I could brush or stamp paint over the top to give the surface a different color from inset lettering. I should probably also reinforce my Z axis before trying to print day numbers that small. Kind of funny to see string manipulation functions implemented in Openscad code.
- evan_ 2y agoYou can always insert a pause and swap to a different filament at a certain z-height.
- jamesy0ung 2y agoYou can use M600 to stop and load a new filament to use multi colour.
- Rikudou 2y agoAs others have said, you can use M600 or a pause (depending on your printer) and swap filaments. The design specifically supports both use-cases, it can easily switch from all colors on a single height level to all colors having their own height levels.
- gerdesj 2y agoNice job. I will have a play. In case anyone fails to notice the link to dotSCAD - do investigate it. That bloke (sadly now deceased was a OpenSCAD legend!)
- gerdesj 2y agoEaster calculator. The algorithm is roughly: Sunday after the first full moon on or after Mar 21. If the full moon is a Sunday, then the following Sunday. The date of the full moon is not an astronomical one and its date is left as an exercise for the reader. There are two Easters too - the Orthodox one involves the Julian calendar, the Roman (etc) involves the Gregorian calendar. You could chicken out with a lookup table!
- bluGill 2y agoEaster is when you village elder decides it is full moon by looking at it, not your fancy math. Though the math is good enough and really better for a connected world.
- bsimpson 2y agoI've never seen the SCAD language before - looks surprisingly similar to JavaScript.
- lucasoshiro 2y agoActually, not much except the curly braces + semicolons, which makes it look like C, C++, Java and many others. OpenSCAD is functional/declarative, so you can't change the state of a variable, functions don't have colateral effects, lists are immutable, and so on. We also don't have for, while or if-else in the way we have in other languages. A for loop in OpenSCAD is only a way to repeat objects (= 3D objects, not POO objects), if-else are like a ternary operator for objects, the objects aren't values, and so on. OpenSCAD has also some built-in less common features. One highlight for me are native vector and matrix multiplication, and other is the list index based on the name of the axis (list.x means list[0], list.y means list[1] and list.z means list[2]). But it lacks string and list operations, which would demand some FP-fu to write your own functions to manipulate them, just like the author did. If you speak Portuguese, I gave a course last year about OpenSCAD. The slides are available here: https://lucasoshiro.github.io/posts-en/2024-03-24-openscad/ https://lucasoshiro.github.io/posts-en/2024-03-24-openscad/
- aqueueaqueue 2y agoIs this a 2D colour thing on a 3D printer? If so am loathed to print those because you need an automatic material system and it creates a lot of poop (cut-offs when switching colour) It think it might be OK to have say 5 white layers then a couple of ink layers. Also how do you get on with the slicer with fonts. I found this difficult when printing a dog tag. I sort of got the impression it may be better to have a "gcode font" rather than go TTF->Triangles (STL)->Gcode However overall: great effort and I love openscad. I love the idea of it I only used it once as I have been busy!
- Rikudou 2y agoIt supports both with a single toggle, either you use MMU/AMS in which case it's all on the same level, or you don't use it and all colors have a different height level making it easy to just M600/pause your print and change the color. Designs of this kind don't leave that much poop, there's not much waste when it's only a few layers. > Also how do you get on with the slicer with fonts. Haven't had many problems with them, I usually enlarge the text until I'm happy. I also usually do $fn = 360 for OpenSCAD which uses so many triangles that you can't really see it not being round with your naked eye.
- brianhorakh 2y agoAnother one for the openscad awesome list: https://github.com/elasticdotventures/awesome-openscad https://github.com/elasticdotventures/awesome-openscad Personally I've stopped using openscad recently (*in the last few years). I found it's lack of ability to create attachment/mate connectors significantly inhibited it's ability to compose complex objects. I looked into the amount of effort required to support attachments and ultimately decided that it was the wrong approach and have since migrated to Python & cadquery.
- pbronez 2y agoI need to take another run at CADQuery and Build123. I’m frustrated with OpenSCAD’s unstable kernel, but it’s still the easiest way to get a basic parametric design going from code. I’m also keeping an eye on zoo (fka KittyCAD). It too has performance problems, but if/when it stabilizes it’s exactly what I want.
- timschmidt 2y agoPlugging my system here: https://github.com/timschmidt/csgrs https://github.com/timschmidt/csgrs I think I've reached feature parity with OpenSCAD, and a similar level of ease of use, but with multithreading and all of Rust available, including the https://www.dimforge.com/ https://www.dimforge.com/ libraries and high quality 2D offsetting with https://github.com/jbuckmccready/cavalier_contours https://github.com/jbuckmccready/cavalier_contours
- nickpinkston 2y agoI'm always trying to figure out why OpenSCAD has such a following when, at least to my manufacturer-brain says "whoa it's inconvenient to use to make real stuff" and "there are more expressive 3D modeling DSLs". Is this like hobby only like writing an app in brainfuck? Or am I missing something?
- jcarrano 2y agoI only used it once for modeling some procedural decorations in the shape of flowers. I did it on a long train ride and managed to both learn the language and do the models, so there's something to be said about the simplicity. If I had to do anything more complex or less artistic I would use other tools. Something python-based would be ideal.
- lucasoshiro 2y ago> Something python-based would be ideal SolidPython is a Python lib that generates OpenSCAD code, so you can use whatever Python code you want to give more power to OpenSCAD. Here's a QR code generator that I made in 30 lines, using a QR code library + NumPy + SolidPython: https://github.com/lucasoshiro/solidpython-qrcode/blob/main/qrcode_scad.py https://github.com/lucasoshiro/solidpython-qrcode/blob/main/...
- timonoko 2y agoOpenSCAD is not a programming language with flow of execution, but static statement of properties of the desired object. Only language better for this might be Prolog. Once you totally comprehend this, all the "functional" shit of OpenSCAD makes total sense. Python does not have that kind static description properties, and those OpenSCAD-Python translators suck very much, imho.
- lucasoshiro 2y ago> there are more expressive 3D modeling DSLs Can you name them? I'm not being sarcastic, I just want more options :-) (if they are free and open source, just like OpenSCAD)
- lucasoshiro 2y agoNice! I'm really happy to see OpenSCAD so often here in HN! Let me also show something that I did: a Braille generator: https://github.com/lucasoshiro/openscad-braille https://github.com/lucasoshiro/openscad-braille It's also available in Thingiverse, so it can generate STL files without having to use OpenSCAD natively: https://www.thingiverse.com/thing:6463849/remixes https://www.thingiverse.com/thing:6463849/remixes
- Rikudou 2y agoWow, nice!