discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

Rounding convex edges without minkowski?

J
jsc
Fri, Jun 2, 2017 7:48 AM

I have just published my universal OpenSCAD fidget spinner model:
https://www.thingiverse.com/thing:2360208

Calculating the three circle Apollonius problem in OpenSCAD was a pretty
challenge, but what really frustrated me was rounding off the edges of the
final profile. I finally settled on minkowski sum with a sphere on a minimal
height 2D profile extrusion, but for a high resolution model it takes about
ten minutes to calculate.

Is there any more efficient way to round these edges than this? I don't see
how I can use hull() in this case.

--
View this message in context: http://forum.openscad.org/Rounding-convex-edges-without-minkowski-tp21621.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

I have just published my universal OpenSCAD fidget spinner model: https://www.thingiverse.com/thing:2360208 Calculating the three circle Apollonius problem in OpenSCAD was a pretty challenge, but what really frustrated me was rounding off the edges of the final profile. I finally settled on minkowski sum with a sphere on a minimal height 2D profile extrusion, but for a high resolution model it takes about ten minutes to calculate. Is there any more efficient way to round these edges than this? I don't see how I can use hull() in this case. -- View this message in context: http://forum.openscad.org/Rounding-convex-edges-without-minkowski-tp21621.html Sent from the OpenSCAD mailing list archive at Nabble.com.
IO
Ian Oliver
Fri, Jun 2, 2017 10:05 AM

On 2017-06-02 08:48, jsc wrote:

Is there any more efficient way to round these edges than this? I don't see
how I can use hull() in this case.

Maybe change your current linear extrude to several of them in a for
loop and use the loop variable in some interesting way to change the
value of offset.

I put this in spinner_preview and it looks OK. Crank up slices based on
whether previewing or not?

   slices = 50;
   curve = bearing_height/2;
   for (s = [0 : 1 : slices-1])
     translate ([0, 0, bearing_height/slices*s])
         linear_extrude(height = bearing_height/slices+0.01, center 

= true) offset (-curve*(1-cos((s/slices-0.5)*180))) profile();

The offset function is down to you and could easily be flat in the
middle and then just curve at top and bottom. If you can handle
Apollonius ...

On 2017-06-02 08:48, jsc wrote: > Is there any more efficient way to round these edges than this? I don't see > how I can use hull() in this case. Maybe change your current linear extrude to several of them in a for loop and use the loop variable in some interesting way to change the value of offset. I put this in spinner_preview and it looks OK. Crank up slices based on whether previewing or not? slices = 50; curve = bearing_height/2; for (s = [0 : 1 : slices-1]) translate ([0, 0, bearing_height/slices*s]) linear_extrude(height = bearing_height/slices+0.01, center = true) offset (-curve*(1-cos((s/slices-0.5)*180))) profile(); The offset function is down to you and could easily be flat in the middle and then just curve at top and bottom. If you can handle Apollonius ...
IO
Ian Oliver
Fri, Jun 2, 2017 10:15 AM

I put this in spinner_preview and it looks OK. Crank up slices based

on whether previewing or not?

Hmm, still pretty slow at rendering, but could use plain extrude for the
middle and just some offset slices at top and bottom?

Or change approach and use rounded cylinders to construct your spinner?

> I put this in spinner_preview and it looks OK. Crank up slices based on whether previewing or not? Hmm, still pretty slow at rendering, but could use plain extrude for the middle and just some offset slices at top and bottom? Or change approach and use rounded cylinders to construct your spinner?
IO
Ian Oliver
Fri, Jun 2, 2017 10:52 AM

Sorry, should be "offset (delta= ..." but maybe that's default?

You also may want to remove the bearing and weights as 2D objects and
the offset can then apply to those too so the inner holes are chamfered,
but maybe you don't actually want this?

Sorry, should be "offset (delta= ..." but maybe that's default? You also may want to remove the bearing and weights as 2D objects and the offset can then apply to those too so the inner holes are chamfered, but maybe you don't actually want this?
RP
Ronaldo Persiano
Fri, Jun 2, 2017 5:56 PM

In your particular case of filleting circular forms, a faster method is to
union rotated extrusions. The snapshot versions of OpenSCAD allow to
prescribe an angle in the rotate_extrude to help things go easier.

2017-06-02 4:48 GMT-03:00 jsc jsc@alum.mit.edu:

I have just published my universal OpenSCAD fidget spinner model:
https://www.thingiverse.com/thing:2360208

Calculating the three circle Apollonius problem in OpenSCAD was a pretty
challenge, but what really frustrated me was rounding off the edges of the
final profile. I finally settled on minkowski sum with a sphere on a
minimal
height 2D profile extrusion, but for a high resolution model it takes about
ten minutes to calculate.

Is there any more efficient way to round these edges than this? I don't see
how I can use hull() in this case.

--
View this message in context: http://forum.openscad.org/
Rounding-convex-edges-without-minkowski-tp21621.html
Sent from the OpenSCAD mailing list archive at Nabble.com.


OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

In your particular case of filleting circular forms, a faster method is to union rotated extrusions. The snapshot versions of OpenSCAD allow to prescribe an angle in the rotate_extrude to help things go easier. 2017-06-02 4:48 GMT-03:00 jsc <jsc@alum.mit.edu>: > I have just published my universal OpenSCAD fidget spinner model: > https://www.thingiverse.com/thing:2360208 > > Calculating the three circle Apollonius problem in OpenSCAD was a pretty > challenge, but what really frustrated me was rounding off the edges of the > final profile. I finally settled on minkowski sum with a sphere on a > minimal > height 2D profile extrusion, but for a high resolution model it takes about > ten minutes to calculate. > > Is there any more efficient way to round these edges than this? I don't see > how I can use hull() in this case. > > > > -- > View this message in context: http://forum.openscad.org/ > Rounding-convex-edges-without-minkowski-tp21621.html > Sent from the OpenSCAD mailing list archive at Nabble.com. > > _______________________________________________ > OpenSCAD mailing list > Discuss@lists.openscad.org > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org >
J
jsc
Fri, Jun 2, 2017 6:36 PM

I simplified your code to:Instead of translating each slice into place, I
just made taller and taller extrusions working in. As you noted, it is quite
slow to render, and the curve is pointier than I would have expected, for
some reason.

--
View this message in context: http://forum.openscad.org/Rounding-convex-edges-without-minkowski-tp21621p21626.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

I simplified your code to:Instead of translating each slice into place, I just made taller and taller extrusions working in. As you noted, it is quite slow to render, and the curve is pointier than I would have expected, for some reason. -- View this message in context: http://forum.openscad.org/Rounding-convex-edges-without-minkowski-tp21621p21626.html Sent from the OpenSCAD mailing list archive at Nabble.com.
JD
Jerry Davis
Fri, Jun 2, 2017 6:37 PM

There are more ways to skin that cat.

I have sometimes, if I wanted rounded corners, done an intersection with a
sphere (just big enough, to round the corners on a cube for instance).

--
Extra Ham Operator: K7AZJ
Registered Linux User: 275424
Raspberry Pi and Openscad developer

The most exciting phrase to hear in science - the one that heralds new
discoveries - is not "Eureka!" but "That's funny...".
- Isaac. Asimov

On Fri, Jun 2, 2017 at 10:56 AM, Ronaldo Persiano rcmpersiano@gmail.com
wrote:

In your particular case of filleting circular forms, a faster method is to
union rotated extrusions. The snapshot versions of OpenSCAD allow to
prescribe an angle in the rotate_extrude to help things go easier.

2017-06-02 4:48 GMT-03:00 jsc jsc@alum.mit.edu:

I have just published my universal OpenSCAD fidget spinner model:
https://www.thingiverse.com/thing:2360208

Calculating the three circle Apollonius problem in OpenSCAD was a pretty
challenge, but what really frustrated me was rounding off the edges of the
final profile. I finally settled on minkowski sum with a sphere on a
minimal
height 2D profile extrusion, but for a high resolution model it takes
about
ten minutes to calculate.

Is there any more efficient way to round these edges than this? I don't
see
how I can use hull() in this case.

--
View this message in context: http://forum.openscad.org/Roun
ding-convex-edges-without-minkowski-tp21621.html
Sent from the OpenSCAD mailing list archive at Nabble.com.


OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

There are more ways to skin that cat. I have sometimes, if I wanted rounded corners, done an intersection with a sphere (just big enough, to round the corners on a cube for instance). -- Extra Ham Operator: K7AZJ Registered Linux User: 275424 Raspberry Pi and Openscad developer *The most exciting phrase to hear in science - the one that heralds new discoveries - is not "Eureka!" but "That's funny...".*- Isaac. Asimov On Fri, Jun 2, 2017 at 10:56 AM, Ronaldo Persiano <rcmpersiano@gmail.com> wrote: > In your particular case of filleting circular forms, a faster method is to > union rotated extrusions. The snapshot versions of OpenSCAD allow to > prescribe an angle in the rotate_extrude to help things go easier. > > 2017-06-02 4:48 GMT-03:00 jsc <jsc@alum.mit.edu>: > >> I have just published my universal OpenSCAD fidget spinner model: >> https://www.thingiverse.com/thing:2360208 >> >> Calculating the three circle Apollonius problem in OpenSCAD was a pretty >> challenge, but what really frustrated me was rounding off the edges of the >> final profile. I finally settled on minkowski sum with a sphere on a >> minimal >> height 2D profile extrusion, but for a high resolution model it takes >> about >> ten minutes to calculate. >> >> Is there any more efficient way to round these edges than this? I don't >> see >> how I can use hull() in this case. >> >> >> >> -- >> View this message in context: http://forum.openscad.org/Roun >> ding-convex-edges-without-minkowski-tp21621.html >> Sent from the OpenSCAD mailing list archive at Nabble.com. >> >> _______________________________________________ >> OpenSCAD mailing list >> Discuss@lists.openscad.org >> http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org >> > > > _______________________________________________ > OpenSCAD mailing list > Discuss@lists.openscad.org > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org > >
HL
Hans L
Fri, Jun 2, 2017 6:37 PM

My star knob design has the same sort of profile as your spinner and
rounded edges all over, you can maybe get some ideas from how I
modeled that.  Its basically what ronaldo says, just do a bunch of
partial rotate_extrudes.
https://www.thingiverse.com/thing:1562501

There are some primitive fillet related functions in the star knob
script that I think originated from here:
https://github.com/jfhbrook/openscad-fillets/blob/master/fillets.scad
But IIRC I ended up modifying the functions many times to fit specific
things I needed that they no longer resemble to original code.

If I were to re-write it today I would probably replace those fillet
functions with some polygon generating functions that incorporate the
"arc" function from my FunctionalOpenSCAD library (
https://github.com/thehans/FunctionalOpenSCAD/blob/master/functional.scad
)

Also, I wish this sort of geometry problem was referred to as the
Appolonius problem when I was solving it myself!

Hans

On Fri, Jun 2, 2017 at 12:56 PM, Ronaldo Persiano rcmpersiano@gmail.com wrote:

In your particular case of filleting circular forms, a faster method is to
union rotated extrusions. The snapshot versions of OpenSCAD allow to
prescribe an angle in the rotate_extrude to help things go easier.

2017-06-02 4:48 GMT-03:00 jsc jsc@alum.mit.edu:

I have just published my universal OpenSCAD fidget spinner model:
https://www.thingiverse.com/thing:2360208

Calculating the three circle Apollonius problem in OpenSCAD was a pretty
challenge, but what really frustrated me was rounding off the edges of the
final profile. I finally settled on minkowski sum with a sphere on a
minimal
height 2D profile extrusion, but for a high resolution model it takes
about
ten minutes to calculate.

Is there any more efficient way to round these edges than this? I don't
see
how I can use hull() in this case.

--
View this message in context:
http://forum.openscad.org/Rounding-convex-edges-without-minkowski-tp21621.html
Sent from the OpenSCAD mailing list archive at Nabble.com.


OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

My star knob design has the same sort of profile as your spinner and rounded edges all over, you can maybe get some ideas from how I modeled that. Its basically what ronaldo says, just do a bunch of partial rotate_extrudes. https://www.thingiverse.com/thing:1562501 There are some primitive fillet related functions in the star knob script that I think originated from here: https://github.com/jfhbrook/openscad-fillets/blob/master/fillets.scad But IIRC I ended up modifying the functions many times to fit specific things I needed that they no longer resemble to original code. If I were to re-write it today I would probably replace those fillet functions with some polygon generating functions that incorporate the "arc" function from my FunctionalOpenSCAD library ( https://github.com/thehans/FunctionalOpenSCAD/blob/master/functional.scad ) Also, I wish this sort of geometry problem was referred to as the Appolonius problem when I was solving it myself! Hans On Fri, Jun 2, 2017 at 12:56 PM, Ronaldo Persiano <rcmpersiano@gmail.com> wrote: > In your particular case of filleting circular forms, a faster method is to > union rotated extrusions. The snapshot versions of OpenSCAD allow to > prescribe an angle in the rotate_extrude to help things go easier. > > 2017-06-02 4:48 GMT-03:00 jsc <jsc@alum.mit.edu>: >> >> I have just published my universal OpenSCAD fidget spinner model: >> https://www.thingiverse.com/thing:2360208 >> >> Calculating the three circle Apollonius problem in OpenSCAD was a pretty >> challenge, but what really frustrated me was rounding off the edges of the >> final profile. I finally settled on minkowski sum with a sphere on a >> minimal >> height 2D profile extrusion, but for a high resolution model it takes >> about >> ten minutes to calculate. >> >> Is there any more efficient way to round these edges than this? I don't >> see >> how I can use hull() in this case. >> >> >> >> -- >> View this message in context: >> http://forum.openscad.org/Rounding-convex-edges-without-minkowski-tp21621.html >> Sent from the OpenSCAD mailing list archive at Nabble.com. >> >> _______________________________________________ >> OpenSCAD mailing list >> Discuss@lists.openscad.org >> http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org > > > > _______________________________________________ > OpenSCAD mailing list > Discuss@lists.openscad.org > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org >
J
jsc
Fri, Jun 2, 2017 7:02 PM

jsc wrote

... the curve is pointier than I would have expected, for some reason.

Oh, right, must base the curve on angle, not z height:

 slices = 40; 
 curve_r = bearing_height/2; 
 for (s = [1 : slices]) {
  h = s*bearing_height/slices;
  theta = asin(h / bearing_height);
  linear_extrude(height = h, center = true)
       offset(delta = curve_r * (cos(theta) - 1))
       profile();
 }

I will try out some of the suggestions other people have made to this
thread, too.

--
View this message in context: http://forum.openscad.org/Rounding-convex-edges-without-minkowski-tp21621p21629.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

jsc wrote > ... the curve is pointier than I would have expected, for some reason. Oh, right, must base the curve on angle, not z height: slices = 40; curve_r = bearing_height/2; for (s = [1 : slices]) { h = s*bearing_height/slices; theta = asin(h / bearing_height); linear_extrude(height = h, center = true) offset(delta = curve_r * (cos(theta) - 1)) profile(); } I will try out some of the suggestions other people have made to this thread, too. -- View this message in context: http://forum.openscad.org/Rounding-convex-edges-without-minkowski-tp21621p21629.html Sent from the OpenSCAD mailing list archive at Nabble.com.
RP
Ronaldo Persiano
Fri, Jun 2, 2017 9:52 PM

