discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

Re: Making smooth transitions on a handle

DE
David Eccles (gringer)
Tue, Jan 21, 2025 12:30 AM

On Mon, Jan 20, 2025 2:45 PM, Roel Vanhout wrote:

I can't figure out how to apply any of the solutions in those to my
current problem, so I'm hoping someone can point me in the right
direction.

Here's an example using the OpenSCAD cosine/sine intersection approach
for a tube / cube interface:

handle_dia = 50;
handle_thickness = 10;
fillet_radius=5;
sigma = 0.01;

module makePiece(tubedia=handle_thickness, pthick=fillet_radius,
fillet_angle=0, do_fillet=false){
intersection(){
rotate_extrude(angle=180){
translate([handle_dia/2,0]) circle(d=tubedia);
}
if(do_fillet){
translate([0,-fillet_radius/2 + fillet_radius * sin(fillet_angle),0])
cube([handle_dia2,pthick,handle_dia/2], center=true);
}
}
if(!do_fillet){
translate([0,-fillet_radius/2,0])
cube([handle_dia
2,fillet_radius,handle_dia/2], center=true);
}
}

makePiece(do_fillet=false, $fn=16);

for(fang = [2:5:90], $fn=16){
makePiece(
tubedia=handle_thickness + fillet_radius * (1-cos(fang)),
pthick=fillet_radius + fillet_radius * (1-sin(fang)),
do_fillet=true);
}

--
David Eccles
Bioinformatics Research Analyst

C: +64 21 262 3223
W: www.gringene.org <www.gringene.org>

GrinGene Bioinformatics

On Mon, Jan 20, 2025 2:45 PM, Roel Vanhout wrote: > I can't figure out how to apply any of the solutions in those to my > current problem, so I'm hoping someone can point me in the right > direction. Here's an example using the OpenSCAD cosine/sine intersection approach for a tube / cube interface: handle_dia = 50; handle_thickness = 10; fillet_radius=5; sigma = 0.01; module makePiece(tubedia=handle_thickness, pthick=fillet_radius, fillet_angle=0, do_fillet=false){ intersection(){ rotate_extrude(angle=180){ translate([handle_dia/2,0]) circle(d=tubedia); } if(do_fillet){ translate([0,-fillet_radius/2 + fillet_radius * sin(fillet_angle),0]) cube([handle_dia*2,pthick,handle_dia/2], center=true); } } if(!do_fillet){ translate([0,-fillet_radius/2,0]) cube([handle_dia*2,fillet_radius,handle_dia/2], center=true); } } makePiece(do_fillet=false, $fn=16); for(fang = [2:5:90], $fn=16){ makePiece( tubedia=handle_thickness + fillet_radius * (1-cos(fang)), pthick=fillet_radius + fillet_radius * (1-sin(fang)), do_fillet=true); } -- *David Eccles* Bioinformatics Research Analyst C: +64 21 262 3223 W: www.gringene.org <www.gringene.org> GrinGene Bioinformatics