What do people do for debugging functions given that echo() doesn't work
inside them?
I'd prefer not to stream debugging output into the return value of the
function.
https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail&utm_term=icon
Virus-free.
www.avast.com
https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail&utm_term=link
<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
On 02/10/2018 09:39 PM, Dan Shriver wrote:
What do people do for debugging functions given that echo()
doesn't work inside them?
It is available for functions in the nightly builds.
For some info, see:
https://github.com/openscad/openscad/pull/1830
There's still some todo:
https://github.com/openscad/openscad/issues/1859
ciao,
Torsten.
I break up the function into simpler parts and test them individually.
Sometimes, I do this through breaking it up into many smaller function, and
one function which puts it all together, sometimes I do it by commenting out
parts of the function temporarily for testing purposes.
--
Sent from: http://forum.openscad.org/
I use this function to echo any part of an expression.
// Echo expression and return it
function echoit(x) = echo(x) x;
Before function echo was added I sometimes had to resort to translating
code into Python to debug it.
On 11 February 2018 at 12:02, Troberg troberg.anders@gmail.com wrote:
I break up the function into simpler parts and test them individually.
Sometimes, I do this through breaking it up into many smaller function, and
one function which puts it all together, sometimes I do it by commenting
out
parts of the function temporarily for testing purposes.
--
Sent from: http://forum.openscad.org/
OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
For those who are concerned about "libraries", could a Save option be included in OpenSCAD that has an "archive" feature that simply saves the target file and any referenced library, or subfile into a ZIP file(for example).
With gigabytes so cheap these days, this would not cost much??
No doubt over time, changes to the OpenSCAD IDEmight render any particular example 'broken' but at least anyone else coming along behind would have a complete snapshot of the original working design to begin with.
It would also make sharing OpenSCAD designs easier?
Cheers.
Rob
Cheers, RobW
On 11 February 2018 11:02:04 pm AEDT, Troberg troberg.anders@gmail.com wrote:
I break up the function into simpler parts and test them individually.
Sometimes, I do this through breaking it up into many smaller function,
and
one function which puts it all together, sometimes I do it by
commenting out
parts of the function temporarily for testing purposes.
--
Sent from: http://forum.openscad.org/
OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
I first write the code as a module to debug it, then translate it into a
function. e.g.
module Arc(centre, radius, angle1, angle2, step = 10, dir=false) {
a1 = dir ? angle1 : angle2;
a2 = dir ? angle2 : angle1;
polygon([for (a = [a1 > a2 ? a1 - 360 : a1:step:a2]) [centre[0] +
radius * cos(a), centre[1] + radius * sin(a)]]);
}
function arc(centre, radius, angle1, angle2, dir = false, step = 10) =
let(a1 = dir ? angle1 : angle2)
let(a2 = dir ? angle2 : angle1)
[for (a = [a1 > a2 ? a1 - 360: a1:step:a2]) [centre[0] + radius *
cos(a), centre[1] + radius * sin(a)]];
On Mon, Feb 12, 2018 at 1:24 AM, Rob Ward rl.ward@bigpond.com wrote:
For those who are concerned about "libraries", could a Save option be
included in OpenSCAD that has an "archive" feature that simply saves the
target file and any referenced library, or subfile into a ZIP file(for
example).
With gigabytes so cheap these days, this would not cost much??
No doubt over time, changes to the OpenSCAD IDEmight render any particular
example 'broken' but at least anyone else coming along behind would have a
complete snapshot of the original working design to begin with.
It would also make sharing OpenSCAD designs easier?
Cheers.
Rob
Cheers, RobW
On 11 February 2018 11:02:04 pm AEDT, Troberg troberg.anders@gmail.com
wrote:
I break up the function into simpler parts and test them individually.
Sometimes, I do this through breaking it up into many smaller function, and
one function which puts it all together, sometimes I do it by commenting out
parts of the function temporarily for testing purposes.
--
Sent from: http://forum.openscad.org/
OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Torsten
on the downloads (http://www.openscad.org/downloads.html) I see a
2018.01.06 build, and I installed that on top of what I had. But it does
not seem to have echo() for functions.
Where do I go to grab a nightly build? The OS is 64 bit windows 7
https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail&utm_term=icon
Virus-free.
www.avast.com
https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail&utm_term=link
<#m_-2160566236724823863_m_-7176511858633565756_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
On Sat, Feb 10, 2018 at 4:53 PM, Torsten Paul Torsten.Paul@gmx.de wrote:
On 02/10/2018 09:39 PM, Dan Shriver wrote:
What do people do for debugging functions given that echo()
doesn't work inside them?
It is available for functions in the nightly builds.
For some info, see:
https://github.com/openscad/openscad/pull/1830
There's still some todo:
https://github.com/openscad/openscad/issues/1859
ciao,
Torsten.
OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
You need to go into Preferences >> Features and enable the "echo
expression" feature.
On 11 February 2018 at 15:28, Dan Shriver tabbydan@gmail.com wrote:
Torsten
on the downloads (http://www.openscad.org/downloads.html) I see a
2018.01.06 build, and I installed that on top of what I had. But it does
not seem to have echo() for functions.
Where do I go to grab a nightly build? The OS is 64 bit windows 7
https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail&utm_term=icon Virus-free.
www.avast.com
https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail&utm_term=link
<#m_2324107662973867695_m_-2160566236724823863_m_-7176511858633565756_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
On Sat, Feb 10, 2018 at 4:53 PM, Torsten Paul Torsten.Paul@gmx.de wrote:
On 02/10/2018 09:39 PM, Dan Shriver wrote:
What do people do for debugging functions given that echo()
doesn't work inside them?
It is available for functions in the nightly builds.
For some info, see:
https://github.com/openscad/openscad/pull/1830
There's still some todo:
https://github.com/openscad/openscad/issues/1859
ciao,
Torsten.
OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
On 02/11/2018 09:28 PM, Dan Shriver wrote:
on the downloads I see a 2018.01.06 build, and I installed
that on top of what I had. But it does not seem to have
echo() for functions.
You may need to go into Preferences->Features to enable it.
ciao,
Torsten.
After enabling it works, thanks Doug / Torsten
https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail&utm_term=icon
Virus-free.
www.avast.com
https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail&utm_term=link
<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
On Sun, Feb 11, 2018 at 3:36 PM, Torsten Paul Torsten.Paul@gmx.de wrote:
On 02/11/2018 09:28 PM, Dan Shriver wrote:
on the downloads I see a 2018.01.06 build, and I installed that on top of
what I had. But it does not seem to have
echo() for functions.
You may need to go into Preferences->Features to enable it.
ciao,
Torsten.
OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org