Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

polyRoundRotate/rotate_extrudeWithRadius functionality #43

Open
drf5n opened this issue Oct 6, 2022 · 1 comment
Open

polyRoundRotate/rotate_extrudeWithRadius functionality #43

drf5n opened this issue Oct 6, 2022 · 1 comment

Comments

@drf5n
Copy link

drf5n commented Oct 6, 2022

If I want to round the corners on a rotated solid polygon as is done with extrudeWithRadius(), is that possible with the library as-is?

I tried to illustrate what I'm looking for with this image and code-- I'd like the x=400 column to round the start,stop, and intermediate corners of the revolved solid in the X=300 column. Is this what beamChains can do?

image

use <Round-Anything/polyround.scad> // https://github.com/Irev-Dev/Round-Anything


function makeRadiiPoints(r1, r2)=[[0,0,0],[0,20,r1],[20,20,r1],[20,0,0]];

// radii are too large again and are reduced to fit, but keep their ratios.
// r1 will go from 10 to 4 and r2 will go from 40 to 16




translate([0,100,0])x0(); //initial shape
translate([100,100,0])x1(); // $fn=3 extrudeWithRadius polygon
translate([200,100,0])x2(); //  rotate_extrude polygon
translate([300,100,0])x3();

translate([0,200,0])c0(); // $fn=3 rotated circle
translate([100,200,0])c1(); // $fn=3 rotated circle
translate([200,200,0])c2(); // $fn=3 rotated circle
translate([300,200,0])c3(); // $fn=3 rotated circle

module x0(){
    polygon(polyRound(makeRadiiPoints(10,40),50));
}

module x1(){
    // from     https://learn.cadhub.xyz/docs/round-anything/api-reference/
    translate([25,0,0])x0();
}
module x2(){
    // 
    extrudeWithRadius(10,-2,2)x0();
}
module x3(){
    // 
    rotate_extrude(angle=180,$fn=8)x0();
}

module x4(){
    // 
    //rotate_extrudeWithRadius(angle=180,2,-2,2,$fn=8)x0();
}


module x5(){
    // 
    rotate_extrude($fn=3)x0();
}

module c0(){
    translate([25,0,0])circle(10);
}

module c1(){
    linear_extrude(10)c0();
}
module c2(){
    extrudeWithRadius(10,-2,2)c0();
}

module c3(){
    rotate_extrude(angle=180,$fn=8)c0();
}


module c4(){
   // rotate_extrudeWithRadius(angle=180,2,-2,2,$fn=8)c0();
}


@drf5n
Copy link
Author

drf5n commented Feb 24, 2024

Apropos of nothing:

// Generate radiused regular polygons with a function

include <Round-Anything/polyround.scad>

function reg_radiipoints(sides,radius,rounds)=
[ for (th = [for(i =[0:sides-1]) i*(360/sides)]) [radius*cos(th), radius*sin(th),rounds] ];

plate();

module plate(){
    for (sides=[3:10]){
        translate([(sides-3)*20,0,0])polyBoss(sides,d=10,rounded=1);
    }    
}

module polyBoss(sides=6,d=10,h=10,r2=1,rounded=0){
    r=d/2;
    radiipoints = reg_radiipoints(sides,r,r2);
    if(rounded)polyRoundExtrude(radiipoints,h,r2,-r2);    
    if(!rounded)linear_extrude(h)polygon(polyRound(radiipoints,10));
}
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant