discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

Creating inner bevel

WW
Whosa whatsis
Thu, Aug 15, 2024 11:01 PM

Minkowski isn't nearly as slow as it used to be. For reference, the one I showed took 30 seconds to render (using a recent nightly build running on an M1 Mac). I've done this kind of job using complicated negative shapes constructed using cylinders, spheres, rotate_extrude, etc., but not only are methods using hull(), offset(), and (when necessary) minkowski easier to read, but the extra rendering time is nothing compared to the extra design time to make it the old fashioned way.

With the method I showed, you can develop your shape in 2d (with instant previewing) until all of the dimensions are correct, then wait to add (or to activate) the minkowski part until you think everything else is finished.

On Aug 15, 2024, at 15:49, Jordan Brown via Discuss discuss@lists.openscad.org wrote:

There has been a lot of detailed discussion, but little in the way of general discussion of the problem.

There are three basic approaches:

Create a 2D shape with holes, extrude it, and somehow (probably with Minkowski) round the corners.
• Create a 3D shape, and a shape that you want removed, and difference the two.
• Create the entire shape as a polyhedron, with the rounding designed in.
Minkowski can be really slow, so I generally don’t consider it. Also, it might be tricky to restrict its effect to the edges that you want rounded.

Creating a polyhedron is very very powerful and can be very very hard.  I think BOSL2 might have the tools required to create a polyhedron like this, but I’m not familiar enough to be sure. Maybe Adrian can chime in there.

I would personally think in terms of the second option, subtracting the unwanted shape from the original shape.

Constructing the negative shape can be complex, but is generally straightforward even if tedious. For your oval slots, start with two cylinders joined by a cube.

I’m on my iPad so can’t experiment, but something like

difference() {
cube([50,50,10], center=true);
translate([-10,0,0]) cylinder(h=11, d=10, center=true);
translate([10,0,0]) cylinder(h=11, d=10, center=true);
cube([20,10,11], center=true);
}

That gets you a straight-sided slot.  Sculpt it as desired by subtracting stuff from the negative piece. Note, for instance, that a cylinder is a rotationally-extruded square, so if you want round edges at the ends you might take a square, subtract a circle along one edge, and rotationally extrude that. Similarly, the cube in the middle is an extruded square, so take a square, subtract circles on each side, and extrude that. However you construct it, when you have your negative “die”, subtract it from the main object. Always remember to make the negative object a little thicker than the original, so that it protrudes from both sides.

If there is interest, I’ll write up a demo snippet in a few days when I get back to my desktop computer.


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org

Minkowski isn't nearly as slow as it used to be. For reference, the one I showed took 30 seconds to render (using a recent nightly build running on an M1 Mac). I've done this kind of job using complicated negative shapes constructed using cylinders, spheres, rotate_extrude, etc., but not only are methods using hull(), offset(), and (when necessary) minkowski easier to read, but the extra rendering time is nothing compared to the extra design time to make it the old fashioned way. With the method I showed, you can develop your shape in 2d (with instant previewing) until all of the dimensions are correct, then wait to add (or to activate) the minkowski part until you think everything else is finished. > On Aug 15, 2024, at 15:49, Jordan Brown via Discuss <discuss@lists.openscad.org> wrote: > > There has been a lot of detailed discussion, but little in the way of general discussion of the problem. > > There are three basic approaches: > • > Create a 2D shape with holes, extrude it, and somehow (probably with Minkowski) round the corners. > • Create a 3D shape, and a shape that you want removed, and difference the two. > • Create the entire shape as a polyhedron, with the rounding designed in. > Minkowski can be really slow, so I generally don’t consider it. Also, it might be tricky to restrict its effect to the edges that you want rounded. > > Creating a polyhedron is very very powerful and can be very very hard. I think BOSL2 might have the tools required to create a polyhedron like this, but I’m not familiar enough to be sure. Maybe Adrian can chime in there. > > I would personally think in terms of the second option, subtracting the unwanted shape from the original shape. > > Constructing the negative shape can be complex, but is generally straightforward even if tedious. For your oval slots, start with two cylinders joined by a cube. > > I’m on my iPad so can’t experiment, but something like > > difference() { > cube([50,50,10], center=true); > translate([-10,0,0]) cylinder(h=11, d=10, center=true); > translate([10,0,0]) cylinder(h=11, d=10, center=true); > cube([20,10,11], center=true); > } > > That gets you a straight-sided slot. Sculpt it as desired by subtracting stuff from the negative piece. Note, for instance, that a cylinder is a rotationally-extruded square, so if you want round edges at the ends you might take a square, subtract a circle along one edge, and rotationally extrude that. Similarly, the cube in the middle is an extruded square, so take a square, subtract circles on each side, and extrude that. However you construct it, when you have your negative “die”, subtract it from the main object. Always remember to make the negative object a little thicker than the original, so that it protrudes from both sides. > > If there is interest, I’ll write up a demo snippet in a few days when I get back to my desktop computer. > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org
RW
Raymond West
Fri, Aug 16, 2024 12:18 PM

My previous example, is additive, i.e, have a basic shape and add on
fillets, etc. That means, if you are wanting to deal with the overall
size, which is generally true, than the radius has to be taken off the
outside edges, and added to internal edges.

For shapes such as have been shown, then simple maths suffices, but more
complex shapes offset can be used. But Minkowski can be slow, as you
say, certainly at high resolution and complex profiles. The rounded
chamfers are the problem.  For more basic shapes, boxes, etc., then I
generate a profile strip and difference with the edges. A question of
finding the best solution for a particular problem, one size does not
fit all, so to speak.

You can generate a profile, the negative of a sphere, and generate
'holes' in shapes such that when differenced will leave a rounded edge.
I've attached a bit of code. The advantage is that no maths is needed to
subtract the radius. The disadvantage is that Minkowski is much slower
with the complex profile,  overall it is cumbersome, and often it breaks
the mesh when differencing.

The way in which I believe most folk think wrt rounding edges, is that
you start off with square edges, and remove the sharp edges. Bare
openscad can not do that easily. However there are plenty of other
software tools that can. In reality, it is often more expedient  to
mechanically finish the object, files, emery-cloth, whatever. Possibly a
woodworker would think differently, since they often glue on mouldings.

d=10;
$fn=80;
module profile(){
   rotate_extrude(){
      difference(){
        translate([-d/2,0])
        square(d);
        translate([0.01+d/2,d/2])
        circle(d=d);
           translate([-d-d,0])  //cut off lhs
           square(d+d);
      }
   }
}

  //  profile();

module shape(){
    linear_extrude(0.001){
       difference(){
          square (100);
          translate([25,25]) square(50);
      }
   }
}
module stamp(){
   minkowski(){
     shape();
     profile();
   }
}

stamp();

On 15/08/2024 23:49, Jordan Brown via Discuss wrote:

There has been a lot of detailed discussion, but little in the way of
general discussion of the problem.

There are three basic approaches:

  • Create a 2D shape with holes, extrude it, and somehow (probably
    with Minkowski) round the corners.
  • Create a 3D shape, and a shape that you want removed, and
    difference the two.
  • Create the entire shape as a polyhedron, with the rounding
    designed in.

Minkowski can be really slow, so I generally don’t consider it. Also,
it might be tricky to restrict its effect to the edges that you want
rounded.

Creating a polyhedron is very very powerful and can be very very hard.
 I think BOSL2 might have the tools required to create a polyhedron
like this, but I’m not familiar enough to be sure. Maybe Adrian can
chime in there.

I would personally think in terms of the second option, subtracting
the unwanted shape from the original shape.

Constructing the negative shape can be complex, but is generally
straightforward even if tedious. For your oval slots, start with two
cylinders joined by a cube.

I’m on my iPad so can’t experiment, but something like

difference() {
    cube([50,50,10], center=true);
    translate([-10,0,0]) cylinder(h=11, d=10, center=true);
    translate([10,0,0]) cylinder(h=11, d=10, center=true);
    cube([20,10,11], center=true);
}

That gets you a straight-sided slot.  Sculpt it as desired by
subtracting stuff from the negative piece. Note, for instance, that a
cylinder is a rotationally-extruded square, so if you want round edges
at the ends you might take a square, subtract a circle along one edge,
and rotationally extrude that. Similarly, the cube in the middle is an
extruded square, so take a square, subtract circles on each side, and
extrude that. However you construct it, when you have your negative
“die”, subtract it from the main object. Always remember to make the
negative object a little thicker than the original, so that it
protrudes from both sides.

If there is interest, I’ll write up a demo snippet in a few days when
I get back to my desktop computer.


OpenSCAD mailing list
To unsubscribe send an email todiscuss-leave@lists.openscad.org

My previous example, is additive, i.e, have a basic shape and add on fillets, etc. That means, if you are wanting to deal with the overall size, which is generally true, than the radius has to be taken off the outside edges, and added to internal edges. For shapes such as have been shown, then simple maths suffices, but more complex shapes offset can be used. But Minkowski can be slow, as you say, certainly at high resolution and complex profiles. The rounded chamfers are the problem.  For more basic shapes, boxes, etc., then I generate a profile strip and difference with the edges. A question of finding the best solution for a particular problem, one size does not fit all, so to speak. You can generate a profile, the negative of a sphere, and generate 'holes' in shapes such that when differenced will leave a rounded edge. I've attached a bit of code. The advantage is that no maths is needed to subtract the radius. The disadvantage is that Minkowski is much slower with the complex profile,  overall it is cumbersome, and often it breaks the mesh when differencing. The way in which I believe most folk think wrt rounding edges, is that you start off with square edges, and remove the sharp edges. Bare openscad can not do that easily. However there are plenty of other software tools that can. In reality, it is often more expedient  to mechanically finish the object, files, emery-cloth, whatever. Possibly a woodworker would think differently, since they often glue on mouldings. d=10; $fn=80; module profile(){    rotate_extrude(){       difference(){         translate([-d/2,0])         square(d);         translate([0.01+d/2,d/2])         circle(d=d);            translate([-d-d,0])  //cut off lhs            square(d+d);       }    } }   //  profile(); module shape(){     linear_extrude(0.001){        difference(){           square (100);           translate([25,25]) square(50);       }    } } module stamp(){    minkowski(){      shape();      profile();    } } stamp(); On 15/08/2024 23:49, Jordan Brown via Discuss wrote: > There has been a lot of detailed discussion, but little in the way of > general discussion of the problem. > > There are three basic approaches: > > * Create a 2D shape with holes, extrude it, and somehow (probably > with Minkowski) round the corners. > * Create a 3D shape, and a shape that you want removed, and > difference the two. > * Create the entire shape as a polyhedron, with the rounding > designed in. > > Minkowski can be really slow, so I generally don’t consider it. Also, > it might be tricky to restrict its effect to the edges that you want > rounded. > > Creating a polyhedron is very very powerful and can be very very hard. >  I think BOSL2 might have the tools required to create a polyhedron > like this, but I’m not familiar enough to be sure. Maybe Adrian can > chime in there. > > I would personally think in terms of the second option, subtracting > the unwanted shape from the original shape. > > Constructing the negative shape can be complex, but is generally > straightforward even if tedious. For your oval slots, start with two > cylinders joined by a cube. > > I’m on my iPad so can’t experiment, but something like > > difference() { >     cube([50,50,10], center=true); >     translate([-10,0,0]) cylinder(h=11, d=10, center=true); >     translate([10,0,0]) cylinder(h=11, d=10, center=true); >     cube([20,10,11], center=true); > } > > That gets you a straight-sided slot.  Sculpt it as desired by > subtracting stuff from the negative piece. Note, for instance, that a > cylinder is a rotationally-extruded square, so if you want round edges > at the ends you might take a square, subtract a circle along one edge, > and rotationally extrude that. Similarly, the cube in the middle is an > extruded square, so take a square, subtract circles on each side, and > extrude that. However you construct it, when you have your negative > “die”, subtract it from the main object. Always remember to make the > negative object a little thicker than the original, so that it > protrudes from both sides. > > If there is interest, I’ll write up a demo snippet in a few days when > I get back to my desktop computer. > > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email todiscuss-leave@lists.openscad.org
MZ
Michael Zimbaro
Fri, Aug 16, 2024 12:46 PM

Yes, the size issue is interesting.  I think what you said earlier about
reducing my size by the radius seems to be working.  Originally my part was
created with Bols2 using the 3d library.  I could not find a way to get the
inner rounded edges.  I have now switched to Bols2 2D and the Minkowski as
suggested but wow is it ever slow.  I increased my facets to 90 and my part
has been compiling for at least 30 minutes.  I want to do a test print of
the first few layers to make sure the size is right.  Interesting that you
suggested using two cylinders and a cube for the inside.  I did the same
using 2 circles and a square in 2d then extruding.

My part is almost complete.  I would like to share the code to see what
others would suggest in the future.  I always welcome a better way.  Is
anyone interested in seeing it?

On Fri, Aug 16, 2024 at 8:19 AM Raymond West via Discuss <
discuss@lists.openscad.org> wrote:

My previous example, is additive, i.e, have a basic shape and add on
fillets, etc. That means, if you are wanting to deal with the overall size,
which is generally true, than the radius has to be taken off the outside
edges, and added to internal edges.

For shapes such as have been shown, then simple maths suffices, but more
complex shapes offset can be used. But Minkowski can be slow, as you say,
certainly at high resolution and complex profiles. The rounded chamfers are
the problem.  For more basic shapes, boxes, etc., then I generate a profile
strip and difference with the edges. A question of finding the best
solution for a particular problem, one size does not fit all, so to speak.

You can generate a profile, the negative of a sphere, and generate 'holes'
in shapes such that when differenced will leave a rounded edge. I've
attached a bit of code. The advantage is that no maths is needed to
subtract the radius. The disadvantage is that Minkowski is much slower with
the complex profile,  overall it is cumbersome, and often it breaks the
mesh when differencing.

The way in which I believe most folk think wrt rounding edges, is that you
start off with square edges, and remove the sharp edges.  Bare openscad can
not do that easily. However there are plenty of other software tools that
can. In reality, it is often more expedient  to mechanically finish the
object, files, emery-cloth, whatever. Possibly a woodworker would think
differently, since they often glue on mouldings.

d=10;
$fn=80;
module profile(){
rotate_extrude(){
difference(){
translate([-d/2,0])
square(d);
translate([0.01+d/2,d/2])
circle(d=d);
translate([-d-d,0])  //cut off lhs
square(d+d);
}
}
}

//  profile();

module shape(){
linear_extrude(0.001){
difference(){
square (100);
translate([25,25]) square(50);
}
}
}
module stamp(){
minkowski(){
shape();
profile();
}
}

stamp();

On 15/08/2024 23:49, Jordan Brown via Discuss wrote:

There has been a lot of detailed discussion, but little in the way of
general discussion of the problem.

There are three basic approaches:

- Create a 2D shape with holes, extrude it, and somehow (probably with
Minkowski) round the corners.
- Create a 3D shape, and a shape that you want removed, and difference
the two.
- Create the entire shape as a polyhedron, with the rounding designed
in.

Minkowski can be really slow, so I generally don’t consider it. Also, it
might be tricky to restrict its effect to the edges that you want rounded.

Creating a polyhedron is very very powerful and can be very very hard.  I
think BOSL2 might have the tools required to create a polyhedron like this,
but I’m not familiar enough to be sure. Maybe Adrian can chime in there.

I would personally think in terms of the second option, subtracting the
unwanted shape from the original shape.

