discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

Re: Dynamic Include

NH
nop head
Fri, Nov 25, 2022 8:18 PM

I don't think it is possible because the includes are parsed before
variables are assigned.

Adrian's example won't work because the include is always included and
there are restrictions of what you can put into an if body. For example you
can't define modules.

On Fri, 25 Nov 2022 at 19:58, Trevor Orr via Discuss <
discuss@lists.openscad.org> wrote:

---------- Forwarded message ----------
From: Trevor Orr fractorr@yahoo.com
To: OpenSCAD General Discussion Mailing-list discuss@lists.openscad.org
Cc:
Bcc:
Date: Fri, 25 Nov 2022 19:57:55 +0000 (UTC)
Subject: [OpenSCAD] Dynamic Include
I am pretty sure this is not possible from my attempts to do this but
thought I would ask anyways.

Is there a way to do a dynamic include base on the value of variable ?
The reason is that I have a file that contains data to build parts and the
data file is getting rather large (almost 1 MB) and it would be nice to be
able to split it up into a separate file for each part.

So say the variable design equals "test" then I want to include the file
"test.scad"

Also does a large data file like this decrease performance?  I would
assume the larger the data file is the longer it takes for it to be parsed?

---------- Forwarded message ----------
From: Trevor Orr via Discuss discuss@lists.openscad.org
To: OpenSCAD General Discussion Mailing-list discuss@lists.openscad.org
Cc: Trevor Orr fractorr@yahoo.com
Bcc:
Date: Fri, 25 Nov 2022 19:57:55 +0000 (UTC)
Subject: [OpenSCAD] Dynamic Include


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org

I don't think it is possible because the includes are parsed before variables are assigned. Adrian's example won't work because the include is always included and there are restrictions of what you can put into an if body. For example you can't define modules. On Fri, 25 Nov 2022 at 19:58, Trevor Orr via Discuss < discuss@lists.openscad.org> wrote: > > > > ---------- Forwarded message ---------- > From: Trevor Orr <fractorr@yahoo.com> > To: OpenSCAD General Discussion Mailing-list <discuss@lists.openscad.org> > Cc: > Bcc: > Date: Fri, 25 Nov 2022 19:57:55 +0000 (UTC) > Subject: [OpenSCAD] Dynamic Include > I am pretty sure this is not possible from my attempts to do this but > thought I would ask anyways. > > Is there a way to do a dynamic include base on the value of variable ? > The reason is that I have a file that contains data to build parts and the > data file is getting rather large (almost 1 MB) and it would be nice to be > able to split it up into a separate file for each part. > > So say the variable design equals "test" then I want to include the file > "test.scad" > > Also does a large data file like this decrease performance? I would > assume the larger the data file is the longer it takes for it to be parsed? > > > > > ---------- Forwarded message ---------- > From: Trevor Orr via Discuss <discuss@lists.openscad.org> > To: OpenSCAD General Discussion Mailing-list <discuss@lists.openscad.org> > Cc: Trevor Orr <fractorr@yahoo.com> > Bcc: > Date: Fri, 25 Nov 2022 19:57:55 +0000 (UTC) > Subject: [OpenSCAD] Dynamic Include > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org >