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

Add squares_add functionality #40

Open pbz opened 1 year ago

bmsleight commented 1 year ago

Looks great. Thanks good addition. Can be merged.

Is this worth an array of square_add for us in boxes such as https://github.com/bmsleight/lasercut/blob/master/readme/COMPLEXBOX.md ?

pbz commented 1 year ago

Thanks. What do you think about the parameter order? Matches well with circles_add, but clashes with cutouts. Trying to use both kinda makes my head hurt.

pbz commented 1 year ago

Complex box support is already included:

image

include <lasercut\lasercut.scad>; 

thickness = 3.1;
unit = 70;

die_one = [
            [unit/14, unit/14, unit*7/14-thickness/2, unit*7/14-thickness/2]
            ];

die_two = [
            [unit/14, unit/14, unit*3/14-thickness/2, unit*3/14-thickness/2], 
            [unit/14, unit/14, unit*11/14-thickness/2, unit*11/14-thickness/2]
            ];

die_three = [
            [unit/14, unit/14, unit*3/14-thickness/2, unit*3/14-thickness/2], 
            [unit/14, unit/14, unit*7/14-thickness/2, unit*7/14-thickness/2],
            [unit/14, unit/14, unit*11/14-thickness/2, unit*11/14-thickness/2]
            ];

die_four = [
            [unit/14, unit/14, unit*3/14-thickness/2, unit*3/14-thickness/2], 
            [unit/14, unit/14, unit*3/14-thickness/2, unit*11/14-thickness/2], 
            [unit/14, unit/14, unit*11/14-thickness/2, unit*3/14-thickness/2],
            [unit/14, unit/14, unit*11/14-thickness/2, unit*11/14-thickness/2]
            ];

die_five = [
            [unit/14, unit/14, unit*3/14-thickness/2, unit*3/14-thickness/2], 
            [unit/14, unit/14, unit*3/14-thickness/2, unit*11/14-thickness/2], 
            [unit/14, unit/14, unit*7/14-thickness/2, unit*7/14-thickness/2],
            [unit/14, unit/14, unit*11/14-thickness/2, unit*3/14-thickness/2],
            [unit/14, unit/14, unit*11/14-thickness/2, unit*11/14-thickness/2]
            ];

die_six = [
            [unit/14, unit/14, unit*3/14-thickness/2, unit*3/14-thickness/2], 
            [unit/14, unit/14, unit*3/14-thickness/2, unit*7/14-thickness/2],
            [unit/14, unit/14, unit*3/14-thickness/2, unit*11/14-thickness/2], 
            [unit/14, unit/14, unit*11/14-thickness/2, unit*3/14-thickness/2],
            [unit/14, unit/14, unit*11/14-thickness/2, unit*7/14-thickness/2],
            [unit/14, unit/14, unit*11/14-thickness/2, unit*11/14-thickness/2],
            ];

squares_add_a = [
        die_one,
        die_two,
        die_three,
        die_four,
        die_five,
        die_six
];

color("yellow", 0.5) lasercutoutBox(thickness = thickness, x=unit, y=unit, z=unit, 
    sides=6, squares_add_a=squares_add_a );
dizcza commented 1 year ago

Ah, I'm missing that too! Hope it will be merged soon.