discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

Why does echo print the entire line?

G
Gadgetmind
Thu, Sep 14, 2017 3:45 PM

On 2017-09-14 16:13, nop head wrote:

Ha, you wouldn't believe the amount of opposition I got to adding
$preview and I was doing the change myself, not asking others to do it.

Wow, I hadn't spotted $preview and am using a far less elegant way to
disable debug during renders from my makefile. I'll get fixing my code!

On 2017-09-14 16:13, nop head wrote: > Ha, you wouldn't believe the amount of opposition I got to adding > $preview and I was doing the change myself, not asking others to do it. Wow, I hadn't spotted $preview and am using a far less elegant way to disable debug during renders from my makefile. I'll get fixing my code!
P
Parkinbot
Thu, Sep 14, 2017 4:10 PM

The inevitability of "ECHO:" has also annoyed me, since I started programming
with OpenSCAD. A "cheap" way to implement such a switch would be to add it
in "preferences".

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

The inevitability of "ECHO:" has also annoyed me, since I started programming with OpenSCAD. A "cheap" way to implement such a switch would be to add it in "preferences". -- Sent from: http://forum.openscad.org/
KM
Kuba Marek
Fri, Sep 15, 2017 6:03 AM

From my POV the best option would be to add a MoreSane(tm) solution
controlled by a commandline option, preferences or a runtime call,
then after a year or two switch it to default and deprecate "ECHO:" and
after another year or two remove "ECHO:" completely.

The new solution could be echos going to stdout without any
additional text and everything else to stderr.

On 9/14/2017 4:28 AM, Troberg wrote:

nophead wrote

I think it is far too late to change now as people like me have
scripts built around it for making BOMs for many years.

I can see that problem, it's not fun going back and rebuild old
scripts...

Not that it wouldn't be a nuisance, but the straightforward thing to
do would be to change the .scad files to emit the "ECHO:" so that the
post-processing scripts wouldn't need to change.

From my POV the best option would be to add a MoreSane(tm) solution controlled by a commandline option, preferences or a runtime call, then after a year or two switch it to default and deprecate "ECHO:" and after another year or two remove "ECHO:" completely. The new solution could be echos going to stdout without any additional text and everything else to stderr. > On 9/14/2017 4:28 AM, Troberg wrote: > > nophead wrote > >> I think it is far too late to change now as people like me have > >> scripts built around it for making BOMs for many years. > > I can see that problem, it's not fun going back and rebuild old > > scripts... > > Not that it wouldn't be a nuisance, but the straightforward thing to > do would be to change the .scad files to emit the "ECHO:" so that the > post-processing scripts wouldn't need to change. >
ST
Shaporev, Timur
Fri, Sep 15, 2017 7:17 AM

Sigh.

Why stick on "echo"?

Why not add new primitive name like print, show, type...

No real need to change existing behaviour.


From: Discuss discuss-bounces@lists.openscad.org on behalf of Kuba Marek blue.cube@seznam.cz
Sent: 15 September 2017 09:03:05
To: discuss@lists.openscad.org
Subject: Re: [OpenSCAD] Why does echo print the entire line?

From my POV the best option would be to add a MoreSane(tm) solution

controlled by a commandline option, preferences or a runtime call,
then after a year or two switch it to default and deprecate "ECHO:" and
after another year or two remove "ECHO:" completely.

The new solution could be echos going to stdout without any
additional text and everything else to stderr.

On 9/14/2017 4:28 AM, Troberg wrote:

nophead wrote

I think it is far too late to change now as people like me have
scripts built around it for making BOMs for many years.

I can see that problem, it's not fun going back and rebuild old
scripts...

Not that it wouldn't be a nuisance, but the straightforward thing to
do would be to change the .scad files to emit the "ECHO:" so that the
post-processing scripts wouldn't need to change.

