lasercut icon indicating copy to clipboard operation
lasercut copied to clipboard

lasercutoutBox positions circle cutouts incorrectly.

Open myklemykle opened this issue 2 years ago • 4 comments

Correct me if i'm wrong, but it appears that cutouts passed to lasercutoutBox() in the "circle_cutouts_a" argument are displaced by one box thickness from where they are supposed to be. All the cutouts on a given face are shifted by the same amount, I believe in the positive direction of whatever coord they lie on.

I'm seeing this in OpenSCAD version 2021.01

This example should create a box with holes in the corners. The radius of the hole is the same as the inset from the corner, so the holes should be evenly nested in the corners, with two edges of each hole touching two edges of its face. In parametric mode you can see that the error grows with the box thickness.

include <lasercut/lasercut.scad>; 

thickness = 10;

dim = 100;
x=dim;
y=dim; 
z=dim;

sides=4;

hole_radius = 10;
hole_inset = 10;

front_holes = [
    [hole_radius, hole_inset, hole_inset],
    [hole_radius, hole_inset, z - hole_inset],
    [hole_radius, x - hole_inset, hole_inset],
    [hole_radius, x - hole_inset, z - hole_inset],
];

top_holes = [
    [hole_radius, hole_inset, hole_inset],
    [hole_radius, hole_inset, y - hole_inset],
    [hole_radius, x - hole_inset, hole_inset],
    [hole_radius, x - hole_inset, y - hole_inset],
];

        lasercutoutBox(thickness = thickness, x=x, y=y, z=z, 
            sides=sides, 
            num_fingers=3,
            circles_remove_a = 
                [ front_holes, top_holes, front_holes, top_holes, [], [] ]  
        );



Here's a screenshot of what I get. There are some artifacts due to the holes intersecting the fingers, but the holes are clearly not where they were declared to be.

Screen Shot 2022-03-29 at 9 39 03 PM

myklemykle avatar Mar 30 '22 04:03 myklemykle

I believe you can also see this problem on the main examples page if you look closely: Screen Shot 2022-03-29 at 9 49 10 PM

myklemykle avatar Mar 30 '22 04:03 myklemykle

Not sure why I not reviewed this..

bmsleight avatar Oct 20 '22 20:10 bmsleight

This show it better - its related to how I build the box..

include <lasercut.scad>; 

thickness = 10;

dim = 100;
x=dim;
y=dim; 
z=dim;

sides=4;

hole_radius = 10;
hole_inset = 10;

front_holes = [
    [dim/2, dim/2, dim/2],
];

front_holes_offset = [
    [dim/2, dim/2, dim/2-thickness],
];


lasercutoutBox(thickness = thickness, x=x, y=y, z=z, 
            sides=sides, 
            num_fingers=3,
            circles_remove_a = 
                [ [], front_holes ]  
        );


translate([dim*1.5, 0, 0]) lasercutoutSquare(thickness=thickness, x=x, y=y,
    circles_remove = [
            [dim/2, x/2, y/2],
        ]

    );
    
translate([dim*3, 0, 0])  lasercutoutBox(thickness = thickness, x=x, y=y, z=z, 
            sides=sides, 
            num_fingers=3,
            circles_remove_a = 
                [ [], front_holes_offset ]  
        );

bmsleight avatar Oct 29 '22 18:10 bmsleight

Untitled3

bmsleight avatar Oct 29 '22 18:10 bmsleight