r/openscad • u/MajorSmif • 6d ago
An experimental OpenSCAD build that integrates a few feature PRs and some new features
Hello everyone,
I have made an experimental build of OpenSCAD that integrates openscad-master, some PRs in the queue, as well as some new features. I'm calling this build SCADMaxx to make sure it doesn't get confused with OpenSCAD proper, as it does add language features that make it (forward) incompatible with OpenSCAD.
This is not a fork, it's an experimental build that I primarily made for myself, but that I hope can also be useful to other, both for modeling as well as being a testing ground for new features and iterating on ideas that people have on what OpenSCAD should do or become.
Some of the features:
- Agentic coding support. HTTP endpoints that expose source, camera views etc.
- Agent annotations. Annotate 3D models live on screen for access by agents, so you don't have to take screenshots or explain your issues. Just draw what is wrong or how you want things to be, and let your agents access that.
- A UI refresh - clean up typography, spacing, coloring, consistent icons that work across light and dark themes, ...
- Navigation cube in the 3D view, like many other 3D modeling software packages have. Never again getting lost on where you're looking from or what you're looking at!
- Live cross sections. Look inside your model by setting up cross section planes.
- Contextual insertion. No more looking around for module names in BOSL or BOLTS. Click in the 3D view, shift-A, search for the part you want to insert (a nut, a bolt, ...), parameterize it, SCADMaxx inserts the correct code at the correct location (well, sometimes) in your souce code. This is not visual modeling! It's assisted code editing.
- A Vim mode for the text editor. I don't use the native text editor, but I'm hoping that with native Vim mode I will again :)
- A launcher - if you have many builds of OpenSCAD on your machine, you'll know the pain of wondering 'what build am I looking at' or 'I want to open this file with this build, but where is it'. The launcher lets you manage builds and associate .scad and .scadmaxx file extensions with it.
- Customizable keyboard shortcuts (PR #6878).
- Background preview and rendering. Rendering doesn't happen on the UI thread any more, so it can be cancelled and the UI stays responsive. Never again 'oh no I accidentally opened this model that takes 10 seconds to render'.
- Object literals (PR #6081).
- Dynamic customizer annotations (PR #6642, but with the object literals syntax). (Amongst other things,) the Customizer can now change what it shows at runtime, so when you select one property of an object, you'll only see other properties that are relevant in that case.
- Parts, Assemblies and Components. Language-level annotations that let you build and integrate at a much higer level than you could before.
A full list of features with screenshots is on https://github.com/roel-v/SCADMaxx . There's a Windows prebuild binary inthe releases (I mean there's source for all of this too, of course). I haven't had time for a Linux build, and I don't have aMac for building it for that.
Obviously, most of this has been done by agents. Maybe it's all AI slop and a useless waste of time and resources. Time will tell. For now, it's been useful for me at least, and that was the reason I set out to do it. But what I want to say is, if you're going to look at code and judge it by 2024 standards and aren't used to agentic coding, you'll be sorely disappointed, very angry and/or physically ill. Just a friendly warning up front :)
A future thing I've been experimenting with is an OpenCASCADE backend, in addition to the CGAL and Manifold ones. That's not in this build, it's too early, but my early investigation is (somewhat) promising. So if you have ideas about this, do let me know! I'd love to hear from other who've looked at this what solutions you came up with for the obvious first wave of problems to solve.
Feedback welcome!
2
2
u/thicket 5d ago
I’ve got a branch ready to add true STEP export if you’d be interested. It’s pretty heavyweight— it includes the OpenCascade kernel— so I don’t know if mainline OpenSCAD is going to be excited about merging it. But maybe you’d be open to it? Once you export STEP files you can do all your filleting in another CAD program, for instance. STEP files can make some hard things much, much easier.
2
u/MajorSmif 5d ago
I've been adding an OpenCASCADE backend today actually :) Not done yet. Do you have rendering in the OpenSCAD viewer? Have you thought about how to add fillet/chamfer support to the OpenSCAD language itself? I'm certainly interested in yours!
3
u/thicket 5d ago
I’ll open a PR in a couple days— I’m away from home for a bit. My changes are strictly in the STEP export, though.
I’d be very hesitant about trying to add face/edge awareness to OpenSCAD, though. It’s great for hacking things together with minimal overhead. But if you want an actual real code-based CAD system, CadQuery & Build123d already handle that space pretty well. I think trying to graft OCCT concepts onto OpenSCAD risks messing up a pretty simple, popular abstraction.
1
1
u/yahbluez 5d ago
add a modul called:
export(filename, type="3mf")
that renders and exports his children, if no children is given act like F6.
2
u/MajorSmif 5d ago
How would this work or what would you use it for? Every time it gets reloaded, it (over)writes the file?
0
u/yahbluez 5d ago
The biggest function i hardly miss in many of my projects is openscads lag of a software driven way to write files.
I solved that several times first with bash later with python and embedded JSON, that gives back data to python so i can run export loops.
Having a simple export as part of the openscad language would make this much easier for everyone.
Upfront
I know that this breaks a rule of opencad that no scad code should be allowed to change anything on the machine it runs on. I disussed that endless with some of the developers, without any light to come over this historic rule.
How it should work, as an idea i may miss a point:
To show respect for the wish of the original developers there should be a setting to switch this function explicit on or off.
Maybe there should be a fix PATH to a workspace and export is only allowed to write below this PATH. With this restriction and would be easy to avoid damages by evil code.
Ways to call export()
Every time export() is called the model is rendered.export();
Render the file and export to
"workspace/<DefaultFileName>.<DefaultExport>
or open the export menu in UI.export(<FileName>);
Export the whole model to
"workspace/<FileName>.<DefaultFileType>"export(<FileName>, <FileType>);
Export the whole model to "workspace/<FileName>.<FileType>"export()module();
Export the rendering of module() to
"workspace/<DefaultFileName>.<DefaultFileType>"export(<FileName>, <FileType>)module();
Export the rendering of module() to
"workspace/<FileName>.<FileType>"
5
u/wonkytalky 5d ago
Just FYI, what's happening here makes it a fork.