discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

import - no warning on failure

T
Trygon
Tue, May 31, 2016 3:28 PM

Simple OpenSCAD script:
import("test1.dxf");

Preview (F5): "WARNING: Can't open DXF file 'C:\Program
Files\OpenSCAD\test1.dxf'."

Preview again (F5): (no warning)

Change file name in script:
import("test2.dxf");

Preview (F5): "WARNING: Can't open DXF file 'C:\Program
Files\OpenSCAD\test2.dxf'."

Preview again (F5): (no warning)

Is this a feature or a bug?

-Trygon

--
View this message in context: http://forum.openscad.org/import-no-warning-on-failure-tp17487.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

Simple OpenSCAD script: import("test1.dxf"); Preview (F5): "WARNING: Can't open DXF file 'C:\Program Files\OpenSCAD\test1.dxf'." Preview again (F5): (no warning) Change file name in script: import("test2.dxf"); Preview (F5): "WARNING: Can't open DXF file 'C:\Program Files\OpenSCAD\test2.dxf'." Preview again (F5): (no warning) Is this a feature or a bug? -Trygon -- View this message in context: http://forum.openscad.org/import-no-warning-on-failure-tp17487.html Sent from the OpenSCAD mailing list archive at Nabble.com.
DM
doug moen
Tue, May 31, 2016 3:32 PM

This is a bug, it causes pain to lots of people. I think the problem is
that we cache the result of a failed import. I think the fix is to not
cache anything if the import fails.

On 31 May 2016 at 11:28, Trygon db5765@outlook.com wrote:

Simple OpenSCAD script:
import("test1.dxf");

Preview (F5): "WARNING: Can't open DXF file 'C:\Program
Files\OpenSCAD\test1.dxf'."

Preview again (F5): (no warning)

Change file name in script:
import("test2.dxf");

Preview (F5): "WARNING: Can't open DXF file 'C:\Program
Files\OpenSCAD\test2.dxf'."

Preview again (F5): (no warning)

Is this a feature or a bug?

-Trygon

--
View this message in context:
http://forum.openscad.org/import-no-warning-on-failure-tp17487.html
Sent from the OpenSCAD mailing list archive at Nabble.com.


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

This is a bug, it causes pain to lots of people. I think the problem is that we cache the result of a failed import. I think the fix is to not cache anything if the import fails. On 31 May 2016 at 11:28, Trygon <db5765@outlook.com> wrote: > Simple OpenSCAD script: > import("test1.dxf"); > > Preview (F5): "WARNING: Can't open DXF file 'C:\Program > Files\OpenSCAD\test1.dxf'." > > Preview again (F5): (no warning) > > Change file name in script: > import("test2.dxf"); > > Preview (F5): "WARNING: Can't open DXF file 'C:\Program > Files\OpenSCAD\test2.dxf'." > > Preview again (F5): (no warning) > > Is this a feature or a bug? > > -Trygon > > > > > -- > View this message in context: > http://forum.openscad.org/import-no-warning-on-failure-tp17487.html > Sent from the OpenSCAD mailing list archive at Nabble.com. > > _______________________________________________ > OpenSCAD mailing list > Discuss@lists.openscad.org > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org > > >
NH
nop head
Tue, May 31, 2016 3:35 PM

Or cache the console strings with the geometry they correspond to and emit
them whenever the geometry is used from the cache. There are lots of
warnings that only emit once, not just import.

On 31 May 2016 at 16:32, doug moen doug@moens.org wrote:

This is a bug, it causes pain to lots of people. I think the problem is
that we cache the result of a failed import. I think the fix is to not
cache anything if the import fails.

On 31 May 2016 at 11:28, Trygon db5765@outlook.com wrote:

Simple OpenSCAD script:
import("test1.dxf");

Preview (F5): "WARNING: Can't open DXF file 'C:\Program
Files\OpenSCAD\test1.dxf'."

Preview again (F5): (no warning)

Change file name in script:
import("test2.dxf");

Preview (F5): "WARNING: Can't open DXF file 'C:\Program
Files\OpenSCAD\test2.dxf'."

Preview again (F5): (no warning)

Is this a feature or a bug?

-Trygon

--
View this message in context:
http://forum.openscad.org/import-no-warning-on-failure-tp17487.html
Sent from the OpenSCAD mailing list archive at Nabble.com.


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

