TERM output

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

TERM output

Circonflexe
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?

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: TERM output

MichaelAtOz
Administrator
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/

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
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.
Reply | Threaded
Open this post in threaded view
|

Re: TERM output

MichaelAtOz
Administrator
In reply to this post by Circonflexe
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/

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
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.
Reply | Threaded
Open this post in threaded view
|

Re: TERM output

MichaelAtOz
Administrator
In reply to this post by Circonflexe
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/

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
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.
Reply | Threaded
Open this post in threaded view
|

Re: TERM output

TLC123
In reply to this post by Circonflexe
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/

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: TERM output

thehans

On Sun, Dec 6, 2020 at 12:02 AM MichaelAtOz <[hidden email]> 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 <[hidden email]> 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


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org