[OpenSCAD] slow render, need help

Don Bright hugh.m.bright at gmail.com
Wed Oct 26 01:10:16 CEST 2011


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
<mebrown at michaels-house.net> 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
> OpenSCAD at rocklinux.org
> http://rocklinux.net/mailman/listinfo/openscad
>
>


More information about the OpenSCAD mailing list