lasercut icon indicating copy to clipboard operation
lasercut copied to clipboard

laserCutBox cubes are translated to correctly fit their dimensions from 0, laserCutSquare pieces aren't

Open Inhibit opened this issue 3 years ago • 3 comments

I'm unsure if this is intentional or not but it threw me for a loop when I was coding up a parametric assembly.

The behavior of boxes is to fit their dimensions precisely including the tab cutouts. The square sheets don't. They're offset by a sheet thickness in two dimensions from 0 rather than translated to compensate. Personally I'd prefer all the functions to have the behavior of the box and once created have the 0 offset; but either case being consistent would do for regular behavior.

I realize this might be intentional for some reason but felt I should point it out to prevent someone having a similar head-scratching moment as their assembly is subtly off :). I can submit a patch if you'd like but it'd probably take me a while.

Thanks for sharing this library by the way. It's a nice time saver.

in example:

$fn=60;

include <lasercut.scad>;

thickness = 3.0;
cabx = 185;
caby = 320;
cabz = 220; 


// Our laserCutSquare sheet
color("aqua", 0.75)
translate([0, 0, 0])
lasercutoutSquare(thickness=thickness, x=cabx-thickness, y=caby-(2*thickness),
bumpy_finger_joints=[
        [UP, 1, 4],
        [DOWN, 0, 4],
        [LEFT, 1, 6]
    ]
);

// a cube for easy reference
color("green", 0.75)
translate([cabx, 0, 0])
cube([cabx, caby, thickness]);

// a cube for easy reference
color("green", 0.75)
translate([0, caby, 0])
cube([cabx, caby, thickness]);

// our laserCutBox
color("red",0.6)
translate([cabx, caby, 0])
lasercutoutBox(thickness = thickness, x=cabx, y=caby, z=cabz, 
sides=5, num_fingers=4);

Inhibit avatar Mar 02 '21 16:03 Inhibit