Newbie rendering problem

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Newbie rendering problem

Michael Petroni
hi all,

my first post and already a question, apologies for that:

i'm using openscad 2011.12 for mac on 10.6.8 macbookpro late 2008 2.4ghz dualcore and try to render the model below. i've already experienced long cgal-rendering times in openscad for other models, but this model gets stuck in the rendering at approx. 25% of the progress bar. i've cancelled the rendering on different tries after 24 to 26hours rendering time each without getting further than the 25% (which has been reached after a few minutes already) progress.

am i simply not patient enough, is it something with my model or is there a openscad/cgal-problem?

thx for your advice,

best,
michael

-----


$fn = 50;
module wheel() {
        union() {
                difference() {
                        cylinder(h = 25, r1 = 75, r2 = 50, $fn = 24);
                        for (i = [15 : 15 : 360]) {
                                rotate([0, 0, i]) translate([0, 80, -5]) rotate([45, 0, 0]) cylinder(h = sqrt(pow(80, 2) * 2), r1 = 7.5, r2 = 0, $fn = 6);
                        }
            difference() {
                                translate([0, 0, -5]) cylinder(h = 35, r = 80, $fn = 24);
                                translate([0, 0, -10]) cylinder(h = 45, r = 71, $fn = 24);
                        }
            difference() {
                                translate([0, 0, -5]) cylinder(h = 7, r = 80);
                                translate([0, 0, -10]) cylinder(h = 15, r = 65);
                        }
                        translate([0, 0, -1]) cylinder(h = 2, r = 80);
                        translate([0, 0, -7]) cylinder(h = 25, r1 = 70, r2 = 45, $fn = 24);
                }
                cylinder(h = 26, r = 10);
                translate([0, 0, -35]) cylinder(h = 60, r = 5);
                translate([0, 0, -17]) cylinder(h = 5, r = 10);
        }
}
module half() {
        wheel();
        translate([0, 72.5, 72.5]) rotate([0, 7.5, 0]) rotate([90, 0, 0]) wheel();
}
module boxpart() {
        difference() {
                translate([0, -78.5, 0]) cube([60, 10, 167], center = true);
                translate([0, -78.5, 0]) rotate([90, 0, 0]) cylinder(h = 20, r = 5.3, center = true);
        }
}
translate([0, 0, -72.5]) half();
translate([0, 0, 72.5]) rotate([0, 180, 180]) half();
union() {
        boxpart();
        rotate([90, 0, 0]) boxpart();
        rotate([180, 0, 0]) boxpart();
        rotate([270, 0, 0]) boxpart();
}



Reply | Threaded
Open this post in threaded view
|

Re: Newbie rendering problem

Whosawhatsis
I found the problem. Your loop to create the cog teeth creates a series of cones with their points in the same place. All these overlapping points trigger an issue in CGAL that causes the complexity of processing to increase exponentially with each additional instance of the cone. If you modify the model to remove the overlap, it dramatically reduces the rendering time.

On Sunday, March 18, 2012 at 3:30 AM, Michael Petroni wrote:

hi all,

my first post and already a question, apologies for that:

i'm using openscad 2011.12 for mac on 10.6.8 macbookpro late 2008 2.4ghz dualcore and try to render the model below. i've already experienced long cgal-rendering times in openscad for other models, but this model gets stuck in the rendering at approx. 25% of the progress bar. i've cancelled the rendering on different tries after 24 to 26hours rendering time each without getting further than the 25% (which has been reached after a few minutes already) progress.

am i simply not patient enough, is it something with my model or is there a openscad/cgal-problem?

thx for your advice,

best,
michael

-----


$fn = 50;
module wheel() {
union() {
difference() {
cylinder(h = 25, r1 = 75, r2 = 50, $fn = 24);
for (i = [15 : 15 : 360]) {
rotate([0, 0, i]) translate([0, 80, -5]) rotate([45, 0, 0]) cylinder(h = sqrt(pow(80, 2) * 2), r1 = 7.5, r2 = 0, $fn = 6);
}
difference() {
translate([0, 0, -5]) cylinder(h = 35, r = 80, $fn = 24);
translate([0, 0, -10]) cylinder(h = 45, r = 71, $fn = 24);
}
difference() {
translate([0, 0, -5]) cylinder(h = 7, r = 80);
translate([0, 0, -10]) cylinder(h = 15, r = 65);
}
translate([0, 0, -1]) cylinder(h = 2, r = 80);
translate([0, 0, -7]) cylinder(h = 25, r1 = 70, r2 = 45, $fn = 24);
}
cylinder(h = 26, r = 10);
translate([0, 0, -35]) cylinder(h = 60, r = 5);
translate([0, 0, -17]) cylinder(h = 5, r = 10);
}
}
module half() {
wheel();
translate([0, 72.5, 72.5]) rotate([0, 7.5, 0]) rotate([90, 0, 0]) wheel();
}
module boxpart() {
difference() {
translate([0, -78.5, 0]) cube([60, 10, 167], center = true);
translate([0, -78.5, 0]) rotate([90, 0, 0]) cylinder(h = 20, r = 5.3, center = true);
}
}
translate([0, 0, -72.5]) half();
translate([0, 0, 72.5]) rotate([0, 180, 180]) half();
union() {
boxpart();
rotate([90, 0, 0]) boxpart();
rotate([180, 0, 0]) boxpart();
rotate([270, 0, 0]) boxpart();
}


_______________________________________________
OpenSCAD mailing list

Reply | Threaded
Open this post in threaded view
|

Re: Newbie rendering problem

Michael Petroni
thank you very much. this was most helpful. i changed only one line and rendering time is down to 2 minutes.

