Welcome! Log In Create A New Profile

Advanced

Rotate extrude help needed

Posted by andy.wpg 
Rotate extrude help needed
April 28, 2022 08:19PM
I have hit the wall on this one, and you’re going to laugh, because it’s probably so simple.

I need to make a disc 35mm across, 3mm thick, with a rounded edge.

To that end, I was able to create the points to make a polygon rectangle 17.5 X, 3mm Y and that extrudes fine into a disc 35mm across with square edges.

The problem comes in when I try to create a circle at the end, 1.5mm radius, centered at X17.5, Y1.5. I’ve tried a few ways, but nothing works.

Could anyone offer some guidance on this? I’m tearing my hair out at this point.

Edited 2 time(s). Last edit at 04/28/2022 08:28PM by andy.wpg.


"I have noticed that even those who assert that everything is predestined and that
we can change nothing about it still look both ways before they cross the street"

-Stephen Hawking
Re: Rotate extrude help needed
April 28, 2022 09:37PM
Adapted from the previous thread [reprap.org]

// chamfercyl - create a cylinder with round chamfered ends
module chamfercyl(
   r,              // cylinder radius
   h,              // cylinder height
   b=0,            // bottom chamfer radius (=0 none, >0 outside, <0 inside)
   t=0,            // top chamfer radius (=0 none, >0 outside, <0 inside)
   offset=[[0,0]], // optional offsets in X and Y to create
                   // convex hulls at slice level
   slices=10,      // number of slices used for chamfering
   eps=0.01,       // tiny overlap of slices
){
    astep=90/slices;
    hull()for(o = offset)
       translate([o[0],o[1],abs(b)-eps])cylinder(r=r,h=h-abs(b)-abs(t)+2*eps);
    if(b)for(a=[0:astep:89.999])hull()for(o = offset)
       translate([o[0],o[1],abs(b)-abs(b)*sin(a+astep)-eps])
          cylinder(r2=r+(1-cos(a))*b,r1=r+(1-cos(a+astep))*b,h=(sin(a+astep)-sin(a))*abs(b)+2*eps);
    if(t)for(a=[0:astep:89.999])hull()for(o = offset)
       translate([o[0],o[1],h-abs(t)+abs(t)*sin(a)-eps])
          cylinder(r1=r+(1-cos(a))*t,r2=r+(1-cos(a+astep))*t,h=(sin(a+astep)-sin(a))*abs(t)+2*eps);
}

$fn=60;
chamfercyl(35/2,3,-0.5,-0.5);  // chamfer both edges
color("red") translate ([-36,0,0]) chamfercyl(35/2,3,-0.0,-0.5); // chamfer top edge
color("blue") translate ([36,0,0]) chamfercyl(35/2,3,-0.5,-0.0); // chamfer bottom edge 
Re: Rotate extrude help needed
April 28, 2022 10:06PM
Thanks for that, I’ll give it a try in the morning. I did do a search for rotate extrude, but nothing showed up in the results.


"I have noticed that even those who assert that everything is predestined and that
we can change nothing about it still look both ways before they cross the street"

-Stephen Hawking
Re: Rotate extrude help needed
April 29, 2022 01:21PM
That worked, thanks!

I woke up at 4am this morning and ran downstairs to try the following. I guess I was thinking about it in my sleep! :-)

$fn=100;
union()
{
rotate_extrude(convexity = 10)
translate([27, 0, 0])
circle(r = 1.5, $fn = 100);
}
translate([0,0,-1.5])
cylinder(3,27,27);

I'm not sure if the union is necessary, I didn't try without it. This is a quick and dirty acceptable version, yours is much more elegant.


"I have noticed that even those who assert that everything is predestined and that
we can change nothing about it still look both ways before they cross the street"

-Stephen Hawking
Re: Rotate extrude help needed
July 25, 2022 11:06AM
Why not
hull() {
rotate_extrude(convexity = 10, $fn = 100)
translate([27, 0, 0])
circle(r = 1.5, $fn = 100);
}
?
Re: Rotate extrude help needed
July 26, 2022 09:22AM
Maybe faster

rotate_extrude(convexity = 10, $fn = 100) {
union() {
translate([27, 0, 0]) {
circle(r = 1.5, $fn = 100);
}
square([27, 1.5]);
}
}

Edited 2 time(s). Last edit at 07/26/2022 10:55AM by F14Claude.
Re: Rotate extrude help needed
July 27, 2022 03:22PM
I will try that! Thanks!


"I have noticed that even those who assert that everything is predestined and that
we can change nothing about it still look both ways before they cross the street"

-Stephen Hawking
Sorry, only registered users may post in this forum.

Click here to login