[OpenSCAD] Module reuse?

nop head nop.head at gmail.com
Thu Oct 20 15:06:05 EDT 2016


Included files see the symbols of the file they are included in, so if they
are included into more than one they can produce module and functions that
behave differently. Won't caching them break that?

On 20 October 2016 at 19:42, Marius Kintel <marius at kintel.net> wrote:

> Related to this: I’m considering changing how files are included by
> parsing all included files separately, and merging the symbols into the
> namespace of the including file as a separate step. This will enable
> caching also of included files.
>
> ..at the expense of breaking backwards compatibility by requiring included
> files to contain fully parsable statements.
>
>  -Marius
>
> > On Oct 20, 2016, at 12:51, nop head <nop.head at gmail.com> wrote:
> >
> > Parsing does take significant time because at the moment all the
> vitamins are included, so they all get parsed for every assembly. I am
> designing a new machine so I will include only the constants and use all
> the modules and functions. This means splitting each vitamin file into two
> parts. For example screws,scad is a list of screw definitions, which are
> just named lists. A second file screw.scad will contain all the functions
> and modules related to screws and will be included in screws.scad.
> Hopefully that will be much faster and possibly fix the slowdown when
> automatic reload is turned on.
>
>
> _______________________________________________
> OpenSCAD mailing list
> Discuss at lists.openscad.org
> http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscad.org/pipermail/discuss_lists.openscad.org/attachments/20161020/d1770ed0/attachment-0002.html>


More information about the Discuss mailing list