-
Notifications
You must be signed in to change notification settings - Fork 193
Description
First, a bit of context:
I love the way CQ-Editor permits efficient and elegant CAD modeling. However, there is a significant learning curve for users who are more comfortable with visual logic (similar to Grasshopper for Rhino or Geometry Nodes for Blender). A node-based interface would bridge the gap between pure coding and visual manipulation, making CadQuery more accessible and faster for rapid prototyping. As a Grasshopper user, I assure you that visual scripting allows for much smoother 3D modeling. It would be a real game changer for an open-source tool as CQ-Editor to offer these same functionalities.
Proposed Solution:
I propose integrating a Visual Scripting Dock within CQ-Editor, powered by the Ryven framework. Ryven is a Python-based flow-based programming tool built on PyQt, which makes it highly compatible with the current CQ-Editor architecture.
The goal is NOT to replace the Python editor, but to offer a synchronized "Node-Graph" view that generates CadQuery code in real-time.
Technical Implementation Details :
To maintain the stability of CQ-Editor, the integration could follow this architecture:
- UI Integration:
- Embed the Ryven FlowView as a new QDockWidget within the main window.
- Allow users to toggle the Node Editor from the "View" menu.
- Core Bridge:
- Node Library: Create a specialized set of Ryven nodes wrapping standard CadQuery operations (cq.Workplane, box, sphere, fillet, shell, etc.).
- Code Generation: Each node in the graph would contribute to a code string. Any change in the graph topology or node parameters would trigger a regeneration of the Python script.
- Synchronization: Use a "push-to-editor" mechanism where the generated code is injected into the existing CQ-Editor text buffer, triggering the native autoreload and 3D view refresh.
- Data Flow:
- Inputs: Float, Integer, String, and cq.Workplane objects.
- Outputs: A final show_object() call generated at the end of the graph's execution path.
Why Ryven?
PyQt Compatibility: Both projects share the same GUI framework, avoiding heavy dependency conflicts.
Extensibility: It’s easy to create custom nodes for specific CadQuery plugins or complex logic.
Lightweight: Ryven can be run in a "headless" mode or as a sub-widget without taking over the main event loop.
To conclude:
This feature would position CQ-Editor as a direct open-source competitor to commercial visual CAD tools and significantly grow the CadQuery community by lowering the entry barrier for non-programmers.
I haven't had time yet to test the feasibility of what I'm proposing, and I'm by no means an expert in this field. So I'm of course open to any comments on what is actually possible!