bmsleight / lasercut

Module for openscad, allowing 3d models to be created from 2d lasercut parts
BSD 2-Clause "Simplified" License
320 stars 55 forks source link

Width of captive nuts is ignored #32

Closed akrinke closed 2 years ago

akrinke commented 2 years ago

Defining a captive nut with a custom nut width doesn't work.

Example:

include <lasercut.scad>; 

thickness = 3.1;
nut_flat_width = 9.3;
x = 100;
y = 100;
lasercutoutSquare(thickness=thickness, x=x, y=y,
    captive_nuts=[
            [LEFT, 0, y/2, nut_flat_width],
            ]
);

Changing the variable nut_flat_width has no effect.

The bug is in the following line:

https://github.com/bmsleight/lasercut/blob/8959a0ff08a9a955de309458803c70e980083197/lasercut.scad#L125

It should be:

if (len(captive_nuts[t]) < 4) {
bmsleight commented 2 years ago

Thanks for the bug report.

Looks like you have tested this change ? Would like to do a PR ?

If not i will try to look at it at the weekend.

Cheers