simple model doesn't render

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

simple model doesn't render

BuddyCasino
Hi!

I'm a beginner, trying to render my first object. However, apparently I did something stupid, openSCAD 2015.03 on macOS makes no progress when trying to render the following code:




height = 235;
radius = 83.5;
thick = 2;

rod_length = 100;
rod_diameter = 3;
tilt_angle = 3;
row_dist = 3;
upper_grid_offset = 205;
upper_grid_length = 5;

lower_grid_offset = 10;
lower_grid_length = 50;

difference()
{
    // make hollow cylinder
    cylinder(h = height, r = radius);
    translate([0, 0, thick]) {
        cylinder(h = height - thick, r = radius - (thick/2));
    }
   
    // add upper microphone grid
    for(horizontal = [upper_grid_offset : row_dist : upper_grid_offset + upper_grid_length])
    {
        shift = (horizontal %2 == 0) ? 0 : tilt_angle/2;
       
        for (heading = [ 0 : tilt_angle : 360 ])
        {
            translate([0, 0, horizontal])
            {
                rotate([heading + shift, 90, 0])
                {
                    cylinder(h = rod_length, d = rod_diameter);
                }
            }
        }
    }
   
    // add lower sound grid
    for(horizontal = [lower_grid_offset : row_dist : lower_grid_offset + lower_grid_length])
    {
        shift = (horizontal %2 == 0) ? 0 : tilt_angle/2;
       
        for (heading = [ 0 : tilt_angle : 360 ])
        {
            translate([0, 0, horizontal])
            {
                rotate([heading + shift, 90, 0])
                {
                    cylinder(h = rod_length, d = rod_diameter);
                }
            }
        }
    }
   
    // add power cable hole
    translate([0, 0, 5])
    {
        rotate([0, 90, 0])
        {
            cylinder(h = rod_length, d = rod_diameter * 2);
        }
    }

}


Anyone has an idea whats going on?

Best regards,
Michael

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: simple model doesn't render

nophead
It will simply take a very long time to make all those holes with CGAL.

On 8 September 2017 at 11:50, Michael Böckling <[hidden email]> wrote:
Hi!

I'm a beginner, trying to render my first object. However, apparently I did something stupid, openSCAD 2015.03 on macOS makes no progress when trying to render the following code:




height = 235;
radius = 83.5;
thick = 2;

rod_length = 100;
rod_diameter = 3;
tilt_angle = 3;
row_dist = 3;
upper_grid_offset = 205;
upper_grid_length = 5;

lower_grid_offset = 10;
lower_grid_length = 50;

difference()
{
    // make hollow cylinder
    cylinder(h = height, r = radius);
    translate([0, 0, thick]) {
        cylinder(h = height - thick, r = radius - (thick/2));
    }
   
    // add upper microphone grid
    for(horizontal = [upper_grid_offset : row_dist : upper_grid_offset + upper_grid_length])
    {
        shift = (horizontal %2 == 0) ? 0 : tilt_angle/2;
       
        for (heading = [ 0 : tilt_angle : 360 ])
        {
            translate([0, 0, horizontal])
            {
                rotate([heading + shift, 90, 0])
                {
                    cylinder(h = rod_length, d = rod_diameter);
                }
            }
        }
    }
   
    // add lower sound grid
    for(horizontal = [lower_grid_offset : row_dist : lower_grid_offset + lower_grid_length])
    {
        shift = (horizontal %2 == 0) ? 0 : tilt_angle/2;
       
        for (heading = [ 0 : tilt_angle : 360 ])
        {
            translate([0, 0, horizontal])
            {
                rotate([heading + shift, 90, 0])
                {
                    cylinder(h = rod_length, d = rod_diameter);
                }
            }
        }
    }
   
    // add power cable hole
    translate([0, 0, 5])
    {
        rotate([0, 90, 0])
        {
            cylinder(h = rod_length, d = rod_diameter * 2);
        }
    }

}


