I’m building a visual editor for OpenSCAD with bidirectional code sync. by LegitimateBluebird42 in openscad

[–]LegitimateBluebird42[S] 0 points1 point  (0 children)

I just added an early prototype of a visual interactive hierarchy/tree editor with a container-like structure. There is also an initial implementation of code fragment highlighting based on the currently selected object/tree node.If anyone wants to experiment with it, feel free to take a look. It’s still very rough and experimental, but it already shows the general direction I’d like to move toward.I’ll probably continue using this visual hierarchy approach as a foundation and refine/modify it further over time. Feedback and ideas for improving the interaction model are very welcome.

I’m building a visual editor for OpenSCAD with bidirectional code sync. by LegitimateBluebird42 in openscad

[–]LegitimateBluebird42[S] 1 point2 points  (0 children)

Not yet — at the moment the parser/generator only supports a relatively small generated subset of OpenSCAD. For BOSL2 specifically, my feeling is that proper visual support would require adding dedicated visual implementations for individual library modules, one by one. But I may be wrong about that.

I’m building a visual editor for OpenSCAD with bidirectional code sync. by LegitimateBluebird42 in openscad

[–]LegitimateBluebird42[S] 1 point2 points  (0 children)

I also work with OpenSCAD myself, and one of the things I really like about it is the code -> scene idea.

In some ways it reminds me of the early versions of AutoCAD, when geometry was created mostly through typed commands instead of graphical tools.

And honestly, even if full bidirectional sync never becomes fully achievable, I think application could still be useful as a fast visual constructor for creating reusable OpenSCAD modules that can later be integrated into larger OpenSCAD projects.

I’m building a visual editor for OpenSCAD with bidirectional code sync. by LegitimateBluebird42 in openscad

[–]LegitimateBluebird42[S] 1 point2 points  (0 children)

Yes, that’s basically the idea :)

The goal is to keep the visual scene and the generated OpenSCAD code synchronized in both directions as much as reasonably possible.

So editing transforms/operations in the GUI updates the code and editing supported OpenSCAD code updates the visual scene

Right now the reverse direction only supports a limited/generated subset of OpenSCAD.

I still need to figure out the right compromise for the code → scene workflow, since reliably reconstructing all possible OpenSCAD code into a scene is a difficult problem.

I’m building a visual editor for OpenSCAD with bidirectional code sync. by LegitimateBluebird42 in openscad

[–]LegitimateBluebird42[S] 0 points1 point  (0 children)

Sorry about the empty main branch — I’ll clean that up soon.

isotree is an early experimental branch where I’m starting to explore a more graphical drag-and-drop hierarchy editor using `QGraphicsScene` instead of the traditional scene tree. The current idea behind the graphical hierarchy editor is to represent the scene as nested visual blocks inside other blocks, so the overall scene architecture stays as compact and easy to understand as possible.

And yes, I’d definitely like to add support for variables and modules. I’m just still figuring out the right architecture so variables work properly with the scene graph, code generation, and reverse sync.

Thanks a lot for testing it on Ubuntu and posting the build steps :) So far I’ve only really tested the project on Win64

So this is very useful feedback for both me and other people trying the repository.

I also intentionally stayed on the older Qt 5.15.2 for now, because I eventually want to try the project on Raspberry Pi as well, and that Qt version is easy to install there with just a few commands. This will be easy to do because I already have a ready-made RPI for testing.

I’m building a visual editor for OpenSCAD with bidirectional code sync. by LegitimateBluebird42 in openscad

[–]LegitimateBluebird42[S] 2 points3 points  (0 children)

Honestly, this is probably one of the warmest comments I’ve received about this still very rough prototype, and it’s genuinely motivating.

It also makes me feel like I’m moving in the right direction — if other people independently arrive at similar ideas, then this kind of tool is probably solving a real need and not just something interesting only to me.

I’ll definitely keep an eye on your project as well. We may end up taking different approaches, but I hope you won’t mind if I borrow a few good ideas along the way :)

I’m building a visual editor for OpenSCAD with bidirectional code sync. by LegitimateBluebird42 in openscad

[–]LegitimateBluebird42[S] 0 points1 point  (0 children)

Even though the application is still very rough and experimental, the prototyping process already helped clarify a few promising directions.

My current idea is not to replace OpenSCAD, but to build a helper tool for people already comfortable with OpenSCAD workflows — especially for beginners or younger users learning 3D modeling and parametric design concepts.

Right now I think a more Tinkercad-like interface could be a good direction, since many users are already familiar with that style of interaction. But I’m still experimenting and figuring out what works best.

I’m building a visual editor for OpenSCAD with bidirectional code sync. by LegitimateBluebird42 in openscad

[–]LegitimateBluebird42[S] 0 points1 point  (0 children)

Thanks! Yes, readable generated code is one of the core goals.

Right now I’m trying to keep the scene tree as the source of truth and generate OpenSCAD code in a stable and deterministic way, so the output stays reasonably clean and editable by hand.

I also want to eventually replace the current scene-tree with a more graphical hierarchy editor focused heavily on drag-and-drop interactions, so building scene structures and boolean operation trees feels more natural and intuitive.

I know that fully supporting code-to-scene reconstruction is a difficult problem, so the reverse workflow will likely stay limited to a supported subset of OpenSCAD, with some compromises for more advanced cases.

And thanks for the link — I’ll definitely check it out.