[OpenSCAD] Module reuse?

nop head nop.head at gmail.com
Thu Oct 20 12:51:40 EDT 2016


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.


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

>
> > On Oct 19, 2016, at 13:29, nop head <nop.head at gmail.com> wrote:
> >
> > If I have a main.scad file that uses a.scad and b.scad and they both use
> c.scad does OpenSCAD process c.scad twice and keep two separate copies in
> memory or is one copy of c.scad re-used?
>
> We cache used files but not included files:
> In this case we will only parse c.scad once, and cache those results until
> the timestamp of c.scad or any dependencies of c.scad changes.
>
> > Is it any different if main.scad includes a.scad and b.scad?
> >
> In that case, we don’t cache a.scad and b.scad, but c.scad will still be
> cached as it’s used, not included.
>
> > I ask because every sub assembly file in Mendel90 includes a library of
> parts and utilities. They also include other sub assemblies which all
> include all those parts. Would using the parts instead of including them be
> more efficient?
> >
> It will be more efficient as you’d save some time in the parsing step.
> However, if most of your time is spent doing other stuff than parsing, it
> unlikely to have a large impact.
>
>  -Marius
>
>
> _______________________________________________
> 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/ee6b9512/attachment-0002.html>


More information about the Discuss mailing list