best,
michael

changed code (body line of for loop):

---

$fn = 50;
module wheel() {
        union() {
                difference() {
                        cylinder(h = 25, r1 = 75, r2 = 50, $fn = 24);
                        for (i = [15 : 15 : 360]) {
                                rotate([0, 0, i]) translate([0, 80, -5]) rotate([45, 0, 0]) cylinder(h = sqrt(pow(80, 2) * 2) / 2, r1 = 7.5, r2 = 3.75, $fn = 6);
                        }
            difference() {
                                translate([0, 0, -5]) cylinder(h = 35, r = 80, $fn = 24);
                                translate([0, 0, -10]) cylinder(h = 45, r = 71, $fn = 24);
                        }
            difference() {
                                translate([0, 0, -5]) cylinder(h = 7, r = 80);
                                translate([0, 0, -10]) cylinder(h = 15, r = 65);
                        }
                        translate([0, 0, -1]) cylinder(h = 2, r = 80);
                        translate([0, 0, -7]) cylinder(h = 25, r1 = 70, r2 = 45, $fn = 24);
                }
                cylinder(h = 26, r = 10);
                translate([0, 0, -35]) cylinder(h = 60, r = 5);
                translate([0, 0, -17]) cylinder(h = 5, r = 10);
        }
}
module half() {
        wheel();
        translate([0, 72.5, 72.5]) rotate([0, 7.5, 0]) rotate([90, 0, 0]) wheel();
}
module boxpart() {
        difference() {
                translate([0, -78.5, 0]) cube([60, 10, 167], center = true);
                translate([0, -78.5, 0]) rotate([90, 0, 0]) cylinder(h = 20, r = 5.3, center = true);
        }
}
translate([0, 0, -72.5]) half();
translate([0, 0, 72.5]) rotate([0, 180, 180]) half();
union() {
        boxpart();
        rotate([90, 0, 0]) boxpart();
        rotate([180, 0, 0]) boxpart();
        rotate([270, 0, 0]) boxpart();
}


Am 18.03.2012 um 17:45 schrieb Whosawhatsis:

> I found the problem. Your loop to create the cog teeth creates a series of cones with their points in the same place. All these overlapping points trigger an issue in CGAL that causes the complexity of processing to increase exponentially with each additional instance of the cone. If you modify the model to remove the overlap, it dramatically reduces the rendering time.
> On Sunday, March 18, 2012 at 3:30 AM, Michael Petroni wrote:
>
>> hi all,
>>
>> my first post and already a question, apologies for that:
>>
>> i'm using openscad 2011.12 for mac on 10.6.8 macbookpro late 2008 2.4ghz dualcore and try to render the model below. i've already experienced long cgal-rendering times in openscad for other models, but this model gets stuck in the rendering at approx. 25% of the progress bar. i've cancelled the rendering on different tries after 24 to 26hours rendering time each without getting further than the 25% (which has been reached after a few minutes already) progress.
>>
>> am i simply not patient enough, is it something with my model or is there a openscad/cgal-problem?
>>
>> thx for your advice,
>>
>> best,
>> michael
>>
>> -----
>>
>>
>> $fn = 50;
>> module wheel() {
>> union() {
>> difference() {
>> cylinder(h = 25, r1 = 75, r2 = 50, $fn = 24);
>> for (i = [15 : 15 : 360]) {
>> rotate([0, 0, i]) translate([0, 80, -5]) rotate([45, 0, 0]) cylinder(h = sqrt(pow(80, 2) * 2), r1 = 7.5, r2 = 0, $fn = 6);
>> }
>> difference() {
>> translate([0, 0, -5]) cylinder(h = 35, r = 80, $fn = 24);
>> translate([0, 0, -10]) cylinder(h = 45, r = 71, $fn = 24);
>> }
>> difference() {
>> translate([0, 0, -5]) cylinder(h = 7, r = 80);
>> translate([0, 0, -10]) cylinder(h = 15, r = 65);
>> }
>> translate([0, 0, -1]) cylinder(h = 2, r = 80);
>> translate([0, 0, -7]) cylinder(h = 25, r1 = 70, r2 = 45, $fn = 24);
>> }
>> cylinder(h = 26, r = 10);
>> translate([0, 0, -35]) cylinder(h = 60, r = 5);
>> translate([0, 0, -17]) cylinder(h = 5, r = 10);
>> }
>> }
>> module half() {
>> wheel();
>> translate([0, 72.5, 72.5]) rotate([0, 7.5, 0]) rotate([90, 0, 0]) wheel();
>> }
>> module boxpart() {
>> difference() {
>> translate([0, -78.5, 0]) cube([60, 10, 167], center = true);
>> translate([0, -78.5, 0]) rotate([90, 0, 0]) cylinder(h = 20, r = 5.3, center = true);
>> }
>> }
>> translate([0, 0, -72.5]) half();
>> translate([0, 0, 72.5]) rotate([0, 180, 180]) half();
>> union() {
>> boxpart();
>> rotate([90, 0, 0]) boxpart();
>> rotate([180, 0, 0]) boxpart();
>> rotate([270, 0, 0]) boxpart();
>> }
>>
>>
>> _______________________________________________
>> OpenSCAD mailing list
>> [hidden email]
>> http://rocklinux.net/mailman/listinfo/openscad
>
> _______________________________________________
> OpenSCAD mailing list
> [hidden email]
> http://rocklinux.net/mailman/listinfo/openscad


--

Petroni Consulting & Creations KG
Lughofgasse 269
3034 Maria Anzbach - Austria

Michael Petroni
T +43 2772 20270 . F +43 2772 20271
E [hidden email]