Avoid a sharp corner between two objects

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Avoid a sharp corner between two objects

Katt
Hi guys;

I am 2 weeks old with OpenSCAD so bear with me if it is an easy one. -

I am wondering how to avoid a sharp corner between two objects in openscad.

-------
Code:
sphere (r=0.3, $fn=50);

rotate([90,0,0])
{
 cylinder (h=2, r=0.1, center=true, $fn=20);
}

rotate([0,90,0])
{
 cylinder (h=2, r=0.1, center=true, $fn=20);
}
--------------

I would like to avoid the sharp edges between the cylinder and sphere.

In a way I want something like an expanding column.
An example: something similar to this but the cylinder is connected to a
sphere and NOT A PLANE.
https://www.thingiverse.com/thing:137984
<https://www.thingiverse.com/thing:137984>  

I tried a few samples using minkowski() function as well, but the outer
surface of the cylinder looks swollen which is not what i actually want.

Any hint please!!



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

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: Avoid a sharp corner between two objects

codifies
first two ideas that came to mind... (btw tiny tiny objects - but then I
assume units are mm - too much 3d printing!)

sphere (r=0.3, $fn=50);

translate([.25,0,0]) sphere(r=0.15, $fn=50);
translate([-.25,0,0]) sphere(r=0.15, $fn=50);
translate([0,.25,0]) sphere(r=0.15, $fn=50);
translate([0,-.25,0]) sphere(r=0.15, $fn=50);
rotate([90,0,0]) cylinder (h=2, r=0.1, center=true, $fn=20);
rotate([0,90,0]) cylinder (h=2, r=0.1, center=true, $fn=20);

translate([1.5,1.5,0]) {
  hull() {
   sphere(r=0.3, $fn=50);
   rotate([90,0,0]) cylinder (h=.7, r=0.1, center=true, $fn=20);
   rotate([0,90,0]) cylinder (h=.7, r=0.1, center=true, $fn=20);
  }
  rotate([90,0,0]) cylinder (h=2, r=0.1, center=true, $fn=20);
  rotate([0,90,0]) cylinder (h=2, r=0.1, center=true, $fn=20);
}


On 18/10/17 11:39, Katt wrote:

> sphere (r=0.3, $fn=50);
>
> rotate([90,0,0])
> {
>   cylinder (h=2, r=0.1, center=true, $fn=20);
> }
>
> rotate([0,90,0])
> {
>   cylinder (h=2, r=0.1, center=true, $fn=20);
> }


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: Avoid a sharp corner between two objects

Katt
Thanks;

That was a good try and sharing some ideas. *The hull() is definitely what I
am not looking for*.

The first one, using several spheres at the ends of a cylinder is close but
not ideal.
As such, you don't get a perfect arc shape. The reason why I want
specifically an arc is because I want to mesh it later for fluid flow
calculations. The scale as of now is not an issue as I scale the image. I
deal with micron size.
However, this results in the same sharp boundary between the new sphere and
the main larger sphere.

 



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

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: Avoid a sharp corner between two objects

algotruneman
In reply to this post by Katt
On 10/18/2017 06:39 AM, Katt wrote:

> Hi guys;
>
> I am 2 weeks old with OpenSCAD so bear with me if it is an easy one. -
>
> I am wondering how to avoid a sharp corner between two objects in openscad.
>
> -------
> Code:
> sphere (r=0.3, $fn=50);
>
> rotate([90,0,0])
> {
>   cylinder (h=2, r=0.1, center=true, $fn=20);
> }
>
> rotate([0,90,0])
> {
>   cylinder (h=2, r=0.1, center=true, $fn=20);
> }
> --------------
>
> I would like to avoid the sharp edges between the cylinder and sphere.
>
> In a way I want something like an expanding column.
> An example: something similar to this but the cylinder is connected to a
> sphere and NOT A PLANE.
> https://www.thingiverse.com/thing:137984
> <https://www.thingiverse.com/thing:137984>
>
> I tried a few samples using minkowski() function as well, but the outer
> surface of the cylinder looks swollen which is not what i actually want.
>
> Any hint please!!
>
A very rough and incomplete suggestion:

With a bit of careful manipulation, removing a torus and tube (as a
module) from each end of your cylinders might do the trick. In this
code, only one end of one cylinder is illustrated.

--Algot

sphere (r=5, $fn=50);

difference(){
rotate([90,0,0])
{
  cylinder (h=20, r=3, center=true, $fn=20);

}
// torus
translate([0,5.1,0])
rotate([90,0,0])
rotate_extrude(convexity = 10)
translate([4, 0, 0])
circle(r = 1.5, $fn=20);
     translate([0,8,0])
     rotate([90,0,0])
     tube();
}

rotate([0,90,0])
{
  cylinder (h=20, r=3, center=true, $fn=20);
}

// tube
module tube(){
     difference(){
         cylinder(h=5,r=3,center=true,$fn=20);
         cylinder(h=5,r=2.5,center=true,$fn=20);
     }}

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: Avoid a sharp corner between two objects

Gadgetmind
In reply to this post by Katt
On 2017-10-18 11:39, Katt wrote:
> I am wondering how to avoid a sharp corner between two objects in openscad.

There is some scad code for a 3D fillet. I tried in on your example, and
I also made objects larger for my own convenience and added a fn
variable to let me easily adjust face count.  Note when using "in anger"
I'd probably also have a wrapper for fillet that let me turn in on and
off globally and also have local overrides.

Does this do what you want? You'll have to download fillet.scad and
either have in same folder or in library folder.

//
https://github.com/clothbot/ClothBotCreations/blob/master/utilities/fillet.scad
include <fillet.scad>;

fn = 5;

fillet(r=3,steps=5, include=true) {

     sphere (r=30, $fn=5*fn);

     rotate([90,0,0])
     {
      cylinder (h=200, r=10, center=true, $fn=2*fn);
     }

     rotate([0,90,0])
     {
      cylinder (h=200, r=10, center=true, $fn=2*fn);
     }

}


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: Avoid a sharp corner between two objects

louijp
In reply to this post by Katt
Katt,

What about doing as below:

hull() {
sphere (r=0.3, $fn=50);
rotate([90,0,0]) cylinder (h=.6, r=0.1, center=true, $fn=20);
rotate([0,90,0]) cylinder (h=.6, r=0.1, center=true, $fn=20);
};
rotate([90,0,0]) cylinder (h=2, r=0.1, center=true, $fn=20);
rotate([0,90,0]) cylinder (h=2, r=0.1, center=true, $fn=20);

Just an idea,

Jean-Paul
N1JPL



> On Oct 18, 2017, at 8:35 AM, Katt <[hidden email]> wrote:
>
> Thanks;
>
> That was a good try and sharing some ideas. *The hull() is definitely what I
> am not looking for*.
>
> The first one, using several spheres at the ends of a cylinder is close but
> not ideal.
> As such, you don't get a perfect arc shape. The reason why I want
> specifically an arc is because I want to mesh it later for fluid flow
> calculations. The scale as of now is not an issue as I scale the image. I
> deal with micron size.
> However, this results in the same sharp boundary between the new sphere and
> the main larger sphere.
>
>
>
>
>
> --
> Sent from: http://forum.openscad.org/
>
> _______________________________________________
> OpenSCAD mailing list
> [hidden email]
> http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org