slow render, need help

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

slow render, need help

Michael Brown
I am trying out openscad to make a few things, and I've run up against a brick wall in that my designs are previewing, but wont render or stl export in a 'reasonable' time. I'm using latest openscad git updated yesterday on a Fedora 15 Linux system running quad-core AMD Phenom @3.2Ghz.

I thought I'd make a mashup of MakeALot's Spiro Coaster and Bracelet V, (http://www.thingiverse.com/thing:7361 and http://www.thingiverse.com/thing:8928). I'm trying to make a container using the bracelet design as the sides and spiro coaster design for the lid. I merged the scad programs, and basically rewrote a lot of it, so it's more 'inspired' by at this point, but it all previews nicely and looks good. My problem at this point is that it is taking *forever* to compile, and using almost 2GB of ram. I'm trying to figure out why it is taking so long.

 I've uploaded my code to github (https://github.com/superchalupa/container-round-decorative). Attached is the main module I've developed.

For comparison, I've re-compiled MakeALot's bracelet and it compiles in about 41 minutes for me. When I redid the same basic bracelet design with my code, it literally took 23 hours. The object is fairly simple, so I am at a loss as to why it takes so long. It is a torus with about 100 oval holes. At first I was specifying $fn variables, but under the assumption that I was over-specifying things, I've removed almost all of those. The second thing I did was that I was using unit circles and scaling, which ends up using only 5 fragments, so I started using larger circles and different scaling factors to let openscad choose a more appropriate number of fragments. This has not seemed to help.

Calling my main module with this:

// for my 3 year old (small)
radius=23;
bracelet_width=35;
wall_thick=3;
hole_len=8;
distance_between_holes=1;
hole_rotation_angle = 80;
num_divisions_around = 16;
edge_buffer=2;

holy_squished_hollow_torus(bracelet_width,
                           radius,
                           wall_thick,
                           edge_buffer,
                           hole_len,
                           distance_between_holes,
                           hole_rotation_angle,
                           num_divisions_around);


Results in this:

time make bracelet.stl
openscad -o bracelet.stl bracelet.scad -Dlayout=\"$(basename bracelet.stl .stl)\"
Compiling library `/home/michael_e_brown/thingomatic/things/my-designs/box/container_module.scad'.
Compiling library `/home/michael_e_brown/thingomatic/things/my-designs/box/pins.scad'.
ECHO: "y_step: ", 8.863269777109872
ECHO: "num big ovals: ", 3
ECHO: "degrees_per_y", 0.4392519091611444
ECHO: "leftover", 11
CGAL Cache insert: group(); (0 verts)
Number of polygons before reduction: 1
    ... cut ...

CGAL Cache insert: group(){group(){multmatrix([[1,0,0,0],[0 (3340 verts)
CGAL Cache insert: difference(){group(){difference(){group( (26991 verts)
CGAL Cache insert: group(){group();group();group();group(); (26991 verts)
CGAL Cache insert: group(){group(){group();group();group(); (26991 verts)

real 1415m34.047s
user 1404m59.223s
sys 0m10.050s

--
Michael



container_module.scad (11K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: slow render, need help

donbright
Sorry, I can't find pins.scad


On Mon, Oct 24, 2011 at 12:36 AM, Michael Brown
<[hidden email]> wrote:

> I am trying out openscad to make a few things, and I've run up against a
> brick wall in that my designs are previewing, but wont render or stl export
> in a 'reasonable' time. I'm using latest openscad git updated yesterday on a
> Fedora 15 Linux system running quad-core AMD Phenom @3.2Ghz.
> I thought I'd make a mashup of MakeALot's Spiro Coaster and Bracelet V,
> (http://www.thingiverse.com/thing:7361
> and http://www.thingiverse.com/thing:8928). I'm trying to make a container
> using the bracelet design as the sides and spiro coaster design for the
> lid. I merged the scad programs, and basically rewrote a lot of it, so it's
> more 'inspired' by at this point, but it all previews nicely and looks good.
> My problem at this point is that it is taking *forever* to compile, and
> using almost 2GB of ram. I'm trying to figure out why it is taking so long.
>  I've uploaded my code to github
> (https://github.com/superchalupa/container-round-decorative). Attached is
> the main module I've developed.
> For comparison, I've re-compiled MakeALot's bracelet and it compiles in
> about 41 minutes for me. When I redid the same basic bracelet design with my
> code, it literally took 23 hours. The object is fairly simple, so I am at a
> loss as to why it takes so long. It is a torus with about 100 oval holes. At
> first I was specifying $fn variables, but under the assumption that I was
> over-specifying things, I've removed almost all of those. The second thing I
> did was that I was using unit circles and scaling, which ends up using only
> 5 fragments, so I started using larger circles and different scaling factors
> to let openscad choose a more appropriate number of fragments. This has not
> seemed to help.
> Calling my main module with this:
>
> // for my 3 year old (small)
> radius=23;
> bracelet_width=35;
> wall_thick=3;
> hole_len=8;
> distance_between_holes=1;
> hole_rotation_angle = 80;
> num_divisions_around = 16;
> edge_buffer=2;
> holy_squished_hollow_torus(bracelet_width,
>                            radius,
>                            wall_thick,
>                            edge_buffer,
>                            hole_len,
>                            distance_between_holes,
>                            hole_rotation_angle,
>                            num_divisions_around);
>
> Results in this:
> time make bracelet.stl
> openscad -o bracelet.stl bracelet.scad -Dlayout=\"$(basename bracelet.stl
> .stl)\"
> Compiling library
> `/home/michael_e_brown/thingomatic/things/my-designs/box/container_module.scad'.
> Compiling library
> `/home/michael_e_brown/thingomatic/things/my-designs/box/pins.scad'.
> ECHO: "y_step: ", 8.863269777109872
> ECHO: "num big ovals: ", 3
> ECHO: "degrees_per_y", 0.4392519091611444
> ECHO: "leftover", 11
> CGAL Cache insert: group(); (0 verts)
> Number of polygons before reduction: 1
>     ... cut ...
> CGAL Cache insert: group(){group(){multmatrix([[1,0,0,0],[0 (3340 verts)
> CGAL Cache insert: difference(){group(){difference(){group( (26991 verts)
> CGAL Cache insert: group(){group();group();group();group(); (26991 verts)
> CGAL Cache insert: group(){group(){group();group();group(); (26991 verts)
> real 1415m34.047s
> user 1404m59.223s
> sys 0m10.050s
> --
> Michael
>
>
> _______________________________________________
> OpenSCAD mailing list
> [hidden email]
> http://rocklinux.net/mailman/listinfo/openscad
>
>

Reply | Threaded
Open this post in threaded view
|

Re: slow render, need help

donbright
nevermind. i see it requires a script.
however the script doesn't work under mingw nor does it work under cygwin


On Mon, Oct 24, 2011 at 5:00 PM, Don Bright <[hidden email]> wrote:

> Sorry, I can't find pins.scad
>
>
> On Mon, Oct 24, 2011 at 12:36 AM, Michael Brown
> <[hidden email]> wrote:
>> I am trying out openscad to make a few things, and I've run up against a
>> brick wall in that my designs are previewing, but wont render or stl export
>> in a 'reasonable' time. I'm using latest openscad git updated yesterday on a
>> Fedora 15 Linux system running quad-core AMD Phenom @3.2Ghz.
>> I thought I'd make a mashup of MakeALot's Spiro Coaster and Bracelet V,
>> (http://www.thingiverse.com/thing:7361
>> and http://www.thingiverse.com/thing:8928). I'm trying to make a container
>> using the bracelet design as the sides and spiro coaster design for the
>> lid. I merged the scad programs, and basically rewrote a lot of it, so it's
>> more 'inspired' by at this point, but it all previews nicely and looks good.
>> My problem at this point is that it is taking *forever* to compile, and
>> using almost 2GB of ram. I'm trying to figure out why it is taking so long.
>>  I've uploaded my code to github
>> (https://github.com/superchalupa/container-round-decorative). Attached is
>> the main module I've developed.
>> For comparison, I've re-compiled MakeALot's bracelet and it compiles in
>> about 41 minutes for me. When I redid the same basic bracelet design with my
>> code, it literally took 23 hours. The object is fairly simple, so I am at a
>> loss as to why it takes so long. It is a torus with about 100 oval holes. At
>> first I was specifying $fn variables, but under the assumption that I was
>> over-specifying things, I've removed almost all of those. The second thing I
>> did was that I was using unit circles and scaling, which ends up using only
>> 5 fragments, so I started using larger circles and different scaling factors
>> to let openscad choose a more appropriate number of fragments. This has not
>> seemed to help.
>> Calling my main module with this:
>>
>> // for my 3 year old (small)
>> radius=23;
>> bracelet_width=35;
>> wall_thick=3;
>> hole_len=8;
>> distance_between_holes=1;
>> hole_rotation_angle = 80;
>> num_divisions_around = 16;
>> edge_buffer=2;
>> holy_squished_hollow_torus(bracelet_width,
>>                            radius,
>>                            wall_thick,
>>                            edge_buffer,
>>                            hole_len,
>>                            distance_between_holes,
>>                            hole_rotation_angle,
>>                            num_divisions_around);
>>
>> Results in this:
>> time make bracelet.stl
>> openscad -o bracelet.stl bracelet.scad -Dlayout=\"$(basename bracelet.stl
>> .stl)\"
>> Compiling library
>> `/home/michael_e_brown/thingomatic/things/my-designs/box/container_module.scad'.
>> Compiling library
>> `/home/michael_e_brown/thingomatic/things/my-designs/box/pins.scad'.
>> ECHO: "y_step: ", 8.863269777109872
>> ECHO: "num big ovals: ", 3
>> ECHO: "degrees_per_y", 0.4392519091611444
>> ECHO: "leftover", 11
>> CGAL Cache insert: group(); (0 verts)
>> Number of polygons before reduction: 1
>>     ... cut ...
>> CGAL Cache insert: group(){group(){multmatrix([[1,0,0,0],[0 (3340 verts)
>> CGAL Cache insert: difference(){group(){difference(){group( (26991 verts)
>> CGAL Cache insert: group(){group();group();group();group(); (26991 verts)
>> CGAL Cache insert: group(){group(){group();group();group(); (26991 verts)
>> real 1415m34.047s
>> user 1404m59.223s
>> sys 0m10.050s
>> --
>> Michael
>>
>>
>> _______________________________________________
>> OpenSCAD mailing list
>> [hidden email]
>> http://rocklinux.net/mailman/listinfo/openscad
>>
>>
>

Reply | Threaded
Open this post in threaded view
|

Re: slow render, need help

Michael Brown
You can easily download pins.scad from thingiverse, which is where I got it. Its at http://www.thingiverse.com/thing:10541
--
Michael

On Mon, Oct 24, 2011 at 5:05 PM, Don Bright <[hidden email]> wrote:
nevermind. i see it requires a script.
however the script doesn't work under mingw nor does it work under cygwin


On Mon, Oct 24, 2011 at 5:00 PM, Don Bright <[hidden email]> wrote:
> Sorry, I can't find pins.scad
>
>
> On Mon, Oct 24, 2011 at 12:36 AM, Michael Brown
> <[hidden email]> wrote:
>> I am trying out openscad to make a few things, and I've run up against a
>> brick wall in that my designs are previewing, but wont render or stl export
>> in a 'reasonable' time. I'm using latest openscad git updated yesterday on a
>> Fedora 15 Linux system running quad-core AMD Phenom @3.2Ghz.
>> I thought I'd make a mashup of MakeALot's Spiro Coaster and Bracelet V,
>> (http://www.thingiverse.com/thing:7361
>> and http://www.thingiverse.com/thing:8928). I'm trying to make a container
>> using the bracelet design as the sides and spiro coaster design for the
>> lid. I merged the scad programs, and basically rewrote a lot of it, so it's
>> more 'inspired' by at this point, but it all previews nicely and looks good.
>> My problem at this point is that it is taking *forever* to compile, and
>> using almost 2GB of ram. I'm trying to figure out why it is taking so long.
>>  I've uploaded my code to github
>> (https://github.com/superchalupa/container-round-decorative). Attached is
>> the main module I've developed.
>> For comparison, I've re-compiled MakeALot's bracelet and it compiles in
>> about 41 minutes for me. When I redid the same basic bracelet design with my
>> code, it literally took 23 hours. The object is fairly simple, so I am at a
>> loss as to why it takes so long. It is a torus with about 100 oval holes. At
>> first I was specifying $fn variables, but under the assumption that I was
>> over-specifying things, I've removed almost all of those. The second thing I
>> did was that I was using unit circles and scaling, which ends up using only
>> 5 fragments, so I started using larger circles and different scaling factors
>> to let openscad choose a more appropriate number of fragments. This has not
>> seemed to help.
>> Calling my main module with this:
>>
>> // for my 3 year old (small)
>> radius=23;
>> bracelet_width=35;
>> wall_thick=3;
>> hole_len=8;
>> distance_between_holes=1;
>> hole_rotation_angle = 80;
>> num_divisions_around = 16;
>> edge_buffer=2;
>> holy_squished_hollow_torus(bracelet_width,
>>                            radius,
>>                            wall_thick,
>>                            edge_buffer,
>>                            hole_len,
>>                            distance_between_holes,
>>                            hole_rotation_angle,
>>                            num_divisions_around);
>>
>> Results in this:
>> time make bracelet.stl
>> openscad -o bracelet.stl bracelet.scad -Dlayout=\"$(basename bracelet.stl
>> .stl)\"
>> Compiling library
>> `/home/michael_e_brown/thingomatic/things/my-designs/box/container_module.scad'.
>> Compiling library
>> `/home/michael_e_brown/thingomatic/things/my-designs/box/pins.scad'.
>> ECHO: "y_step: ", 8.863269777109872
>> ECHO: "num big ovals: ", 3
>> ECHO: "degrees_per_y", 0.4392519091611444
>> ECHO: "leftover", 11
>> CGAL Cache insert: group(); (0 verts)
>> Number of polygons before reduction: 1
>>     ... cut ...
>> CGAL Cache insert: group(){group(){multmatrix([[1,0,0,0],[0 (3340 verts)
>> CGAL Cache insert: difference(){group(){difference(){group( (26991 verts)
>> CGAL Cache insert: group(){group();group();group();group(); (26991 verts)
>> CGAL Cache insert: group(){group(){group();group();group(); (26991 verts)
>> real 1415m34.047s
>> user 1404m59.223s
>> sys 0m10.050s
>> --
>> Michael
>>
>>
>> _______________________________________________
>> OpenSCAD mailing list
>> [hidden email]
>> http://rocklinux.net/mailman/listinfo/openscad
>>
>>
>
_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad

Reply | Threaded
Open this post in threaded view
|

Re: slow render, need help

donbright
In reply to this post by Michael Brown
sorry man i dont know if my last message yesterday got through, i got
some error about my image was too big for the email list.

my basic theory (after viewing in 'throwntogether' rendering mode) is
that CGAL was getting gummed up when all those negative cylinders met
at the center. they all touched each other and CGAL was having to slug
through that.


i redid your code, so that instead of being spikes that meet in the
center, they are little stubbies that sit on your ring.

i also used $fn=10

it took 20 minutes to CGAL render on my 2.7ghz pentium 4 with 1GIG of
RAM. I ran 'top' and openscad sat steady at 100-200m of memory, while
maxing out CPU.

hope this helps. ps, i love that shape, its really cool looking.

-DB

   difference() {
        squished_hollow_torus(radius, minor_radius, box_height, wall_thick);

        // Ok, this was a pain to come up with, but basically here we
chop holes in the sides
        // outer loop copies each individual vertical 'line' around
the circumference
        // inner loop does one individual 'line' of holes going up
        for (i=[0:num_divisions_around-1]) {
            // first row

            for (j=[0:num_big_ovals-1]) {

rotate([0,0,i*(360/num_divisions_around)+j*(degrees_per_y*y_step)])
                    translate([radius*0.7,0,leftover/2 + y_step/2 + j*y_step])
                        rotate([hole_rotation_angle,0,0])
                        rotate([0,90,0])
                            scale([1.5/oval_maj_rad,1,1])

cylinder(h=wall_thick*4+smidgen,r1=oval_maj_rad, r2=oval_maj_rad);
            }

            // The 'odd' row (starts with half oval, but we skip that
in this loop)

            for (j=[0:num_big_ovals-2]) {

rotate([0,0,(i+0.5)*(360/num_divisions_around)+j*(degrees_per_y*y_step)+degrees_per_y*y_step/2])
                    translate([radius*0.7,0,leftover/2 + y_step + j*y_step])
                        rotate([hole_rotation_angle,0,0])
                        rotate([0,90,0])
                            scale([1.5/oval_maj_rad,1,1])

cylinder(h=wall_thick*4+smidgen,r1=oval_maj_rad, r2=oval_maj_rad);
            }

            // here we get the odd half-sized ones on the bottom
            // uses same formula as above, but I simplified couple
terms manually
            rotate([0,0,(i+0.5)*(360/num_divisions_around)-degrees_per_y*y_step/4])
                translate([radius*0.7,0,leftover/2 + y_step/4])
                rotate([hole_rotation_angle,0,0])
                rotate([0,90,0])
                scale([1.5/oval_maj_rad,1/2,1])
                cylinder(h=wall_thick*4+smidgen,r1=oval_maj_rad,
r2=oval_maj_rad);

            // here we get the odd half-sized ones on the top
            // uses same formula as above, but I simplified couple
terms manually

            rotate([0,0,(i+0.5)*(360/num_divisions_around)+(num_big_ovals-1)*(degrees_per_y*y_step)+degrees_per_y*y_step/4])
                translate([radius*0.7,0,leftover/2 + y_step +
(num_big_ovals-1)*y_step - y_step/4])
                rotate([hole_rotation_angle,0,0])
                rotate([0,90,0])
                scale([1.5/oval_maj_rad,1/2,1])
                cylinder(h=wall_thick*4+smidgen,r1=oval_maj_rad,
r2=oval_maj_rad);

        }


On Mon, Oct 24, 2011 at 12:36 AM, Michael Brown
<[hidden email]> wrote:

> I am trying out openscad to make a few things, and I've run up against a
> brick wall in that my designs are previewing, but wont render or stl export
> in a 'reasonable' time. I'm using latest openscad git updated yesterday on a
> Fedora 15 Linux system running quad-core AMD Phenom @3.2Ghz.
> I thought I'd make a mashup of MakeALot's Spiro Coaster and Bracelet V,
> (http://www.thingiverse.com/thing:7361
> and http://www.thingiverse.com/thing:8928). I'm trying to make a container
> using the bracelet design as the sides and spiro coaster design for the
> lid. I merged the scad programs, and basically rewrote a lot of it, so it's
> more 'inspired' by at this point, but it all previews nicely and looks good.
> My problem at this point is that it is taking *forever* to compile, and
> using almost 2GB of ram. I'm trying to figure out why it is taking so long.
>  I've uploaded my code to github
> (https://github.com/superchalupa/container-round-decorative). Attached is
> the main module I've developed.
> For comparison, I've re-compiled MakeALot's bracelet and it compiles in
> about 41 minutes for me. When I redid the same basic bracelet design with my
> code, it literally took 23 hours. The object is fairly simple, so I am at a
> loss as to why it takes so long. It is a torus with about 100 oval holes. At
> first I was specifying $fn variables, but under the assumption that I was
> over-specifying things, I've removed almost all of those. The second thing I
> did was that I was using unit circles and scaling, which ends up using only
> 5 fragments, so I started using larger circles and different scaling factors
> to let openscad choose a more appropriate number of fragments. This has not
> seemed to help.
> Calling my main module with this:
>
> // for my 3 year old (small)
> radius=23;
> bracelet_width=35;
> wall_thick=3;
> hole_len=8;
> distance_between_holes=1;
> hole_rotation_angle = 80;
> num_divisions_around = 16;
> edge_buffer=2;
> holy_squished_hollow_torus(bracelet_width,
>                            radius,
>                            wall_thick,
>                            edge_buffer,
>                            hole_len,
>                            distance_between_holes,
>                            hole_rotation_angle,
>                            num_divisions_around);
>
> Results in this:
> time make bracelet.stl
> openscad -o bracelet.stl bracelet.scad -Dlayout=\"$(basename bracelet.stl
> .stl)\"
> Compiling library
> `/home/michael_e_brown/thingomatic/things/my-designs/box/container_module.scad'.
> Compiling library
> `/home/michael_e_brown/thingomatic/things/my-designs/box/pins.scad'.
> ECHO: "y_step: ", 8.863269777109872
> ECHO: "num big ovals: ", 3
> ECHO: "degrees_per_y", 0.4392519091611444
> ECHO: "leftover", 11
> CGAL Cache insert: group(); (0 verts)
> Number of polygons before reduction: 1
>     ... cut ...
> CGAL Cache insert: group(){group(){multmatrix([[1,0,0,0],[0 (3340 verts)
> CGAL Cache insert: difference(){group(){difference(){group( (26991 verts)
> CGAL Cache insert: group(){group();group();group();group(); (26991 verts)
> CGAL Cache insert: group(){group(){group();group();group(); (26991 verts)
> real 1415m34.047s
> user 1404m59.223s
> sys 0m10.050s
> --
> Michael
>
>
> _______________________________________________
> OpenSCAD mailing list
> [hidden email]
> http://rocklinux.net/mailman/listinfo/openscad
>
>

Reply | Threaded
Open this post in threaded view
|

Re: slow render, need help

Michael Brown
Thanks, I will check this out!

And credit for the shape goes to MakeALot, I basically stole the design from him and just made it parametric.
--
Michael

On Tue, Oct 25, 2011 at 6:10 PM, Don Bright <[hidden email]> wrote:
sorry man i dont know if my last message yesterday got through, i got
some error about my image was too big for the email list.

my basic theory (after viewing in 'throwntogether' rendering mode) is
that CGAL was getting gummed up when all those negative cylinders met
at the center. they all touched each other and CGAL was having to slug
through that.


i redid your code, so that instead of being spikes that meet in the
center, they are little stubbies that sit on your ring.

i also used $fn=10

it took 20 minutes to CGAL render on my 2.7ghz pentium 4 with 1GIG of
RAM. I ran 'top' and openscad sat steady at 100-200m of memory, while
maxing out CPU.

hope this helps. ps, i love that shape, its really cool looking.

-DB

  difference() {
       squished_hollow_torus(radius, minor_radius, box_height, wall_thick);

       // Ok, this was a pain to come up with, but basically here we
chop holes in the sides
       // outer loop copies each individual vertical 'line' around
the circumference
       // inner loop does one individual 'line' of holes going up
       for (i=[0:num_divisions_around-1]) {
           // first row

           for (j=[0:num_big_ovals-1]) {

rotate([0,0,i*(360/num_divisions_around)+j*(degrees_per_y*y_step)])
                   translate([radius*0.7,0,leftover/2 + y_step/2 + j*y_step])
                       rotate([hole_rotation_angle,0,0])
                       rotate([0,90,0])
                           scale([1.5/oval_maj_rad,1,1])

cylinder(h=wall_thick*4+smidgen,r1=oval_maj_rad, r2=oval_maj_rad);
           }

           // The 'odd' row (starts with half oval, but we skip that
in this loop)

           for (j=[0:num_big_ovals-2]) {

rotate([0,0,(i+0.5)*(360/num_divisions_around)+j*(degrees_per_y*y_step)+degrees_per_y*y_step/2])
                   translate([radius*0.7,0,leftover/2 + y_step + j*y_step])
                       rotate([hole_rotation_angle,0,0])
                       rotate([0,90,0])
                           scale([1.5/oval_maj_rad,1,1])

cylinder(h=wall_thick*4+smidgen,r1=oval_maj_rad, r2=oval_maj_rad);
           }

           // here we get the odd half-sized ones on the bottom
           // uses same formula as above, but I simplified couple
terms manually
           rotate([0,0,(i+0.5)*(360/num_divisions_around)-degrees_per_y*y_step/4])
               translate([radius*0.7,0,leftover/2 + y_step/4])
               rotate([hole_rotation_angle,0,0])
               rotate([0,90,0])
               scale([1.5/oval_maj_rad,1/2,1])
               cylinder(h=wall_thick*4+smidgen,r1=oval_maj_rad,
r2=oval_maj_rad);

           // here we get the odd half-sized ones on the top
           // uses same formula as above, but I simplified couple
terms manually

           rotate([0,0,(i+0.5)*(360/num_divisions_around)+(num_big_ovals-1)*(degrees_per_y*y_step)+degrees_per_y*y_step/4])
               translate([radius*0.7,0,leftover/2 + y_step +
(num_big_ovals-1)*y_step - y_step/4])
               rotate([hole_rotation_angle,0,0])
               rotate([0,90,0])
               scale([1.5/oval_maj_rad,1/2,1])
               cylinder(h=wall_thick*4+smidgen,r1=oval_maj_rad,
r2=oval_maj_rad);

       }


On Mon, Oct 24, 2011 at 12:36 AM, Michael Brown
<[hidden email]> wrote:
> I am trying out openscad to make a few things, and I've run up against a
> brick wall in that my designs are previewing, but wont render or stl export
> in a 'reasonable' time. I'm using latest openscad git updated yesterday on a
> Fedora 15 Linux system running quad-core AMD Phenom @3.2Ghz.
> I thought I'd make a mashup of MakeALot's Spiro Coaster and Bracelet V,
> (http://www.thingiverse.com/thing:7361
> and http://www.thingiverse.com/thing:8928). I'm trying to make a container
> using the bracelet design as the sides and spiro coaster design for the
> lid. I merged the scad programs, and basically rewrote a lot of it, so it's
> more 'inspired' by at this point, but it all previews nicely and looks good.
> My problem at this point is that it is taking *forever* to compile, and
> using almost 2GB of ram. I'm trying to figure out why it is taking so long.
>  I've uploaded my code to github
> (https://github.com/superchalupa/container-round-decorative). Attached is
> the main module I've developed.
> For comparison, I've re-compiled MakeALot's bracelet and it compiles in
> about 41 minutes for me. When I redid the same basic bracelet design with my
> code, it literally took 23 hours. The object is fairly simple, so I am at a
> loss as to why it takes so long. It is a torus with about 100 oval holes. At
> first I was specifying $fn variables, but under the assumption that I was
> over-specifying things, I've removed almost all of those. The second thing I
> did was that I was using unit circles and scaling, which ends up using only
> 5 fragments, so I started using larger circles and different scaling factors
> to let openscad choose a more appropriate number of fragments. This has not
> seemed to help.
> Calling my main module with this:
>
> // for my 3 year old (small)
> radius=23;
> bracelet_width=35;
> wall_thick=3;
> hole_len=8;
> distance_between_holes=1;
> hole_rotation_angle = 80;
> num_divisions_around = 16;
> edge_buffer=2;
> holy_squished_hollow_torus(bracelet_width,
>                            radius,
>                            wall_thick,
>                            edge_buffer,
>                            hole_len,
>                            distance_between_holes,
>                            hole_rotation_angle,
>                            num_divisions_around);
>
> Results in this:
> time make bracelet.stl
> openscad -o bracelet.stl bracelet.scad -Dlayout=\"$(basename bracelet.stl
> .stl)\"
> Compiling library
> `/home/michael_e_brown/thingomatic/things/my-designs/box/container_module.scad'.
> Compiling library
> `/home/michael_e_brown/thingomatic/things/my-designs/box/pins.scad'.
> ECHO: "y_step: ", 8.863269777109872
> ECHO: "num big ovals: ", 3
> ECHO: "degrees_per_y", 0.4392519091611444
> ECHO: "leftover", 11
> CGAL Cache insert: group(); (0 verts)
> Number of polygons before reduction: 1
>     ... cut ...
> CGAL Cache insert: group(){group(){multmatrix([[1,0,0,0],[0 (3340 verts)
> CGAL Cache insert: difference(){group(){difference(){group( (26991 verts)
> CGAL Cache insert: group(){group();group();group();group(); (26991 verts)
> CGAL Cache insert: group(){group(){group();group();group(); (26991 verts)
> real 1415m34.047s
> user 1404m59.223s
> sys 0m10.050s
> --
> Michael
>
>
> _______________________________________________
> OpenSCAD mailing list
> [hidden email]
> http://rocklinux.net/mailman/listinfo/openscad
>
>
_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad

Reply | Threaded
Open this post in threaded view
|

Re: slow render, need help

Michael Brown
In reply to this post by donbright
Some of the speed issues seem to be resolved with this plus one other small bug I fixed.

Unfortunately, I'm still running into assertion errors and/or crashes. In fact, now I've got a situation where if I even start up the GUI, it quickly takes up literally all my memory, OOMs the machine, and gets killed (or crashes the box).

I've been attempting to comment out one thing at a time in the model to get to a working state
--
Michael

On Tue, Oct 25, 2011 at 6:10 PM, Don Bright <[hidden email]> wrote:
sorry man i dont know if my last message yesterday got through, i got
some error about my image was too big for the email list.

my basic theory (after viewing in 'throwntogether' rendering mode) is
that CGAL was getting gummed up when all those negative cylinders met
at the center. they all touched each other and CGAL was having to slug
through that.


i redid your code, so that instead of being spikes that meet in the
center, they are little stubbies that sit on your ring.

i also used $fn=10

it took 20 minutes to CGAL render on my 2.7ghz pentium 4 with 1GIG of
RAM. I ran 'top' and openscad sat steady at 100-200m of memory, while
maxing out CPU.

hope this helps. ps, i love that shape, its really cool looking.

-DB

  difference() {
       squished_hollow_torus(radius, minor_radius, box_height, wall_thick);

       // Ok, this was a pain to come up with, but basically here we
chop holes in the sides
       // outer loop copies each individual vertical 'line' around
the circumference
       // inner loop does one individual 'line' of holes going up
       for (i=[0:num_divisions_around-1]) {
           // first row

           for (j=[0:num_big_ovals-1]) {

rotate([0,0,i*(360/num_divisions_around)+j*(degrees_per_y*y_step)])
                   translate([radius*0.7,0,leftover/2 + y_step/2 + j*y_step])
                       rotate([hole_rotation_angle,0,0])
                       rotate([0,90,0])
                           scale([1.5/oval_maj_rad,1,1])

cylinder(h=wall_thick*4+smidgen,r1=oval_maj_rad, r2=oval_maj_rad);
           }

           // The 'odd' row (starts with half oval, but we skip that
in this loop)

           for (j=[0:num_big_ovals-2]) {

rotate([0,0,(i+0.5)*(360/num_divisions_around)+j*(degrees_per_y*y_step)+degrees_per_y*y_step/2])
                   translate([radius*0.7,0,leftover/2 + y_step + j*y_step])
                       rotate([hole_rotation_angle,0,0])
                       rotate([0,90,0])
                           scale([1.5/oval_maj_rad,1,1])

cylinder(h=wall_thick*4+smidgen,r1=oval_maj_rad, r2=oval_maj_rad);
           }

           // here we get the odd half-sized ones on the bottom
           // uses same formula as above, but I simplified couple
terms manually
           rotate([0,0,(i+0.5)*(360/num_divisions_around)-degrees_per_y*y_step/4])
               translate([radius*0.7,0,leftover/2 + y_step/4])
               rotate([hole_rotation_angle,0,0])
               rotate([0,90,0])
               scale([1.5/oval_maj_rad,1/2,1])
               cylinder(h=wall_thick*4+smidgen,r1=oval_maj_rad,
r2=oval_maj_rad);

           // here we get the odd half-sized ones on the top
           // uses same formula as above, but I simplified couple
terms manually

           rotate([0,0,(i+0.5)*(360/num_divisions_around)+(num_big_ovals-1)*(degrees_per_y*y_step)+degrees_per_y*y_step/4])
               translate([radius*0.7,0,leftover/2 + y_step +
(num_big_ovals-1)*y_step - y_step/4])
               rotate([hole_rotation_angle,0,0])
               rotate([0,90,0])
               scale([1.5/oval_maj_rad,1/2,1])
               cylinder(h=wall_thick*4+smidgen,r1=oval_maj_rad,
r2=oval_maj_rad);

       }


On Mon, Oct 24, 2011 at 12:36 AM, Michael Brown
<[hidden email]> wrote:
> I am trying out openscad to make a few things, and I've run up against a
> brick wall in that my designs are previewing, but wont render or stl export
> in a 'reasonable' time. I'm using latest openscad git updated yesterday on a
> Fedora 15 Linux system running quad-core AMD Phenom @3.2Ghz.
> I thought I'd make a mashup of MakeALot's Spiro Coaster and Bracelet V,
> (http://www.thingiverse.com/thing:7361
> and http://www.thingiverse.com/thing:8928). I'm trying to make a container
> using the bracelet design as the sides and spiro coaster design for the
> lid. I merged the scad programs, and basically rewrote a lot of it, so it's
> more 'inspired' by at this point, but it all previews nicely and looks good.
> My problem at this point is that it is taking *forever* to compile, and
> using almost 2GB of ram. I'm trying to figure out why it is taking so long.
>  I've uploaded my code to github
> (https://github.com/superchalupa/container-round-decorative). Attached is
> the main module I've developed.
> For comparison, I've re-compiled MakeALot's bracelet and it compiles in
> about 41 minutes for me. When I redid the same basic bracelet design with my
> code, it literally took 23 hours. The object is fairly simple, so I am at a
> loss as to why it takes so long. It is a torus with about 100 oval holes. At
> first I was specifying $fn variables, but under the assumption that I was
> over-specifying things, I've removed almost all of those. The second thing I
> did was that I was using unit circles and scaling, which ends up using only
> 5 fragments, so I started using larger circles and different scaling factors
> to let openscad choose a more appropriate number of fragments. This has not
> seemed to help.
> Calling my main module with this:
>
> // for my 3 year old (small)
> radius=23;
> bracelet_width=35;
> wall_thick=3;
> hole_len=8;
> distance_between_holes=1;
> hole_rotation_angle = 80;
> num_divisions_around = 16;
> edge_buffer=2;
> holy_squished_hollow_torus(bracelet_width,
>                            radius,
>                            wall_thick,
>                            edge_buffer,
>                            hole_len,
>                            distance_between_holes,
>                            hole_rotation_angle,
>                            num_divisions_around);
>
> Results in this:
> time make bracelet.stl
> openscad -o bracelet.stl bracelet.scad -Dlayout=\"$(basename bracelet.stl
> .stl)\"
> Compiling library
> `/home/michael_e_brown/thingomatic/things/my-designs/box/container_module.scad'.
> Compiling library
> `/home/michael_e_brown/thingomatic/things/my-designs/box/pins.scad'.
> ECHO: "y_step: ", 8.863269777109872
> ECHO: "num big ovals: ", 3
> ECHO: "degrees_per_y", 0.4392519091611444
> ECHO: "leftover", 11
> CGAL Cache insert: group(); (0 verts)
> Number of polygons before reduction: 1
>     ... cut ...
> CGAL Cache insert: group(){group(){multmatrix([[1,0,0,0],[0 (3340 verts)
> CGAL Cache insert: difference(){group(){difference(){group( (26991 verts)
> CGAL Cache insert: group(){group();group();group();group(); (26991 verts)
> CGAL Cache insert: group(){group(){group();group();group(); (26991 verts)
> real 1415m34.047s
> user 1404m59.223s
> sys 0m10.050s
> --
> Michael
>
>
> _______________________________________________
> OpenSCAD mailing list
> [hidden email]
> http://rocklinux.net/mailman/listinfo/openscad
>
>
_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad

Reply | Threaded
Open this post in threaded view
|

Re: slow render, need help

kintel
Administrator
On Oct 26, 2011, at 09:52 AM, Michael Brown wrote:

> Unfortunately, I'm still running into assertion errors and/or crashes.

I've fixed the assertion error. It was a bug in the caching code which was introduced in September.

 -Marius


Reply | Threaded
Open this post in threaded view
|

Re: slow render, need help

Michael Brown
Ok, two things:

1) The assertion error is gone! I can call openscad from the command line to build my stl files.

2) When I try to open up my scad files in openscad gui mode, it *immediately* (within about 5 seconds) consumes all available RAM and gets killed by the OOM killer.

I have tagged the offending code: openscad-memleak

cd container-round-decorative
git checkout openscad-memleak
openscad ./box.scad

I suggest having 'top' running and kill it when you see it get above a couple gigs, or you risk crashing your machine (I've already done that a couple times now).

I tried wrapping the toplevel object with render(), but that didnt help.

--
Michael

On Wed, Oct 26, 2011 at 5:50 PM, Marius Kintel <[hidden email]> wrote:
On Oct 26, 2011, at 09:52 AM, Michael Brown wrote:

> Unfortunately, I'm still running into assertion errors and/or crashes.

I've fixed the assertion error. It was a bug in the caching code which was introduced in September.

 -Marius

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad

Reply | Threaded
Open this post in threaded view
|

Re: slow render, need help

donbright
branch openscad-memleak doesnt appear to be uploaded to github


On Wed, Oct 26, 2011 at 9:31 PM, Michael Brown
<[hidden email]> wrote:

> Ok, two things:
> 1) The assertion error is gone! I can call openscad from the command line to
> build my stl files.
> 2) When I try to open up my scad files in openscad gui mode, it
> *immediately* (within about 5 seconds) consumes all available RAM and gets
> killed by the OOM killer.
> I have tagged the offending code: openscad-memleak
> git clone  git://github.com/superchalupa/container-round-decorative.git
> cd container-round-decorative
> git checkout openscad-memleak
> openscad ./box.scad
> I suggest having 'top' running and kill it when you see it get above a
> couple gigs, or you risk crashing your machine (I've already done that a
> couple times now).
> I tried wrapping the toplevel object with render(), but that didnt help.
> --
> Michael
>
> On Wed, Oct 26, 2011 at 5:50 PM, Marius Kintel <[hidden email]> wrote:
>>
>> On Oct 26, 2011, at 09:52 AM, Michael Brown wrote:
>>
>> > Unfortunately, I'm still running into assertion errors and/or crashes.
>>
>> I've fixed the assertion error. It was a bug in the caching code which was
>> introduced in September.
>>
>>  -Marius
>>
>> _______________________________________________
>> OpenSCAD mailing list
>> [hidden email]
>> http://rocklinux.net/mailman/listinfo/openscad
>
>
> _______________________________________________
> OpenSCAD mailing list
> [hidden email]
> http://rocklinux.net/mailman/listinfo/openscad
>
>

Reply | Threaded
Open this post in threaded view
|

Re: slow render, need help

donbright
i have similar problems.

i was able to debug the scad file a little bit by commenting out a
bunch of 'difference()' lines, reducing $fn to 10, and increasing all
of your basic parameters by a factor of 10 (i.e. box_height=700
instead of 70..... sometimes the drawing code crashes on small decimal
differences that dont exist when you deal with larger numbers. )

anyways, when i add the diff() back in it freezes as described.
running git openscad.

i also run
 nice -n 19 ionice -c 3 openscad
so i am able to kill it without having to hard-reset my machine.

-DB

On Wed, Oct 26, 2011 at 10:03 PM, Don Bright <[hidden email]> wrote:

> branch openscad-memleak doesnt appear to be uploaded to github
>
>
> On Wed, Oct 26, 2011 at 9:31 PM, Michael Brown
> <[hidden email]> wrote:
>> Ok, two things:
>> 1) The assertion error is gone! I can call openscad from the command line to
>> build my stl files.
>> 2) When I try to open up my scad files in openscad gui mode, it
>> *immediately* (within about 5 seconds) consumes all available RAM and gets
>> killed by the OOM killer.
>> I have tagged the offending code: openscad-memleak
>> git clone  git://github.com/superchalupa/container-round-decorative.git
>> cd container-round-decorative
>> git checkout openscad-memleak
>> openscad ./box.scad
>> I suggest having 'top' running and kill it when you see it get above a
>> couple gigs, or you risk crashing your machine (I've already done that a
>> couple times now).
>> I tried wrapping the toplevel object with render(), but that didnt help.
>> --
>> Michael
>>
>> On Wed, Oct 26, 2011 at 5:50 PM, Marius Kintel <[hidden email]> wrote:
>>>
>>> On Oct 26, 2011, at 09:52 AM, Michael Brown wrote:
>>>
>>> > Unfortunately, I'm still running into assertion errors and/or crashes.
>>>
>>> I've fixed the assertion error. It was a bug in the caching code which was
>>> introduced in September.
>>>
>>>  -Marius
>>>
>>> _______________________________________________
>>> OpenSCAD mailing list
>>> [hidden email]
>>> http://rocklinux.net/mailman/listinfo/openscad
>>
>>
>> _______________________________________________
>> OpenSCAD mailing list
>> [hidden email]
>> http://rocklinux.net/mailman/listinfo/openscad
>>
>>
>

Reply | Threaded
Open this post in threaded view
|

Re: slow render, need help

Michael Brown
I did get it to render without crashing, finally, by adding render() to the front of the toplevel object, but that's not exactly a good solution as it takes about 15 minutes to render.

So, is there a bug in openscad that can be fixed?

Regarding "small decimal differences", I tried to make sure that everything (as far as I am able to tell) is at least .1 away from anything else.
--
Michael

On Wed, Oct 26, 2011 at 10:53 PM, Don Bright <[hidden email]> wrote:
i have similar problems.

i was able to debug the scad file a little bit by commenting out a
bunch of 'difference()' lines, reducing $fn to 10, and increasing all
of your basic parameters by a factor of 10 (i.e. box_height=700
instead of 70..... sometimes the drawing code crashes on small decimal
differences that dont exist when you deal with larger numbers. )

anyways, when i add the diff() back in it freezes as described.
running git openscad.

i also run
 nice -n 19 ionice -c 3 openscad
so i am able to kill it without having to hard-reset my machine.

-DB

On Wed, Oct 26, 2011 at 10:03 PM, Don Bright <[hidden email]> wrote:
> branch openscad-memleak doesnt appear to be uploaded to github
>
>
> On Wed, Oct 26, 2011 at 9:31 PM, Michael Brown
> <[hidden email]> wrote:
>> Ok, two things:
>> 1) The assertion error is gone! I can call openscad from the command line to
>> build my stl files.
>> 2) When I try to open up my scad files in openscad gui mode, it
>> *immediately* (within about 5 seconds) consumes all available RAM and gets
>> killed by the OOM killer.
>> I have tagged the offending code: openscad-memleak
>> git clone  git://github.com/superchalupa/container-round-decorative.git
>> cd container-round-decorative
>> git checkout openscad-memleak
>> openscad ./box.scad
>> I suggest having 'top' running and kill it when you see it get above a
>> couple gigs, or you risk crashing your machine (I've already done that a
>> couple times now).
>> I tried wrapping the toplevel object with render(), but that didnt help.
>> --
>> Michael
>>
>> On Wed, Oct 26, 2011 at 5:50 PM, Marius Kintel <[hidden email]> wrote:
>>>
>>> On Oct 26, 2011, at 09:52 AM, Michael Brown wrote:
>>>
>>> > Unfortunately, I'm still running into assertion errors and/or crashes.
>>>
>>> I've fixed the assertion error. It was a bug in the caching code which was
>>> introduced in September.
>>>
>>>  -Marius
>>>
>>> _______________________________________________
>>> OpenSCAD mailing list
>>> [hidden email]
>>> http://rocklinux.net/mailman/listinfo/openscad
>>
>>
>> _______________________________________________
>> OpenSCAD mailing list
>> [hidden email]
>> http://rocklinux.net/mailman/listinfo/openscad
>>
>>
>
_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad

Reply | Threaded
Open this post in threaded view
|

Re: slow render, need help

Michael Brown
I finally figured out what was causing the incredible memory fail.

I had a cube sitting on the XY plane being differenced with a torus that was tangent to the XY plane. That seemed to intermittently cause the problem. When I translated the torus down 0.1, everything works reliably now.
--
Michael

On Thu, Oct 27, 2011 at 12:14 AM, Michael Brown <[hidden email]> wrote:
I did get it to render without crashing, finally, by adding render() to the front of the toplevel object, but that's not exactly a good solution as it takes about 15 minutes to render.

So, is there a bug in openscad that can be fixed?

Regarding "small decimal differences", I tried to make sure that everything (as far as I am able to tell) is at least .1 away from anything else.
--
Michael


On Wed, Oct 26, 2011 at 10:53 PM, Don Bright <[hidden email]> wrote:
i have similar problems.

i was able to debug the scad file a little bit by commenting out a
bunch of 'difference()' lines, reducing $fn to 10, and increasing all
of your basic parameters by a factor of 10 (i.e. box_height=700
instead of 70..... sometimes the drawing code crashes on small decimal
differences that dont exist when you deal with larger numbers. )

anyways, when i add the diff() back in it freezes as described.
running git openscad.

i also run
 nice -n 19 ionice -c 3 openscad
so i am able to kill it without having to hard-reset my machine.

-DB

On Wed, Oct 26, 2011 at 10:03 PM, Don Bright <[hidden email]> wrote:
> branch openscad-memleak doesnt appear to be uploaded to github
>
>
> On Wed, Oct 26, 2011 at 9:31 PM, Michael Brown
> <[hidden email]> wrote:
>> Ok, two things:
>> 1) The assertion error is gone! I can call openscad from the command line to
>> build my stl files.
>> 2) When I try to open up my scad files in openscad gui mode, it
>> *immediately* (within about 5 seconds) consumes all available RAM and gets
>> killed by the OOM killer.
>> I have tagged the offending code: openscad-memleak
>> git clone  git://github.com/superchalupa/container-round-decorative.git
>> cd container-round-decorative
>> git checkout openscad-memleak
>> openscad ./box.scad
>> I suggest having 'top' running and kill it when you see it get above a
>> couple gigs, or you risk crashing your machine (I've already done that a
>> couple times now).
>> I tried wrapping the toplevel object with render(), but that didnt help.
>> --
>> Michael
>>
>> On Wed, Oct 26, 2011 at 5:50 PM, Marius Kintel <[hidden email]> wrote:
>>>
>>> On Oct 26, 2011, at 09:52 AM, Michael Brown wrote:
>>>
>>> > Unfortunately, I'm still running into assertion errors and/or crashes.
>>>
>>> I've fixed the assertion error. It was a bug in the caching code which was
>>> introduced in September.
>>>
>>>  -Marius
>>>
>>> _______________________________________________
>>> OpenSCAD mailing list
>>> [hidden email]
>>> http://rocklinux.net/mailman/listinfo/openscad
>>
>>
>> _______________________________________________
>> OpenSCAD mailing list
>> [hidden email]
>> http://rocklinux.net/mailman/listinfo/openscad
>>
>>
>
_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad