[OpenSCAD] Configuration selection

Dan Christian danchristian65 at gmail.com
Thu Sep 13 19:16:56 EDT 2018


Thanks!

Approach 2 should work for me.

Dan


On Thu, Sep 13, 2018 at 1:21 PM Michael Frey <michael.frey at gmx.ch> wrote:

> Hi Dan,
>
> I see two practical approaches:
>
> *Approach 1:*
> If you don´t mind Development snapshoots, try our customizer.
> You can get those snapshoots from http://www.openscad.org/downloads.html
> You also have to go into the preferences and enable the customzier.
>
> In the customizer you can handle your configurations as so called presets.
>
> https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/WIP#Customizer
>
> *Approach 2:*
> If you want to stay on the release line of openscad:
> I would write a "base_model.scad" (or something like that), which is let
> us say model default:
>     dim_a = 5;
>     dim_b = 6;
>     //lots of code that creates the actual model
>
> For model b, I would create a file called "model_b.scad" and then simply
>     include <base_model.scad>;
>     dim_a = 1;
>     dim_b = 2;
>
> For model b, I would create a file called "model_b.scad" and then simply
>     include <base_model.scad>;
>     dim_a = 3;
>     dim_b = 4;
>
> The trick is, that the last assignment overwrites any previous assignments
> to a variable.
>
> Every model has then its own file.
> Most of the code being in base_model.scad.
> The other files only need to overwrite the variables.
>
> Depending on what you really want/need, use might also be an option.
> But when you use "use", you need a bit more code for each configuration.
>
> see also
> https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Include_Statement
>
> With Kind regards,
> Michael Frey
> _______________________________________________
> 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/20180913/00b74a2d/attachment.html>


More information about the Discuss mailing list