discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

TERM output

JP
Jérôme Plût
Sat, Dec 5, 2020 10:59 PM

Supposedly OpenSCAD has, in addition to the abstract syntax tree and
raw CSG output format, a TERM output; per the manual:

TERM (the constructive solid geometry expression passed to OpenCSG)

which is confirmed by the source code:

else if (curFormat == FileFormat::TERM) {
CSGTreeEvaluator csgRenderer(tree);
auto root_raw_term = csgRenderer.buildCSGTree(*root_node);
with_output(cmd.is_stdout, filename_str, [root_raw_term](std::ostream & stream) {
if (!root_raw_term || root_raw_term->isEmptySet()) {
stream << "No top-level CSG object\n";
} else {
stream << root_raw_term->dump() << "\n";
}
});
}

However, when trying to play with this, I get the “No top-level CSG
object” whatever the input is:

$ echo "sphere(10);" > a.scad; openscad-nightly a.scad -o - --export-format term
No top-level CSG object

(I am quite confient however that this top-level CSG object is, in
fact, not empty !).

Is there a way to make this work?

Supposedly OpenSCAD has, in addition to the abstract syntax tree and raw CSG output format, a TERM output; per the manual: # TERM (the constructive solid geometry expression passed to OpenCSG) which is confirmed by the source code: else if (curFormat == FileFormat::TERM) { CSGTreeEvaluator csgRenderer(tree); auto root_raw_term = csgRenderer.buildCSGTree(*root_node); with_output(cmd.is_stdout, filename_str, [root_raw_term](std::ostream & stream) { if (!root_raw_term || root_raw_term->isEmptySet()) { stream << "No top-level CSG object\n"; } else { stream << root_raw_term->dump() << "\n"; } }); } However, when trying to play with this, I get the “No top-level CSG object” whatever the input is: $ echo "sphere(10);" > a.scad; openscad-nightly a.scad -o - --export-format term No top-level CSG object (I am quite confient however that this top-level CSG object is, in fact, not empty !). Is there a way to make this work?
M
MichaelAtOz
Sat, Dec 5, 2020 11:13 PM

I've been using OpenSCAD for very many years and have never come across TERM.

Where in the manual did you find it?

However, I have not tried this, if it is CSG & you are using command line,
try --preview to invoke OpenCSG.


OpenSCAD Admin - email* me if you need anything,  or if I've done something stupid...

  • on the Forum, click on my MichaelAtOz label, there is a link to email me.

Unless specifically shown otherwise above, my contribution is in the Public Domain; to the extent possible under law, I have waived all copyright and related or neighbouring rights to this work. Obviously inclusion of works of previous authors is not included in the above.

--
Sent from: http://forum.openscad.org/

I've been using OpenSCAD for very many years and have never come across TERM. Where in the manual did you find it? However, I have not tried this, if it is CSG & you are using command line, try --preview to invoke OpenCSG. ----- OpenSCAD Admin - email* me if you need anything, or if I've done something stupid... * on the Forum, click on my MichaelAtOz label, there is a link to email me. Unless specifically shown otherwise above, my contribution is in the Public Domain; to the extent possible under law, I have waived all copyright and related or neighbouring rights to this work. Obviously inclusion of works of previous authors is not included in the above. -- Sent from: http://forum.openscad.org/
M
MichaelAtOz
Sun, Dec 6, 2020 5:19 AM

https://github.com/openscad/openscad/commit/99f24241c5d8f4c09407e7986db30104ef44d0e4

Export TERM & command-line, seems very new, probably untested by the look of
it.

You could try the Development Snapshot:
http://www.openscad.org/downloads.html#snapshots


OpenSCAD Admin - email* me if you need anything,  or if I've done something stupid...

  • on the Forum, click on my MichaelAtOz label, there is a link to email me.

Unless specifically shown otherwise above, my contribution is in the Public Domain; to the extent possible under law, I have waived all copyright and related or neighbouring rights to this work. Obviously inclusion of works of previous authors is not included in the above.

--
Sent from: http://forum.openscad.org/