Your code spent more then 28 min. to render in my rather old notebook. The
following code is a redesign of spinner_solid() using rotate_extrude
instead of minkovsky. Now, it renders in 4 min in my computer.

module spinner_solid()
{
// from body()
poly = [[0, bearing_to_weight_centers_dist],
[tc[0], tc[1]],
[cos(30)*bearing_to_weight_centers_dist,
-sin(30)*bearing_to_weight_centers_dist],
[0, -sqrt(tc[0]*tc[0] + tc[1]*tc[1])],
[-cos(30)*bearing_to_weight_centers_dist,
-sin(30)*bearing_to_weight_centers_dist],
[-tc[0], tc[1]]];
r  = bearing_height/2;
x1 = bearing_to_weight_centers_dist;
R  = lobe_r;
x2 = norm([tc[0],tc[1]]);

// the three lobes
rotate( 90) translate([x1,0,0]) filled_torus(R,r);
rotate(-30) translate([x1,0,0]) filled_torus(R,r);
rotate(210) translate([x1,0,0]) filled_torus(R,r);

// the concave section
intersection(){
    translate([0,0,-r])
        linear_extrude(height=2*r) polygon(poly);
    union(){
        rotate( 30) translate([x2,0,0]) torus(tc[2],r);
        rotate(-90) translate([x2,0,0]) torus(tc[2],r);
        rotate(150) translate([x2,0,0]) torus(tc[2],r);
    }
}

// the center filling
translate([0,0,-r])
difference(){
    linear_extrude(height=2*r) body();
    rotate( 30) translate([x2,0,r])

cylinder(r=tc[2],h=2r+1,center=true);
rotate(-90) translate([x2,0,r])
cylinder(r=tc[2],h=2
r+1,center=true);
rotate(150) translate([x2,0,r])
cylinder(r=tc[2],h=2*r+1,center=true);
}
}

2017-06-02 16:02 GMT-03:00 jsc jsc@alum.mit.edu:

jsc wrote

I will try out some of the suggestions other people have made to this
thread, too.

Your code spent more then 28 min. to render in my rather old notebook. The following code is a redesign of spinner_solid() using rotate_extrude instead of minkovsky. Now, it renders in 4 min in my computer. module spinner_solid() { // from body() poly = [[0, bearing_to_weight_centers_dist], [tc[0], tc[1]], [cos(30)*bearing_to_weight_centers_dist, -sin(30)*bearing_to_weight_centers_dist], [0, -sqrt(tc[0]*tc[0] + tc[1]*tc[1])], [-cos(30)*bearing_to_weight_centers_dist, -sin(30)*bearing_to_weight_centers_dist], [-tc[0], tc[1]]]; r = bearing_height/2; x1 = bearing_to_weight_centers_dist; R = lobe_r; x2 = norm([tc[0],tc[1]]); // the three lobes rotate( 90) translate([x1,0,0]) filled_torus(R,r); rotate(-30) translate([x1,0,0]) filled_torus(R,r); rotate(210) translate([x1,0,0]) filled_torus(R,r); // the concave section intersection(){ translate([0,0,-r]) linear_extrude(height=2*r) polygon(poly); union(){ rotate( 30) translate([x2,0,0]) torus(tc[2],r); rotate(-90) translate([x2,0,0]) torus(tc[2],r); rotate(150) translate([x2,0,0]) torus(tc[2],r); } } // the center filling translate([0,0,-r]) difference(){ linear_extrude(height=2*r) body(); rotate( 30) translate([x2,0,r]) cylinder(r=tc[2],h=2*r+1,center=true); rotate(-90) translate([x2,0,r]) cylinder(r=tc[2],h=2*r+1,center=true); rotate(150) translate([x2,0,r]) cylinder(r=tc[2],h=2*r+1,center=true); } } 2017-06-02 16:02 GMT-03:00 jsc <jsc@alum.mit.edu>: > jsc wrote > > I will try out some of the suggestions other people have made to this > thread, too. >