Sigh. Why stick on "echo"? Why not add new primitive name like print, show, type... No real need to change existing behaviour. ________________________________ From: Discuss <discuss-bounces@lists.openscad.org> on behalf of Kuba Marek <blue.cube@seznam.cz> Sent: 15 September 2017 09:03:05 To: discuss@lists.openscad.org Subject: Re: [OpenSCAD] Why does echo print the entire line? >From my POV the best option would be to add a MoreSane(tm) solution controlled by a commandline option, preferences or a runtime call, then after a year or two switch it to default and deprecate "ECHO:" and after another year or two remove "ECHO:" completely. The new solution could be echos going to stdout without any additional text and everything else to stderr. > On 9/14/2017 4:28 AM, Troberg wrote: > > nophead wrote > >> I think it is far too late to change now as people like me have > >> scripts built around it for making BOMs for many years. > > I can see that problem, it's not fun going back and rebuild old > > scripts... > > Not that it wouldn't be a nuisance, but the straightforward thing to > do would be to change the .scad files to emit the "ECHO:" so that the > post-processing scripts wouldn't need to change. > _______________________________________________ OpenSCAD mailing list Discuss@lists.openscad.org http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
JD
Jerry Davis
Fri, Sep 15, 2017 11:57 AM

I like Tim's suggestion. In fact, why not a up the stakes to a modified
printf kind of behavior?

That way scripts who have been based on the old ECHO behavior don't break,
but new way of printing output is added for those who want something
different.

--
Extra Ham Operator: K7AZJ
Registered Linux User: 275424
Raspberry Pi and Openscad developer

The most exciting phrase to hear in science - the one that heralds new
discoveries - is not "Eureka!" but "That's funny...".
- Isaac. Asimov

On Fri, Sep 15, 2017 at 12:17 AM, Shaporev, Timur tim@auriga.com wrote:

Sigh.

Why stick on "echo"?

Why not add new primitive name like print, show, type...

No real need to change existing behaviour.

From: Discuss discuss-bounces@lists.openscad.org on behalf of Kuba
Marek blue.cube@seznam.cz
Sent: 15 September 2017 09:03:05
To: discuss@lists.openscad.org
Subject: Re: [OpenSCAD] Why does echo print the entire line?

From my POV the best option would be to add a MoreSane(tm) solution
controlled by a commandline option, preferences or a runtime call,
then after a year or two switch it to default and deprecate "ECHO:" and
after another year or two remove "ECHO:" completely.

The new solution could be echos going to stdout without any
additional text and everything else to stderr.

On 9/14/2017 4:28 AM, Troberg wrote:

nophead wrote

I think it is far too late to change now as people like me have
scripts built around it for making BOMs for many years.

I can see that problem, it's not fun going back and rebuild old
scripts...

Not that it wouldn't be a nuisance, but the straightforward thing to
do would be to change the .scad files to emit the "ECHO:" so that the
post-processing scripts wouldn't need to change.

I like Tim's suggestion. In fact, why not a up the stakes to a modified printf kind of behavior? That way scripts who have been based on the old ECHO behavior don't break, but new way of printing output is added for those who want something different. -- Extra Ham Operator: K7AZJ Registered Linux User: 275424 Raspberry Pi and Openscad developer *The most exciting phrase to hear in science - the one that heralds new discoveries - is not "Eureka!" but "That's funny...".*- Isaac. Asimov On Fri, Sep 15, 2017 at 12:17 AM, Shaporev, Timur <tim@auriga.com> wrote: > Sigh. > > Why stick on "echo"? > > Why not add new primitive name like print, show, type... > > No real need to change existing behaviour. > ------------------------------ > *From:* Discuss <discuss-bounces@lists.openscad.org> on behalf of Kuba > Marek <blue.cube@seznam.cz> > *Sent:* 15 September 2017 09:03:05 > *To:* discuss@lists.openscad.org > *Subject:* Re: [OpenSCAD] Why does echo print the entire line? > > From my POV the best option would be to add a MoreSane(tm) solution > controlled by a commandline option, preferences or a runtime call, > then after a year or two switch it to default and deprecate "ECHO:" and > after another year or two remove "ECHO:" completely. > > The new solution could be echos going to stdout without any > additional text and everything else to stderr. > > > On 9/14/2017 4:28 AM, Troberg wrote: > > > nophead wrote > > >> I think it is far too late to change now as people like me have > > >> scripts built around it for making BOMs for many years. > > > I can see that problem, it's not fun going back and rebuild old > > > scripts... > > > > Not that it wouldn't be a nuisance, but the straightforward thing to > > do would be to change the .scad files to emit the "ECHO:" so that the > > post-processing scripts wouldn't need to change. > > > > _______________________________________________ > OpenSCAD mailing list > Discuss@lists.openscad.org > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org > > _______________________________________________ > OpenSCAD mailing list > Discuss@lists.openscad.org > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org > >
MC
Mr C Camacho
Fri, Sep 15, 2017 12:26 PM

