BelfrySCAD / BOSL2

The Belfry OpenScad Library, v2.0. An OpenSCAD library of shapes, masks, and manipulators to make working with OpenSCAD easier. BETA
https://github.com/BelfrySCAD/BOSL2/wiki
BSD 2-Clause "Simplified" License
1.01k stars 115 forks source link

[BUG] nvm fixed after redownloading #1396

Closed Nikorasu closed 9 months ago

Nikorasu commented 9 months ago

I was trying to use grid_copies() for a situation where each copy needs an alteration based on their index, but I keep getting a [WARNING: Ignoring unknown variable '$idx' error.. Meanwhile if I replace $idx with $col, that still works.

For example, this works:

include <BOSL2/std.scad>
grid_copies(spacing=8, n=8)
    color(($row+$col)%2?"black":"red")
        cube([8,8,0.01], center=false);

But this does not:

include <BOSL2/std.scad>
grid_copies(spacing=8, n=8)
    color(($idx)%2?"black":"red")
        cube([8,8,0.01], center=false);
adrianVmariano commented 9 months ago

Unless recently, $idx was not documented to work for grid_copies() and this was correct. Sometime recently this was changed. Are you running the latest BOSL2?