Trying to get a design cut, but am stymied on the CAM end of things — if I could just write out a text file from OpenSCAD I’d have it I think.
All I need is for any text which is added to the Console via Echo() to be exported via a menu entry (yes, I know I could filter it out w/ a utility or fancy search/replace but I want this to be something that a naïve user could do). Asked for it in an Issue:
but got shot down.
There’s on-going discussion in a different issue as well as the mailing list — I think it’d be accepted if it came in over the transom as a code patch, at least I hope it would.
Simplest expression:
Just adding a parallel output where if one called echo() only that text was written out to a second file (with a user configurable file extension) would work — no added menu entry, just a pair of configuration options:
[ ] write out echo text in separate file
[ ] custom file extension, use ____ instead of .txt
that’s all that would be necessary to allow folks to experiment with directly creating G-Code for CAM. (EDIT: and doing lots of other things such as compiling a B.O.M.)
If anyone is able to look into this I’d be grateful.
I’ve used OpenSCAD a fair amount. I had a look at the code and could add a writeln(“filename.nc”,{}) type of function to their grammar that would do the sort of thing you are after.
If this was a personal build for you on a single platform, then that’s straightforward. But if you wanted it to be generic and available to others then the OpenSCAD team would need to accept a pull request, and they seem to be reluctant about the overall concept.
So the code changes are easy, but making, updating and distributing builds is more complicated… and, well, tedious
Thanks. I don’t want to have to distribute the script — the thing is, being able to write out the echoed text would also be useful folks using OpenSCAD more generally — generating a B.O.M. comes to mind.
If it won’t just work directly, I guess I’ll either switch to AngelCAD or FreeCAD.
You could write out the commands in the first ECHO statement instead. Then to generate the NC file the person would just need to remove the first ECHO: and then run the output to generate the NC file.