[OpenSCAD] puzzlecutlib rendering problem & STL export error Current top level object is empty.

Ronaldo rcmpersiano at gmail.com
Wed Jun 1 23:27:11 EDT 2016


FourthDr wrote
> There is one other thing I have not been able to figure out. How would I
> change the puzzle cut from the default "T" shape to a round cutout? Like a
> ball and socket shape. I don't see where in the code that does that.

The T lock is shaped by the following lines of makePuzzleStamp() in the
puzzlecutlib.scad:

> translate([i,0,0])
>     cube ([(cutSize / 2) - kerf * 2, cutSize - kerf * 2,stampSize[2]],
> center = true);
> translate([i,cutSize / 2,0])
>     cube ([cutSize - kerf *  2,(cutSize / 2) - kerf * 2, stampSize[2]],
> center = true);

To get a ball socket substitute those lines by:

> translate([i,0,0]) ball_socket(cutSize, kerf, stampSize[2]);

and for a dovetail by:

> translate([i,0,0]) dovetail(cutSize, kerf, stampSize[2]);

where those modules should be defined as:

> module dovetail(cutSize, kerf, height) {
>     angle = 12;
>     offset = kerf*(1/2+tan(angle));
>     intersection(){
>         translate([-cutSize/2-offset, cutSize+kerf, -1])
>             rotate([0,0,-90+angle]) cube([cutSize*2, cutSize*2,
> height+2]);
>         scale([-1,1,1])
>             translate([-cutSize/2-offset, cutSize+kerf, -1])
>                 rotate([0,0,-90+angle]) cube([cutSize*2, cutSize*2,
> height+2]);
>         cube([2*(cutSize+kerf), 2*cutSize+kerf, 2*(height+1)], center =
> true);
>     }
> }
> 
> module ball_socket(cutSize, kerf, height){
>         cube ([(cutSize / 2) + kerf, cutSize - kerf * 2,height+2], center
> = true);
>     translate([0,cutSize/2,0])
>         cylinder(r=cutSize/2 + kerf/2, h = height+2, $fn=12, center =
> true);
> }

I guess dovetail is safer, stronger and easier to adjust.



--
View this message in context: http://forum.openscad.org/puzzlecutlib-rendering-problem-STL-export-error-Current-top-level-object-is-empty-tp17440p17518.html
Sent from the OpenSCAD mailing list archive at Nabble.com.




More information about the Discuss mailing list