[OpenSCAD] Getting more information

Ronaldo Persiano rcmpersiano at gmail.com
Thu Jul 4 12:21:43 EDT 2019


My suggestion is not very clever but it is a debugging aid that will point
the problematic 'for' out. The function:

function checkLimits(a,b,i) =
  a>b ? echo(a=a, b=b, for_number=i) 0 : 0;


may be called just before each suspicious 'for' in a module:

for203 = checkLimits(a,b, 203);
for(i=[a:b]) dosomething ;


or in a function:

let( ...
      for24 = checkLimits(a,b,24),
      x = [for(i=[a:b} ...],
     ...


Em qui, 4 de jul de 2019 às 16:20, Dan Shriver <tabbydan at gmail.com>
escreveu:

> I'm not sure I understand "It could be a degenerate case, in which case
> you can solve the problem by replacing every occurrence of [a:b] in your
> code with [a:1:b]"
>
> I thought the way loops worked in openscad was [start:increment:end] or if
> two arguments were used they were assumed to be only start and end and
> increment was assumed to be 1.
> I will try your suggestion but don't understand why it would sometimes be
> a problem and sometimes not.  I'd like to understand it since it would give
> me a better picture how to use OpenSCAD.  When you say "degenerate" do you
> mean in the case start = end; or do you mean the interpreter sometimes
> screws up and interprets two arguments as [start:increment] and gives end
> some weird garbage value?
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscad.org/pipermail/discuss_lists.openscad.org/attachments/20190704/5181d89c/attachment.html>


More information about the Discuss mailing list