Constructing the negative shape can be complex, but is generally
straightforward even if tedious. For your oval slots, start with two
cylinders joined by a cube.

I’m on my iPad so can’t experiment, but something like

difference() {
cube([50,50,10], center=true);
translate([-10,0,0]) cylinder(h=11, d=10, center=true);
translate([10,0,0]) cylinder(h=11, d=10, center=true);
cube([20,10,11], center=true);
}

That gets you a straight-sided slot.  Sculpt it as desired by subtracting
stuff from the negative piece. Note, for instance, that a cylinder is a
rotationally-extruded square, so if you want round edges at the ends you
might take a square, subtract a circle along one edge, and rotationally
extrude that. Similarly, the cube in the middle is an extruded square, so
take a square, subtract circles on each side, and extrude that. However you
construct it, when you have your negative “die”, subtract it from the main
object. Always remember to make the negative object a little thicker than
the original, so that it protrudes from both sides.

If there is interest, I’ll write up a demo snippet in a few days when I
get back to my desktop computer.


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org

Yes, the size issue is interesting. I think what you said earlier about reducing my size by the radius seems to be working. Originally my part was created with Bols2 using the 3d library. I could not find a way to get the inner rounded edges. I have now switched to Bols2 2D and the Minkowski as suggested but wow is it ever slow. I increased my facets to 90 and my part has been compiling for at least 30 minutes. I want to do a test print of the first few layers to make sure the size is right. Interesting that you suggested using two cylinders and a cube for the inside. I did the same using 2 circles and a square in 2d then extruding. My part is almost complete. I would like to share the code to see what others would suggest in the future. I always welcome a better way. Is anyone interested in seeing it? On Fri, Aug 16, 2024 at 8:19 AM Raymond West via Discuss < discuss@lists.openscad.org> wrote: > My previous example, is additive, i.e, have a basic shape and add on > fillets, etc. That means, if you are wanting to deal with the overall size, > which is generally true, than the radius has to be taken off the outside > edges, and added to internal edges. > > For shapes such as have been shown, then simple maths suffices, but more > complex shapes offset can be used. But Minkowski can be slow, as you say, > certainly at high resolution and complex profiles. The rounded chamfers are > the problem. For more basic shapes, boxes, etc., then I generate a profile > strip and difference with the edges. A question of finding the best > solution for a particular problem, one size does not fit all, so to speak. > > You can generate a profile, the negative of a sphere, and generate 'holes' > in shapes such that when differenced will leave a rounded edge. I've > attached a bit of code. The advantage is that no maths is needed to > subtract the radius. The disadvantage is that Minkowski is much slower with > the complex profile, overall it is cumbersome, and often it breaks the > mesh when differencing. > > The way in which I believe most folk think wrt rounding edges, is that you > start off with square edges, and remove the sharp edges. Bare openscad can > not do that easily. However there are plenty of other software tools that > can. In reality, it is often more expedient to mechanically finish the > object, files, emery-cloth, whatever. Possibly a woodworker would think > differently, since they often glue on mouldings. > > d=10; > $fn=80; > module profile(){ > rotate_extrude(){ > difference(){ > translate([-d/2,0]) > square(d); > translate([0.01+d/2,d/2]) > circle(d=d); > translate([-d-d,0]) //cut off lhs > square(d+d); > } > } > } > > // profile(); > > module shape(){ > linear_extrude(0.001){ > difference(){ > square (100); > translate([25,25]) square(50); > } > } > } > module stamp(){ > minkowski(){ > shape(); > profile(); > } > } > > stamp(); > > > On 15/08/2024 23:49, Jordan Brown via Discuss wrote: > > There has been a lot of detailed discussion, but little in the way of > general discussion of the problem. > > There are three basic approaches: > > - Create a 2D shape with holes, extrude it, and somehow (probably with > Minkowski) round the corners. > - Create a 3D shape, and a shape that you want removed, and difference > the two. > - Create the entire shape as a polyhedron, with the rounding designed > in. > > Minkowski can be really slow, so I generally don’t consider it. Also, it > might be tricky to restrict its effect to the edges that you want rounded. > > Creating a polyhedron is very very powerful and can be very very hard. I > think BOSL2 might have the tools required to create a polyhedron like this, > but I’m not familiar enough to be sure. Maybe Adrian can chime in there. > > I would personally think in terms of the second option, subtracting the > unwanted shape from the original shape. > > Constructing the negative shape can be complex, but is generally > straightforward even if tedious. For your oval slots, start with two > cylinders joined by a cube. > > I’m on my iPad so can’t experiment, but something like > > difference() { > cube([50,50,10], center=true); > translate([-10,0,0]) cylinder(h=11, d=10, center=true); > translate([10,0,0]) cylinder(h=11, d=10, center=true); > cube([20,10,11], center=true); > } > > That gets you a straight-sided slot. Sculpt it as desired by subtracting > stuff from the negative piece. Note, for instance, that a cylinder is a > rotationally-extruded square, so if you want round edges at the ends you > might take a square, subtract a circle along one edge, and rotationally > extrude that. Similarly, the cube in the middle is an extruded square, so > take a square, subtract circles on each side, and extrude that. However you > construct it, when you have your negative “die”, subtract it from the main > object. Always remember to make the negative object a little thicker than > the original, so that it protrudes from both sides. > > If there is interest, I’ll write up a demo snippet in a few days when I > get back to my desktop computer. > > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org > > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org >
RW
Raymond West
Fri, Aug 16, 2024 1:45 PM

you can set $fn =20 for testing, see if it looks OK. Minkowski is then
fairly quick. When you have it looking right, then set $fn to 100, say,
for the final stl, and come back after lunch.

If it is only an stl that you want, it used to be you could feed the
scad file into AngelCad, and it used to produce an stl quite quickly.
I'm not sure if openscad has caught up wrt speed, or even if AngelCAD
accepts minkowski.  Freecad can also import scad files and render. It
allows individual edges to be selected for filleting. It tends to export
back to openscad as a large polyhedron, you lose the individual cubes
and cylinders, etc. fwiw, bevels are better for printing, not round-overs.

On 16/08/2024 13:46, Michael Zimbaro via Discuss wrote:

Yes, the size issue is interesting.  I think what you said earlier
about reducing my size by the radius seems to be working.  Originally
my part was created with Bols2 using the 3d library.  I could not find
a way to get the inner rounded edges.  I have now switched to Bols2 2D
and the Minkowski as suggested but wow is it ever slow.  I increased
my facets to 90 and my part has been compiling for at least 30
minutes.  I want to do a test print of the first few layers to make
sure the size is right.  Interesting that you suggested using two
cylinders and a cube for the inside.  I did the same using 2 circles
and a square in 2d then extruding.

My part is almost complete.  I would like to share the code to see
what others would suggest in the future.  I always welcome a better
way.  Is anyone interested in seeing it?

On Fri, Aug 16, 2024 at 8:19 AM Raymond West via Discuss
discuss@lists.openscad.org wrote:

 My previous example, is additive, i.e, have a basic shape and add
 on fillets, etc. That means, if you are wanting to deal with the
 overall size, which is generally true, than the radius has to be
 taken off the outside edges, and added to internal edges.

 For shapes such as have been shown, then simple maths suffices,
 but more complex shapes offset can be used. But Minkowski can be
 slow, as you say, certainly at high resolution and complex
 profiles. The rounded chamfers are the problem.  For more basic
 shapes, boxes, etc., then I generate a profile strip and
 difference with the edges. A question of finding the best solution
 for a particular problem, one size does not fit all, so to speak.

 You can generate a profile, the negative of a sphere, and generate
 'holes' in shapes such that when differenced will leave a rounded
 edge. I've attached a bit of code. The advantage is that no maths
 is needed to subtract the radius. The disadvantage is that
 Minkowski is much slower with the complex profile,  overall it is
 cumbersome, and often it breaks the mesh when differencing.

 The way in which I believe most folk think wrt rounding edges, is
 that you start off with square edges, and remove the sharp edges. 
 Bare openscad can not do that easily. However there are plenty of
 other software tools that can. In reality, it is often more
 expedient  to mechanically finish the object, files, emery-cloth,
 whatever. Possibly a woodworker would think differently, since
 they often glue on mouldings.

 d=10;
 $fn=80;
 module profile(){
    rotate_extrude(){
       difference(){
         translate([-d/2,0])
         square(d);
         translate([0.01+d/2,d/2])
         circle(d=d);
            translate([-d-d,0])  //cut off lhs
            square(d+d);
       }
    }
 }

   //  profile();

 module shape(){
     linear_extrude(0.001){
        difference(){
           square (100);
           translate([25,25]) square(50);
       }
    }
 }
 module stamp(){
    minkowski(){
      shape();
      profile();
    }
 }

 stamp();


 On 15/08/2024 23:49, Jordan Brown via Discuss wrote:
 There has been a lot of detailed discussion, but little in the
 way of general discussion of the problem.

 There are three basic approaches:

   * Create a 2D shape with holes, extrude it, and somehow
     (probably with Minkowski) round the corners.
   * Create a 3D shape, and a shape that you want removed, and
     difference the two.
   * Create the entire shape as a polyhedron, with the rounding
     designed in.

 Minkowski can be really slow, so I generally don’t consider it.
 Also, it might be tricky to restrict its effect to the edges that
 you want rounded.

 Creating a polyhedron is very very powerful and can be very very
 hard.  I think BOSL2 might have the tools required to create a
 polyhedron like this, but I’m not familiar enough to be sure.
 Maybe Adrian can chime in there.

 I would personally think in terms of the second option,
 subtracting the unwanted shape from the original shape.

 Constructing the negative shape can be complex, but is generally
 straightforward even if tedious. For your oval slots, start with
 two cylinders joined by a cube.

 I’m on my iPad so can’t experiment, but something like

 difference() {
     cube([50,50,10], center=true);
     translate([-10,0,0]) cylinder(h=11, d=10, center=true);
     translate([10,0,0]) cylinder(h=11, d=10, center=true);
     cube([20,10,11], center=true);
 }

 That gets you a straight-sided slot.  Sculpt it as desired by
 subtracting stuff from the negative piece. Note, for instance,
 that a cylinder is a rotationally-extruded square, so if you want
 round edges at the ends you might take a square, subtract a
 circle along one edge, and rotationally extrude that. Similarly,
 the cube in the middle is an extruded square, so take a square,
 subtract circles on each side, and extrude that. However you
 construct it, when you have your negative “die”, subtract it from
 the main object. Always remember to make the negative object a
 little thicker than the original, so that it protrudes from both
 sides.

 If there is interest, I’ll write up a demo snippet in a few days
 when I get back to my desktop computer.

 _______________________________________________
 OpenSCAD mailing list
 To unsubscribe send an email todiscuss-leave@lists.openscad.org
 _______________________________________________
 OpenSCAD mailing list
 To unsubscribe send an email to discuss-leave@lists.openscad.org

OpenSCAD mailing list
To unsubscribe send an email todiscuss-leave@lists.openscad.org