I like that idea I once coded an opengl version of printf and using
stdarg.h to access va_lists
(variable number of parameters...) its super easy....

On 15/09/17 12:57, Jerry Davis wrote:

I like Tim's suggestion. In fact, why not a up the stakes to a
modified printf kind of behavior?

That way scripts who have been based on the old ECHO behavior don't
break, but new way of printing output is added for those who want
something different.

--
Extra Ham Operator: K7AZJ
Registered Linux User: 275424
Raspberry Pi and Openscad developer

/The most exciting phrase to hear in science - the one that heralds
new discoveries - is not "Eureka!" but "That's funny...".
/- Isaac. Asimov

On Fri, Sep 15, 2017 at 12:17 AM, Shaporev, Timur <tim@auriga.com
mailto:tim@auriga.com> wrote:

 Sigh.

 Why stick on "echo"?

 Why not add new primitive name like print, show, type...

 No real need to change existing behaviour.

 ------------------------------------------------------------------------
 *From:* Discuss <discuss-bounces@lists.openscad.org
 <mailto:discuss-bounces@lists.openscad.org>> on behalf of Kuba
 Marek <blue.cube@seznam.cz <mailto:blue.cube@seznam.cz>>
 *Sent:* 15 September 2017 09:03:05
 *To:* discuss@lists.openscad.org <mailto:discuss@lists.openscad.org>
 *Subject:* Re: [OpenSCAD] Why does echo print the entire line?
 From my POV the best option would be to add a MoreSane(tm) solution
 controlled by a commandline option, preferences or a runtime call,
 then after a year or two switch it to default and deprecate
 "ECHO:" and
 after another year or two remove "ECHO:" completely.

 The new solution could be echos going to stdout without any
 additional text and everything else to stderr.

On 9/14/2017 4:28 AM, Troberg wrote:

nophead wrote

I think it is far too late to change now as people like me have
scripts built around it for making BOMs for many years.

I can see that problem, it's not fun going back and rebuild old
scripts...

Not that it wouldn't be a nuisance, but the straightforward thing to
do would be to change the .scad files to emit the "ECHO:" so

 that the

post-processing scripts wouldn't need to change.

 _______________________________________________
 OpenSCAD mailing list
 Discuss@lists.openscad.org <mailto:Discuss@lists.openscad.org>
 http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
 <http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org>

 _______________________________________________
 OpenSCAD mailing list
 Discuss@lists.openscad.org <mailto:Discuss@lists.openscad.org>
 http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
 <http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org>

OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

