discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

non-circular cylinder?

A
AllTheGoodUsernamesAreTaken
Tue, May 30, 2017 11:23 PM

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.

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.
JD
Jerry Davis
Wed, May 31, 2017 12:52 AM

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

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
ER
Ezra Reynolds
Wed, May 31, 2017 1:05 AM

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 73-69-6d-6f-6e@protonmail.com 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
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

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 <73-69-6d-6f-6e@protonmail.com> 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 > Discuss@lists.openscad.org > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
B
boxcarmib
Wed, May 31, 2017 1:16 AM

or perhaps even...

hull() {
cylinder(r1 = 10, r2 = 1, h = 15);
translate([-20,0,0])
cylinder(r1 = 10, r2 = 1, h = 15);
}

--
View this message in context: http://forum.openscad.org/non-circular-cylinder-tp21603p21606.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

or perhaps even... hull() { cylinder(r1 = 10, r2 = 1, h = 15); translate([-20,0,0]) cylinder(r1 = 10, r2 = 1, h = 15); } -- View this message in context: http://forum.openscad.org/non-circular-cylinder-tp21603p21606.html Sent from the OpenSCAD mailing list archive at Nabble.com.
RP
Ronaldo Persiano
Wed, May 31, 2017 3:15 PM

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);
}

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); }