discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

Bevelling a cylinder creates a void

LL
Luc Le Blanc
Sat, Jan 16, 2021 4:35 PM

I'm trying to bevel a drilled cylinder, but I when I do that, the top
of the cylinder disappears into a (green) hole. I attached a
screenshot. The 3D printer-owning friend I sent my STL to says there's
a strange gap at the top.

$fn=100;

difference()
{
difference()
{
cylinder(h=39, d=13.69);

     // bevel
    translate([-6.845,-15,18])
    {
        rotate(a=[0,-56.89,0])
        {
            cube(30);
        }
    }
}

// bolt hole
cylinder(h=39, d=4);

}

Of course, if I remove the bevel, the top of the cylinder is normal (yellow).

Is this a bug? Is there a better way to bevel a cylinder?

--
Luc Le Blanc

I'm trying to bevel a drilled cylinder, but I when I do that, the top of the cylinder disappears into a (green) hole. I attached a screenshot. The 3D printer-owning friend I sent my STL to says there's a strange gap at the top. $fn=100; difference() { difference() { cylinder(h=39, d=13.69); // bevel translate([-6.845,-15,18]) { rotate(a=[0,-56.89,0]) { cube(30); } } } // bolt hole cylinder(h=39, d=4); } Of course, if I remove the bevel, the top of the cylinder is normal (yellow). Is this a bug? Is there a better way to bevel a cylinder? -- Luc Le Blanc
A
adrianv
Sat, Jan 16, 2021 4:57 PM

The model works for me.  What version of OpenSCAD are you using?

lleblanc wrote

I'm trying to bevel a drilled cylinder, but I when I do that, the top
of the cylinder disappears into a (green) hole. I attached a
screenshot. The 3D printer-owning friend I sent my STL to says there's
a strange gap at the top.

$fn=100;

difference()
{
difference()
{
cylinder(h=39, d=13.69);

      // bevel
     translate([-6.845,-15,18])
     {
         rotate(a=[0,-56.89,0])
         {
             cube(30);
         }
     }
 }

 // bolt hole
 cylinder(h=39, d=4);

}

Of course, if I remove the bevel, the top of the cylinder is normal
(yellow).

Is this a bug? Is there a better way to bevel a cylinder?

--
Luc Le Blanc


OpenSCAD mailing list

Discuss@.openscad

http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

bevel.png (9K)
<http://forum.openscad.org/attachment/31592/0/bevel.png>

The model works for me. What version of OpenSCAD are you using? lleblanc wrote > I'm trying to bevel a drilled cylinder, but I when I do that, the top > of the cylinder disappears into a (green) hole. I attached a > screenshot. The 3D printer-owning friend I sent my STL to says there's > a strange gap at the top. > > $fn=100; > > difference() > { > difference() > { > cylinder(h=39, d=13.69); > > // bevel > translate([-6.845,-15,18]) > { > rotate(a=[0,-56.89,0]) > { > cube(30); > } > } > } > > // bolt hole > cylinder(h=39, d=4); > } > > Of course, if I remove the bevel, the top of the cylinder is normal > (yellow). > > Is this a bug? Is there a better way to bevel a cylinder? > > > -- > Luc Le Blanc > > _______________________________________________ > OpenSCAD mailing list > Discuss@.openscad > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org > > > bevel.png (9K) > &lt;http://forum.openscad.org/attachment/31592/0/bevel.png&gt; -- Sent from: http://forum.openscad.org/
F
fred
Sat, Jan 16, 2021 5:03 PM

When I run your code on my machine (Win7, OpenSCAD 2019.05) everything is fine. The exported STL passes Meshmixer inspector (watertight/manifold) and would likely print fine.

On Saturday, January 16, 2021, 11:58:40 AM EST, adrianv <avm4@cornell.edu> wrote:  

The model works for me.  What version of OpenSCAD are you using? 

lleblanc wrote

I'm trying to bevel a drilled cylinder, but I when I do that, the top
of the cylinder disappears into a (green) hole. I attached a
screenshot. The 3D printer-owning friend I sent my STL to says there's
a strange gap at the top.

$fn=100;

difference()
{
    difference()
    {
        cylinder(h=39, d=13.69);

          // bevel
        translate([-6.845,-15,18])
        {
            rotate(a=[0,-56.89,0])
            {
                cube(30);
            }
        }
    }

    // bolt hole
    cylinder(h=39, d=4);
}

Of course, if I remove the bevel, the top of the cylinder is normal
(yellow).

Is this a bug? Is there a better way to bevel a cylinder?

--
Luc Le Blanc


OpenSCAD mailing list

Discuss@.openscad

http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

bevel.png (9K)
<http://forum.openscad.org/attachment/31592/0/bevel.png>

When I run your code on my machine (Win7, OpenSCAD 2019.05) everything is fine. The exported STL passes Meshmixer inspector (watertight/manifold) and would likely print fine. On Saturday, January 16, 2021, 11:58:40 AM EST, adrianv <avm4@cornell.edu> wrote: The model works for me.  What version of OpenSCAD are you using?  lleblanc wrote > I'm trying to bevel a drilled cylinder, but I when I do that, the top > of the cylinder disappears into a (green) hole. I attached a > screenshot. The 3D printer-owning friend I sent my STL to says there's > a strange gap at the top. > > $fn=100; > > difference() > { >    difference() >    { >        cylinder(h=39, d=13.69); > >          // bevel >        translate([-6.845,-15,18]) >        { >            rotate(a=[0,-56.89,0]) >            { >                cube(30); >            } >        } >    } > >    // bolt hole >    cylinder(h=39, d=4); > } > > Of course, if I remove the bevel, the top of the cylinder is normal > (yellow). > > Is this a bug? Is there a better way to bevel a cylinder? > > > -- > Luc Le Blanc > > _______________________________________________ > OpenSCAD mailing list > Discuss@.openscad > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org > > > bevel.png (9K) > &lt;http://forum.openscad.org/attachment/31592/0/bevel.png> -- Sent from: http://forum.openscad.org/ _______________________________________________ OpenSCAD mailing list Discuss@lists.openscad.org http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
BC
Bob Carter
Sat, Jan 16, 2021 5:11 PM

I tried playing with the code and I get some rather strange F5 previews but the F6  render is OK using  2021.01.13 (git 0f79135ef)

difference(){      
    linear_extrude(39){
        difference(){   
            circle(d=13.69);
            circle(d=4);
        }    
    }
    // bevel
    translate([13.69/2,0,39]) rotate([0,-56.89,0]) cylinder(d=60,h=15);      

}

On 16 Jan 2021, at 17:03, fred via Discuss discuss@lists.openscad.org wrote:

When I run your code on my machine (Win7, OpenSCAD 2019.05) everything is fine. The exported STL passes Meshmixer inspector (watertight/manifold) and would likely print fine.

On Saturday, January 16, 2021, 11:58:40 AM EST, adrianv avm4@cornell.edu wrote:

The model works for me.  What version of OpenSCAD are you using?

lleblanc wrote

I'm trying to bevel a drilled cylinder, but I when I do that, the top
of the cylinder disappears into a (green) hole. I attached a
screenshot. The 3D printer-owning friend I sent my STL to says there's
a strange gap at the top.

$fn=100;

difference()
{
difference()
{
cylinder(h=39, d=13.69);

      // bevel
    translate([-6.845,-15,18])
    {
        rotate(a=[0,-56.89,0])
        {
            cube(30);
        }
    }
}

// bolt hole
cylinder(h=39, d=4);

}

Of course, if I remove the bevel, the top of the cylinder is normal
(yellow).

Is this a bug? Is there a better way to bevel a cylinder?

--
Luc Le Blanc


OpenSCAD mailing list

Discuss@.openscad mailto:Discuss@.openscad

I tried playing with the code and I get some rather strange F5 previews but the F6 render is OK using 2021.01.13 (git 0f79135ef) difference(){ linear_extrude(39){ difference(){ circle(d=13.69); circle(d=4); } } // bevel translate([13.69/2,0,39]) rotate([0,-56.89,0]) cylinder(d=60,h=15); } > On 16 Jan 2021, at 17:03, fred via Discuss <discuss@lists.openscad.org> wrote: > > When I run your code on my machine (Win7, OpenSCAD 2019.05) everything is fine. The exported STL passes Meshmixer inspector (watertight/manifold) and would likely print fine. > > On Saturday, January 16, 2021, 11:58:40 AM EST, adrianv <avm4@cornell.edu> wrote: > > > The model works for me. What version of OpenSCAD are you using? > > > lleblanc wrote > > I'm trying to bevel a drilled cylinder, but I when I do that, the top > > of the cylinder disappears into a (green) hole. I attached a > > screenshot. The 3D printer-owning friend I sent my STL to says there's > > a strange gap at the top. > > > > $fn=100; > > > > difference() > > { > > difference() > > { > > cylinder(h=39, d=13.69); > > > > // bevel > > translate([-6.845,-15,18]) > > { > > rotate(a=[0,-56.89,0]) > > { > > cube(30); > > } > > } > > } > > > > // bolt hole > > cylinder(h=39, d=4); > > } > > > > Of course, if I remove the bevel, the top of the cylinder is normal > > (yellow). > > > > Is this a bug? Is there a better way to bevel a cylinder? > > > > > > -- > > Luc Le Blanc > > > > _______________________________________________ > > OpenSCAD mailing list > > > Discuss@.openscad <mailto:Discuss@.openscad> > > > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org <http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org> > > > > > > bevel.png (9K) > > &lt;http://forum.openscad.org/attachment/31592/0/bevel.png> <http://forum.openscad.org/attachment/31592/0/bevel.png%3E> > > > > > > -- > Sent from: http://forum.openscad.org/ <http://forum.openscad.org/> > > > _______________________________________________ > OpenSCAD mailing list > Discuss@lists.openscad.org <mailto:Discuss@lists.openscad.org> > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org <http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org> > _______________________________________________ > OpenSCAD mailing list > Discuss@lists.openscad.org > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
RW
Ray West
Sat, Jan 16, 2021 5:21 PM

I find that when subtracting shapes, you need to make them longer than
what you are subtracting the shape from. If both edges are on the same
plane, it often has no idea what to do, you can see the flashing
yellow/green of indecision...

On 16/01/2021 16:35, Luc Le
On 16/01/2021 16:35, Luc Le Blanc wrote:

I'm trying to bevel a drilled cylinder, but I when I do that, the top
of the cylinder disappears into a (green) hole. I attached a
screenshot. The 3D printer-owning friend I sent my STL to says there's
a strange gap at the top.

$fn=100;

difference()
{
difference()
{
cylinder(h=39, d=13.69);

       // bevel
      translate([-6.845,-15,18])
      {
          rotate(a=[0,-56.89,0])
          {
              cube(30);
          }
      }
  }

  // bolt hole
  cylinder(h=39, d=4);

}

Of course, if I remove the bevel, the top of the cylinder is normal (yellow).

Is this a bug? Is there a better way to bevel a cylinder?


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

I find that when subtracting shapes, you need to make them longer than what you are subtracting the shape from. If both edges are on the same plane, it often has no idea what to do, you can see the flashing yellow/green of indecision... On 16/01/2021 16:35, Luc Le On 16/01/2021 16:35, Luc Le Blanc wrote: > I'm trying to bevel a drilled cylinder, but I when I do that, the top > of the cylinder disappears into a (green) hole. I attached a > screenshot. The 3D printer-owning friend I sent my STL to says there's > a strange gap at the top. > > $fn=100; > > difference() > { > difference() > { > cylinder(h=39, d=13.69); > > // bevel > translate([-6.845,-15,18]) > { > rotate(a=[0,-56.89,0]) > { > cube(30); > } > } > } > > // bolt hole > cylinder(h=39, d=4); > } > > Of course, if I remove the bevel, the top of the cylinder is normal (yellow). > > Is this a bug? Is there a better way to bevel a cylinder? > > > > _______________________________________________ > OpenSCAD mailing list > Discuss@lists.openscad.org > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
RW
Ray West
Sat, Jan 16, 2021 5:23 PM

make the last line -

  translate([0,0,-2]) cylinder(h=40, d=4);

On 16/01/2021 16:35, Luc Le Blanc wrote:

$fn=100;

difference()
{
difference()
{
cylinder(h=39, d=13.69);

       // bevel
      translate([-6.845,-15,18])
      {
          rotate(a=[0,-56.89,0])
          {
              cube(30);
          }
      }
  }

  // bolt hole
  cylinder(h=39, d=4);

}

make the last line -   translate([0,0,-2]) cylinder(h=40, d=4); On 16/01/2021 16:35, Luc Le Blanc wrote: > $fn=100; > > difference() > { > difference() > { > cylinder(h=39, d=13.69); > > // bevel > translate([-6.845,-15,18]) > { > rotate(a=[0,-56.89,0]) > { > cube(30); > } > } > } > > // bolt hole > cylinder(h=39, d=4); > }
A
adrianv
Sat, Jan 16, 2021 5:41 PM

I get weird behavior like that with the 2019.05 version as well as the RC5
version.  It also persists if I shrink the cutting cylinder down to a
smaller diameter.  I've seen weird preview behavior when the cutting object
is really big (like bigger than the viewport) but not in a case like this,
that I can remember.

It's bizarre that it works fine if you do the difference() in 3d but gives
those weird results when you use the more efficient technique of doing the
difference in 2d.

One other remark to the original poster:  When you do a difference it's
normal for the cut surface to be green.

I tried playing with the code and I get some rather strange F5 previews but
the F6  render is OK using  2021.01.13 (git 0f79135ef)

difference(){      
    linear_extrude(39){
        difference(){   
            circle(d=13.69);
            circle(d=4);
        }    
    }
    // bevel
    translate([13.69/2,0,39]) rotate([0,-56.89,0]) cylinder(d=60,h=15);      

}

--
Sent from: http://forum.openscad.org/

I get weird behavior like that with the 2019.05 version as well as the RC5 version. It also persists if I shrink the cutting cylinder down to a smaller diameter. I've seen weird preview behavior when the cutting object is really big (like bigger than the viewport) but not in a case like this, that I can remember. It's bizarre that it works fine if you do the difference() in 3d but gives those weird results when you use the more efficient technique of doing the difference in 2d. One other remark to the original poster: When you do a difference it's normal for the cut surface to be green. I tried playing with the code and I get some rather strange F5 previews but the F6 render is OK using 2021.01.13 (git 0f79135ef) difference(){ linear_extrude(39){ difference(){ circle(d=13.69); circle(d=4); } } // bevel translate([13.69/2,0,39]) rotate([0,-56.89,0]) cylinder(d=60,h=15); } -- Sent from: http://forum.openscad.org/
T
TLC123
Sat, Jan 16, 2021 6:02 PM

That is  to low convexity, default should be much higher but it is what it is
.

difference(){
linear_extrude(39,convexity=10){
difference(){
circle(d=13.69);
circle(d=4);
}
}
// bevel
translate([13.69/2,0,39]) rotate([0,-56.89,0]) cylinder(d=60,h=15);
}

--
Sent from: http://forum.openscad.org/

That is to low convexity, default should be much higher but it is what it is . difference(){ linear_extrude(39,convexity=10){ difference(){ circle(d=13.69); circle(d=4); } } // bevel translate([13.69/2,0,39]) rotate([0,-56.89,0]) cylinder(d=60,h=15); } -- Sent from: http://forum.openscad.org/
A
adrianv
Sat, Jan 16, 2021 6:28 PM

I never remember convexity.  I have it set to 10 in all my library functions,
and I've never noticed that this causes any problems or performance issues.
Is there some reason the default couldn't be changed in a future version of
OpenSCAD?    Why would anybody need convexity to be low?

TLC123 wrote

That is  to low convexity, default should be much higher but it is what it
is
.

difference(){
linear_extrude(39,convexity=10){
difference(){
circle(d=13.69);
circle(d=4);
}
}
// bevel
translate([13.69/2,0,39]) rotate([0,-56.89,0])
cylinder(d=60,h=15);
}

--
Sent from: http://forum.openscad.org/


OpenSCAD mailing list

Discuss@.openscad

I never remember convexity. I have it set to 10 in all my library functions, and I've never noticed that this causes any problems or performance issues. Is there some reason the default couldn't be changed in a future version of OpenSCAD? Why would anybody need convexity to be low? TLC123 wrote > That is to low convexity, default should be much higher but it is what it > is > . > > difference(){ > linear_extrude(39,convexity=10){ > difference(){ > circle(d=13.69); > circle(d=4); > } > } > // bevel > translate([13.69/2,0,39]) rotate([0,-56.89,0]) > cylinder(d=60,h=15); > } > > > > -- > Sent from: http://forum.openscad.org/ > > _______________________________________________ > OpenSCAD mailing list > Discuss@.openscad > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org -- Sent from: http://forum.openscad.org/
NH
nop head
Sat, Jan 16, 2021 6:32 PM

I think because 1 is the fastest and is correct for all the builtin solids.

Odd thing is that the number required seems to be PC dependent. On an old
laptop I had to set it higher!

On Sat, 16 Jan 2021 at 18:29, adrianv avm4@cornell.edu wrote:

I never remember convexity.  I have it set to 10 in all my library
functions,
and I've never noticed that this causes any problems or performance
issues.
Is there some reason the default couldn't be changed in a future version of
OpenSCAD?    Why would anybody need convexity to be low?

TLC123 wrote

That is  to low convexity, default should be much higher but it is what

it

is
.

difference(){
linear_extrude(39,convexity=10){
difference(){
circle(d=13.69);
circle(d=4);
}
}
// bevel
translate([13.69/2,0,39]) rotate([0,-56.89,0])
cylinder(d=60,h=15);
}

--
Sent from: http://forum.openscad.org/


OpenSCAD mailing list

Discuss@.openscad

I think because 1 is the fastest and is correct for all the builtin solids. Odd thing is that the number required seems to be PC dependent. On an old laptop I had to set it higher! On Sat, 16 Jan 2021 at 18:29, adrianv <avm4@cornell.edu> wrote: > I never remember convexity. I have it set to 10 in all my library > functions, > and I've never noticed that this causes any problems or performance > issues. > Is there some reason the default couldn't be changed in a future version of > OpenSCAD? Why would anybody need convexity to be low? > > > TLC123 wrote > > That is to low convexity, default should be much higher but it is what > it > > is > > . > > > > difference(){ > > linear_extrude(39,convexity=10){ > > difference(){ > > circle(d=13.69); > > circle(d=4); > > } > > } > > // bevel > > translate([13.69/2,0,39]) rotate([0,-56.89,0]) > > cylinder(d=60,h=15); > > } > > > > > > > > -- > > Sent from: http://forum.openscad.org/ > > > > _______________________________________________ > > OpenSCAD mailing list > > > Discuss@.openscad > > > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org > > > > > > -- > Sent from: http://forum.openscad.org/ > > _______________________________________________ > OpenSCAD mailing list > Discuss@lists.openscad.org > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org >