运行OpenSCAD模块并捕获ECHO输出。

huangapple go评论86阅读模式
英文:

Run OpenSCAD module and capture ECHO output

问题

我在我的OpenSCAD模型中有一系列的回声调用,生成了一种物料清单(BOM),我想要使用命令行来捕获它。

假设模型是有效的,语法是正确的。我想要调用它并获取输出,而不是启动GUI。

如何做到这一点?

<!-- language: lang-none -->
操作系统是Linux
OpenSCAD版本为2021.01

英文:

I have a chain of echo calls in my OpenSCAD model that generates some sort of Bill of Materials(BOM) that I would like to capture using command line.

Let's assume the model is valid and the syntax is correct. I would like to call it and get output rather than launching GUI.

How to do it?

<!-- language: lang-none -->
OS is Linux
OpenSCAD version 2021.01

答案1

得分: 1

我想我找到了一个解决方法:

openscad foo.scad -o $(mktemp).stl 2>&1 | grep ECHO

输出如下:

ECHO: "obj1 dimensions:", 32, 256

相关的OpenSCAD Github问题

英文:

I think I've found a workaround:

<!-- language: lang-bash -->
openscad foo.scad -o $(mktemp).stl 2>&1 | grep ECHO

Output looks like:

<!-- language: lang-none -->
ECHO: "obj1 dimensions:", 32, 256

Related OpenSCAD Github issue

huangapple
  • 本文由 发表于 2023年7月10日 20:05:56
  • 转载请务必保留本文链接:https://go.coder-hub.com/76653569.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定