discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

Re: [OpenSCAD] Re-assigning values to "variables"

R
runsun
Mon, Oct 12, 2015 2:44 PM

@ new_designer:

try:

      if (form>1) {form=1;}

$  Runsun Pan, PhD

$ libs: doctest , faces ( git ), offline doc ( git ),runscad.py( 1 , 2 , git );

$ tips: hash( 1 , 2 ), sweep , var , lerp , animGif

--
View this message in context: http://forum.openscad.org/Re-assigning-values-to-variables-tp14099p14113.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

@ new_designer: try: if (form>1) {form=1;} ----- $ Runsun Pan, PhD $ libs: doctest , faces ( git ), offline doc ( git ),runscad.py( 1 , 2 , git ); $ tips: hash( 1 , 2 ), sweep , var , lerp , animGif -- View this message in context: http://forum.openscad.org/Re-assigning-values-to-variables-tp14099p14113.html Sent from the OpenSCAD mailing list archive at Nabble.com.
N
nophead
Mon, Oct 12, 2015 2:59 PM

Although that is correct syntax it won't do what the user intends.

You need something like:
clipped_form = form > 1 ? 1 : form;

or

clipped_form = min(1, form);

You can't reassign variables.

--
View this message in context: http://forum.openscad.org/Re-assigning-values-to-variables-tp14099p14114.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

Although that is correct syntax it won't do what the user intends. You need something like: clipped_form = form > 1 ? 1 : form; or clipped_form = min(1, form); You can't reassign variables. -- View this message in context: http://forum.openscad.org/Re-assigning-values-to-variables-tp14099p14114.html Sent from the OpenSCAD mailing list archive at Nabble.com.