<div dir="ltr"><div dir="ltr"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;color:#000000"><span class="gmail_default">On</span><span style="font-family:Arial,Helvetica,sans-serif;color:rgb(34,34,34)">, 14</span><span class="gmail_default">.10.</span><span style="font-family:Arial,Helvetica,sans-serif;color:rgb(34,34,34)">2019</span><span class="gmail_default">,</span><span style="font-family:Arial,Helvetica,sans-serif;color:rgb(34,34,34)"> 13:59, kitwallace <<a href="mailto:kit.wallace@gmail.com">kit.wallace@gmail.com</a>> </span><span class="gmail_default">wrote:</span><br></div></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Anyone able to suggest a work-around?<span class="gmail_default" style="font-family:arial,helvetica,sans-serif;color:rgb(0,0,0)"></span><br></blockquote><div><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;color:rgb(0,0,0)">With the let() clauses of your code, no tail recursion elimination will be done by older OpenSCAD versions.</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;color:rgb(0,0,0)">An alternative to Torsten Paul's suggestion is to eliminate the let() clauses from your code.</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;color:rgb(0,0,0)">Something like:</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;color:rgb(0,0,0)"><br></div></div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div class="gmail_quote"><div class="gmail_default" style="color:rgb(0,0,0)"><font face="monospace">function string_to_points(s,step=1,angle=90,pos=[0,0,0],dir=0,i=0,ps=[]) =</font></div></div><div class="gmail_quote"><div class="gmail_default" style="color:rgb(0,0,0)"><font face="monospace">    i == len(s)</font></div></div><div class="gmail_quote"><div class="gmail_default" style="color:rgb(0,0,0)"><font face="monospace">      ? concat([pos],ps)</font></div></div><div class="gmail_quote"><div class="gmail_default" style="color:rgb(0,0,0)"><font face="monospace">      : string_to_points(s,</font></div></div><div class="gmail_quote"><div class="gmail_default" style="color:rgb(0,0,0)"><font face="monospace">                         step,</font></div></div><div class="gmail_quote"><div class="gmail_default" style="color:rgb(0,0,0)"><font face="monospace">                         angle,</font></div></div><div class="gmail_quote"><div class="gmail_default" style="color:rgb(0,0,0)"><font face="monospace">                         s[i]=="F" ||s[i]=="A" || s[i]=="B" // newpos</font></div></div><div class="gmail_quote"><div class="gmail_default" style="color:rgb(0,0,0)"><font face="monospace">                           ? pos + step*[cos(dir), sin(dir)]</font></div></div><div class="gmail_quote"><div class="gmail_default" style="color:rgb(0,0,0)"><font face="monospace">                           : pos,</font></div></div><div class="gmail_quote"><div class="gmail_default" style="color:rgb(0,0,0)"><font face="monospace">                         s[i]=="+"                          // newdir</font></div></div><div class="gmail_quote"><div class="gmail_default" style="color:rgb(0,0,0)"><font face="monospace">                           ? dir + angle</font></div></div><div class="gmail_quote"><div class="gmail_default" style="color:rgb(0,0,0)"><font face="monospace">                           : s[i]=="-" </font></div></div><div class="gmail_quote"><div class="gmail_default" style="color:rgb(0,0,0)"><font face="monospace">                              ? dir - angle</font></div></div><div class="gmail_quote"><div class="gmail_default" style="color:rgb(0,0,0)"><font face="monospace">                              : dir, </font></div></div><div class="gmail_quote"><div class="gmail_default" style="color:rgb(0,0,0)"><font face="monospace">                        i+1,</font></div></div><div class="gmail_quote"><div class="gmail_default" style="color:rgb(0,0,0)"><font face="monospace">                        concat([pos],ps) ) </font></div></div><div class="gmail_quote"><div class="gmail_default" style="color:rgb(0,0,0)"><font face="monospace">     ;</font></div></div></blockquote><div class="gmail_quote"><div class="gmail_default" style="color:rgb(0,0,0)"><font face="monospace"><br></font></div><div class="gmail_default" style="color:rgb(0,0,0)"><font face="monospace">I </font><span style="font-family:arial,helvetica,sans-serif">haven't tested this code.</span></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;color:rgb(0,0,0)"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;color:rgb(0,0,0)"><br></div></div></div>