hollow cone in open scad or sketchup

1,954 views
Skip to first unread message

beverageexpert

unread,
Mar 19, 2012, 5:55:47 PM3/19/12
to MakerBot Operators
I need to draw a simple cone around 25mm tall with a 4mm opening in
the top hollowed out and walls about 2mm thick.
I am playing around with open scad right now and the cylinder object
seems the way to go but how do I hollow it out?

the cones I make in sketchup using the follow me tool get filled up in
skeinforge. I figured it out the other week but cant mimic my results.

thanks
bryan

Jeremy Green

unread,
Mar 19, 2012, 6:05:44 PM3/19/12
to make...@googlegroups.com
Height=25;
Opening=4;
Thickness=2;
Base=20;

Difference() {
cylinder(r1=base/2, r2=opening/2+thickness, h=height);
Cylinder(r1=base/2-thickness, r2=opening/2, h=height);
}

Please excuse the formatting and random capitalization. It's my iPhone's fault.

> --
> You received this message because you are subscribed to the Google Groups "MakerBot Operators" group.
> To post to this group, send email to make...@googlegroups.com.
> To unsubscribe from this group, send email to makerbot+u...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/makerbot?hl=en.
>

beverageexpert

unread,
Mar 19, 2012, 6:11:19 PM3/19/12
to MakerBot Operators
my version of open scad doesnt understand difference

On Mar 19, 6:05 pm, Jeremy Green <jeremyalangr...@gmail.com> wrote:
> Height=25;
> Opening=4;
> Thickness=2;
> Base=20;
>
> Difference() {
>  cylinder(r1=base/2, r2=opening/2+thickness, h=height);
> Cylinder(r1=base/2-thickness, r2=opening/2, h=height);
>
> }
>
> Please excuse the formatting and random capitalization. It's my iPhone's fault.
>

Dan Newman

unread,
Mar 19, 2012, 6:15:06 PM3/19/12
to make...@googlegroups.com

On 19 Mar 2012 , at 3:11 PM, beverageexpert wrote:

> my version of open scad doesnt understand difference

Lower case, "difference()". Not "Difference()". That error
is indicated by OpenSCAD in the log window on the lower,
right hand side.

And it's "cylinder" not "Cylinder()".

Dan

beverageexpert

unread,
Mar 19, 2012, 6:15:12 PM3/19/12
to MakerBot Operators
sorry it was the capitalization
it does make the cylinder but its not hollow

On Mar 19, 6:05 pm, Jeremy Green <jeremyalangr...@gmail.com> wrote:
> Height=25;
> Opening=4;
> Thickness=2;
> Base=20;
>
> Difference() {
>  cylinder(r1=base/2, r2=opening/2+thickness, h=height);
> Cylinder(r1=base/2-thickness, r2=opening/2, h=height);
>
> }
>
> Please excuse the formatting and random capitalization. It's my iPhone's fault.
>

Dan Newman

unread,
Mar 19, 2012, 6:18:03 PM3/19/12
to make...@googlegroups.com

On 19 Mar 2012 , at 3:15 PM, beverageexpert wrote:

> sorry it was the capitalization
> it does make the cylinder but its not hollow

You need to center the cylinders,

height=25;
opening=4;
thickness=2;
base=20;
difference() {
cylinder(r1=base/2, r2=opening/2+thickness, h=height, center=true);
cylinder(r1=base/2-thickness, r2=opening/2, h=height, center=true);
}

Dan Newman

unread,
Mar 19, 2012, 6:23:42 PM3/19/12
to make...@googlegroups.com
>> sorry it was the capitalization
>> it does make the cylinder but its not hollow
>
> You need to center the cylinders,

Actually, it also works without centering them now that I think
about it. Are you being sure to render using F6? F5 works as
well, but will probably illustrate the fact that you need to make the
inner cylinder a tad taller so as to deal with some issues
where the surfaces meet. (You should do that regardless of how
you render.) And when you make the inner cyl. a
tad taller, it's easier to center things than to have to translate
the inner one by ½ the height difference.

height=25;
opening=4;
thickness=2;
base=20;
difference() {
cylinder(r1=base/2, r2=opening/2+thickness, h=height, center=true);

cylinder(r1=base/2-thickness, r2=opening/2, h=height+1, center=true);
}

Dan

beverageexpert

unread,
Mar 19, 2012, 6:30:00 PM3/19/12
to MakerBot Operators
how do I make the inner cylinder taller? I am using compile and
render. looks good at first but sketchup sees a hole. skeinforge seems
to leave the center of the 2mm walls hollow. this is the problem I was
having with sketchup. I need the cylinder to be strong. I am going to
try and run it through netfab cloud and see what that does
thanks

Jeremy Green

unread,
Mar 19, 2012, 6:32:11 PM3/19/12
to make...@googlegroups.com
Yeah, I thought about adding the extra but then I figured I'd keep it simple...
I guess it's not really any simpler.

Jeremy Green

unread,
Mar 19, 2012, 6:34:35 PM3/19/12
to make...@googlegroups.com
It's pretty rare for openscad to make a bad STL. Try using the code that Dan emailed. Just put a center=true in each of the cylinder statements and put a +1 (or 0.1) after the height of the second cylinder

beverageexpert

unread,
Mar 19, 2012, 6:54:57 PM3/19/12
to MakerBot Operators
I have tried pretty much every variant you guys have suggested. there
is still a hole at the top. When I changed the diameter to 3 mm
skeinforge filled it in properly. so that issue must be in my
skeinforge settings. They want me to angle the hole down. is there an
easy way to do that? I appreciate all the help.

bryan

On Mar 19, 6:34 pm, Jeremy Green <jeremyalangr...@gmail.com> wrote:
> It's pretty rare for openscad to make a bad STL. Try using the code that Dan emailed. Just put a center=true in each of the cylinder statements and put a +1 (or 0.1) after the height of the second cylinder
>

Doug MacDonald

unread,
Mar 20, 2012, 6:43:37 AM3/20/12
to make...@googlegroups.com
Bryan, if you would like some basic tutorials on OpenSCAD, there are a series of Youtube videos from Digitaljestin which will show you the basics.  That, and the OpenSCAD online manual have helped me build some pretty complex shapes.  As wierd as it sounds, I've had better luck with OpenSCAD than with other CAD programs.

beverageexpert

unread,
Mar 20, 2012, 2:23:30 PM3/20/12
to MakerBot Operators
thanks for the advice. seems openscad is the way to go. With 7 lines
of code I had my object. I needed to adjust the sizes of the cone for
4 objects. It was awesome just having to change a few numbers and have
my perfect cones for my objects. I was going through some of the
examples. seems pretty intuitive. will definitely be using this more
often.

bryan

On Mar 20, 6:43 am, Doug MacDonald <dougsn...@gmail.com> wrote:
> Bryan, if you would like some basic tutorials on OpenSCAD, there are a
> series of Youtube videos from Digitaljestin which will show you the
> basics.  That, and the OpenSCAD online manual have helped me build some
> pretty complex shapes.  As wierd as it sounds, I've had better luck with
> OpenSCAD than with other CAD programs.
>
Reply all
Reply to author
Forward
0 new messages