This thread is a branch from a discussion that started under the General Discussion "Why I Still Care About Nodebox". This first post is a recap of the initial conversation:
Posted by willadams on Jan 28, 2022 @ 07:32 AM
I'd like to use Nodebox, or something like to it --- the thing is, I want to do 3D though.
Right now I'm limping along doing modeling in BlockSCAD and then exporting to OpenSCAD --- the problem is the latter won't write out text files, and what one can capture as a DXF or SVG from it is limited (and STLs won't work for my purposes, since I can't find any CAM tools which will use the tooling which I wish to use efficiently enough).
So, could we connect Nodebox to the kind of 3D modeling which OpenSCAD does?
Once we've done so, could we allow writing out a text file?
Posted by john on Jan 28, 2022 @ 02:53 PM
I assume you can already create 2D shapes in Nodebox and import them as SVGs into OpenSCAD for extrusion, but I gather you want to do more than this.
It's certainly possible to create Nodebox nodes which would draw 2D perspectives of simple 3D objects, but recreating OpenSCAD would be a heavy lift.
What kind of text files do you want to export? Some kind of XML file to drive CAM tools of some sort? I'm not clear what your end goal is and what your proposed workflow would look like.
Nodebox can create drawings and export them as text files. It can certainly be part of an overall workflow. But I'm skeptical that you could stretch it into a usable and efficient one-stop CADCAM tool just by adding nodes. Even if you could do it there would probably be easier ways to accomplish what you want.
Nevertheless I am always happy to explore ideas. If you can describe exactly what kind of text files you want to export maybe Nodebox could help. Feel free to start a separate thread if you'd like to have a conversation about this.
Posted by willadams on Jan 30, 2022 @ 06:29 AM
I would like to write out G-Code:
but I want to do it in the context of 3D modeling, and using a Node/block editor --- as noted, I'm currently using BlockSCAD:
and I just find that the most workable way for me to do design work. I suspect I'll have to write my own tool --- we'll see.
|?||Show this help|
|ESC||Blurs the current field|
|r||Focus the comment reply box|
|^ + ↩||Submit the comment|
You can use
Command ⌘ instead of
Control ^ on Mac
Support Staff 1 Posted by john on 31 Jan, 2022 10:26 PM
I've been thinking about this and learning more about CADCAM and G-Code. I still think writing a general purpose CAD tool that could also export G-code would be challenging to do in a robust, general purpose way. But perhaps it could be done for a special purpose project that only requires a subset of capabilities.
I am noodling around with a 3D rotation node posted by another Nodebox user, Rioch, back in 2013. I think within a day or so I should be able to craft a simple proof of concept network that allows you to extrude, rotate, place and display simple objects. This would be a subset of what you can do in BlockSCAD or OpenSCAD. I think it might also be possible to import ASCII STL files from BlocksCAD if that would be preferable.
As for the G-code, it's fairly easy to generate and export a text file in NodeBox. The simplest way would be to render each line of code as a string, combine those strings into a list, put that list in to a one-column table with the first line (e.g. "%") as the header, export the table as a CSV, then change the extension from .CSV to .TXT (or whatever).
I still don't understand the connection between these two pieces of the puzzle, though. You say you want to generate G-code "in the context of 3D modeling". Does this mean you want to derive coordinates and length measurements from the objects and use these as parameters for individual G-code instructions? Would you also need to model your work path, or parts of your machinery?
I'll keep working on and post again when I have something worth showing,
2 Posted by willadams on 31 Jan, 2022 11:28 PM
The way I want to do this is:
- model the stock in 3D
- model the tool in 3D
- have code which determines the toolpath of the tool and subtracts it from the stock and writes out the G-Code for that movement
The idea is to bypass CAD entirely and do the design as CAM, modeling the tool and toolpath --- that way, one can only design things which can be made on the machine, and conversely, anything which can be made on the machine can be designed --- it's that latter point which is the issue for me currently. I've been designing joinery which I can't find CAM tools which will create toolpaths for.
Support Staff 3 Posted by john on 12 Feb, 2022 01:13 PM
Just a quick update in case you are still there...
I am intrigued by your project and, in spare moments, have taken a deep dive into 3D, CADCAM, etc. I've taught myself rudimentary prospective geometry, learned how to use BlocksCAD and OpenSCAD, downloaded Carbide Create, parsed one of your G code files, read through parts of your website and ebook, learned a bit about rabbet joints and woodworking, sifted through OpenSCAD code on GitHub, learned some 3D modeling techniques like face culling and winding order, and lost myself down more rabbit holes and dead ends than I'd care to admit.
In parallel, I started noodling around in NodeBox, trying to build a rudimentary 3D modeler - something I've been meaning to do for years now. Lots of fits and starts and a few quick animations just for fun which I posted on Twitter and Instagram:
I am also thinking about how to create a small library of 3D nodes for my fellow Nodeboxers. This involves coming up with not just individual nodes to accomplish a single project, but a whole interlocking system of ways to construct 3D objects and pass information and orientations from node to node in a generic and robust way. There are many possible systems, each with pros and cons depending on just what kind of 3D work you want to do.
All the while I go back and forth on the fundamental question: how crazy would it be to do your project in Nodebox?
As I said at the outset, if you constrain yourself to a small subset of CADCAM capabilities I think you could so something useful using Nodebox. But I'm still not sure Nodebox would be the best tool. You might have to be almost as crazy as me to stretch it far enough to do what you want.
All of this is to say that I am still working on this, but it may take awhile. As soon as I have something worth playing with I will post it here. So please check back every now and then. Meanwhile, if you are noodling around with Nodebox yourself and get stuck, please feel free to ask me specific questions.
4 Posted by willadams on 14 Mar, 2022 04:55 PM
I think doing the projects I envision in Nodebox should be pretty straight-forward.
Really, all that's needed for G-Code and CNC is the ability to:
- model a 3D shape to be the stock (this can be a regular cuboid)
- model various endmill shapes (all based on symmetrical/rotated a shapes --- a cylinder, a sphere (ideally attached to the bottom of a cylinder) and cones of various angles (again, ideally attached to the bottom of a cylinder)
- plot the movement of the endmill shapes and remove the hulled shape from the stock
- the ability to write out code/coordinates so as to make a G-Code file for cutting things out
I've tried to put everything I envision up at:
and one can do some really neat projects using just 2D:
Let me know when you have something I could experiment with! Really looking forward to it!
5 Posted by willadams on 16 Mar, 2022 08:39 PM
My apologies, I'd thought I had responded here previously.
The 3D stuff sounds awesome!
I think the projects I've been working on could be done in NodeBox pretty easily --- I actually used it for a couple of proof of concepts, but had a problem w/ precision which caused me to drop it --- there was one person who used it for a sundial design which was later CNCd.
All that I want to be able to do is:
- model a piece of stock
- model tooling
- algorithmically describe toolpaths
- subtract the 3D shape created by the 3D modeled tooling traveling along the toolpaths
- write out G-Code files w/ coordinates
Support Staff 6 Posted by john on 17 Mar, 2022 06:34 AM
Thanks for checking in. I was wondering if you were still there.
My apologies for the delay. I got distracted and then distracted from my distractions. As soon as I finish the next rev of my library I will get back to me rudimentary 3D modeling nodes.
I warn you, though, that they will be rudimentary. You could use them to algorithmically make some simple 3D shapes and view them from different perspectives. And you could use those same algorithms to generate some G code.
But I doubt I will be able to provide any of the 3D set operations (union, difference, intersection, and hull) you would need for the fourth item on your wishlist. Perhaps if your geometry skills are better than mine you can extend my framework to provide those functions yourself.
Anyway, stay tuned. I really will get back to this interesting challenge.