[OpenSCAD] Caching files?

nop head nop.head at gmail.com
Tue Aug 23 15:56:57 CEST 2011


Hi Marius,
  Here is a very simple case that shows the bug. Main draws two cylinders
that should both be the same height, set by K in the config file.

main.scad:
include <conf.scad>
use <module.scad>

color([1,0,0]) cyl(10);

color([0,1,0]) translate([30, 0, 0]) cylinder(h = K, r = 10, center = true);

conf.scad:
K = 20;

module.scad:
include <conf.scad>

module cyl(r) {
cylinder(h = K, r = r, center = true);
}
cyl(20);

When I change the value of K in conf.scad nothing happens as auto reload
only looks at the main file, to be expected, but would be nice if it looked
at all the includes. If I reload main manually then the green cylinder will
change but the red one set by the use of K in the module will not change. If
I open module it shows the correct size, but if I reopen main again it is
still wrong. I have to close openscad and open main again to see both
cylinders use the new value.

Odd that you are caching files. I find both Windows and Linux do a pretty
good job of doing that for me, particularly when the files as so small.

Chris

On 23 August 2011 01:21, Marius Kintel <marius at kintel.net> wrote:

> On Aug 23, 2011, at 01:16 AM, nop head wrote:
> >
> > If I change a constant in the config file and recompile with F4 or F5 the
> uses of the constant in the main file use the new value, but modules that
> are used by the main file still see the old value. Flush caches doesn't fix
> it. If I open the module it shows the correct value but when I return to the
> main file it still uses the old value. The only way I can get all of the
> code to use the new value is to close openscad and reopen it again.
> >
> Cache handling of included files might not be perfect. If you could whip up
> a minimal example this would be valuable for debugging and regression
> testing.
>
>  -Marius
>
> _______________________________________________
> OpenSCAD mailing list
> OpenSCAD at rocklinux.org
> http://rocklinux.net/mailman/listinfo/openscad
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rocklinux.net/pipermail/openscad/attachments/20110823/8a6b7e6f/attachment.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: module.scad
Type: application/octet-stream
Size: 82 bytes
Desc: not available
Url : http://rocklinux.net/pipermail/openscad/attachments/20110823/8a6b7e6f/module.obj
-------------- next part --------------
A non-text attachment was scrubbed...
Name: conf.scad
Type: application/octet-stream
Size: 8 bytes
Desc: not available
Url : http://rocklinux.net/pipermail/openscad/attachments/20110823/8a6b7e6f/conf.obj
-------------- next part --------------
A non-text attachment was scrubbed...
Name: main.scad
Type: application/octet-stream
Size: 146 bytes
Desc: not available
Url : http://rocklinux.net/pipermail/openscad/attachments/20110823/8a6b7e6f/main.obj


More information about the OpenSCAD mailing list