Really, really odd non-problem...

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

Really, really odd non-problem...

Troberg
This code:

use<delar.scad>;

echo(trekantvag(0));
echo(trekantvag(0.25));
echo(trekantvag(0.5));
echo(trekantvag(0.75));
echo(trekantvag(1));

Gives this output:

Saved backup file: M:/Dok/OpenSCAD/backups/unsaved-backup-tdO13248.scad
WARNING: Can't open library 'delar.scad'.
Compiling design (CSG Tree generation)...
ECHO: 0
ECHO: 0.5
ECHO: 1
ECHO: 0.5
ECHO: 0
Compiling design (CSG Products generation)...
Geometries in cache: 124
Geometry cache size in bytes: 910648
CGAL Polyhedrons in cache: 0
CGAL cache size in bytes: 0
Compiling design (CSG Products normalization)...
Normalized CSG tree has 0 elements
Compile and preview finished.
Total rendering time: 0 hours, 0 minutes, 0 seconds

The relevant line in delar.scad is:

function trekantvag(x)=1-abs(2*x-1);

Observe that it can't find the file delar.scad (look at the warning), yet,
somehow, it still manages to run the function calls correctly and return the
correct result.

In this case, I don't mind, but I can see a situation where it might cause
problems because it might find some other version of a file than the
intended, and you don't notice.

But, mostly, I find it amusing.



--
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: Really, really odd non-problem...

kintel
Administrator
> On Nov 27, 2017, at 4:50 AM, Troberg <[hidden email]> wrote:
>
> Saved backup file: M:/Dok/OpenSCAD/backups/unsaved-backup-tdO13248.scad
> WARNING: Can't open library 'delar.scad’.

This warning comes from the lexer. It most likely means that your library file cannot be found since the main openscad file hasn’t been saved yet, so it doesn’t know in which folder to look for it.

 -Marius


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

Re: Really, really odd non-problem...

Troberg
Figured as much, but I thought it was funny that it still found it...



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

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