# a ball with lot of holes

5 messages
Open this post in threaded view
|

## a ball with lot of holes

 This post was updated on . hello every body, i work on creation a ball with a lot of holes just i make 2 sphere in difference function but to make holes every square space of it, i got problem also for the code which it's slow to generate it : module boule(){ difference(){ sphere(r=12.5, center=true, \$fn = 280); sphere(r=11.9, center=true, \$fn = 280); } } difference(){ boule(); holes(); } module holes(){ module sp_1(){ for (i = [0:8]) { //echo(60*i/90, sin(60*i/90)*80, cos(60*i/90)*80); translate([sin(360*i/9)*11.6, cos(360*i/9)*11.6, 0]) sphere(r=2.2, center=true, \$fn = 280); } } module H_BDSM(){ sp_1(); mirror([1,0,1]){ sp_1(); } } H_BDSM(); } /* hull(){ rotate([45,45,0]){ translate([13.5,0,0]) cylinder(r=0.9, h=6.3, center=true, \$fn=6); } rotate([50,37,-10]){ translate([12,0,0]) rotate([90,90,90]){ cylinder(r=0.9, h=3.3, center=true, \$fn=6); } } rotate([50,52,12]){ translate([12,0,0]) rotate([90,90,90]){ cylinder(r=0.9, h=3.3, center=true, \$fn=6); } } } */ /* mirror([1,0,1]){ H_BDSM(); */ /*hull(){ rotate([-45,-145,0]){ translate([13.5,0,0]) cylinder(r=0.9, h=6.3, center=true, \$fn=6); } rotate([50,208,-9]){ translate([12,0,0]) rotate([90,90,90]){ cylinder(r=0.9, h=3.3, center=true, \$fn=6); } } rotate([50,222,9.4]){ translate([12,0,0]) rotate([90,90,90]){ cylinder(r=0.9, h=3.3, center=true, \$fn=6); } } } } */     //difference(){ //#left(); //rotate([1,234,18.4]) //translate([10.5,-0.6,0]) //} module in_1(){ scale([0.3,1.2,1]){ difference(){  sphere(r=2, \$fn=200); translate([-2,-2,0])   cube([4.1,4.1,4.1]);   } } } module out_1(){ scale([1.2,2.2,2]){ difference(){  sphere(r=0.8, \$fn=200); translate([-1,-1,0])   cube([2,2,1.7]);   } } } module left(){ rotate([-84,-173,86]){ difference(){ in_1(); out_1(); } } } rotate([-45,-145,10]) translate([11.8,0,0]) left(); module right(){ rotate([95,185,90]){ difference(){ in_1(); out_1(); } } } rotate([-45,-135,10]) translate([-11.8,0,0]) right();i hope you can find an other way to make the code simple and did the holes without interferes, and thank you -- Sent from: http://forum.openscad.org/_______________________________________________ OpenSCAD mailing list Discuss@lists.openscad.org http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Open this post in threaded view
|

## Re: a ball with lot of holes

 Without addressing a different method to create your model, I can suggest a substantial improvement by reducing the \$fn from 200 and 280 to as low as 90. This will give a faster preview at the very least.The sphere command defaults to the center and does not need that parameter in lines 7, 8 and 21 and will remove those errors as well. On Thursday, January 2, 2020, 5:42:16 PM EST, Higraphics <[hidden email]> wrote: hello every body, i work on creation a ball with a lot of holesjust i make 2 sphere in difference function but to make holes every square space of it, i got problem also for the code which it's slow to generate it :*// Sex Month ball// BDSM Fétiche// Bâillon Boule// Bâillon-boule en caoutchouc.module boule(){difference(){sphere(r=12.5, center=true, \$fn = 280);sphere(r=11.9, center=true, \$fn = 280);}}difference(){boule();holes();}module holes(){module sp_1(){for (i = [0:8]) {//echo(60*i/90, sin(60*i/90)*80, cos(60*i/90)*80);translate([sin(360*i/9)*11.6, cos(360*i/9)*11.6, 0])sphere(r=2.2, center=true, \$fn = 280);}}module H_BDSM(){sp_1();mirror([1,0,1]){sp_1();}}H_BDSM();}/*hull(){rotate([45,45,0]){translate([13.5,0,0])cylinder(r=0.9, h=6.3, center=true, \$fn=6);}rotate([50,37,-10]){translate([12,0,0])rotate([90,90,90]){cylinder(r=0.9, h=3.3, center=true, \$fn=6);}}rotate([50,52,12]){translate([12,0,0])rotate([90,90,90]){cylinder(r=0.9, h=3.3, center=true, \$fn=6);}}}*//*mirror([1,0,1]){H_BDSM();*//*hull(){rotate([-45,-145,0]){translate([13.5,0,0])cylinder(r=0.9, h=6.3, center=true, \$fn=6);}rotate([50,208,-9]){translate([12,0,0])rotate([90,90,90]){cylinder(r=0.9, h=3.3, center=true, \$fn=6);}}rotate([50,222,9.4]){translate([12,0,0])rotate([90,90,90]){cylinder(r=0.9, h=3.3, center=true, \$fn=6);}}}}*/    //difference(){//#left();//rotate([1,234,18.4])//translate([10.5,-0.6,0])//}module in_1(){scale([0.3,1.2,1]){difference(){ sphere(r=2, \$fn=200);translate([-2,-2,0])  cube([4.1,4.1,4.1]);  }}}module out_1(){scale([1.2,2.2,2]){difference(){ sphere(r=0.8, \$fn=200);translate([-1,-1,0])  cube([2,2,1.7]);  }}}module left(){rotate([-84,-173,86]){difference(){in_1();out_1();}}}rotate([-45,-145,10])translate([11.8,0,0])left();module right(){rotate([95,185,90]){difference(){in_1();out_1();}}}rotate([-45,-135,10])translate([-11.8,0,0])right();*i hope you can find an other way to make the code simple and did the holes without interferes, and thank you --Sent from: http://forum.openscad.org/_______________________________________________OpenSCAD mailing list _______________________________________________ OpenSCAD mailing list [hidden email] http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Open this post in threaded view
|