Ball vertical strip vase

... with a vertical line patter do trick your brain and hide the layer lines.

Inspired by Bubble pencil holder here's an OpenSCAD version. Enjoy!

// Author: Tiago Charters de Azevedo
// Maintainer: Tiago Charters de Azevedo

// Copyright (c) - 2021 Tiago Charters de Azevedo

// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 3, or (at your option)
// any later version.

// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.

// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor,
// Boston, MA 02110-1301, USA.

//Notes:
// Based on: https://www.prusaprinters.org/prints/86837-bubble-pencil-holder

$fn= $preview ? 16 : 32;

n=10;
m=5;
h=1.2;
eps=1;

rball=10;
rvase=30;

spacing=.75*rball;
lvase=m*rball+(m-1)*spacing;

echo("Height:");
echo(lvase);
echo("Radius:");
echo(rvase);

module balls(l=30,r=rball,theta=.25*360/(n-1),spacing=spacing){
    for(j=[0:m-2]){
        for(i=[0:n-2]){
            rotate([0,0,i*360/(n-1)+pow(-1,j)*theta])
            translate([rvase-.1*rball,0,(r+spacing)*j+r+spacing/2])
            sphere(r=r);}}}

module verts(r=rvase,l=lvase,hh=1.2){
    N=1.25*PI*rvase/hh;
    for(i=[0:N]){
        rotate([0,0,i*360/N])
        translate([rvase-h,0,lvase/2])
        cube([3*rball,hh,lvase+eps],center=true);}}


module cylinder1(r=rvase,l=lvase,h=h){
    translate([0,0,l/2])
    difference(){
        cylinder(h=l,r=r,center=true);
        translate([0,0,h])
        cylinder(h=l+eps,r=r-h,center=true);}}

module vase1(hollow=false){
    if (hollow==true){
        //balls
        difference(){
            balls(r=rball);
            cylinder(h=lvase,r=rvase-h);}
        // cylinder
        difference(){
            cylinder1(r=rvase,l=lvase,h=h);
            balls(r=rball);
        }}
    else{
        balls(r=rball);
        cylinder(r=rvase,h=lvase);}}

module vasesolid(){
        vasescale=(rvase-h)/rvase;
        union(){
            scale(vasescale*[1,1,1/vasescale])
            vase1(hollow=false);
            intersection(){
                vase1(hollow=false);
                verts();}}}

module vase(hollow=false){
    vasescale=(rvase-h)/rvase;
    if (hollow==false){
        vasesolid();}
    else{
        difference(){
            vasesolid();
            translate([0,0,lvase/2+h])
            cylinder(h=lvase+eps,r=rvase-2*h,center=true);
             for(j=[0:m-2])
            {
                for(i=[0:n-2])
                {
                    rotate([0,0,i*360/(n-1)+pow(-1,j)*.25*360/(n-1)])
                    translate([rvase-.1*rball,0,(rball+spacing)*j+rball+spacing/2])
                    sphere(r=rball-2*h);}}
            translate([0,0,2*h])
            cylinder(h=lvase,r=rvase-2*h);
            }
    }}




//show
vase(hollow=false);
Palavras chave/keywords: 3dprint, vase, openscad, opensource

Criado/Created: 06-12-2021 [09:54]

Última actualização/Last updated: 10-10-2022 [14:25]


Voltar à página inicial.


GNU/Emacs Creative Commons License

(c) Tiago Charters de Azevedo