Anyone has an idea whats going on?

Best regards,
Michael

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org



_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: simple model doesn't render

Ronaldo
Yes, it takes 16 sec to render in my computer with the setting:

tilt_angle = 30;
row_dist = 10;

Besides, you may consider the change

    translate([0, 0, thick]) {
        cylinder(h = height /*- thick*/, r = radius - (thick/2));

to avoid zbuffer fighting at the top.

2017-09-08 12:11 GMT+01:00 nop head <[hidden email]>:
It will simply take a very long time to make all those holes with CGAL.





_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: simple model doesn't render

nophead
The original takes about 14 minutes on my system. The progress bar does not progress smoothly so is no guide to how it is progressing.

Total rendering time: 0 hours, 13 minutes, 53 seconds

Top level object is a 3D object:

Simple: yes

Vertices: 36059

Halfedges: 108222

Edges: 54111

Halffacets: 34906

Facets: 17453

Volumes: 2



On 8 September 2017 at 12:18, Ronaldo Persiano <[hidden email]> wrote:
Yes, it takes 16 sec to render in my computer with the setting:

tilt_angle = 30;
row_dist = 10;

Besides, you may consider the change

    translate([0, 0, thick]) {
        cylinder(h = height /*- thick*/, r = radius - (thick/2));

to avoid zbuffer fighting at the top.

2017-09-08 12:11 GMT+01:00 nop head <[hidden email]>:
It will simply take a very long time to make all those holes with CGAL.





_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org



_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: simple model doesn't render

nophead
It only takes six minutes if you stop the hole cylinders from overlapping each other. I.e. make then short and translate them out to the radius.

On 8 September 2017 at 12:25, nop head <[hidden email]> wrote:
The original takes about 14 minutes on my system. The progress bar does not progress smoothly so is no guide to how it is progressing.

Total rendering time: 0 hours, 13 minutes, 53 seconds

Top level object is a 3D object:

Simple: yes

Vertices: 36059

Halfedges: 108222

Edges: 54111

Halffacets: 34906

Facets: 17453

Volumes: 2



On 8 September 2017 at 12:18, Ronaldo Persiano <[hidden email]> wrote:
Yes, it takes 16 sec to render in my computer with the setting:

tilt_angle = 30;
row_dist = 10;

Besides, you may consider the change

    translate([0, 0, thick]) {
        cylinder(h = height /*- thick*/, r = radius - (thick/2));

to avoid zbuffer fighting at the top.

2017-09-08 12:11 GMT+01:00 nop head <[hidden email]>:
It will simply take a very long time to make all those holes with CGAL.





_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org




_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: simple model doesn't render

BuddyCasino
Thanks everyone for the useful advise in such a short time - very impressive!

2017-09-08 14:03 GMT+02:00 nop head <[hidden email]>:
It only takes six minutes if you stop the hole cylinders from overlapping each other. I.e. make then short and translate them out to the radius.

On 8 September 2017 at 12:25, nop head <[hidden email]> wrote:
The original takes about 14 minutes on my system. The progress bar does not progress smoothly so is no guide to how it is progressing.

Total rendering time: 0 hours, 13 minutes, 53 seconds

Top level object is a 3D object:

Simple: yes

Vertices: 36059

Halfedges: 108222

Edges: <a href="tel:54111" value="+4954111" target="_blank">54111

Halffacets: 34906

Facets: 17453

Volumes: 2



On 8 September 2017 at 12:18, Ronaldo Persiano <[hidden email]> wrote:
Yes, it takes 16 sec to render in my computer with the setting:

tilt_angle = 30;
row_dist = 10;

Besides, you may consider the change

    translate([0, 0, thick]) {
        cylinder(h = height /*- thick*/, r = radius - (thick/2));

to avoid zbuffer fighting at the top.

2017-09-08 12:11 GMT+01:00 nop head <[hidden email]>:
It will simply take a very long time to make all those holes with CGAL.





_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org




_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org



_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org