Or cache the console strings with the geometry they correspond to and emit them whenever the geometry is used from the cache. There are lots of warnings that only emit once, not just import. On 31 May 2016 at 16:32, doug moen <doug@moens.org> wrote: > This is a bug, it causes pain to lots of people. I think the problem is > that we cache the result of a failed import. I think the fix is to not > cache anything if the import fails. > > On 31 May 2016 at 11:28, Trygon <db5765@outlook.com> wrote: > >> Simple OpenSCAD script: >> import("test1.dxf"); >> >> Preview (F5): "WARNING: Can't open DXF file 'C:\Program >> Files\OpenSCAD\test1.dxf'." >> >> Preview again (F5): (no warning) >> >> Change file name in script: >> import("test2.dxf"); >> >> Preview (F5): "WARNING: Can't open DXF file 'C:\Program >> Files\OpenSCAD\test2.dxf'." >> >> Preview again (F5): (no warning) >> >> Is this a feature or a bug? >> >> -Trygon >> >> >> >> >> -- >> View this message in context: >> http://forum.openscad.org/import-no-warning-on-failure-tp17487.html >> Sent from the OpenSCAD mailing list archive at Nabble.com. >> >> _______________________________________________ >> 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 > >
TP
Torsten Paul
Tue, May 31, 2016 3:47 PM

The issue is more general, at least surface() is also affected

https://github.com/openscad/openscad/issues/454

The issue is more general, at least surface() is also affected https://github.com/openscad/openscad/issues/454
MK
Marius Kintel
Wed, Jun 1, 2016 4:42 PM

On May 31, 2016, at 11:32 AM, doug moen doug@moens.org wrote:

This is a bug, it causes pain to lots of people. I think the problem is that we cache the result of a failed import. I think the fix is to not cache anything if the import fails.

Failures can take significant time, so I think we should cache failures, but change the return value from just shapes to shapes + messages instead of messages being side effects to the console.

-Marius

> On May 31, 2016, at 11:32 AM, doug moen <doug@moens.org> wrote: > > This is a bug, it causes pain to lots of people. I think the problem is that we cache the result of a failed import. I think the fix is to not cache anything if the import fails. > Failures can take significant time, so I think we should cache failures, but change the return value from just shapes to shapes + messages instead of messages being side effects to the console. -Marius
T
Trygon
Fri, Jun 3, 2016 9:10 PM

What still puzzles me about this issue, is the following:

As before simple OpenSCAD script:
import("test1.dxf");

Preview (F5): "WARNING: Can't open DXF file 'C:\Program
Files\OpenSCAD\test1.dxf'."

Preview (F5): (no warning)

Now create file test1.dxf

Preview (F5): test1.dxf is displayed (no warning)

Delete file test1.dxf

Preview (F5): nothing displayed (no warning)

This behaviour may be obvious to those who understand the inner workings.

-Trygon

--
View this message in context: http://forum.openscad.org/import-no-warning-on-failure-tp17487p17555.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

What still puzzles me about this issue, is the following: As before simple OpenSCAD script: import("test1.dxf"); Preview (F5): "WARNING: Can't open DXF file 'C:\Program Files\OpenSCAD\test1.dxf'." Preview (F5): (no warning) Now create file test1.dxf Preview (F5): test1.dxf is displayed (no warning) Delete file test1.dxf Preview (F5): nothing displayed (no warning) This behaviour may be obvious to those who understand the inner workings. -Trygon -- View this message in context: http://forum.openscad.org/import-no-warning-on-failure-tp17487p17555.html Sent from the OpenSCAD mailing list archive at Nabble.com.
MK
Marius Kintel
Fri, Jun 3, 2016 9:24 PM

On Jun 3, 2016, at 17:10 PM, Trygon db5765@outlook.com wrote:

What still puzzles me about this issue, is the following:
[…]

We cache each import statement separately, including the last modification timestamp of the file.
If the file is not found, we thus cache that separately as an empty object (no timestamp).
..so your last refresh, after deleting the file, is hitting the earlier cached empty object.

-Marius

> On Jun 3, 2016, at 17:10 PM, Trygon <db5765@outlook.com> wrote: > > What still puzzles me about this issue, is the following: > […] We cache each import statement separately, including the last modification timestamp of the file. If the file is not found, we thus cache that separately as an empty object (no timestamp). ..so your last refresh, after deleting the file, is hitting the earlier cached empty object. -Marius