you can set $fn =20 for testing, see if it looks OK. Minkowski is then fairly quick. When you have it looking right, then set $fn to 100, say, for the final stl, and come back after lunch. If it is only an stl that you want, it used to be you could feed the scad file into AngelCad, and it used to produce an stl quite quickly. I'm not sure if openscad has caught up wrt speed, or even if AngelCAD accepts minkowski.  Freecad can also import scad files and render. It allows individual edges to be selected for filleting. It tends to export back to openscad as a large polyhedron, you lose the individual cubes and cylinders, etc. fwiw, bevels are better for printing, not round-overs. On 16/08/2024 13:46, Michael Zimbaro via Discuss wrote: > Yes, the size issue is interesting.  I think what you said earlier > about reducing my size by the radius seems to be working.  Originally > my part was created with Bols2 using the 3d library.  I could not find > a way to get the inner rounded edges.  I have now switched to Bols2 2D > and the Minkowski as suggested but wow is it ever slow.  I increased > my facets to 90 and my part has been compiling for at least 30 > minutes.  I want to do a test print of the first few layers to make > sure the size is right.  Interesting that you suggested using two > cylinders and a cube for the inside.  I did the same using 2 circles > and a square in 2d then extruding. > > My part is almost complete.  I would like to share the code to see > what others would suggest in the future.  I always welcome a better > way.  Is anyone interested in seeing it? > > On Fri, Aug 16, 2024 at 8:19 AM Raymond West via Discuss > <discuss@lists.openscad.org> wrote: > > My previous example, is additive, i.e, have a basic shape and add > on fillets, etc. That means, if you are wanting to deal with the > overall size, which is generally true, than the radius has to be > taken off the outside edges, and added to internal edges. > > For shapes such as have been shown, then simple maths suffices, > but more complex shapes offset can be used. But Minkowski can be > slow, as you say, certainly at high resolution and complex > profiles. The rounded chamfers are the problem.  For more basic > shapes, boxes, etc., then I generate a profile strip and > difference with the edges. A question of finding the best solution > for a particular problem, one size does not fit all, so to speak. > > You can generate a profile, the negative of a sphere, and generate > 'holes' in shapes such that when differenced will leave a rounded > edge. I've attached a bit of code. The advantage is that no maths > is needed to subtract the radius. The disadvantage is that > Minkowski is much slower with the complex profile,  overall it is > cumbersome, and often it breaks the mesh when differencing. > > The way in which I believe most folk think wrt rounding edges, is > that you start off with square edges, and remove the sharp edges.  > Bare openscad can not do that easily. However there are plenty of > other software tools that can. In reality, it is often more > expedient  to mechanically finish the object, files, emery-cloth, > whatever. Possibly a woodworker would think differently, since > they often glue on mouldings. > > d=10; > $fn=80; > module profile(){ >    rotate_extrude(){ >       difference(){ >         translate([-d/2,0]) >         square(d); >         translate([0.01+d/2,d/2]) >         circle(d=d); >            translate([-d-d,0])  //cut off lhs >            square(d+d); >       } >    } > } > >   //  profile(); > > module shape(){ >     linear_extrude(0.001){ >        difference(){ >           square (100); >           translate([25,25]) square(50); >       } >    } > } > module stamp(){ >    minkowski(){ >      shape(); >      profile(); >    } > } > > stamp(); > > > On 15/08/2024 23:49, Jordan Brown via Discuss wrote: >> There has been a lot of detailed discussion, but little in the >> way of general discussion of the problem. >> >> There are three basic approaches: >> >> * Create a 2D shape with holes, extrude it, and somehow >> (probably with Minkowski) round the corners. >> * Create a 3D shape, and a shape that you want removed, and >> difference the two. >> * Create the entire shape as a polyhedron, with the rounding >> designed in. >> >> Minkowski can be really slow, so I generally don’t consider it. >> Also, it might be tricky to restrict its effect to the edges that >> you want rounded. >> >> Creating a polyhedron is very very powerful and can be very very >> hard.  I think BOSL2 might have the tools required to create a >> polyhedron like this, but I’m not familiar enough to be sure. >> Maybe Adrian can chime in there. >> >> I would personally think in terms of the second option, >> subtracting the unwanted shape from the original shape. >> >> Constructing the negative shape can be complex, but is generally >> straightforward even if tedious. For your oval slots, start with >> two cylinders joined by a cube. >> >> I’m on my iPad so can’t experiment, but something like >> >> difference() { >>     cube([50,50,10], center=true); >>     translate([-10,0,0]) cylinder(h=11, d=10, center=true); >>     translate([10,0,0]) cylinder(h=11, d=10, center=true); >>     cube([20,10,11], center=true); >> } >> >> That gets you a straight-sided slot.  Sculpt it as desired by >> subtracting stuff from the negative piece. Note, for instance, >> that a cylinder is a rotationally-extruded square, so if you want >> round edges at the ends you might take a square, subtract a >> circle along one edge, and rotationally extrude that. Similarly, >> the cube in the middle is an extruded square, so take a square, >> subtract circles on each side, and extrude that. However you >> construct it, when you have your negative “die”, subtract it from >> the main object. Always remember to make the negative object a >> little thicker than the original, so that it protrudes from both >> sides. >> >> If there is interest, I’ll write up a demo snippet in a few days >> when I get back to my desktop computer. >> >> _______________________________________________ >> OpenSCAD mailing list >> To unsubscribe send an email todiscuss-leave@lists.openscad.org > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org > > > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email todiscuss-leave@lists.openscad.org
PK
Peter Kriens
Fri, Aug 16, 2024 2:55 PM

You might want to take a look at https://learn.cadhub.xyz/docs/round-anything/api-reference/#polyround

The library can round a path with square corners with variable radii. For this, you add the radius as the z coordinate in a 3vec. It can then extrude this path with a radius at the end. For the outer component you can use a positive radius for the under and top side. You can then make the inner shapes the same way and subtract them. However, you can then make the radii of the ends negative, which leaves a nice round shape.

The library could use some love. If your path contains undef it will hang ... :-( (Surprised OpenSCAD does not run the rendering in a background thread?) This is the function of the val() routine, to check this.

The quickly hacked together code.

use <lib/Round-Anything/polyround.scad>

$fn=50;
function val(p) = [for(i=p) assert( ! (is_undef(i.x) || is_undef(i.y)|| is_undef(i.y)))];

rect=[60,60];
round=[140,20];
a = 20;
/*

     -rect.x/2            rect.x/2
        a----------------b            rect.y/2
        |                |
  m-----n                c-----d      round.y
 /                              \

l+                                + e
\                              /
k-----j                g-----f      0
|                |
|                |
i----------------h            -rect.y/2

                0
        

*/

l = -rect.x/2;
r = -l;
t = rect.y/2;
b = -t;

path = [
[l,  t,  5], // a
[r,  t,  5], // b
[r,  round.y,  5], // c
[round.x/2-round.y,  round.y,  5], // d
[round.x/2,          round.y/2,  round.y], // e
[round.x/2-round.y,  0,  round.y], // f
[r,  0,  5], // g
[r,  b,  5], // h
[l,  b,  5], // i
[l,  0,  5], // j
[-round.x/2+round.y,  0,  5], // k
[-round.x/2,  round.y/2,  round.y], // l
[-round.x/2+round.y,  round.y,  round.y], // m
[l,  round.y, 5], // n
];

function exclude( w, h ) = let(
adj = h/2,
path = [
[-w/2,0,adj],
[-w/2+adj,h/2,adj],
[w/2-adj,h/2,adj],
[w/2,0,adj],
[w/2-adj,-h/2,adj],
[-w/2+adj,-h/2,adj],
],

) path;

x=val(path);
difference() {
polyRoundExtrude(path,r1=2, r2=2);
translate([-round.x/2+30,10,0]) polyRoundExtrude(exclude(25,5),r1=-2, r2=-2);
translate([round.x/2-30,10,0]) polyRoundExtrude(exclude(25,5),r1=-2, r2=-2);
translate([0,10,0]) polyRoundExtrude(exclude(40,8),r1=-2, r2=-2);
translate([0,-10,0]) polyRoundExtrude(exclude(40,8),r1=-2, r2=-2);
}

On 16 Aug 2024, at 15:45, Raymond West via Discuss discuss@lists.openscad.org wrote:

you can set $fn =20 for testing, see if it looks OK. Minkowski is then fairly quick. When you have it looking right, then set $fn to 100, say, for the final stl, and come back after lunch.

If it is only an stl that you want, it used to be you could feed the scad file into AngelCad, and it used to produce an stl quite quickly. I'm not sure if openscad has caught up wrt speed, or even if AngelCAD accepts minkowski.  Freecad can also import scad files and render. It allows individual edges to be selected for filleting. It tends to export back to openscad as a large polyhedron, you lose the individual cubes and cylinders, etc.  fwiw, bevels are better for printing, not round-overs.

On 16/08/2024 13:46, Michael Zimbaro via Discuss wrote:

Yes, the size issue is interesting.  I think what you said earlier about reducing my size by the radius seems to be working.  Originally my part was created with Bols2 using the 3d library.  I could not find a way to get the inner rounded edges.  I have now switched to Bols2 2D and the Minkowski as suggested but wow is it ever slow.  I increased my facets to 90 and my part has been compiling for at least 30 minutes.  I want to do a test print of the first few layers to make sure the size is right.  Interesting that you suggested using two cylinders and a cube for the inside.  I did the same using 2 circles and a square in 2d then extruding.

My part is almost complete.  I would like to share the code to see what others would suggest in the future.  I always welcome a better way.  Is anyone interested in seeing it?

On Fri, Aug 16, 2024 at 8:19 AM Raymond West via Discuss <discuss@lists.openscad.org mailto:discuss@lists.openscad.org> wrote:

My previous example, is additive, i.e, have a basic shape and add on fillets, etc. That means, if you are wanting to deal with the overall size, which is generally true, than the radius has to be taken off the outside edges, and added to internal edges.

For shapes such as have been shown, then simple maths suffices, but more complex shapes offset can be used. But Minkowski can be slow, as you say, certainly at high resolution and complex profiles. The rounded chamfers are the problem.  For more basic shapes, boxes, etc., then I generate a profile strip and difference with the edges. A question of finding the best solution for a particular problem, one size does not fit all, so to speak.

You can generate a profile, the negative of a sphere, and generate 'holes' in shapes such that when differenced will leave a rounded edge. I've attached a bit of code. The advantage is that no maths is needed to subtract the radius. The disadvantage is that Minkowski is much slower with the complex profile,  overall it is cumbersome, and often it breaks the mesh when differencing.

The way in which I believe most folk think wrt rounding edges, is that you start off with square edges, and remove the sharp edges.  Bare openscad can not do that easily. However there are plenty of other software tools that can. In reality, it is often more expedient  to mechanically finish the object, files, emery-cloth, whatever. Possibly a woodworker would think differently, since they often glue on mouldings.

d=10;
$fn=80;
module profile(){
rotate_extrude(){
difference(){
translate([-d/2,0])
square(d);
translate([0.01+d/2,d/2])
circle(d=d);
translate([-d-d,0])  //cut off lhs
square(d+d);
}
}
}

//  profile();

module shape(){
linear_extrude(0.001){
difference(){
square (100);
translate([25,25]) square(50);
}
}
}
module stamp(){
minkowski(){
shape();
profile();
}
}

stamp();

On 15/08/2024 23:49, Jordan Brown via Discuss wrote:

There has been a lot of detailed discussion, but little in the way of general discussion of the problem.

There are three basic approaches:
Create a 2D shape with holes, extrude it, and somehow (probably with Minkowski) round the corners.
Create a 3D shape, and a shape that you want removed, and difference the two.
Create the entire shape as a polyhedron, with the rounding designed in.
Minkowski can be really slow, so I generally don’t consider it. Also, it might be tricky to restrict its effect to the edges that you want rounded.

Creating a polyhedron is very very powerful and can be very very hard.  I think BOSL2 might have the tools required to create a polyhedron like this, but I’m not familiar enough to be sure. Maybe Adrian can chime in there.

I would personally think in terms of the second option, subtracting the unwanted shape from the original shape.

Constructing the negative shape can be complex, but is generally straightforward even if tedious. For your oval slots, start with two cylinders joined by a cube.

I’m on my iPad so can’t experiment, but something like

difference() {
cube([50,50,10], center=true);
translate([-10,0,0]) cylinder(h=11, d=10, center=true);
translate([10,0,0]) cylinder(h=11, d=10, center=true);
cube([20,10,11], center=true);
}

That gets you a straight-sided slot.  Sculpt it as desired by subtracting stuff from the negative piece. Note, for instance, that a cylinder is a rotationally-extruded square, so if you want round edges at the ends you might take a square, subtract a circle along one edge, and rotationally extrude that. Similarly, the cube in the middle is an extruded square, so take a square, subtract circles on each side, and extrude that. However you construct it, when you have your negative “die”, subtract it from the main object. Always remember to make the negative object a little thicker than the original, so that it protrudes from both sides.

If there is interest, I’ll write up a demo snippet in a few days when I get back to my desktop computer.


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org mailto:discuss-leave@lists.openscad.org


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org mailto:discuss-leave@lists.openscad.org


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org mailto:discuss-leave@lists.openscad.org


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org

You might want to take a look at https://learn.cadhub.xyz/docs/round-anything/api-reference/#polyround  The library can round a path with square corners with variable radii. For this, you add the radius as the z coordinate in a 3vec. It can then extrude this path with a radius at the end. For the outer component you can use a positive radius for the under and top side. You can then make the inner shapes the same way and subtract them. However, you can then make the radii of the ends negative, which leaves a nice round shape. The library could use some love. If your path contains undef it will hang ... :-( (Surprised OpenSCAD does not run the rendering in a background thread?) This is the function of the val() routine, to check this. The quickly hacked together code. use <lib/Round-Anything/polyround.scad> $fn=50; function val(p) = [for(i=p) assert( ! (is_undef(i.x) || is_undef(i.y)|| is_undef(i.y)))]; rect=[60,60]; round=[140,20]; a = 20; /* -rect.x/2 rect.x/2 a----------------b rect.y/2 | | m-----n c-----d round.y / \ l+ + e \ / k-----j g-----f 0 | | | | i----------------h -rect.y/2 0 */ l = -rect.x/2; r = -l; t = rect.y/2; b = -t; path = [ [l, t, 5], // a [r, t, 5], // b [r, round.y, 5], // c [round.x/2-round.y, round.y, 5], // d [round.x/2, round.y/2, round.y], // e [round.x/2-round.y, 0, round.y], // f [r, 0, 5], // g [r, b, 5], // h [l, b, 5], // i [l, 0, 5], // j [-round.x/2+round.y, 0, 5], // k [-round.x/2, round.y/2, round.y], // l [-round.x/2+round.y, round.y, round.y], // m [l, round.y, 5], // n ]; function exclude( w, h ) = let( adj = h/2, path = [ [-w/2,0,adj], [-w/2+adj,h/2,adj], [w/2-adj,h/2,adj], [w/2,0,adj], [w/2-adj,-h/2,adj], [-w/2+adj,-h/2,adj], ], ) path; x=val(path); difference() { polyRoundExtrude(path,r1=2, r2=2); translate([-round.x/2+30,10,0]) polyRoundExtrude(exclude(25,5),r1=-2, r2=-2); translate([round.x/2-30,10,0]) polyRoundExtrude(exclude(25,5),r1=-2, r2=-2); translate([0,10,0]) polyRoundExtrude(exclude(40,8),r1=-2, r2=-2); translate([0,-10,0]) polyRoundExtrude(exclude(40,8),r1=-2, r2=-2); } > On 16 Aug 2024, at 15:45, Raymond West via Discuss <discuss@lists.openscad.org> wrote: > > you can set $fn =20 for testing, see if it looks OK. Minkowski is then fairly quick. When you have it looking right, then set $fn to 100, say, for the final stl, and come back after lunch. > > If it is only an stl that you want, it used to be you could feed the scad file into AngelCad, and it used to produce an stl quite quickly. I'm not sure if openscad has caught up wrt speed, or even if AngelCAD accepts minkowski. Freecad can also import scad files and render. It allows individual edges to be selected for filleting. It tends to export back to openscad as a large polyhedron, you lose the individual cubes and cylinders, etc. fwiw, bevels are better for printing, not round-overs. > > On 16/08/2024 13:46, Michael Zimbaro via Discuss wrote: >> Yes, the size issue is interesting. I think what you said earlier about reducing my size by the radius seems to be working. Originally my part was created with Bols2 using the 3d library. I could not find a way to get the inner rounded edges. I have now switched to Bols2 2D and the Minkowski as suggested but wow is it ever slow. I increased my facets to 90 and my part has been compiling for at least 30 minutes. I want to do a test print of the first few layers to make sure the size is right. Interesting that you suggested using two cylinders and a cube for the inside. I did the same using 2 circles and a square in 2d then extruding. >> >> My part is almost complete. I would like to share the code to see what others would suggest in the future. I always welcome a better way. Is anyone interested in seeing it? >> >> On Fri, Aug 16, 2024 at 8:19 AM Raymond West via Discuss <discuss@lists.openscad.org <mailto:discuss@lists.openscad.org>> wrote: >>> My previous example, is additive, i.e, have a basic shape and add on fillets, etc. That means, if you are wanting to deal with the overall size, which is generally true, than the radius has to be taken off the outside edges, and added to internal edges. >>> >>> For shapes such as have been shown, then simple maths suffices, but more complex shapes offset can be used. But Minkowski can be slow, as you say, certainly at high resolution and complex profiles. The rounded chamfers are the problem. For more basic shapes, boxes, etc., then I generate a profile strip and difference with the edges. A question of finding the best solution for a particular problem, one size does not fit all, so to speak. >>> >>> You can generate a profile, the negative of a sphere, and generate 'holes' in shapes such that when differenced will leave a rounded edge. I've attached a bit of code. The advantage is that no maths is needed to subtract the radius. The disadvantage is that Minkowski is much slower with the complex profile, overall it is cumbersome, and often it breaks the mesh when differencing. >>> >>> The way in which I believe most folk think wrt rounding edges, is that you start off with square edges, and remove the sharp edges. Bare openscad can not do that easily. However there are plenty of other software tools that can. In reality, it is often more expedient to mechanically finish the object, files, emery-cloth, whatever. Possibly a woodworker would think differently, since they often glue on mouldings. >>> >>> d=10; >>> $fn=80; >>> module profile(){ >>> rotate_extrude(){ >>> difference(){ >>> translate([-d/2,0]) >>> square(d); >>> translate([0.01+d/2,d/2]) >>> circle(d=d); >>> translate([-d-d,0]) //cut off lhs >>> square(d+d); >>> } >>> } >>> } >>> >>> // profile(); >>> >>> module shape(){ >>> linear_extrude(0.001){ >>> difference(){ >>> square (100); >>> translate([25,25]) square(50); >>> } >>> } >>> } >>> module stamp(){ >>> minkowski(){ >>> shape(); >>> profile(); >>> } >>> } >>> >>> stamp(); >>> >>> >>> >>> On 15/08/2024 23:49, Jordan Brown via Discuss wrote: >>>> There has been a lot of detailed discussion, but little in the way of general discussion of the problem. >>>> >>>> There are three basic approaches: >>>> Create a 2D shape with holes, extrude it, and somehow (probably with Minkowski) round the corners. >>>> Create a 3D shape, and a shape that you want removed, and difference the two. >>>> Create the entire shape as a polyhedron, with the rounding designed in. >>>> Minkowski can be really slow, so I generally don’t consider it. Also, it might be tricky to restrict its effect to the edges that you want rounded. >>>> >>>> Creating a polyhedron is very very powerful and can be very very hard. I think BOSL2 might have the tools required to create a polyhedron like this, but I’m not familiar enough to be sure. Maybe Adrian can chime in there. >>>> >>>> I would personally think in terms of the second option, subtracting the unwanted shape from the original shape. >>>> >>>> Constructing the negative shape can be complex, but is generally straightforward even if tedious. For your oval slots, start with two cylinders joined by a cube. >>>> >>>> I’m on my iPad so can’t experiment, but something like >>>> >>>> difference() { >>>> cube([50,50,10], center=true); >>>> translate([-10,0,0]) cylinder(h=11, d=10, center=true); >>>> translate([10,0,0]) cylinder(h=11, d=10, center=true); >>>> cube([20,10,11], center=true); >>>> } >>>> >>>> That gets you a straight-sided slot. Sculpt it as desired by subtracting stuff from the negative piece. Note, for instance, that a cylinder is a rotationally-extruded square, so if you want round edges at the ends you might take a square, subtract a circle along one edge, and rotationally extrude that. Similarly, the cube in the middle is an extruded square, so take a square, subtract circles on each side, and extrude that. However you construct it, when you have your negative “die”, subtract it from the main object. Always remember to make the negative object a little thicker than the original, so that it protrudes from both sides. >>>> >>>> If there is interest, I’ll write up a demo snippet in a few days when I get back to my desktop computer. >>>> >>>> >>>> _______________________________________________ >>>> OpenSCAD mailing list >>>> To unsubscribe send an email to discuss-leave@lists.openscad.org <mailto:discuss-leave@lists.openscad.org> >>> _______________________________________________ >>> OpenSCAD mailing list >>> To unsubscribe send an email to discuss-leave@lists.openscad.org <mailto:discuss-leave@lists.openscad.org> >> >> >> _______________________________________________ >> OpenSCAD mailing list >> To unsubscribe send an email to discuss-leave@lists.openscad.org <mailto:discuss-leave@lists.openscad.org> > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org
GB
Glenn Butcher
Fri, Aug 16, 2024 9:27 PM

Oh, I love Round-Anything's polyRound() module...

I modeled a complete steam locomotive with it, using it 83 times to make
the rounded shapes 1880's steam locomotive designers so loved:

On 8/16/2024 8:55 AM, Peter Kriens via Discuss wrote:

You might want to take a look at
https://learn.cadhub.xyz/docs/round-anything/api-reference/#polyround

PastedGraphic-1.png

The library can round a path with square corners with variable radii.
For this, you add the radius as the z coordinate in a 3vec. It can
then extrude this path with a radius at the end. For the outer
component you can use a positive radius for the under and top side.
You can then make the inner shapes the same way and subtract them.
However, you can then make the radii of the ends negative, which
leaves a nice round shape.

The library could use some love. If your path contains undef it will
hang ... :-( (Surprised OpenSCAD does not run the rendering in a
background thread?) This is the function of the val() routine, to
check this.

The quickly hacked together code.

 use <lib/Round-Anything/polyround.scad>

 $fn=50;
 function val(p) = [for(i=p) assert( ! (is_undef(i.x) ||
 is_undef(i.y)|| is_undef(i.y)))];

 rect=[60,60];
 round=[140,20];
 a = 20;
 /*

          -rect.x/2            rect.x/2
             a----------------b            rect.y/2
             |                |
       m-----n                c-----d      round.y
      /                              \
    l+                                + e
      \                              /
       k-----j                g-----f      0
             |                |
             |                |
             i----------------h            -rect.y/2
                     0

 */


 l = -rect.x/2;
 r = -l;
 t = rect.y/2;
 b = -t;

 path = [
         [l,  t,  5], // a
         [r,   t,  5], // b
         [r,   round.y,  5], // c
         [round.x/2-round.y,   round.y,  5], // d
         [round.x/2,           round.y/2,  round.y], // e
         [round.x/2-round.y,   0,  round.y], // f
         [r,   0,  5], // g
         [r,   b,  5], // h
         [l,   b,  5], // i
         [l,   0,  5], // j
         [-round.x/2+round.y,   0,  5], // k
         [-round.x/2,   round.y/2,  round.y], // l
         [-round.x/2+round.y,   round.y,  round.y], // m
         [l,   round.y, 5], // n
 ];


 function exclude( w, h ) = let(
     adj = h/2,
     path = [
         [-w/2,0,adj],
         [-w/2+adj,h/2,adj],
         [w/2-adj,h/2,adj],
         [w/2,0,adj],
         [w/2-adj,-h/2,adj],
         [-w/2+adj,-h/2,adj],
     ],

 ) path;

 x=val(path);
 difference() {
     polyRoundExtrude(path,r1=2, r2=2);
     translate([-round.x/2+30,10,0])
 polyRoundExtrude(exclude(25,5),r1=-2, r2=-2);
     translate([round.x/2-30,10,0])
 polyRoundExtrude(exclude(25,5),r1=-2, r2=-2);
     translate([0,10,0]) polyRoundExtrude(exclude(40,8),r1=-2, r2=-2);
     translate([0,-10,0]) polyRoundExtrude(exclude(40,8),r1=-2, r2=-2);
 }

On 16 Aug 2024, at 15:45, Raymond West via Discuss
discuss@lists.openscad.org wrote:

you can set $fn =20 for testing, see if it looks OK. Minkowski is
then fairly quick. When you have it looking right, then set $fn to
100, say, for the final stl, and come back after lunch.

If it is only an stl that you want, it used to be you could feed the
scad file into AngelCad, and it used to produce an stl quite quickly.
I'm not sure if openscad has caught up wrt speed, or even if AngelCAD
accepts minkowski.  Freecad can also import scad files and render. It
allows individual edges to be selected for filleting. It tends to
export back to openscad as a large polyhedron, you lose the
individual cubes and cylinders, etc.  fwiw, bevels are better for
printing, not round-overs.

On 16/08/2024 13:46, Michael Zimbaro via Discuss wrote:

Yes, the size issue is interesting.  I think what you said earlier
about reducing my size by the radius seems to be working. 
Originally my part was created with Bols2 using the 3d library.  I
could not find a way to get the inner rounded edges.  I have now
switched to Bols2 2D and the Minkowski as suggested but wow is it
ever slow.  I increased my facets to 90 and my part has been
compiling for at least 30 minutes.  I want to do a test print of the
first few layers to make sure the size is right.  Interesting that
you suggested using two cylinders and a cube for the inside.  I did
the same using 2 circles and a square in 2d then extruding.

My part is almost complete.  I would like to share the code to see
what others would suggest in the future.  I always welcome a better
way.  Is anyone interested in seeing it?

On Fri, Aug 16, 2024 at 8:19 AM Raymond West via Discuss
discuss@lists.openscad.org wrote:

 My previous example, is additive, i.e, have a basic shape and
 add on fillets, etc. That means, if you are wanting to deal with
 the overall size, which is generally true, than the radius has
 to be taken off the outside edges, and added to internal edges.

 For shapes such as have been shown, then simple maths suffices,
 but more complex shapes offset can be used. But Minkowski can be
 slow, as you say, certainly at high resolution and complex
 profiles. The rounded chamfers are the problem.  For more basic
 shapes, boxes, etc., then I generate a profile strip and
 difference with the edges. A question of finding the best
 solution for a particular problem, one size does not fit all, so
 to speak.

 You can generate a profile, the negative of a sphere, and
 generate 'holes' in shapes such that when differenced will leave
 a rounded edge. I've attached a bit of code. The advantage is
 that no maths is needed to subtract the radius. The disadvantage
 is that Minkowski is much slower with the complex profile, 
 overall it is cumbersome, and often it breaks the mesh when
 differencing.

 The way in which I believe most folk think wrt rounding edges,
 is that you start off with square edges, and remove the sharp
 edges. Bare openscad can not do that easily. However there are
 plenty of other software tools that can. In reality, it is often
 more expedient to mechanically finish the object, files,
 emery-cloth, whatever. Possibly a woodworker would think
 differently, since they often glue on mouldings.

 d=10;
 $fn=80;
 module profile(){
    rotate_extrude(){
       difference(){
         translate([-d/2,0])
         square(d);
         translate([0.01+d/2,d/2])
         circle(d=d);
            translate([-d-d,0])  //cut off lhs
            square(d+d);
       }
    }
 }

   //  profile();

 module shape(){
     linear_extrude(0.001){
        difference(){
           square (100);
           translate([25,25]) square(50);
       }
    }
 }
 module stamp(){
    minkowski(){
      shape();
      profile();
    }
 }

 stamp();


 On 15/08/2024 23:49, Jordan Brown via Discuss wrote:
 There has been a lot of detailed discussion, but little in the
 way of general discussion of the problem.

 There are three basic approaches:

   * Create a 2D shape with holes, extrude it, and somehow
     (probably with Minkowski) round the corners.
   * Create a 3D shape, and a shape that you want removed, and
     difference the two.
   * Create the entire shape as a polyhedron, with the rounding
     designed in.

 Minkowski can be really slow, so I generally don’t consider it.
 Also, it might be tricky to restrict its effect to the edges
 that you want rounded.

 Creating a polyhedron is very very powerful and can be very
 very hard.  I think BOSL2 might have the tools required to
 create a polyhedron like this, but I’m not familiar enough to
 be sure. Maybe Adrian can chime in there.

 I would personally think in terms of the second option,
 subtracting the unwanted shape from the original shape.

 Constructing the negative shape can be complex, but is
 generally straightforward even if tedious. For your oval slots,
 start with two cylinders joined by a cube.

 I’m on my iPad so can’t experiment, but something like

 difference() {
     cube([50,50,10], center=true);
     translate([-10,0,0]) cylinder(h=11, d=10, center=true);
     translate([10,0,0]) cylinder(h=11, d=10, center=true);
     cube([20,10,11], center=true);
 }

 That gets you a straight-sided slot. Sculpt it as desired by
 subtracting stuff from the negative piece. Note, for instance,
 that a cylinder is a rotationally-extruded square, so if you
 want round edges at the ends you might take a square, subtract
 a circle along one edge, and rotationally extrude that.
 Similarly, the cube in the middle is an extruded square, so
 take a square, subtract circles on each side, and extrude that.
 However you construct it, when you have your negative “die”,
 subtract it from the main object. Always remember to make the
 negative object a little thicker than the original, so that it
 protrudes from both sides.

 If there is interest, I’ll write up a demo snippet in a few
 days when I get back to my desktop computer.

 _______________________________________________
 OpenSCAD mailing list
 To unsubscribe send an email todiscuss-leave@lists.openscad.org
 _______________________________________________
 OpenSCAD mailing list
 To unsubscribe send an email to discuss-leave@lists.openscad.org

OpenSCAD mailing list
To unsubscribe send an email todiscuss-leave@lists.openscad.org


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org


OpenSCAD mailing list
To unsubscribe send an email todiscuss-leave@lists.openscad.org

Oh, I love Round-Anything's polyRound() module... I modeled a complete steam locomotive with it, using it 83 times to make the rounded shapes 1880's steam locomotive designers so loved: On 8/16/2024 8:55 AM, Peter Kriens via Discuss wrote: > You might want to take a look at > https://learn.cadhub.xyz/docs/round-anything/api-reference/#polyround > > > > PastedGraphic-1.png > > The library can round a path with square corners with variable radii. > For this, you add the radius as the z coordinate in a 3vec. It can > then extrude this path with a radius at the end. For the outer > component you can use a positive radius for the under and top side. > You can then make the inner shapes the same way and subtract them. > However, you can then make the radii of the ends negative, which > leaves a nice round shape. > > The library could use some love. If your path contains undef it will > hang ... :-( (Surprised OpenSCAD does not run the rendering in a > background thread?) This is the function of the val() routine, to > check this. > > The quickly hacked together code. > > > use <lib/Round-Anything/polyround.scad> > > $fn=50; > function val(p) = [for(i=p) assert( ! (is_undef(i.x) || > is_undef(i.y)|| is_undef(i.y)))]; > > rect=[60,60]; > round=[140,20]; > a = 20; > /* > >          -rect.x/2            rect.x/2 >             a----------------b            rect.y/2 >             |                | >       m-----n                c-----d      round.y >      /                              \ >    l+                                + e >      \                              / >       k-----j                g-----f      0 >             |                | >             |                | >             i----------------h            -rect.y/2 >                     0 > > */ > > > l = -rect.x/2; > r = -l; > t = rect.y/2; > b = -t; > > path = [ >         [l,  t,  5], // a >         [r,   t,  5], // b >         [r,   round.y,  5], // c >         [round.x/2-round.y,   round.y,  5], // d >         [round.x/2,           round.y/2,  round.y], // e >         [round.x/2-round.y,   0,  round.y], // f >         [r,   0,  5], // g >         [r,   b,  5], // h >         [l,   b,  5], // i >         [l,   0,  5], // j >         [-round.x/2+round.y,   0,  5], // k >         [-round.x/2,   round.y/2,  round.y], // l >         [-round.x/2+round.y,   round.y,  round.y], // m >         [l,   round.y, 5], // n > ]; > > > function exclude( w, h ) = let( >     adj = h/2, >     path = [ >         [-w/2,0,adj], >         [-w/2+adj,h/2,adj], >         [w/2-adj,h/2,adj], >         [w/2,0,adj], >         [w/2-adj,-h/2,adj], >         [-w/2+adj,-h/2,adj], >     ], > > ) path; > > x=val(path); > difference() { >     polyRoundExtrude(path,r1=2, r2=2); >     translate([-round.x/2+30,10,0]) > polyRoundExtrude(exclude(25,5),r1=-2, r2=-2); >     translate([round.x/2-30,10,0]) > polyRoundExtrude(exclude(25,5),r1=-2, r2=-2); >     translate([0,10,0]) polyRoundExtrude(exclude(40,8),r1=-2, r2=-2); >     translate([0,-10,0]) polyRoundExtrude(exclude(40,8),r1=-2, r2=-2); > } > > > > >> On 16 Aug 2024, at 15:45, Raymond West via Discuss >> <discuss@lists.openscad.org> wrote: >> >> you can set $fn =20 for testing, see if it looks OK. Minkowski is >> then fairly quick. When you have it looking right, then set $fn to >> 100, say, for the final stl, and come back after lunch. >> >> If it is only an stl that you want, it used to be you could feed the >> scad file into AngelCad, and it used to produce an stl quite quickly. >> I'm not sure if openscad has caught up wrt speed, or even if AngelCAD >> accepts minkowski.  Freecad can also import scad files and render. It >> allows individual edges to be selected for filleting. It tends to >> export back to openscad as a large polyhedron, you lose the >> individual cubes and cylinders, etc.  fwiw, bevels are better for >> printing, not round-overs. >> >> On 16/08/2024 13:46, Michael Zimbaro via Discuss wrote: >>> Yes, the size issue is interesting.  I think what you said earlier >>> about reducing my size by the radius seems to be working.  >>> Originally my part was created with Bols2 using the 3d library.  I >>> could not find a way to get the inner rounded edges.  I have now >>> switched to Bols2 2D and the Minkowski as suggested but wow is it >>> ever slow.  I increased my facets to 90 and my part has been >>> compiling for at least 30 minutes.  I want to do a test print of the >>> first few layers to make sure the size is right.  Interesting that >>> you suggested using two cylinders and a cube for the inside.  I did >>> the same using 2 circles and a square in 2d then extruding. >>> >>> My part is almost complete.  I would like to share the code to see >>> what others would suggest in the future.  I always welcome a better >>> way.  Is anyone interested in seeing it? >>> >>> On Fri, Aug 16, 2024 at 8:19 AM Raymond West via Discuss >>> <discuss@lists.openscad.org> wrote: >>> >>> My previous example, is additive, i.e, have a basic shape and >>> add on fillets, etc. That means, if you are wanting to deal with >>> the overall size, which is generally true, than the radius has >>> to be taken off the outside edges, and added to internal edges. >>> >>> For shapes such as have been shown, then simple maths suffices, >>> but more complex shapes offset can be used. But Minkowski can be >>> slow, as you say, certainly at high resolution and complex >>> profiles. The rounded chamfers are the problem.  For more basic >>> shapes, boxes, etc., then I generate a profile strip and >>> difference with the edges. A question of finding the best >>> solution for a particular problem, one size does not fit all, so >>> to speak. >>> >>> You can generate a profile, the negative of a sphere, and >>> generate 'holes' in shapes such that when differenced will leave >>> a rounded edge. I've attached a bit of code. The advantage is >>> that no maths is needed to subtract the radius. The disadvantage >>> is that Minkowski is much slower with the complex profile,  >>> overall it is cumbersome, and often it breaks the mesh when >>> differencing. >>> >>> The way in which I believe most folk think wrt rounding edges, >>> is that you start off with square edges, and remove the sharp >>> edges. Bare openscad can not do that easily. However there are >>> plenty of other software tools that can. In reality, it is often >>> more expedient to mechanically finish the object, files, >>> emery-cloth, whatever. Possibly a woodworker would think >>> differently, since they often glue on mouldings. >>> >>> d=10; >>> $fn=80; >>> module profile(){ >>>    rotate_extrude(){ >>>       difference(){ >>>         translate([-d/2,0]) >>>         square(d); >>>         translate([0.01+d/2,d/2]) >>>         circle(d=d); >>>            translate([-d-d,0])  //cut off lhs >>>            square(d+d); >>>       } >>>    } >>> } >>> >>>   //  profile(); >>> >>> module shape(){ >>>     linear_extrude(0.001){ >>>        difference(){ >>>           square (100); >>>           translate([25,25]) square(50); >>>       } >>>    } >>> } >>> module stamp(){ >>>    minkowski(){ >>>      shape(); >>>      profile(); >>>    } >>> } >>> >>> stamp(); >>> >>> >>> On 15/08/2024 23:49, Jordan Brown via Discuss wrote: >>>> There has been a lot of detailed discussion, but little in the >>>> way of general discussion of the problem. >>>> >>>> There are three basic approaches: >>>> >>>> * Create a 2D shape with holes, extrude it, and somehow >>>> (probably with Minkowski) round the corners. >>>> * Create a 3D shape, and a shape that you want removed, and >>>> difference the two. >>>> * Create the entire shape as a polyhedron, with the rounding >>>> designed in. >>>> >>>> Minkowski can be really slow, so I generally don’t consider it. >>>> Also, it might be tricky to restrict its effect to the edges >>>> that you want rounded. >>>> >>>> Creating a polyhedron is very very powerful and can be very >>>> very hard.  I think BOSL2 might have the tools required to >>>> create a polyhedron like this, but I’m not familiar enough to >>>> be sure. Maybe Adrian can chime in there. >>>> >>>> I would personally think in terms of the second option, >>>> subtracting the unwanted shape from the original shape. >>>> >>>> Constructing the negative shape can be complex, but is >>>> generally straightforward even if tedious. For your oval slots, >>>> start with two cylinders joined by a cube. >>>> >>>> I’m on my iPad so can’t experiment, but something like >>>> >>>> difference() { >>>>     cube([50,50,10], center=true); >>>>     translate([-10,0,0]) cylinder(h=11, d=10, center=true); >>>>     translate([10,0,0]) cylinder(h=11, d=10, center=true); >>>>     cube([20,10,11], center=true); >>>> } >>>> >>>> That gets you a straight-sided slot. Sculpt it as desired by >>>> subtracting stuff from the negative piece. Note, for instance, >>>> that a cylinder is a rotationally-extruded square, so if you >>>> want round edges at the ends you might take a square, subtract >>>> a circle along one edge, and rotationally extrude that. >>>> Similarly, the cube in the middle is an extruded square, so >>>> take a square, subtract circles on each side, and extrude that. >>>> However you construct it, when you have your negative “die”, >>>> subtract it from the main object. Always remember to make the >>>> negative object a little thicker than the original, so that it >>>> protrudes from both sides. >>>> >>>> If there is interest, I’ll write up a demo snippet in a few >>>> days when I get back to my desktop computer. >>>> >>>> _______________________________________________ >>>> OpenSCAD mailing list >>>> To unsubscribe send an email todiscuss-leave@lists.openscad.org >>> _______________________________________________ >>> OpenSCAD mailing list >>> To unsubscribe send an email to discuss-leave@lists.openscad.org >>> >>> >>> _______________________________________________ >>> OpenSCAD mailing list >>> To unsubscribe send an email todiscuss-leave@lists.openscad.org >> _______________________________________________ >> OpenSCAD mailing list >> To unsubscribe send an email to discuss-leave@lists.openscad.org > > > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email todiscuss-leave@lists.openscad.org
RD
Revar Desmera
Sat, Aug 17, 2024 8:12 AM

With BOSL2 you can make an interior rounding mask using negative radius roundings.  For example:

cuboid([30,50,20], rounding=-5);
ycopies(50) cyl(d=30,h=20,rounding=-5);

I do note that there seems to be a slight imperfection to the mask, though.

  • Revar

On Aug 16, 2024, at 5:46 AM, Michael Zimbaro via Discuss discuss@lists.openscad.org wrote:

Yes, the size issue is interesting.  I think what you said earlier about reducing my size by the radius seems to be working.  Originally my part was created with Bols2 using the 3d library.  I could not find a way to get the inner rounded edges.  I have now switched to Bols2 2D and the Minkowski as suggested but wow is it ever slow.  I increased my facets to 90 and my part has been compiling for at least 30 minutes.  I want to do a test print of the first few layers to make sure the size is right.  Interesting that you suggested using two cylinders and a cube for the inside.  I did the same using 2 circles and a square in 2d then extruding.

My part is almost complete.  I would like to share the code to see what others would suggest in the future.  I always welcome a better way.  Is anyone interested in seeing it?

On Fri, Aug 16, 2024 at 8:19 AM Raymond West via Discuss <discuss@lists.openscad.org mailto:discuss@lists.openscad.org> wrote:

My previous example, is additive, i.e, have a basic shape and add on fillets, etc. That means, if you are wanting to deal with the overall size, which is generally true, than the radius has to be taken off the outside edges, and added to internal edges.

For shapes such as have been shown, then simple maths suffices, but more complex shapes offset can be used. But Minkowski can be slow, as you say, certainly at high resolution and complex profiles. The rounded chamfers are the problem.  For more basic shapes, boxes, etc., then I generate a profile strip and difference with the edges. A question of finding the best solution for a particular problem, one size does not fit all, so to speak.

You can generate a profile, the negative of a sphere, and generate 'holes' in shapes such that when differenced will leave a rounded edge. I've attached a bit of code. The advantage is that no maths is needed to subtract the radius. The disadvantage is that Minkowski is much slower with the complex profile,  overall it is cumbersome, and often it breaks the mesh when differencing.

The way in which I believe most folk think wrt rounding edges, is that you start off with square edges, and remove the sharp edges.  Bare openscad can not do that easily. However there are plenty of other software tools that can. In reality, it is often more expedient  to mechanically finish the object, files, emery-cloth, whatever. Possibly a woodworker would think differently, since they often glue on mouldings.

d=10;
$fn=80;
module profile(){
rotate_extrude(){
difference(){
translate([-d/2,0])
square(d);
translate([0.01+d/2,d/2])
circle(d=d);
translate([-d-d,0])  //cut off lhs
square(d+d);
}
}
}

//  profile();

module shape(){
linear_extrude(0.001){
difference(){
square (100);
translate([25,25]) square(50);
}
}
}
module stamp(){
minkowski(){
shape();
profile();
}
}

stamp();

On 15/08/2024 23:49, Jordan Brown via Discuss wrote:

There has been a lot of detailed discussion, but little in the way of general discussion of the problem.

There are three basic approaches:
Create a 2D shape with holes, extrude it, and somehow (probably with Minkowski) round the corners.
Create a 3D shape, and a shape that you want removed, and difference the two.
Create the entire shape as a polyhedron, with the rounding designed in.
Minkowski can be really slow, so I generally don’t consider it. Also, it might be tricky to restrict its effect to the edges that you want rounded.

Creating a polyhedron is very very powerful and can be very very hard.  I think BOSL2 might have the tools required to create a polyhedron like this, but I’m not familiar enough to be sure. Maybe Adrian can chime in there.

I would personally think in terms of the second option, subtracting the unwanted shape from the original shape.

Constructing the negative shape can be complex, but is generally straightforward even if tedious. For your oval slots, start with two cylinders joined by a cube.

I’m on my iPad so can’t experiment, but something like

difference() {
cube([50,50,10], center=true);
translate([-10,0,0]) cylinder(h=11, d=10, center=true);
translate([10,0,0]) cylinder(h=11, d=10, center=true);
cube([20,10,11], center=true);
}

That gets you a straight-sided slot.  Sculpt it as desired by subtracting stuff from the negative piece. Note, for instance, that a cylinder is a rotationally-extruded square, so if you want round edges at the ends you might take a square, subtract a circle along one edge, and rotationally extrude that. Similarly, the cube in the middle is an extruded square, so take a square, subtract circles on each side, and extrude that. However you construct it, when you have your negative “die”, subtract it from the main object. Always remember to make the negative object a little thicker than the original, so that it protrudes from both sides.

If there is interest, I’ll write up a demo snippet in a few days when I get back to my desktop computer.


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org mailto:discuss-leave@lists.openscad.org


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org mailto:discuss-leave@lists.openscad.org


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org

With BOSL2 you can make an interior rounding mask using negative radius roundings. For example: cuboid([30,50,20], rounding=-5); ycopies(50) cyl(d=30,h=20,rounding=-5);  I do note that there seems to be a slight imperfection to the mask, though. - Revar > On Aug 16, 2024, at 5:46 AM, Michael Zimbaro via Discuss <discuss@lists.openscad.org> wrote: > > Yes, the size issue is interesting. I think what you said earlier about reducing my size by the radius seems to be working. Originally my part was created with Bols2 using the 3d library. I could not find a way to get the inner rounded edges. I have now switched to Bols2 2D and the Minkowski as suggested but wow is it ever slow. I increased my facets to 90 and my part has been compiling for at least 30 minutes. I want to do a test print of the first few layers to make sure the size is right. Interesting that you suggested using two cylinders and a cube for the inside. I did the same using 2 circles and a square in 2d then extruding. > > My part is almost complete. I would like to share the code to see what others would suggest in the future. I always welcome a better way. Is anyone interested in seeing it? > > On Fri, Aug 16, 2024 at 8:19 AM Raymond West via Discuss <discuss@lists.openscad.org <mailto:discuss@lists.openscad.org>> wrote: >> My previous example, is additive, i.e, have a basic shape and add on fillets, etc. That means, if you are wanting to deal with the overall size, which is generally true, than the radius has to be taken off the outside edges, and added to internal edges. >> >> For shapes such as have been shown, then simple maths suffices, but more complex shapes offset can be used. But Minkowski can be slow, as you say, certainly at high resolution and complex profiles. The rounded chamfers are the problem. For more basic shapes, boxes, etc., then I generate a profile strip and difference with the edges. A question of finding the best solution for a particular problem, one size does not fit all, so to speak. >> >> You can generate a profile, the negative of a sphere, and generate 'holes' in shapes such that when differenced will leave a rounded edge. I've attached a bit of code. The advantage is that no maths is needed to subtract the radius. The disadvantage is that Minkowski is much slower with the complex profile, overall it is cumbersome, and often it breaks the mesh when differencing. >> >> The way in which I believe most folk think wrt rounding edges, is that you start off with square edges, and remove the sharp edges. Bare openscad can not do that easily. However there are plenty of other software tools that can. In reality, it is often more expedient to mechanically finish the object, files, emery-cloth, whatever. Possibly a woodworker would think differently, since they often glue on mouldings. >> >> d=10; >> $fn=80; >> module profile(){ >> rotate_extrude(){ >> difference(){ >> translate([-d/2,0]) >> square(d); >> translate([0.01+d/2,d/2]) >> circle(d=d); >> translate([-d-d,0]) //cut off lhs >> square(d+d); >> } >> } >> } >> >> // profile(); >> >> module shape(){ >> linear_extrude(0.001){ >> difference(){ >> square (100); >> translate([25,25]) square(50); >> } >> } >> } >> module stamp(){ >> minkowski(){ >> shape(); >> profile(); >> } >> } >> >> stamp(); >> >> >> >> On 15/08/2024 23:49, Jordan Brown via Discuss wrote: >>> There has been a lot of detailed discussion, but little in the way of general discussion of the problem. >>> >>> There are three basic approaches: >>> Create a 2D shape with holes, extrude it, and somehow (probably with Minkowski) round the corners. >>> Create a 3D shape, and a shape that you want removed, and difference the two. >>> Create the entire shape as a polyhedron, with the rounding designed in. >>> Minkowski can be really slow, so I generally don’t consider it. Also, it might be tricky to restrict its effect to the edges that you want rounded. >>> >>> Creating a polyhedron is very very powerful and can be very very hard. I think BOSL2 might have the tools required to create a polyhedron like this, but I’m not familiar enough to be sure. Maybe Adrian can chime in there. >>> >>> I would personally think in terms of the second option, subtracting the unwanted shape from the original shape. >>> >>> Constructing the negative shape can be complex, but is generally straightforward even if tedious. For your oval slots, start with two cylinders joined by a cube. >>> >>> I’m on my iPad so can’t experiment, but something like >>> >>> difference() { >>> cube([50,50,10], center=true); >>> translate([-10,0,0]) cylinder(h=11, d=10, center=true); >>> translate([10,0,0]) cylinder(h=11, d=10, center=true); >>> cube([20,10,11], center=true); >>> } >>> >>> That gets you a straight-sided slot. Sculpt it as desired by subtracting stuff from the negative piece. Note, for instance, that a cylinder is a rotationally-extruded square, so if you want round edges at the ends you might take a square, subtract a circle along one edge, and rotationally extrude that. Similarly, the cube in the middle is an extruded square, so take a square, subtract circles on each side, and extrude that. However you construct it, when you have your negative “die”, subtract it from the main object. Always remember to make the negative object a little thicker than the original, so that it protrudes from both sides. >>> >>> If there is interest, I’ll write up a demo snippet in a few days when I get back to my desktop computer. >>> >>> >>> _______________________________________________ >>> OpenSCAD mailing list >>> To unsubscribe send an email to discuss-leave@lists.openscad.org <mailto:discuss-leave@lists.openscad.org> >> _______________________________________________ >> OpenSCAD mailing list >> To unsubscribe send an email to discuss-leave@lists.openscad.org <mailto:discuss-leave@lists.openscad.org> > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org
RD
Revar Desmera
Sat, Aug 17, 2024 8:49 AM

Actually, the imperfection was user error.  I forgot to specify edges="Y" in the cuboid():

include <BOSL2/std.scad>
$fn=72;
cuboid([30,50,20], edges="Y", rounding=-5);
ycopies(50) cyl(d=30,h=20,rounding=-5);

  • Revar

On Aug 17, 2024, at 1:12 AM, Revar Desmera revarbat@gmail.com wrote:

With BOSL2 you can make an interior rounding mask using negative radius roundings.  For example:

cuboid([30,50,20], rounding=-5);
ycopies(50) cyl(d=30,h=20,rounding=-5);

<Screenshot 2024-08-17 at 1.10.44 AM.png>

I do note that there seems to be a slight imperfection to the mask, though.

  • Revar

On Aug 16, 2024, at 5:46 AM, Michael Zimbaro via Discuss discuss@lists.openscad.org wrote:

Yes, the size issue is interesting.  I think what you said earlier about reducing my size by the radius seems to be working.  Originally my part was created with Bols2 using the 3d library.  I could not find a way to get the inner rounded edges.  I have now switched to Bols2 2D and the Minkowski as suggested but wow is it ever slow.  I increased my facets to 90 and my part has been compiling for at least 30 minutes.  I want to do a test print of the first few layers to make sure the size is right.  Interesting that you suggested using two cylinders and a cube for the inside.  I did the same using 2 circles and a square in 2d then extruding.

My part is almost complete.  I would like to share the code to see what others would suggest in the future.  I always welcome a better way.  Is anyone interested in seeing it?

On Fri, Aug 16, 2024 at 8:19 AM Raymond West via Discuss <discuss@lists.openscad.org mailto:discuss@lists.openscad.org> wrote:

My previous example, is additive, i.e, have a basic shape and add on fillets, etc. That means, if you are wanting to deal with the overall size, which is generally true, than the radius has to be taken off the outside edges, and added to internal edges.

For shapes such as have been shown, then simple maths suffices, but more complex shapes offset can be used. But Minkowski can be slow, as you say, certainly at high resolution and complex profiles. The rounded chamfers are the problem.  For more basic shapes, boxes, etc., then I generate a profile strip and difference with the edges. A question of finding the best solution for a particular problem, one size does not fit all, so to speak.

You can generate a profile, the negative of a sphere, and generate 'holes' in shapes such that when differenced will leave a rounded edge. I've attached a bit of code. The advantage is that no maths is needed to subtract the radius. The disadvantage is that Minkowski is much slower with the complex profile,  overall it is cumbersome, and often it breaks the mesh when differencing.

The way in which I believe most folk think wrt rounding edges, is that you start off with square edges, and remove the sharp edges.  Bare openscad can not do that easily. However there are plenty of other software tools that can. In reality, it is often more expedient  to mechanically finish the object, files, emery-cloth, whatever. Possibly a woodworker would think differently, since they often glue on mouldings.

d=10;
$fn=80;
module profile(){
rotate_extrude(){
difference(){
translate([-d/2,0])
square(d);
translate([0.01+d/2,d/2])
circle(d=d);
translate([-d-d,0])  //cut off lhs
square(d+d);
}
}
}

//  profile();

module shape(){
linear_extrude(0.001){
difference(){
square (100);
translate([25,25]) square(50);
}
}
}
module stamp(){
minkowski(){
shape();
profile();
}
}

stamp();

On 15/08/2024 23:49, Jordan Brown via Discuss wrote:

There has been a lot of detailed discussion, but little in the way of general discussion of the problem.

There are three basic approaches:
Create a 2D shape with holes, extrude it, and somehow (probably with Minkowski) round the corners.
Create a 3D shape, and a shape that you want removed, and difference the two.
Create the entire shape as a polyhedron, with the rounding designed in.
Minkowski can be really slow, so I generally don’t consider it. Also, it might be tricky to restrict its effect to the edges that you want rounded.

Creating a polyhedron is very very powerful and can be very very hard.  I think BOSL2 might have the tools required to create a polyhedron like this, but I’m not familiar enough to be sure. Maybe Adrian can chime in there.

I would personally think in terms of the second option, subtracting the unwanted shape from the original shape.

Constructing the negative shape can be complex, but is generally straightforward even if tedious. For your oval slots, start with two cylinders joined by a cube.

I’m on my iPad so can’t experiment, but something like

difference() {
cube([50,50,10], center=true);
translate([-10,0,0]) cylinder(h=11, d=10, center=true);
translate([10,0,0]) cylinder(h=11, d=10, center=true);
cube([20,10,11], center=true);
}

That gets you a straight-sided slot.  Sculpt it as desired by subtracting stuff from the negative piece. Note, for instance, that a cylinder is a rotationally-extruded square, so if you want round edges at the ends you might take a square, subtract a circle along one edge, and rotationally extrude that. Similarly, the cube in the middle is an extruded square, so take a square, subtract circles on each side, and extrude that. However you construct it, when you have your negative “die”, subtract it from the main object. Always remember to make the negative object a little thicker than the original, so that it protrudes from both sides.

If there is interest, I’ll write up a demo snippet in a few days when I get back to my desktop computer.


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org mailto:discuss-leave@lists.openscad.org


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org mailto:discuss-leave@lists.openscad.org


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org

Actually, the imperfection was user error. I forgot to specify `edges="Y"` in the `cuboid()`: include <BOSL2/std.scad> $fn=72; cuboid([30,50,20], edges="Y", rounding=-5); ycopies(50) cyl(d=30,h=20,rounding=-5);  - Revar > On Aug 17, 2024, at 1:12 AM, Revar Desmera <revarbat@gmail.com> wrote: > > With BOSL2 you can make an interior rounding mask using negative radius roundings. For example: > > cuboid([30,50,20], rounding=-5); > ycopies(50) cyl(d=30,h=20,rounding=-5); > > <Screenshot 2024-08-17 at 1.10.44 AM.png> > > I do note that there seems to be a slight imperfection to the mask, though. > > - Revar > > > >> On Aug 16, 2024, at 5:46 AM, Michael Zimbaro via Discuss <discuss@lists.openscad.org> wrote: >> >> Yes, the size issue is interesting. I think what you said earlier about reducing my size by the radius seems to be working. Originally my part was created with Bols2 using the 3d library. I could not find a way to get the inner rounded edges. I have now switched to Bols2 2D and the Minkowski as suggested but wow is it ever slow. I increased my facets to 90 and my part has been compiling for at least 30 minutes. I want to do a test print of the first few layers to make sure the size is right. Interesting that you suggested using two cylinders and a cube for the inside. I did the same using 2 circles and a square in 2d then extruding. >> >> My part is almost complete. I would like to share the code to see what others would suggest in the future. I always welcome a better way. Is anyone interested in seeing it? >> >> On Fri, Aug 16, 2024 at 8:19 AM Raymond West via Discuss <discuss@lists.openscad.org <mailto:discuss@lists.openscad.org>> wrote: >>> My previous example, is additive, i.e, have a basic shape and add on fillets, etc. That means, if you are wanting to deal with the overall size, which is generally true, than the radius has to be taken off the outside edges, and added to internal edges. >>> >>> For shapes such as have been shown, then simple maths suffices, but more complex shapes offset can be used. But Minkowski can be slow, as you say, certainly at high resolution and complex profiles. The rounded chamfers are the problem. For more basic shapes, boxes, etc., then I generate a profile strip and difference with the edges. A question of finding the best solution for a particular problem, one size does not fit all, so to speak. >>> >>> You can generate a profile, the negative of a sphere, and generate 'holes' in shapes such that when differenced will leave a rounded edge. I've attached a bit of code. The advantage is that no maths is needed to subtract the radius. The disadvantage is that Minkowski is much slower with the complex profile, overall it is cumbersome, and often it breaks the mesh when differencing. >>> >>> The way in which I believe most folk think wrt rounding edges, is that you start off with square edges, and remove the sharp edges. Bare openscad can not do that easily. However there are plenty of other software tools that can. In reality, it is often more expedient to mechanically finish the object, files, emery-cloth, whatever. Possibly a woodworker would think differently, since they often glue on mouldings. >>> >>> d=10; >>> $fn=80; >>> module profile(){ >>> rotate_extrude(){ >>> difference(){ >>> translate([-d/2,0]) >>> square(d); >>> translate([0.01+d/2,d/2]) >>> circle(d=d); >>> translate([-d-d,0]) //cut off lhs >>> square(d+d); >>> } >>> } >>> } >>> >>> // profile(); >>> >>> module shape(){ >>> linear_extrude(0.001){ >>> difference(){ >>> square (100); >>> translate([25,25]) square(50); >>> } >>> } >>> } >>> module stamp(){ >>> minkowski(){ >>> shape(); >>> profile(); >>> } >>> } >>> >>> stamp(); >>> >>> >>> >>> On 15/08/2024 23:49, Jordan Brown via Discuss wrote: >>>> There has been a lot of detailed discussion, but little in the way of general discussion of the problem. >>>> >>>> There are three basic approaches: >>>> Create a 2D shape with holes, extrude it, and somehow (probably with Minkowski) round the corners. >>>> Create a 3D shape, and a shape that you want removed, and difference the two. >>>> Create the entire shape as a polyhedron, with the rounding designed in. >>>> Minkowski can be really slow, so I generally don’t consider it. Also, it might be tricky to restrict its effect to the edges that you want rounded. >>>> >>>> Creating a polyhedron is very very powerful and can be very very hard. I think BOSL2 might have the tools required to create a polyhedron like this, but I’m not familiar enough to be sure. Maybe Adrian can chime in there. >>>> >>>> I would personally think in terms of the second option, subtracting the unwanted shape from the original shape. >>>> >>>> Constructing the negative shape can be complex, but is generally straightforward even if tedious. For your oval slots, start with two cylinders joined by a cube. >>>> >>>> I’m on my iPad so can’t experiment, but something like >>>> >>>> difference() { >>>> cube([50,50,10], center=true); >>>> translate([-10,0,0]) cylinder(h=11, d=10, center=true); >>>> translate([10,0,0]) cylinder(h=11, d=10, center=true); >>>> cube([20,10,11], center=true); >>>> } >>>> >>>> That gets you a straight-sided slot. Sculpt it as desired by subtracting stuff from the negative piece. Note, for instance, that a cylinder is a rotationally-extruded square, so if you want round edges at the ends you might take a square, subtract a circle along one edge, and rotationally extrude that. Similarly, the cube in the middle is an extruded square, so take a square, subtract circles on each side, and extrude that. However you construct it, when you have your negative “die”, subtract it from the main object. Always remember to make the negative object a little thicker than the original, so that it protrudes from both sides. >>>> >>>> If there is interest, I’ll write up a demo snippet in a few days when I get back to my desktop computer. >>>> >>>> >>>> _______________________________________________ >>>> OpenSCAD mailing list >>>> To unsubscribe send an email to discuss-leave@lists.openscad.org <mailto:discuss-leave@lists.openscad.org> >>> _______________________________________________ >>> OpenSCAD mailing list >>> To unsubscribe send an email to discuss-leave@lists.openscad.org <mailto:discuss-leave@lists.openscad.org> >> _______________________________________________ >> OpenSCAD mailing list >> To unsubscribe send an email to discuss-leave@lists.openscad.org >
PK
Peter Kriens
Sat, Aug 17, 2024 1:59 PM

Wow, impressive!

On 16 Aug 2024, at 23:27, Glenn Butcher via Discuss discuss@lists.openscad.org wrote:

Oh, I love Round-Anything's polyRound() module...

I modeled a complete steam locomotive with it, using it 83 times to make the rounded shapes 1880's steam locomotive designers so loved:

<integration-_2024-06-24.png>

On 8/16/2024 8:55 AM, Peter Kriens via Discuss wrote:

You might want to take a look at https://learn.cadhub.xyz/docs/round-anything/api-reference/#polyround

<PastedGraphic-1.png>

The library can round a path with square corners with variable radii. For this, you add the radius as the z coordinate in a 3vec. It can then extrude this path with a radius at the end. For the outer component you can use a positive radius for the under and top side. You can then make the inner shapes the same way and subtract them. However, you can then make the radii of the ends negative, which leaves a nice round shape.

The library could use some love. If your path contains undef it will hang ... :-( (Surprised OpenSCAD does not run the rendering in a background thread?) This is the function of the val() routine, to check this.

The quickly hacked together code.

use <lib/Round-Anything/polyround.scad>

$fn=50;
function val(p) = [for(i=p) assert( ! (is_undef(i.x) || is_undef(i.y)|| is_undef(i.y)))];

rect=[60,60];
round=[140,20];
a = 20;
/*

      -rect.x/2            rect.x/2
         a----------------b            rect.y/2
         |                |
   m-----n                c-----d      round.y
  /                              \
l+                                + e
  \                              /
   k-----j                g-----f      0
         |                |
         |                |
         i----------------h            -rect.y/2
         
                 0
         
 

*/

l = -rect.x/2;
r = -l;
t = rect.y/2;
b = -t;

path = [
[l,  t,  5], // a
[r,  t,  5], // b
[r,  round.y,  5], // c
[round.x/2-round.y,  round.y,  5], // d
[round.x/2,          round.y/2,  round.y], // e
[round.x/2-round.y,  0,  round.y], // f
[r,  0,  5], // g
[r,  b,  5], // h
[l,  b,  5], // i
[l,  0,  5], // j
[-round.x/2+round.y,  0,  5], // k
[-round.x/2,  round.y/2,  round.y], // l
[-round.x/2+round.y,  round.y,  round.y], // m
[l,  round.y, 5], // n
];

function exclude( w, h ) = let(
adj = h/2,
path = [
[-w/2,0,adj],
[-w/2+adj,h/2,adj],
[w/2-adj,h/2,adj],
[w/2,0,adj],
[w/2-adj,-h/2,adj],
[-w/2+adj,-h/2,adj],
],

) path;

x=val(path);
difference() {
polyRoundExtrude(path,r1=2, r2=2);
translate([-round.x/2+30,10,0]) polyRoundExtrude(exclude(25,5),r1=-2, r2=-2);
translate([round.x/2-30,10,0]) polyRoundExtrude(exclude(25,5),r1=-2, r2=-2);
translate([0,10,0]) polyRoundExtrude(exclude(40,8),r1=-2, r2=-2);
translate([0,-10,0]) polyRoundExtrude(exclude(40,8),r1=-2, r2=-2);
}

On 16 Aug 2024, at 15:45, Raymond West via Discuss discuss@lists.openscad.org mailto:discuss@lists.openscad.org wrote:

you can set $fn =20 for testing, see if it looks OK. Minkowski is then fairly quick. When you have it looking right, then set $fn to 100, say, for the final stl, and come back after lunch.

If it is only an stl that you want, it used to be you could feed the scad file into AngelCad, and it used to produce an stl quite quickly. I'm not sure if openscad has caught up wrt speed, or even if AngelCAD accepts minkowski.  Freecad can also import scad files and render. It allows individual edges to be selected for filleting. It tends to export back to openscad as a large polyhedron, you lose the individual cubes and cylinders, etc.  fwiw, bevels are better for printing, not round-overs.

On 16/08/2024 13:46, Michael Zimbaro via Discuss wrote:

Yes, the size issue is interesting.  I think what you said earlier about reducing my size by the radius seems to be working.  Originally my part was created with Bols2 using the 3d library.  I could not find a way to get the inner rounded edges.  I have now switched to Bols2 2D and the Minkowski as suggested but wow is it ever slow.  I increased my facets to 90 and my part has been compiling for at least 30 minutes.  I want to do a test print of the first few layers to make sure the size is right.  Interesting that you suggested using two cylinders and a cube for the inside.  I did the same using 2 circles and a square in 2d then extruding.

My part is almost complete.  I would like to share the code to see what others would suggest in the future.  I always welcome a better way.  Is anyone interested in seeing it?

On Fri, Aug 16, 2024 at 8:19 AM Raymond West via Discuss <discuss@lists.openscad.org mailto:discuss@lists.openscad.org> wrote:

My previous example, is additive, i.e, have a basic shape and add on fillets, etc. That means, if you are wanting to deal with the overall size, which is generally true, than the radius has to be taken off the outside edges, and added to internal edges.

For shapes such as have been shown, then simple maths suffices, but more complex shapes offset can be used. But Minkowski can be slow, as you say, certainly at high resolution and complex profiles. The rounded chamfers are the problem.  For more basic shapes, boxes, etc., then I generate a profile strip and difference with the edges. A question of finding the best solution for a particular problem, one size does not fit all, so to speak.

You can generate a profile, the negative of a sphere, and generate 'holes' in shapes such that when differenced will leave a rounded edge. I've attached a bit of code. The advantage is that no maths is needed to subtract the radius. The disadvantage is that Minkowski is much slower with the complex profile,  overall it is cumbersome, and often it breaks the mesh when differencing.

The way in which I believe most folk think wrt rounding edges, is that you start off with square edges, and remove the sharp edges.  Bare openscad can not do that easily. However there are plenty of other software tools that can. In reality, it is often more expedient  to mechanically finish the object, files, emery-cloth, whatever. Possibly a woodworker would think differently, since they often glue on mouldings.

d=10;
$fn=80;
module profile(){
rotate_extrude(){
difference(){
translate([-d/2,0])
square(d);
translate([0.01+d/2,d/2])
circle(d=d);
translate([-d-d,0])  //cut off lhs
square(d+d);
}
}
}

//  profile();

module shape(){
linear_extrude(0.001){
difference(){
square (100);
translate([25,25]) square(50);
}
}
}
module stamp(){
minkowski(){
shape();
profile();
}
}

stamp();

On 15/08/2024 23:49, Jordan Brown via Discuss wrote:

There has been a lot of detailed discussion, but little in the way of general discussion of the problem.

There are three basic approaches:
Create a 2D shape with holes, extrude it, and somehow (probably with Minkowski) round the corners.
Create a 3D shape, and a shape that you want removed, and difference the two.
Create the entire shape as a polyhedron, with the rounding designed in.
Minkowski can be really slow, so I generally don’t consider it. Also, it might be tricky to restrict its effect to the edges that you want rounded.

Creating a polyhedron is very very powerful and can be very very hard.  I think BOSL2 might have the tools required to create a polyhedron like this, but I’m not familiar enough to be sure. Maybe Adrian can chime in there.

I would personally think in terms of the second option, subtracting the unwanted shape from the original shape.

Constructing the negative shape can be complex, but is generally straightforward even if tedious. For your oval slots, start with two cylinders joined by a cube.

I’m on my iPad so can’t experiment, but something like

difference() {
cube([50,50,10], center=true);
translate([-10,0,0]) cylinder(h=11, d=10, center=true);
translate([10,0,0]) cylinder(h=11, d=10, center=true);
cube([20,10,11], center=true);
}

That gets you a straight-sided slot.  Sculpt it as desired by subtracting stuff from the negative piece. Note, for instance, that a cylinder is a rotationally-extruded square, so if you want round edges at the ends you might take a square, subtract a circle along one edge, and rotationally extrude that. Similarly, the cube in the middle is an extruded square, so take a square, subtract circles on each side, and extrude that. However you construct it, when you have your negative “die”, subtract it from the main object. Always remember to make the negative object a little thicker than the original, so that it protrudes from both sides.

If there is interest, I’ll write up a demo snippet in a few days when I get back to my desktop computer.


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org mailto:discuss-leave@lists.openscad.org


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org mailto:discuss-leave@lists.openscad.org


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org mailto:discuss-leave@lists.openscad.org


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org mailto:discuss-leave@lists.openscad.org


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org mailto:discuss-leave@lists.openscad.org


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org

Wow, impressive! > On 16 Aug 2024, at 23:27, Glenn Butcher via Discuss <discuss@lists.openscad.org> wrote: > > Oh, I love Round-Anything's polyRound() module... > > I modeled a complete steam locomotive with it, using it 83 times to make the rounded shapes 1880's steam locomotive designers so loved: > > <integration-_2024-06-24.png> > > > > > On 8/16/2024 8:55 AM, Peter Kriens via Discuss wrote: >> You might want to take a look at https://learn.cadhub.xyz/docs/round-anything/api-reference/#polyround >> >> >> >> <PastedGraphic-1.png> >> >> The library can round a path with square corners with variable radii. For this, you add the radius as the z coordinate in a 3vec. It can then extrude this path with a radius at the end. For the outer component you can use a positive radius for the under and top side. You can then make the inner shapes the same way and subtract them. However, you can then make the radii of the ends negative, which leaves a nice round shape. >> >> The library could use some love. If your path contains undef it will hang ... :-( (Surprised OpenSCAD does not run the rendering in a background thread?) This is the function of the val() routine, to check this. >> >> The quickly hacked together code. >> >> >> use <lib/Round-Anything/polyround.scad> >> >> $fn=50; >> function val(p) = [for(i=p) assert( ! (is_undef(i.x) || is_undef(i.y)|| is_undef(i.y)))]; >> >> rect=[60,60]; >> round=[140,20]; >> a = 20; >> /* >> >> -rect.x/2 rect.x/2 >> a----------------b rect.y/2 >> | | >> m-----n c-----d round.y >> / \ >> l+ + e >> \ / >> k-----j g-----f 0 >> | | >> | | >> i----------------h -rect.y/2 >> >> 0 >> >> >> >> */ >> >> >> l = -rect.x/2; >> r = -l; >> t = rect.y/2; >> b = -t; >> >> path = [ >> [l, t, 5], // a >> [r, t, 5], // b >> [r, round.y, 5], // c >> [round.x/2-round.y, round.y, 5], // d >> [round.x/2, round.y/2, round.y], // e >> [round.x/2-round.y, 0, round.y], // f >> [r, 0, 5], // g >> [r, b, 5], // h >> [l, b, 5], // i >> [l, 0, 5], // j >> [-round.x/2+round.y, 0, 5], // k >> [-round.x/2, round.y/2, round.y], // l >> [-round.x/2+round.y, round.y, round.y], // m >> [l, round.y, 5], // n >> ]; >> >> >> function exclude( w, h ) = let( >> adj = h/2, >> path = [ >> [-w/2,0,adj], >> [-w/2+adj,h/2,adj], >> [w/2-adj,h/2,adj], >> [w/2,0,adj], >> [w/2-adj,-h/2,adj], >> [-w/2+adj,-h/2,adj], >> ], >> >> ) path; >> >> x=val(path); >> difference() { >> polyRoundExtrude(path,r1=2, r2=2); >> translate([-round.x/2+30,10,0]) polyRoundExtrude(exclude(25,5),r1=-2, r2=-2); >> translate([round.x/2-30,10,0]) polyRoundExtrude(exclude(25,5),r1=-2, r2=-2); >> translate([0,10,0]) polyRoundExtrude(exclude(40,8),r1=-2, r2=-2); >> translate([0,-10,0]) polyRoundExtrude(exclude(40,8),r1=-2, r2=-2); >> } >> >> >> >> >>> On 16 Aug 2024, at 15:45, Raymond West via Discuss <discuss@lists.openscad.org> <mailto:discuss@lists.openscad.org> wrote: >>> >>> you can set $fn =20 for testing, see if it looks OK. Minkowski is then fairly quick. When you have it looking right, then set $fn to 100, say, for the final stl, and come back after lunch. >>> >>> If it is only an stl that you want, it used to be you could feed the scad file into AngelCad, and it used to produce an stl quite quickly. I'm not sure if openscad has caught up wrt speed, or even if AngelCAD accepts minkowski. Freecad can also import scad files and render. It allows individual edges to be selected for filleting. It tends to export back to openscad as a large polyhedron, you lose the individual cubes and cylinders, etc. fwiw, bevels are better for printing, not round-overs. >>> >>> On 16/08/2024 13:46, Michael Zimbaro via Discuss wrote: >>>> Yes, the size issue is interesting. I think what you said earlier about reducing my size by the radius seems to be working. Originally my part was created with Bols2 using the 3d library. I could not find a way to get the inner rounded edges. I have now switched to Bols2 2D and the Minkowski as suggested but wow is it ever slow. I increased my facets to 90 and my part has been compiling for at least 30 minutes. I want to do a test print of the first few layers to make sure the size is right. Interesting that you suggested using two cylinders and a cube for the inside. I did the same using 2 circles and a square in 2d then extruding. >>>> >>>> My part is almost complete. I would like to share the code to see what others would suggest in the future. I always welcome a better way. Is anyone interested in seeing it? >>>> >>>> On Fri, Aug 16, 2024 at 8:19 AM Raymond West via Discuss <discuss@lists.openscad.org <mailto:discuss@lists.openscad.org>> wrote: >>>>> My previous example, is additive, i.e, have a basic shape and add on fillets, etc. That means, if you are wanting to deal with the overall size, which is generally true, than the radius has to be taken off the outside edges, and added to internal edges. >>>>> >>>>> For shapes such as have been shown, then simple maths suffices, but more complex shapes offset can be used. But Minkowski can be slow, as you say, certainly at high resolution and complex profiles. The rounded chamfers are the problem. For more basic shapes, boxes, etc., then I generate a profile strip and difference with the edges. A question of finding the best solution for a particular problem, one size does not fit all, so to speak. >>>>> >>>>> You can generate a profile, the negative of a sphere, and generate 'holes' in shapes such that when differenced will leave a rounded edge. I've attached a bit of code. The advantage is that no maths is needed to subtract the radius. The disadvantage is that Minkowski is much slower with the complex profile, overall it is cumbersome, and often it breaks the mesh when differencing. >>>>> >>>>> The way in which I believe most folk think wrt rounding edges, is that you start off with square edges, and remove the sharp edges. Bare openscad can not do that easily. However there are plenty of other software tools that can. In reality, it is often more expedient to mechanically finish the object, files, emery-cloth, whatever. Possibly a woodworker would think differently, since they often glue on mouldings. >>>>> >>>>> d=10; >>>>> $fn=80; >>>>> module profile(){ >>>>> rotate_extrude(){ >>>>> difference(){ >>>>> translate([-d/2,0]) >>>>> square(d); >>>>> translate([0.01+d/2,d/2]) >>>>> circle(d=d); >>>>> translate([-d-d,0]) //cut off lhs >>>>> square(d+d); >>>>> } >>>>> } >>>>> } >>>>> >>>>> // profile(); >>>>> >>>>> module shape(){ >>>>> linear_extrude(0.001){ >>>>> difference(){ >>>>> square (100); >>>>> translate([25,25]) square(50); >>>>> } >>>>> } >>>>> } >>>>> module stamp(){ >>>>> minkowski(){ >>>>> shape(); >>>>> profile(); >>>>> } >>>>> } >>>>> >>>>> stamp(); >>>>> >>>>> >>>>> >>>>> On 15/08/2024 23:49, Jordan Brown via Discuss wrote: >>>>>> There has been a lot of detailed discussion, but little in the way of general discussion of the problem. >>>>>> >>>>>> There are three basic approaches: >>>>>> Create a 2D shape with holes, extrude it, and somehow (probably with Minkowski) round the corners. >>>>>> Create a 3D shape, and a shape that you want removed, and difference the two. >>>>>> Create the entire shape as a polyhedron, with the rounding designed in. >>>>>> Minkowski can be really slow, so I generally don’t consider it. Also, it might be tricky to restrict its effect to the edges that you want rounded. >>>>>> >>>>>> Creating a polyhedron is very very powerful and can be very very hard. I think BOSL2 might have the tools required to create a polyhedron like this, but I’m not familiar enough to be sure. Maybe Adrian can chime in there. >>>>>> >>>>>> I would personally think in terms of the second option, subtracting the unwanted shape from the original shape. >>>>>> >>>>>> Constructing the negative shape can be complex, but is generally straightforward even if tedious. For your oval slots, start with two cylinders joined by a cube. >>>>>> >>>>>> I’m on my iPad so can’t experiment, but something like >>>>>> >>>>>> difference() { >>>>>> cube([50,50,10], center=true); >>>>>> translate([-10,0,0]) cylinder(h=11, d=10, center=true); >>>>>> translate([10,0,0]) cylinder(h=11, d=10, center=true); >>>>>> cube([20,10,11], center=true); >>>>>> } >>>>>> >>>>>> That gets you a straight-sided slot. Sculpt it as desired by subtracting stuff from the negative piece. Note, for instance, that a cylinder is a rotationally-extruded square, so if you want round edges at the ends you might take a square, subtract a circle along one edge, and rotationally extrude that. Similarly, the cube in the middle is an extruded square, so take a square, subtract circles on each side, and extrude that. However you construct it, when you have your negative “die”, subtract it from the main object. Always remember to make the negative object a little thicker than the original, so that it protrudes from both sides. >>>>>> >>>>>> If there is interest, I’ll write up a demo snippet in a few days when I get back to my desktop computer. >>>>>> >>>>>> >>>>>> _______________________________________________ >>>>>> OpenSCAD mailing list >>>>>> To unsubscribe send an email to discuss-leave@lists.openscad.org <mailto:discuss-leave@lists.openscad.org> >>>>> _______________________________________________ >>>>> OpenSCAD mailing list >>>>> To unsubscribe send an email to discuss-leave@lists.openscad.org <mailto:discuss-leave@lists.openscad.org> >>>> >>>> >>>> _______________________________________________ >>>> OpenSCAD mailing list >>>> To unsubscribe send an email to discuss-leave@lists.openscad.org <mailto:discuss-leave@lists.openscad.org> >>> _______________________________________________ >>> OpenSCAD mailing list >>> To unsubscribe send an email to discuss-leave@lists.openscad.org <mailto:discuss-leave@lists.openscad.org> >> >> >> >> _______________________________________________ >> OpenSCAD mailing list >> To unsubscribe send an email to discuss-leave@lists.openscad.org <mailto:discuss-leave@lists.openscad.org> > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org
SP
Sanjeev Prabhakar
Sat, Aug 17, 2024 3:30 PM

Really impressive indeed

On Sat, 17 Aug, 2024, 2:57 am Glenn Butcher via Discuss, <
discuss@lists.openscad.org> wrote:

Oh, I love Round-Anything's polyRound() module...

I modeled a complete steam locomotive with it, using it 83 times to make
the rounded shapes 1880's steam locomotive designers so loved:

On 8/16/2024 8:55 AM, Peter Kriens via Discuss wrote:

You might want to take a look at
https://learn.cadhub.xyz/docs/round-anything/api-reference/#polyround

[image: PastedGraphic-1.png]

The library can round a path with square corners with variable radii. For
this, you add the radius as the z coordinate in a 3vec. It can then extrude
this path with a radius at the end. For the outer component you can use a
positive radius for the under and top side. You can then make the inner
shapes the same way and subtract them. However, you can then make the radii
of the ends negative, which leaves a nice round shape.

The library could use some love. If your path contains undef it will hang
... :-( (Surprised OpenSCAD does not run the rendering in a background
thread?) This is the function of the val() routine, to check this.

The quickly hacked together code.

use <lib/Round-Anything/polyround.scad>

$fn=50;
function val(p) = [for(i=p) assert( ! (is_undef(i.x) || is_undef(i.y)||
is_undef(i.y)))];

rect=[60,60];
round=[140,20];
a = 20;
/*

      -rect.x/2            rect.x/2
         a----------------b            rect.y/2
         |                |
   m-----n                c-----d      round.y
  /                              \
l+                                + e
  \                              /
   k-----j                g-----f      0
         |                |
         |                |
         i----------------h            -rect.y/2

                 0

*/

l = -rect.x/2;
r = -l;
t = rect.y/2;
b = -t;

path = [
[l,  t,  5], // a
[r,  t,  5], // b
[r,  round.y,  5], // c
[round.x/2-round.y,  round.y,  5], // d
[round.x/2,          round.y/2,  round.y], // e
[round.x/2-round.y,  0,  round.y], // f
[r,  0,  5], // g
[r,  b,  5], // h
[l,  b,  5], // i
[l,  0,  5], // j
[-round.x/2+round.y,  0,  5], // k
[-round.x/2,  round.y/2,  round.y], // l
[-round.x/2+round.y,  round.y,  round.y], // m
[l,  round.y, 5], // n
];

function exclude( w, h ) = let(
adj = h/2,
path = [
[-w/2,0,adj],
[-w/2+adj,h/2,adj],
[w/2-adj,h/2,adj],
[w/2,0,adj],
[w/2-adj,-h/2,adj],
[-w/2+adj,-h/2,adj],
],

) path;

x=val(path);
difference() {
polyRoundExtrude(path,r1=2, r2=2);
translate([-round.x/2+30,10,0]) polyRoundExtrude(exclude(25,5),r1=-2,
r2=-2);
translate([round.x/2-30,10,0]) polyRoundExtrude(exclude(25,5),r1=-2,
r2=-2);
translate([0,10,0]) polyRoundExtrude(exclude(40,8),r1=-2, r2=-2);
translate([0,-10,0]) polyRoundExtrude(exclude(40,8),r1=-2, r2=-2);
}

On 16 Aug 2024, at 15:45, Raymond West via Discuss
discuss@lists.openscad.org discuss@lists.openscad.org wrote:

you can set $fn =20 for testing, see if it looks OK. Minkowski is then
fairly quick. When you have it looking right, then set $fn to 100, say, for
the final stl, and come back after lunch.

If it is only an stl that you want, it used to be you could feed the scad
file into AngelCad, and it used to produce an stl quite quickly. I'm not
sure if openscad has caught up wrt speed, or even if AngelCAD accepts
minkowski.  Freecad can also import scad files and render. It allows
individual edges to be selected for filleting. It tends to export back to
openscad as a large polyhedron, you lose the individual cubes and
cylinders, etc.  fwiw, bevels are better for printing, not round-overs.
On 16/08/2024 13:46, Michael Zimbaro via Discuss wrote:

Yes, the size issue is interesting.  I think what you said earlier about
reducing my size by the radius seems to be working.  Originally my part was
created with Bols2 using the 3d library.  I could not find a way to get the
inner rounded edges.  I have now switched to Bols2 2D and the Minkowski as
suggested but wow is it ever slow.  I increased my facets to 90 and my part
has been compiling for at least 30 minutes.  I want to do a test print of
the first few layers to make sure the size is right.  Interesting that you
suggested using two cylinders and a cube for the inside.  I did the same
using 2 circles and a square in 2d then extruding.

My part is almost complete.  I would like to share the code to see what
others would suggest in the future.  I always welcome a better way.  Is
anyone interested in seeing it?

On Fri, Aug 16, 2024 at 8:19 AM Raymond West via Discuss <
discuss@lists.openscad.org> wrote:

My previous example, is additive, i.e, have a basic shape and add on
fillets, etc. That means, if you are wanting to deal with the overall size,
which is generally true, than the radius has to be taken off the outside
edges, and added to internal edges.

For shapes such as have been shown, then simple maths suffices, but more
complex shapes offset can be used. But Minkowski can be slow, as you say,
certainly at high resolution and complex profiles. The rounded chamfers are
the problem.  For more basic shapes, boxes, etc., then I generate a profile
strip and difference with the edges. A question of finding the best
solution for a particular problem, one size does not fit all, so to speak.

You can generate a profile, the negative of a sphere, and generate
'holes' in shapes such that when differenced will leave a rounded edge.
I've attached a bit of code. The advantage is that no maths is needed to
subtract the radius. The disadvantage is that Minkowski is much slower with
the complex profile,  overall it is cumbersome, and often it breaks the
mesh when differencing.

The way in which I believe most folk think wrt rounding edges, is that
you start off with square edges, and remove the sharp edges.  Bare openscad
can not do that easily. However there are plenty of other software tools
that can. In reality, it is often more expedient  to mechanically finish
the object, files, emery-cloth, whatever. Possibly a woodworker would think
differently, since they often glue on mouldings.

d=10;
$fn=80;
module profile(){
rotate_extrude(){
difference(){
translate([-d/2,0])
square(d);
translate([0.01+d/2,d/2])
circle(d=d);
translate([-d-d,0])  //cut off lhs
square(d+d);
}
}
}

//  profile();

module shape(){
linear_extrude(0.001){
difference(){
square (100);
translate([25,25]) square(50);
}
}
}
module stamp(){
minkowski(){
shape();
profile();
}
}

stamp();

On 15/08/2024 23:49, Jordan Brown via Discuss wrote:

There has been a lot of detailed discussion, but little in the way of
general discussion of the problem.

There are three basic approaches:

- Create a 2D shape with holes, extrude it, and somehow (probably
with Minkowski) round the corners.
- Create a 3D shape, and a shape that you want removed, and
difference the two.
- Create the entire shape as a polyhedron, with the rounding designed
in.

Minkowski can be really slow, so I generally don’t consider it. Also, it
might be tricky to restrict its effect to the edges that you want rounded.

Creating a polyhedron is very very powerful and can be very very hard.  I
think BOSL2 might have the tools required to create a polyhedron like this,
but I’m not familiar enough to be sure. Maybe Adrian can chime in there.

I would personally think in terms of the second option, subtracting the
unwanted shape from the original shape.

Constructing the negative shape can be complex, but is generally
straightforward even if tedious. For your oval slots, start with two
cylinders joined by a cube.

I’m on my iPad so can’t experiment, but something like

difference() {
cube([50,50,10], center=true);
translate([-10,0,0]) cylinder(h=11, d=10, center=true);
translate([10,0,0]) cylinder(h=11, d=10, center=true);
cube([20,10,11], center=true);
}

That gets you a straight-sided slot.  Sculpt it as desired by subtracting
stuff from the negative piece. Note, for instance, that a cylinder is a
rotationally-extruded square, so if you want round edges at the ends you
might take a square, subtract a circle along one edge, and rotationally
extrude that. Similarly, the cube in the middle is an extruded square, so
take a square, subtract circles on each side, and extrude that. However you
construct it, when you have your negative “die”, subtract it from the main
object. Always remember to make the negative object a little thicker than
the original, so that it protrudes from both sides.

If there is interest, I’ll write up a demo snippet in a few days when I
get back to my desktop computer.


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org

Really impressive indeed On Sat, 17 Aug, 2024, 2:57 am Glenn Butcher via Discuss, < discuss@lists.openscad.org> wrote: > Oh, I love Round-Anything's polyRound() module... > > I modeled a complete steam locomotive with it, using it 83 times to make > the rounded shapes 1880's steam locomotive designers so loved: > > > > On 8/16/2024 8:55 AM, Peter Kriens via Discuss wrote: > > You might want to take a look at > https://learn.cadhub.xyz/docs/round-anything/api-reference/#polyround > > > > [image: PastedGraphic-1.png] > > The library can round a path with square corners with variable radii. For > this, you add the radius as the z coordinate in a 3vec. It can then extrude > this path with a radius at the end. For the outer component you can use a > positive radius for the under and top side. You can then make the inner > shapes the same way and subtract them. However, you can then make the radii > of the ends negative, which leaves a nice round shape. > > The library could use some love. If your path contains undef it will hang > ... :-( (Surprised OpenSCAD does not run the rendering in a background > thread?) This is the function of the val() routine, to check this. > > The quickly hacked together code. > > > use <lib/Round-Anything/polyround.scad> > > $fn=50; > function val(p) = [for(i=p) assert( ! (is_undef(i.x) || is_undef(i.y)|| > is_undef(i.y)))]; > > rect=[60,60]; > round=[140,20]; > a = 20; > /* > > -rect.x/2 rect.x/2 > a----------------b rect.y/2 > | | > m-----n c-----d round.y > / \ > l+ + e > \ / > k-----j g-----f 0 > | | > | | > i----------------h -rect.y/2 > > 0 > > > > */ > > > l = -rect.x/2; > r = -l; > t = rect.y/2; > b = -t; > > path = [ > [l, t, 5], // a > [r, t, 5], // b > [r, round.y, 5], // c > [round.x/2-round.y, round.y, 5], // d > [round.x/2, round.y/2, round.y], // e > [round.x/2-round.y, 0, round.y], // f > [r, 0, 5], // g > [r, b, 5], // h > [l, b, 5], // i > [l, 0, 5], // j > [-round.x/2+round.y, 0, 5], // k > [-round.x/2, round.y/2, round.y], // l > [-round.x/2+round.y, round.y, round.y], // m > [l, round.y, 5], // n > ]; > > > function exclude( w, h ) = let( > adj = h/2, > path = [ > [-w/2,0,adj], > [-w/2+adj,h/2,adj], > [w/2-adj,h/2,adj], > [w/2,0,adj], > [w/2-adj,-h/2,adj], > [-w/2+adj,-h/2,adj], > ], > > ) path; > > x=val(path); > difference() { > polyRoundExtrude(path,r1=2, r2=2); > translate([-round.x/2+30,10,0]) polyRoundExtrude(exclude(25,5),r1=-2, > r2=-2); > translate([round.x/2-30,10,0]) polyRoundExtrude(exclude(25,5),r1=-2, > r2=-2); > translate([0,10,0]) polyRoundExtrude(exclude(40,8),r1=-2, r2=-2); > translate([0,-10,0]) polyRoundExtrude(exclude(40,8),r1=-2, r2=-2); > } > > > > > On 16 Aug 2024, at 15:45, Raymond West via Discuss > <discuss@lists.openscad.org> <discuss@lists.openscad.org> wrote: > > you can set $fn =20 for testing, see if it looks OK. Minkowski is then > fairly quick. When you have it looking right, then set $fn to 100, say, for > the final stl, and come back after lunch. > > If it is only an stl that you want, it used to be you could feed the scad > file into AngelCad, and it used to produce an stl quite quickly. I'm not > sure if openscad has caught up wrt speed, or even if AngelCAD accepts > minkowski. Freecad can also import scad files and render. It allows > individual edges to be selected for filleting. It tends to export back to > openscad as a large polyhedron, you lose the individual cubes and > cylinders, etc. fwiw, bevels are better for printing, not round-overs. > On 16/08/2024 13:46, Michael Zimbaro via Discuss wrote: > > Yes, the size issue is interesting. I think what you said earlier about > reducing my size by the radius seems to be working. Originally my part was > created with Bols2 using the 3d library. I could not find a way to get the > inner rounded edges. I have now switched to Bols2 2D and the Minkowski as > suggested but wow is it ever slow. I increased my facets to 90 and my part > has been compiling for at least 30 minutes. I want to do a test print of > the first few layers to make sure the size is right. Interesting that you > suggested using two cylinders and a cube for the inside. I did the same > using 2 circles and a square in 2d then extruding. > > My part is almost complete. I would like to share the code to see what > others would suggest in the future. I always welcome a better way. Is > anyone interested in seeing it? > > On Fri, Aug 16, 2024 at 8:19 AM Raymond West via Discuss < > discuss@lists.openscad.org> wrote: > >> My previous example, is additive, i.e, have a basic shape and add on >> fillets, etc. That means, if you are wanting to deal with the overall size, >> which is generally true, than the radius has to be taken off the outside >> edges, and added to internal edges. >> >> For shapes such as have been shown, then simple maths suffices, but more >> complex shapes offset can be used. But Minkowski can be slow, as you say, >> certainly at high resolution and complex profiles. The rounded chamfers are >> the problem. For more basic shapes, boxes, etc., then I generate a profile >> strip and difference with the edges. A question of finding the best >> solution for a particular problem, one size does not fit all, so to speak. >> >> You can generate a profile, the negative of a sphere, and generate >> 'holes' in shapes such that when differenced will leave a rounded edge. >> I've attached a bit of code. The advantage is that no maths is needed to >> subtract the radius. The disadvantage is that Minkowski is much slower with >> the complex profile, overall it is cumbersome, and often it breaks the >> mesh when differencing. >> >> The way in which I believe most folk think wrt rounding edges, is that >> you start off with square edges, and remove the sharp edges. Bare openscad >> can not do that easily. However there are plenty of other software tools >> that can. In reality, it is often more expedient to mechanically finish >> the object, files, emery-cloth, whatever. Possibly a woodworker would think >> differently, since they often glue on mouldings. >> >> d=10; >> $fn=80; >> module profile(){ >> rotate_extrude(){ >> difference(){ >> translate([-d/2,0]) >> square(d); >> translate([0.01+d/2,d/2]) >> circle(d=d); >> translate([-d-d,0]) //cut off lhs >> square(d+d); >> } >> } >> } >> >> // profile(); >> >> module shape(){ >> linear_extrude(0.001){ >> difference(){ >> square (100); >> translate([25,25]) square(50); >> } >> } >> } >> module stamp(){ >> minkowski(){ >> shape(); >> profile(); >> } >> } >> >> stamp(); >> >> >> On 15/08/2024 23:49, Jordan Brown via Discuss wrote: >> >> There has been a lot of detailed discussion, but little in the way of >> general discussion of the problem. >> >> There are three basic approaches: >> >> - Create a 2D shape with holes, extrude it, and somehow (probably >> with Minkowski) round the corners. >> - Create a 3D shape, and a shape that you want removed, and >> difference the two. >> - Create the entire shape as a polyhedron, with the rounding designed >> in. >> >> Minkowski can be really slow, so I generally don’t consider it. Also, it >> might be tricky to restrict its effect to the edges that you want rounded. >> >> Creating a polyhedron is very very powerful and can be very very hard. I >> think BOSL2 might have the tools required to create a polyhedron like this, >> but I’m not familiar enough to be sure. Maybe Adrian can chime in there. >> >> I would personally think in terms of the second option, subtracting the >> unwanted shape from the original shape. >> >> Constructing the negative shape can be complex, but is generally >> straightforward even if tedious. For your oval slots, start with two >> cylinders joined by a cube. >> >> I’m on my iPad so can’t experiment, but something like >> >> difference() { >> cube([50,50,10], center=true); >> translate([-10,0,0]) cylinder(h=11, d=10, center=true); >> translate([10,0,0]) cylinder(h=11, d=10, center=true); >> cube([20,10,11], center=true); >> } >> >> That gets you a straight-sided slot. Sculpt it as desired by subtracting >> stuff from the negative piece. Note, for instance, that a cylinder is a >> rotationally-extruded square, so if you want round edges at the ends you >> might take a square, subtract a circle along one edge, and rotationally >> extrude that. Similarly, the cube in the middle is an extruded square, so >> take a square, subtract circles on each side, and extrude that. However you >> construct it, when you have your negative “die”, subtract it from the main >> object. Always remember to make the negative object a little thicker than >> the original, so that it protrudes from both sides. >> >> If there is interest, I’ll write up a demo snippet in a few days when I >> get back to my desktop computer. >> >> _______________________________________________ >> OpenSCAD mailing list >> To unsubscribe send an email to discuss-leave@lists.openscad.org >> >> _______________________________________________ >> OpenSCAD mailing list >> To unsubscribe send an email to discuss-leave@lists.openscad.org >> > > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org > > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org > > > > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org > > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org >