[OpenSCAD] Configuration selection

Dan Christian danchristian65 at gmail.com
Thu Sep 13 15:16:09 EDT 2018


I want to select between multiple different configurations and want to
understand how to do that in a functional language.

In an imperative language I would do:
model = 'A';
if (model == 'A') {
  dim_a = 1;
  dim_b = 2;
}  else if (model == 'B') {
  dim_a = 3;
  dim_b = 4;
} else {  // default configuration
  dim_a = 5;
  dim_b = 6;
}

I may have many configurations and variables for each one.  This simple
example could be done with ? :, but that gets super messy as things get
more complex.

What's the best way to do this in OpenScad?

Dan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscad.org/pipermail/discuss_lists.openscad.org/attachments/20180913/3720612f/attachment.html>


More information about the Discuss mailing list