non-circular cylinder?

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

non-circular cylinder?

AllTheUsernamesAreTaken
Hello, self taught openSCAD newbie here, I was wondering if there is a way to create a pyramid/cone with a non-circular base, more precisely with the shape of
hull(){
    cylinder(h=2,d=13);
translate([-20,0,0]){
    cylinder(h=2,d=13);
}
}

so you know how you can do cylinder(r1=40,r2=1,h=20); to make a cone with a base radius of 10 and a height of 15. however, this makes a cone with a circular base, but I need the base to be this shape:
hull(){
    cylinder(h=2,d=13);
translate([-20,0,0]){
    cylinder(h=2,d=13);
}
}
sorry, I can't really think of a better way to word it, so I hope that you guys can understand what i'm trying to say. Any help would be MUCH appreciated, thanks!
Reply | Threaded
Open this post in threaded view
|

Re: non-circular cylinder?

jdawgaz
what about two examples?

$fn = 60;

translate([20,0,0]) 
  scale([1.0,.75,1.0]) cylinder(r1=10,r2=.1,h=20);

hull() {
    cylinder(h=2,d=13);
    translate([-20,0,0]) cylinder(h=2,d=13);
    translate([-10,0,10]) cylinder(h=2,d=.1);    
}




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

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


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

Re: non-circular cylinder?

shadowwynd
In reply to this post by AllTheUsernamesAreTaken
Try hulling a thin extrusion with a tiny sphere at (0,0, height).

Away from pc so I can't test it but this should work.

hull()
{
    linear_extrude(0.1)
        hull()
       {
          translate ([20,0,0]) circle (r=5);
          translate ([-20,0,0]) circle (r=5);
       }

     translate ([0,0,20]) sphere(d=0.01);
}

Sent from my iPhone

> On May 30, 2017, at 6:23 PM, AllTheGoodUsernamesAreTaken <[hidden email]> wrote:
>
> Hello, self taught openSCAD newbie here, I was wondering if there is a way to
> create a pyramid/cone with a non-circular base, more precisely with the
> shape of
> hull(){
>    cylinder(h=2,d=13);
> translate([-20,0,0]){
>    cylinder(h=2,d=13);
> }
> }
>
> so you know how you can do cylinder(r1=40,r2=1,h=20); to make a cone with a
> base radius of 10 and a height of 15. however, this makes a cone with a
> circular base, but I need the base to be this shape:
> hull(){
>    cylinder(h=2,d=13);
> translate([-20,0,0]){
>    cylinder(h=2,d=13);
> }
> }
> sorry, I can't really think of a better way to word it, so I hope that you
> guys can understand what i'm trying to say. Any help would be MUCH
> appreciated, thanks!
>
>
>
> --
> View this message in context: http://forum.openscad.org/non-circular-cylinder-tp21603.html
> Sent from the OpenSCAD mailing list archive at Nabble.com.
>
> _______________________________________________
> 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
Reply | Threaded
Open this post in threaded view
|

Re: non-circular cylinder?

boxcarmib
In reply to this post by AllTheUsernamesAreTaken
or perhaps even...

hull() {
        cylinder(r1 = 10, r2 = 1, h = 15);
        translate([-20,0,0])
                cylinder(r1 = 10, r2 = 1, h = 15);
}
Reply | Threaded
Open this post in threaded view
|

Re: non-circular cylinder?

Ronaldo
If your base shape may be described by a 2D shape, you may use linear_extrude with scale parameter:

linear_extrude(h=20,scale=0)
hull(){
   circle(d=13);
   translate([-20,0,0]) circle(d=13);
}

Note the cone apex is on the z axis, so if you want it to project on the center of the base, change to:

linear_extrude(h=20,scale=0)
hull(){
  translate([-10,0,0])  circle(d=13);
  translate([ 10,0,0])  circle(d=13);
}



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