discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

Re: [OpenSCAD] Long rendering time when using difference() with a lot of objects.

S
stonysmith
Fri, Mar 4, 2016 2:12 AM

I know this is off-topic for the "speed" issue, but I wanted to offer a
simpler way to generate the holes.

They're not hex-aligned like the examples above, but it still looks cool.

module PAT(){
outer_D=400.0;
inner_D=6.5;
offset=2.5;// adjust for space between rings
theta=6; // adjust for space between holes around rings
linear_extrude(50.0)
difference() { circle(outer_D,center=true,$fn=512);
union() {
circle(inner_D,center=true);
for (j=[1:floor(outer_D/(inner_Doffset))])
for (i=[1:theta
j]) rotate([0,0,360/(thetaj)i])
translate([inner_D
offset
j,0.0,0.0])
circle(inner_D,center=true);
}}

}
$fa = 12;
$fs = 1;
PAT();

--
View this message in context: http://forum.openscad.org/Long-rendering-time-when-using-difference-with-a-lot-of-objects-tp16268p16287.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

I know this is off-topic for the "speed" issue, but I wanted to offer a simpler way to generate the holes. They're not hex-aligned like the examples above, but it still looks cool. module PAT(){ outer_D=400.0; inner_D=6.5; offset=2.5;// adjust for space between rings theta=6; // adjust for space between holes around rings linear_extrude(50.0) difference() { circle(outer_D,center=true,$fn=512); union() { circle(inner_D,center=true); for (j=[1:floor(outer_D/(inner_D*offset))]) for (i=[1:theta*j]) rotate([0,0,360/(theta*j)*i]) translate([inner_D*offset*j,0.0,0.0]) circle(inner_D,center=true); }} } $fa = 12; $fs = 1; PAT(); -- View this message in context: http://forum.openscad.org/Long-rendering-time-when-using-difference-with-a-lot-of-objects-tp16268p16287.html Sent from the OpenSCAD mailing list archive at Nabble.com.
N
Neon22
Fri, Mar 4, 2016 3:18 AM

or go for honeycombs:

module PAT()  {
outer_D = 400.0;
inner_D = 6.5;
height  = 50;
offset = 2;    // adjust for space between rings
theta = 6;      // adjust for space between holes around rings
linear_extrude(h=height)
// make it all in 2D and extrude the result
difference() {
// disk
circle(outer_D,center=true,$fn=512);
// holes
union() {
circle(inner_D, center=true);
circle_count = floor(outer_D / (inner_Doffset));
for (j = [1:circle_count])
for (i = [1:theta
j])
rotate([0,0,360/(thetaj)i])
translate([inner_D
offset
j,0,0])
circle(inner_D, center=true);
}
}
}

// $fa = 12;
// $fs = 1;
$fn=6;
PAT();

--
View this message in context: http://forum.openscad.org/Long-rendering-time-when-using-difference-with-a-lot-of-objects-tp16268p16288.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

or go for honeycombs: module PAT() { outer_D = 400.0; inner_D = 6.5; height = 50; offset = 2; // adjust for space between rings theta = 6; // adjust for space between holes around rings linear_extrude(h=height) // make it all in 2D and extrude the result difference() { // disk circle(outer_D,center=true,$fn=512); // holes union() { circle(inner_D, center=true); circle_count = floor(outer_D / (inner_D*offset)); for (j = [1:circle_count]) for (i = [1:theta*j]) rotate([0,0,360/(theta*j)*i]) translate([inner_D*offset*j,0,0]) circle(inner_D, center=true); } } } // $fa = 12; // $fs = 1; $fn=6; PAT(); -- View this message in context: http://forum.openscad.org/Long-rendering-time-when-using-difference-with-a-lot-of-objects-tp16268p16288.html Sent from the OpenSCAD mailing list archive at Nabble.com.