https://github.com/openscad/openscad/commit/99f24241c5d8f4c09407e7986db30104ef44d0e4 Export TERM & command-line, seems very new, probably untested by the look of it. You could try the Development Snapshot: http://www.openscad.org/downloads.html#snapshots ----- OpenSCAD Admin - email* me if you need anything, or if I've done something stupid... * on the Forum, click on my MichaelAtOz label, there is a link to email me. Unless specifically shown otherwise above, my contribution is in the Public Domain; to the extent possible under law, I have waived all copyright and related or neighbouring rights to this work. Obviously inclusion of works of previous authors is not included in the above. -- Sent from: http://forum.openscad.org/
M
MichaelAtOz
Sun, Dec 6, 2020 6:01 AM

Circonflexe wrote

Supposedly OpenSCAD has, in addition to the abstract syntax tree and
raw CSG output format, a TERM output; per the manual:

TERM (the constructive solid geometry expression passed to OpenCSG)

That is the Linux manual, very old.

I think that is what you get with GUI Display/Display-CSG-Products.


OpenSCAD Admin - email* me if you need anything,  or if I've done something stupid...

  • on the Forum, click on my MichaelAtOz label, there is a link to email me.

Unless specifically shown otherwise above, my contribution is in the Public Domain; to the extent possible under law, I have waived all copyright and related or neighbouring rights to this work. Obviously inclusion of works of previous authors is not included in the above.

--
Sent from: http://forum.openscad.org/

Circonflexe wrote > Supposedly OpenSCAD has, in addition to the abstract syntax tree and > raw CSG output format, a TERM output; per the manual: > > # TERM (the constructive solid geometry expression passed to OpenCSG) That is the Linux manual, very old. I think that is what you get with GUI Display/Display-CSG-Products. ----- OpenSCAD Admin - email* me if you need anything, or if I've done something stupid... * on the Forum, click on my MichaelAtOz label, there is a link to email me. Unless specifically shown otherwise above, my contribution is in the Public Domain; to the extent possible under law, I have waived all copyright and related or neighbouring rights to this work. Obviously inclusion of works of previous authors is not included in the above. -- Sent from: http://forum.openscad.org/
T
TLC123
Sun, Dec 6, 2020 8:27 AM

I'm intrigued. What do you recon the .TERM data can be used for?
Pretty rendering? Web preview? Something completely else?

--
Sent from: http://forum.openscad.org/

I'm intrigued. What do you recon the .TERM data can be used for? Pretty rendering? Web preview? Something completely else? -- Sent from: http://forum.openscad.org/
HL
Hans L
Mon, Dec 7, 2020 10:11 AM

On Sun, Dec 6, 2020 at 12:02 AM MichaelAtOz oz.at.michael@gmail.com wrote:

...
I think that is what you get with GUI Display/Display-CSG-Products.

I believe Michael is correct here.

On Sun, Dec 6, 2020 at 2:28 AM TLC123 torleif.ceder@gmail.com wrote:

I'm intrigued. What do you recon the .TERM data can be used for?
Pretty rendering? Web preview? Something completely else?

It's not useful for much, aside from maybe diagnostics and debugging (and
specific to OpenCSG preview).  You can't recreate anything with it since it
doesn't contain full geometry info like size and transformations.  Nodes,
aka "terms" in the CSG boolean expression, are labeled based on their node
type and node ID such as "sphere2" etc.
Which is probably also why that output is apparently not covered by tests
at the moment either.

Hans

On Sun, Dec 6, 2020 at 12:02 AM MichaelAtOz <oz.at.michael@gmail.com> wrote: > ... > I think that is what you get with GUI Display/Display-CSG-Products. > I believe Michael is correct here. On Sun, Dec 6, 2020 at 2:28 AM TLC123 <torleif.ceder@gmail.com> wrote: > I'm intrigued. What do you recon the .TERM data can be used for? > Pretty rendering? Web preview? Something completely else? > It's not useful for much, aside from maybe diagnostics and debugging (and specific to OpenCSG preview). You can't recreate anything with it since it doesn't contain full geometry info like size and transformations. Nodes, aka "terms" in the CSG boolean expression, are labeled based on their node type and node ID such as "sphere2" etc. Which is probably also why that output is apparently not covered by tests at the moment either. Hans