I like that idea I once coded an opengl version of printf and using stdarg.h to access va_lists (variable number of parameters...) its super easy.... On 15/09/17 12:57, Jerry Davis wrote: > I like Tim's suggestion. In fact, why not a up the stakes to a > modified printf kind of behavior? > > That way scripts who have been based on the old ECHO behavior don't > break, but new way of printing output is added for those who want > something different. > > > > -- > Extra Ham Operator: K7AZJ > Registered Linux User: 275424 > Raspberry Pi and Openscad developer > > /The most exciting phrase to hear in science - the one that heralds > new discoveries - is not "Eureka!" but "That's funny...". > /- Isaac. Asimov > > > On Fri, Sep 15, 2017 at 12:17 AM, Shaporev, Timur <tim@auriga.com > <mailto:tim@auriga.com>> wrote: > > Sigh. > > Why stick on "echo"? > > Why not add new primitive name like print, show, type... > > No real need to change existing behaviour. > > ------------------------------------------------------------------------ > *From:* Discuss <discuss-bounces@lists.openscad.org > <mailto:discuss-bounces@lists.openscad.org>> on behalf of Kuba > Marek <blue.cube@seznam.cz <mailto:blue.cube@seznam.cz>> > *Sent:* 15 September 2017 09:03:05 > *To:* discuss@lists.openscad.org <mailto:discuss@lists.openscad.org> > *Subject:* Re: [OpenSCAD] Why does echo print the entire line? > From my POV the best option would be to add a MoreSane(tm) solution > controlled by a commandline option, preferences or a runtime call, > then after a year or two switch it to default and deprecate > "ECHO:" and > after another year or two remove "ECHO:" completely. > > The new solution could be echos going to stdout without any > additional text and everything else to stderr. > > > On 9/14/2017 4:28 AM, Troberg wrote: > > > nophead wrote > > >> I think it is far too late to change now as people like me have > > >> scripts built around it for making BOMs for many years. > > > I can see that problem, it's not fun going back and rebuild old > > > scripts... > > > > Not that it wouldn't be a nuisance, but the straightforward thing to > > do would be to change the .scad files to emit the "ECHO:" so > that the > > post-processing scripts wouldn't need to change. > > > > _______________________________________________ > OpenSCAD mailing list > Discuss@lists.openscad.org <mailto:Discuss@lists.openscad.org> > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org > <http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org> > > _______________________________________________ > OpenSCAD mailing list > Discuss@lists.openscad.org <mailto:Discuss@lists.openscad.org> > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org > <http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org> > > > > > _______________________________________________ > OpenSCAD mailing list > Discuss@lists.openscad.org > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
M
memsfactory
Fri, Sep 15, 2017 9:57 PM

Great ideas....but please make it so that we can write output to a file.
Here is an example of a recent issue. I coded up a special design with 100K+
of objects (yes, really!) and I output them to dxf for import into a chip
design software. However, the chip design crashes so now I need a way for
the same openscad code to output all the object coordinates in a data file,
but I can't.  A printf to file would be great!!!!

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

Great ideas....but please make it so that we can write output to a file. Here is an example of a recent issue. I coded up a special design with 100K+ of objects (yes, really!) and I output them to dxf for import into a chip design software. However, the chip design crashes so now I need a way for the same openscad code to output all the object coordinates in a data file, but I can't. A printf to file would be great!!!! -- Sent from: http://forum.openscad.org/
M
MichaelAtOz
Fri, Sep 15, 2017 10:12 PM

For at least 2015.03-2+, specifying the extension .echo causes openscad to
produce a text file containing error messages and the output of all echo()
calls in filename as they would appear in the console window visible in
the GUI. Multiple output files are not supported, so using this option you
cannot also obtain the model that would have normally been generated.

Multiple output files are not supported

It would be a good next step to support .echo in addition to normal
output...


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

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.

The TPP is no simple “trade agreement.”  Fight it! http://www.ourfairdeal.org/  time is running out!

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

Wiki <https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Using_OpenSCAD_in_a_command_line_environment#Export_options> > For at least 2015.03-2+, specifying the extension .echo causes openscad to > produce a text file containing error messages and the output of all echo() > calls in filename as they would appear in the console window visible in > the GUI. Multiple output files are not supported, so using this option you > cannot also obtain the model that would have normally been generated. > Multiple output files are not supported It would be a good next step to support .echo in addition to normal output... ----- Admin - PM me if you need anything, or if I've done something stupid... 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. The TPP is no simple “trade agreement.” Fight it! http://www.ourfairdeal.org/ time is running out! -- Sent from: http://forum.openscad.org/
G
Gadgetmind
Sat, Sep 16, 2017 7:38 AM

On 15/09/17 23:12, MichaelAtOz wrote:

It would be a good next step to support .echo in addition to normal
output...

Hmmm, thanks, this is actually useful to me now and I hadn't spotted it.
I must read the docs from start to end!

I have an aeroplane fuselage held as a multi D vector and need to
"probe" this to get locations and angles of all of the windows. Doing
this at "run time" every time would be slow, so running it as a separate
pass only when this geometry changes, outputting the data from probing
to a file with .echo, cleaning it up with some Python, and then
importing the resulting structure/data for when I need to create the
windows, makes a lot of sense.

I'd still be minded to abuse echo() with extra variables (special, not,
dunno) to set verbosity and maybe even output file (keep a list of ones
already opened, close them at the end, etc.) but maybe that's my
assembly hacked roots!

On 15/09/17 23:12, MichaelAtOz wrote: > It would be a good next step to support .echo in addition to normal > output... Hmmm, thanks, this is actually useful to me now and I hadn't spotted it. I *must* read the docs from start to end! I have an aeroplane fuselage held as a multi D vector and need to "probe" this to get locations and angles of all of the windows. Doing this at "run time" every time would be slow, so running it as a separate pass only when this geometry changes, outputting the data from probing to a file with .echo, cleaning it up with some Python, and then importing the resulting structure/data for when I need to create the windows, makes a lot of sense. I'd still be minded to abuse echo() with extra variables (special, not, dunno) to set verbosity and maybe even output file (keep a list of ones already opened, close them at the end, etc.) but maybe that's my assembly hacked roots!
JD
Jerry Davis
Sat, Sep 16, 2017 12:07 PM

as for going to a file, I don't believe that is necessary.
I do this for some of my scripts:

example:

centerpiece4_build.sh > out.txt 2>&1

the output (all of it) goes to out.txt and you can do with it what you want.

--
Extra Ham Operator: K7AZJ
Registered Linux User: 275424
Raspberry Pi and Openscad developer

The most exciting phrase to hear in science - the one that heralds new
discoveries - is not "Eureka!" but "That's funny...".
- Isaac. Asimov

On Sat, Sep 16, 2017 at 3:38 AM, Gadgetmind lists@foxhill.co.uk wrote:

On 15/09/17 23:12, MichaelAtOz wrote:

It would be a good next step to support .echo in addition to normal
output...

Hmmm, thanks, this is actually useful to me now and I hadn't spotted it. I
must read the docs from start to end!

I have an aeroplane fuselage held as a multi D vector and need to "probe"
this to get locations and angles of all of the windows. Doing this at "run
time" every time would be slow, so running it as a separate pass only when
this geometry changes, outputting the data from probing to a file with
.echo, cleaning it up with some Python, and then importing the resulting
structure/data for when I need to create the windows, makes a lot of sense.

I'd still be minded to abuse echo() with extra variables (special, not,
dunno) to set verbosity and maybe even output file (keep a list of ones
already opened, close them at the end, etc.) but maybe that's my assembly
hacked roots!


OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

as for going to a file, I don't believe that is necessary. I do this for some of my scripts: example: centerpiece4_build.sh > out.txt 2>&1 the output (all of it) goes to out.txt and you can do with it what you want. -- Extra Ham Operator: K7AZJ Registered Linux User: 275424 Raspberry Pi and Openscad developer *The most exciting phrase to hear in science - the one that heralds new discoveries - is not "Eureka!" but "That's funny...".*- Isaac. Asimov On Sat, Sep 16, 2017 at 3:38 AM, Gadgetmind <lists@foxhill.co.uk> wrote: > On 15/09/17 23:12, MichaelAtOz wrote: > >> It would be a good next step to support .echo in addition to normal >> output... >> > > Hmmm, thanks, this is actually useful to me now and I hadn't spotted it. I > *must* read the docs from start to end! > > I have an aeroplane fuselage held as a multi D vector and need to "probe" > this to get locations and angles of all of the windows. Doing this at "run > time" every time would be slow, so running it as a separate pass only when > this geometry changes, outputting the data from probing to a file with > .echo, cleaning it up with some Python, and then importing the resulting > structure/data for when I need to create the windows, makes a lot of sense. > > I'd still be minded to abuse echo() with extra variables (special, not, > dunno) to set verbosity and maybe even output file (keep a list of ones > already opened, close them at the end, etc.) but maybe that's my assembly > hacked roots! > > > > _______________________________________________ > OpenSCAD mailing list > Discuss@lists.openscad.org > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org >